|
@@ -132,8 +132,14 @@
|
|
|
<script>
|
|
|
import { getRandomNumber } from '@/utils/index';
|
|
|
import { componentList } from '../../data/bookType';
|
|
|
-import { ContentSaveCoursewareContent, ContentGetCoursewareContent, SaveBookUnifiedAttrib } from '@/api/book';
|
|
|
+import {
|
|
|
+ ContentSaveCoursewareContent,
|
|
|
+ ContentGetCoursewareContent,
|
|
|
+ SaveBookUnifiedAttrib,
|
|
|
+ GetBookUnifiedAttrib,
|
|
|
+} from '@/api/book';
|
|
|
import _ from 'lodash';
|
|
|
+import { unified_attrib } from '@/common/data';
|
|
|
|
|
|
import PreviewEdit from './PreviewEdit.vue';
|
|
|
import FullTextSettings from '../components/FullTextSettings.vue';
|
|
@@ -145,6 +151,11 @@ export default {
|
|
|
FullTextSettings,
|
|
|
},
|
|
|
inject: ['getCurSettingId'],
|
|
|
+ provide() {
|
|
|
+ return {
|
|
|
+ getBookUnifiedAttr: () => this.book_unified_attrib,
|
|
|
+ };
|
|
|
+ },
|
|
|
props: {
|
|
|
isEdit: {
|
|
|
type: Boolean,
|
|
@@ -168,17 +179,7 @@ export default {
|
|
|
// 组件列表
|
|
|
row_list: [],
|
|
|
// 全文设置
|
|
|
- unified_attrib: {
|
|
|
- topic_color: '#165dff',
|
|
|
- font: '宋体,微软雅黑',
|
|
|
- font_size: '12pt',
|
|
|
- pinyin_size: '12pt',
|
|
|
- line_height: 1.5,
|
|
|
- text_color: '#1d2129',
|
|
|
- align: 'LEFT',
|
|
|
- view_pinyin: 'true',
|
|
|
- pinyin_position: 'top',
|
|
|
- },
|
|
|
+ unified_attrib,
|
|
|
},
|
|
|
rowCheckList: {}, // 行复选框列表
|
|
|
content_group_row_list: [], // 行分组id列表
|
|
@@ -197,6 +198,7 @@ export default {
|
|
|
dragging: false,
|
|
|
},
|
|
|
visibleFullTextSettings: false,
|
|
|
+ book_unified_attrib: unified_attrib,
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
@@ -341,6 +343,7 @@ export default {
|
|
|
},
|
|
|
);
|
|
|
});
|
|
|
+ this.getBookUnifiedAttr();
|
|
|
},
|
|
|
mounted() {
|
|
|
document.addEventListener('mousemove', this.dragMove);
|
|
@@ -372,6 +375,13 @@ export default {
|
|
|
this.data.unified_attrib = data;
|
|
|
this.saveBookUnifiedAttr(data);
|
|
|
},
|
|
|
+ getBookUnifiedAttr() {
|
|
|
+ GetBookUnifiedAttrib({ book_id: this.project_id }).then(({ content }) => {
|
|
|
+ if (content) {
|
|
|
+ this.book_unified_attrib = JSON.parse(content);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
saveBookUnifiedAttr(data) {
|
|
|
SaveBookUnifiedAttrib({
|
|
|
book_id: this.project_id,
|
|
@@ -405,7 +415,7 @@ export default {
|
|
|
});
|
|
|
|
|
|
try {
|
|
|
- // 先等待所有子组件内容落库完成
|
|
|
+ // 先等待所有子组件内容保存完成
|
|
|
if (this.isEdit) {
|
|
|
const comps = Array.isArray(this.$refs?.component)
|
|
|
? this.$refs.component
|