zhaoke 2 年之前
父節點
當前提交
ca3a748c60
共有 3 個文件被更改,包括 34 次插入8 次删除
  1. 6 0
      src/views/newRole/css/index.scss
  2. 26 6
      src/views/newRole/index.vue
  3. 2 2
      src/views/newUserManagement/index.vue

+ 6 - 0
src/views/newRole/css/index.scss

@@ -28,6 +28,9 @@
       &-bottom {
         height: calc(100% - 128px);
         .treeArr{
+          .bigText{
+            font-weight: 600;
+          }
           .customTxt{
             font-size: 14px;
           }
@@ -88,6 +91,9 @@
             justify-content: space-between;
             font-size: 14px;
             padding-right: 8px;
+            .bigText{
+              font-weight: 600;
+            }
             .customBtn {
               .rm{
                 font-size: 14px;

+ 26 - 6
src/views/newRole/index.vue

@@ -16,9 +16,9 @@
           <el-scrollbar ref="scroll" style="height: 100%">
             <div class="treeArr">
               <el-tree ref="treeArr" :data="arrs" :props="defaultArrProps" highlight-current :filter-node-method="filterArrNode" default-expand-all node-key="user_group_id" @node-click="handleClick" :expand-on-click-node="false">
-                <span class="custom-tree-node" slot-scope="{ node }">
+                <span class="custom-tree-node" slot-scope="{ node,data }">
                   <div class="flex">
-                    <div>
+                    <div :class="!data.user_id ? 'bigText':''">
                       <span class="customTxt">{{ node.label }}</span>
                     </div>
                   </div>
@@ -409,8 +409,12 @@ export default {
         if (this.checkDatas.length == 1) {
           const res = this.checkDatas[this.checkDatas.length - 1]; //最后一条数据
           const addRes = []
+          const newDatas = []
           const newItem = _.cloneDeep(this.dataObj)
           res.forEach(item => {
+            if (item.children) {
+              delete item.children
+            }
             if (newItem.hasOwnProperty('user_id')) {
               item.user_id = newItem.user_id
             } else {
@@ -418,7 +422,13 @@ export default {
             }
             addRes.push(item)
           })
-          const { code } = await this.getChangeList(SERVICE_ID.userAuthorizationId, addRes, 1)
+          const newMsgs = _.cloneDeep(addRes)
+          newMsgs.forEach(item => {
+            const { auth_id, auth_type, queryTemplateColumnSetID, row_auth, user_group_id, user_id } = item
+            const newObj = { auth_id, auth_type, queryTemplateColumnSetID, row_auth, user_group_id, user_id }
+            newDatas.push(newObj)
+          })
+          const { code } = await this.getChangeList(SERVICE_ID.userAuthorizationId, newDatas, 1)
           if (code == 0) {
             setTimeout(() => {
               this.getRoleQuth(this.dataObj)
@@ -442,8 +452,12 @@ export default {
     async checksBoxTs (datas, arr, type) {
       const res = [...datas, ...arr].filter((item) => !(datas.some((p) => item.auth_id == p.auth_id) && arr.some((c) => item.auth_id == c.auth_id)));
       const addRes = []
+      const newDatas = []
       const newItem = _.cloneDeep(this.dataObj)
       res.forEach(item => {
+        if (item.children) {
+          delete item.children
+        }
         if (newItem.hasOwnProperty('user_id')) {
           item.user_id = newItem.user_id
         } else {
@@ -451,8 +465,14 @@ export default {
         }
         addRes.push(item)
       })
+      const newMsgs = _.cloneDeep(addRes)
+      newMsgs.forEach(item => {
+        const { auth_id, auth_type, queryTemplateColumnSetID, row_auth, user_group_id, user_id } = item
+        const newObj = { auth_id, auth_type, queryTemplateColumnSetID, row_auth, user_group_id, user_id }
+        newDatas.push(newObj)
+      })
       if (type == 'add') {
-        const { code } = await this.getChangeList(SERVICE_ID.userAuthorizationId, addRes, 1)
+        const { code } = await this.getChangeList(SERVICE_ID.userAuthorizationId, newDatas, 1)
         if (code == 0) {
           setTimeout(() => {
             this.getRoleQuth(this.dataObj)
@@ -460,7 +480,7 @@ export default {
         }
         this.tipMsg(code)
       } else {
-        const { code } = await this.getChangeList(SERVICE_ID.userAuthorizationId, addRes, 3)
+        const { code } = await this.getChangeList(SERVICE_ID.userAuthorizationId, newDatas, 3)
         if (code == 0) {
           this.msgUserId = null
           this.checkArrs = []
@@ -483,7 +503,7 @@ export default {
           newObj.user_group_id = newItem.user_group_id
         }
         newObj.auth_id = data.auth_id
-        const { code, returnData } = await this.getQueryList(SERVICE_ID.sysUserAuthId, { user_id: getToken('userid'), auth_id: data.auth_id })
+        const { code, returnData } = await this.getQueryList(SERVICE_ID.sysUserAuthId, { auth_id: data.auth_id })
         if (code == 0) {
           const result = returnData
           if (result && result.length) {

+ 2 - 2
src/views/newUserManagement/index.vue

@@ -519,11 +519,11 @@ export default {
             const { code } = await this.getChangeList(SERVICE_ID.getUserTableId, data, 1)
             this.tipMsg(code)
           } else {
-            const id = this.ruleForm.user_group_id
+            const id = this.ruleForm.user_group_id || this.ruleForm.user_id
             if (id) {
               this.ruleForm.user_pwd = MD5(this.ruleForm.user_pwd)
               const data = this.ruleForm
-              const { code } = await this.getChangeList(SERVICE_ID.getUserTableId, data, 2, 'up_user_group_id')
+              const { code } = await this.getChangeList(SERVICE_ID.getUserTableId, data, 2, 'user_id')
               this.tipMsg(code)
             }
           }