Przeglądaj źródła

用户选择数据过滤,角色人员列表数据过滤

cfort 2 lat temu
rodzic
commit
d3dfbcf0c9

+ 42 - 42
src/api/platform/org/user.js

@@ -5,70 +5,70 @@ import { ORG_URL, OAUTH2_URL } from '@/api/baseUrl'
  *修改密码
  * @param {*} params
  */
-export function changePassword(params) {
-  return request({
-    url: ORG_URL() + '/user/change/passwd',
-    method: 'post',
-    isLoading: true,
-    data: params
-  })
+export function changePassword (params) {
+    return request({
+        url: ORG_URL() + '/user/change/passwd',
+        method: 'post',
+        isLoading: true,
+        data: params
+    })
 }
 
 /**
  * 查询列表数据[用于用户选择器使用]
  * @param {*} params
  */
-export function query(type, params) {
-  var url = '/employee/query'
-  if (type === 'org') {
-    url = '/user/query4Org'
-  } else if (type === 'position') {
-    url = '/user/query4Position'
-  } else if (type === 'role') {
-    url = '/user/query4Role'
-  } else if (type === 'group') {
-    url = '/user/query4Group'
-  }
-  return request({
-    url: ORG_URL() + url,
-    method: 'post',
-    data: params
-  })
+export function query (type, params) {
+    var url = '/employee/query'
+    if (type === 'org') {
+        url = '/user/query4Org'
+    } else if (type === 'position') {
+        url = '/user/query4Position'
+    } else if (type === 'role') {
+        url = '/user/query4Role'
+    } else if (type === 'group') {
+        url = '/user/query4Group'
+    }
+    return request({
+        url: ORG_URL() + url,
+        method: 'post',
+        data: params
+    })
 }
 
 /**
  * 获取用户信息
  * @param {*} params
  */
-export function get(params) {
-  return request({
-    url: ORG_URL() + '/user/get',
-    method: 'get',
-    params: params
-  })
+export function get (params) {
+    return request({
+        url: ORG_URL() + '/user/get',
+        method: 'get',
+        params: params
+    })
 }
 
 /**
  * 通过账号获取用户信息
  * @param {*} params
  */
-export function getByAccount(params) {
-  return request({
-    url: ORG_URL() + '/user/getByAccount',
-    method: 'get',
-    params: params
-  })
+export function getByAccount (params) {
+    return request({
+        url: ORG_URL() + '/user/getByAccount',
+        method: 'get',
+        params: params
+    })
 }
 
 /**
  *修改密码(注册用户认证服务)
  * @param {*} params
  */
-export function registerChangePassword(params) {
-  return request({
-    url: OAUTH2_URL() + '/user/register/change/passwd',
-    method: 'post',
-    isLoading: true,
-    data: params
-  })
+export function registerChangePassword (params) {
+    return request({
+        url: OAUTH2_URL() + '/user/register/change/passwd',
+        method: 'post',
+        isLoading: true,
+        data: params
+    })
 }

+ 9 - 1
src/business/platform/org/employee/panel.vue

@@ -304,7 +304,15 @@ export default {
                     this.loading = false
                 })
             } else {
-                queryPageList(this.getFormatParams()).then(response => {
+                // 过滤数据
+                const { first = '', second = '' } = this.$store.getters.level
+                const { isSuper = '', account = '' } = this.$store.getters
+                const special = ['admin', 'jinyuan']
+                let t = { position: second || first }
+                if (special.includes(account) && isSuper) {
+                    t = null
+                }
+                queryPageList(this.getFormatParams(), t).then(response => {
                     this.loading = false
                     ActionUtils.handleListData(this, response.data)
                     this.setSelectRow()

+ 2 - 2
src/store/modules/ibps/modules/user.js

@@ -169,7 +169,7 @@ export default {
          */
         getUserList ({ state, dispatch }, { first, second }) {
             const params = second ? `'%${second}%' or entity.id_ = '${first}'` : first ? `'%${first}%'` : '%%'
-            const sql = `select users.id_ as userId, users.name_ as userName, users.mobile_ as phone, (select ifnull(GROUP_CONCAT(DISTINCT roles.name_ SEPARATOR ','), '') from ibps_party_entity as roles where find_in_set(roles.id_, users.job_)) as roles, (select ifnull(GROUP_CONCAT(DISTINCT positions.name_ SEPARATOR ','), '') from ibps_party_entity as positions where find_in_set(positions.id_, users.positions_)) as positions from ibps_party_employee as users where exists (select 1 from ibps_party_entity as entity where find_in_set(entity.id_, users.positions_) and (entity.path_ like ${params}))`
+            const sql = `select users.id_ as userId, users.name_ as userName, users.mobile_ as phone, users.positions_ as positionId, users.job_ as roleId, (select ifnull(GROUP_CONCAT(DISTINCT roles.name_ SEPARATOR ','), '') from ibps_party_entity as roles where find_in_set(roles.id_, users.job_)) as roles, (select ifnull(GROUP_CONCAT(DISTINCT positions.name_ SEPARATOR ','), '') from ibps_party_entity as positions where find_in_set(positions.id_, users.positions_)) as positions from ibps_party_employee as users where exists (select 1 from ibps_party_entity as entity where find_in_set(entity.id_, users.positions_) and (entity.path_ like ${params}))`
             common.request('sql', sql).then(res => {
                 const { data = [] } = res.variables || {}
                 dispatch('ibps/param/setUserList', data, {
@@ -185,7 +185,7 @@ export default {
          */
         getDeptList ({ state, dispatch }, { first, second }) {
             const params = second ? ` and (path_ like '%${second}%' or id_ = '${first}')` : first ? ` and path_ like '%${first}%'` : ''
-            const sql = `select id_ as positionId, name_ as positionName, path_ as path from ibps_party_entity where party_type_ = 'position'${params}`
+            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`
             common.request('sql', sql).then(res => {
                 const { data = [] } = res.variables || {}
                 dispatch('ibps/param/setDeptList', data, {

+ 2 - 2
src/views/platform/org/employee/list.vue

@@ -318,10 +318,10 @@ export default {
         // 加载数据
         loadData () {
             this.loading = true
-            const { first = '' } = this.$store.getters.level
+            const { first = '', second = '' } = this.$store.getters.level
             const { isSuper = '', account = '' } = this.$store.getters
             const special = ['admin', 'jinyuan']
-            let t = { position: first }
+            let t = { position: second || first }
             if (special.includes(account) && isSuper) {
                 t = null
             }

+ 316 - 308
src/views/platform/org/role/list.vue

@@ -1,319 +1,327 @@
 <template>
     <div class="main-container">
-      <ibps-crud
-        ref="crud"
-        :height="height"
-        :data="listData"
-        :toolbars="listConfig.toolbars"
-        :search-form="listConfig.searchForm"
-        :pk-key="pkKey"
-        :columns="listConfig.columns"
-        :row-handle="listConfig.rowHandle"
-        :pagination="pagination"
-        :loading="loading"
-        displayField="角色设置列表"
-        @action-event="handleAction"
-        @sort-change="handleSortChange"
-        @pagination-change="handlePaginationChange"
-      />
-      <edit
-        :id="editId"
-        :title="title"
-        :visible="dialogFormVisible"
-        :readonly="readonly"
-        @callback="search"
-        @close="visible => dialogFormVisible = visible"
-      />
-      <copy
-        :id="editId"
-        :data="data"
-        :visible="copyFormVisible"
-        :title="title"
-        @callback="search"
-        @close="visible => copyFormVisible = visible"
-      />
-      <user-list
-        :id="editId"
-        :visible="dialogUserListVisible"
-        @close="visible => dialogUserListVisible = visible"
-      />
-      <assign-resource
-        :id="editId"
-        :system-id="systemId"
-        :type="assignResourceType"
-        :visible="dialogAssignResourceVisible"
-        @callback="search"
-        @close="visible => dialogAssignResourceVisible = visible"
-      />
-      <!-- API 授权申请 -->
-      <client-grant
-        :title="title"
-        :client-key="clientKey"
-        :grant-type="grantType"
-        :visible="apiGrantVisible"
-        @callback="search"
-        @close="visible => apiGrantVisible = visible"
-        @closeAll="closeAll"
-      />
+        <ibps-crud
+            ref="crud"
+            :height="height"
+            :data="listData"
+            :toolbars="listConfig.toolbars"
+            :search-form="listConfig.searchForm"
+            :pk-key="pkKey"
+            :columns="listConfig.columns"
+            :row-handle="listConfig.rowHandle"
+            :pagination="pagination"
+            :loading="loading"
+            display-field="角色设置列表"
+            @action-event="handleAction"
+            @sort-change="handleSortChange"
+            @pagination-change="handlePaginationChange"
+        />
+        <edit
+            :id="editId"
+            :title="title"
+            :visible="dialogFormVisible"
+            :readonly="readonly"
+            @callback="search"
+            @close="visible => dialogFormVisible = visible"
+        />
+        <copy
+            :id="editId"
+            :data="data"
+            :visible="copyFormVisible"
+            :title="title"
+            @callback="search"
+            @close="visible => copyFormVisible = visible"
+        />
+        <user-list
+            :id="editId"
+            :visible="dialogUserListVisible"
+            :position-list="positionList"
+            @close="visible => dialogUserListVisible = visible"
+        />
+        <assign-resource
+            :id="editId"
+            :system-id="systemId"
+            :type="assignResourceType"
+            :visible="dialogAssignResourceVisible"
+            @callback="search"
+            @close="visible => dialogAssignResourceVisible = visible"
+        />
+        <!-- API 授权申请 -->
+        <client-grant
+            :title="title"
+            :client-key="clientKey"
+            :grant-type="grantType"
+            :visible="apiGrantVisible"
+            @callback="search"
+            @close="visible => apiGrantVisible = visible"
+            @closeAll="closeAll"
+        />
     </div>
-  </template>
-  
-  <script>
-  import { queryPageList, remove } from '@/api/platform/org/role'
-  import { findAllSubsystem } from '@/api/platform/auth/subsystem'
-  import ActionUtils from '@/utils/action'
-  import FixHeight from '@/mixins/height'
-  import Edit from './edit'
-  import ClientGrant from '@/views/platform/auth/client/grant/index'
-  import UserList from './user-list'
-  import AssignResource from './assign-resource'
-  import Copy from './copy'
-  
-  export default {
+</template>
+
+<script>
+import { queryPageList, remove } from '@/api/platform/org/role'
+import { findAllSubsystem } from '@/api/platform/auth/subsystem'
+import ActionUtils from '@/utils/action'
+import FixHeight from '@/mixins/height'
+import Edit from './edit'
+import ClientGrant from '@/views/platform/auth/client/grant/index'
+import UserList from './user-list'
+import AssignResource from './assign-resource'
+import Copy from './copy'
+
+export default {
     components: {
-      Edit,
-      ClientGrant,
-      UserList,
-      AssignResource,
-      Copy
+        Edit,
+        ClientGrant,
+        UserList,
+        AssignResource,
+        Copy
     },
     mixins: [FixHeight],
-    data() {
-      return {
-        dialogFormVisible: false, // 弹窗
-        editId: '', // 编辑dialog需要使用
-        systemId: '',
-        dialogUserListVisible: false,
-        dialogAssignResourceVisible: false,
-        apiGrantVisible: false,
-        copyFormVisible: false, // 复制角色信息弹窗
-        data: {},
-  
-        readonly: false, // 是否只读
-        pkKey: 'id', // 主键  如果主键不是pk需要传主键
-  
-        clientKey: '',
-        grantType: '',
-  
-        assignResourceType: '',
-  
-        title: '',
-        loading: true,
-        height: document.clientHeight,
-        pagination: {},
-        sorts: {},
-        listData: [],
-        listConfig: {
-          toolbars: [
-            {
-              key: 'search'
-            }, {
-              key: 'add'
-            }, {
-              key: 'edit'
-            }, {
-              key: 'remove'
-            }
-          ],
-          searchForm: {
-            forms: [
-              { prop: 'Q^NAME_^SL', label: '角色名称' },
-              { prop: 'Q^ROLE_ALIAS_^SL', label: '角色别名' },
-              // {
-              //   prop: 'Q^SYSTEM_ID_^SL',
-              //   label: '子系统',
-              //   fieldType: 'select',
-              //   valueKey: 'id',
-              //   labelKey: 'name',
-              //   resultField: 'data',
-              //   selectFetch: findAllSubsystem
-              // }
-            ]
-          },
-          // 表格字段配置
-          columns: [
-            { prop: 'name', label: '角色名称' },
-            { prop: 'roleAlias', label: '角色别名' },
-          //   { prop: 'subSystemName', label: '子系统名称' }
-          ],
-          rowHandle: {
-            actions: [{
-              key: 'copy',
-              label: '复制',
-              icon: 'ibps-icon-copy'
-            }, {
-              key: 'userList',
-              label: '人员列表',
-              icon: 'ibps-icon-detail'
-            }, {
-              key: 'assignResource',
-              label: '资源分配',
-              icon: 'ibps-icon-dashboard'
-            }, {
-              key: 'appAssignResource',
-              label: 'App资源分配',
-              icon: 'ibps-icon-dashboard'
-            }, {
-              key: 'authApiGrant',
-              label: '接口授权',
-              icon: 'ibps-icon-ticket'
-            },{
-              key: 'remove'
-            }, {
-              key: 'detail'
-            },{
-              key: 'edit'
-            }]
-          }
-        },
-        subsystemList: []
-      }
+    data () {
+        return {
+            dialogFormVisible: false, // 弹窗
+            editId: '', // 编辑dialog需要使用
+            systemId: '',
+            dialogUserListVisible: false,
+            dialogAssignResourceVisible: false,
+            apiGrantVisible: false,
+            copyFormVisible: false, // 复制角色信息弹窗
+            data: {},
+            readonly: false, // 是否只读
+            pkKey: 'id', // 主键  如果主键不是pk需要传主键
+            clientKey: '',
+            grantType: '',
+            assignResourceType: '',
+            title: '',
+            loading: true,
+            height: document.clientHeight,
+            pagination: {},
+            sorts: {},
+            listData: [],
+            listConfig: {
+                toolbars: [
+                    {
+                        key: 'search'
+                    }, {
+                        key: 'add'
+                    }, {
+                        key: 'edit'
+                    }, {
+                        key: 'remove'
+                    }
+                ],
+                searchForm: {
+                    forms: [
+                        { prop: 'Q^NAME_^SL', label: '角色名称' },
+                        { prop: 'Q^ROLE_ALIAS_^SL', label: '角色别名' }
+                        // {
+                        //   prop: 'Q^SYSTEM_ID_^SL',
+                        //   label: '子系统',
+                        //   fieldType: 'select',
+                        //   valueKey: 'id',
+                        //   labelKey: 'name',
+                        //   resultField: 'data',
+                        //   selectFetch: findAllSubsystem
+                        // }
+                    ]
+                },
+                // 表格字段配置
+                columns: [
+                    { prop: 'name', label: '角色名称' },
+                    { prop: 'roleAlias', label: '角色别名' }
+                    //   { prop: 'subSystemName', label: '子系统名称' }
+                ],
+                rowHandle: {
+                    actions: [{
+                        key: 'copy',
+                        label: '复制',
+                        icon: 'ibps-icon-copy'
+                    }, {
+                        key: 'userList',
+                        label: '人员列表',
+                        icon: 'ibps-icon-detail'
+                    }, {
+                        key: 'assignResource',
+                        label: '资源分配',
+                        icon: 'ibps-icon-dashboard'
+                    }, {
+                        key: 'appAssignResource',
+                        label: 'App资源分配',
+                        icon: 'ibps-icon-dashboard'
+                    }, {
+                        key: 'authApiGrant',
+                        label: '接口授权',
+                        icon: 'ibps-icon-ticket'
+                    }, {
+                        key: 'remove'
+                    }, {
+                        key: 'detail'
+                    }, {
+                        key: 'edit'
+                    }]
+                }
+            },
+            subsystemList: [],
+            positionList: []
+        }
     },
-    created() {
-      this.loadData()
+    created () {
+        this.getPosition().then(() => {
+            this.loadData()
+        })
     },
     methods: {
-  
-      // 加载数据
-      loadData() {
-        this.loading = true
-        queryPageList(this.getSearcFormData()).then(response => {
-          ActionUtils.handleListData(this, response.data)
-          this.loading = false
-        }).catch(() => {
-          this.loading = false
-        })
-      },
-      /**
-       * 获取格式化参数
-       */
-      getSearcFormData() {
-        return ActionUtils.formatParams(
-          this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {},
-          this.pagination,
-          this.sorts)
-      },
-      /**
-       * 处理分页事件
-       */
-      handlePaginationChange(page) {
-        ActionUtils.setPagination(this.pagination, page)
-        this.loadData()
-      },
-      /**
-       * 处理排序
-       */
-      handleSortChange(sort) {
-        ActionUtils.setSorts(this.sorts, sort)
-        this.loadData()
-      },
-      /**
-       * 查询
-       */
-      search() {
-        this.loadData()
-      },
-      /**
-       * 处理按钮事件
-       */
-      handleAction(command, position, selection, data) {
-        switch (command) {
-          case 'search':// 查询
-            ActionUtils.setFirstPagination(this.pagination)
-            this.search()
-            break
-          case 'add':// 添加
-            this.handleEdit()
-            this.title = '添加角色'
-            break
-          case 'edit':// 编辑
-            ActionUtils.selectedRecord(selection).then((id) => {
-              this.handleEdit(id)
-              this.title = '编辑角色'
-            }).catch(() => { })
-            break
-          case 'detail':// 明细
-            ActionUtils.selectedRecord(selection).then((id) => {
-              this.handleEdit(id, true)
-              this.title = '角色明细'
-            }).catch(() => { })
-            break
-          case 'copy':// 复制
-            this.title = '复制角色'
-            this.data = data
-            this.handleCopy(selection)
-            break
-          case 'remove':// 删除
-            ActionUtils.removeRecord(selection).then((ids) => {
-              this.handleRemove(ids)
-            }).catch(() => { })
-            break
-          case 'userList':// 人员列表
-            this.handleUserList(selection)
-            break
-          case 'assignResource':// 资源分配
-            this.handleAsignResource(selection, data.subSystemId, '')
-            break
-          case 'appAssignResource':// app资源分配
-            this.handleAsignResource(selection, data.subSystemId, 'app')
-            break
-          case 'authApiGrant':// 接口授权申请
-            ActionUtils.selectedRecord(selection).then((id) => {
-              this.handleApiGrant(id)
-              this.title = '接口授权申请'
-              this.clientKey = data.roleAlias
-              this.grantType = 'role'
-            }).catch(() => { })
-            break
-          default:
-            break
+        // 获取组织的数据
+        getPosition () {
+            return new Promise((resolve, reject) => {
+                const sql = `select a.ID_ as ID_, a.NAME_ as NAME_, b.path_ as PATH_ FROM ibps_party_position a, ibps_party_entity b where a.id_ = b.id_`
+                this.$common.request('sql', sql).then((res) => {
+                    this.positionList = res.variables.data || []
+                    resolve()
+                })
+            })
+        },
+        // 加载数据
+        loadData () {
+            this.loading = true
+            queryPageList(this.getSearcFormData()).then(response => {
+                ActionUtils.handleListData(this, response.data)
+                this.loading = false
+            }).catch(() => {
+                this.loading = false
+            })
+        },
+        /**
+         * 获取格式化参数
+         */
+        getSearcFormData () {
+            return ActionUtils.formatParams(
+                this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {},
+                this.pagination,
+                this.sorts)
+        },
+        /**
+         * 处理分页事件
+         */
+        handlePaginationChange (page) {
+            ActionUtils.setPagination(this.pagination, page)
+            this.loadData()
+        },
+        /**
+         * 处理排序
+         */
+        handleSortChange (sort) {
+            ActionUtils.setSorts(this.sorts, sort)
+            this.loadData()
+        },
+        /**
+         * 查询
+         */
+        search () {
+            this.loadData()
+        },
+        /**
+         * 处理按钮事件
+         */
+        handleAction (command, position, selection, data) {
+            switch (command) {
+                case 'search':// 查询
+                    ActionUtils.setFirstPagination(this.pagination)
+                    this.search()
+                    break
+                case 'add':// 添加
+                    this.handleEdit()
+                    this.title = '添加角色'
+                    break
+                case 'edit':// 编辑
+                    ActionUtils.selectedRecord(selection).then((id) => {
+                        this.handleEdit(id)
+                        this.title = '编辑角色'
+                    }).catch(() => { })
+                    break
+                case 'detail':// 明细
+                    ActionUtils.selectedRecord(selection).then((id) => {
+                        this.handleEdit(id, true)
+                        this.title = '角色明细'
+                    }).catch(() => { })
+                    break
+                case 'copy':// 复制
+                    this.title = '复制角色'
+                    this.data = data
+                    this.handleCopy(selection)
+                    break
+                case 'remove':// 删除
+                    ActionUtils.removeRecord(selection).then((ids) => {
+                        this.handleRemove(ids)
+                    }).catch(() => { })
+                    break
+                case 'userList':// 人员列表
+                    this.handleUserList(selection)
+                    break
+                case 'assignResource':// 资源分配
+                    this.handleAsignResource(selection, data.subSystemId, '')
+                    break
+                case 'appAssignResource':// app资源分配
+                    this.handleAsignResource(selection, data.subSystemId, 'app')
+                    break
+                case 'authApiGrant':// 接口授权申请
+                    ActionUtils.selectedRecord(selection).then((id) => {
+                        this.handleApiGrant(id)
+                        this.title = '接口授权申请'
+                        this.clientKey = data.roleAlias
+                        this.grantType = 'role'
+                    }).catch(() => { })
+                    break
+                default:
+                    break
+            }
+        },
+        /**
+         * 处理编辑
+         */
+        handleEdit (id = '', readonly = false) {
+            this.editId = id
+            this.readonly = readonly
+            this.dialogFormVisible = true
+        },
+        /**
+         * 复制角色信息
+         */
+        handleCopy (id) {
+            this.copyFormVisible = true
+            this.editId = id
+        },
+        /**
+         * 接口授权申请
+         */
+        handleApiGrant (id = '') {
+            this.editId = id
+            this.apiGrantVisible = true
+        },
+        /**
+         * 处理删除
+         */
+        handleRemove (ids) {
+            remove({ roleIds: ids }).then(response => {
+                ActionUtils.removeSuccessMessage()
+                this.search()
+            }).catch(() => {})
+        },
+        handleUserList (id) {
+            this.editId = id
+            this.dialogUserListVisible = true
+        },
+        handleAsignResource (id, systemId, type) {
+            this.assignResourceType = type
+            this.editId = id
+            this.systemId = systemId
+            this.dialogAssignResourceVisible = true
+        },
+        closeAll () {
+            this.apiGrantVisible = false
         }
-      },
-      /**
-       * 处理编辑
-       */
-      handleEdit(id = '', readonly = false) {
-        this.editId = id
-        this.readonly = readonly
-        this.dialogFormVisible = true
-      },
-      /**
-       * 复制角色信息
-       */
-      handleCopy(id) {
-        this.copyFormVisible = true
-        this.editId = id
-      },
-      /**
-       * 接口授权申请
-       */
-      handleApiGrant(id = '') {
-        this.editId = id
-        this.apiGrantVisible = true
-      },
-      /**
-       * 处理删除
-       */
-      handleRemove(ids) {
-        remove({ roleIds: ids }).then(response => {
-          ActionUtils.removeSuccessMessage()
-          this.search()
-        }).catch(() => {})
-      },
-      handleUserList(id) {
-        this.editId = id
-        this.dialogUserListVisible = true
-      },
-      handleAsignResource(id, systemId, type) {
-        this.assignResourceType = type
-        this.editId = id
-        this.systemId = systemId
-        this.dialogAssignResourceVisible = true
-      },
-      closeAll() {
-        this.apiGrantVisible = false
-      }
     }
-  }
-  </script>
-  
+}
+</script>

+ 233 - 194
src/views/platform/org/role/user-list.vue

@@ -1,42 +1,42 @@
 <template>
-  <el-dialog
-    :visible.sync="dialogVisible"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    append-to-body
-    width="60%"
-    title="人员列表"
-    class="user-list-dialog"
-    @open="loadData"
-    @close="closeDialog"
-  >
-    <ibps-crud
-      ref="crud"
-      v-loading="dialogLoading"
-      :element-loading-text="$t('common.loading')"
-      :pk-key="pkKey"
-      :height="height"
-      :data="listData"
-      :toolbars="listConfig.toolbars"
-      :columns="listConfig.columns"
-      :row-handle="listConfig.rowHandle"
-      :pagination="pagination"
-      :loading="loading"
-      @action-event="handleAction"
-      @sort-change="handleSortChange"
-      @pagination-change="handlePaginationChange"
-    />
-    <!-- 人员选择器 -->
-    <ibps-employee-selector-dialog
-      :visible="selectorVisible"
-      :value="[]"
-      :show-tree="false"
-      title="人员选择器"
-      multiple
-      @close="visible => selectorVisible = visible"
-      @action-event="handleSelectorActionEvent"
-    />
-  </el-dialog>
+    <el-dialog
+        :visible.sync="dialogVisible"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        append-to-body
+        width="60%"
+        title="人员列表"
+        class="user-list-dialog"
+        @open="loadData"
+        @close="closeDialog"
+    >
+        <ibps-crud
+            ref="crud"
+            v-loading="dialogLoading"
+            :element-loading-text="$t('common.loading')"
+            :pk-key="pkKey"
+            :height="height"
+            :data="listData"
+            :toolbars="listConfig.toolbars"
+            :columns="listConfig.columns"
+            :row-handle="listConfig.rowHandle"
+            :pagination="pagination"
+            :loading="loading"
+            @action-event="handleAction"
+            @sort-change="handleSortChange"
+            @pagination-change="handlePaginationChange"
+        />
+        <!-- 人员选择器 -->
+        <ibps-employee-selector-dialog
+            :visible="selectorVisible"
+            :value="[]"
+            :show-tree="false"
+            title="人员选择器"
+            multiple
+            @close="visible => selectorVisible = visible"
+            @action-event="handleSelectorActionEvent"
+        />
+    </el-dialog>
 </template>
 <script>
 import IbpsEmployeeSelectorDialog from '@/business/platform/org/employee/dialog'
@@ -45,172 +45,211 @@ import { statusOptions, genderOptions } from '../employee/constants'
 import { sourceOptions } from './constants'
 import ActionUtils from '@/utils/action'
 export default {
-  components: {
-    IbpsEmployeeSelectorDialog
-  },
-  props: {
-    visible: {
-      type: Boolean,
-      default: false
+    components: {
+        IbpsEmployeeSelectorDialog
     },
-    id: String
-  },
-  data() {
-    return {
-      selectorVisible: false,
-
-      dialogLoading: false,
-      dialogVisible: false,
-
-      loading: false,
-      height: document.clientHeight,
-      pkKey: 'id',
-      pagination: {},
-      sorts: {},
-      listData: [],
-      listConfig: {
-        toolbars: [{
-          key: 'add',
-          label: '设置'
-        }, {
-          key: 'remove',
-          label: '移除'
+    props: {
+        visible: {
+            type: Boolean,
+            default: false
+        },
+        id: String,
+        positionList: {
+            type: Array,
+            default: () => []
         }
-        ],
-        // 表格字段配置
-        columns: [
-          { prop: 'name', label: '姓名' },
-          { prop: 'account', label: '用户名' },
-          { prop: 'orgName', label: '归属组织路径' },
-          { prop: 'gender', label: '性别', tags: genderOptions },
-          { prop: 'createTime', label: '创建时间' },
-          { prop: 'status', label: '状态', tags: statusOptions },
-          { prop: 'source', label: '用户来源', tags: sourceOptions }
-        ]
-      }
-    }
-  },
-  watch: {
-    visible: {
-      handler: function(val, oldVal) {
-        this.dialogVisible = this.visible
-      },
-      immediate: true
-    }
-  },
-  mounted() {
-    this.height = 455
-  },
-  methods: {
-    // 加载数据
-    loadData() {
-      this.loading = true
-      queryPageList(this.getSearcFormData()).then(response => {
-        ActionUtils.handleListData(this, response.data)
-        this.loading = false
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    /**
-     * 获取格式化参数
-     */
-    getSearcFormData() {
-      return ActionUtils.formatParams({
-        roleId: this.id
-      }, this.pagination, this.sorts)
-    },
-    /**
-     * 处理分页事件
-     */
-    handlePaginationChange(page) {
-      ActionUtils.setPagination(this.pagination, page)
-      this.loadData()
-    },
-    /**
-     * 处理排序
-     */
-    handleSortChange(sort) {
-      ActionUtils.setSorts(this.sorts, sort)
-      this.loadData()
-    },
-    /**
-     * 查询
-     */
-    search() {
-      this.loadData()
-    },
-    closeDialog() {
-      this.$emit('close', false)
-    },
-    /**
-     * 处理按钮事件
-     */
-    handleAction(command, position, selection, data) {
-      switch (command) {
-        case 'add':// 添加
-          this.handleAdd()
-          break
-        case 'remove':// 删除
-          ActionUtils.removeRecord(selection).then((ids) => {
-            this.handleRemove(ids)
-          }).catch(() => { })
-          break
-        default:
-          break
-      }
     },
-    // 处理 加入人员
-    handleAdd() {
-      this.selectorVisible = true
+    data () {
+        const { account = '', deptList = [] } = this.$store.getters
+        return {
+            account,
+            deptList,
+            selectorVisible: false,
+            dialogLoading: false,
+            dialogVisible: false,
+            loading: false,
+            height: document.clientHeight,
+            pkKey: 'id',
+            pagination: {},
+            sorts: {},
+            listData: [],
+            listConfig: {
+                toolbars: [{
+                    key: 'add',
+                    label: '设置'
+                }, {
+                    key: 'remove',
+                    label: '移除'
+                }
+                ],
+                // 表格字段配置
+                columns: [
+                    { prop: 'name', label: '姓名', width: '100px' },
+                    { prop: 'account', label: '用户名', width: '90px' },
+                    { prop: 'positionsPath', label: '归属组织路径' },
+                    { prop: 'gender', label: '性别', tags: genderOptions, width: '60px' },
+                    { prop: 'createTime', label: '创建时间', width: '140px' },
+                    { prop: 'status', label: '状态', tags: statusOptions, width: '75px' },
+                    { prop: 'source', label: '用户来源', tags: sourceOptions, width: '85px' }
+                ]
+            }
+        }
     },
-    handleSelectorActionEvent(buttonKey, data) {
-      switch (buttonKey) {
-        case 'confirm':// 确定
-          this.handleConfirm(data)
-          break
-      }
+    watch: {
+        visible: {
+            handler: function (val, oldVal) {
+                this.dialogVisible = this.visible
+            },
+            immediate: true
+        }
     },
-    handleConfirm(data) {
-      this.selectorVisible = false
-      addRoleUser({
-        roleId: this.id,
-        userIds: data.map((d) => { return d.id }).join(',')
-      }).then(response => {
-        this.selectorVisible = false
-        ActionUtils.success('加入人员成功!')
-        this.search()
-      })
+    mounted () {
+        this.height = 455
     },
-    /**
-     * 处理删除
-     */
-    handleRemove(ids) {
-      if (!this.$utils.isEmpty(ids)) {
-        for (let i = 0, arr = ids.split(','); i < arr.length; i++) {
-          for (let j = 0, listData = this.listData; j < listData.length; j++) {
-            if (listData[j].id === arr[i] && listData[j].source !== 'role') {
-              this.$message({
-                message: '【' + listData[j].name + '】是非自有角色用户,不允许删除,需要移除请到对应来源移除用户',
-                type: 'fail'
-              })
-              return
+    methods: {
+        getPositionsPath (valueList) {
+            const postList = valueList.split(',')
+            const list = []
+            if (!postList.length) {
+                return ''
+            }
+            postList.forEach((item) => {
+                const temp = this.positionList.find(i => i.ID_ === item)
+                const pathList = temp ? temp.PATH_.split('.') : []
+                let p = ''
+                pathList.filter(i => i).forEach(k => {
+                    const t = this.positionList.find(i => i.ID_ === k)
+                    p += `${t.NAME_}.`
+                })
+                list.push(p)
+            })
+            return list.join('\r\n')
+        },
+        // 加载数据
+        loadData () {
+            this.loading = true
+            queryPageList(this.getSearcFormData()).then(response => {
+                const { dataResult = [] } = response.data || {}
+                const newData = []
+                dataResult.forEach(item => {
+                    if (item.positions) {
+                        const inner = this.deptList.some(i => item.positions.includes(i.positionId))
+                        // 转换岗位路径
+                        const path = this.getPositionsPath(item.positions)
+                        this.$set(item, 'positionsPath', path)
+                        if (inner) {
+                            newData.push(item)
+                        }
+                    }
+                })
+                if (this.account !== 'jinyuan') {
+                    response.data.dataResult = newData
+                }
+                ActionUtils.handleListData(this, response.data)
+                this.loading = false
+            }).catch(() => {
+                this.loading = false
+            })
+        },
+        /**
+         * 获取格式化参数
+         */
+        getSearcFormData () {
+            return ActionUtils.formatParams({
+                roleId: this.id
+            }, this.pagination, this.sorts)
+        },
+        /**
+         * 处理分页事件
+         */
+        handlePaginationChange (page) {
+            ActionUtils.setPagination(this.pagination, page)
+            this.loadData()
+        },
+        /**
+         * 处理排序
+         */
+        handleSortChange (sort) {
+            ActionUtils.setSorts(this.sorts, sort)
+            this.loadData()
+        },
+        /**
+         * 查询
+         */
+        search () {
+            this.loadData()
+        },
+        closeDialog () {
+            this.$emit('close', false)
+        },
+        /**
+         * 处理按钮事件
+         */
+        handleAction (command, position, selection, data) {
+            switch (command) {
+                case 'add':// 添加
+                    this.handleAdd()
+                    break
+                case 'remove':// 删除
+                    ActionUtils.removeRecord(selection).then((ids) => {
+                        this.handleRemove(ids)
+                    }).catch(() => { })
+                    break
+                default:
+                    break
             }
-          }
+        },
+        // 处理 加入人员
+        handleAdd () {
+            this.selectorVisible = true
+        },
+        handleSelectorActionEvent (buttonKey, data) {
+            switch (buttonKey) {
+                case 'confirm':// 确定
+                    this.handleConfirm(data)
+                    break
+            }
+        },
+        handleConfirm (data) {
+            this.selectorVisible = false
+            addRoleUser({
+                roleId: this.id,
+                userIds: data.map((d) => { return d.id }).join(',')
+            }).then(response => {
+                this.selectorVisible = false
+                ActionUtils.success('加入人员成功!')
+                this.search()
+            })
+        },
+        /**
+         * 处理删除
+         */
+        handleRemove (ids) {
+            if (!this.$utils.isEmpty(ids)) {
+                for (let i = 0, arr = ids.split(','); i < arr.length; i++) {
+                    for (let j = 0, listData = this.listData; j < listData.length; j++) {
+                        if (listData[j].id === arr[i] && listData[j].source !== 'role') {
+                            this.$message({
+                                message: '【' + listData[j].name + '】是非自有角色用户,不允许删除,需要移除请到对应来源移除用户',
+                                type: 'fail'
+                            })
+                            return
+                        }
+                    }
+                }
+            }
+            removeRoleUser({ roleId: this.id, userIds: ids }).then(response => {
+                ActionUtils.removeSuccessMessage()
+                this.search()
+            }).catch(() => {})
         }
-      }
-      removeRoleUser({ roleId: this.id, userIds: ids }).then(response => {
-        ActionUtils.removeSuccessMessage()
-        this.search()
-      }).catch(() => {})
     }
-  }
 }
 </script>
 <style lang="scss">
- .user-list-dialog{
-   .el-dialog__body{
-     padding: 0;
-   }
- }
+    .user-list-dialog{
+        .el-dialog__body{
+            padding: 0;
+        }
+    }
 </style>