提交 c63df3f7 authored 作者: lidongxu's avatar lidongxu

refactor(dept): 部门默认展开第一级

同上
上级 89f60d93
......@@ -295,5 +295,4 @@ getList()
}
}
}
</style>
\ No newline at end of file
......@@ -58,6 +58,7 @@
:data="deptList"
row-key="deptId"
:default-expand-all="isExpandAll"
:expand-row-keys="defaultExpandList"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
<el-table-column prop="deptName"
label="部门名称"
......@@ -202,8 +203,9 @@
const showSearch = ref(true);
const title = ref("");
const deptOptions = ref([]);
const isExpandAll = ref(true);
const isExpandAll = ref(false);
const refreshTable = ref(true);
const defaultExpandList = ref([1]) // 默认展开的节点 keys 集合
const data = reactive({
form: {},
......@@ -228,6 +230,7 @@
listDept(queryParams.value).then(response => {
deptList.value = proxy.handleTree(response.data, "deptId");
defaultExpandList.value.push(response.data[0].deptId + '')
loading.value = false;
});
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论