|
|
@@ -2,7 +2,7 @@
|
|
|
<el-dialog
|
|
|
title="教材样式设置"
|
|
|
:visible="visible"
|
|
|
- width="600px"
|
|
|
+ width="480px"
|
|
|
:close-on-click-modal="false"
|
|
|
class="book-unified-attr"
|
|
|
@close="dialogClose"
|
|
|
@@ -16,6 +16,8 @@
|
|
|
<span>辅助色</span>
|
|
|
<el-color-picker v-model="unified_attrib.assist_color" />
|
|
|
<span class="link" @click="generateAssistColor">自动生成辅助色</span>
|
|
|
+ <span>|</span>
|
|
|
+ <span class="link" @click="applyBookUnifiedAttr('COLOR')">应用于整本教材</span>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="字体">
|
|
|
@@ -53,11 +55,6 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
-
|
|
|
- <div class="tips" @click="applyBookUnifiedAttr">
|
|
|
- <p>重置当前教材所有内容</p>
|
|
|
- <p style="color: #f00">(不包含富文本的现有文字属性)</p>
|
|
|
- </div>
|
|
|
</div>
|
|
|
<div class="setting-bottom">
|
|
|
<span>拼音</span>
|
|
|
@@ -134,11 +131,26 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- applyBookUnifiedAttr() {
|
|
|
+ /**
|
|
|
+ * 应用教材全文设置
|
|
|
+ * @param {String} scope 应用范围
|
|
|
+ */
|
|
|
+ applyBookUnifiedAttr(scope = '') {
|
|
|
let loading = this.$loading({ fullscreen: true, text: '正在应用,请稍后...' });
|
|
|
+ let content = null;
|
|
|
+ if (scope === 'COLOR') {
|
|
|
+ content = {
|
|
|
+ topic_color: this.unified_attrib.topic_color,
|
|
|
+ assist_color: this.unified_attrib.assist_color,
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ content = this.unified_attrib;
|
|
|
+ }
|
|
|
+
|
|
|
ApplyBookUnifiedAttrib({
|
|
|
book_id: this.bookId,
|
|
|
- content: JSON.stringify(this.unified_attrib),
|
|
|
+ content: JSON.stringify(content),
|
|
|
+ apply_scope: scope,
|
|
|
})
|
|
|
.then(() => {
|
|
|
this.$message.success('应用成功');
|
|
|
@@ -186,10 +198,6 @@ export default {
|
|
|
.form {
|
|
|
flex: 1;
|
|
|
|
|
|
- .el-input-number {
|
|
|
- width: calc(100% - 42px);
|
|
|
- }
|
|
|
-
|
|
|
.color-group {
|
|
|
display: flex;
|
|
|
column-gap: 10px;
|
|
|
@@ -199,20 +207,13 @@ export default {
|
|
|
white-space: nowrap;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- .tips {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- align-items: center;
|
|
|
- justify-content: center;
|
|
|
- width: 240px;
|
|
|
- font-size: 12px;
|
|
|
- line-height: 1.5;
|
|
|
- text-align: center;
|
|
|
- cursor: pointer;
|
|
|
- background-color: rgba(22, 93, 255, 8%);
|
|
|
- border-radius: 8px;
|
|
|
+ .el-form {
|
|
|
+ .el-select,
|
|
|
+ .el-input-number {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|