Ver Fonte

Merge branch 'master' of http://60.205.254.193:3000/GCLS/eep_page

zq há 1 mês atrás
pai
commit
dd6cc3b730

+ 16 - 3
src/views/book/courseware/create/components/question/article/Article.vue

@@ -489,8 +489,19 @@ export default {
     'data.unified_attrib': {
       handler(val) {
         if (val) {
+          let oldAttrib = this.data.other_attrib;
           this.articleAttrib = JSON.parse(JSON.stringify(val));
-          this.handleChangeStyles();
+          if (oldAttrib.oldFont && oldAttrib.oldFont !== val.font) {
+            this.$set(this.articleAttrib, 'font', oldAttrib.oldFont);
+          }
+          if (oldAttrib.oldColor && oldAttrib.oldColor !== val.text_color) {
+            this.$set(this.articleAttrib, 'text_color', oldAttrib.oldColor);
+          }
+          if (oldAttrib.align && oldAttrib.align !== val.align) {
+            this.$set(this.articleAttrib, 'align', oldAttrib.align);
+          }
+
+          // this.handleChangeStyles();
         }
       },
       deep: true,
@@ -537,7 +548,8 @@ export default {
             });
           });
         });
-      } else if (this.articleAttrib.text_color !== this.data.other_attrib.oldColor) {
+      }
+      if (this.articleAttrib.text_color !== this.data.other_attrib.oldColor) {
         this.data.other_attrib.oldColor = this.articleAttrib.text_color;
         this.data.detail.forEach((item) => {
           item.wordsList.forEach((items) => {
@@ -546,7 +558,8 @@ export default {
             });
           });
         });
-      } else if (this.articleAttrib.align !== this.data.other_attrib.oldAlign) {
+      }
+      if (this.articleAttrib.align !== this.data.other_attrib.oldAlign) {
         this.data.other_attrib.oldAlign = this.articleAttrib.align;
         this.data.detail.forEach((item) => {
           item.paraAlign =

+ 15 - 3
src/views/book/courseware/create/components/question/dialogue_article/Article.vue

@@ -664,8 +664,18 @@ export default {
     'data.unified_attrib': {
       handler(val) {
         if (val) {
+          let oldAttrib = this.data.other_attrib;
           this.articleAttrib = JSON.parse(JSON.stringify(val));
-          this.handleChangeStyles();
+          if (oldAttrib.oldFont && oldAttrib.oldFont !== val.font) {
+            this.$set(this.articleAttrib, 'font', oldAttrib.oldFont);
+          }
+          if (oldAttrib.oldColor && oldAttrib.oldColor !== val.text_color) {
+            this.$set(this.articleAttrib, 'text_color', oldAttrib.oldColor);
+          }
+          if (oldAttrib.align && oldAttrib.align !== val.align) {
+            this.$set(this.articleAttrib, 'align', oldAttrib.align);
+          }
+          // this.handleChangeStyles();
         }
       },
       deep: true,
@@ -712,7 +722,8 @@ export default {
             });
           });
         });
-      } else if (this.articleAttrib.text_color !== this.data.other_attrib.oldColor) {
+      }
+      if (this.articleAttrib.text_color !== this.data.other_attrib.oldColor) {
         this.data.other_attrib.oldColor = this.articleAttrib.text_color;
         this.data.detail.forEach((item) => {
           item.wordsList.forEach((items) => {
@@ -721,7 +732,8 @@ export default {
             });
           });
         });
-      } else if (this.articleAttrib.align !== this.data.other_attrib.oldAlign) {
+      }
+      if (this.articleAttrib.align !== this.data.other_attrib.oldAlign) {
         this.data.other_attrib.oldAlign = this.articleAttrib.align;
         this.data.detail.forEach((item) => {
           item.paraAlign =