From 614aa05b426fdafe0e07e9b4486767a0b6784f5c Mon Sep 17 00:00:00 2001 From: guocan Date: Fri, 13 Jun 2025 15:09:59 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=9C=BA=E6=99=AF=E6=AD=A5=E9=AA=A4?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=90=8E=EF=BC=8C=E5=8F=B3=E8=BE=B9=E7=9A=84?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=B2=A1=E6=9C=89=E6=B8=85=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/test/uiTest/automationTest.vue | 1 - test-ui/src/views/test/uiTest/editScene.vue | 25 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/test-ui/src/views/test/uiTest/automationTest.vue b/test-ui/src/views/test/uiTest/automationTest.vue index fb5e428..2257a11 100644 --- a/test-ui/src/views/test/uiTest/automationTest.vue +++ b/test-ui/src/views/test/uiTest/automationTest.vue @@ -163,7 +163,6 @@ export default { } }).catch(err => { loading.close(); - this.$modal.msgError("执行失败"); }); }, // 分页 diff --git a/test-ui/src/views/test/uiTest/editScene.vue b/test-ui/src/views/test/uiTest/editScene.vue index f7cad9b..383f07a 100644 --- a/test-ui/src/views/test/uiTest/editScene.vue +++ b/test-ui/src/views/test/uiTest/editScene.vue @@ -150,6 +150,31 @@ export default { deleteStep(index) { this.$modal.confirm('确认删除该步骤' + '?').then(() => { this.informationForm.uiSceneStepsVOList.splice(index, 1); + + // 如果删除后没有步骤了,清空右侧面板 + if (this.informationForm.uiSceneStepsVOList.length === 0) { + this.defaultActive = 0; + this.changeStep = { operateType: null }; + return; + } + + // 如果删除的是当前选中的步骤 + if (this.defaultActive - 1 === index) { + // 如果有下一个步骤,选择下一个 + if (index < this.informationForm.uiSceneStepsVOList.length) { + this.defaultActive = index + 1; + this.changeStep = this.informationForm.uiSceneStepsVOList[index]; + } + // 如果有上一个步骤,选择上一个 + else if (index > 0) { + this.defaultActive = index; + this.changeStep = this.informationForm.uiSceneStepsVOList[index - 1]; + } + } + // 如果删除的步骤在当前选中步骤之前,需要更新defaultActive + else if (this.defaultActive - 1 > index) { + this.defaultActive--; + } }).catch(() => { }) }, // 场景步骤