natasha 1 week ago
parent
commit
b3435ec159

+ 4 - 0
src/views/book/courseware/create/components/question/pinyin_base/PinyinBase.vue

@@ -168,10 +168,12 @@ export default {
         )
         )
         .filter((item) => item.length > 0)
         .filter((item) => item.length > 0)
         .join(' ');
         .join(' ');
+      this.data.matically_pinyin_str[mark] = this.matically_pinyin_str[mark];
       if (this.matically_pinyin_str[mark].indexOf(',') > -1) {
       if (this.matically_pinyin_str[mark].indexOf(',') > -1) {
         this.$message.warning('输入的拼音有误,请重新输入');
         this.$message.warning('输入的拼音有误,请重新输入');
         this.matically_pinyin_obj[mark] = [];
         this.matically_pinyin_obj[mark] = [];
         this.matically_pinyin_str[mark] = '';
         this.matically_pinyin_str[mark] = '';
+        this.data.matically_pinyin_str[mark] = '';
         this.data.content = '';
         this.data.content = '';
       }
       }
       this.handleMindMap();
       this.handleMindMap();
@@ -208,6 +210,7 @@ export default {
       this.res_arr = [];
       this.res_arr = [];
       this.$set(this.matically_pinyin_obj, item.mark, []);
       this.$set(this.matically_pinyin_obj, item.mark, []);
       this.$set(this.matically_pinyin_str, item.mark, '');
       this.$set(this.matically_pinyin_str, item.mark, '');
+      this.$set(this.data.matically_pinyin_str, item.mark, '');
       if (this.data.property.fun_type !== 'input') {
       if (this.data.property.fun_type !== 'input') {
         this.data.answer.answer_list = [];
         this.data.answer.answer_list = [];
       }
       }
@@ -311,6 +314,7 @@ export default {
       let node_list = [];
       let node_list = [];
       node_list.push({
       node_list.push({
         name: this.matically_pinyin_str[this.data.mark],
         name: this.matically_pinyin_str[this.data.mark],
+
         id: Math.random().toString(36).substring(2, 12),
         id: Math.random().toString(36).substring(2, 12),
       });
       });
       this.data.mind_map.node_list = node_list;
       this.data.mind_map.node_list = node_list;

+ 8 - 0
src/views/book/courseware/create/components/question/pinyin_base/PinyinBaseSetting.vue

@@ -83,5 +83,13 @@ export default {
 
 
 .el-form {
 .el-form {
   @include setting-base;
   @include setting-base;
+
+  .el-radio input[aria-hidden='true'] {
+    display: none !important;
+  }
+
+  .el-radio:focus:not(.is-focus, :active, .is-disabled) .el-radio__inner {
+    box-shadow: none !important;
+  }
 }
 }
 </style>
 </style>

+ 1 - 0
src/views/book/courseware/data/pinyinBase.js

@@ -84,6 +84,7 @@ export function getPinyinBaseData() {
     content: '',
     content: '',
     content_view: [],
     content_view: [],
     content_hz: '',
     content_hz: '',
+    matically_pinyin_str: {},
     audio_file_id: '',
     audio_file_id: '',
     file_id_list: [], // 文件 id
     file_id_list: [], // 文件 id
     mark: getRandomNumber(),
     mark: getRandomNumber(),

+ 24 - 17
src/views/book/courseware/preview/components/pinyin_base/PinyinBasePreview.vue

@@ -42,23 +42,30 @@
               </span>
               </span>
             </template>
             </template>
             <template v-else-if="data.property.answer_mode === 'select'">
             <template v-else-if="data.property.answer_mode === 'select'">
-              <span
-                v-for="(itemc, indexc) in con_preview[0].item_con"
-                :key="indexc"
-                :class="[
-                  'item-con',
-                  active_index_str === 0 + '-' + indexc ? 'active' : '',
-                  isJudgingRightWrong && !con_preview[0].user_answer[indexc].is_right ? 'error' : '',
-                  data.property.fun_type === 'show' ? 'item-con-in' : '',
-                ]"
-                @click="
-                  if (data.property.fun_type === 'show') return;
-                  con_preview[0].item_active_index = indexc;
-                  active_index_str = 0 + '-' + indexc;
-                "
-              >
-                {{ itemc }}
-              </span>
+              <template v-if="data.property.fun_type === 'show'">
+                <span v-for="(itemc, indexc) in data.matically_pinyin_str[data.mark]" :key="indexc" class="items-box">
+                  <span v-for="(itemi, indexi) in itemc" :key="indexi" :class="['items-con']">{{ itemi }}</span>
+                </span>
+              </template>
+              <template v-else>
+                <span
+                  v-for="(itemc, indexc) in con_preview[0].item_con"
+                  :key="indexc"
+                  :class="[
+                    'item-con',
+                    active_index_str === 0 + '-' + indexc ? 'active' : '',
+                    isJudgingRightWrong && !con_preview[0].user_answer[indexc].is_right ? 'error' : '',
+                    data.property.fun_type === 'show' ? 'item-con-in' : '',
+                  ]"
+                  @click="
+                    if (data.property.fun_type === 'show') return;
+                    con_preview[0].item_active_index = indexc;
+                    active_index_str = 0 + '-' + indexc;
+                  "
+                >
+                  {{ itemc }}
+                </span>
+              </template>
             </template>
             </template>
             <template v-else>
             <template v-else>
               <span v-for="(itemc, indexc) in con_preview[0].item_con" :key="indexc" class="items-box">
               <span v-for="(itemc, indexc) in con_preview[0].item_con" :key="indexc" class="items-box">