From 68338b19f9dc2ad9725326b7e699a3e191030cb8 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期四, 24 八月 2023 17:27:59 +0800
Subject: [PATCH] 1.角色分配

---
 src/store/modules/user.js                    |    3 
 src/views/basicSettings/postList.vue         |   27 +
 src/styles/global.css                        |   37 +-
 src/layout/components/Navbar.vue             |    2 
 src/store/modules/permission.js              |    3 
 src/router/index.js                          |    8 
 src/views/basicSettings/personList.vue       |   61 +++
 src/views/basicSettings/roleDivider.vue      |  541 ++++++++++++++++++++++++++++++++++++++
 src/api/basicSettings.js                     |   27 +
 src/views/basicSettings/powerDivider.vue     |   22 +
 src/views/basicSettings/roleList.vue         |   32 ++
 src/views/systemSetting/encodingRules.vue    |   19 +
 src/layout/components/Sidebar/index.vue      |    6 
 src/views/basicSettings/organizationList.vue |   19 +
 src/views/basicSettings/groupList.vue        |   19 +
 15 files changed, 780 insertions(+), 46 deletions(-)

diff --git a/src/api/basicSettings.js b/src/api/basicSettings.js
index 11a9d51..ddd8397 100644
--- a/src/api/basicSettings.js
+++ b/src/api/basicSettings.js
@@ -175,3 +175,30 @@
   })
 }
 
+// 瑙掕壊绠$悊鍒嗛厤鐢ㄦ埛,鑾峰彇宸插垎閰嶇敤鎴峰垪琛�
+export function RoleAssignedUserData(data) {
+  return request({
+    url: 'BasicSetting/RoleAssignedUserData',
+    method: 'get',
+    params: data
+  })
+}
+
+//
+export function RoleAssignedUserBatchCancel(data, role_code) {
+  return request({
+    url: 'BasicSetting/RoleAssignedUserBatchCancel?role_code=' + role_code,
+    method: 'post',
+    data
+  })
+}
+
+//
+export function RoleAssignedUserBatchAdd(data, role_code) {
+  return request({
+    url: 'BasicSetting/RoleAssignedUserBatchAdd?role_code=' + role_code,
+    method: 'post',
+    data
+  })
+}
+
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 8c36bd9..3b02761 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -265,11 +265,11 @@
   ],
   created() {
     // this.$signalr.start()
+    // Vue.prototype.$ButtonData = JSON.parse(localStorage.getItem('ButtonData'))
   },
   mounted() {
     // this.getHubConnectionBuilder()
 
-    Vue.prototype.$ButtonData = JSON.parse(localStorage.getItem('ButtonData'))
   },
   computed: {
     ...mapGetters([
diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue
index f62720f..a5507e8 100644
--- a/src/layout/components/Sidebar/index.vue
+++ b/src/layout/components/Sidebar/index.vue
@@ -80,9 +80,9 @@
       // console.log(meta, path, 7)
       // if set path, the sidebar will highlight the path you set
       removeCookie('ruleCode')
-      setCookie('ruleCode', meta.code)// 灏嗙紪鐮佽鍒檆ode瀛樺埌cookie閲岄潰
-      Vue.prototype.$buttoncode = meta.buttoncode
-      Vue.prototype.$datacode = meta.datacode
+      setCookie('ruleCode', meta.code) // 灏嗙紪鐮佽鍒檆ode瀛樺埌cookie閲岄潰
+      // Vue.prototype.$buttoncode = meta.buttoncode
+      // Vue.prototype.$datacode = meta.datacode
       // setCookie('buttoncode', meta.buttoncode)//  鎸夐挳鏉冮檺
       // setCookie('datacode', meta.datacode)//  鏁版嵁鏉冮檺
       if (meta.activeMenu) {
diff --git a/src/router/index.js b/src/router/index.js
index 521d7d0..86d8d21 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -133,6 +133,14 @@
         code: '1015',
         component: () => import('@/views/basicSettings/powerDivider'),
         meta: { code: '1015', title: '鏉冮檺鍒嗛厤', icon: '', keepAlive: true }
+      },
+      {
+        path: 'roleDivider',
+        name: 'roleDividerCancel',
+        code: '1016',
+        hidden: true,
+        component: () => import('@/views/basicSettings/roleDivider'),
+        meta: { code: '1016', title: '瑙掕壊鍒嗛厤', icon: '', keepAlive: true }
       }
 
     ]
diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js
index f6d5d76..f4e3713 100644
--- a/src/store/modules/permission.js
+++ b/src/store/modules/permission.js
@@ -18,7 +18,7 @@
         item.children.forEach(it => {
           if (it.flag === '0') {
             menuCode.push(it.code)
-            menuNameAndCode.push({ code: it.code, name: it.name, buttoncode: it.buttoncode, datacode: it.datacode })
+            menuNameAndCode.push({ code: it.code, name: it.name, hidden: it.is_show === 'N', buttoncode: it.buttoncode, datacode: it.datacode })
           }
         })
       }
@@ -38,6 +38,7 @@
           it.meta.title = t.name
           it.meta.buttoncode = t.buttoncode
           it.meta.datacode = t.datacode
+          it.hidden = t.hidden
           children.push(it)
           flag = true
         }
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 1de7bef..291baf5 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -2,6 +2,7 @@
 import { getToken, removeToken, setCookie } from '@/utils/auth'
 import { resetRouter } from '@/router'
 import { ButtonData } from '@/api/GeneralBasicData'
