diff --git a/src/views/calendar/components/addCalendar.vue b/src/views/calendar/components/addCalendar.vue index 08909d0..9987434 100644 --- a/src/views/calendar/components/addCalendar.vue +++ b/src/views/calendar/components/addCalendar.vue @@ -15,7 +15,7 @@
*是否发布: + >是否对外展示:
具体说明:
- + @change="onModuleChange" + @create="onCreateModule" + > + + +
@@ -331,6 +344,18 @@ export default { course_content_options: [], course_options: [], canSelect: false, + module_options: [ + { id: 1, value: '第一模块' }, + { id: 2, value: '第二模块' }, + { id: 3, value: '第三模块' }, + { id: 4, value: '第四模块' }, + { id: 5, value: '第五模块' }, + { id: 6, value: '第六模块' }, + { id: 7, value: '第七模块' }, + { id: 8, value: '第八模块' }, + { id: 9, value: '第九模块' }, + { id: 10, value: '第十模块' } + ], form: { is_publish:1, type: "", @@ -483,6 +508,40 @@ export default { }); } }, + onModuleChange(value) { + // 当选择模块时,自动拼接到标题后面 + if (value && this.form.title) { + // 先去除标题中可能存在的模块值 + let cleanTitle = this.form.title; + this.module_options.forEach(module => { + if (cleanTitle.includes(' | ' + module.value)) { + cleanTitle = cleanTitle.replace(' | ' + module.value, ''); + } + }); + // 拼接新的模块值 + this.form.title = cleanTitle + ' | ' + value; + } + }, + onCreateModule(value) { + // 当创建新模块时,添加到选项列表并选中 + const newModule = { + id: this.module_options.length + 1, + value: value + }; + this.module_options.push(newModule); + this.form.introduce = value; + // 先去除标题中可能存在的模块值,再拼接新的模块值 + if (this.form.title) { + let cleanTitle = this.form.title; + this.module_options.forEach(module => { + if (cleanTitle.includes(' | ' + module.value)) { + cleanTitle = cleanTitle.replace(' | ' + module.value, ''); + } + }); + // 拼接新的模块值 + this.form.title = cleanTitle + ' | ' + value; + } + }, submit() { if (this.id) { this.form.id = this.id; diff --git a/src/views/config/classFiles.vue b/src/views/config/classFiles.vue index 2af20e7..cec6975 100644 --- a/src/views/config/classFiles.vue +++ b/src/views/config/classFiles.vue @@ -6,11 +6,17 @@
-
- - - - +
+ + + + +
+
+ + + +
查询 @@ -28,10 +34,10 @@
- + @@ -60,36 +71,40 @@
- -