This commit is contained in:
liqiang-fit2cloud 2023-01-06 15:55:44 +08:00
commit 78be4e00f2
1 changed files with 13 additions and 7 deletions

View File

@ -28,19 +28,13 @@
<span slot="title" class="ms-menu-item-title">{{ $t('commons.api') }}</span> <span slot="title" class="ms-menu-item-title">{{ $t('commons.api') }}</span>
</div> </div>
</el-menu-item> </el-menu-item>
<el-menu-item index="/ui" @click="active()" v-if="hasLicense() && check('ui')" onselectstart="return false" <el-menu-item :index="getUiIndex()" @click="clickPlanMenu" v-if="check('ui')" onselectstart="return false"
v-permission="['PROJECT_UI_SCENARIO:READ','PROJECT_UI_REPORT:READ', 'PROJECT_UI_ELEMENT:READ']"> v-permission="['PROJECT_UI_SCENARIO:READ','PROJECT_UI_REPORT:READ', 'PROJECT_UI_ELEMENT:READ']">
<div> <div>
<svg-icon iconClass="ui" class-name="ms-menu-img"/> <svg-icon iconClass="ui" class-name="ms-menu-img"/>
<span slot="title" class="ms-menu-item-title">{{ $t('commons.ui') }}</span> <span slot="title" class="ms-menu-item-title">{{ $t('commons.ui') }}</span>
</div> </div>
</el-menu-item> </el-menu-item>
<el-menu-item v-if="!hasLicense()" @click="clickPlanMenu">
<div>
<svg-icon iconClass="ui" class-name="ms-menu-img"/>
<span slot="title" class="ms-menu-item-title">{{ $t('commons.ui') }}</span>
</div>
</el-menu-item>
<el-menu-item index="/performance" v-if="check('performance')" <el-menu-item index="/performance" v-if="check('performance')"
onselectstart="return false" onselectstart="return false"
v-permission="['PROJECT_PERFORMANCE_HOME:READ', 'PROJECT_PERFORMANCE_TEST:READ','PROJECT_PERFORMANCE_REPORT:READ']"> v-permission="['PROJECT_PERFORMANCE_HOME:READ', 'PROJECT_PERFORMANCE_TEST:READ','PROJECT_PERFORMANCE_REPORT:READ']">
@ -145,9 +139,18 @@ export default {
} }
}, },
check(key) { check(key) {
if (key === 'ui' && !hasLicense()) {
return this.modules[key] === 'ENABLE';
}
let microApps = JSON.parse(sessionStorage.getItem("micro_apps")); let microApps = JSON.parse(sessionStorage.getItem("micro_apps"));
return this.modules[key] === 'ENABLE' && microApps && microApps[key]; return this.modules[key] === 'ENABLE' && microApps && microApps[key];
}, },
getUiIndex() {
if (hasLicense()) {
return "ui";
}
return "";
},
registerEvents() { registerEvents() {
getModuleList() getModuleList()
.then(response => { .then(response => {
@ -164,6 +167,9 @@ export default {
}); });
}, },
clickPlanMenu() { clickPlanMenu() {
if (hasLicense()) {
return true;
}
this.$message({ this.$message({
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true,
showClose: true, showClose: true,