dsy 3 дней назад
Родитель
Сommit
c828f9f5eb

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

@@ -390,6 +390,21 @@ export default {
       });
       });
       this.data.unified_attrib = data;
       this.data.unified_attrib = data;
     },
     },
+    applyToSelectedComponents(data) {
+      this.$refs.component.forEach((item) => {
+        if (item.$refs.base.checked) {
+          item.updateProperty('view_pinyin', data.view_pinyin);
+          item.updateProperty('pinyin_position', data.pinyin_position);
+          item.updateRichTextProperty('fontFamily', data.font);
+          item.updateRichTextProperty('fontSize', data.font_size);
+          item.updateRichTextProperty('lineHeight', data.line_height);
+          item.updateRichTextProperty('color', data.text_color);
+          item.updateRichTextProperty('align', data.align);
+
+          item.setUnifiedAttr(data);
+        }
+      });
+    },
     getBookUnifiedAttr() {
     getBookUnifiedAttr() {
       GetBookUnifiedAttrib({ book_id: this.project_id }).then(({ content }) => {
       GetBookUnifiedAttrib({ book_id: this.project_id }).then(({ content }) => {
         if (content) {
         if (content) {

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

@@ -63,6 +63,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="confirm">确 定</el-button>
       <el-button type="primary" @click="confirm">确 定</el-button>
     </div>
     </div>
   </el-dialog>
   </el-dialog>
@@ -152,6 +153,10 @@ export default {
       this.$emit('update:visible', false);
       this.$emit('update:visible', false);
       this.$emit('fullTextSettings', this.unified_attrib);
       this.$emit('fullTextSettings', this.unified_attrib);
     },
     },
+    applyToSelectedComponents() {
+      this.$emit('update:visible', false);
+      this.$emit('applyToSelectedComponents', this.unified_attrib);
+    },
   },
   },
 };
 };
 </script>
 </script>

+ 4 - 0
src/views/personal_workbench/edit_task/edit/index.vue

@@ -70,6 +70,7 @@
       :visible.sync="visibleFullTextSettings"
       :visible.sync="visibleFullTextSettings"
       :settings="data.unified_attrib"
       :settings="data.unified_attrib"
       @fullTextSettings="fullTextSettings"
       @fullTextSettings="fullTextSettings"
+      @applyToSelectedComponents="applyToSelectedComponents"
     />
     />
 
 
     <SetBackground
     <SetBackground
@@ -269,6 +270,9 @@ export default {
     fullTextSettings(data) {
     fullTextSettings(data) {
       this.$refs.create.$refs.createCanvas.fullTextSettings(data);
       this.$refs.create.$refs.createCanvas.fullTextSettings(data);
     },
     },
+    applyToSelectedComponents(data) {
+      this.$refs.create.$refs.createCanvas.applyToSelectedComponents(data);
+    },
     goBackPreview() {
     goBackPreview() {
       if (this.$route.query.template_type) {
       if (this.$route.query.template_type) {
         this.$router.push({
         this.$router.push({