Explorar o código

组织架构设置、角色设置页面增加页面标题,隐藏部分字段

cfort %!s(int64=3) %!d(string=hai) anos
pai
achega
d70fca218a
Modificáronse 2 ficheiros con 408 adicións e 395 borrados
  1. 100 89
      src/views/platform/org/org/detail/index.vue
  2. 308 306
      src/views/platform/org/role/list.vue

+ 100 - 89
src/views/platform/org/org/detail/index.vue

@@ -1,97 +1,108 @@
 <template>
-  <div class="main-container">
-    <el-tabs
-      v-model="activeName"
-      @tab-click="handleTabClick"
-    >
-      <el-tab-pane label="组织明细" name="detail">
-        <detail :id="id" readonly />
-      </el-tab-pane>
-      <el-tab-pane label="组织负责人" name="orgCharge">
-        <org-charge :id="id" :rights-arr="rightsArr" :height="height" :visible="activeName==='orgCharge'" />
-      </el-tab-pane>
-      <el-tab-pane label="行政岗位" name="position">
-        <org-position :id="id" :row-handle="rowHandle" :rights-arr="rightsArr" :height="height" :visible="activeName==='position'" />
-      </el-tab-pane>
-      <el-tab-pane label="组织人员" name="employee">
-        <org-employee :id="groundId" :rights-arr="rightsArr" :show-tree="showTree" :height="height" :visible="activeName==='employee'" />
-      </el-tab-pane>
-      <el-tab-pane label="扩展属性" name="extAttr">
-        <ext-attr :id="id" ref="attrForm" :height="height" :visible="activeName==='extAttr'" party-type="org" />
-      </el-tab-pane>
-      <el-tab-pane label="已分配角色" name="role">
-        <org-role :id="id" :is-auth="isAuth" :rights-arr="rightsArr" :height="height" :visible="activeName==='role'" />
-      </el-tab-pane>
-      <el-tab-pane label="组织分级管理" name="orgAuth">
-        <org-auth :org-id="id" :org-name="orgName" :is-edit="isEdit" :rights-arr="rightsArr" :height="height" :visible="activeName==='orgAuth'" />
-      </el-tab-pane>
-    </el-tabs>
-  </div>
-</template>
-<script>
-// 组件
-import Detail from '../edit'
-import OrgCharge from './org-charge'
-import OrgPosition from './org-position/index'
-import OrgEmployee from './org-employee'
-import OrgRole from './org-role'
-import OrgAuth from '../../auth/list'
-import ExtAttr from '../../components/attr/ext-attr'
-export default {
-  components: {
-    Detail,
-    OrgCharge,
-    OrgPosition,
-    OrgEmployee,
-    OrgRole,
-    OrgAuth,
-    ExtAttr
-  },
-  props: {
-    id: {
-      type: [String, Number]
+    <div class="main-container">
+      <div class="header">组织架构信息</div>
+      <el-tabs
+        v-model="activeName"
+        @tab-click="handleTabClick"
+      >
+        <el-tab-pane label="组织明细" name="detail">
+          <detail :id="id" readonly />
+        </el-tab-pane>
+        <el-tab-pane label="组织负责人" name="orgCharge">
+          <org-charge :id="id" :rights-arr="rightsArr" :height="height" :visible="activeName==='orgCharge'" />
+        </el-tab-pane>
+        <el-tab-pane label="行政岗位" name="position">
+          <org-position :id="id" :row-handle="rowHandle" :rights-arr="rightsArr" :height="height" :visible="activeName==='position'" />
+        </el-tab-pane>
+        <el-tab-pane label="组织人员" name="employee">
+          <org-employee :id="groundId" :rights-arr="rightsArr" :show-tree="showTree" :height="height" :visible="activeName==='employee'" />
+        </el-tab-pane>
+        <el-tab-pane label="扩展属性" name="extAttr">
+          <ext-attr :id="id" ref="attrForm" :height="height" :visible="activeName==='extAttr'" party-type="org" />
+        </el-tab-pane>
+        <el-tab-pane label="已分配角色" name="role">
+          <org-role :id="id" :is-auth="isAuth" :rights-arr="rightsArr" :height="height" :visible="activeName==='role'" />
+        </el-tab-pane>
+        <el-tab-pane label="组织分级管理" name="orgAuth">
+          <org-auth :org-id="id" :org-name="orgName" :is-edit="isEdit" :rights-arr="rightsArr" :height="height" :visible="activeName==='orgAuth'" />
+        </el-tab-pane>
+      </el-tabs>
+    </div>
+  </template>
+  <script>
+  // 组件
+  import Detail from '../edit'
+  import OrgCharge from './org-charge'
+  import OrgPosition from './org-position/index'
+  import OrgEmployee from './org-employee'
+  import OrgRole from './org-role'
+  import OrgAuth from '../../auth/list'
+  import ExtAttr from '../../components/attr/ext-attr'
+  export default {
+    components: {
+      Detail,
+      OrgCharge,
+      OrgPosition,
+      OrgEmployee,
+      OrgRole,
+      OrgAuth,
+      ExtAttr
     },
-    orgName: String,
-    isAuth: {
-      type: Boolean,
-      default: false
+    props: {
+      id: {
+        type: [String, Number]
+      },
+      orgName: String,
+      isAuth: {
+        type: Boolean,
+        default: false
+      },
+      rowHandle: {
+        type: Boolean,
+        default: false
+      },
+      rightsArr: {
+        type: Array,
+        default: () => []
+      },
+      isEdit: {
+        type: Boolean,
+        default: false
+      },
+      showTree: {
+        type: Boolean,
+        default: true
+      }
     },
-    rowHandle: {
-      type: Boolean,
-      default: false
+    data() {
+      return {
+        activeName: 'detail',
+        height: 500,
+        groundId: ''
+      }
     },
-    rightsArr: {
-      type: Array,
-      default: () => []
+    watch: {
+      id() {
+        this.activeName = 'detail'
+      }
     },
-    isEdit: {
-      type: Boolean,
-      default: false
+    mounted() {
+      this.height = this.$parent.$el.offsetHeight - 75
     },
-    showTree: {
-      type: Boolean,
-      default: true
-    }
-  },
-  data() {
-    return {
-      activeName: 'detail',
-      height: 500,
-      groundId: ''
-    }
-  },
-  watch: {
-    id() {
-      this.activeName = 'detail'
-    }
-  },
-  mounted() {
-    this.height = this.$parent.$el.offsetHeight - 75
-  },
-  methods: {
-    handleTabClick(tab) {
-      this.groundId = this.id
+    methods: {
+      handleTabClick(tab) {
+        this.groundId = this.id
+      }
     }
   }
-}
-</script>
+  </script>
+  <style lang="scss" scoped>
+      .main-container {
+          .header {
+              text-align: center;
+              font-size: 18px;
+              font-weight: bold;
+              width: 100%;
+          }
+      }
+  </style>

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

@@ -1,317 +1,319 @@
 <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"
-      @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"
-    />
-  </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 {
-  components: {
-    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: '角色别名' },
+    <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"
+      />
+    </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 {
+    components: {
+      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: [
             {
-              prop: 'Q^SYSTEM_ID_^SL',
-              label: '子系统',
-              fieldType: 'select',
-              valueKey: 'id',
-              labelKey: 'name',
-              resultField: 'data',
-              selectFetch: findAllSubsystem
+              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'
+            }]
+          }
         },
-        // 表格字段配置
-        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: []
-    }
-  },
-  created() {
-    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()
+        subsystemList: []
+      }
     },
-    /**
-     * 查询
-     */
-    search() {
+    created() {
       this.loadData()
     },
-    /**
-     * 处理按钮事件
-     */
-    handleAction(command, position, selection, data) {
-      switch (command) {
-        case 'search':// 查询
-          ActionUtils.setFirstPagination(this.pagination)
+    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
+        }
+      },
+      /**
+       * 处理编辑
+       */
+      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()
-          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
+        }).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>
+