浏览代码

修改显示拼音问题

dsy 6 天之前
父节点
当前提交
d213d3683e

+ 18 - 2
src/views/book/courseware/create/components/question/fill/Fill.vue

@@ -129,10 +129,26 @@ export default {
     'data.property': {
       handler({ view_pinyin }) {
         if (!this.isEnable(view_pinyin)) {
-          this.data.paragraph_list = [];
+          this.data.model_essay.forEach((item, i) => {
+            item.forEach((option) => {
+              option.paragraph_list = [];
+              option.paragraph_list_parameter = {
+                text: '',
+                pinyin_proofread_word_list: [],
+              };
+            });
+          });
           return;
         }
-        if (this.data.paragraph_list.length > 0) return;
+
+        if (
+          this.data.model_essay.length > 0 &&
+          this.data.model_essay[0].length > 0 &&
+          this.data.model_essay[0][0].paragraph_list.length > 0
+        ) {
+          return;
+        }
+
         this.data.model_essay.forEach((item, i) => {
           item.forEach((option, j) => {
             const text = option.content.replace(/<[^>]+>/g, '');

+ 8 - 2
src/views/book/courseware/create/components/question/judge/Judge.vue

@@ -81,10 +81,16 @@ export default {
     'data.property': {
       handler({ view_pinyin }) {
         if (!this.isEnable(view_pinyin)) {
-          this.data.paragraph_list = [];
+          this.data.option_list.forEach((item) => {
+            item.paragraph_list = [];
+            item.paragraph_list_parameter = {
+              text: '',
+              pinyin_proofread_word_list: [],
+            };
+          });
           return;
         }
-        if (this.data.paragraph_list.length > 0) return;
+        if (this.data.option_list.length > 0 && this.data.option_list[0].paragraph_list.length > 0) return;
         this.data.option_list.forEach((item, i) => {
           const text = item.content.replace(/<[^>]+>/g, '');
           if (!text) return;

+ 8 - 2
src/views/book/courseware/create/components/question/matching/Matching.vue

@@ -157,10 +157,16 @@ export default {
     'data.property': {
       handler({ view_pinyin }) {
         if (!this.isEnable(view_pinyin)) {
-          this.data.paragraph_list = [];
+          this.data.option_list.forEach((item) => {
+            item.paragraph_list = [];
+            item.paragraph_list_parameter = {
+              text: '',
+              pinyin_proofread_word_list: [],
+            };
+          });
           return;
         }
-        if (this.data.paragraph_list.length > 0) return;
+        if (this.data.option_list.length > 0 && this.data.option_list[0].paragraph_list.length > 0) return;
         this.data.option_list.forEach((item, i) => {
           item.forEach((option, j) => {
             const text = option.content.replace(/<[^>]+>/g, '');

+ 8 - 2
src/views/book/courseware/create/components/question/select/Select.vue

@@ -69,10 +69,16 @@ export default {
     'data.property': {
       handler({ view_pinyin }) {
         if (!this.isEnable(view_pinyin)) {
-          this.data.paragraph_list = [];
+          this.data.option_list.forEach((item) => {
+            item.paragraph_list = [];
+            item.paragraph_list_parameter = {
+              text: '',
+              pinyin_proofread_word_list: [],
+            };
+          });
           return;
         }
-        if (this.data.paragraph_list.length > 0) return;
+        if (this.data.option_list.length > 0 && this.data.option_list[0].paragraph_list.length > 0) return;
         this.data.option_list.forEach((item, i) => {
           const text = item.content.replace(/<[^>]+>/g, '');
           if (!text) return;

+ 8 - 2
src/views/book/courseware/create/components/question/sort/Sort.vue

@@ -105,10 +105,16 @@ export default {
     'data.property': {
       handler({ view_pinyin }) {
         if (!this.isEnable(view_pinyin)) {
-          this.data.paragraph_list = [];
+          this.data.option_list.forEach((item) => {
+            item.paragraph_list = [];
+            item.paragraph_list_parameter = {
+              text: '',
+              pinyin_proofread_word_list: [],
+            };
+          });
           return;
         }
-        if (this.data.paragraph_list.length > 0) return;
+        if (this.data.option_list.length > 0 && this.data.option_list[0].paragraph_list.length > 0) return;
         this.data.option_list.forEach((item, i) => {
           const text = item.content.replace(/<[^>]+>/g, '');
           if (!text) return;