Przeglądaj źródła

修改附件、表单下载权限判定

cfort 1 rok temu
rodzic
commit
068bc65da4

+ 3 - 6
src/business/platform/form/utils/custom/preview.js

@@ -3,7 +3,6 @@ import Pdfh5 from 'pdfh5'
 import 'pdfh5/css/pdfh5.css'
 import { snapshoot, download } from '@/api/platform/file/attachment' // 印章,快照
 import ActionUtils from '@/utils/action'
-import store from '@/store'
 
 export const preview = (tableForm, url) => {
     let isMobile = false
@@ -36,17 +35,15 @@ export const preview = (tableForm, url) => {
             },
             (tpl) => {
                 tableForm.dialogTemplate = tpl
-                const { role } = store.getters.userInfo || {}
-                // 系统管理角色、检验科主任、检验科副主任、文件管理员、技术负责人、质量负责人可下载打印
-                const hasRole = role.some(item => ['xtgljs', 'syszr', 'jykfzr', 'wjgly', 'jsfzr', 'zlfzr', 'jyy'].includes(item.alias))
-                if (1 || hasRole) {
+                const hasHighRole = localStorage.getItem('hasHighRole') === '1'
+                if (hasHighRole) {
                     return
                 }
                 setTimeout(() => {
                     const toolbarCover = document.createElement('div')
                     toolbarCover.classList.add('toolbar-cover')
                     toolbarCover.addEventListener('click', () => {
-                        confirm('无权操作,请联系管理员开放相关权限!', '提示')
+                        confirm('无权操作,请联系系统管理员!', '提示')
                     })
                     document.querySelector('.btn-cover').children[1].appendChild(toolbarCover)
                 }, 1000)

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

@@ -76,9 +76,9 @@ export default {
                         const info = response.data
                         /**
                          * store 统一存储高权限角色,用于各模块校验附件下载权限
-                         * 初定角色为:系统管理角色、主任、质量负责人、文件管理负责人、文件管理员,文件下载角色
+                         * 初定角色为:系统管理角色、主任、质量负责人、技术负责人、专业组组长、文件管理负责人、文件管理员,文件下载角色
                          */
-                        info.highRoles = ['xtgljs', 'syszr', 'zlfzr', 'wjglzzc', 'wjgly', 'wjxzjs']
+                        info.highRoles = ['xtgljs', 'syszr', 'zlfzr', 'jsfzr', 'zhsfzr', 'wjglzzc', 'wjgly', 'wjxzjs']
 
                         let level = {}
                         if (info.positions && info.positions.length) {

+ 4 - 4
src/views/component/fileTraining/index.vue

@@ -368,8 +368,8 @@ export default {
         const curRole = this.role.map((i) => i.alias)
         const isPower = curRole.some((item) => roleKey.includes(item))
         this.deleteShow = !!(isPower || this.isPower)
-        const hasRole = localStorage.getItem('hasHighRole') || 0
-        if (this.isSuper || hasRole == 1) {
+        const hasRole = localStorage.getItem('hasHighRole') === '1'
+        if (this.isSuper || hasRole) {
             this.updateShow = true
         }
     },
@@ -628,11 +628,11 @@ export default {
         //     this.innerVisible = val
         // },
         updateFile () {
-            const hasRole = localStorage.getItem('hasHighRole') || 0
+            const hasRole = localStorage.getItem('hasHighRole') === '1'
             // const roleKey = ['xtgljs', 'wjglzzc', 'wjgly', 'zhsfzr']
             // const curRole = this.role.map(i => i.alias)
             // const isPower = curRole.some(i => roleKey.includes(i))
-            if (this.isSuper || hasRole == 1) {
+            if (this.isSuper || hasRole) {
                 const a = document.createElement('a')
                 a.href = this.optionFile.url
                 a.download = this.optionFile.data.fileName

+ 2 - 3
src/views/infosManage/fileIE.vue

@@ -163,9 +163,8 @@ export default {
     },
     mixins: [FixHeight],
     data () {
-        const roleList = ['xtgljs', 'syszr', 'wjglzzc', 'wjgly', 'wjxzjs']
-        const { isSuper, role, deptList = [] } = this.$store.getters || {}
-        const hasRole = isSuper || role.some((r) => roleList.includes(r.alias))
+        const { isSuper, deptList = [] } = this.$store.getters || {}
+        const hasRole = localStorage.getItem('hasHighRole') === '1'
         const depArrs = deptList.map(
             (i) => `wj.bian_zhi_bu_men_ like '${i.positionId}'`
         )