fix(测试跟踪): 编辑用例自定义ID选项
--bug=1023260 --user=陈建星 【测试跟踪】功能用例开启自定义用例ID,新建/编辑 页面没有填写ID的地方 https://www.tapd.cn/55049933/s/1337681
This commit is contained in:
parent
74a96dab9e
commit
5498a17695
|
@ -383,6 +383,7 @@ import {openCaseEdit} from "@/business/case/test-case";
|
||||||
import ListItemDeleteConfirm from "metersphere-frontend/src/components/ListItemDeleteConfirm";
|
import ListItemDeleteConfirm from "metersphere-frontend/src/components/ListItemDeleteConfirm";
|
||||||
import CaseDiffSideViewer from "./case/diff/CaseDiffSideViewer";
|
import CaseDiffSideViewer from "./case/diff/CaseDiffSideViewer";
|
||||||
|
|
||||||
|
const store = useStore();
|
||||||
export default {
|
export default {
|
||||||
name: "TestCaseEdit",
|
name: "TestCaseEdit",
|
||||||
components: {
|
components: {
|
||||||
|
@ -583,10 +584,10 @@ export default {
|
||||||
return pId ? pId : getCurrentProjectID();
|
return pId ? pId : getCurrentProjectID();
|
||||||
},
|
},
|
||||||
moduleOptions() {
|
moduleOptions() {
|
||||||
return useStore().testCaseModuleOptions;
|
return store.testCaseModuleOptions;
|
||||||
},
|
},
|
||||||
isCustomNum() {
|
isCustomNum() {
|
||||||
return useStore().currentProjectIsCustomNum;
|
return store.currentProjectIsCustomNum;
|
||||||
},
|
},
|
||||||
richTextDefaultOpen() {
|
richTextDefaultOpen() {
|
||||||
return this.type === "edit" ? "preview" : "edit";
|
return this.type === "edit" ? "preview" : "edit";
|
||||||
|
@ -635,20 +636,20 @@ export default {
|
||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
if (val && useStore().testCaseMap && this.form.id) {
|
if (val && store.testCaseMap && this.form.id) {
|
||||||
let change = useStore().testCaseMap.get(this.form.id);
|
let change = store.testCaseMap.get(this.form.id);
|
||||||
change = change + 1;
|
change = change + 1;
|
||||||
useStore().testCaseMap.set(this.form.id, change);
|
store.testCaseMap.set(this.form.id, change);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
},
|
},
|
||||||
customFieldForm: {
|
customFieldForm: {
|
||||||
handler(val) {
|
handler(val) {
|
||||||
if (val && useStore().testCaseMap && this.form.id) {
|
if (val && store.testCaseMap && this.form.id) {
|
||||||
let change = useStore().testCaseMap.get(this.form.id);
|
let change = store.testCaseMap.get(this.form.id);
|
||||||
change = change + 1;
|
change = change + 1;
|
||||||
useStore().testCaseMap.set(this.form.id, change);
|
store.testCaseMap.set(this.form.id, change);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
|
@ -673,11 +674,11 @@ export default {
|
||||||
});
|
});
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
if (!(useStore().testCaseMap instanceof Map)) {
|
if (!(store.testCaseMap instanceof Map)) {
|
||||||
useStore().testCaseMap = new Map();
|
store.testCaseMap = new Map();
|
||||||
}
|
}
|
||||||
if (this.form.id) {
|
if (this.form.id) {
|
||||||
useStore().testCaseMap.set(this.form.id, 0);
|
store.testCaseMap.set(this.form.id, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -719,10 +720,20 @@ export default {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
getTestTemplate().then((template) => {
|
getTestTemplate().then((template) => {
|
||||||
this.testCaseTemplate = template;
|
this.testCaseTemplate = template;
|
||||||
useStore().testCaseTemplate = this.testCaseTemplate;
|
store.testCaseTemplate = this.testCaseTemplate;
|
||||||
initFuc();
|
initFuc();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
getProjectApplicationConfig('CASE_CUSTOM_NUM')
|
||||||
|
.then(result => {
|
||||||
|
let data = result.data;
|
||||||
|
if (data && data.typeValue === 'true') {
|
||||||
|
store.currentProjectIsCustomNum = true;
|
||||||
|
} else {
|
||||||
|
store.currentProjectIsCustomNum = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.addListener(); // 添加 ctrl s 监听
|
this.addListener(); // 添加 ctrl s 监听
|
||||||
if (!this.projectList || this.projectList.length === 0) {
|
if (!this.projectList || this.projectList.length === 0) {
|
||||||
//没有项目数据的话请求项目数据
|
//没有项目数据的话请求项目数据
|
||||||
|
@ -846,7 +857,7 @@ export default {
|
||||||
this.form.remark = "";
|
this.form.remark = "";
|
||||||
}
|
}
|
||||||
if (this.form.id) {
|
if (this.form.id) {
|
||||||
useStore().testCaseMap.set(this.form.id, 0);
|
store.testCaseMap.set(this.form.id, 0);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addPublic() {
|
addPublic() {
|
||||||
|
@ -887,7 +898,7 @@ export default {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.isStepTableAlive = true;
|
this.isStepTableAlive = true;
|
||||||
if (this.form.id) {
|
if (this.form.id) {
|
||||||
useStore().testCaseMap.set(this.form.id, 0);
|
store.testCaseMap.set(this.form.id, 0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -1089,7 +1100,7 @@ export default {
|
||||||
this.$success(this.$t("commons.save_success"), false);
|
this.$success(this.$t("commons.save_success"), false);
|
||||||
this.operationType = "edit";
|
this.operationType = "edit";
|
||||||
this.$emit("refreshTestCase");
|
this.$emit("refreshTestCase");
|
||||||
useStore().testCaseMap.set(this.form.id, 0);
|
store.testCaseMap.set(this.form.id, 0);
|
||||||
this.$emit("refresh", response.data);
|
this.$emit("refresh", response.data);
|
||||||
if (this.form.id) {
|
if (this.form.id) {
|
||||||
this.$emit("caseEdit", param);
|
this.$emit("caseEdit", param);
|
||||||
|
@ -1280,7 +1291,7 @@ export default {
|
||||||
document.removeEventListener("keydown", this.createCtrlSHandle);
|
document.removeEventListener("keydown", this.createCtrlSHandle);
|
||||||
},
|
},
|
||||||
createCtrlSHandle(event) {
|
createCtrlSHandle(event) {
|
||||||
let curTabId = useStore().curTabId;
|
let curTabId = store.curTabId;
|
||||||
if (curTabId === this.tabId) {
|
if (curTabId === this.tabId) {
|
||||||
if (event.keyCode === 83 && event.ctrlKey && this.readOnly) {
|
if (event.keyCode === 83 && event.ctrlKey && this.readOnly) {
|
||||||
this.$warning(this.$t("commons.no_operation_permission"), false);
|
this.$warning(this.$t("commons.no_operation_permission"), false);
|
||||||
|
|
Loading…
Reference in New Issue