|
@@ -4,7 +4,7 @@ import ModuleBase from './ModuleBase.vue';
|
|
|
import RichText from '@/components/RichText.vue';
|
|
import RichText from '@/components/RichText.vue';
|
|
|
import MultilingualFill from '@/views/book/components/MultilingualFill.vue';
|
|
import MultilingualFill from '@/views/book/components/MultilingualFill.vue';
|
|
|
|
|
|
|
|
-import { displayList, viewMethodList, isEnable } from '@/views/book/courseware/data/common';
|
|
|
|
|
|
|
+import { displayList, viewMethodList, isEnable, analysisData, answerData } from '@/views/book/courseware/data/common';
|
|
|
import {
|
|
import {
|
|
|
ContentSaveCoursewareComponentContent,
|
|
ContentSaveCoursewareComponentContent,
|
|
|
ContentGetCoursewareComponentContent,
|
|
ContentGetCoursewareComponentContent,
|
|
@@ -23,6 +23,22 @@ const mixin = {
|
|
|
},
|
|
},
|
|
|
borderColorObj: Vue.observable({ value: this.borderColor }), // 边框颜色
|
|
borderColorObj: Vue.observable({ value: this.borderColor }), // 边框颜色
|
|
|
multilingualVisible: false, // 多语言弹窗
|
|
multilingualVisible: false, // 多语言弹窗
|
|
|
|
|
+ idNameOrder: [
|
|
|
|
|
+ 'answer_audio_id_list',
|
|
|
|
|
+ 'answer_image_id_list',
|
|
|
|
|
+ 'answer_video_id_list',
|
|
|
|
|
+ 'analysis_audio_id_list',
|
|
|
|
|
+ 'analysis_image_id_list',
|
|
|
|
|
+ 'analysis_video_id_list',
|
|
|
|
|
+ ],
|
|
|
|
|
+ fileNameOrder: [
|
|
|
|
|
+ 'answer_audio_list',
|
|
|
|
|
+ 'answer_image_list',
|
|
|
|
|
+ 'answer_video_list',
|
|
|
|
|
+ 'analysis_audio_list',
|
|
|
|
|
+ 'analysis_image_list',
|
|
|
|
|
+ 'analysis_video_list',
|
|
|
|
|
+ ],
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
props: {
|
|
props: {
|
|
@@ -340,6 +356,47 @@ const mixin = {
|
|
|
if (activeTextStyle) listItem.activeTextStyle = activeTextStyle;
|
|
if (activeTextStyle) listItem.activeTextStyle = activeTextStyle;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 组件中添加答案与解析
|
|
|
|
|
+ * @param {'answer'|'analysis'} type 类型 answer 答案 analysis 解析
|
|
|
|
|
+ */
|
|
|
|
|
+ addAnswerAndAnalysis(type) {
|
|
|
|
|
+ if (type === 'answer') {
|
|
|
|
|
+ this.data.answer_list.push(structuredClone(answerData));
|
|
|
|
|
+ } else if (type === 'analysis') {
|
|
|
|
|
+ this.data.analysis_list.push(structuredClone(analysisData));
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 更新答案或解析的文件列表
|
|
|
|
|
+ * @param {Array} file_list 文件列表
|
|
|
|
|
+ * @param {Array} file_id_list 文件ID列表
|
|
|
|
|
+ * @param {Number} index 答案解析索引
|
|
|
|
|
+ * @param {Number} indexs 文件类型索引 0-答案音频 1-答案图片 2-答案视频 3-解析音频 4-解析图片 5-解析视频
|
|
|
|
|
+ * @param {String} type 类型 answer 答案 analysis 解析
|
|
|
|
|
+ */
|
|
|
|
|
+ updateAnswerAnalysisFileList({ file_list, file_id_list, index, indexs, type }) {
|
|
|
|
|
+ if (type === 'answer') {
|
|
|
|
|
+ this.data.answer_list[index][this.idNameOrder[indexs]] = file_id_list;
|
|
|
|
|
+ this.data.answer_list[index][this.fileNameOrder[indexs]] = file_list;
|
|
|
|
|
+ } else if (type === 'analysis') {
|
|
|
|
|
+ this.data.analysis_list[index][this.idNameOrder[indexs]] = file_id_list;
|
|
|
|
|
+ this.data.analysis_list[index][this.fileNameOrder[indexs]] = file_list;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 删除答案或解析项
|
|
|
|
|
+ * @param {Object} param 参数对象
|
|
|
|
|
+ * @param {number} param.index 索引
|
|
|
|
|
+ * @param {'answer'|'analysis'} param.type 类型
|
|
|
|
|
+ */
|
|
|
|
|
+ deleteAnswerAnalysis({ index, type }) {
|
|
|
|
|
+ if (type === 'answer') {
|
|
|
|
|
+ this.data.answer_list.splice(index, 1);
|
|
|
|
|
+ } else if (type === 'analysis') {
|
|
|
|
|
+ this.data.analysis_list.splice(index, 1);
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
|
|
|