Przeglądaj źródła

取配置的直播类型

lex 2 lat temu
rodzic
commit
3875835571

+ 161 - 162
src/views/liveClassManager/api.js

@@ -1,278 +1,277 @@
-import request from '@/utils/request2'
+import request from "@/utils/request2";
 // 新建直播间
 export const createLiveBroadcast = data => {
   return request({
-    url: '/api-web/imLiveBroadcastRoom/add',
-    method: 'post',
+    url: "/api-web/imLiveBroadcastRoom/add",
+    method: "post",
     data,
-    requestType: 'json',
-  })
-}
+    requestType: "json"
+  });
+};
 
 // 获取直播列表
 export const getLiveBroadcastList = data => {
   return request({
-    url: '/api-web/imLiveBroadcastRoom/queryPage',
-    method: 'post',
+    url: "/api-web/imLiveBroadcastRoom/queryPage",
+    method: "post",
     data,
-    requestType: 'json',
-  })
-}
+    requestType: "json"
+  });
+};
 
 // 删除直播间
 export const delLiveBroadcast = data => {
   return request({
-    url: '/api-web/imLiveBroadcastRoom/delete',
-    method: 'post',
+    url: "/api-web/imLiveBroadcastRoom/delete",
+    method: "post",
     data,
-    requestType: 'json',
-  })
-}
+    requestType: "json"
+  });
+};
 
 // 关闭直播间
 export const closeLiveBroadcast = data => {
   return request({
-    url: '/api-web/imLiveBroadcastRoom/delete',
-    method: 'post',
+    url: "/api-web/imLiveBroadcastRoom/delete",
+    method: "post",
     data,
-    requestType: 'json',
-  })
-}
+    requestType: "json"
+  });
+};
 
 //查询房间信息 getLiveBroadcastRoomList
-export const getLiveBroadcastRoomDetail= data => {
+export const getLiveBroadcastRoomDetail = data => {
   return request({
-    url: '/api-web/imLiveBroadcastRoomMember/queryRoomDetail',
-    method: 'post',
-    data,
-  })
-}
+    url: "/api-web/imLiveBroadcastRoomMember/queryRoomDetail",
+    method: "post",
+    data
+  });
+};
 
 // 直播间详情 学生列表
-export const getLiveBroadcastRoomDetailList= data => {
+export const getLiveBroadcastRoomDetailList = data => {
   return request({
-    url: '/api-web/imLiveBroadcastRoomMember/queryRoomMember',
-    method: 'post',
-    data,
-  })
-}
+    url: "/api-web/imLiveBroadcastRoomMember/queryRoomMember",
+    method: "post",
+    data
+  });
+};
 // 修改直播间
 
-export const resetLiveBroadcastRoomList= data => {
+export const resetLiveBroadcastRoomList = data => {
   return request({
-    url: '/api-web/imLiveBroadcastRoom/update',
-    method: 'post',
+    url: "/api-web/imLiveBroadcastRoom/update",
+    method: "post",
     data,
-    requestType: 'json',
-  })
-}
-
+    requestType: "json"
+  });
+};
 
 // 获取群聊信息
-export const getImList= data => {
+export const getImList = data => {
   return request({
-    url: '/api-web/imGroup/queryGroupList',
-    method: 'get',
+    url: "/api-web/imGroup/queryGroupList",
+    method: "get",
     data,
     params: data
-  })
-}
+  });
+};
 
 // 群聊分享
-export const shareGroup= data => {
+export const shareGroup = data => {
   return request({
-    url: '/api-web/imLiveBroadcastRoom/shareGroup',
-    method: 'get',
+    url: "/api-web/imLiveBroadcastRoom/shareGroup",
+    method: "get",
     data,
     params: data
-  })
-}
+  });
+};
 // 关闭直播间 imLiveBroadcastRoom/roomDestroy
-export const closeBroadcastRoomList= data => {
+export const closeBroadcastRoomList = data => {
   return request({
-    url: '/api-web/imLiveBroadcastRoom/roomDestroy/'+data,
-    method: 'get',
+    url: "/api-web/imLiveBroadcastRoom/roomDestroy/" + data,
+    method: "get",
     data,
     params: data
-  })
-}
+  });
+};
 
 // 推广直播间
