From 16ede80fd4b4bbe6547f784bd7db34b028dab0e6 Mon Sep 17 00:00:00 2001 From: AoXuan Date: Wed, 13 Aug 2025 16:22:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(Scheduler):=20=E4=BF=AE=E5=A4=8D=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=9A=84=E5=BC=B9=E7=AA=97=E9=80=89=E6=8B=A9=E5=99=A8?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/Scheduler.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/Scheduler.vue b/frontend/src/views/Scheduler.vue index f2281a6..1a5069c 100644 --- a/frontend/src/views/Scheduler.vue +++ b/frontend/src/views/Scheduler.vue @@ -119,7 +119,7 @@ const taskOptions = ref([]) // 任务表单 const taskForm = reactive({ - taskId: '', + taskId: null, mode: '自动代理' as TaskCreateIn.mode }) @@ -192,6 +192,12 @@ const addTask = async () => { message.error('请填写完整的任务信息') return } + if ( + taskForm.taskId === '' + ) { + message.error('请选择要执行的任务') + return + } try { addTaskLoading.value = true @@ -217,7 +223,7 @@ const addTask = async () => { addTaskModalVisible.value = false // 重置表单 - taskForm.taskId = '' + taskForm.taskId = null taskForm.mode = '自动代理' } else { message.error(response.message || '创建任务失败') @@ -233,7 +239,7 @@ const addTask = async () => { // 取消添加任务 const cancelAddTask = () => { addTaskModalVisible.value = false - taskForm.taskId = '' + taskForm.taskId = null taskForm.mode = '自动代理' }