diff --git a/src/components/Table/ListTable/TableAction/index.vue b/src/components/Table/ListTable/TableAction/index.vue index 5d6ac2ded..e5f3ccc91 100644 --- a/src/components/Table/ListTable/TableAction/index.vue +++ b/src/components/Table/ListTable/TableAction/index.vue @@ -124,6 +124,9 @@ export default { return this.iHasLeftActions ? 'right' : 'left' } }, + created() { + this.$emit('done') + }, methods: { handleTagSearch(val) { this.searchTable(val) diff --git a/src/components/Table/ListTable/index.vue b/src/components/Table/ListTable/index.vue index ff96ff5d8..26981f8d6 100644 --- a/src/components/Table/ListTable/index.vue +++ b/src/components/Table/ListTable/index.vue @@ -8,9 +8,11 @@ :selected-rows="selectedRows" :table-url="tableUrl" v-bind="iHeaderActions" + @done="handleActionInitialDone" /> { + this.actionInit = true + }, 100) + }, handleSelectionChange(val) { this.selectedRows = val }, reloadTable() { this.dataTable?.getList() }, + updateInitQuery(attrs) { + if (!this.actionInit) { + this.initQuery = attrs + for (const key in attrs) { + this.$set(this.extraQuery, key, attrs[key]) + } + return true + } + const removeKeys = Object.keys(this.initQuery).filter(key => !attrs[key]) + for (const key of removeKeys) { + this.$delete(this.extraQuery, key) + } + }, search(attrs) { + const init = this.updateInitQuery(attrs) + if (init) { + return + } this.$log.debug('ListTable: search table', attrs) this.$emit('TagSearch', attrs) this.$refs.dataTable?.$refs.dataTable?.search(attrs, true)