-export const opsPopularize= data => {
+export const opsPopularize = data => {
   return request({
-    url: '/api-web/imLiveBroadcastRoom/opsPopularize',
-    method: 'get',
+    url: "/api-web/imLiveBroadcastRoom/opsPopularize",
+    method: "get",
     data,
     params: data
-  })
-}
-
+  });
+};
 
 // 直播间商品列表
-export const getLiveGoodsMapper= data => {
+export const getLiveGoodsMapper = data => {
   return request({
-    url: '/api-web/liveGoodsMapper/page',
-    method: 'post',
+    url: "/api-web/liveGoodsMapper/page",
+    method: "post",
     data,
-    requestType: 'form',
-  })
-}
-
+    requestType: "form"
+  });
+};
 
 // 新增直播间商品
-export const addLiveGoodsMapper= data => {
+export const addLiveGoodsMapper = data => {
   return request({
-    url: '/api-web/liveGoodsMapper/add',
-    method: 'post',
+    url: "/api-web/liveGoodsMapper/add",
+    method: "post",
     data,
-    requestType: 'form',
-  })
-}
-
+    requestType: "form"
+  });
+};
 
 // 直播间详情 imLiveBroadcastRoom/queryRoomInfo
-export const getRoomInfo= data => {
+export const getRoomInfo = data => {
   return request({
-    url: '/api-web/imLiveBroadcastRoom/queryRoomInfo',
-    method: 'get',
+    url: "/api-web/imLiveBroadcastRoom/queryRoomInfo",
+    method: "get",
     data,
     params: data
-  })
-}
-
+  });
+};
 
 // 直播间商品 上下架
-export const updateLiveGoodsMapperStatus= data => {
+export const updateLiveGoodsMapperStatus = data => {
   return request({
-    url: '/api-web/liveGoodsMapper/updateStatus',
-    method: 'post',
+    url: "/api-web/liveGoodsMapper/updateStatus",
+    method: "post",
     data,
-    requestType: 'form',
-  })
-}
-
+    requestType: "form"
+  });
+};
 
 // 获取直播间预约人数
-export const getRoomUser= data => {
+export const getRoomUser = data => {
   return request({
-    url: '/api-web/imLiveBroadcastRoom/query/roomUser',
-    method: 'post',
-    data,
-  })
-}
+    url: "/api-web/imLiveBroadcastRoom/query/roomUser",
+    method: "post",
+    data
+  });
+};
 
 // 获取直播间黑名单
-export const getBlackList= data => {
+export const getBlackList = data => {
   return request({
-    url: '/api-web/imLiveRoomBlack/queryBlackList',
-    method: 'post',
-    data,
-  })
-}
+    url: "/api-web/imLiveRoomBlack/queryBlackList",
+    method: "post",
+    data
+  });
+};
 
 // 获取待加入黑名单的学生名单
-export const getWaitBlackList= data => {
+export const getWaitBlackList = data => {
   return request({
-    url: '/api-web/imLiveRoomBlack/queryStudentList',
-    method: 'post',
-    data,
-  })
-}
-
+    url: "/api-web/imLiveRoomBlack/queryStudentList",
+    method: "post",
+    data
+  });
+};
 
 // 添加黑名单
-export const addBlackList= data => {
+export const addBlackList = data => {
   return request({
-    url: '/api-web/imLiveRoomBlack/add',
-    method: 'post',
-    data,
-  })
-}
-
+    url: "/api-web/imLiveRoomBlack/add",
+    method: "post",
+    data
+  });
+};
 
 // 删除黑名单
-export const deteleBlackList= data => {
+export const deteleBlackList = data => {
   return request({
-    url: '/api-web/imLiveRoomBlack/delete',
-    method: 'post',
-    data,
-  })
-}
+    url: "/api-web/imLiveRoomBlack/delete",
+    method: "post",
+    data
+  });
+};
 
 // 商品销售详情
-export const getGoodsOrderList= data => {
+export const getGoodsOrderList = data => {
   return request({
-    url: '/api-web/imLiveBroadcastRoom/queryLiveRoomGoodsOrderList',
-    method: 'get',
+    url: "/api-web/imLiveBroadcastRoom/queryLiveRoomGoodsOrderList",
+    method: "get",
     data,
     params: data
-  })
-}
+  });
+};
 
 // 获取直播间学员
