|
@@ -324,7 +324,7 @@
|
|
<el-dialog title="添加课程" :visible.sync="course.addOpen" width="500px" append-to-body>
|
|
<el-dialog title="添加课程" :visible.sync="course.addOpen" width="500px" append-to-body>
|
|
<el-form ref="courseAddForm" :model="course.form" label-width="100px">
|
|
<el-form ref="courseAddForm" :model="course.form" label-width="100px">
|
|
<el-form-item label="课程" prop="courseId">
|
|
<el-form-item label="课程" prop="courseId">
|
|
- <el-select filterable v-model="course.form.courseId" placeholder="请选择课程" clearable size="small" @change="courseChange(course.form.courseId)" style="width: 100%">
|
|
|
|
|
|
+ <el-select filterable v-model="course.form.courseId" placeholder="请选择课程" clearable size="small" @change="courseChange(course.form.courseId)" style="width: 100%" :value-key="'dictValue'">
|
|
<el-option
|
|
<el-option
|
|
v-for="dict in courseList"
|
|
v-for="dict in courseList"
|
|
:key="dict.dictValue"
|
|
:key="dict.dictValue"
|
|
@@ -334,7 +334,7 @@
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="小节" prop="videoId">
|
|
<el-form-item label="小节" prop="videoId">
|
|
- <el-select filterable v-model="course.form.videoIds" placeholder="请选择小节" :multiple-limit="getDiff(course.row.periodStartingTime, course.row.periodEndTime) - course.total" multiple clearable size="small" style="width: 100%">
|
|
|
|
|
|
+ <el-select filterable v-model="course.form.videoIds" placeholder="请选择小节" :multiple-limit="getDiff(course.row.periodStartingTime, course.row.periodEndTime) - course.total" multiple clearable size="small" style="width: 100%" :value-key="'dictValue'">
|
|
<el-option
|
|
<el-option
|
|
v-for="dict in videoList"
|
|
v-for="dict in videoList"
|
|
:key="dict.dictValue"
|
|
:key="dict.dictValue"
|
|
@@ -979,17 +979,32 @@ export default {
|
|
this.course.loading = false;
|
|
this.course.loading = false;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- handleAddCourse(){
|
|
|
|
|
|
+ handleAddCourse() {
|
|
this.course.addOpen = true;
|
|
this.course.addOpen = true;
|
|
this.course.form = {
|
|
this.course.form = {
|
|
periodId: this.course.row.periodId,
|
|
periodId: this.course.row.periodId,
|
|
|
|
+ courseId: null,
|
|
|
|
+ videoIds: []
|
|
};
|
|
};
|
|
|
|
+ // 重置表单
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
+ if (this.$refs.courseAddForm) {
|
|
|
|
+ this.$refs.courseAddForm.resetFields();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
},
|
|
},
|
|
- closeAddCourse(){
|
|
|
|
|
|
+ closeAddCourse() {
|
|
this.course.addOpen = false;
|
|
this.course.addOpen = false;
|
|
|
|
+ this.course.form = {
|
|
|
|
+ periodId: null,
|
|
|
|
+ courseId: null,
|
|
|
|
+ videoIds: []
|
|
|
|
+ };
|
|
|
|
+ // 重置表单
|
|
|
|
+ if (this.$refs.courseAddForm) {
|
|
|
|
+ this.$refs.courseAddForm.resetFields();
|
|
|
|
+ }
|
|
},
|
|
},
|
|
-
|
|
|
|
- //查询小节
|
|
|
|
courseChange(row){
|
|
courseChange(row){
|
|
this.course.form.videoIds = [];
|
|
this.course.form.videoIds = [];
|
|
videoList(row).then(response => {
|
|
videoList(row).then(response => {
|