fix(系统设置): 修复只启用测试跟踪模块后,测试计划仍可以关联别的模块的缺陷
--bug=1032032 --user=王孝刚 【系统设置】项目配额管理中仅启用了测试跟踪模块,测试计划中可以关联其他模块的用例 https://www.tapd.cn/55049933/s/1427478
This commit is contained in:
parent
68ecf04503
commit
c9bf47b03d
|
@ -1,7 +1,20 @@
|
||||||
function enableModules(...modules) {
|
function enableModules(...modules) {
|
||||||
for (let module of modules) {
|
for (let module of modules) {
|
||||||
let modules = JSON.parse(localStorage.getItem('modules'));
|
let modules = JSON.parse(localStorage.getItem("modules"));
|
||||||
if (modules && modules[module] === 'DISABLE') {
|
if (module === "project" || module === "setting") {
|
||||||
|
return modules && modules[module] === "ENABLE";
|
||||||
|
}
|
||||||
|
let projectModules = JSON.parse(sessionStorage.getItem("project_modules"));
|
||||||
|
if (projectModules && projectModules.length > 0) {
|
||||||
|
return (
|
||||||
|
modules[module] === "ENABLE" && projectModules.indexOf(modules) > -1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
let workModules = JSON.parse(sessionStorage.getItem("workspace_modules"));
|
||||||
|
if (workModules && workModules.length > 0) {
|
||||||
|
return modules[module] === "ENABLE" && workModules.indexOf(modules) > -1;
|
||||||
|
}
|
||||||
|
if (modules && modules[module] === "DISABLE") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +22,7 @@ function enableModules(...modules) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkModule(el, binding) {
|
function checkModule(el, binding) {
|
||||||
const {value} = binding;
|
const { value } = binding;
|
||||||
if (value && value instanceof Array && value.length > 0) {
|
if (value && value instanceof Array && value.length > 0) {
|
||||||
let v = enableModules(...value);
|
let v = enableModules(...value);
|
||||||
if (!v) {
|
if (!v) {
|
||||||
|
@ -21,6 +34,5 @@ function checkModule(el, binding) {
|
||||||
export default {
|
export default {
|
||||||
inserted(el, binding) {
|
inserted(el, binding) {
|
||||||
checkModule(el, binding);
|
checkModule(el, binding);
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue