-
+ class="card-info" shadow="never" @click.native="gotoDetail(option.name, option.permission)">
{{option.label}}
{{option.value}}
@@ -24,6 +24,7 @@
import {getFollowTotalCount, getUpcomingTotalCount} from "@/api/workstation";
import {getCurrentWorkspaceId} from "metersphere-frontend/src/utils/token";
+import {hasPermissions} from "metersphere-frontend/src/utils/permission"
export default {
name: "MyUpcomingCard",
@@ -42,48 +43,62 @@ export default {
name: 'track_case',
value:0,
label: this.$t('workstation.table_name.track_case'),
+ permission: 'PROJECT_TRACK_CASE:READ'
},
{
name:"track_plan",
value:0,
label: this.$t('workstation.table_name.track_plan'),
+ permission: 'PROJECT_TRACK_PLAN:READ'
},
{
name:"track_review",
value:0,
label: this.$t('workstation.table_name.track_review'),
+ permission: 'PROJECT_TRACK_REVIEW:READ'
},
{
name:"track_issue",
value:0,
label: this.$t('workstation.table_name.track_issue'),
+ permission: 'PROJECT_TRACK_ISSUE:READ'
},
{
name:"api_definition",
value:0,
label: this.$t('workstation.table_name.api_definition'),
+ permission: 'PROJECT_API_DEFINITION:READ'
},
{
name:"api_case",
value:0,
label: this.$t('workstation.table_name.api_case'),
+ permission: 'PROJECT_API_DEFINITION:READ'
},
{
name:"api_automation",
value:0,
label: this.$t('workstation.table_name.api_automation'),
+ permission: 'PROJECT_API_SCENARIO:READ'
},
{
name:"performance",
value:0,
label: this.$t('workstation.table_name.performance'),
+ permission: 'PROJECT_PERFORMANCE_TEST:READ'
},
],
title:"",
};
},
methods:{
- gotoDetail(name){
+ hasPermissions(permission) {
+ return hasPermissions(permission);
+ },
+ gotoDetail(name, permission){
+ if (!hasPermissions(permission)) {
+ return;
+ }
if (this.cardType === 'upcoming') {
let upcoming =this.$router.resolve({
path: "/workstation/upcoming",
@@ -158,6 +173,12 @@ export default {
background: #F5F6F7;
}
}
+.no-permission {
+ background: #F5F6F7;
+ &:hover {
+ cursor: not-allowed;
+ }
+}
.top-css {
left: 24px;
font-weight: 650;
diff --git a/workstation/frontend/src/business/focus/Focus.vue b/workstation/frontend/src/business/focus/Focus.vue
index 3859bb6d55..6885b0f584 100644
--- a/workstation/frontend/src/business/focus/Focus.vue
+++ b/workstation/frontend/src/business/focus/Focus.vue
@@ -1,7 +1,7 @@
@@ -24,6 +24,7 @@ export default {
methods: {
setDefaultCurrentTodo() {
// 设置当前默认TAB页为下一个有权限的菜单TAB
+ // 如果该用户无权限存在, 则空白
if (hasPermissions('PROJECT_TRACK_CASE:READ')) {
this.currentTodo = 'track_case';
} else if (hasPermissions('PROJECT_TRACK_PLAN:READ')) {
@@ -38,6 +39,8 @@ export default {
this.currentTodo = 'api_automation';
} else if (hasPermissions('PROJECT_PERFORMANCE_TEST:READ')) {
this.currentTodo = 'performance';
+ } else {
+ this.currentTodo = 'empty'
}
}
},
diff --git a/workstation/frontend/src/business/head/TableHeader.vue b/workstation/frontend/src/business/head/TableHeader.vue
index c840ae17bf..154b0283b1 100644
--- a/workstation/frontend/src/business/head/TableHeader.vue
+++ b/workstation/frontend/src/business/head/TableHeader.vue
@@ -5,7 +5,7 @@
-
+
diff --git a/workstation/frontend/src/business/upcoming/Upcoming.vue b/workstation/frontend/src/business/upcoming/Upcoming.vue
index e50ae784c4..112706487c 100644
--- a/workstation/frontend/src/business/upcoming/Upcoming.vue
+++ b/workstation/frontend/src/business/upcoming/Upcoming.vue
@@ -2,7 +2,7 @@