|
@@ -3,7 +3,7 @@
|
|
|
<h2>
|
|
|
<el-page-header @back="onCancel" :content="name"></el-page-header>
|
|
|
</h2>
|
|
|
- <div class="m-core">
|
|
|
+ <div class="m-core" v-show="activeType == 1">
|
|
|
<el-form
|
|
|
:model="form"
|
|
|
ref="form"
|
|
@@ -176,89 +176,12 @@
|
|
|
<el-radio label="ORGAN">分部</el-radio>
|
|
|
<el-radio label="SCHOOL">合作单位</el-radio>
|
|
|
<el-radio label="TEAM">乐团</el-radio>
|
|
|
- <el-radio label="CAT">群聊</el-radio>
|
|
|
+ <el-radio label="GROUP">群聊</el-radio>
|
|
|
<el-radio label="STUDENT">学生</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
|
- <el-row class="row">
|
|
|
- <el-form-item
|
|
|
- v-if="
|
|
|
- form.popularizeType == 'SCHOOL' ||
|
|
|
- form.popularizeType == 'ORGAN' ||
|
|
|
- form.popularizeType == 'TEAM'
|
|
|
- "
|
|
|
- label="分部"
|
|
|
- prop="organIds"
|
|
|
- :rules="[{ required: true, message: '请选择分部' }]"
|
|
|
- >
|
|
|
- <select-all
|
|
|
- v-model.trim="form.organIds"
|
|
|
- filterable
|
|
|
- clearable
|
|
|
- :isCollapseTags ="false"
|
|
|
- placeholder="请选择分部"
|
|
|
- @change="changeSection"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in selects.branchs"
|
|
|
- :key="index"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- ></el-option>
|
|
|
- </select-all>
|
|
|
- </el-form-item>
|
|
|
- </el-row>
|
|
|
- <el-row class="row">
|
|
|
- <el-form-item
|
|
|
- v-if="form.popularizeType == 'SCHOOL'"
|
|
|
- label="合作单位"
|
|
|
- prop="schoolIds"
|
|
|
- :rules="[{ required: true, message: '请选择合作单位' }]"
|
|
|
- >
|
|
|
- <select-all
|
|
|
- v-model.trim="form.schoolIds"
|
|
|
- :disabled="form.organIds.length <= 0"
|
|
|
- filterable
|
|
|
- clearable
|
|
|
- multiple
|
|
|
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in cooperationList"
|
|
|
- :key="index"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- ></el-option>
|
|
|
- </select-all>
|
|
|
- </el-form-item>
|
|
|
- </el-row>
|
|
|
- <el-row class="row">
|
|
|
- <el-form-item
|
|
|
- v-if="form.popularizeType == 'TEAM'"
|
|
|
- label="乐团"
|
|
|
- prop="teamIds"
|
|
|
- :rules="[{ required: true, message: '请选择乐团' }]"
|
|
|
- >
|
|
|
- <select-all
|
|
|
- v-model.trim="form.teamIds"
|
|
|
- :disabled="form.organIds.length <= 0"
|
|
|
- filterable
|
|
|
- clearable
|
|
|
- multiple
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in teamList"
|
|
|
- :key="index"
|
|
|
- :label="item.name"
|
|
|
- :value="item.id"
|
|
|
- ></el-option>
|
|
|
- </select-all>
|
|
|
- </el-form-item>
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
-
|
|
|
- </el-row>
|
|
|
<el-alert
|
|
|
title="直播间信息"
|
|
|
type="info"
|
|
@@ -341,7 +264,114 @@
|
|
|
<el-button type="primary" @click="submit">提交</el-button>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
+ <div class="m-core" v-show="activeType == 2">
|
|
|
+ <el-alert
|
|
|
+ title="观看权限详情"
|
|
|
+ type="info"
|
|
|
+ :closable="false"
|
|
|
+ style="margin-bottom: 20px"
|
|
|
+ ></el-alert>
|
|
|
+ <el-form
|
|
|
+ :model="form"
|
|
|
+ ref="form"
|
|
|
+ label-width="300px"
|
|
|
+ :inline="true"
|
|
|
+ label-position="left"
|
|
|
+ >
|
|
|
+ <el-row class="row">
|
|
|
+ <el-form-item
|
|
|
+ v-if="
|
|
|
+ form.popularizeType == 'SCHOOL' ||
|
|
|
+ form.popularizeType == 'ORGAN' ||
|
|
|
+ form.popularizeType == 'TEAM'
|
|
|
+ "
|
|
|
+ label="分部"
|
|
|
+ prop="organIds"
|
|
|
+ :rules="[{ required: true, message: '请选择分部' }]"
|
|
|
+ >
|
|
|
+ <select-all
|
|
|
+ v-model.trim="form.organIds"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ :isCollapseTags="false"
|
|
|
+ placeholder="请选择分部"
|
|
|
+ @change="changeSection"
|
|
|
+ @clearable="clearSection"
|
|
|
+ @removeTag="removetagSection"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in selects.branchs"
|
|
|
+ :key="index"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ ></el-option>
|
|
|
+ </select-all>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="row">
|
|
|
+ <el-form-item
|
|
|
+ v-if="form.popularizeType == 'SCHOOL'"
|
|
|
+ label="合作单位"
|
|
|
+ prop="schoolIds"
|
|
|
+ :rules="[{ required: true, message: '请选择合作单位' }]"
|
|
|
+ >
|
|
|
+ <select-all
|
|
|
+ v-model.trim="form.schoolIds"
|
|
|
+ :disabled="form.organIds.length <= 0"
|
|
|
+ :isCollapseTags="false"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ multiple
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in cooperationList"
|
|
|
+ :key="index"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ ></el-option>
|
|
|
+ </select-all>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="row">
|
|
|
+ <el-form-item
|
|
|
+ v-if="form.popularizeType == 'TEAM'"
|
|
|
+ label="乐团"
|
|
|
+ prop="teamIds"
|
|
|
+ :rules="[{ required: true, message: '请选择乐团' }]"
|
|
|
+ >
|
|
|
+ <select-all
|
|
|
+ v-model.trim="form.teamIds"
|
|
|
+ :disabled="form.organIds.length <= 0"
|
|
|
+ :isCollapseTags="false"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ multiple
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in teamList"
|
|
|
+ :key="index"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ ></el-option>
|
|
|
+ </select-all>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
|
|
|
+ <el-row> </el-row>
|
|
|
+ </el-form>
|
|
|
+ <el-row class="row">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ @click="
|
|
|
+ () => {
|
|
|
+ activeType--;
|
|
|
+ }
|
|
|
+ "
|
|
|
+ >上一页</el-button
|
|
|
+ >
|
|
|
+ <el-button type="primary" @click="submit">提交</el-button>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
<el-dialog
|
|
|
title="预览"
|
|
|
width="415px"
|
|
@@ -357,12 +387,16 @@
|
|
|
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";
|
|
|
-import addStudentList from './modals/addStudentList'
|
|
|
+import addStudentList from "./modals/addStudentList";
|
|
|
export default {
|
|
|
- components: { preview,addStudentList },
|
|
|
+ components: { preview, addStudentList },
|
|
|
data() {
|
|
|
return {
|
|
|
name: "新建直播课",
|
|
@@ -394,52 +428,61 @@ export default {
|
|
|
cooperationList: [],
|
|
|
teamList: [],
|
|
|
isinit: true,
|
|
|
+ activeType: 1,
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.$store.dispatch("setBranchs");
|
|
|
if (this.$route.query.id) {
|
|
|
- this.name = "修改直播间";
|
|
|
- // console.log()
|
|
|
- this.form = {
|
|
|
- ...this.$route.query,
|
|
|
- organIds: [],
|
|
|
- schoolIds: [],
|
|
|
- teamIds: [],
|
|
|
- catIds: [],
|
|
|
- studentIds: [],
|
|
|
- };
|
|
|
- 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.getDetail();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ 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 (this.$route.query.popularizeSchoolIds) {
|
|
|
- this.form.schoolIds = this.$route.query.popularizeSchoolIds
|
|
|
- .split(",")
|
|
|
- .map((item) => {
|
|
|
- return item * 1;
|
|
|
- });
|
|
|
- }
|
|
|
+ if (res.data.popularizeSchoolIds) {
|
|
|
+ this.form.schoolIds = res.data.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);
|
|
|
- }
|
|
|
+ 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(this.$route.query.speakerName);
|
|
|
+ // this.form.popularizeType = "SCHOOL";
|
|
|
+ this.changeSection(this.form.organIds);
|
|
|
+ this.remoteMethod(res.data.speakerName);
|
|
|
|
|
|
- this.checkList.push(this.form.preTemplate * 1);
|
|
|
- this.isinit = false;
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
+ 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");
|
|
@@ -532,17 +575,22 @@ export default {
|
|
|
this.$set(this.form, "preTemplate", this.checkList[0] || null);
|
|
|
},
|
|
|
async submit() {
|
|
|
- this.form.popularizeOrgIds = this.form.organIds.join(",");
|
|
|
- this.form.popularizeSchoolIds = this.form.schoolIds.join(",");
|
|
|
- this.form.popularizeTeamIds = this.form.teamIds.join(",");
|
|
|
+ // this.form.popularizeOrgIds = this.form.organIds.join(",");
|
|
|
+ // this.form.popularizeSchoolIds = this.form.schoolIds.join(",");
|
|
|
+ // this.form.popularizeTeamIds = this.form.teamIds.join(",");
|
|
|
|
|
|
if (this.$route.query.id) {
|
|
|
// 修改
|
|
|
+
|
|
|
try {
|
|
|
- const res = await resetLiveBroadcastRoomList(this.form);
|
|
|
- this.$message.success("修改成功");
|
|
|
- this.$store.dispatch("delVisitedViews", this.$route);
|
|
|
- this.$router.push("/liveClassManager");
|
|
|
+ if (this.form.popularizeType == "ALL") {
|
|
|
+ const res = await resetLiveBroadcastRoomList(this.form);
|
|
|
+ this.$message.success("修改成功");
|
|
|
+ this.$store.dispatch("delVisitedViews", this.$route);
|
|
|
+ this.$router.push("/liveClassManager");
|
|
|
+ } else {
|
|
|
+ this.activeType++;
|
|
|
+ }
|
|
|
} catch (e) {
|
|
|
console.log(e);
|
|
|
}
|
|
@@ -550,8 +598,12 @@ export default {
|
|
|
try {
|
|
|
const res = await createLiveBroadcast(this.form);
|
|
|
this.$message.success("创建成功");
|
|
|
- this.$store.dispatch("delVisitedViews", this.$route);
|
|
|
- this.$router.push("/liveClassManager");
|
|
|
+ if (this.form.popularizeType == "ALL") {
|
|
|
+ this.$store.dispatch("delVisitedViews", this.$route);
|
|
|
+ this.$router.push("/liveClassManager");
|
|
|
+ } else {
|
|
|
+ this.activeType++;
|
|
|
+ }
|
|
|
} catch (e) {
|
|
|
console.log(e);
|
|
|
}
|
|
@@ -563,35 +615,70 @@ export default {
|
|
|
this.$set(this.form, "schoolIds", []);
|
|
|
this.$set(this.form, "teamIds", []);
|
|
|
},
|
|
|
- async changeSection(val) {
|
|
|
- if (!this.isinit) {
|
|
|
- this.form.schoolIds = [];
|
|
|
- this.form.teamIds = [];
|
|
|
+ clearSection() {
|
|
|
+ this.form.schoolIds = [];
|
|
|
+ this.form.teamIds = [];
|
|
|
+ },
|
|
|
+ removetagSection(val) {
|
|
|
+ console.log("removetagSection");
|
|
|
+ if (this.form.popularizeType == "SCHOOL") {
|
|
|
+ let arr = [];
|
|
|
+ let chioseIdArr = [];
|
|
|
+ this.cooperationList.forEach((item) => {
|
|
|
+ if (item.organId == val) {
|
|
|
+ arr.push(item.id);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.form.schoolIds.forEach((item) => {
|
|
|
+ if (arr.indexOf(item) == -1) {
|
|
|
+ chioseIdArr.push(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.$set(this.form, "schoolIds", chioseIdArr);
|
|
|
+ } else if (this.form.popularizeType == "TEAM") {
|
|
|
+ let arr = [];
|
|
|
+ let chioseIdArr = [];
|
|
|
+ this.teamList.forEach((item) => {
|
|
|
+ if (item.organId == val) {
|
|
|
+ arr.push(item.id);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.form.teamIds.forEach((item) => {
|
|
|
+ if (arr.indexOf(item) == -1) {
|
|
|
+ chioseIdArr.push(item);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.$set(this.form, "teamIds", chioseIdArr);
|
|
|
}
|
|
|
- if (this.form.popularizeType == "SCHOOL" && (val && val.length > 0)) {
|
|
|
- let organId = val.join(",");
|
|
|
- try {
|
|
|
- await queryByOrganId({ organId }).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.cooperationList = res.data;
|
|
|
- }
|
|
|
- });
|
|
|
- } catch (e) {
|
|
|
- console.log(e);
|
|
|
+ },
|
|
|
+ async changeSection(val) {
|
|
|
+ this.$nextTick(async () => {
|
|
|
+ console.log("changeSection");
|
|
|
+ if (this.form.popularizeType == "SCHOOL" && val && val.length > 0) {
|
|
|
+ let organId = val.join(",");
|
|
|
+ try {
|
|
|
+ await queryByOrganId({ organId }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.cooperationList = res.data;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- if (this.form.popularizeType == "TEAM" && (val && val.length > 0)) {
|
|
|
- let organId = val.join(",");
|
|
|
- try {
|
|
|
- await getTeamList({ organId, page: 1, rows: 9999 }).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- this.teamList = res.data.rows;
|
|
|
- }
|
|
|
- });
|
|
|
- } catch (e) {
|
|
|
- console.log(e);
|
|
|
+ if (this.form.popularizeType == "TEAM" && val && val.length > 0) {
|
|
|
+ let organId = val.join(",");
|
|
|
+ try {
|
|
|
+ await getTeamList({ organId, page: 1, rows: 9999 }).then((res) => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.teamList = res.data.rows;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } catch (e) {
|
|
|
+ console.log(e);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ });
|
|
|
},
|
|
|
},
|
|
|
};
|