fix(接口测试): 修复api列表批量复制数据会发出多个请求的缺陷

--bug=1028466 --user=王孝刚 【接口测试】api定义列表-批量复制较多数据-可发出多个请求
https://www.tapd.cn/55049933/s/1402885
This commit is contained in:
wxg0103 2023-08-11 19:08:45 +08:00 committed by 刘瑞斌
parent a0ffb3a685
commit 2f94824031
3 changed files with 12 additions and 3 deletions

View File

@ -29,7 +29,7 @@
</el-tree> </el-tree>
</div> </div>
<template v-slot:footer> <template v-slot:footer>
<ms-dialog-footer @cancel="close" @confirm="save" /> <ms-dialog-footer @cancel="close" @confirm="save" ref="footer"/>
</template> </template>
</el-dialog> </el-dialog>
</div> </div>
@ -74,6 +74,7 @@ export default {
this.moduleOptions = moduleOptions; this.moduleOptions = moduleOptions;
}, },
save() { save() {
this.$refs.footer.disableSaveBtn = true;
if (!this.currentKey) { if (!this.currentKey) {
this.$warning(this.$t('test_track.case.input_module')); this.$warning(this.$t('test_track.case.input_module'));
return; return;
@ -101,6 +102,7 @@ export default {
this.filterText = ''; this.filterText = '';
this.dialogVisible = false; this.dialogVisible = false;
this.selectNode = {}; this.selectNode = {};
this.$refs.footer.disableSaveBtn = false;
}, },
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;

View File

@ -29,7 +29,7 @@
</el-tree> </el-tree>
</div> </div>
<template v-slot:footer> <template v-slot:footer>
<ms-dialog-footer @cancel="close" @confirm="save" /> <ms-dialog-footer @cancel="close" @confirm="save" ref="footer"/>
</template> </template>
</el-dialog> </el-dialog>
</div> </div>
@ -67,6 +67,7 @@ export default {
this.moduleOptions = moduleOptions; this.moduleOptions = moduleOptions;
}, },
save() { save() {
this.$refs.footer.disableSaveBtn = true;
if (!this.currentKey) { if (!this.currentKey) {
this.$warning(this.$t('test_track.case.input_module')); this.$warning(this.$t('test_track.case.input_module'));
return; return;
@ -90,6 +91,7 @@ export default {
this.filterText = ''; this.filterText = '';
this.dialogVisible = false; this.dialogVisible = false;
this.selectNode = {}; this.selectNode = {};
this.$refs.footer.disableSaveBtn = false;
}, },
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;

View File

@ -2,7 +2,7 @@
<div class="dialog-footer"> <div class="dialog-footer">
<el-button @click="cancel" :size="btnSize">{{ $t('commons.cancel') }}</el-button> <el-button @click="cancel" :size="btnSize">{{ $t('commons.cancel') }}</el-button>
<el-button v-prevent-re-click type="primary" @click="confirm" @keydown.enter.native.prevent :size="btnSize">{{ $t('commons.confirm') }} <el-button v-prevent-re-click type="primary" @click="confirm" @keydown.enter.native.prevent :size="btnSize" :disabled="disableSaveBtn">{{ $t('commons.confirm') }}
</el-button> </el-button>
<el-button v-prevent-re-click type="primary" v-if="isShow" @click="saveAsEdit" @keydown.enter.native.prevent>{{ title }}</el-button> <el-button v-prevent-re-click type="primary" v-if="isShow" @click="saveAsEdit" @keydown.enter.native.prevent>{{ title }}</el-button>
</div> </div>
@ -25,6 +25,11 @@ export default {
} }
} }
}, },
data() {
return {
disableSaveBtn: false,
};
},
methods: { methods: {
cancel() { cancel() {
this.$emit("cancel"); this.$emit("cancel");