Procházet zdrojové kódy

部门用户列表调整

cfort před 2 roky
rodič
revize
21aa2d71cb

+ 16 - 35
src/views/platform/org/position/detail/position-employee.vue

@@ -32,14 +32,10 @@
 </template>
 <script>
 import IbpsEmployeeSelectorDialog from '@/business/platform/org/employee/dialog'
-
 import { queryWithOrg as queryPageList, addPositionUser, removePositionUser } from '@/api/platform/org/employee'
-
 import ActionUtils from '@/utils/action'
-import { statusOption } from '../constants'
-import {
-    queryPageList as queryUserList
-} from '@/api/platform/org/employee'
+import { statusOptions, genderOptions } from '../../employee/constants'
+import { queryPageList as queryUserList } from '@/api/platform/org/employee'
 
 export default {
     components: {
@@ -89,19 +85,9 @@ export default {
                 columns: [
                     { prop: 'name', label: '姓名', width: '120' },
                     { prop: 'positionsName', label: '归属部门', hidden: false },
-                    { prop: 'gender',
-                        label: '性别',
-                        options: [{
-                            value: 'male',
-                            label: '男'
-                        },
-                        {
-                            value: 'female',
-                            label: '女',
-                            type: 'danger'
-                        }], width: '80' },
+                    { prop: 'gender', label: '性别', tags: genderOptions, width: '80' },
                     { prop: 'createTime', label: '创建时间', width: '150' },
-                    { prop: 'status', label: '状态', tags: statusOption, width: '120' }
+                    { prop: 'status', label: '状态', tags: statusOptions, width: '120' }
                 ],
                 rowHandle: {
                     actions: [
@@ -112,8 +98,7 @@ export default {
                         }
                     ]
                 }
-            },
-            statusOptions: statusOption
+            }
         }
     },
     watch: {
@@ -127,11 +112,7 @@ export default {
         },
         depth: {
             handler () {
-                if (!this.depth || this.depth > 3) {
-                    this.listConfig.columns[1].hidden = true
-                } else {
-                    this.listConfig.columns[1].hidden = false
-                }
+                this.listConfig.columns[1].hidden = this.depth === 4
             },
             immediate: true
         }
@@ -140,7 +121,7 @@ export default {
         this.getOrg()
     },
     methods: {
-    // 初始化数据
+        // 初始化数据
         loadData () {
             this.loading = true
             queryUserList(this.getSearcFormData()).then((response) => {
@@ -200,15 +181,15 @@ export default {
             return res
         },
         /**
-     * 处理排序
-     */
+         * 处理排序
+         */
         handleSortChange (sort) {
             ActionUtils.setSorts(this.sorts, sort)
             this.loadData()
         },
         /**
-     * 处理分页事件
-     */
+         * 处理分页事件
+         */
         handlePaginationChange (page) {
             ActionUtils.setPagination(this.pagination, page)
             this.loadData()
@@ -285,9 +266,9 @@ export default {
 }
 </script>
 <style lang="scss">
-.position-employee-dialog{
-  .el-dialog__body{
-    height:  calc(70vh - 190px) !important;
-  }
-}
+    .position-employee-dialog{
+        .el-dialog__body{
+            height:  calc(70vh - 190px) !important;
+        }
+    }
 </style>