fix(系统设置): 操作日志的操作对象中没有UI测试模块

--bug=1018662 --user=李玉号 [系统设置]操作日志的操作对象中没有UI 测试模块
https://www.tapd.cn/55049933/s/1277873
This commit is contained in:
shiziyuan9527 2022-10-26 11:32:44 +08:00 committed by 刘瑞斌
parent 933fbba450
commit 9e7dd36714
4 changed files with 106 additions and 4 deletions

View File

@ -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

View File

@ -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: [
{

View File

@ -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: [
{

View File

@ -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');