From 9e7dd36714c3f6973c343858667ac6eda0f9e1e0 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 26 Oct 2022 11:32:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E6=97=A5=E5=BF=97=E7=9A=84=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E5=AF=B9=E8=B1=A1=E4=B8=AD=E6=B2=A1=E6=9C=89UI=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1018662 --user=李玉号 [系统设置]操作日志的操作对象中没有UI 测试模块 https://www.tapd.cn/55049933/s/1277873 --- .../frontend/src/business/menu/log/Log.vue | 23 +++++++++- .../frontend/src/business/menu/log/config.js | 20 +++++++++ .../frontend/src/business/common/config.js | 43 ++++++++++++++++++- .../business/workspace/log/OperatingLog.vue | 24 ++++++++++- 4 files changed, 106 insertions(+), 4 deletions(-) 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');