+import Vue from 'vue'
 
 const getDefaultState = () => {
   return {
@@ -82,6 +83,8 @@
       }).then(res => {
         if (res.code === '200') {
           ButtonData().then(res2 => {
+            // localStorage.setItem('buttoncode', res2.data.map(i => i.buttoncode))
+            Vue.prototype.$buttoncode = res2.data.map(i => i.buttoncode)
             localStorage.setItem('ButtonData', JSON.stringify(res2.data))
           })
 
diff --git a/src/styles/global.css b/src/styles/global.css
index 5bc8580..4a09c44 100644
--- a/src/styles/global.css
+++ b/src/styles/global.css
@@ -27,25 +27,27 @@
   background: #f8f8fa;
 }
 
-.el-table__body-wrapper{
+.el-table__body-wrapper {
   background: #f8f8fa;
 }
+
 .el-table__body .el-table__row.hover-row td {
   background-color: #eaecef !important;
 }
 
-.body .el-input__inner{
+.body .el-input__inner {
   height: 34px !important;
 }
 
-.el-dialog__body{
-  padding:50px 80px !important;
+.el-dialog__body {
+  padding: 50px 80px !important;
 }
-.el-dialog__body .el-input__inner{
+
+.el-dialog__body .el-input__inner {
   height: 34px !important;
 }
 
-.el-icon-delete,.el-icon-edit-outline{
+.el-icon-delete, .el-icon-edit-outline {
   cursor: pointer;
   margin-right: 15px;
 }
@@ -56,11 +58,10 @@
   align-items: center;
 }
 
-.el-message-box__btns{
+.el-message-box__btns {
   display: flex;
   justify-content: flex-end;
 }
-
 
 
 /*澶撮儴鎸夐挳缁勬牱寮�*/
@@ -99,11 +100,11 @@
   /*cursor: pointer;*/
 }
 
-.bodyTopFormExpand:hover{
+.bodyTopFormExpand:hover {
   color: #00ff8b !important;
 }
 
-.svg-icon:hover{
+.svg-icon:hover {
   color: #00ff8b !important;
   /*background-color: #00ff8b !important;*/
 }
@@ -114,8 +115,12 @@
   /*justify-content: space-between;*/
   /*justify-content: space-around;*/
   width: 100%;
-  height:50px;
+  /*min-height:42px  !important;*/
   flex-wrap: wrap;
+}
+
+.elForm .el-form-item {
+  margin-bottom: 0 !important;
 }
 
 .elTableDiv {
@@ -158,9 +163,8 @@
 }
 
 
-
-.el-button{
-  height: 34px ;
+.el-button {
+  height: 34px;
   display: flex !important;
   align-items: center;
   justify-content: center;
@@ -206,9 +210,10 @@
 
 
 /*瑙e喅鍥哄畾婊氬姩鏉¢珮浣庡儚绱犲樊*/
-.el-table__fixed::before{
+.el-table__fixed::before {
   height: 0 !important;
 }
-.el-table__fixed-right::before{
+
+.el-table__fixed-right::before {
   height: 0 !important;
 }
diff --git a/src/views/basicSettings/groupList.vue b/src/views/basicSettings/groupList.vue
index 81d1ec4..89fc83d 100644
--- a/src/views/basicSettings/groupList.vue
+++ b/src/views/basicSettings/groupList.vue
@@ -29,7 +29,24 @@
             <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
           </div>
         </el-form>
-
+        <div
+          class="bodyTopFormExpand"
+          style="height:5px"
+        >
+          <!--          <svg-icon-->
+          <!--            v-show="mouseHoverType==='mouseout'"-->
+          <!--            style="cursor: pointer"-->
+          <!--            :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"-->
+          <!--            @mouseenter="mouseHoverType=$event.type"-->
+          <!--          />-->
+          <!--          <svg-icon-->
+          <!--            v-show="mouseHoverType==='mouseenter'"-->
+          <!--            style="cursor: pointer"-->
+          <!--            :icon-class="!isExpandForm?'doubleDown':'doubleUp'"-->
+          <!--            @click="isExpandForm=!isExpandForm"-->
+          <!--            @mouseout="mouseHoverType=$event.type"-->
+          <!--          />-->
+        </div>
       </div>
 
       <div class="elTableDiv">
diff --git a/src/views/basicSettings/organizationList.vue b/src/views/basicSettings/organizationList.vue
index c807f9e..76e2b73 100644
--- a/src/views/basicSettings/organizationList.vue
+++ b/src/views/basicSettings/organizationList.vue
@@ -29,7 +29,24 @@
             <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
           </div>
         </el-form>
-
+        <div
+          class="bodyTopFormExpand"
+          style="height:5px"
+        >
+          <!--          <svg-icon-->
+          <!--            v-show="mouseHoverType==='mouseout'"-->
+          <!--            style="cursor: pointer"-->
+          <!--            :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"-->
+          <!--            @mouseenter="mouseHoverType=$event.type"-->
+          <!--          />-->
+          <!--          <svg-icon-->
+          <!--            v-show="mouseHoverType==='mouseenter'"-->
+          <!--            style="cursor: pointer"-->
+          <!--            :icon-class="!isExpandForm?'doubleDown':'doubleUp'"-->
+          <!--            @click="isExpandForm=!isExpandForm"-->
+          <!--            @mouseout="mouseHoverType=$event.type"-->
+          <!--          />-->
+        </div>
       </div>
 
       <div class="elTableDiv">
diff --git a/src/views/basicSettings/personList.vue b/src/views/basicSettings/personList.vue
index 4f76e53..5bc9d2c 100644
--- a/src/views/basicSettings/personList.vue
+++ b/src/views/basicSettings/personList.vue
@@ -23,7 +23,7 @@
           <el-tree
             ref="treeLeftRef"
             style="padding: 10px;overflow: auto;"
-            :style="{height:(tableHeight+140)+'px'}"
+            :style="{height:(tableHeight+180)+'px'}"
             :data="treeLeft"
             node-key="torg_code"
             highlight-current
@@ -55,6 +55,25 @@
                 <el-form-item label="鐢ㄦ埛鍚嶇О" style=" display: flex;">
                   <el-input v-model="form.username" placeholder="璇疯緭鍏�" style="width: 200px" />
                 </el-form-item>
+                <el-form-item label="鐢ㄦ埛缂栫爜" style=" display: flex;">
+                  <el-input v-model="form.usercode" placeholder="璇疯緭鍏�" style="width: 200px" />
+                </el-form-item>
+                <el-form-item v-show="isExpandForm" label="鐢ㄦ埛鍚嶇О" style=" display: flex;">
+                  <el-input v-model="form.username" placeholder="璇疯緭鍏�" style="width: 200px" />
+                </el-form-item>
+
+                <el-form-item v-show="isExpandForm" label="鐢ㄦ埛缂栫爜" style=" display: flex;">
+                  <el-input v-model="form.usercode" placeholder="璇疯緭鍏�" style="width: 200px" />
+                </el-form-item>
+                <el-form-item v-show="isExpandForm" label="鐢ㄦ埛鍚嶇О" style=" display: flex;">
+                  <el-input v-model="form.username" placeholder="璇疯緭鍏�" style="width: 200px" />
+                </el-form-item>
+                <el-form-item v-show="isExpandForm" label="鐢ㄦ埛缂栫爜" style=" display: flex;">
+                  <el-input v-model="form.usercode" placeholder="璇疯緭鍏�" style="width: 200px" />
+                </el-form-item>
+                <el-form-item v-show="isExpandForm" label="鐢ㄦ埛鍚嶇О" style=" display: flex;">
+                  <el-input v-model="form.username" placeholder="璇疯緭鍏�" style="width: 200px" />
+                </el-form-item>
               </div>
               <div
                 class="bodySearchReset"
@@ -64,7 +83,23 @@
                 <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
               </div>
             </el-form>
-
+            <div
+              class="bodyTopFormExpand"
+            >
+              <svg-icon
+                v-show="mouseHoverType==='mouseout'"
+                style="cursor: pointer"
+                :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"
+                @mouseenter="mouseHoverType=$event.type"
+              />
+              <svg-icon
+                v-show="mouseHoverType==='mouseenter'"
+                style="cursor: pointer"
+                :icon-class="!isExpandForm?'doubleDown':'doubleUp'"
+                @click="isExpandForm=!isExpandForm"
+                @mouseout="mouseHoverType=$event.type"
+              />
+            </div>
           </div>
 
           <div class="elTableDiv">
@@ -72,10 +107,10 @@
               ref="tableDataRef"
               class="tableFixed"
               :data="tableData"
-              :height="tableHeight+'px'"
+              :height="isExpandForm?tableHeight:(tableHeight+80)+'px'"
               border
               row-class-name="custom-row"
-              :style="{width: 100+'%',height:tableHeight+'px',}"
+              :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+80)+'px',}"
               highlight-current-row
               :header-cell-style="this.$headerCellStyle"
               :cell-style="this.$cellStyle"
@@ -154,7 +189,16 @@
                 </template>
               </el-table-column>
               <el-table-column
-                prop="username"
+                prop="group_name"
+                label="鐝粍"
+                sortable="custom"
+              >
+                <template slot-scope="{row}">
+                  {{ row.group_name ? row.group_name : '/' }}
+                </template>
+              </el-table-column>
+              <el-table-column
+                prop="createusername"
                 label="鍒涘缓浜哄憳"
                 sortable="custom"
               />
@@ -381,6 +425,8 @@
       }
     }
     return {
+      mouseHoverType: 'mouseout',
+      isExpandForm: false,
       mainHeight: 0,
       tableHeight: 0,
       form: {
@@ -602,7 +648,6 @@
     handleClose() {
       this.dialogForm.usercode = ''
       this.dialogForm.username = ''
-      this.dialogForm.storg_code = ''
       this.dialogForm.status = 'Y'
 
       this.dialogForm.post_code = []
@@ -611,6 +656,8 @@
       this.dialogForm.password = '123456'
       this.dialogForm.mobile = ''
       this.dialogForm.email = ''
+
+      // this.dialogForm.storg_code = ''
 
       this.$refs.cascader.checkedValue = ''
       this.$refs.dialogForm.clearValidate()
@@ -646,7 +693,7 @@
     getHeight() {
       this.$nextTick(() => {
         this.mainHeight = window.innerHeight - 85
-        this.tableHeight = this.mainHeight - 200
+        this.tableHeight = this.mainHeight - 295
         this.$refs.tableDataRef.doLayout()
       })
     }
diff --git a/src/views/basicSettings/postList.vue b/src/views/basicSettings/postList.vue
index b3721a6..fb8c498 100644
--- a/src/views/basicSettings/postList.vue
+++ b/src/views/basicSettings/postList.vue
@@ -29,7 +29,24 @@
             <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
           </div>
         </el-form>
-
+        <div
+          class="bodyTopFormExpand"
+          style="height:5px"
+        >
+          <!--          <svg-icon-->
+          <!--            v-show="mouseHoverType==='mouseout'"-->
+          <!--            style="cursor: pointer"-->
+          <!--            :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"-->
+          <!--            @mouseenter="mouseHoverType=$event.type"-->
+          <!--          />-->
+          <!--          <svg-icon-->
+          <!--            v-show="mouseHoverType==='mouseenter'"-->
+          <!--            style="cursor: pointer"-->
+          <!--            :icon-class="!isExpandForm?'doubleDown':'doubleUp'"-->
+          <!--            @click="isExpandForm=!isExpandForm"-->
+          <!--            @mouseout="mouseHoverType=$event.type"-->
+          <!--          />-->
+        </div>
       </div>
 
       <div class="elTableDiv">
@@ -42,8 +59,6 @@
           row-class-name="custom-row"
           :style="{width: 100+'%',height:tableHeight+'px',}"
           highlight-current-row
-          row-key="torg_code"
-          default-expand-all
           :header-cell-style="this.$headerCellStyle"
           :cell-style="this.$cellStyle"
           @sort-change="sortChange"
@@ -78,7 +93,11 @@
             prop="description"
             label="鎻忚堪"
             sortable="custom"
-          />
+          >
+            <template slot-scope="{row}">
+              {{ row.description?row.description:'/' }}
+            </template>
+          </el-table-column>
           <el-table-column
             prop="username"
             label="鍒涘缓浜哄憳"
diff --git a/src/views/basicSettings/powerDivider.vue b/src/views/basicSettings/powerDivider.vue
index 5997ed7..a823b49 100644
--- a/src/views/basicSettings/powerDivider.vue
+++ b/src/views/basicSettings/powerDivider.vue
@@ -180,12 +180,15 @@
 
       allButtonData: [], // 鎵�鏈夎彍鍗曞搴旂殑鎸夐挳鏉冮檺鍔犳暟鎹潈闄�
 
-      isScroll: 'left'
+      isScroll: 'left',
+
+      ButtonData: JSON.parse(localStorage.getItem('ButtonData'))
 
     }
   },
 
   created() {
+
   },
   mounted() {
     window.addEventListener('resize', this.getHeight)
@@ -200,14 +203,19 @@
       const { data: res } = await RolePermissionSearchRole()
       this.treeLeft = res
 
+      let rolecode = ''
+      if (window.location.hash.indexOf('?') !== -1) {
+        rolecode = window.location.hash.split('?')[1].split('=')[1]
+      }
+
       if (res && res.length > 0) {
         this.$nextTick(() => { // 榛樿閫変腑绗竴涓�
-          this.$refs.treeLeftRef.setCurrentKey(res[0].code) // 榛樿閫変腑鑺傜偣绗竴涓�
+          this.$refs.treeLeftRef.setCurrentKey(rolecode || res[0].code) // 榛樿閫変腑鑺傜偣绗竴涓�
         })
 
-        await this.getRolePermissionSearchRoleMenuButton(res[0].code)// 鐢ㄤ簬鏁版嵁鍥炴樉
+        await this.getRolePermissionSearchRoleMenuButton(rolecode || res[0].code)// 鐢ㄤ簬鏁版嵁鍥炴樉
 
-        await this.getRolePermissionSearchRoleMenu(res[0].code)// 鐢ㄤ簬娓叉煋椤甸潰
+        await this.getRolePermissionSearchRoleMenu(rolecode || res[0].code)// 鐢ㄤ簬娓叉煋椤甸潰
       } else {
         this.$notify.error('璇峰厛寤虹浉瀵瑰簲鐨勮鑹诧紒')
       }
@@ -238,7 +246,7 @@
           item.children.forEach(it => {
             it.buttoncodelist = it.buttoncodelist !== '' && it.buttoncodelist !== null ? it.buttoncodelist.split(',') : []
             if (it.buttoncodelist && it.buttoncodelist.length > 0) {
-              it.buttoncodelist = this.$ButtonData.filter(j =>
+              it.buttoncodelist = this.ButtonData.filter(j =>
                 it.buttoncodelist.includes(j.buttoncode)
               )
 
@@ -265,7 +273,7 @@
             let temp = this.allButtonData.filter(j => j.menucode === it.menucode).length > 0 ? this.allButtonData.filter(j => j.menucode === it.menucode)[0].buttoncode : []
             temp = temp.length > 0 ? temp.split(',') : []
             it.buttonChecked = [] // 鏁版嵁鍥炴樉
-            this.$ButtonData.forEach(j => {
+            this.ButtonData.forEach(j => {
               if (temp.includes(j.buttoncode)) {
                 it.buttonChecked.push(j.buttonname)
               }
@@ -419,7 +427,7 @@
           item.children.forEach(it => {
             if (menuKeyArr.includes(it.menucode)) {
               if (it.buttonChecked && it.buttonChecked.length > 0) { // 宸查�夎彍鍗�
-                it.buttonCheckedCode = this.$ButtonData.filter(i =>
+                it.buttonCheckedCode = this.ButtonData.filter(i =>
                   it.buttonChecked.includes(i.buttonname)
                 ).map(i => i.buttoncode)
               }
diff --git a/src/views/basicSettings/roleDivider.vue b/src/views/basicSettings/roleDivider.vue
new file mode 100644
index 0000000..838a67d
--- /dev/null
+++ b/src/views/basicSettings/roleDivider.vue
@@ -0,0 +1,541 @@
+<template>
+  <div>
+    <div class="body" :style="{height:mainHeight+'px'}">
+      <div class="bodyTopButtonGroup">
+        <el-button v-waves type="primary" icon="el-icon-circle-plus-outline" @click="add('add')">鏂板</el-button>
+        <el-button v-waves type="danger" icon="el-icon-error" @click="batchCancel">鎵归噺鍙栨秷鎺堟潈</el-button>
+        <!--        <el-button v-waves type="warning" icon="el-icon-close">鍏抽棴</el-button>-->
+      </div>
+
+      <div class="bodyTopFormGroup">
+        <el-form
+          ref="form"
+          :model="form"
+          label-width="100px"
+          inline
+          style="display: flex;"
+        >
+          <div class="elForm">
+            <el-form-item label="瑙掕壊缂栫爜" style=" display: flex;">
+              <el-select
+                v-model="form.role_code"
+                style="width:200px"
+                placeholder="璇烽�夋嫨"
+                @change="roleChange"
+              >
+                <el-option
+                  v-for="item in roleArr"
+                  :key="item.rolecode"
+                  :label="item.rolename"
+                  :value="item.rolecode"
+                />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="鐢ㄦ埛缂栫爜" style=" display: flex;">
+              <el-input v-model="form.usercode" placeholder="璇疯緭鍏�" style="width: 200px" />
+            </el-form-item>
+            <el-form-item label="鐢ㄦ埛鍚嶇О" style=" display: flex;">
+              <el-input v-model="form.username" placeholder="璇疯緭鍏�" style="width: 200px" />
+            </el-form-item>
+
+            <el-form-item label="缁勭粐缂栫爜" style=" display: flex;">
+              <el-cascader
+                ref="cascader"
+                v-model="form.storg_code"
+                :options="cascaderOptions"
+                filterable
+                :props="defaultProps"
+                :show-all-levels="false"
+              />
+            </el-form-item>
+            <el-form-item v-show="isExpandForm" label="宀椾綅鍚嶇О" style=" display: flex;">
+              <el-select
+                v-model="form.post_code"
+                style="width:200px"
+                multiple
+                collapse-tags
+                placeholder="璇烽�夋嫨"
+              >
+                <el-option
+                  v-for="item in postArr"
+                  :key="item.postcode"
+                  :label="item.postname"
+                  :value="item.postcode"
+                />
+              </el-select>
+            </el-form-item>
+            <el-form-item v-show="isExpandForm" label="鐝粍缂栫爜" style=" display: flex;">
+              <el-select
+                v-model="form.group_code"
+                style="width:200px"
+                multiple
+                collapse-tags
+                placeholder="璇烽�夋嫨"
+              >
+                <el-option
+                  v-for="item in groupArr"
+                  :key="item.usergroupcode"
+                  :label="item.usergroupname"
+                  :value="item.usergroupcode"
+                />
+              </el-select>
+            </el-form-item>
+          </div>
+          <div
+            class="bodySearchReset"
+            :style="{marginLeft:$store.state.app.sidebar.opened? $store.state.settings.menuIsHorizontal?'15%':'3%':'10%'}"
+          >
+            <el-button v-waves type="primary" icon="el-icon-search" @click="getRoleAssignedUserData">鏌ヨ</el-button>
+            <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
+          </div>
+        </el-form>
+        <div
+          class="bodyTopFormExpand"
+        >
+          <svg-icon
+            v-show="mouseHoverType==='mouseout'"
+            style="cursor: pointer"
+            :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"
+            @mouseenter="mouseHoverType=$event.type"
+          />
+          <svg-icon
+            v-show="mouseHoverType==='mouseenter'"
+            style="cursor: pointer"
+            :icon-class="!isExpandForm?'doubleDown':'doubleUp'"
+            @click="isExpandForm=!isExpandForm"
+            @mouseout="mouseHoverType=$event.type"
+          />
+        </div>
+      </div>
+
+      <div class="elTableDiv">
+        <el-table
+          ref="tableDataRef"
+          class="tableFixed"
+          :data="tableData"
+          :height="isExpandForm?tableHeight:(tableHeight+40)+'px'"
+          border
+          row-class-name="custom-row"
+          :style="{width: 100+'%',height:isExpandForm?tableHeight:(tableHeight+40)+'px',}"
+          highlight-current-row
+          :row-key="getRowKey"
+          :header-cell-style="this.$headerCellStyle"
+          :cell-style="this.$cellStyle"
+          @selection-change="handleSelectionChange"
+          @sort-change="sortChange"
+        >
+          <el-table-column
+            type="selection"
+            width="50"
+            :reserve-selection="true"
+            fixed
+          />
+          <el-table-column
+            prop="rowNum"
+            width="50"
+            fixed
+            label="搴忓彿"
+          />
+          <el-table-column
+            prop="usercode"
+            label="鐢ㄦ埛缂栫爜"
+            sortable="custom"
+          />
+          <el-table-column
+            prop="username"
+            label="鐢ㄦ埛鍚嶇О"
+            sortable="custom"
+          />
+          <el-table-column
+            prop="storg_name"
+            label="鎵�灞炵粍缁�"
+            sortable="custom"
+          />
+          <el-table-column
+            prop="rolename"
+            label="瑙掕壊"
+            sortable="custom"
+          >
+            <template slot-scope="{row}">
+              {{ row.rolename ? row.rolename : '/' }}
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="postname"
+            label="宀椾綅"
+            sortable="custom"
+          >
+            <template slot-scope="{row}">
+              {{ row.postname ? row.postname : '/' }}
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="group_name"
+            label="鐝粍"
+            sortable="custom"
+          >
+            <template slot-scope="{row}">
+              {{ row.group_name ? row.group_name : '/' }}
+            </template>
+          </el-table-column>
+
+          <el-table-column
+            label="鎿嶄綔"
+            width="200"
+            fixed="right"
+          >
+            <template slot-scope="{row}">
+              <div class="operationClass">
+                <el-button
+                  type="text"
+                  style="cursor: pointer;font-size: 14px"
+                  @click="cancel(row.usercode)"
+                >鍙栨秷鎺堟潈
+                </el-button>
+
+              </div>
+            </template>
+          </el-table-column>
+        </el-table>
+      </div>
+      <!--鍒嗛〉-->
+      <pagination
+        :total="total"
+        :page.sync="form.page"
+        :limit.sync="form.rows"
+        align="right"
+        layout="total,prev, pager, next,sizes,jumper"
+        popper-class="select_bottom"
+        @pagination="getRoleAssignedUserData"
+      />
+    </div>
+
+    <el-dialog
+      v-el-drag-dialog
+      title="鏂板"
+      :visible.sync="dialogVisible"
+      width="800px"
+      :close-on-click-modal="false"
+      top="15vh"
+      @closed="handleClose"
+      @close="handleClose"
+    >
+      <div>
+        <el-table
+          ref="tableDataDialogRef"
+          class="tableFixed"
+          :data="tableDataDialog"
+          height="400"
+          border
+          :style="{width: 100+'%',height:'400px',}"
+          highlight-current-row
+          :row-key="getRowKey"
+          :header-cell-style="this.$headerCellStyle"
+          :cell-style="this.$cellStyle"
+          @selection-change="handleDialogSelectionChange"
+        >
+          <el-table-column
+            type="selection"
+            width="50"
+            :reserve-selection="true"
+            fixed
+          />
+          <el-table-column
+            prop="rowNum"
+            width="50"
+            fixed
+            label="搴忓彿"
+          />
+          <el-table-column
+            prop="usercode"
+            label="鐢ㄦ埛缂栫爜"
+          />
+          <el-table-column
+            prop="username"
+            label="鐢ㄦ埛鍚嶇О"
+          />
+          <el-table-column
+            prop="storg_name"
+            label="鎵�灞炵粍缁�"
+          />
+          <el-table-column
+            prop="rolename"
+            label="瑙掕壊"
+          >
+            <template slot-scope="{row}">
+              {{ row.rolename?row.rolename:'/' }}
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="postname"
+            label="宀椾綅"
+          >
+            <template slot-scope="{row}">
+              {{ row.postname?row.postname:'/' }}
+            </template>
+          </el-table-column>
+          <el-table-column
+            prop="group_name"
+            label="鐝粍"
+          >
+            <template slot-scope="{row}">
+              {{ row.group_name?row.group_name:'/' }}
+            </template>
+          </el-table-column>
+        </el-table>
+        <!--鍒嗛〉-->
+        <pagination
+          :total="totalDialog"
+          :page.sync="dialogForm.page"
+          :limit.sync="dialogForm.rows"
+          align="right"
+          style="margin-top: 10px;"
+          layout="total,prev, pager, next,sizes,jumper"
+          popper-class="select_bottom"
+          @pagination="add"
+        />
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <div class="footerButton">
+          <el-button
+            v-waves
+            @click="dialogVisibleCancel"
+          >鍙� 娑�</el-button>
+          <el-button
+            v-waves
+            type="primary"
+            :loading="$store.state.app.buttonIsDisabled"
+            :disabled="$store.state.app.buttonIsDisabled"
+            @click="dialogVisibleConfirm"
+          >纭� 瀹�</el-button>
+        </div>
+      </span>
+    </el-dialog>
+
+  </div>
+</template>
+
+<script>
+import Pagination from '@/components/Pagination'
+import {
+  AddUpdatePost, RoleAssignedUserBatchAdd,
+  RoleAssignedUserBatchCancel,
+  RoleAssignedUserData
+
+} from '@/api/basicSettings'
+import { validateCode } from '@/utils/global'
+import elDragDialog from '@/directive/el-drag-dialog'
+import waves from '@/directive/waves'
+import arrayToTree from 'array-to-tree'
+import { GroupsPermissions, PostPermissions, PrentOrganization, RolePermissions } from '@/api/GeneralBasicData'
+
+export default {
+  name: 'Zzjg',
+  components: {
+    Pagination
+  },
+  directives: { elDragDialog, waves },
+  data() {
+    return {
+      mouseHoverType: 'mouseout',
+      isExpandForm: false,
+      mainHeight: 0,
+      tableHeight: 0,
+      form: {
+        flag: 'TRUE', // TRUE(宸插叧鑱�) FALSE(鏈叧鑱�)
+        role_code: '', // 瑙掕壊缂栫爜
+        usercode: '', // 鐢ㄦ埛缂栫爜
+        username: '', // 鐢ㄦ埛鍚嶇О
+        storg_code: [], //
+        post_code: [], //
+        group_code: [], //
+        prop: 'lm_date', // 鎺掑簭瀛楁
+        order: 'desc', // 鎺掑簭瀛楁
+        page: 1, // 绗嚑椤�
+        rows: 20 // 姣忛〉澶氬皯鏉�
+      },
+      total: 10,
+      tableData: [],
+
+      cascaderOptions: [],
+      defaultProps: {
+        checkStrictly: true,
+        expandTrigger: 'hover',
+        value: 'torg_code',
+        label: 'torg_name'
+      },
+      roleArr: [],
+      postArr: [],
+      groupArr: [],
+
+      dialogVisible: false,
+      dialogForm: {
+        page: 1, // 绗嚑椤�
+        rows: 20 // 姣忛〉澶氬皯鏉�
+      },
+      tableDataDialog: [],
+      totalDialog: 10,
+
+      batchRoleCode: [],
+      batchDialogRoleCode: []
+
+    }
+  },
+  created() {
+  },
+  mounted() {
+    window.addEventListener('resize', this.getHeight)
+    this.getHeight()
+
+    this.getAllSelectData()
+    this.getPrentOrganization()
+  },
+  methods: {
+    // 缁勭粐鏋舵瀯澶у垪琛ㄦ煡璇�
+    async getRoleAssignedUserData() {
+      if (!this.form.role_code) {
+        this.form.role_code = this.roleArr[0].rolecode
+      }
+
+      this.form.storg_code = this.form.storg_code ? this.form.storg_code[this.form.storg_code.length - 1] : ''
+      this.form.post_code = this.form.post_code ? this.form.post_code.join(',') : ''
+      this.form.group_code = this.form.group_code ? this.form.group_code.join(',') : ''
+
+      const res = await RoleAssignedUserData(this.form)
+      this.tableData = res.data
+      this.total = res.count
+    },
+    async getPrentOrganization() {
+      const { data: res } = await PrentOrganization()
+      this.cascaderOptions = arrayToTree(res, {
+        parentProperty: 'parent_id',
+        customID: 'torg_code',
+        childrenProperty: 'children'
+      })
+    },
+    // 宀椾綅 瑙掕壊 鐝粍
+    async getAllSelectData() {
+      const { data: res2 } = await RolePermissions()
+      this.roleArr = res2
+      await this.getRoleAssignedUserData()
+
+      const { data: res1 } = await PostPermissions()
+      this.postArr = res1
+
+      const { data: res3 } = await GroupsPermissions()
+      this.groupArr = res3
+    },
+    // 鎺掑簭鏀瑰彉鏃�
+    sortChange({ column, prop, order }) {
+      if (order === 'descending') {
+        order = 'desc'
+      } else if (order === 'ascending') {
+        order = 'asc'
+      } else {
+        order = 'desc'
+      }
+      this.form.order = order
+      this.form.prop = prop
+      this.getRoleAssignedUserData()
+    },
+    // 閲嶇疆
+    reset() {
+      this.form.usercode = ''
+      this.form.username = ''
+
+      this.form.storg_code = []
+      this.form.post_code = []
+      this.form.group_code = []
+      this.getRoleAssignedUserData()
+    },
+    roleChange(val) {
+      this.getRoleAssignedUserData()
+      this.batchRoleCode = []
+      this.$refs.tableDataRef.clearSelection()
+    },
+
+    async cancel(code) {
+      const res = await RoleAssignedUserBatchCancel([code], this.form.role_code)
+      if (res.code === '200') {
+        this.$notify.success('鍙栨秷鎺堟潈鎴愬姛锛�')
+        await this.getRoleAssignedUserData()
+      } else {
+        this.$notify.error('鍙栨秷鎺堟潈澶辫触锛�')
+      }
+    },
+
+    async batchCancel() {
+      const res = await RoleAssignedUserBatchCancel(this.batchRoleCode, this.form.role_code)
+      if (res.code === '200') {
+        this.$notify.success(this.batchRoleCode.length + '涓敤鎴峰彇娑堟巿鏉冩垚鍔燂紒')
+        await this.getRoleAssignedUserData()
+        this.batchRoleCode = []
+        this.$refs.tableDataRef.clearSelection()
+      } else {
+        this.$notify.error(this.batchRoleCode.length + '涓敤鎴峰彇娑堟巿鏉冨け璐ワ紒')
+      }
+    },
+
+    // 鏂板鎸夐挳
+    async add() {
+      this.dialogVisible = true
+
+      const data = {
+        flag: 'FALSE', // TRUE(宸插叧鑱�) FALSE(鏈叧鑱�)
+        role_code: this.form.role_code, // 瑙掕壊缂栫爜
+        usercode: '', // 鐢ㄦ埛缂栫爜
+        username: '', // 鐢ㄦ埛鍚嶇О
+        storg_code: '', //
+        post_code: '', //
+        group_code: '', //
+        prop: 'lm_date', // 鎺掑簭瀛楁
+        order: 'desc', // 鎺掑簭瀛楁
+        page: this.dialogForm.page, // 绗嚑椤�
+        rows: this.dialogForm.rows // 姣忛〉澶氬皯鏉�
+      }
+      const res = await RoleAssignedUserData(data)
+      this.tableDataDialog = res.data
+      this.totalDialog = res.count
+    },
+
+    // 瀵硅瘽妗嗗叧闂簨浠�
+    handleClose() {
+      // this.form.flag = 'TRUE'
+    },
+    getRowKey(row) {
+      return row.usercode
+    },
+    handleSelectionChange(rows) {
+      this.batchRoleCode = rows.map(i => i.usercode)
+    },
+    handleDialogSelectionChange(rows) {
+      this.batchDialogRoleCode = rows.map(i => i.usercode)
+    },
+    // 瀵硅瘽妗嗗彇娑�
+    dialogVisibleCancel() {
+      this.dialogVisible = false
+    },
+    // 瀵硅瘽妗嗙‘璁�
+    async  dialogVisibleConfirm() {
+      const res = await RoleAssignedUserBatchAdd(this.batchDialogRoleCode, this.form.role_code)
+      if (res.code === '200') {
+        this.$notify.success(this.batchDialogRoleCode.length + '涓敤鎴锋柊澧炴巿鏉冩垚鍔燂紒')
+        await this.getRoleAssignedUserData()
+        this.batchDialogRoleCode = []
+        this.$refs.tableDataDialogRef.clearSelection()
+        this.dialogVisible = false
+      } else {
+        this.$notify.error(this.batchDialogRoleCode.length + '涓敤鎴锋柊澧炴巿鏉冨け璐ワ紒')
+      }
+    },
+    // 鑾峰彇椤甸潰楂樺害
+    getHeight() {
+      this.$nextTick(() => {
+        this.mainHeight = window.innerHeight - 85
+        this.tableHeight = this.mainHeight - 255
+        this.$refs.tableDataRef.doLayout()
+      })
+    }
+  }
+}
+</script>
diff --git a/src/views/basicSettings/roleList.vue b/src/views/basicSettings/roleList.vue
index 9b508f0..0d211da 100644
--- a/src/views/basicSettings/roleList.vue
+++ b/src/views/basicSettings/roleList.vue
@@ -29,7 +29,24 @@
             <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
           </div>
         </el-form>
-
+        <div
+          class="bodyTopFormExpand"
+          style="height:5px"
+        >
+          <!--          <svg-icon-->
+          <!--            v-show="mouseHoverType==='mouseout'"-->
+          <!--            style="cursor: pointer"-->
+          <!--            :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"-->
+          <!--            @mouseenter="mouseHoverType=$event.type"-->
+          <!--          />-->
+          <!--          <svg-icon-->
+          <!--            v-show="mouseHoverType==='mouseenter'"-->
+          <!--            style="cursor: pointer"-->
+          <!--            :icon-class="!isExpandForm?'doubleDown':'doubleUp'"-->
+          <!--            @click="isExpandForm=!isExpandForm"-->
+          <!--            @mouseout="mouseHoverType=$event.type"-->
+          <!--          />-->
+        </div>
       </div>
 
       <div class="elTableDiv">
@@ -81,7 +98,11 @@
             prop="description"
             label="澶囨敞"
             sortable="custom"
-          />
+          >
+            <template slot-scope="{row}">
+              {{ row.description?row.description:'/' }}
+            </template>
+          </el-table-column>
           <el-table-column
             prop="username"
             label="鍒涘缓浜哄憳"
@@ -131,7 +152,7 @@
                   <el-dropdown-menu slot="dropdown">
                     <el-dropdown-item icon="el-icon-circle-check" command="menuPower">鑿滃崟鏉冮檺</el-dropdown-item>
                     <el-dropdown-item icon="el-icon-user" command="divideUser">鍒嗛厤鐢ㄦ埛</el-dropdown-item>
-                    <el-dropdown-item icon="el-icon-download" command="downloadMenu">瀵煎嚭鑿滃崟</el-dropdown-item>
+                    <!--                    <el-dropdown-item icon="el-icon-download" command="downloadMenu">瀵煎嚭鑿滃崟</el-dropdown-item>-->
                   </el-dropdown-menu>
                 </el-dropdown>
               </div>
@@ -439,7 +460,10 @@
     handleCommand(command, row) {
       console.log(command, row)
       if (command === 'menuPower') {
-        this.$router.push('./roleList?powerId=' + row.id)// demo
+        this.$router.push('./powerDivider?rolecode=' + row.rolecode)
+      }
+      if (command === 'divideUser') {
+        this.$router.push('./roleDivider?rolecode=' + row.rolecode)
       }
     },
     // 鑾峰彇椤甸潰楂樺害
diff --git a/src/views/systemSetting/encodingRules.vue b/src/views/systemSetting/encodingRules.vue
index e6cc22f..7dffe02 100644
--- a/src/views/systemSetting/encodingRules.vue
+++ b/src/views/systemSetting/encodingRules.vue
@@ -36,6 +36,24 @@
             <el-button v-waves type="info" icon="el-icon-refresh" @click="reset">閲嶇疆</el-button>
           </div>
         </el-form>
+        <div
+          class="bodyTopFormExpand"
+          style="height:5px"
+        >
+          <!--          <svg-icon-->
+          <!--            v-show="mouseHoverType==='mouseout'"-->
+          <!--            style="cursor: pointer"-->
+          <!--            :icon-class="!isExpandForm?'doubleDown3':'doubleUp3'"-->
+          <!--            @mouseenter="mouseHoverType=$event.type"-->
+          <!--          />-->
+          <!--          <svg-icon-->
+          <!--            v-show="mouseHoverType==='mouseenter'"-->
+          <!--            style="cursor: pointer"-->
+          <!--            :icon-class="!isExpandForm?'doubleDown':'doubleUp'"-->
+          <!--            @click="isExpandForm=!isExpandForm"-->
+          <!--            @mouseout="mouseHoverType=$event.type"-->
+          <!--          />-->
+        </div>
       </div>
 
       <div class="elTableDiv">
@@ -308,7 +326,6 @@
     this.getHeight()
 
     this.getCodeMenuSelect()
-    console.log(this.$buttoncode)
   },
   methods: {
     async getCodeMenuSelect() {

--
Gitblit v1.9.3