Przeglądaj źródła

直播列表选择优化/一键发群优化

三七 11 godzin temu
rodzic
commit
5f824648db

+ 12 - 2
src/api/live/live.js

@@ -52,10 +52,20 @@ export function exportLive(query) {
   })
 }
 // 查询未结束的直播间
-export function listToLiveNoEnd() {
+export function listToLiveNoEnd(query) {
   return request({
     url: '/live/live/listToLiveNoEnd',
-    method: 'get'
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询直播间分组列表
+export function listLiveGroupType(query) {
+  return request({
+    url: '/live/liveGroupType/list',
+    method: 'get',
+    params: query
   })
 }
 

+ 1 - 1
src/views/qw/sop/deptSop.vue

@@ -697,7 +697,7 @@
             <el-option
               v-for="chatId in sendMsgOpen.row && sendMsgOpen.row.chatId ? sendMsgOpen.row.chatId.split(',') : []"
               :key="chatId"
-              :label="chatList.filter(e => e.chatId == chatId) ? chatList.filter(e => e.chatId == chatId)[0].name : ''"
+              :label="chatList.filter(e => e.chatId == chatId).length ? chatList.filter(e => e.chatId == chatId)[0].name : ''"
               :value="chatId"
             />
           </el-select>

+ 1 - 1
src/views/qw/sop/mySop.vue

@@ -697,7 +697,7 @@
             <el-option
               v-for="chatId in sendMsgOpen.row && sendMsgOpen.row.chatId ? sendMsgOpen.row.chatId.split(',') : []"
               :key="chatId"
-              :label="chatList.filter(e => e.chatId == chatId) ? chatList.filter(e => e.chatId == chatId)[0].name : ''"
+              :label="chatList.filter(e => e.chatId == chatId).length ? chatList.filter(e => e.chatId == chatId)[0].name : ''"
               :value="chatId"
             />
           </el-select>

+ 1 - 1
src/views/qw/sop/sop.vue

@@ -698,7 +698,7 @@
             <el-option
               v-for="chatId in sendMsgOpen.row && sendMsgOpen.row.chatId ? sendMsgOpen.row.chatId.split(',') : []"
               :key="chatId"
-              :label="chatList.filter(e => e.chatId == chatId) ? chatList.filter(e => e.chatId == chatId)[0].name : ''"
+              :label="chatList.filter(e => e.chatId == chatId).length ? chatList.filter(e => e.chatId == chatId)[0].name : ''"
               :value="chatId"
             />
           </el-select>

+ 58 - 2
src/views/qw/sopTemp/updateSopTemp.vue

@@ -215,6 +215,17 @@
                                   </el-radio-group>
                                 </el-form-item>
                                 <el-form-item label="直播间" v-if="content.type == 20">
+                                      <el-select  v-model="liveGroupTypeId"
+                                                  filterable
+                                                  placeholder="请选择直播间分组" clearable
+                                                  @change="liveGroupTypeChange" >
+                                        <el-option
+                                          v-for="dict in liveGroupTypeList"
+                                          :key="dict.id"
+                                          :label="dict.liveGroupType"
+                                          :value="dict.id"
+                                        />
+                                      </el-select>
                                       <el-select  v-model="content.liveId"
                                                   filterable
                                                   placeholder="请选择直播间" size="mini"
@@ -539,10 +550,23 @@
                                                 <i class="el-icon-video-camera"></i>
                                                 <span>直播小程序</span>
                                               </div>
+                                              <el-form-item label="直播间分组" label-width="120px">
+                                                <el-select  v-model="liveGroupTypeId"
+                                                            filterable
+                                                            placeholder="请选择直播间分组"  clearable
+                                                            @change="liveGroupTypeChange" >
+                                                  <el-option
+                                                    v-for="dict in liveGroupTypeList"
+                                                    :key="dict.id"
+                                                    :label="dict.liveGroupType"
+                                                    :value="dict.id"
+                                                  />
+                                                </el-select>
+                                              </el-form-item>
                                               <el-form-item label="直播间" prop="liveId"
                                                             :rules="[{ required: true, message: '请选择直播间', trigger: 'change' }]">
                                                 <el-select  v-model="setList.liveId"
-                                                            placeholder="请选择直播间" size="mini"
+                                                            placeholder="请选择直播间"
                                                             filterable
                                                             :disabled="content.type==20"
                                                             @change="liveChange(setList)" >
@@ -1827,7 +1851,7 @@ import {
   delRules
 } from "@/api/qw/sopTemp";
 import {courseList, videoList} from "@/api/qw/sop";
-import {listToLiveNoEnd} from "@/api/live/live";
+import {listToLiveNoEnd, listLiveGroupType} from "@/api/live/live";
 import ImageUpload from "@/views/qw/sop/ImageUpload";
 import userVideo from "@/views/qw/userVideo/userVideo.vue";
 import {listReward} from "@/api/qw/luckyBag";
@@ -1952,6 +1976,8 @@ export default {
         ],
       },
       liveList: [],
+      liveGroupTypeList: [],
+      liveGroupTypeId: null,
     };
   },
   created() {
@@ -1986,6 +2012,9 @@ export default {
 
     listToLiveNoEnd().then(response => {
       this.liveList = response.rows;
+    });
+    listLiveGroupType().then(response => {
+      this.liveGroupTypeList = response.rows || response.data || [];
     })
     listReward(this.queryParams1).then(response => {
       this.luckyBagList = response.rows;
@@ -2070,6 +2099,33 @@ export default {
         content.miniprogramPicUrl = '';
       }
     },
+    liveGroupTypeChange(val) {
+      if (val) {
+        listToLiveNoEnd({ liveGroupType: val }).then(response => {
+          this.liveList = response.rows;
+        });
+      } else {
+        listToLiveNoEnd().then(response => {
+          this.liveList = response.rows;
+        });
+      }
+      // 切换分组时清空已选的直播间
+      if (this.form && this.form.content) {
+        for (let i = 0; i < this.form.content.length; i++) {
+          const content = this.form.content[i];
+          if (content.liveId != null) {
+            content.liveId = null;
+          }
+          if (content.setting) {
+            for (let j = 0; j < content.setting.length; j++) {
+              if (content.setting[j].liveId != null) {
+                this.$set(content.setting[j], 'liveId', null);
+              }
+            }
+          }
+        }
+      }
+    },
     liveChangeContent(e){
       //循环修改当前content下面的直播间内容
       //并且禁用直播间编辑

+ 66 - 6
src/views/qw/sopUserLogsInfo/sendMsgOpenTool.vue

@@ -11,7 +11,7 @@
                 </span>
         </template>
       </el-alert>
-      <el-form ref="msgForm" :model="msgForm" :rules="msgRules" label-width="100px">
+      <el-form ref="msgForm" :model="msgForm" :rules="msgRules">
         <el-form-item label="策略" prop="draftStrategy">
           <el-radio-group v-model="msgForm.draftStrategy">
             <el-radio :label="1">正常群发</el-radio>
@@ -48,6 +48,16 @@
           </el-select>
         </el-form-item>
          <el-form-item label="选择直播间" v-if="msgForm.draftStrategy!=4">
+             <el-select  v-model="liveGroupTypeId"
+                         placeholder="请选择直播间分组" clearable
+                                      @change="liveGroupTypeChange" >
+                            <el-option
+                              v-for="dict in liveGroupTypeList"
+                              :key="dict.id"
+                              :label="dict.liveGroupType"
+                              :value="dict.id"
+                            />
+              </el-select>
              <el-select  v-model="msgForm.liveId"
                          filterable
                                       placeholder="请选择直播间" size="mini"
@@ -104,10 +114,23 @@
                   <el-form-item label="内容" style="margin-bottom: 2%" >
                     <div v-if="item.contentType == 12 || item.contentType == 18 || item.contentType == 19 || item.contentType == 24">
                       <el-card class="box-card">
+                        <el-form-item label="直播间分组" label-width="110px">
+                          <el-select  v-model="liveGroupTypeId"
+                                      filterable
+                                      placeholder="请选择直播间分组" clearable
+                                      @change="liveGroupTypeChange" >
+                            <el-option
+                              v-for="dict in liveGroupTypeList"
+                              :key="dict.id"
+                              :label="dict.liveGroupType"
+                              :value="dict.id"
+                            />
+                          </el-select>
+                        </el-form-item>
                         <el-form-item label="直播间" >
                           <el-select  v-model="item.liveId"
                                       filterable
-                                      placeholder="请选择直播间" size="mini"
+                                      placeholder="请选择直播间"
                                       @change="liveChange(item)" :disabled="liveDisabled()">
                             <el-option
                               v-for="dict in liveList"
@@ -313,9 +336,23 @@
                     </div>
                     <div v-if="item.contentType == 20">
                       <el-card class="box-card">
+                        <el-form-item label="直播间分组" label-width="110px">
+                          <el-select  v-model="liveGroupTypeId"
+                                      filterable
+                                      placeholder="请选择直播间分组" clearable
+                                      @change="liveGroupTypeChange" >
+                            <el-option
+                              v-for="dict in liveGroupTypeList"
+                              :key="dict.id"
+                              :label="dict.liveGroupType"
+                              :value="dict.id"
+                            />
+                          </el-select>
+                        </el-form-item>
                         <el-form-item label="直播间" >
                           <el-select  v-model="item.liveId"
-                                      placeholder="请选择直播间" size="mini"
+                                      filterable
+                                      placeholder="请选择直播间"
                                       @change="liveChange(item)" >
                             <el-option
                               v-for="dict in liveList"
@@ -493,7 +530,7 @@ import { sendMsgSopType,} from "../../../api/qw/sopUserLogsInfo";
 import ImageUpload from "@/views/qw/sop/ImageUpload.vue";
 import {courseList, videoList} from "@/api/qw/sop";
 import userVideo from "@/views/qw/userVideo/userVideo";
-import {listToLiveNoEnd} from "@/api/live/live";
+import {listToLiveNoEnd, listLiveGroupType} from "@/api/live/live";
 import {listReward} from "@/api/qw/luckyBag";
 import { getSmsTempList } from "@/api/company/companySmsTemp";
 import { getQwSopTempVoiceCompanyUser } from "@/api/qw/QwSopTempVoice";
@@ -619,6 +656,8 @@ export default {
       },
       msgRules:{},
       liveList: [],
+      liveGroupTypeList: [],
+      liveGroupTypeId: null,
       pickerOptions: {
             shortcuts: [
                 {
@@ -679,6 +718,9 @@ export default {
     listToLiveNoEnd().then(response => {
       this.liveList = response.rows;
     })
+    listLiveGroupType().then(response => {
+      this.liveGroupTypeList = response.rows || response.data || [];
+    })
     listReward(this.queryParams1).then(response => {
       this.luckyBagList = response.rows;
     });
@@ -741,6 +783,25 @@ export default {
         content.miniprogramPicUrl = '';
       }
     },
+    liveGroupTypeChange(val) {
+      if (val) {
+        listToLiveNoEnd({ liveGroupType: val }).then(response => {
+          this.liveList = response.rows;
+        });
+      } else {
+        listToLiveNoEnd().then(response => {
+          this.liveList = response.rows;
+        });
+      }
+      // 切换分组时清空已选的直播间
+      if (this.msgForm.liveId) {
+        this.msgForm.liveId = null;
+      }
+      // 清空规则中的直播间
+      for (let i = 0; i < this.setting.length; i++) {
+        this.$set(this.setting[i], 'liveId', null);
+      }
+    },
     qwUserVideoResult(val) {
 
       // 根据选中的内容,将返回的数据更新到相应的表单项
@@ -1074,6 +1135,7 @@ export default {
     },
 
     resetSendMsgSop() {
+      this.liveGroupTypeId = null;
       this.msgForm = {
         liveId:null,
         videoId:null,
@@ -1302,8 +1364,6 @@ export default {
       this.resetSendMsgSop();
     },
     liveChangemsgForm(liveId){
-      console.log(liveId);
-      console.log(this.setting);
       if(!!liveId){
         for(let i =0;i<this.setting.length;i++){
            this.$set(this.setting[i], 'liveId', liveId);

+ 80 - 4
src/views/qw/sopUserLogsInfo/sendMsgSopOpenTool.vue

@@ -11,7 +11,7 @@
                 </span>
         </template>
       </el-alert>
-      <el-form ref="msgForm" :model="msgForm" :rules="msgRules" label-width="100px">
+      <el-form ref="msgForm" :model="msgForm" :rules="msgRules">
         <el-form-item label="策略" prop="draftStrategy">
           <el-radio-group v-model="msgForm.draftStrategy">
             <el-radio :label="1">正常群发</el-radio>
@@ -47,6 +47,30 @@
             />
           </el-select>
         </el-form-item>
+          <el-form-item label="选择直播间" v-if="msgForm.draftStrategy!=4">
+              <el-select  v-model="liveGroupTypeId"
+                          placeholder="请选择直播间分组"  clearable
+                          @change="liveGroupTypeChange" >
+                  <el-option
+                      v-for="dict in liveGroupTypeList"
+                      :key="dict.id"
+                      :label="dict.liveGroupType"
+                      :value="dict.id"
+                  />
+              </el-select>
+              <el-select  v-model="msgForm.liveId"
+                          filterable
+                          placeholder="请选择直播间" size="mini"
+                          style=" margin-right: 10px;"
+                          @change="liveChangemsgForm(msgForm.liveId)" clearable >
+                  <el-option
+                      v-for="dict in liveList"
+                      :key="dict.liveId"
+                      :label="dict.liveName"
+                      :value="dict.liveId"
+                  />
+              </el-select>
+          </el-form-item>
         <el-form-item label="规则" prop="setting" v-if="msgForm.draftStrategy==1"  >
           <div v-for="(item, index) in setting" :key="index" style="background-color: #fdfdfd; border: 1px solid #e6e6e6; margin-bottom: 20px;">
             <el-row>
@@ -206,12 +230,25 @@
                       </el-card>
                     </div>
 
-                    <div v-if="item.contentType == 12 || item.contentType == 18 || item.contentType == 19 || item.contentType == 24">
+                    <div v-if="item.contentType == 12 || item.contentType == 18 || item.contentType == 19 || item.contentType == 24 || item.contentType == 20">
                       <el-card class="box-card">
+                        <el-form-item label="直播间分组" label-width="110px">
+                          <el-select  v-model="liveGroupTypeId"
+                                      filterable
+                                      placeholder="请选择直播间分组" clearable
+                                      @change="liveGroupTypeChange" >
+                            <el-option
+                              v-for="dict in liveGroupTypeList"
+                              :key="dict.id"
+                              :label="dict.liveGroupType"
+                              :value="dict.id"
+                            />
+                          </el-select>
+                        </el-form-item>
                         <el-form-item label="直播间" >
                           <el-select  v-model="item.liveId"
                                       filterable
-                                      placeholder="请选择直播间" size="mini"
+                                      placeholder="请选择直播间"
                                       @change="liveChange(item)" >
                             <el-option
                               v-for="dict in liveList"
@@ -369,7 +406,7 @@ import ImageUpload from "@/views/qw/sop/ImageUpload.vue";
 import {courseList, videoList} from "@/api/qw/sop";
 import userVideo from "@/views/qw/userVideo/userVideo";
 import {listReward} from "@/api/qw/luckyBag";
-import {listToLiveNoEnd} from "@/api/live/live";
+import {listToLiveNoEnd, listLiveGroupType} from "@/api/live/live";
 import { getQwSopTempVoiceCompanyUser } from "@/api/qw/QwSopTempVoice";
 import { listAiSipCallTask } from '@/api/aiSipCall/aiSipCallTask'
 
@@ -461,6 +498,8 @@ export default {
       sysQwSopAiContentType:[],
 
       liveList: [],
+      liveGroupTypeList: [],
+      liveGroupTypeId: null,
       sendMsgOpen:{
         title:'一键批量群发',
         open:false,
@@ -547,6 +586,9 @@ export default {
     listToLiveNoEnd().then(response => {
       this.liveList = response.rows;
     });
+    listLiveGroupType().then(response => {
+      this.liveGroupTypeList = response.rows || response.data || [];
+    });
 
     courseList().then(response => {
       this.courseList = response.list;
@@ -609,6 +651,26 @@ export default {
       }
     },
 
+    liveGroupTypeChange(val) {
+      if (val) {
+        listToLiveNoEnd({ liveGroupType: val }).then(response => {
+          this.liveList = response.rows;
+        });
+      } else {
+        listToLiveNoEnd().then(response => {
+          this.liveList = response.rows;
+        });
+      }
+      // 切换分组时清空已选的直播间
+      if (this.msgForm.liveId) {
+        this.msgForm.liveId = null;
+      }
+      // 清空规则中的直播间
+      for (let i = 0; i < this.setting.length; i++) {
+        this.$set(this.setting[i], 'liveId', null);
+      }
+    },
+
     qwUserVideoResult(val) {
 
       // 根据选中的内容,将返回的数据更新到相应的表单项
@@ -952,6 +1014,7 @@ export default {
     },
 
     resetSendMsgSop() {
+      this.liveGroupTypeId = null;
       this.msgForm = {
         videoId:null,
         courseId:null,
@@ -1097,6 +1160,19 @@ export default {
       this.sendMsgOpen.open = false;
       this.resetSendMsgSop();
     },
+
+      liveChangemsgForm(liveId){
+          if(!!liveId){
+              for(let i =0;i<this.setting.length;i++){
+                  this.$set(this.setting[i], 'liveId', liveId);
+                  this.liveChange(this.setting[i]);
+              }
+          }
+      },
+      liveDisabled(){
+          return !!this.msgForm && !!this.msgForm.liveId ;
+      },
+
     openVoiceDialog(item) {
       this.voiceOptions.open = true;
       this.voiceOptions.currentItem = item;

+ 65 - 3
src/views/qw/sopUserLogsInfo/sopUserLogsInfoDetails.vue

@@ -269,6 +269,16 @@
 
         </el-form-item>
         <el-form-item label="选择直播间">
+             <el-select  v-model="liveGroupTypeId"
+                         placeholder="请选择直播间分组" clearable
+                          @change="liveGroupTypeChange" >
+                            <el-option
+                              v-for="dict in liveGroupTypeList"
+                              :key="dict.id"
+                              :label="dict.liveGroupType"
+                              :value="dict.id"
+                            />
+              </el-select>
              <el-select  v-model="msgForm.liveId"
                          filterable
                                       placeholder="请选择直播间" size="mini"
@@ -411,10 +421,23 @@
                     <div v-if="item.contentType == 12 || item.contentType == 24">
                       <!--                                           <div >-->
                       <el-card class="box-card">
+                        <el-form-item label="直播间分组" label-width="120px">
+                          <el-select  v-model="liveGroupTypeId"
+                                      filterable
+                                      placeholder="请选择直播间分组" clearable
+                                      @change="liveGroupTypeChange" >
+                            <el-option
+                              v-for="dict in liveGroupTypeList"
+                              :key="dict.id"
+                              :label="dict.liveGroupType"
+                              :value="dict.id"
+                            />
+                          </el-select>
+                        </el-form-item>
                         <el-form-item label="直播间" >
                           <el-select  v-model="item.liveId"
                                       filterable
-                                      placeholder="请选择直播间" size="mini"
+                                      placeholder="请选择直播间"
                                       @change="liveChange(item)" :disabled="liveDisabled()" >
                             <el-option
                               v-for="dict in liveList"
@@ -442,9 +465,23 @@
                     </div>
                     <div v-if="item.contentType == 20">
                       <el-card class="box-card">
+                        <el-form-item label="直播间分组" label-width="120px">
+                          <el-select  v-model="liveGroupTypeId"
+                                      filterable
+                                      placeholder="请选择直播间分组" clearable
+                                      @change="liveGroupTypeChange" >
+                            <el-option
+                              v-for="dict in liveGroupTypeList"
+                              :key="dict.id"
+                              :label="dict.liveGroupType"
+                              :value="dict.id"
+                            />
+                          </el-select>
+                        </el-form-item>
                         <el-form-item label="直播间" >
                           <el-select  v-model="item.liveId"
-                                      placeholder="请选择直播间" size="mini"
+                                      filterable
+                                      placeholder="请选择直播间"
                                       @change="liveChange(item)" >
                             <el-option
                               v-for="dict in liveList"
@@ -705,7 +742,7 @@ import {listTag} from "@/api/qw/tag";
 import {searchTags} from "../../../api/qw/tag";
 import userVideo from "@/views/qw/userVideo/userVideo.vue";
 import PaginationMore from "../../../components/PaginationMore/index.vue";
-import {listToLiveNoEnd} from "@/api/live/live";
+import {listToLiveNoEnd, listLiveGroupType} from "@/api/live/live";
 import {listReward} from "@/api/qw/luckyBag";
 import { getSmsTempList } from "@/api/company/companySmsTemp";
 import { getQwSopTempVoiceCompanyUser } from "@/api/qw/QwSopTempVoice";
@@ -849,6 +886,8 @@ export default {
       },
       msgRules:{},
       liveList: [],
+      liveGroupTypeList: [],
+      liveGroupTypeId: null,
     };
   },
 
@@ -878,6 +917,9 @@ export default {
     listToLiveNoEnd().then(response => {
       this.liveList = response.rows;
     });
+    listLiveGroupType().then(response => {
+      this.liveGroupTypeList = response.rows || response.data || [];
+    });
     listReward(this.queryParams1).then(response => {
       this.luckyBagList = response.rows;
     });
@@ -912,6 +954,25 @@ export default {
         content.miniprogramPicUrl = '';
       }
     },
+    liveGroupTypeChange(val) {
+      if (val) {
+        listToLiveNoEnd({ liveGroupType: val }).then(response => {
+          this.liveList = response.rows;
+        });
+      } else {
+        listToLiveNoEnd().then(response => {
+          this.liveList = response.rows;
+        });
+      }
+      // 切换分组时清空已选的直播间
+      if (this.msgForm.liveId) {
+        this.msgForm.liveId = null;
+      }
+      // 清空规则中的直播间
+      for (let i = 0; i < this.setting.length; i++) {
+        this.$set(this.setting[i], 'liveId', null);
+      }
+    },
     selectSopUserLogsInfo(val,externalUserName){
 
       this.loading = true;
@@ -1416,6 +1477,7 @@ export default {
 
 
     resetSendMsgSop() {
+      this.liveGroupTypeId = null;
       this.msgForm = {
         liveId:null,
         // liveMsgType:null,