refactor: 测试元素实体类增加项目ID属性

This commit is contained in:
shiziyuan9527 2021-02-22 14:51:05 +08:00
parent 2a7ccf7b24
commit 5f0821174a
3 changed files with 7 additions and 3 deletions

View File

@ -102,6 +102,8 @@ public abstract class MsTestElement {
private LinkedList<MsTestElement> hashTree;
@JSONField(ordinal = 11)
private boolean customizeReq;
@JSONField(ordinal = 12)
private String projectId;
private MsTestElement parent;

View File

@ -603,6 +603,7 @@ export default {
request.enable === undefined ? request.enable = true : request.enable;
request.active = false;
request.resourceId = getUUID();
request.projectId = item.projectId;
if (!request.url) {
request.url = "";
}
@ -933,7 +934,8 @@ export default {
headers: this.currentScenario.headers,
referenced: 'Created',
environmentId: this.currentEnvironmentId,
hashTree: this.scenarioDefinition
hashTree: this.scenarioDefinition,
projectId: this.projectId
};
this.currentScenario.scenarioDefinition = scenario;
if (this.currentScenario.tags instanceof Array) {

View File

@ -65,7 +65,7 @@
return;
}
this.currentScenario.forEach(item => {
let obj = {id: item.id, name: item.name, type: "scenario", referenced: 'REF', resourceId: getUUID()};
let obj = {id: item.id, name: item.name, type: "scenario", referenced: 'REF', resourceId: getUUID(), projectId: item.projectId};
scenarios.push(obj);
});
this.$emit('save', scenarios);
@ -82,7 +82,7 @@
response.data.forEach(item => {
let scenarioDefinition = JSON.parse(item.scenarioDefinition);
if (scenarioDefinition && scenarioDefinition.hashTree) {
let obj = {id: item.id, name: item.name, type: "scenario", referenced: 'Copy', resourceId: getUUID(), hashTree: scenarioDefinition.hashTree};
let obj = {id: item.id, name: item.name, type: "scenario", referenced: 'Copy', resourceId: getUUID(), hashTree: scenarioDefinition.hashTree, projectId: item.projectId};
scenarios.push(obj);
}
});