提交 1bf8fe5d authored 作者: fit2cloud-chenyw's avatar fit2cloud-chenyw

fix: 组织管理查询功能

上级 d6f799ae
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
import LayoutContent from '@/components/business/LayoutContent' import LayoutContent from '@/components/business/LayoutContent'
import TreeTable from '@/components/business/tree-table' import TreeTable from '@/components/business/tree-table'
import Treeselect from '@riophae/vue-treeselect' 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 '@riophae/vue-treeselect/dist/vue-treeselect.css'
import { LOAD_CHILDREN_OPTIONS, LOAD_ROOT_OPTIONS } from '@riophae/vue-treeselect' import { LOAD_CHILDREN_OPTIONS, LOAD_ROOT_OPTIONS } from '@riophae/vue-treeselect'
import { checkPermission } from '@/utils/permission' import { checkPermission } from '@/utils/permission'
...@@ -149,10 +149,9 @@ export default { ...@@ -149,10 +149,9 @@ export default {
], ],
searchConfig: { searchConfig: {
useQuickSearch: true, useQuickSearch: true,
useComplexSearch: false,
quickPlaceholder: '按名称搜索', quickPlaceholder: '按名称搜索',
components: [ components: [
{ field: 'name', label: this.$t('organization.name'), component: 'FuComplexInput' }
] ]
}, },
...@@ -260,17 +259,18 @@ export default { ...@@ -260,17 +259,18 @@ export default {
}, },
// 加载表格数据 // 加载表格数据
search(condition) { search(condition) {
// this.setTableAttr() condition = formatQuickCondition(condition, 'name')
let conditionExist = false
const temp = formatCondition(condition)
this.tableData = [] this.tableData = []
let param = {} let param = {}
if (condition && condition.quick) { if (temp && temp.conditions && temp.conditions.length !== 0) {
const con = this.quick_condition(condition) conditionExist = true
param = formatCondition(con) param = temp
} else { } else {
param = { conditions: [this.defaultCondition] } param = { conditions: [this.defaultCondition] }
} }
// param.conditions.push(this.defaultCondition)
loadTable(param).then(res => { loadTable(param).then(res => {
let data = res.data let data = res.data
data = data.map(obj => { data = data.map(obj => {
...@@ -280,11 +280,15 @@ export default { ...@@ -280,11 +280,15 @@ export default {
return obj return obj
}) })
if (condition && condition.quick) { if (conditionExist) {
data = this.buildTree(data) data = this.buildTree(data)
// this.setTableAttr(true)
} }
this.tableData = data this.tableData = data
this.$nextTick(() => {
this.tableData.forEach(node => {
this.$refs.table.toggleRowExpansion(node, conditionExist)
})
})
this.depts = null this.depts = null
}) })
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论