|
@@ -158,6 +158,75 @@
|
|
|
</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="popularizeType"
|
|
|
+ label-width="120px"
|
|
|
+ :rules="[{ required: true, message: '请选择推广类型' }]"
|
|
|
+ >
|
|
|
+ <el-radio-group v-model="form.popularizeType" @change="changeType">
|
|
|
+ <el-radio label="ALL">全员</el-radio>
|
|
|
+ <el-radio label="ORGAN">分部</el-radio>
|
|
|
+ <el-radio label="SCHOOL">合作单位</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'
|
|
|
+ "
|
|
|
+ label="分部"
|
|
|
+ prop="organIds"
|
|
|
+ :rules="[{ required: true, message: '请选择分部' }]"
|
|
|
+ >
|
|
|
+ <select-all
|
|
|
+ v-model.trim="form.organIds"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ 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-alert
|
|
|
title="直播间信息"
|
|
|
type="info"
|
|
|
:closable="false"
|
|
@@ -219,7 +288,7 @@
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
|
- <el-row class="row">
|
|
|
+ <!-- <el-row class="row">
|
|
|
<el-form-item
|
|
|
prop="roomConfig.whether_view_shop_cart"
|
|
|
label-width="120px"
|
|
@@ -232,7 +301,7 @@
|
|
|
<el-radio :label="1">否</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
- </el-row>
|
|
|
+ </el-row> -->
|
|
|
</el-form>
|
|
|
<el-row class="row">
|
|
|
<el-button type="primary" @click="preLook">预览</el-button>
|
|
@@ -256,6 +325,7 @@ import preview from "./modals/preview.vue";
|
|
|
import axios from "axios";
|
|
|
import { getToken, getTenantId } from "@/utils/auth";
|
|
|
import { createLiveBroadcast, resetLiveBroadcastRoomList } from "./api";
|
|
|
+import { queryByOrganId } from "@/api/systemManage";
|
|
|
export default {
|
|
|
components: { preview },
|
|
|
data() {
|
|
@@ -263,11 +333,14 @@ export default {
|
|
|
name: "新建直播课",
|
|
|
preLookVisible: false,
|
|
|
form: {
|
|
|
+ organIds: [],
|
|
|
+ schoolIds: [],
|
|
|
roomTitle: "",
|
|
|
speakerId: "",
|
|
|
liveStartTime: "",
|
|
|
liveRemark: "",
|
|
|
preTemplate: null,
|
|
|
+ popularizeType: "ALL",
|
|
|
roomConfig: {
|
|
|
whether_like: 0,
|
|
|
whether_chat: 0,
|
|
@@ -280,14 +353,26 @@ export default {
|
|
|
remoteLoading: false,
|
|
|
teacherList: [],
|
|
|
checkList: [],
|
|
|
+ cooperationList: [],
|
|
|
+ isinit:true
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
+ this.$store.dispatch("setBranchs");
|
|
|
if (this.$route.query.id) {
|
|
|
this.name = "修改直播间";
|
|
|
// console.log()
|
|
|
- this.form = { ...this.$route.query };
|
|
|
+ this.form = { ...this.$route.query, organIds: [],
|
|
|
+ schoolIds: [], };
|
|
|
this.form.roomConfig = JSON.parse(this.$route.query.roomConfig);
|
|
|
+
|
|
|
+ this.form.organIds =
|
|
|
+ this.$route.query.popularizeOrgIds.split(",").map(item=>{return item*1});
|
|
|
+
|
|
|
+ this.form.schoolIds=this.$route.query.popularizeSchoolIds.split(",").map(item=>{return item*1});
|
|
|
+
|
|
|
+ // this.form.popularizeType = "SCHOOL";
|
|
|
+ this.changeSection(this.form.organIds)
|
|
|
this.remoteMethod(this.$route.query.speakerName);
|
|
|
this.checkList.push(this.form.preTemplate * 1);
|
|
|
}
|
|
@@ -305,7 +390,6 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
preLook() {
|
|
|
- console.log(this.form);
|
|
|
this.$refs.form.validate((flag) => {
|
|
|
if (flag) {
|
|
|
this.preLookVisible = true;
|
|
@@ -314,14 +398,13 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
setPreTemplate(index) {
|
|
|
- console.log("调用", index);
|
|
|
this.$set(this.form, "preTemplate", index);
|
|
|
if (this.checkList.indexOf(index) == -1) {
|
|
|
this.checkList.push(index);
|
|
|
} else {
|
|
|
this.checkList.splice(this.checkList.indexOf(index), 1);
|
|
|
}
|
|
|
- console.log("调用结束", index);
|
|
|
+ // console.log("调用结束", index);
|
|
|
this.bindCheckBox();
|
|
|
},
|
|
|
remoteMethod(query) {
|
|
@@ -387,6 +470,8 @@ 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(",");
|
|
|
if (this.$route.query.id) {
|
|
|
// 修改
|
|
|
try {
|
|
@@ -409,6 +494,31 @@ export default {
|
|
|
}
|
|
|
// createLiveBroadcast
|
|
|
},
|
|
|
+ changeType() {
|
|
|
+ this.$set(this.form, "organIds", []);
|
|
|
+ this.$set(this.form, "schoolIds", []);
|
|
|
+ },
|
|
|
+ async changeSection(val) {
|
|
|
+
|
|
|
+ if(!this.isinit){
|
|
|
+ this.form.schoolIds = [];
|
|
|
+ }
|
|
|
+ console.log('进来了', this.form,(this.form.popularizeType == "SCHOOL" ) )
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.isinit = false
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|