Browse Source

feat: 企微助手 - 群活码 - 编辑交互逻辑&接口联调

zhengxy 2 years ago
parent
commit
7d2e51cb8d
1 changed files with 17 additions and 1 deletions
  1. 17 1
      project/src/components/groupCode/createGroupCode.vue

+ 17 - 1
project/src/components/groupCode/createGroupCode.vue

@@ -353,9 +353,25 @@ export default {
353 353
         is_limit,
354 354
         user_list: user_list.join(','),
355 355
         leading_words,
356
-        chat_id_list: JSON.stringify(chatIdList),
357 356
       }
358 357
 
358
+      if (this.isEdit) {
359
+        params.rule_id = this.rule_id
360
+        params.config_id = this.detailFromApi.config_id
361
+
362
+        // 接口返回的原始数据 与 页面显示的数据比对
363
+        this.detailFromApi.chat_id_list.forEach((item, idx) => {
364
+          const isFound = chatIdList.find(c => c.chat_id === item.chat_id)
365
+          // 如果原始数据 在页面中"没"找到 => 证明"已删除"
366
+          if (!isFound) {
367
+            item.enable = 0 // 参数写为0 并追加到数组末
368
+            chatIdList.push(item)
369
+          }
370
+        })
371
+      }
372
+
373
+      params.chat_id_list = JSON.stringify(chatIdList)
374
+
359 375
       return { url, params }
360 376
     },
361 377
     // 获取分组列表