fix: bug#10992
This commit is contained in:
parent
1455fe8141
commit
b8d0fd5bcf
|
@ -86,14 +86,14 @@ import { queryPlatformNoPage, _import ,exportCard} from '@/api/iot-card/cardMana
|
|||
import { message } from 'jetlinks-ui-components';
|
||||
|
||||
|
||||
const emit = defineEmits(['close']);
|
||||
const emit = defineEmits(['close', 'save']);
|
||||
|
||||
const configList = ref<Record<string, any>[]>([]);
|
||||
const loading = ref<boolean>(false);
|
||||
const totalCount = ref<number>(0);
|
||||
const errCount = ref<number>(0);
|
||||
const formRef = ref(null)
|
||||
|
||||
const importStatus = ref(false)
|
||||
const modelRef = reactive({
|
||||
configId: undefined,
|
||||
upload: [],
|
||||
|
@ -132,6 +132,7 @@ const fileChange = (info: any) => {
|
|||
_import(modelRef.configId, { fileUrl: r.result })
|
||||
.then((resp: any) => {
|
||||
totalCount.value = resp.result.total;
|
||||
importStatus.value = true
|
||||
message.success('导入成功')
|
||||
})
|
||||
.catch((err) => {
|
||||
|
@ -164,7 +165,12 @@ const handleCancel = () => {
|
|||
totalCount.value = 0;
|
||||
errCount.value = 0;
|
||||
modelRef.configId = undefined;
|
||||
|
||||
emit('close', true);
|
||||
if (importStatus.value) {
|
||||
emit('save', true)
|
||||
}
|
||||
importStatus.value = false
|
||||
};
|
||||
|
||||
const handleOk = () => {
|
||||
|
|
|
@ -370,7 +370,7 @@
|
|||
</template>
|
||||
</j-pro-table>
|
||||
<!-- 批量导入 -->
|
||||
<Import v-if="importVisible" @close="importVisible = false" />
|
||||
<Import v-if="importVisible" @close="importVisible = false" @save="importSave"/>
|
||||
<!-- 批量导出 -->
|
||||
<Export
|
||||
v-if="exportVisible"
|
||||
|
@ -588,6 +588,11 @@ const columns = [
|
|||
},
|
||||
];
|
||||
|
||||
const importSave = () => {
|
||||
cardManageRef.value?.reload()
|
||||
importVisible.value = false
|
||||
}
|
||||
|
||||
const getActions = (
|
||||
data: Partial<Record<string, any>>,
|
||||
type: 'card' | 'table',
|
||||
|
|
Loading…
Reference in New Issue