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 @@