refactor(接口测试): 优化创建场景状态是空的缺陷 (#15836)

--bug=1014924 --user=王孝刚 【接口测试】场景-更多操作-创建场景,状态是空的
https://www.tapd.cn/55049933/s/1202822

Co-authored-by: wxg0103 <727495428@qq.com>
This commit is contained in:
MeterSphere Bot 2022-07-15 17:25:00 +08:00 committed by GitHub
parent 6ab23d2224
commit 787c529490
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 226 additions and 221 deletions

View File

@ -58,7 +58,6 @@
</template>
<script>
import {WORKSPACE_ID} from '@/common/js/constants';
import {getCurrentProjectID, getCurrentUser, getUUID} from "@/common/js/utils";
import MsDialogFooter from "@/business/components/common/components/MsDialogFooter";
import {saveScenario} from "@/business/components/api/automation/api-automation";
@ -97,6 +96,8 @@
if (valid) {
let path = "/api/automation/create";
this.setParameter();
this.scenarioForm.status = 'Underway';
this.scenarioForm.level = 'P0';
if (saveAs) {
this.scenarioForm.request = JSON.stringify(this.scenarioForm.request);
this.$emit('saveAsEdit', this.scenarioForm);

View File

@ -57,7 +57,6 @@
<script>
import MsDialogFooter from "../../../../common/components/MsDialogFooter";
import {WORKSPACE_ID} from '../../../../../../common/js/constants';
import {REQ_METHOD} from "../../model/JsonData";
import {getCurrentProjectID, getCurrentUser} from "../../../../../../common/js/utils";
import {createComponent, Request} from "../jmeter/components";
@ -89,7 +88,11 @@
{required: true, message: this.$t('test_track.case.input_name'), trigger: 'blur'},
{max: 100, message: this.$t('test_track.length_less_than') + '100', trigger: 'blur'}
],
path: [{required: true, message: this.$t('api_test.definition.request.path_info'), trigger: 'blur'}, {validator: validateURL, trigger: 'blur'}],
path: [{
required: true,
message: this.$t('api_test.definition.request.path_info'),
trigger: 'blur'
}, {validator: validateURL, trigger: 'blur'}],
userId: [{required: true, message: this.$t('test_track.case.input_maintainer'), trigger: 'change'}],
},
value: REQ_METHOD[0].id,
@ -123,6 +126,7 @@
let bodyFiles = [];
let path = "/api/definition/create";
this.setParameter();
this.httpForm.status = 'Underway';
//
if (this.httpForm.request) {
this.httpForm.request.clazzName = TYPE_TO_C.get(this.httpForm.request.type);