-export const getLiveStudentList= data => {
+export const getLiveStudentList = data => {
   return request({
-    url: '/api-web/imLiveRoomPurview/queryStudent',
-    method: 'post',
-    data,
-  })
-}
+    url: "/api-web/imLiveRoomPurview/queryStudent",
+    method: "post",
+    data
+  });
+};
 
 // 获取群聊
-export const getGroupList= data => {
+export const getGroupList = data => {
   return request({
-    url: '/api-web/imLiveRoomPurview/selectRoomPurviewGroup',
-    method: 'post',
-    data,
-  })
-}
+    url: "/api-web/imLiveRoomPurview/selectRoomPurviewGroup",
+    method: "post",
+    data
+  });
+};
 
 // 获取待添加直播间的学生
-export const getWaitLiveStudentList= data => {
+export const getWaitLiveStudentList = data => {
   return request({
-    url: '/api-web/imLiveRoomPurview/selectRoomPurviewStudent',
-    method: 'post',
-    data,
-  })
-}
+    url: "/api-web/imLiveRoomPurview/selectRoomPurviewStudent",
+    method: "post",
+    data
+  });
+};
 
 // 添加学生到直播间
-export const addLiveStudentList= data => {
+export const addLiveStudentList = data => {
   return request({
-    url: '/api-web/imLiveRoomPurview/add',
-    method: 'get',
+    url: "/api-web/imLiveRoomPurview/add",
+    method: "get",
     data,
     params: data
-  })
-}
-
+  });
+};
 
 // 移除直播间
-export const deteleLiveStudentList= data => {
+export const deteleLiveStudentList = data => {
   return request({
-    url: '/api-web/imLiveRoomPurview/delete',
-    method: 'get',
+    url: "/api-web/imLiveRoomPurview/delete",
+    method: "get",
     data,
     params: data
-  })
-}
+  });
+};
 
 // 一键添加   imLiveRoomPurview/addByCondition
-export const addByCondition= data => {
+export const addByCondition = data => {
   return request({
-    url: '/api-web/imLiveRoomPurview/addByCondition',
-    method: 'post',
+    url: "/api-web/imLiveRoomPurview/addByCondition",
+    method: "post",
     data,
     params: data
-  })
-}
+  });
+};
 //  手动开启直播
 
 export const roomStart = data => {
   return request({
     url: `/api-web/imLiveBroadcastRoom/roomStart/${data}`,
-    method: 'get',
+    method: "get",
     data,
     params: data
-  })
-}
+  });
+};
+
+export const sysTenantConfigAll = data => {
+  return request({
+    url: "/api-web/sysTenantConfig/queryAll",
+    params: data,
+    method: "get"
+  });
+};

+ 73 - 44
src/views/liveClassManager/newLiveClass.vue

@@ -31,7 +31,7 @@
               v-model.trim="form.roomTitle"
             ></el-input>
           </el-form-item>
-          <el-form-item
+          <!-- <el-form-item
             label="直播方案"
             class="nomb"
             prop="serviceProvider"
