|
|
@@ -60,6 +60,7 @@
|
|
|
import { getVideoData } from '@/views/book/courseware/data/video';
|
|
|
import PreviewMixin from '../common/PreviewMixin';
|
|
|
import VideoPlay from '../common/VideoPlay.vue';
|
|
|
+import { getRandomNumber } from '@/utils';
|
|
|
|
|
|
export default {
|
|
|
name: 'VideoPreview',
|
|
|
@@ -85,7 +86,7 @@ export default {
|
|
|
data: {
|
|
|
handler(val) {
|
|
|
this.fileLen = val.file_list.length;
|
|
|
- if (this.fileLen == 0) return;
|
|
|
+ if (this.fileLen === 0) return;
|
|
|
if (this.data.property.view_method === 'list') {
|
|
|
const ele = this.$refs.videoAreaBox;
|
|
|
const sn_position = this.data.property.sn_position;
|
|
|
@@ -161,7 +162,7 @@ export default {
|
|
|
}
|
|
|
this.fileLen = this.data.file_list.length;
|
|
|
|
|
|
- //}
|
|
|
+ // }
|
|
|
|
|
|
this.resizeObserver = new ResizeObserver((entries) => {
|
|
|
if (!this.getDragStatus() && !this.isFirstLoad) return;
|
|
|
@@ -282,6 +283,26 @@ export default {
|
|
|
this.translateY = newY;
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取无文本内容的数据结构,用于保存为个人模板时的样式模板
|
|
|
+ */
|
|
|
+ getNoTextContentData() {
|
|
|
+ let noTextContentData = JSON.parse(JSON.stringify(this.data));
|
|
|
+ const resetFieldMap = {
|
|
|
+ analysis_list: [],
|
|
|
+ answer_list: [],
|
|
|
+ };
|
|
|
+
|
|
|
+ Object.assign(noTextContentData, resetFieldMap);
|
|
|
+
|
|
|
+ if (noTextContentData.answer) {
|
|
|
+ noTextContentData.answer.answer_list = [];
|
|
|
+ noTextContentData.answer.reference_answer = '';
|
|
|
+ }
|
|
|
+
|
|
|
+ return noTextContentData;
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|