fixed: Fixed export module default options

This commit is contained in:
zhaojisen 2024-06-18 18:02:20 +08:00
parent eba323fb64
commit 5dcdbb702f
4 changed files with 38 additions and 10 deletions

View File

@ -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

View File

@ -2,11 +2,13 @@
<div>
<ActionsGroup :actions="rightSideActions" :is-fa="true" class="right-side-actions right-side-item" />
<ImExportDialog
v-if="dialogExportVisible"
:export-options="iExportOptions"
:import-options="iImportOptions"
:selected-rows="selectedRows"
v-bind="$attrs"
@importDialogClose="onImportDialogClose"
@importDialogConfirm="onImportDialogConfirm"
/>
</div>
</template>
@ -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()
}
}

View File

@ -15,6 +15,3 @@ export default {
}
}
</script>
<style>
</style>

View File

@ -12,6 +12,7 @@
@showAll="showAll"
/>
<BaseList
ref="baseList"
slot="table"
:add-extra-more-actions="addExtraMoreActions"
:header-actions="headerActions"
@ -66,6 +67,11 @@ export default {
mounted() {
this.treeRef = this.$refs.AssetTreeTable.$refs.TreeList
},
activated() {
setTimeout(() => {
this.$refs.baseList.$refs.ListTable.reloadTable()
}, 500)
},
methods: {
decorateRMenu() {
const show_current_asset = this.$cookie.get('show_current_asset') || '0'