fix: 场景编辑报错

This commit is contained in:
chenjianxing 2020-12-16 10:31:09 +08:00
parent 884fc213dd
commit c3ae4e9e02
3 changed files with 6 additions and 6 deletions

View File

@ -83,8 +83,7 @@
}],
},
}
}
,
},
methods: {
saveScenario(saveAs) {
this.$refs['scenarioForm'].validate((valid) => {
@ -95,7 +94,7 @@
this.visible = false;
if (saveAs) {
this.scenarioForm.request = JSON.stringify(this.scenarioForm.request);
this.$emit('saveAsEdit', this.httpForm);
this.$emit('saveAsEdit', this.scenarioForm);
} else {
this.$emit('refresh');
}
@ -109,7 +108,8 @@
this.scenarioForm.projectId = getCurrentProjectID();
this.scenarioForm.id = getUUID().substring(0, 8);
this.scenarioForm.protocol = this.currentProtocol;
if (this.currentModule != null && this.currentModule != "newId") {
if (this.currentModule && this.currentModule.id != "root") {
this.scenarioForm.modulePath = this.currentModule.method !== undefined ? this.currentModule.method : null;
this.scenarioForm.apiScenarioModuleId = this.currentModule.id;
}

View File

@ -57,7 +57,7 @@
},
projectId: "",
data: [],
currentModule: {},
currentModule: undefined,
}
},
mounted() {

View File

@ -59,7 +59,7 @@
import MsDialogFooter from "../../../../common/components/MsDialogFooter";
import {WORKSPACE_ID} from '../../../../../../common/js/constants';
import {REQ_METHOD} from "../../model/JsonData";
import {getCurrentProjectID, getCurrentUser, getUUID} from "../../../../../../common/js/utils";
import {getCurrentProjectID, getCurrentUser} from "../../../../../../common/js/utils";
import {createComponent, Request} from "../jmeter/components";
export default {