From 1bf8fe5dff329aeef36bf17e766c9b3f93aa388d Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 19 May 2021 17:50:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=BB=84=E7=BB=87=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/system/dept/index.vue | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/frontend/src/views/system/dept/index.vue b/frontend/src/views/system/dept/index.vue index 81991a62bf..cf93cdd55f 100644 --- a/frontend/src/views/system/dept/index.vue +++ b/frontend/src/views/system/dept/index.vue @@ -93,7 +93,7 @@ import LayoutContent from '@/components/business/LayoutContent' import TreeTable from '@/components/business/tree-table' import Treeselect from '@riophae/vue-treeselect' -import { formatCondition } from '@/utils/index' +import { formatCondition, formatQuickCondition } from '@/utils/index' import '@riophae/vue-treeselect/dist/vue-treeselect.css' import { LOAD_CHILDREN_OPTIONS, LOAD_ROOT_OPTIONS } from '@riophae/vue-treeselect' import { checkPermission } from '@/utils/permission' @@ -149,10 +149,9 @@ export default { ], searchConfig: { useQuickSearch: true, - useComplexSearch: false, quickPlaceholder: '按名称搜索', components: [ - + { field: 'name', label: this.$t('organization.name'), component: 'FuComplexInput' } ] }, @@ -260,17 +259,18 @@ export default { }, // 加载表格数据 search(condition) { - // this.setTableAttr() + condition = formatQuickCondition(condition, 'name') + let conditionExist = false + const temp = formatCondition(condition) this.tableData = [] let param = {} - if (condition && condition.quick) { - const con = this.quick_condition(condition) - param = formatCondition(con) + if (temp && temp.conditions && temp.conditions.length !== 0) { + conditionExist = true + param = temp } else { param = { conditions: [this.defaultCondition] } } - // param.conditions.push(this.defaultCondition) loadTable(param).then(res => { let data = res.data data = data.map(obj => { @@ -280,11 +280,15 @@ export default { return obj }) - if (condition && condition.quick) { + if (conditionExist) { data = this.buildTree(data) - // this.setTableAttr(true) } this.tableData = data + this.$nextTick(() => { + this.tableData.forEach(node => { + this.$refs.table.toggleRowExpansion(node, conditionExist) + }) + }) this.depts = null }) },