|
@@ -3,7 +3,7 @@ defineOptions({
|
|
|
// name 作为一种规范最好必须写上并且和路由的name保持一致
|
|
|
name: "prosonDepartment"
|
|
|
});
|
|
|
-import { ref, reactive, watch } from "vue";
|
|
|
+import { ref, reactive, watch, nextTick } from "vue";
|
|
|
import { ElMessageBox, ElMessage } from "element-plus";
|
|
|
import { Search } from "@element-plus/icons-vue";
|
|
|
import prosonEditDrawer from "./components/prosonEditDrawer.vue";
|
|
@@ -14,6 +14,8 @@ import changeRole from "./components/changeRole.vue";
|
|
|
import { postListTree, postDelDept } from "@/api/department";
|
|
|
import { postOrganizationUserPage, getDeleteUserApi } from "@/api/userSetting";
|
|
|
import UserPageTable from "@/components/UserPageTable/index.vue";
|
|
|
+import { Plus } from "@element-plus/icons-vue";
|
|
|
+
|
|
|
// 添加部门
|
|
|
const newDepartmentRef = ref(null);
|
|
|
const newDepartmentShow = ref(false);
|
|
@@ -53,7 +55,13 @@ const postListTreeApi = async () => {
|
|
|
const { code, data } = await postListTree();
|
|
|
if (code == 200) {
|
|
|
console.log(data);
|
|
|
+ if (data && data.length) {
|
|
|
+ data[0].id = 1;
|
|
|
+ }
|
|
|
dataTree.value = data;
|
|
|
+ nextTick(() => {
|
|
|
+ handleNodeClick(dataTree.value[0]);
|
|
|
+ });
|
|
|
}
|
|
|
};
|
|
|
postListTreeApi();
|
|
@@ -173,6 +181,7 @@ watch(realName, val => {
|
|
|
<prosonEditDrawer
|
|
|
ref="prosonEditDrawerRef"
|
|
|
v-model="prosonEditDrawerShow"
|
|
|
+ @handleClick="postListTreeApi"
|
|
|
/>
|
|
|
<!-- 添加部门 -->
|
|
|
<newDepartment
|
|
@@ -216,7 +225,9 @@ watch(realName, val => {
|
|
|
<span>{{ node.label }}</span>
|
|
|
<el-dropdown trigger="click" @click.stop>
|
|
|
<span>
|
|
|
- <el-icon><Operation /></el-icon>
|
|
|
+ <el-icon>
|
|
|
+ <Operation />
|
|
|
+ </el-icon>
|
|
|
</span>
|
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu class="setting">
|
|
@@ -253,8 +264,9 @@ watch(realName, val => {
|
|
|
class="w-full mt-4"
|
|
|
type="primary"
|
|
|
plain
|
|
|
+ :icon="Plus"
|
|
|
@click="addDepartment"
|
|
|
- >添加部门</el-button
|
|
|
+ >新增部门</el-button
|
|
|
>
|
|
|
</Auth>
|
|
|
</div>
|
|
@@ -268,11 +280,15 @@ watch(realName, val => {
|
|
|
<template #actions="{ row }">
|
|
|
<Auth :value="['编辑成员']">
|
|
|
<el-dropdown trigger="click" class="mr-2">
|
|
|
- <el-icon @click="personDetails(row)"><View /></el-icon>
|
|
|
+ <el-icon @click="personDetails(row)">
|
|
|
+ <View />
|
|
|
+ </el-icon>
|
|
|
</el-dropdown>
|
|
|
</Auth>
|
|
|
<el-dropdown trigger="click">
|
|
|
- <el-icon><Operation /></el-icon>
|
|
|
+ <el-icon>
|
|
|
+ <Operation />
|
|
|
+ </el-icon>
|
|
|
<template #dropdown>
|
|
|
<el-dropdown-menu class="setting">
|
|
|
<Auth :value="['删除成员']">
|
|
@@ -309,6 +325,7 @@ watch(realName, val => {
|
|
|
height: 100%;
|
|
|
padding: 10px 20px;
|
|
|
}
|
|
|
+
|
|
|
// ::v-deep .el-dropdown {
|
|
|
// line-height: 1;
|
|
|
// }
|