refactor(接口测试): 页面刷新优化

This commit is contained in:
fit2-zhao 2022-12-07 15:34:30 +08:00
parent 19c0154512
commit b059d88a62
4 changed files with 20 additions and 8 deletions

View File

@ -28,7 +28,7 @@
ref="debugResult"/>
</div>
<!-- 执行组件 -->
<ms-run :debug="true" :reportId="reportId" :isStop="isStop" :run-data="runData" @runRefresh="runRefresh"
<ms-run :debug="true" :reportId="reportId" :isStop="isStop" :run-data="runData" @runRefresh="runRefresh" @errorRefresh="errorRefresh"
ref="runTest"/>
</el-card>
<div v-if="scenario">
@ -153,11 +153,14 @@ export default {
this.reportId = getUUID().substring(0, 8);
},
runRefresh(data) {
this.responseData = data;
this.responseData = data || {type: 'JDBC', responseResult: {}, subRequestResults: []};
this.loading = false;
this.isStop = false;
this.$refs.debugResult.reload();
},
errorRefresh() {
this.runRefresh();
},
saveAsApi() {
let obj = {request: this.request};
obj.request.id = getUUID();

View File

@ -51,7 +51,7 @@
<p class="tip">{{ $t('api_test.definition.request.res_param') }} </p>
<ms-request-result-tail v-if="!loading" :response="responseData" ref="debugResult"/>
<!-- 执行组件 -->
<ms-run :debug="true" :reportId="reportId" :isStop="isStop" :run-data="runData" @runRefresh="runRefresh"
<ms-run :debug="true" :reportId="reportId" :isStop="isStop" :run-data="runData" @runRefresh="runRefresh" @errorRefresh="errorRefresh"
ref="runTest"/>
</div>
</el-card>
@ -204,13 +204,16 @@ export default {
this.$emit('refreshModule');
},
runRefresh(data) {
this.responseData = data;
this.responseData = data || {type: 'JDBC', responseResult: {}, subRequestResults: []};
this.loading = false;
this.isStop = false;
if (this.$refs.debugResult) {
this.$refs.debugResult.reload();
}
},
errorRefresh() {
this.runRefresh();
},
saveAsApi() {
this.$refs['debugForm'].validate((valid) => {
if (valid) {

View File

@ -29,7 +29,7 @@
</div>
<!-- 执行组件 -->
<ms-run :debug="true" :reportId="reportId" :isStop="isStop" :run-data="runData" @runRefresh="runRefresh"
<ms-run :debug="true" :reportId="reportId" :isStop="isStop" :run-data="runData" @runRefresh="runRefresh" @errorRefresh="errorRefresh"
ref="runTest"/>
</el-card>
<div v-if="scenario">
@ -158,13 +158,16 @@ export default {
this.reportId = getUUID().substring(0, 8);
},
runRefresh(data) {
this.responseData = data;
this.responseData = data || {type: 'JDBC', responseResult: {}, subRequestResults: []};
this.loading = false;
this.isStop = false;
if (this.$refs.debugResult) {
this.$refs.debugResult.reload();
}
},
errorRefresh() {
this.runRefresh();
},
saveAsApi() {
let obj = {request: this.request};
obj.request.id = getUUID();

View File

@ -39,7 +39,7 @@
ref="debugResult"/>
</div>
<!-- 执行组件 -->
<ms-run :debug="true" :reportId="reportId" :isStop="isStop" :run-data="runData" @runRefresh="runRefresh"
<ms-run :debug="true" :reportId="reportId" :isStop="isStop" :run-data="runData" @runRefresh="runRefresh" @errorRefresh="errorRefresh"
ref="runTest"/>
</el-card>
<div v-if="scenario">
@ -161,13 +161,16 @@ export default {
this.reportId = getUUID().substring(0, 8);
},
runRefresh(data) {
this.responseData = data;
this.responseData = data || {type: 'JDBC', responseResult: {}, subRequestResults: []};
this.loading = false;
this.isStop = false;
if (this.$refs.debugResult) {
this.$refs.debugResult.reload();
}
},
errorRefresh() {
this.runRefresh();
},
saveAsApi() {
let obj = {request: this.request};
obj.request.id = getUUID();