Sfoglia il codice sorgente

增加其他前端分支store中userListAll变量

cyy 3 ore fa
parent
commit
b2ecf2debb

+ 12 - 3
src/store/getters.js

@@ -73,11 +73,16 @@ export default {
     state.ibps.system.system ? state.ibps.system.system.id : '', // 子系统id
   permissions: (state) => state.ibps.menu.permissions, //  拥有的权限
   myform: (state) => (state.ibps.myform ? state.ibps.myform : ''),
-  // 获取所有用户信息
+  // 获取所有用户信息带禁用过滤
   userList: (state) =>
     state.ibps.param && state.ibps.param.userList
       ? state.ibps.param.userList
       : [],
+  // 获取所有用户信息不加过滤
+  userListAll: (state) =>
+    state.ibps.param && state.ibps.param.userListAll
+      ? state.ibps.param.userListAll
+      : [],
   // 获取所有部门信息
   deptList: (state) =>
     state.ibps.param && state.ibps.param.deptList
@@ -94,8 +99,12 @@ export default {
   licence: (state) => (state.ibps.licence ? state.ibps.licence.licJson : {}),
   // 获取配置信息
   setting: (state) =>
-    state.ibps.param && state.ibps.param.setting ? state.ibps.param.setting : {},
+    state.ibps.param && state.ibps.param.setting
+      ? state.ibps.param.setting
+      : {},
   // 获取示例列表
   exampleList: (state) =>
-    state.ibps.page && state.ibps.page.exampleList ? state.ibps.page.exampleList : []
+    state.ibps.page && state.ibps.page.exampleList
+      ? state.ibps.page.exampleList
+      : []
 }

+ 9 - 1
src/store/modules/ibps/modules/param.js

@@ -3,8 +3,10 @@ export default {
   state: {
     // 所有菜单
     myform: '',
-    // 所有用户信息
+    // 所有用户信息带禁用过滤
     userList: [],
+    // 所有用户信息不带过滤
+    userListAll: [],
     // 所有部门信息
     deptList: [],
     deptListAll: [],
@@ -23,6 +25,9 @@ export default {
     userList(state, data) {
       state.userList = data.length ? data : []
     },
+    userListAll(state, data) {
+      state.userListAll = data.length ? data : []
+    },
     deptList(state, data) {
       state.deptList = data.length ? data : []
     },
@@ -40,6 +45,9 @@ export default {
     setUserList({ commit }, data) {
       commit('userList', data)
     },
+    setUserListAll({ commit }, data) {
+      commit('userListAll', data)
+    },
     setDeptList({ commit }, data) {
       commit('deptList', data)
     },

+ 37 - 10
src/store/modules/ibps/modules/user.js

@@ -123,10 +123,10 @@ export default {
                     second: hasFirst
                       ? ''
                       : [
-                        ...new Set(
-                          info.positions.map((obj) => obj.path.split('.')[1])
-                        )
-                      ].join(',')
+                          ...new Set(
+                            info.positions.map((obj) => obj.path.split('.')[1])
+                          )
+                        ].join(',')
                   }
                   await dispatch('ibps/param/setLevel', level, {
                     root: true
@@ -136,8 +136,10 @@ export default {
                 await dispatch('ibps/param/setSetting', await getSetting(), {
                   root: true
                 })
-                // 获取所有用户信息
+                // 获取所有用户信息带禁用过滤
                 await dispatch('getUserList', level)
+                // 获取所有用户信息不带过滤
+                await dispatch('getUserListAll', level)
                 // 获取所有部门信息
                 await dispatch('getDeptList', level)
                 await dispatch('ibps/page/getExampleList', null, { root: true })
@@ -245,14 +247,14 @@ export default {
       })
     },
     /**
-     * 获取所有系统用户账号
+     * 获取所有系统用户账号带禁用过滤
      */
     getUserList({ state, dispatch }, { first, second }) {
       const params = second
         ? `'%${second}%' or entity.id_ = '${first}'`
         : first
-          ? `'%${first}%'`
-          : '%%'
+        ? `'%${first}%'`
+        : '%%'
       // const sql = `select users.id_ as userId, users.name_ as userName, ifnull(users.mobile_, '') as phone, ifnull(group_concat(distinct positions.id_ order by positions.id_ separator ','), '') as positionId, ifnull(group_concat(distinct positions.name_ order by positions.id_ separator ','), '') as positions, ifnull(group_concat(distinct roles.id_ order by roles.role_note_ asc separator ','), '') as roleId, ifnull( group_concat( distinct roles.alias_ order by roles.role_note_ asc separator ',' ), '' ) as roleAlias, ifnull(group_concat(distinct roles.name_ order by roles.role_note_ asc separator ','), '') as roles, (select ifnull(people.qian_zi_tu_wen_, '') from t_ryjbqk as people where people.parent_id_ = users.id_ order by create_time_ desc limit 1) as signatureId, (select ifnull(files.file_name_, '') from ibps_file_attachment as files where files.id_ = signatureId) as signatureName from ibps_party_employee as users left join (select ur.user_id_, r.role_note_, group_concat(distinct r.id_ order by r.id_ separator ',') as id_, group_concat( distinct r.role_alias_ order by r.id_ separator ',' ) as alias_, group_concat(distinct r.name_ order by r.id_ separator ',') as name_ from ibps_party_user_role as ur join ibps_party_role as r on ur.role_id_ = r.id_ group by ur.user_id_) as roles on users.id_ = roles.user_id_ left join ibps_party_entity as positions on find_in_set(positions.id_, users.positions_) where exists (select 1 from ibps_party_entity as entity where find_in_set(entity.id_, users.positions_) and (entity.path_ like CONCAT('%', '${first}', '%'))) and users.status_ = 'actived' group by users.id_`
       common
         .request('query', {
@@ -270,6 +272,31 @@ export default {
           alert('获取所有用户信息失败!')
         })
     },
+    /**
+     * 获取所有系统用户账号
+     */
+    getUserListAll({ state, dispatch }, { first, second }) {
+      const params = second
+        ? `'%${second}%' or entity.id_ = '${first}'`
+        : first
+        ? `'%${first}%'`
+        : '%%'
+      common
+        .request('query', {
+          key: 'getUserListAll',
+          params: [first]
+        })
+        .then((res) => {
+          const { data = [] } = res.variables || {}
+          dispatch('ibps/param/setUserListAll', data, {
+            root: true
+          })
+        })
+        .catch((error) => {
+          console.log(error)
+          alert('获取所有用户信息失败!')
+        })
+    },
     /**
      * 获取所有系统部门信息
      */
@@ -277,8 +304,8 @@ export default {
       const params = second
         ? ` and (pe.path_ like '%${second}%' or pe.id_ = '${first}')`
         : first
-          ? ` and pe.path_ like '%${first}%'`
-          : ''
+        ? ` and pe.path_ like '%${first}%'`
+        : ''
       // const sql = `select id_ as positionId, name_ as positionName, path_ as path, depth_ as depth, sn_ as sn from ibps_party_entity where party_type_ = 'position'${params} order by depth_ asc, sn_ asc`
       // const sql = `select pe.id_ as positionId, pe.name_ as positionName, pe.path_ as path, pe.depth_ as depth, pe.party_alias_ as alias, pe.sn_ as sn, pe.parent_id_ as parentId, ifnull(r.name_, '') as manager, ifnull(r.id_, '') as managerId from ibps_party_entity as pe left join (select em.id_, em.positions_, em.name_ from ibps_party_employee as em left join ibps_party_user_role as ur on em.id_ = ur.user_id_ left join ibps_party_role as pr on pr.id_ = ur.role_id_ where role_alias_ in ('zhsfzr', 'syszr', 'zhglzzc')) as r on find_in_set(pe.id_, r.positions_) > 0 where pe.party_type_ = 'position' and pe.path_ like CONCAT('%', ${first}, '%') group by pe.id_ order by pe.depth_ asc, pe.sn_ asc,pe.id_ asc`
       // 部门负责人获取从指定角色改为部门最早设置的主负责人