From 3fad8f3a5a6915af875e04d33bf95cf2c8daba49 Mon Sep 17 00:00:00 2001 From: guocan Date: Thu, 29 May 2025 11:22:30 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=96=AD=E8=A8=80=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=A4=B1=E8=B4=A5=E5=90=8E=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E7=BB=A7=E7=BB=AD=E6=89=A7=E8=A1=8C=E5=92=8C=20=E5=AE=9A?= =?UTF-8?q?=E6=97=B6=E4=BB=BB=E5=8A=A1=E9=85=8D=E7=BD=AE=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=90=8E=EF=BC=8C=E6=9C=89=E4=B8=8B=E6=AC=A1=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E6=97=B6=E9=97=B4=EF=BC=8C=E4=BF=9D=E5=AD=98=E9=87=8D=E6=96=B0?= =?UTF-8?q?=E8=BF=9B=E6=9D=A5=E5=90=8E=E6=B2=A1=E6=9C=89=E4=B8=8B=E6=AC=A1?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/performance/performanceEdit.vue | 35 ++++++++++++------- .../src/views/test/uiTest/advancedSetting.vue | 25 ++++++++----- 2 files changed, 40 insertions(+), 20 deletions(-) diff --git a/test-ui/src/views/test/performance/performanceEdit.vue b/test-ui/src/views/test/performance/performanceEdit.vue index dc7adf2..51bd6c3 100644 --- a/test-ui/src/views/test/performance/performanceEdit.vue +++ b/test-ui/src/views/test/performance/performanceEdit.vue @@ -190,6 +190,25 @@ export default { this.getTestCaseData() this.getTestDetailData() }, + watch: { + // 监听 crontab 和 crontabStatus 的变化 + 'addForm.crontab': { + handler(newVal) { + if (newVal && this.addForm.crontabStatus === 1) { + this.updateExecutionTimes(); + } + } + }, + 'addForm.crontabStatus': { + handler(newVal) { + if (newVal === 1 && this.addForm.crontab) { + this.updateExecutionTimes(); + } else if (newVal === 0) { + this.nextExecutionTime = ''; + } + } + } + }, methods: { // 校验 validationForm() { @@ -306,19 +325,11 @@ export default { getTestDetail(this.$route.query.id).then(res => { if (res.code === 200) { this.addForm = res.data - this.addForm.crontabStatus = parseInt(res.data.crontabStatus) - res.data.performanceTestCaseVOList.forEach(item => { - item.status = String(item.status) - }) this.changeList = res.data.performanceTestCaseVOList - this.sceneList.forEach(row => { - this.changeList.forEach(item => { - if (row.id === item.testCaseId) { - this.multipleSelection.push(row) - } - }) - }) - this.addForm.rpsStatus = String(res.data.rpsStatus) + // 如果有定时任务,更新下次执行时间 + if (this.addForm.crontabStatus === 1 && this.addForm.crontab) { + this.updateExecutionTimes(); + } } }) }, diff --git a/test-ui/src/views/test/uiTest/advancedSetting.vue b/test-ui/src/views/test/uiTest/advancedSetting.vue index 2224cba..57c4b39 100644 --- a/test-ui/src/views/test/uiTest/advancedSetting.vue +++ b/test-ui/src/views/test/uiTest/advancedSetting.vue @@ -400,6 +400,7 @@ + 失败终止
@@ -467,13 +468,16 @@ - - +
+ + + 失败终止 +
@@ -529,7 +533,10 @@ - +
+ + 失败终止 +
@@ -539,6 +546,7 @@
+ 失败终止
@@ -879,6 +887,7 @@ export default { expectations: null, // 期望值 assertionMode: null, // 断言方式 isPopText: null, + isFailedAbort: '0', // 初始化失败终止属性为'0',使用字符串类型 } switch (this.saveForm.assertionType) {