@@ -43,7 +43,6 @@
               clearable
               @change="
                 (value) => {
-                  // console.log(value, 'value');
                   if (value === 'rongCloud') {
                     form.os = 'pc';
                   } else if (value === 'tencentCloud') {
@@ -55,7 +54,7 @@
               <el-option label="融云" value="rongCloud"></el-option>
               <el-option label="腾讯云" value="tencentCloud"></el-option>
             </el-select>
-          </el-form-item>
+          </el-form-item> -->
           <el-form-item
             label="直播开始时间"
             class="nomb"
@@ -86,7 +85,7 @@
               v-model="form.clientType"
               clearable
               @change="
-                (value) => {
+                value => {
                   form.speakerId = '';
                 }
               "
@@ -256,10 +255,10 @@
             <el-radio-group v-model="form.os">
               <!-- value="rongCloud"></el-option>
               <el-option label="腾讯云" value="tencentCloud" -->
-              <el-radio v-if="form.serviceProvider === 'rongCloud'" label="pc"
+              <el-radio v-if="serviceProvider === 'rongCloud'" label="pc"
                 >web</el-radio
               >
-              <el-radio v-if="form.serviceProvider === 'tencentCloud'" label="client"
+              <el-radio v-if="serviceProvider === 'tencentCloud'" label="client"
                 >客户端</el-radio
               >
               <el-radio label="mobile">手机</el-radio>
@@ -290,8 +289,8 @@
           <el-form-item
             v-if="
               form.popularizeType == 'SCHOOL' ||
-              form.popularizeType == 'ORGAN' ||
-              form.popularizeType == 'TEAM'
+                form.popularizeType == 'ORGAN' ||
+                form.popularizeType == 'TEAM'
             "
             label="分部"
             prop="organIds"
@@ -458,7 +457,12 @@
 import preview from "./modals/preview.vue";
 import axios from "axios";
 import { getToken, getTenantId } from "@/utils/auth";
-import { createLiveBroadcast, resetLiveBroadcastRoomList, getRoomInfo } from "./api";
+import {
+  createLiveBroadcast,
+  resetLiveBroadcastRoomList,
+  getRoomInfo,
+  sysTenantConfigAll
+} from "./api";
 import { queryByOrganId } from "@/api/systemManage";
 import { getTeamList } from "@/api/teamServer";
 export default {
@@ -484,11 +488,11 @@ export default {
           whether_chat: 0,
           whether_video: 0,
           whether_mic: 0,
-          whether_view_shop_cart: 0,
+          whether_view_shop_cart: 0
         },
-        checkList: [],
-        serviceProvider: "tencentCloud",
+        checkList: []
       },
+      serviceProvider: "tencentCloud",
       remoteLoading: false,
       teacherList: [],
       checkList: [],
@@ -499,16 +503,35 @@ export default {
         firstDayOfWeek: 1,
         disabledDate(time) {
           return time.getTime() + 86400000 <= new Date().getTime();
-        },
+        }
       },
-      educationList: [],
+      educationList: []
     };
   },
