Forráskód Böngészése

检测档案、体系运行记录盒查阅按钮增加权限控制

cfort 2 éve
szülő
commit
902e462d83

+ 1 - 1
src/components/ibps-crud/mixin/handleRow.js

@@ -43,7 +43,7 @@ export default {
      * @param {*} data
      */
     hasRowHandleActions(row, data) {
-      if (!this.rowHandleActions) return false
+      if (!this.rowHandleActions || !this.rowHandleActions.length) return false
       for (let i = 0; i < this.rowHandleActions.length; i++) {
         if (this.handleActionHidden(this.rowHandleActions[i].hidden, row, data)) {
           return true

+ 8 - 5
src/views/platform/bpmn/bpmInstHis/list.vue

@@ -189,6 +189,9 @@
             }
         },
         data() {
+            const roleList = this.$store.getters.userInfo.role
+            // 系统管理角色、实验室主任、信息管理角色具有高级权限
+            const hasRole = roleList.some(item => item.alias === 'xtgljs' || item.alias === 'xxgljs' || item.alias === 'syszr')
             return {
                 width: 250,
                 selection: false,
@@ -244,7 +247,7 @@
                         { prop: 'tUser', label: '编制人', width: 80 },
                         { prop: 'endTime', label: '完成时间', sortable: 'custom', dateFormat: 'yyyy-MM-dd', width: 90}
                     ],
-                    rowHandle: {
+                    rowHandle: hasRole ? {
                         actions: [
                             // {
                             //     key: 'detail',label:"内容及附件"
@@ -252,7 +255,7 @@
                         ],
                         effect: 'display',
                         width: '100'
-                    }
+                    } : null
                 }
             }
         },
@@ -261,9 +264,9 @@
             this.getConfig()
             const roleList = this.$store.getters.userInfo.role
             // 系统管理角色添加删除按钮
-            const hasRole = roleList.some(item => item.name === '系统管理角色')
-            if (hasRole) {
-                // 系统管理角色不做分类过滤
+            const deleteRole = roleList.some(item => item.alias === 'xtgljs')
+            if (deleteRole) {
+                // 系统管理角色不做分类过滤,显示删除按钮
                 this.hasPermission = false
                 this.listConfig.toolbars.push({ key: 'remove' })
                 this.selection = true

+ 6 - 2
src/views/platform/bpmn/bpmInstHis/record/component/testingRecord.vue

@@ -56,7 +56,7 @@
                     <template slot-scope="scope">{{ getTestTime(scope.row) }}</template>
                 </el-table-column>
                 <el-table-column prop="gai_zhang_jian_pd" label="检测项目" minWidth="200"></el-table-column>
-                <el-table-column label="操作" align="left" width="100">
+                <el-table-column v-if="hasRole" label="操作" align="left" width="100">
                     <template slot-scope="scope">
                         <el-popover placement="left" width="200" trigger="click">
                             <div slot="reference" class="more"><i class="el-icon-caret-bottom"></i>查阅</div>
@@ -220,6 +220,9 @@ export default {
         }
     },
     data () {
+        const roleList = this.$store.getters.userInfo.role
+        // 系统管理角色、实验室主任、信息管理角色具有高级权限
+        const hasRole = roleList.some(item => item.alias === 'xtgljs' || item.alias === 'xxgljs' || item.alias === 'syszr')
         return {
             searchList,
             reportList,
@@ -250,7 +253,8 @@ export default {
             },
             prop: '',
             order: '',
-            params: ''
+            params: '',
+            hasRole
         }
     },
     created () {