|
|
@@ -58,6 +58,7 @@ import PreviewMixin from '../common/PreviewMixin';
|
|
|
import { isEnable } from '@/views/book/courseware/data/common';
|
|
|
import PinyinText from '@/components/PinyinText.vue';
|
|
|
import AudioPlay from '../character_base/components/AudioPlay.vue';
|
|
|
+import { getRandomNumber } from '@/utils';
|
|
|
|
|
|
export default {
|
|
|
name: 'RichTextPreview',
|
|
|
@@ -119,6 +120,41 @@ export default {
|
|
|
}, 800);
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取无文本内容的数据结构,用于保存为个人模板时的样式模板
|
|
|
+ */
|
|
|
+ getNoTextContentData() {
|
|
|
+ let noTextContentData = JSON.parse(JSON.stringify(this.data));
|
|
|
+ const resetFieldMap = {
|
|
|
+ analysis_list: [],
|
|
|
+ answer_list: [],
|
|
|
+ };
|
|
|
+
|
|
|
+ Object.assign(noTextContentData, resetFieldMap);
|
|
|
+
|
|
|
+ noTextContentData.option_list.forEach((item) => {
|
|
|
+ item.content = '';
|
|
|
+ item.pinyin = '';
|
|
|
+ item.shiyi = '';
|
|
|
+ item.mark = getRandomNumber();
|
|
|
+ item.hz_info = [];
|
|
|
+ item.file_list = [];
|
|
|
+ item.file_id_list = [];
|
|
|
+ item.content_list = [];
|
|
|
+ item.is_common_pinyin = true;
|
|
|
+ item.audio_file_id = '';
|
|
|
+ item.is_margin = false;
|
|
|
+ item.is_show_ben = true;
|
|
|
+ });
|
|
|
+
|
|
|
+ if (noTextContentData.answer) {
|
|
|
+ noTextContentData.answer.answer_list = [];
|
|
|
+ noTextContentData.answer.reference_answer = '';
|
|
|
+ }
|
|
|
+
|
|
|
+ return noTextContentData;
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|