|
|
@@ -103,9 +103,11 @@ export default {
|
|
|
rowHandle: {
|
|
|
effect: 'display',
|
|
|
actions: [
|
|
|
- { key: 'adjust', label: '申请调班', type: 'primary', icon: 'ibps-icon-exchange' },
|
|
|
- { key: 'edit', label: '编辑', type: 'primary', icon: 'ibps-icon-edit' },
|
|
|
- { key: 'preview', label: '查看', type: 'primary', icon: 'ibps-icon-eye' }
|
|
|
+ { key: 'adjust', label: '申请调班', type: 'primary', icon: 'ibps-icon-exchange', hidden: false },
|
|
|
+ { key: 'edit', label: '编辑', type: 'primary', icon: 'ibps-icon-edit', hidden: (row) => {
|
|
|
+ return !this.isRoleFilter() && this.$store.getters.userId !== row.createBy
|
|
|
+ } },
|
|
|
+ { key: 'preview', label: '查看', type: 'primary', icon: 'ibps-icon-eye', hidden: false }
|
|
|
// { key: 'report', label: '实验报告', type: 'success', icon: 'ibps-icon-file-text-o' }
|
|
|
]
|
|
|
}
|
|
|
@@ -156,6 +158,35 @@ export default {
|
|
|
search () {
|
|
|
this.loadData()
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 判断当前用户是否为超级管理员和高权限角色和专业组组长
|
|
|
+ */
|
|
|
+ isRoleFilter () {
|
|
|
+ const highRoles = this.$store.getters.userInfo.highRoles || [] // 高权限角色
|
|
|
+ const userRole = this.$store.getters.userInfo.role || [] // 用户权限角色
|
|
|
+ let isHighRole = false
|
|
|
+ userRole.forEach(el => {
|
|
|
+ const roleAlias = el.alias
|
|
|
+ if (highRoles.includes(roleAlias)) {
|
|
|
+ isHighRole = true
|
|
|
+ }
|
|
|
+ if (roleAlias === 'zhsfzr') {
|
|
|
+ isHighRole = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return (this.$store.getters.isSuper || isHighRole)
|
|
|
+ },
|
|
|
+ isZhsfzr () {
|
|
|
+ const userRole = this.$store.getters.userInfo.role || [] // 用户权限角色
|
|
|
+ let isZhsfzrRole = false
|
|
|
+ userRole.forEach(el => {
|
|
|
+ const roleAlias = el.alias
|
|
|
+ if (roleAlias === 'zhsfzr') {
|
|
|
+ isZhsfzrRole = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return isZhsfzrRole
|
|
|
+ },
|
|
|
/**
|
|
|
* 处理按钮事件
|
|
|
*/
|