|
|
@@ -376,6 +376,26 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="无需注册小节" prop="noRegisterVideoIds">
|
|
|
+ <el-select
|
|
|
+ filterable
|
|
|
+ v-model="course.form.noRegisterVideoIds"
|
|
|
+ placeholder="请选择无需注册的小节"
|
|
|
+ multiple
|
|
|
+ clearable
|
|
|
+ size="small"
|
|
|
+ style="width: 100%"
|
|
|
+ :value-key="'dictValue'"
|
|
|
+ :disabled="!course.form.videoIds || course.form.videoIds.length === 0">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in filteredVideoList"
|
|
|
+ :key="dict.dictValue"
|
|
|
+ :label="dict.dictLabel"
|
|
|
+ :value="parseInt(dict.dictValue)"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <p v-if="!course.form.videoIds || course.form.videoIds.length === 0" style="color: #909399; font-size: 12px; margin: 5px 0 0;">请先选择小节</p>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="看课时间" prop="timeRange">
|
|
|
<el-time-picker
|
|
|
is-range
|
|
|
@@ -529,6 +549,7 @@
|
|
|
<el-table-column label="课程" align="center" prop="courseName" width="180" />
|
|
|
<el-table-column label="小节" align="center" prop="videoName" />
|
|
|
<el-table-column label="开课状态" align="center" prop="status" width="100" :formatter="courseStatusFormatter" />
|
|
|
+ <el-table-column label="是否开启注册链接" align="center" prop="registrationSwitch" width="180" :formatter="registrationSwitchFormatter" />
|
|
|
<el-table-column label="营期时间" align="center" prop="dayDate" width="100"/>
|
|
|
<el-table-column label="开始时间" align="center" prop="startDateTime" width="100">
|
|
|
<!-- <template slot-scope="scope">-->
|
|
|
@@ -690,7 +711,10 @@ export default {
|
|
|
loading: true,
|
|
|
total: 0,
|
|
|
addOpen: false,
|
|
|
- form: {},
|
|
|
+ form: {
|
|
|
+ videoIds: [],
|
|
|
+ noRegisterVideoIds: []
|
|
|
+ },
|
|
|
},
|
|
|
//修改营期时间参数
|
|
|
updatePeriodDate: {
|
|
|
@@ -844,6 +868,18 @@ export default {
|
|
|
batchRedPacketVisible: false,
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ filteredVideoList() {
|
|
|
+ if (!this.course.form.videoIds || this.course.form.videoIds.length === 0) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+
|
|
|
+ // 只显示已选择的 videoIds 中的选项
|
|
|
+ return this.videoList.filter(video =>
|
|
|
+ this.course.form.videoIds.includes(parseInt(video.dictValue))
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
created() {
|
|
|
|
|
|
courseList().then(response => {
|
|
|
@@ -1431,7 +1467,8 @@ export default {
|
|
|
courseId: null,
|
|
|
timeRange: ['00:00:00', '23:59:59'],
|
|
|
joinTime: '23:59:59',
|
|
|
- videoIds: []
|
|
|
+ videoIds: [],
|
|
|
+ noRegisterVideoIds: []
|
|
|
};
|
|
|
// 重置表单
|
|
|
this.$nextTick(() => {
|
|
|
@@ -1472,7 +1509,8 @@ export default {
|
|
|
courseId: null,
|
|
|
timeRange: null,
|
|
|
joinTime: null,
|
|
|
- videoIds: []
|
|
|
+ videoIds: [],
|
|
|
+ noRegisterVideoIds: []
|
|
|
};
|
|
|
// 重置表单
|
|
|
if (this.$refs.courseAddForm) {
|
|
|
@@ -1508,6 +1546,7 @@ export default {
|
|
|
},
|
|
|
courseChange(row){
|
|
|
this.course.form.videoIds = [];
|
|
|
+ this.course.form.noRegisterVideoIds = [];
|
|
|
videoList(row).then(response => {
|
|
|
this.videoList=response.list
|
|
|
});
|
|
|
@@ -1698,6 +1737,14 @@ export default {
|
|
|
};
|
|
|
return statusMap[row.periodStatus] || '未知状态';
|
|
|
},
|
|
|
+ /** 注册开关状态格式化 */
|
|
|
+ registrationSwitchFormatter(row) {
|
|
|
+ const switchMap = {
|
|
|
+ 0: '未开启',
|
|
|
+ 1: '已开启'
|
|
|
+ };
|
|
|
+ return switchMap[row.registrationSwitch] || '未知状态';
|
|
|
+ },
|
|
|
/** 开课状态格式化 */
|
|
|
courseStatusFormatter(row) {
|
|
|
const statusMap = {
|