浏览代码

Merge branch 'demo_' of http://123.60.19.203:8088/hitch/hitch-antd into demo_

408249787 2 年之前
父节点
当前提交
5acec2ddda

+ 8 - 3
src/views/workplace/backlog/NewWorkplaceBacklog.vue

@@ -331,12 +331,12 @@ export default {
   },
   computed: {
     role () {
-      if (this.$store.state.user.roles.join().includes('manage')) {
+      if (this.$store.state.user.roles.join().includes('workplace-repair-manage')) {
         return 'workplace-repair-manage'
-      } else if (this.$store.state.user.roles.join().includes('normal')) {
+      } else if (this.$store.state.user.roles.join().includes('workplace-repair-normal')) {
         return 'workplace-repair-normal'
       } else {
-        return ''
+        return 'undifined'
       }
     }
   },
@@ -376,6 +376,11 @@ export default {
       this.typeDetailDict = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.WORKPLACE_BACKLOG_DETAIL_TYPE)
     },
     getInfo () {
+      if (this.role === 'undifined') {
+        // this.$error('您的角色未赋予该权限')
+        alert('您的角色未赋予该权限')
+        this.$router.push({ path: '/WorkplaceBacklog' })
+      }
       getWorkplaceBacklogWeekData(this.role).then(res => {
         const data = res.data.reduce((pre, item) => {
           pre.push({

+ 8 - 3
src/views/workplace/backlog/StoreWorkplaceBacklog.vue

@@ -340,12 +340,12 @@ export default {
   },
   computed: {
     role () {
-      if (this.$store.state.user.roles.join().includes('manage')) {
+      if (this.$store.state.user.roles.join().includes('workplace_store_manage')) {
         return 'workplace_store_manage'
-      } else if (this.$store.state.user.roles.join().includes('normal')) {
+      } else if (this.$store.state.user.roles.join().includes('workplace_store_normal')) {
         return 'workplace_store_normal'
       } else {
-        return ''
+        return 'undifined'
       }
     }
   },
@@ -369,6 +369,11 @@ export default {
       this.typeDetailDict = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.WORKPLACE_BACKLOG_DETAIL_TYPE)
     },
     getInfo () {
+      if (this.role === 'undifined') {
+        // this.$error('您的角色未赋予该权限')
+        alert('您的角色未赋予该权限')
+        this.$router.push({ path: '/WorkplaceBacklog' })
+      }
       Promise.all([
         getWorkplaceBacklogWeekData(this.role),
         getWorkplaceBacklogPie(this.role),