diff --git a/api-test/frontend/src/business/automation/scenario/AddBasisScenario.vue b/api-test/frontend/src/business/automation/scenario/AddBasisScenario.vue index c5ecaaf6a9..571922a27d 100644 --- a/api-test/frontend/src/business/automation/scenario/AddBasisScenario.vue +++ b/api-test/frontend/src/business/automation/scenario/AddBasisScenario.vue @@ -75,6 +75,7 @@ @@ -135,6 +136,7 @@ export default { }, ], }, + loading: false, }; }, computed: { @@ -150,16 +152,19 @@ export default { saveScenario(saveAs) { this.$refs['scenarioForm'].validate((valid) => { if (valid) { + this.loading = true; let path = '/api/automation/create'; this.setParameter(); this.scenarioForm.status = 'Underway'; this.scenarioForm.level = 'P0'; if (saveAs) { + this.loading = false; this.scenarioForm.request = JSON.stringify(this.scenarioForm.request); this.$emit('saveAsEdit', this.scenarioForm); this.visible = false; } else { saveScenario(path, this.scenarioForm, [], this, (response) => { + this.loading = false; this.$success(this.$t('commons.save_success')); this.visible = false; this.$emit('refresh'); diff --git a/api-test/frontend/src/business/definition/components/basis/AddBasisApi.vue b/api-test/frontend/src/business/definition/components/basis/AddBasisApi.vue index e5f4184efe..19528d5b7d 100644 --- a/api-test/frontend/src/business/definition/components/basis/AddBasisApi.vue +++ b/api-test/frontend/src/business/definition/components/basis/AddBasisApi.vue @@ -68,6 +68,7 @@ @cancel="httpVisible = false" :isShow="true" title="编辑详情" + v-loading="loading" @saveAsEdit="saveApi(true)" @confirm="saveApi"> @@ -142,6 +143,7 @@ export default { }, value: REQ_METHOD[0].id, options: REQ_METHOD, + loading: false, }; }, computed: { @@ -168,6 +170,7 @@ export default { saveApi(saveAs) { this.$refs['httpForm'].validate((valid) => { if (valid) { + this.loading = true; let bodyFiles = []; this.setParameter(); this.httpForm.status = 'Underway'; @@ -176,12 +179,13 @@ export default { this.httpForm.request.clazzName = TYPE_TO_C.get(this.httpForm.request.type); this.compatibleHistory(this.httpForm.request.hashTree); } - this.result = createDefinition(null, bodyFiles, this.httpForm).then(() => { + this.result = createDefinition(null, bodyFiles, this.httpForm).then((res) => { this.httpVisible = false; if (saveAs) { - this.httpForm.request = JSON.stringify(this.httpForm.request); - this.$emit('saveAsEdit', this.httpForm); + this.loading = false; + this.$emit('saveAsEdit', res.data.data); } else { + this.loading = false; this.$emit('refresh'); } });