refactor: 修改顶部菜单

This commit is contained in:
CaptainB 2022-01-17 15:23:09 +08:00 committed by 刘瑞斌
parent e569bb13a4
commit bf80be60bf
5 changed files with 32 additions and 7 deletions

View File

@ -8,7 +8,10 @@
@select="handleSelect"
:key="menuKey"
router>
<el-menu-item index="/workstation" v-xpack onselectstart="return false">
<el-menu-item index="/workstation" v-if="hasLicense()">
{{ $t('commons.my_workstation') }}
</el-menu-item>
<el-menu-item v-else @click="clickPlanMenu">
{{ $t('commons.my_workstation') }}
</el-menu-item>
<el-menu-item index="/track" v-if="check('testTrack')" onselectstart="return false"
@ -100,8 +103,11 @@ export default {
this.registerEvents();
},
methods: {
hasLicense,
handleSelect(index) {
this.activeIndex = index;
if (index) {
this.activeIndex = index;
}
},
active() {
if (this.activeIndex === '/api') {
@ -122,7 +128,15 @@ export default {
});
}
});
}
},
clickPlanMenu() {
this.$message({
dangerouslyUseHTMLString: true,
showClose: true,
message: this.$t('commons.enterprise_edition_tips'),
});
return false;
},
}
};
</script>

View File

@ -27,13 +27,16 @@
v-permission="['PROJECT_CUSTOM_CODE:READ']">
{{ $t('project.code_segment.code_segment') }}
</el-menu-item>
<el-menu-item :index="'/project/errorreportlibrary'" v-xpack >
<el-menu-item :index="'/project/errorreportlibrary'" v-xpack>
{{ $t("error_report_library.name") }}
</el-menu-item>
<el-menu-item :index="'/project/log'" popper-class="submenu" v-permission="['PROJECT_OPERATING_LOG:READ']">
{{ $t('project.log') }}
</el-menu-item>
<el-menu-item v-xpack :index="'/project/version'" v-permission="['PROJECT_VERSION:READ']">
<el-menu-item v-if="hasLicense()" :index="'/project/version'" v-permission="['PROJECT_VERSION:READ']">
{{ $t('project.version_manage') }}
</el-menu-item>
<el-menu-item v-else v-permission="['PROJECT_VERSION:READ']" @click="clickPlanMenu">
{{ $t('project.version_manage') }}
</el-menu-item>
<el-menu-item :index="'/project/app'" popper-class="submenu"
@ -52,7 +55,7 @@ import MsShowAll from "@/business/components/common/head/ShowAll";
import MsRecentList from "@/business/components/common/head/RecentList";
import MsCreateButton from "@/business/components/common/head/CreateButton";
import ProjectChange from "@/business/components/common/head/ProjectSwitch";
import {getCurrentProjectID, getCurrentUserId, getCurrentWorkspaceId} from "@/common/js/utils";
import {hasLicense} from "@/common/js/utils";
export default {
name: "ProjectHeaderMenus",
@ -73,8 +76,13 @@ export default {
}
},
methods: {
hasLicense,
clickPlanMenu() {
this.$info(this.$t('commons.function_planning'));
this.$message({
dangerouslyUseHTMLString: true,
showClose: true,
message: this.$t('commons.enterprise_edition_tips'),
});
return false;
},
}

View File

@ -400,6 +400,7 @@ export default {
enterprise_edition: "ENTERPRISE",
open_source_version: "OPEN-SOURCE",
function_planning: "The function is being planned...",
enterprise_edition_tips: "This is an enterprise edition feature, <a href='https://metersphere.io/enterprise.html' target='_blank'>please consult for details</a>",
system_data: "System Data",
system_user: "User",
system_workspace: "Workspace",

View File

@ -401,6 +401,7 @@ export default {
enterprise_edition: "企业版",
open_source_version: "开源版",
function_planning: "功能正在规划中...",
enterprise_edition_tips: "此功能为企业版功能,<a href='https://metersphere.io/enterprise.html' target='_blank'>详情请咨询</a>",
system_data: "系统数据",
system_user: "系统用户",
system_workspace: "工作空间",

View File

@ -401,6 +401,7 @@ export default {
enterprise_edition: "企業版",
open_source_version: "開源版",
function_planning: "功能正在規劃中...",
enterprise_edition_tips: "此功能為企業版功能,<a href='https://metersphere.io/enterprise.html' target='_blank'>詳情請諮詢</a>",
system_data: "系統數據",
system_user: "系統用戶",
system_workspace: "工作空間",