Bläddra i källkod

fix: 云效bug

“ystl_myq” 6 månader sedan
förälder
incheckning
ec8939dc3e

+ 10 - 0
src/api/userSetting.ts

@@ -34,6 +34,16 @@ export const postOrganizationUserPage = data => {
 export const postAssignmentUser = data => {
   return http.request<addDept>("post", "/user/assignmentUser", { data });
 };
+export const postAssignmentUserApi = async (data, pageList) => {
+  const { code, msg } = await postAssignmentUser(data);
+  if (code === 200) {
+    ElMessage.success("移除成功");
+    pageList();
+  } else {
+    console.log(msg);
+    // ElMessage.error(msg);
+  }
+};
 // 删除用户
 export const getDeleteUser = params => {
   return http.request<addDept>("get", "/user/deleteUser", { params });

+ 4 - 4
src/views/background/framework/roles/components/addPerson.vue

@@ -49,10 +49,10 @@ const postAssignmentUserApi = async () => {
     $emit("handeClick");
     dialogVisibleAdd.value = false;
   } else {
-    ElMessage({
-      message: msg,
-      type: "error"
-    });
+    // ElMessage({
+    //   message: msg,
+    //   type: "error"
+    // });
   }
 };
 // 树选择

+ 33 - 3
src/views/background/framework/roles/rolePower.vue

@@ -8,7 +8,7 @@ import { ElMessageBox, ElMessage } from "element-plus";
 import { Search } from "@element-plus/icons-vue";
 import addRole from "./components/addRole.vue";
 import addPerson from "./components/addPerson.vue";
-import { getDeleteUserApi } from "@/api/userSetting";
+import { getDeleteUserApi, postAssignmentUserApi } from "@/api/userSetting";
 import {
   getMenuList,
   getMenuListCodeForRole,
@@ -97,11 +97,17 @@ const bgColor = ref(null);
 onMounted(() => {
   postPageRoleApi();
   setTimeout(() => {
+    formLink.targetCodes = [];
+    formLink.targetCodes.push(rolesList.data[0]?.roleCode);
     bgColor.value = rolesList.data[0]?.roleCode;
     paramsPageUser.roleName = rolesList.data[0]?.roleName;
     paramsPageUser.roleCode = rolesList.data[0]?.roleCode;
     rolesList.rolesName = rolesList.data[0]?.roleName;
+    Object.assign(rolesList.addPerson, rolesList.data[0]);
+    getMenuListApi();
     postPageUserByRoleApi();
+    getUserPermissionsByRoleCodeApi(rolesList.data[0]?.roleCode);
+    getMenuListCodeForRoleApi(rolesList.data[0]);
   }, 500);
 });
 const lookRoles = item => {
@@ -109,6 +115,9 @@ const lookRoles = item => {
   paramsPageUser.roleCode = item.roleCode;
   bgColor.value = item.roleCode;
   rolesList.rolesName = item.roleName;
+  // 取消关联
+  formLink.targetCodes = [];
+  formLink.targetCodes.push(item.roleCode);
   Object.assign(rolesList.addPerson, item);
   getMenuListApi();
   postPageUserByRoleApi();
@@ -145,6 +154,19 @@ const postDelRoleApi = async item => {
       type: "success"
     });
     postPageRoleApi();
+    setTimeout(() => {
+      formLink.targetCodes = [];
+      formLink.targetCodes.push(rolesList.data[0]?.roleCode);
+      bgColor.value = rolesList.data[0]?.roleCode;
+      paramsPageUser.roleName = rolesList.data[0]?.roleName;
+      paramsPageUser.roleCode = rolesList.data[0]?.roleCode;
+      rolesList.rolesName = rolesList.data[0]?.roleName;
+      Object.assign(rolesList.addPerson, rolesList.data[0]);
+      getMenuListApi();
+      postPageUserByRoleApi();
+      getUserPermissionsByRoleCodeApi(rolesList.data[0]?.roleCode);
+      getMenuListCodeForRoleApi(rolesList.data[0]);
+    }, 500);
   }
 };
 const deleteRole = item => {
@@ -167,9 +189,15 @@ const deleteRole = item => {
 };
 // 标签选择
 const activeName = ref("first");
-
+const formLink = reactive({
+  sourceCodes: [],
+  targetCodes: [],
+  linkAction: "unlink",
+  correlatedModel: "userRole"
+});
 // 添加角色组人员
 const AddRolesPerson = () => {
+  formLink.sourceCodes = [];
   if (rolesList.rolesName) {
     addPersonRef.value.open(rolesList.addPerson);
     addPersonShow.value = true;
@@ -187,7 +215,9 @@ const deltetePerson = item => {
     }
   )
     .then(() => {
-      getDeleteUserApi(item.userCode, postPageUserByRoleApi);
+      // getDeleteUserApi(item.userCode, postPageUserByRoleApi);
+      formLink.sourceCodes.push(item.userCode);
+      postAssignmentUserApi(formLink, postPageUserByRoleApi);
     })
     .catch(() => {
       // catch error

+ 10 - 4
src/views/background/framework/users/components/addUsers.vue

@@ -16,7 +16,7 @@ const form = reactive({
 });
 const rolesList = reactive({
   list: [],
-  rolesName: "",
+  rolesName: [],
   assignmentParams: {
     sourceCodes: [],
     targetCodes: [],
@@ -25,6 +25,9 @@ const rolesList = reactive({
   }
 });
 const postAddUserGroupApi = async () => {
+  rolesList.assignmentParams.targetCodes = [
+    ...new Set(rolesList.assignmentParams.targetCodes)
+  ];
   const { code, msg } =
     dialogTitle.value == "新建用户组"
       ? await postAddUserGroup(form)
@@ -46,6 +49,7 @@ const postAddUserGroupApi = async () => {
   } else {
     // ElMessage.error(msg);
   }
+  rolesList.assignmentParams.targetCodes = [];
 };
 const handleClose = () => {
   dialogVisibleAdd.value = false;
@@ -64,8 +68,9 @@ const rolesData = async () => {
   }
 };
 const changeRoles = () => {
-  rolesList.assignmentParams.targetCodes = [];
-  rolesList.assignmentParams.targetCodes.push(rolesList.rolesName);
+  // rolesList.assignmentParams.targetCodes = [];
+  rolesList.assignmentParams.targetCodes.push(...rolesList.rolesName);
+  // console.log("123123",rolesList.rolesName)
   // rolesList.assignmentParams.sourceCodes = [];
   // rolesList.assignmentParams.sourceCodes.push(rolesList.rolesName);
 };
@@ -93,7 +98,7 @@ const open = item => {
       hospitalCode: "",
       leaderCode: ""
     });
-    rolesList.rolesName = "";
+    rolesList.rolesName = [];
     dialogTitle.value = "新建用户组";
     form.groupName = "";
     dialogForm.value = true;
@@ -153,6 +158,7 @@ defineExpose({
           <el-select
             v-model="rolesList.rolesName"
             placeholder="请选择"
+            multiple
             @change="changeRoles"
           >
             <el-option

+ 40 - 5
src/views/background/framework/users/index.vue

@@ -12,7 +12,7 @@ import editPerson from "./components/editPerson.vue";
 import { postPageGroup, postDelUserGroup } from "@/api/userGroup";
 import UserPageTable from "@/components/UserPageTable/index.vue";
 import pngcaret from "@/assets/icon-png/caret-right-small.svg";
-import { getDeleteUserApi } from "@/api/userSetting";
+import { getDeleteUserApi, postAssignmentUserApi } from "@/api/userSetting";
 // 新增用户组
 const addUsersRef = ref();
 const addUsersShow = ref(false);
@@ -65,11 +65,17 @@ const postPageGroupApi = async () => {
 onMounted(() => {
   postPageGroupApi();
   setTimeout(() => {
+    formLink.targetCodes = [];
     rolesList.rolesName = rolesList.perName;
     bgColor.value = rolesList.perOne;
-    console.log(999, rolesList.data);
-    console.log(1231231, rolesList.perOne);
+    Object.assign(rolesList.addPerson, rolesList.data[0]);
     UserTable?.value?.handleNodeClick(rolesList.data[0], "group");
+    addPersonClick.value = UserTable?.value?.handleNodeClick(
+      rolesList.data[0],
+      "group"
+    );
+    paramsItem.value = rolesList.data[0];
+    formLink.targetCodes.push(rolesList.data[0].groupCode);
   }, 500);
 });
 // 查看角色组
@@ -82,6 +88,9 @@ const lookRoles = item => {
   UserTable?.value?.handleNodeClick(item, "group");
   addPersonClick.value = UserTable?.value?.handleNodeClick(item, "group");
   paramsItem.value = item;
+  // 取消关联动作
+  formLink.targetCodes = [];
+  formLink.targetCodes.push(item.groupCode);
 };
 // 标签选择
 const activeName = ref("first");
@@ -98,6 +107,19 @@ const postDelUserGroupApi = async row => {
       type: "success",
       message: "删除成功"
     });
+    setTimeout(() => {
+      formLink.targetCodes = [];
+      rolesList.rolesName = rolesList.perName;
+      bgColor.value = rolesList.perOne;
+      Object.assign(rolesList.addPerson, rolesList.data[0]);
+      UserTable?.value?.handleNodeClick(rolesList.data[0], "group");
+      addPersonClick.value = UserTable?.value?.handleNodeClick(
+        rolesList.data[0],
+        "group"
+      );
+      paramsItem.value = rolesList.data[0];
+      formLink.targetCodes.push(rolesList.data[0].groupCode);
+    }, 500);
   }
 };
 const deleteUsers = row => {
@@ -132,8 +154,16 @@ const changeUsers = item => {
 const editUsers = row => {
   editPersonRef.value.open(row);
 };
+// 取消关联参数
+const formLink = reactive({
+  sourceCodes: [],
+  targetCodes: [],
+  linkAction: "unlink",
+  correlatedModel: "groupUser"
+});
 // 删除用户
 const deltetePerson = row => {
+  formLink.sourceCodes = [];
   ElMessageBox.confirm(
     `用户删除不能恢复,是否确认删除用户【${row.realName}】吗`,
     "确定删除该用户吗?",
@@ -144,8 +174,13 @@ const deltetePerson = row => {
     }
   )
     .then(() => {
-      getDeleteUserApi(
-        row.userCode,
+      // getDeleteUserApi(
+      //   row.userCode,
+      //   UserTable.value.postOrganizationUserPageApi
+      // );
+      formLink.sourceCodes.push(row.userCode);
+      postAssignmentUserApi(
+        formLink,
         UserTable.value.postOrganizationUserPageApi
       );
       UserTable?.value?.handleNodeClick(row, "group");

+ 11 - 0
src/views/draw/children/department/componements/seach.vue

@@ -185,6 +185,15 @@ const getAssessmentPageListApi = async () => {
   }
 };
 getAssessmentPageListApi();
+
+// 清除条件
+const handClickClear1 = () => {
+  dataList.teplist = [];
+  dataList.deptList = [];
+};
+const handClickClear2 = () => {
+  dataList.deptList = [];
+};
 </script>
 
 <template>
@@ -200,6 +209,7 @@ getAssessmentPageListApi();
             placeholder="请选择"
             style="width: 200px"
             @change="handClickInit1"
+            @clear="handClickClear1"
           >
             <el-option
               v-for="item in dataList.magList"
@@ -218,6 +228,7 @@ getAssessmentPageListApi();
             placeholder="请选择"
             style="width: 200px"
             @change="handClickInit2"
+            @clear="handClickClear2"
           >
             <el-option
               v-for="item in dataList.teplist"

+ 10 - 0
src/views/draw/children/head/componements/seach.vue

@@ -195,6 +195,14 @@ const getAssessmentPageListApi = async () => {
   }
 };
 getAssessmentPageListApi();
+// 清除条件
+const handClickClear1 = () => {
+  dataList.teplist = [];
+  dataList.leaderList = [];
+};
+const handClickClear2 = () => {
+  dataList.leaderList = [];
+};
 </script>
 
 <template>
@@ -210,6 +218,7 @@ getAssessmentPageListApi();
             placeholder="请选择"
             style="width: 200px"
             @change="handClickInit1"
+            @clear="handClickClear1"
           >
             <el-option
               v-for="item in dataList.magList"
@@ -228,6 +237,7 @@ getAssessmentPageListApi();
             placeholder="请选择"
             style="width: 200px"
             @change="handClickInit2"
+            @clear="handClickClear2"
           >
             <el-option
               v-for="item in dataList.teplist"

+ 10 - 0
src/views/draw/children/health/componements/seach.vue

@@ -177,6 +177,14 @@ const getAssessmentPageListApi = async () => {
   }
 };
 getAssessmentPageListApi();
+// 清除条件
+const handClickClear1 = () => {
+  dataList.teplist = [];
+  dataList.userList = [];
+};
+const handClickClear2 = () => {
+  dataList.userList = [];
+};
 </script>
 
 <template>
@@ -192,6 +200,7 @@ getAssessmentPageListApi();
             placeholder="请选择"
             style="width: 200px"
             @change="handClickInit1"
+            @clear="handClickClear1"
           >
             <el-option
               v-for="item in dataList.magList"
@@ -210,6 +219,7 @@ getAssessmentPageListApi();
             placeholder="请选择"
             style="width: 200px"
             @change="handClickInit2"
+            @clear="handClickClear2"
           >
             <el-option
               v-for="item in dataList.teplist"

+ 16 - 0
src/views/draw/children/worker/componements/seach.vue

@@ -220,6 +220,19 @@ const getAssessmentPageListApi = async () => {
 if (route.query) {
   getAssessmentPageListApi();
 }
+// 清除条件
+const handClickClear1 = () => {
+  dataList.teplist = [];
+  dataList.deptList = [];
+  dataList.personList = [];
+};
+const handClickClear2 = () => {
+  dataList.deptList = [];
+  dataList.personList = [];
+};
+const handClickClear3 = () => {
+  dataList.personList = [];
+};
 </script>
 
 <template>
@@ -235,6 +248,7 @@ if (route.query) {
             placeholder="请选择"
             style="width: 200px"
             @change="handClickInit1"
+            @clear="handClickClear1"
           >
             <el-option
               v-for="item in dataList.magList"
@@ -253,6 +267,7 @@ if (route.query) {
             placeholder="请选择"
             style="width: 200px"
             @change="handClickInit2"
+            @clear="handClickClear2"
           >
             <el-option
               v-for="item in dataList.teplist"
@@ -271,6 +286,7 @@ if (route.query) {
             placeholder="请选择"
             style="width: 200px"
             @change="handClickInit3"
+            @clear="handClickClear3"
           >
             <el-option
               v-for="item in dataList.deptList"