Browse Source

1、颜色应用于整本教材 2、单个属性应用到富文本问题修改

dsy 1 week ago
parent
commit
079ac88ba3

+ 1 - 1
.env

@@ -11,4 +11,4 @@ VUE_APP_BookWebSI = '/GCLSBookWebSI/ServiceInterface'
 VUE_APP_EepServer = '/EEPServer/SI'
 VUE_APP_EepServer = '/EEPServer/SI'
 
 
 #version
 #version
-VUE_APP_VERSION = '2026.04.23'
+VUE_APP_VERSION = '2026.04.24'

+ 1 - 1
src/api/book.js

@@ -561,4 +561,4 @@ export function GetCoursewareFeedbackList(data) {
  */
  */
 export function DeleteCoursewareFeedback(data) {
 export function DeleteCoursewareFeedback(data) {
   return http.post(`${process.env.VUE_APP_EepServer}?MethodName=book_preview_manager-DeleteCoursewareFeedback`, data);
   return http.post(`${process.env.VUE_APP_EepServer}?MethodName=book_preview_manager-DeleteCoursewareFeedback`, data);
-}
+}

+ 1 - 0
src/components/RichText.vue

@@ -837,6 +837,7 @@ export default {
         }
         }
       }
       }
       editor.selection.collapse(false);
       editor.selection.collapse(false);
+      editor.fire('change'); // 触发内容变化事件,确保内容更新
     },
     },
     setRichTitleFormat(config) {
     setRichTitleFormat(config) {
       if (!this.editorIsInited) {
       if (!this.editorIsInited) {

+ 13 - 0
src/views/book/courseware/create/components/CreateCanvas.vue

@@ -408,6 +408,10 @@ export default {
     changeData() {
     changeData() {
       this.$emit('changeData');
       this.$emit('changeData');
     },
     },
+    /**
+     * 应用全文设置
+     * @param {object} data 全文设置数据
+     */
     fullTextSettings(data) {
     fullTextSettings(data) {
       this.$refs.component.forEach((item) => {
       this.$refs.component.forEach((item) => {
         item.updateProperty('view_pinyin', data.view_pinyin);
         item.updateProperty('view_pinyin', data.view_pinyin);
@@ -422,6 +426,10 @@ export default {
       });
       });
       this.data.unified_attrib = data;
       this.data.unified_attrib = data;
     },
     },
+    /**
+     * 应用属性到选中组件
+     * @param {object} data 属性数据
+     */
     applyToSelectedComponents(data) {
     applyToSelectedComponents(data) {
       this.$refs.component.forEach((item) => {
       this.$refs.component.forEach((item) => {
         if (item.$refs.base.checked) {
         if (item.$refs.base.checked) {
@@ -437,6 +445,11 @@ export default {
         }
         }
       });
       });
     },
     },
+    /**
+     * 应用单个属性到选中组件
+     * @param {string} attr 属性名称
+     * @param {any} val 属性值
+     */
     applySingleAttrToSelectedComponents(attr, val) {
     applySingleAttrToSelectedComponents(attr, val) {
       this.$refs.component.forEach((item) => {
       this.$refs.component.forEach((item) => {
         if (item.$refs.base.checked) {
         if (item.$refs.base.checked) {

+ 1 - 1
src/views/book/courseware/create/components/FullTextSettings.vue

@@ -88,7 +88,7 @@
     <div slot="footer" class="dialog-footer">
     <div slot="footer" class="dialog-footer">
       <el-button @click="handleClose">取 消</el-button>
       <el-button @click="handleClose">取 消</el-button>
       <el-button type="primary" @click="applyToSelectedComponents">应用选中组件</el-button>
       <el-button type="primary" @click="applyToSelectedComponents">应用选中组件</el-button>
-      <el-button type="primary" @click="confirm">确 定</el-button>
+      <el-button type="primary" @click="confirm">应用整页</el-button>
     </div>
     </div>
   </el-dialog>
   </el-dialog>
 </template>
 </template>

+ 4 - 0
src/views/book/courseware/create/components/common/ModuleMixin.js

@@ -216,6 +216,10 @@ const mixin = {
         richText.setRichFormat(type, attr);
         richText.setRichFormat(type, attr);
       });
       });
     },
     },
+    /**
+     * @description 设置 unified_attrib 属性
+     * @param {object} data unified_attrib数据
+     */
     setUnifiedAttr(data) {
     setUnifiedAttr(data) {
       if (!data) return;
       if (!data) return;
       this.data.unified_attrib = data;
       this.data.unified_attrib = data;

+ 26 - 25
src/views/personal_workbench/project/components/BookUnifiedAttr.vue

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