Procházet zdrojové kódy

feat: 智能推送 - 推送分组 - "新建分组"逻辑

zhengxy před 1 rokem
rodič
revize
0a688f5190

+ 7 - 0
project/src/components/smartPushV3/detailList.vue

@@ -23,6 +23,7 @@
23 23
         </div>
24 24
       </div>
25 25
       <div class="flex">
26
+        <el-button type="primary" size="mini" @click="onClickCreatedRule">新建智能推送</el-button>
26 27
         <el-button type="primary" plain size="mini" @click="onClickBatchGroup">批量设置分组</el-button>
27 28
         <el-button type="primary" plain size="mini" @click="init(1,'export')">导出Excel</el-button>
28 29
       </div>
@@ -170,6 +171,12 @@ export default {
170 171
       }
171 172
       this.massMsgFlag = false
172 173
     },
174
+    // 监听点击"新建智能推送"规则
175
+    onClickCreatedRule () {
176
+      this.detail_rule_id = ''
177
+      this.isCopy = false
178
+      this.massMsgFlag = true
179
+    },
173 180
     // 监听点击"编辑"智能推送规则
174 181
     onClickEditRule (data) {
175 182
       this.detail_rule_id = data.rule_id;

+ 9 - 4
project/src/components/smartPushV3/pushGroupDialog.vue

@@ -27,7 +27,7 @@
27 27
       <!-- S 使用员工 - 单个企微主体 模式 -->
28 28
       <div v-show="form.operate_type == 1" class="form-item flex-align-start">
29 29
         <span class="lable required">使用员工:</span>
30
-        <div>
30
+        <div v-if="!loading">
31 31
           <div class="flex-align-center">
32 32
             <el-radio v-model="form.is_all" :label="1">全部员工</el-radio>
33 33
             <el-radio v-model="form.is_all" :label="0">部分员工</el-radio>
@@ -40,7 +40,7 @@
40 40
       <!-- S 使用员工 - 多个企微主体 模式 -->
41 41
       <div v-show="form.operate_type == 2" class="form-item flex-align-start">
42 42
         <span class="lable required">使用员工:</span>
43
-        <div>
43
+        <div v-if="!loading">
44 44
           <div class="flex-align-center">
45 45
             <el-radio v-model="form.is_operation" :label="1">运营组</el-radio>
46 46
             <el-radio v-model="form.is_operation" :label="0">选择成员</el-radio>
@@ -86,6 +86,7 @@ export default {
86 86
   data() {
87 87
     return {
88 88
       loading: false,
89
+      isShowForm: false,
89 90
       form: {
90 91
         title: '',
91 92
         is_all: 1, // 使用员工:1全部员工 0部分员工
@@ -127,7 +128,7 @@ export default {
127 128
           group_id: this.isEdit ? this.groupInfo.group_id : '',
128 129
           title,
129 130
           operate_type,
130
-          is_all,
131
+          is_all: operate_type == 2 ? 0 : is_all, // 多企微时传0
131 132
           senders: (operate_type == 1 && is_all == 0) ? user_id_list.join(',') : '',
132 133
           is_operation: operate_type == 1 ? 0 : is_operation, // 单主体模式 该字段传0
133 134
           operator_group_id: (operate_type == 2 && is_operation == 1) ? operator_group_id : '',
@@ -139,7 +140,7 @@ export default {
139 140
         if (res && res.errno == 0) {
140 141
           this.$message.success('操作成功')
141 142
           this.handleClearFormData()
142
-          this.$emit('confirm')
143
+          this.$emit('confirm', { isEdit: this.isEdit })
143 144
         } else if (res.errno != 4002) {
144 145
           this.$message.warning(res.err || '操作失败')
145 146
         }
@@ -221,6 +222,8 @@ export default {
221 222
         this.loading = true
222 223
         const { data: res = {} } = await this.$axios.get(url, { params })
223 224
         if (res && res.errno == 0) {
225
+          this.isShowForm = false
226
+
224 227
           const detailInfo = res.rst || {}
225 228
           this.form.title = detailInfo.title
226 229
           this.form.operate_type = detailInfo.operate_type ? detailInfo.operate_type : 1
@@ -251,6 +254,8 @@ export default {
251 254
               this.form.afferent_multiple_senders = [...arr]
252 255
             }
253 256
           }
257
+
258
+          this.isShowForm = true
254 259
         } else if (res.errno != 4002) {
255 260
           this.$message.warning(res.err || '操作失败')
256 261
         }

+ 17 - 5
project/src/components/smartPushV3/pushGroupList.vue

@@ -1,11 +1,12 @@
1 1
 <template>
2 2
   <div v-loading="loading">
3
-    <div class="screenBox" style="align-items: center;padding-right:16px">
3
+    <div class="screenBox" style="align-items: center;padding-right:16px;min-width:1120px;">
4 4
       <div class="flex-align-center" style="flex:1">
5 5
         <datePicker title="创建时间" :reset="resetFlag" @changeTime="onChangeTime" />
6 6
         <selfChannel title="创建人" :reset="resetFlag" type="circleCreate" :labelWidth="true" @channelDefine="onChangeCreatorId" />
7
-        <selfInputV2 v-model="keyword" label_name="搜索" placeholder="请输入" @change="onChangeKeyword" />
7
+        <selfInputV2 v-model="keyword" label_name="搜索" placeholder="请输入" :labelWidth="true" @change="onChangeKeyword" />
8 8
       </div>
9
+      <el-button type="primary" size="mini" @click="onClickCreateGroup">新建分组</el-button>
9 10
       <el-button type="primary" size="mini" @click="onClickCreatedRule">新建智能推送</el-button>
10 11
     </div>
11 12
     <el-table ref="multipleTable" :height="height" :data="tableData" tooltip-effect="dark" style="width:100%;margin-top:10px;">
@@ -94,6 +95,8 @@ export default {
94 95
     this.init(1)
95 96
   },
96 97
   methods: {
98
+
99
+
97 100
     detailClose (val) {
98 101
       if (val == 'update') {//编辑
99 102
         this.init(this.page)
@@ -273,13 +276,22 @@ export default {
273 276
       this.$exportOrder({ excelDatas, name: `智能推送-分组列表(导出时间:${this.$getDay(0)})` })
274 277
     },
275 278
 
276
-    // 监听点击"编辑"智能推送规则
279
+    // 监听点击"新建分组"
280
+    onClickCreateGroup() {
281
+      this.currentGroupInfo = {}
282
+      this.pushGroupVisible = true
283
+    },
284
+    // 监听点击"编辑分组"
277 285
     onClickEditGroup({ group_id, title }) {
278 286
       this.currentGroupInfo = { group_id, title }
279 287
       this.pushGroupVisible = true
280 288
     },
281
-    onConfirmGroup() {
282
-      this.init()
289
+    onConfirmGroup({ isEdit }) {
290
+      if (isEdit) {
291
+        this.init()
292
+      } else {
293
+        this.init(1)
294
+      }
283 295
       this.currentGroupInfo = {}
284 296
       this.pushGroupVisible = false
285 297
     },