Browse Source

初始化框颜色

natasha 2 days ago
parent
commit
182270194e
1 changed files with 7 additions and 3 deletions
  1. 7 3
      src/views/book/courseware/create/components/common/ModuleMixin.js

+ 7 - 3
src/views/book/courseware/create/components/common/ModuleMixin.js

@@ -96,11 +96,15 @@ const mixin = {
             this.data = JSON.parse(content);
           } else if ('view_pinyin' in this.data.property) {
             // 初始化时,如果有 view_pinyin 则根据全文设置配置设 view_pinyin 和 pinyin_position
-            const bookUnifiedAttr = this.getBookUnifiedAttr();
-
+            const bookUnifiedAttr = this.getBookUnifiedAttr();   
+            
             this.data.property.view_pinyin = bookUnifiedAttr?.view_pinyin ?? 'false';
             this.data.property.pinyin_position = bookUnifiedAttr?.pinyin_position ?? 'top';
-          }
+            if ('frame_color' in this.data.property) {
+              // 框颜色初始化为主题色
+              this.data.property.frame_color = bookUnifiedAttr?.topic_color ?? '#F13232';
+            }
+          } 
           this.property.isGetContent = true;
 
           this.$watch(