diff --git a/project-management/frontend/src/business/menu/log/Log.vue b/project-management/frontend/src/business/menu/log/Log.vue index 749911de64..e9830bf5f1 100644 --- a/project-management/frontend/src/business/menu/log/Log.vue +++ b/project-management/frontend/src/business/menu/log/Log.vue @@ -144,6 +144,7 @@ import {getCurrentWsMembers} from "../../../api/user"; import {modifyUserByResourceId} from "metersphere-frontend/src/api/user"; import {getOperatingLogPages} from "../../../api/log"; import {getProject} from "../../../api/project"; +import {hasLicense} from "metersphere-frontend/src/utils/permission"; export default { name: "Log", @@ -153,6 +154,26 @@ export default { MsContainer }, data() { + let getModules = function () { + let license = hasLicense(); + let data = new PROJECTSYSLIST(); + return data.filter(item => { + if (!item.license) { + if (item.children) { + item.children = item.children.filter(child => { + if (!child.license || (child.license && license)) { + return true; + } + }) + } + return true; + } else { + if (license) { + return true; + } + } + }); + }; return { props: { multiple: false, @@ -172,7 +193,7 @@ export default { LOG_TYPE: new LOG_TYPE(this), LOG_TYPE_MAP: new LOG_TYPE_MAP(this), LOG_MODULE_MAP: new LOG_MODULE_MAP(this), - sysList: new PROJECTSYSLIST(), + sysList: getModules(), options: [], selectLoading: false, cardLoading: false diff --git a/project-management/frontend/src/business/menu/log/config.js b/project-management/frontend/src/business/menu/log/config.js index 4db0e14317..14acc3f9fe 100644 --- a/project-management/frontend/src/business/menu/log/config.js +++ b/project-management/frontend/src/business/menu/log/config.js @@ -102,6 +102,26 @@ export function LOG_MODULE_MAP(_this) { export function PROJECTSYSLIST() { let projectsysList = [ + { + label: i18n.t('commons.ui'), value: i18n.t('commons.ui'), license: true, + children: [ + { + label: i18n.t('ui.ui_element'), + value: [i18n.t('ui.ui_element'), 'UI_ELEMENT'], + leaf: true + }, + { + label: i18n.t('ui.ui_automation'), + value: [i18n.t('ui.ui_automation'), 'UI_AUTOMATION'], + leaf: true + }, + { + label: i18n.t('ui.report'), + value: [i18n.t('ui.report'), 'UI_AUTOMATION_REPORT'], + leaf: true + }, + ] + }, { label: i18n.t('test_track.test_track'), value: i18n.t('test_track.test_track'), children: [ { diff --git a/system-setting/frontend/src/business/common/config.js b/system-setting/frontend/src/business/common/config.js index 1bd836372a..883817f1c0 100644 --- a/system-setting/frontend/src/business/common/config.js +++ b/system-setting/frontend/src/business/common/config.js @@ -103,7 +103,28 @@ export function LOG_MODULE_MAP(_this) { export function SYSLIST() { let sysList = [ { - label: i18n.t('test_track.test_track'), value: i18n.t('test_track.test_track'), children: [ + label: i18n.t('commons.ui'), value: i18n.t('commons.ui'), license: true, + children: [ + { + label: i18n.t('ui.ui_element'), + value: [i18n.t('ui.ui_element'), 'UI_ELEMENT'], + leaf: true + }, + { + label: i18n.t('ui.ui_automation'), + value: [i18n.t('ui.ui_automation'), 'UI_AUTOMATION'], + leaf: true + }, + { + label: i18n.t('ui.report'), + value: [i18n.t('ui.report'), 'UI_AUTOMATION_REPORT'], + leaf: true + }, + ] + }, + { + label: i18n.t('test_track.test_track'), value: i18n.t('test_track.test_track'), + children: [ { label: i18n.t('permission.project_track_case.name'), value: [i18n.t('permission.project_track_case.name'), 'TRACK_TEST_CASE'], @@ -260,6 +281,26 @@ export function SYSLIST() { export function WORKSYSLIST() { let worksysList = [ + { + label: i18n.t('commons.ui'), value: i18n.t('commons.ui'), license: true, + children: [ + { + label: i18n.t('ui.ui_element'), + value: [i18n.t('ui.ui_element'), 'UI_ELEMENT'], + leaf: true + }, + { + label: i18n.t('ui.ui_automation'), + value: [i18n.t('ui.ui_automation'), 'UI_AUTOMATION'], + leaf: true + }, + { + label: i18n.t('ui.report'), + value: [i18n.t('ui.report'), 'UI_AUTOMATION_REPORT'], + leaf: true + }, + ] + }, { label: i18n.t('test_track.test_track'), value: i18n.t('test_track.test_track'), children: [ { diff --git a/system-setting/frontend/src/business/workspace/log/OperatingLog.vue b/system-setting/frontend/src/business/workspace/log/OperatingLog.vue index 3fb8c0f2e2..e1a7784a5b 100644 --- a/system-setting/frontend/src/business/workspace/log/OperatingLog.vue +++ b/system-setting/frontend/src/business/workspace/log/OperatingLog.vue @@ -160,6 +160,7 @@ import {getProjectById, getProjectsByWorkspaceId} from "../../../api/project"; import {getUserListByResourceUrl} from "../../../api/user"; import {modifyUserByResourceId} from "metersphere-frontend/src/api/user"; import {getOperatingLogPages} from "../../../api/operating-log"; +import {hasLicense} from "metersphere-frontend/src/utils/permission"; export default { name: "OperatingLog", @@ -169,6 +170,26 @@ export default { MsLogDetail }, data() { + let getModules = function () { + let license = hasLicense(); + let data = new WORKSYSLIST(); + return data.filter(item => { + if (!item.license) { + if (item.children) { + item.children = item.children.filter(child => { + if (!child.license || (child.license && license)) { + return true; + } + }) + } + return true; + } else { + if (license) { + return true; + } + } + }); + }; return { props: { multiple: false, @@ -189,7 +210,7 @@ export default { LOG_TYPE: new LOG_TYPE(this), LOG_TYPE_MAP: new LOG_TYPE_MAP(this), LOG_MODULE_MAP: new LOG_MODULE_MAP(this), - sysList: new SYSLIST(), + sysList: getModules(), loading: false, options: [], selectLoading: false @@ -200,7 +221,6 @@ export default { handler(toPath) { if (toPath === '/setting/operatingLog/workspace') { this.isSystem = false; - this.sysList = new WORKSYSLIST(); this.condition.workspaceId = getCurrentWorkspaceId(); this.initProject(); this.getMember('/user/ws/current/member/list');