From c3d26d0fe57fd0a46ecb1c2763e1cc66994c6185 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期一, 21 八月 2023 16:07:40 +0800
Subject: [PATCH] 增加判断

---
 src/components/AddControl.vue |   32 ++++++++++++++++++++------------
 1 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/src/components/AddControl.vue b/src/components/AddControl.vue
index 5883121..d1e4498 100644
--- a/src/components/AddControl.vue
+++ b/src/components/AddControl.vue
@@ -80,11 +80,16 @@
   },
   methods: {
     getStartInfo(){
-      startTask({id:this.id}).then(res=>{
-        if(res.code==200){
-          this.Arr=res.data.params;
-        }
-      })
+      if(this.id){
+        startTask({id:this.id}).then(res=>{
+          if(res.code==200){
+            this.Arr=res.data.params;
+          }
+        })
+      }else{
+        this.$message.error("褰撳墠璁惧娌℃湁宸ュ簭锛�");
+      }
+      
     },
     validatorNum(rule, value, callback) {
       if (value) {
@@ -105,13 +110,16 @@
 
     onSubmit() {
       
-     
-      sendProcessParams({id:this.id}).then(res=>{
-        if(res.code==200){
-          this.$message.success("涓嬪彂鎴愬姛锛�");
-          this.shutdown();
-        }
-      }) 
+      if(this.id){
+        sendProcessParams({id:this.id}).then(res=>{
+          if(res.code==200){
+            this.$message.success("涓嬪彂鎴愬姛锛�");
+            this.shutdown();
+          }
+        }) 
+      }else{
+        this.$message.error("褰撳墠璁惧娌℃湁宸ュ簭锛�");
+      }
     },
     shutdown() {
       this.islook = false;

--
Gitblit v1.8.0