处理弹窗中loading的加载问题

获取普文件列表接口参数调整
This commit is contained in:
renpy 2023-09-07 15:13:51 +08:00
parent 2eb703e2ac
commit da3e09e847

View File

@ -52,42 +52,42 @@
<!-- 底部按钮结束 -->
</custom-modal>
<a-modal v-model="visible_file" :width="1200" title="File List" @cancel="cancelFileModale">
<div style="position: relative;padding-bottom: 40px;height: 460px;overflow: hidden;">
<a-table
v-if="tableType=='multiple'"
:data-source="list_file"
:columns="columns_file"
:loading="loading_file"
:pagination="false"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
>
</a-table>
<custom-table
v-if="tableType=='single'"
rowKey="id"
size="middle"
:columns="columns_file"
:list="list_file"
:pagination="false"
:loading="loading_file_edit"
:selectedRowKeys.sync="selectedRowKeys_edit"
:selectionRows.sync="selectionRows_edit"
>
</custom-table>
<a-pagination
size="small"
v-model="ipagination.current"
:pageSize="ipagination.pageSize"
:page-size-options="ipagination.pageSizeOptions"
show-size-changer
show-quick-jumper
:total="ipagination.total"
:show-total="(total, range) => `Total ${total} items Page ${ipagination.current} / ${Math.ceil(total / ipagination.pageSize)}`"
show-less-items
@change="handlePageChange"
@showSizeChange="handleSizeChange"
/>
</div>
<a-spin :spinning="loading_file">
<div style="position: relative;padding-bottom: 40px;height: 460px;overflow: hidden;">
<a-table
v-if="tableType=='multiple'"
:data-source="list_file"
:columns="columns_file"
:pagination="false"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
>
</a-table>
<custom-table
v-if="tableType=='single'"
rowKey="id"
size="middle"
:columns="columns_file"
:list="list_file"
:pagination="false"
:selectedRowKeys.sync="selectedRowKeys_edit"
:selectionRows.sync="selectionRows_edit"
>
</custom-table>
<a-pagination
size="small"
v-model="ipagination.current"
:pageSize="ipagination.pageSize"
:page-size-options="ipagination.pageSizeOptions"
show-size-changer
show-quick-jumper
:total="ipagination.total"
:show-total="(total, range) => `Total ${total} items Page ${ipagination.current} / ${Math.ceil(total / ipagination.pageSize)}`"
show-less-items
@change="handlePageChange"
@showSizeChange="handleSizeChange"
/>
</div>
</a-spin>
<template slot="footer">
<a-space class="operators" :size="20">
<a-button type="success" @click="saveFileName">Save</a-button>
@ -200,7 +200,6 @@ export default {
uploading: false,
currRowData: {},
currFileType: "_S_",
loading_file_edit: false,
selectedRowKeys_edit: [],
selectionRows_edit: [],
tableType: "multiple"
@ -231,13 +230,21 @@ export default {
},
getSpectrumFile(params) {
this.loading_file = true
getAction("/spectrumFile/get", params).then(res => {
let params_arg = {}
if (this.tableType==="multiple") {
params_arg = {...params}
} else {
params_arg = {...params,name:this.currFileType}
}
getAction("/spectrumFile/get", params_arg).then(res => {
this.loading_file = false
if (res.success) {
res.result.records.forEach((item,index) => {
item.id = index
})
this.ipagination.total = res.result.total
this.ipagination.current = res.result.current
this.ipagination.pageSize = res.result.size
this.list_file = res.result.records
} else {
this.$message.warning("This operation fails. Contact your system administrator")