ソースを参照

直播间端口号

1
mo 2 年 前
コミット
b95c4ee47a
2 ファイル変更117 行追加40 行削除
  1. 16 6
      src/views/liveClassManager/index.vue
  2. 101 34
      src/views/liveClassManager/newLiveClass.vue

+ 16 - 6
src/views/liveClassManager/index.vue

@@ -102,10 +102,17 @@
               </div>
             </template>
           </el-table-column>
-              <el-table-column align="center" prop="popularize" label="观看权限">
+          <el-table-column align="center" prop="popularize" label="直播设备">
             <template slot-scope="scope">
               <div>
-                {{ scope.row.popularizeType=='ALL'? "全员" : "部分" }}
+                {{ scope.row.os == "pc" ? "电脑" : "手机" }}
+              </div>
+            </template>
+          </el-table-column>
+          <el-table-column align="center" prop="popularize" label="观看权限">
+            <template slot-scope="scope">
+              <div>
+                {{ scope.row.popularizeType == "ALL" ? "全员" : "部分" }}
               </div>
             </template>
           </el-table-column>
@@ -152,7 +159,10 @@
                   </span>
                   <el-dropdown-menu slot="dropdown">
                     <el-dropdown-item
-                      v-if="permission('/liveStudentList')&&scope.row.popularizeType!=='ALL'"
+                      v-if="
+                        permission('/liveStudentList') &&
+                        scope.row.popularizeType !== 'ALL'
+                      "
                     >
                       <el-button
                         type="text"
@@ -440,9 +450,9 @@ export default {
     resetLive(row) {
       let params = {
         path: "/business/createLiveClass",
-        query: { ...row },
+       query: { id:row.id,roomUid:row.roomUid}
       };
-      //   query: { id:row.id,roomUid:row.roomUid},
+      //  ,
       this.$router.push(params, (route) => {
         route.meta.title = "修改直播课";
       });
@@ -527,7 +537,7 @@ export default {
     lookStudentDetail(row) {
       this.$router.push({
         path: "/business/liveStudentList",
-        query: { roomUid: row.roomUid,name:row.roomTitle },
+        query: { roomUid: row.roomUid, name: row.roomTitle },
       });
     },
   },

+ 101 - 34
src/views/liveClassManager/newLiveClass.vue

@@ -158,6 +158,26 @@
           </el-form-item>
         </el-row>
         <el-alert
+          title="直播设备配置"
+          type="info"
+          :closable="false"
+          style="margin-bottom: 20px"
+        ></el-alert>
+        <el-row class="row">
+          <el-form-item
+            class="mline"
+            label="直播设备"
+            prop="os"
+            label-width="120px"
+            :rules="[{ required: true, message: '请选择推广类型' }]"
+          >
+            <el-radio-group v-model="form.os" >
+              <el-radio label="pc">电脑</el-radio>
+              <el-radio label="mobile">手机</el-radio>
+            </el-radio-group>
+          </el-form-item>
+        </el-row>
+        <el-alert
           title="观看权限配置"
           type="info"
           :closable="false"
@@ -349,7 +369,7 @@
 import preview from "./modals/preview.vue";
 import axios from "axios";
 import { getToken, getTenantId } from "@/utils/auth";
-import { createLiveBroadcast, resetLiveBroadcastRoomList } from "./api";
+import { createLiveBroadcast, resetLiveBroadcastRoomList ,getRoomInfo} from "./api";
 import { queryByOrganId } from "@/api/systemManage";
 import { getTeamList } from "@/api/teamServer";
 export default {
@@ -368,6 +388,7 @@ export default {
         liveRemark: "",
         preTemplate: null,
         popularizeType: "ALL",
+        os:'pc',
         roomConfig: {
           whether_like: 0,
           whether_chat: 0,
@@ -388,47 +409,93 @@ export default {
   mounted() {
     this.$store.dispatch("setBranchs");
     if (this.$route.query.id) {
-      this.name = "修改直播间";
+      // this.name = "修改直播间";
+      this.getDetail()
       // console.log()
-      this.form = {
-        ...this.$route.query,
-        organIds: [],
-        schoolIds: [],
-        teamIds: [],
-      };
-      this.form.roomConfig = JSON.parse(this.$route.query.roomConfig);
+      // this.form = {
+      //   ...this.$route.query,
+      //   organIds: [],
+      //   schoolIds: [],
+      //   teamIds: [],
+      // };
+      // this.form.roomConfig = JSON.parse(this.$route.query.roomConfig);
 
-      if (this.$route.query.popularizeOrgIds) {
-        this.form.organIds = this.$route.query.popularizeOrgIds
-          .split(",")
-          .map((item) => {
-            return item * 1;
-          });
-      }
-      this.changeSection(this.form.organIds);
-      if (this.$route.query.popularizeSchoolIds) {
-        this.form.schoolIds = this.$route.query.popularizeSchoolIds
-          .split(",")
-          .map((item) => {
-            return item * 1;
-          });
-      }
+      // if (this.$route.query.popularizeOrgIds) {
+      //   this.form.organIds = this.$route.query.popularizeOrgIds
+      //     .split(",")
+      //     .map((item) => {
+      //       return item * 1;
+      //     });
+      // }
+      // this.changeSection(this.form.organIds);
+      // if (this.$route.query.popularizeSchoolIds) {
+      //   this.form.schoolIds = this.$route.query.popularizeSchoolIds
+      //     .split(",")
+      //     .map((item) => {
+      //       return item * 1;
+      //     });
+      // }
 
-      if (this.$route.query.popularizeTeamIds) {
-        let arr = this.$route.query.popularizeTeamIds.split(",");
-        this.$set(this.form, "teamIds", arr);
-        console.log(this.form.teamIds);
-      }
+      // if (this.$route.query.popularizeTeamIds) {
+      //   let arr = this.$route.query.popularizeTeamIds.split(",");
+      //   this.$set(this.form, "teamIds", arr);
+      //   console.log(this.form.teamIds);
+      // }
 
-      // this.form.popularizeType = "SCHOOL";
+      // // this.form.popularizeType = "SCHOOL";
 
-      this.remoteMethod(this.$route.query.speakerName);
+      // this.remoteMethod(this.$route.query.speakerName);
 
-      this.checkList.push(this.form.preTemplate * 1);
-      this.isinit = false;
+      // this.checkList.push(this.form.preTemplate * 1);
+      // this.isinit = false;
     }
   },
   methods: {
+        async getDetail() {
+      try {
+        const res = await getRoomInfo({ roomUid: this.$route.query.roomUid });
+        this.name = "修改直播间";
+        // console.log()
+        this.form = {
+          ...res.data,
+          organIds: [],
+          schoolIds: [],
+          teamIds: [],
+          catIds: [],
+          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;
+            });
+        }
+
+        if (res.data.popularizeSchoolIds) {
+          this.form.schoolIds = res.data.popularizeSchoolIds
+            .split(",")
+            .map((item) => {
+              return item * 1;
+            });
+        }
+
+        if (res.data.popularizeTeamIds) {
+          let arr = res.data.popularizeTeamIds.split(",");
+          this.$set(this.form, "teamIds", arr);
+        }
+
+        // this.form.popularizeType = "SCHOOL";
+        this.changeSection(this.form.organIds);
+        this.remoteMethod(res.data.speakerName);
+
+        this.checkList.push(this.form.preTemplate * 1);
+        this.isinit = false;
+      } catch (e) {
+        console.log(e);
+      }
+    },
     onCancel() {
       this.$store.dispatch("delVisitedViews", this.$route);
       this.$router.push("/liveClassManager");
@@ -524,7 +591,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) {
           // 修改