|
|
@@ -1,5 +1,6 @@
|
|
|
// 组件混入
|
|
|
import Vue from 'vue';
|
|
|
+import _ from 'lodash';
|
|
|
import ModuleBase from './ModuleBase.vue';
|
|
|
import RichText from '@/components/RichText.vue';
|
|
|
import MultilingualFill from '@/views/book/components/MultilingualFill.vue';
|
|
|
@@ -279,9 +280,12 @@ const mixin = {
|
|
|
{ deep: true },
|
|
|
);
|
|
|
},
|
|
|
+ /**
|
|
|
+ * @description 初始化组件的默认内容,包括统一属性和部分属性的默认值
|
|
|
+ */
|
|
|
initializeDefaultContent() {
|
|
|
const bookUnifiedAttr = this.getBookUnifiedAttr();
|
|
|
- this.$set(this.data, 'unified_attrib', bookUnifiedAttr);
|
|
|
+ this.$set(this.data, 'unified_attrib', _.cloneDeep(bookUnifiedAttr));
|
|
|
|
|
|
if ('view_pinyin' in this.data.property) {
|
|
|
this.data.property.view_pinyin = bookUnifiedAttr?.view_pinyin ?? 'false';
|
|
|
@@ -420,7 +424,7 @@ const mixin = {
|
|
|
*/
|
|
|
setUnifiedAttr(data) {
|
|
|
if (!data) return;
|
|
|
- this.data.unified_attrib = data;
|
|
|
+ this.data.unified_attrib = _.cloneDeep(data);
|
|
|
},
|
|
|
/**
|
|
|
* @description 设置单个教材属性
|