|
@@ -63,6 +63,7 @@ import {
|
|
addSystemUserMenu,
|
|
addSystemUserMenu,
|
|
systemMenuList,
|
|
systemMenuList,
|
|
systemUserMenuList,
|
|
systemUserMenuList,
|
|
|
|
+ treeList,
|
|
} from "@/api/user/index";
|
|
} from "@/api/user/index";
|
|
|
|
|
|
// 传入一个url,后面不带/
|
|
// 传入一个url,后面不带/
|
|
@@ -77,9 +78,13 @@ const { checkBtnPerm, downloadTemplate, exportData } = Utils; //按钮权限等
|
|
|
|
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
const crudRef = ref(null); //crudRef.value 获取avue-crud对象
|
|
|
|
|
|
-onMounted(() => {
|
|
|
|
- dataList();
|
|
|
|
-});
|
|
|
|
|
|
+const deptList = ref([]); //部门列表
|
|
|
|
+const getDeptList = async () => {
|
|
|
|
+ let res = await treeList();
|
|
|
|
+ if (res && res.code == 200) {
|
|
|
|
+ deptList.value = res.data ?? []; //获取部门列表
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
|
|
// 设置表格列或者其他自定义的option
|
|
// 设置表格列或者其他自定义的option
|
|
option.value = Object.assign(option.value, {
|
|
option.value = Object.assign(option.value, {
|
|
@@ -113,7 +118,6 @@ option.value = Object.assign(option.value, {
|
|
],
|
|
],
|
|
search: true,
|
|
search: true,
|
|
},
|
|
},
|
|
-
|
|
|
|
{
|
|
{
|
|
label: "账号",
|
|
label: "账号",
|
|
prop: "userName",
|
|
prop: "userName",
|
|
@@ -168,6 +172,22 @@ option.value = Object.assign(option.value, {
|
|
value: 0,
|
|
value: 0,
|
|
},
|
|
},
|
|
{
|
|
{
|
|
|
|
+ label: "部门名称",
|
|
|
|
+ prop: "deptIds",
|
|
|
|
+ type: "tree",
|
|
|
|
+ dicData: deptList, // 使用树形结构数据
|
|
|
|
+ props: {
|
|
|
|
+ label: "deptName", // 显示的字段
|
|
|
|
+ value: "id", // 传递给后端的字段
|
|
|
|
+ children: "children", // 子节点字段
|
|
|
|
+ },
|
|
|
|
+ checkStrictly: true,
|
|
|
|
+ multiple: true, // 支持多选
|
|
|
|
+ showCheckbox: true, // 显示复选框
|
|
|
|
+ search: true,
|
|
|
|
+ valueformat: "array", // 确保值是数组格式
|
|
|
|
+ },
|
|
|
|
+ {
|
|
label: "操作",
|
|
label: "操作",
|
|
prop: "menu",
|
|
prop: "menu",
|
|
span: 24,
|
|
span: 24,
|
|
@@ -214,4 +234,9 @@ const toggleCheckAll = () => {
|
|
const resetChecked = () => {
|
|
const resetChecked = () => {
|
|
treeRef.value.setCheckedKeys([], false);
|
|
treeRef.value.setCheckedKeys([], false);
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+onMounted(() => {
|
|
|
|
+ getDeptList(); //获取部门列表
|
|
|
|
+ dataList();
|
|
|
|
+});
|
|
</script>
|
|
</script>
|