-  mounted() {
+  async mounted() {
     this.$store.dispatch("setBranchs");
+
+    try {
+      const findName = await sysTenantConfigAll({
+        group: "LIVE_CLIENT"
+      });
+      if (findName.data && findName.data.length > 0) {
+        findName.data.forEach(item => {
+          if (item.paramName == "live_client") {
+            this.serviceProvider = item.paranValue;
+
+            this.form.os =
+              this.serviceProvider == "tencentCloud" ? "client" : "pc";
+          }
+        });
+      }
+    } catch {
+      //
+    }
+
     if (this.$route.query.id) {
       // this.name = "修改直播间";
-      this.getDetail();
+      await this.getDetail();
       // console.log()
       // this.form = {
       //   ...this.$route.query,
@@ -562,19 +585,23 @@ export default {
           schoolIds: [],
           teamIds: [],
           catIds: [],
-          studentIds: [],
+          studentIds: []
         };
         this.form.roomConfig = JSON.parse(res.data.roomConfig);
         if (res.data.popularizeOrgIds) {
-          this.form.organIds = res.data.popularizeOrgIds.split(",").map((item) => {
-            return item * 1;
-          });
+          this.form.organIds = res.data.popularizeOrgIds
+            .split(",")
+            .map(item => {
+              return item * 1;
+            });
         }
 
         if (res.data.popularizeSchoolIds) {
-          this.form.schoolIds = res.data.popularizeSchoolIds.split(",").map((item) => {
-            return item * 1;
-          });
+          this.form.schoolIds = res.data.popularizeSchoolIds
+            .split(",")
+            .map(item => {
+              return item * 1;
+            });
         }
 
         if (res.data.popularizeTeamIds) {
@@ -601,14 +628,14 @@ export default {
       this.$router.push("/liveClassManager");
     },
     changeTeacher(val) {
-      this.teacherList.forEach((item) => {
+      this.teacherList.forEach(item => {
         if (val == item.id) {
           this.form.speakerName = item.realName;
         }
       });
     },
     preLook() {
-      this.$refs.form.validate((flag) => {
+      this.$refs.form.validate(flag => {
         if (flag) {
           this.preLookVisible = true;
           console.log("预览", this.form);
@@ -635,25 +662,25 @@ export default {
           method: "get",
           headers: {
             Authorization: getToken(),
-            tenantId: getTenantId(),
+            tenantId: getTenantId()
           },
           params: {
             rows: 9999,
             search: query,
             lockFlag: 0,
-            demissionFlag: false,
+            demissionFlag: false
           },
-          url,
+          url
         };
         this.remoteLoading = true;
         // this.studentList = []
-        axios(options).then((res) => {
+        axios(options).then(res => {
           this.remoteLoading = false;
           let result = res.data;
           if (result.code == 200) {
             // Array.prototype.splice.apply(this.studentList, result.data.rows);
             if (result.data && result.data.rows.length > 0) {
-              result.data.rows.forEach((item) => {
+              result.data.rows.forEach(item => {
                 this.teacherList.unshift(item);
               });
               this.teacherList = this.deweight(this.teacherList, "phone");
@@ -680,25 +707,25 @@ export default {
           method: "get",
           headers: {
             Authorization: getToken(),
-            tenantId: getTenantId(),
+            tenantId: getTenantId()
           },
           params: {
             rows: 9999,
             search: query,
             lockFlag: 0,
-            demissionFlag: false,
+            demissionFlag: false
           },
-          url,
+          url
         };
         this.remoteLoading = true;
 
-        axios(options).then((res) => {
+        axios(options).then(res => {
           this.remoteLoading = false;
           let result = res.data;
           if (result.code == 200) {
             // Array.prototype.splice.apply(this.studentList, result.data.rows);
             if (result.data && result.data.rows.length > 0) {
-              result.data.rows.forEach((item) => {
+              result.data.rows.forEach(item => {
                 this.educationList.unshift(item);
               });
               this.educationList = this.deweight(this.educationList, "phone");
@@ -710,9 +737,9 @@ export default {
     },
     deweight(arr, key) {
       let res = [];
-      arr.forEach((item) => {
+      arr.forEach(item => {
         let list = [];
-        res.forEach((resitem) => {
+        res.forEach(resitem => {
           list.push(resitem[key]);
         });
         if (list.indexOf(item[key]) === -1) {
@@ -731,7 +758,7 @@ export default {
       this.form.popularizeOrgIds = this.form.organIds.join(",");
       this.form.popularizeSchoolIds = this.form.schoolIds.join(",");
       this.form.popularizeTeamIds = this.form.teamIds.join(",");
-      this.$refs.form.validate(async (flag) => {
+      this.$refs.form.validate(async flag => {
         if (!flag) return;
         if (this.$route.query.id) {
           // 修改
@@ -770,7 +797,7 @@ export default {
       if (this.form.popularizeType == "SCHOOL" && val && val.length > 0) {
         let organId = val.join(",");
         try {
-          await queryByOrganId({ organId }).then((res) => {
+          await queryByOrganId({ organId }).then(res => {
             if (res.code == 200) {
               this.cooperationList = res.data;
             }
@@ -782,7 +809,7 @@ export default {
       if (this.form.popularizeType == "TEAM" && val && val.length > 0) {
         let organId = val.join(",");
         try {
-          await getTeamList({ organId, page: 1, rows: 9999 }).then((res) => {
+          await getTeamList({ organId, page: 1, rows: 9999 }).then(res => {
             if (res.code == 200) {
               this.teamList = res.data.rows;
             }
@@ -791,8 +818,8 @@ export default {
           console.log(e);
         }
       }
-    },
-  },
+    }
+  }
 };
 </script>
 <style lang="scss" scoped>
@@ -879,13 +906,15 @@ export default {
       .dotWrap {
         width: 21px;
         height: 21px;
-        background: url("../../assets/images/icon_checkbox_default.png") no-repeat center;
+        background: url("../../assets/images/icon_checkbox_default.png")
+          no-repeat center;
         background-size: contain;
         margin-right: 8px;
         position: relative;
         overflow: hidden;
         &.checked {
-          background: url("../../assets/images/icon_checkbox.png") no-repeat center;
+          background: url("../../assets/images/icon_checkbox.png") no-repeat
+            center;
           background-size: contain;
         }
       }