Bladeren bron

feat: 智能推送 - 删除分组

zhengxy 1 jaar geleden
bovenliggende
commit
d2e31495bb
2 gewijzigde bestanden met toevoegingen van 26 en 1 verwijderingen
  1. 1 0
      project/src/assets/config/interface_api.js
  2. 25 1
      project/src/components/smartPushV3/pushGroupList.vue

+ 1 - 0
project/src/assets/config/interface_api.js

@@ -383,6 +383,7 @@ var api = {
383 383
   smartPushV3_templateDetail: "/api/PeriodMassMsg/templateDetail", // 企微助手 - 智能推送V3 - 模板详情
384 384
   smartPushV3_groupList: "/api/PeriodMassMsg/groupList", // 企微助手 - 智能推送V3 - 分组列表
385 385
   smartPushV3_changeGroupStatus: "/api/PeriodMassMsg/changeGroupStatus", // 企微助手 - 智能推送V3 - 分组状态
386
+  smartPushV3_delGroup: "/api/PeriodMassMsg/delGroup", // 企微助手 - 智能推送V3 - 删除分组
386 387
   smartPushV3_editGroup: "/api/PeriodMassMsg/editGroup", // 企微助手 - 智能推送V3 - 新建/编辑模板
387 388
   smartPushV3_changeGroupBatch: "/api/PeriodMassMsg/changeGroupBatch", // 企微助手 - 智能推送V3 - 批量设置分组
388 389
 

+ 25 - 1
project/src/components/smartPushV3/pushGroupList.vue

@@ -30,6 +30,9 @@
30 30
           <div class="flex" style="justify-content:center">
31 31
             <div v-if="scope.row.group_id != 0" class="c-00B38A pointer table_button" @click="onClickEditGroup(scope.row)">编辑</div>
32 32
             <div class="c-00B38A pointer table_button" @click="onClickGroupDetail(scope.row)">详情</div>
33
+            <el-popconfirm @confirm="onClickDelGroup(scope.row)" :title="`确定删除【${scope.row.title}】分组吗?`">
34
+              <div slot="reference" class="c-FF604D pointer table_button">删除</div>
35
+            </el-popconfirm>
33 36
           </div>
34 37
         </template>
35 38
       </el-table-column>
@@ -106,13 +109,34 @@ export default {
106 109
     onClickCreatedRule () {
107 110
       this.massMsgFlag = true
108 111
     },
109
-    // 监听点击"推送记录"
112
+    // 监听点击"详情"
110 113
     onClickGroupDetail(data) {
111 114
       this.$router.push({
112 115
         path: '/pushDetailV3',
113 116
         query: { group_id: data.group_id }
114 117
       })
115 118
     },
119
+    // 监听点击“删除”分组
120
+    async onClickDelGroup(row) {
121
+      try {
122
+        const url = `${this.URL.BASEURL}${this.URL.smartPushV3_delGroup}`
123
+        const params = {
124
+          group_id: row.group_id
125
+        }
126
+        this.$loading(this.$loadingConfig);
127
+        const { data: res = {} } = await this.$axios.get(url, { params })
128
+        if (res && res.errno == 0) {
129
+          this.$message.success('操作成功')
130
+          this.init()
131
+        } else if (res.errno != 4002) {
132
+          this.$message.warning(res.err)
133
+        }
134
+      } catch (error) {
135
+        console.log('error => ', error)
136
+      } finally {
137
+        this.$loading(this.$loadingConfig).close()
138
+      }
139
+    },
116 140
     // 监听点击切换"状态"
117 141
     onClickStatus(row) {
118 142
       this.$confirm(`确定${row.status == 0 ? '启用' : '禁用'}【${row.title}】?`, '提示', {