From 5dcdbb702f6e18239f552131cf6e721198371baf Mon Sep 17 00:00:00 2001 From: zhaojisen <1301338853@qq.com> Date: Tue, 18 Jun 2024 18:02:20 +0800 Subject: [PATCH] fixed: Fixed export module default options --- .../ListTable/TableAction/ExportDialog.vue | 18 +++++++++++----- .../Table/ListTable/TableAction/RightSide.vue | 21 +++++++++++++++++-- .../AssetCreateUpdate/HostCreateUpdate.vue | 3 --- src/views/assets/Asset/AssetList/AllList.vue | 6 ++++++ 4 files changed, 38 insertions(+), 10 deletions(-) diff --git a/src/components/Table/ListTable/TableAction/ExportDialog.vue b/src/components/Table/ListTable/TableAction/ExportDialog.vue index 9004275c0..a0ea17754 100644 --- a/src/components/Table/ListTable/TableAction/ExportDialog.vue +++ b/src/components/Table/ListTable/TableAction/ExportDialog.vue @@ -145,7 +145,7 @@ export default { { label: this.$t('ExportOnlySelectedItems'), value: 'selected', - can: this.selectedRows.length > 0 && this.canExportSelected + can: this.hasSelected && this.canExportSelected }, { label: this.$t('ExportOnlyFiltered'), @@ -180,6 +180,15 @@ export default { showExportDialog() { if (!this.mfaVerifyRequired) { this.exportDialogShow = true + + if (this.hasSelected) { + this.exportOption = 'selected' + } + + if (this.tableHasQuery) { + this.exportOption = 'filtered' + } + return } this.$axios.get('/api/v1/authentication/confirm/check/?confirm_type=mfa').then(() => { @@ -221,12 +230,11 @@ export default { async handleExportConfirm() { await this.handleExport() this.exportDialogShow = false + this.$emit('importDialogConfirm') }, handleExportCancel() { - const vm = this - setTimeout(() => { - vm.exportDialogShow = false - }, 100) + this.exportDialogShow = false + this.$emit('importDialogClose') }, handleAuthMFAError() { this.mfaDialogShow = false diff --git a/src/components/Table/ListTable/TableAction/RightSide.vue b/src/components/Table/ListTable/TableAction/RightSide.vue index 93aa55bd6..8ef8fd46f 100644 --- a/src/components/Table/ListTable/TableAction/RightSide.vue +++ b/src/components/Table/ListTable/TableAction/RightSide.vue @@ -2,11 +2,13 @@
@@ -40,7 +42,10 @@ export default { default: function({ selectedRows }) { const { exportOptions, tableUrl } = this const url = exportOptions?.url ? exportOptions.url : tableUrl - this.$eventBus.$emit('showExportDialog', { selectedRows, url, name: this.name }) + this.dialogExportVisible = true + this.$nextTick(() => { + this.$eventBus.$emit('showExportDialog', { selectedRows, url, name: this.name }) + }) } }, hasImport: defaultTrue, @@ -53,7 +58,10 @@ export default { default: function({ selectedRows }) { const { importOptions, tableUrl } = this const url = importOptions?.url ? importOptions.url : tableUrl - this.$eventBus.$emit('showImportDialog', { selectedRows, url, name: this.name }) + this.dialogExportVisible = true + this.$nextTick(() => { + this.$eventBus.$emit('showImportDialog', { selectedRows, url, name: this.name }) + }) } }, hasColumnSetting: defaultTrue, @@ -156,6 +164,15 @@ export default { }, onImportDialogClose() { this.$emit('importDialogClose') + setTimeout(() => { + this.dialogExportVisible = false + }, 100) + }, + onImportDialogConfirm() { + this.$emit('importDialogClose') + setTimeout(() => { + this.dialogExportVisible = false + }, 100) this.reloadTable() } } diff --git a/src/views/assets/Asset/AssetCreateUpdate/HostCreateUpdate.vue b/src/views/assets/Asset/AssetCreateUpdate/HostCreateUpdate.vue index 7629d3723..74344c421 100644 --- a/src/views/assets/Asset/AssetCreateUpdate/HostCreateUpdate.vue +++ b/src/views/assets/Asset/AssetCreateUpdate/HostCreateUpdate.vue @@ -15,6 +15,3 @@ export default { } } - - diff --git a/src/views/assets/Asset/AssetList/AllList.vue b/src/views/assets/Asset/AssetList/AllList.vue index 84506ac8c..1bb5b045f 100644 --- a/src/views/assets/Asset/AssetList/AllList.vue +++ b/src/views/assets/Asset/AssetList/AllList.vue @@ -12,6 +12,7 @@ @showAll="showAll" /> { + this.$refs.baseList.$refs.ListTable.reloadTable() + }, 500) + }, methods: { decorateRMenu() { const show_current_asset = this.$cookie.get('show_current_asset') || '0'