DESKTOP-O04BTUJ\muzen пре 3 година
родитељ
комит
0eabd7d0cc
1 измењених фајлова са 7 додато и 2 уклоњено
  1. 7 2
      src/views/channel/custom/index.vue

+ 7 - 2
src/views/channel/custom/index.vue

@@ -82,6 +82,11 @@ export default {
       ids: []
     };
   },
+  watch:{
+    ids(val){
+      this.dialogForm.deviceIds = val.join(',')
+    }
+  },
   mounted() {
     devList().then(res => {
       if (res.code === 0) {
@@ -135,6 +140,7 @@ export default {
           }
         })
       } else {
+        this.ids = []
         this.dialogForm = {}
         this.title = '新增'
       }
@@ -142,8 +148,7 @@ export default {
 
     // 创建
     getSubmit() {
-      this.dialogForm.deviceIds = this.ids.join(',')
-      if (this.title = '编辑') {
+      if (this.title === '编辑') {
         editPage(this.dialogForm).then(res => {
           if (res.code === 0) {
             this.$message.success('修改成功!')