From c0d2913cef87214fedc18073dec42bcbf8b9a57d Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Mon, 16 May 2022 15:55:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8A=A0=E8=BD=BD=E7=94=A8=E4=BE=8B=E5=8F=AA?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E6=9C=80=E8=BF=91=E4=B8=80=E6=9D=A1=E7=9A=84?= =?UTF-8?q?=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1013172 --user=王孝刚 [接口测试]github#13585v接口定义-TEST-加载用例只显示最新的一条 https://www.tapd.cn/55049933/s/1158552 --- .../components/case/ApiCaseItem.vue | 1 + .../components/case/ApiCaseList.vue | 75 +++++++++++-------- 2 files changed, 46 insertions(+), 30 deletions(-) diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue index 29f1519562..23d67af619 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseItem.vue @@ -469,6 +469,7 @@ export default { this.currentApi.request = item.request; this.currentApi.request.changeId = getUUID(); } + this.$emit("setSelectedCaseId", item.id); }, changePriority(row) { if (row.id) { diff --git a/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue b/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue index bf48472f78..64bb7a1587 100644 --- a/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue +++ b/frontend/src/business/components/api/definition/components/case/ApiCaseList.vue @@ -3,38 +3,41 @@ - +
+ +
@@ -204,8 +207,20 @@ export default { } this.visible = true; }, - saveCase(item, hideAlert) { - this.$refs.apiCaseItem.saveTestCase(item, hideAlert); + setSelectedCaseId(caseId) { + this.selectCaseId = caseId; + }, + saveCase(hideAlert) { + let index = 0; + if (this.selectCaseId && this.selectCaseId !== '') { + for (let i = 0; i < this.apiCaseList.length; i++) { + if (this.apiCaseList[i].id === this.selectCaseId) { + index = i; + } + } + } + let item = this.apiCaseList[index]; + this.$refs.apiCaseItem[index].saveTestCase(item, hideAlert); }, saveApiAndCase(api) { if (api && api.url) {