浏览代码

增加读拼音写汉字的录音字段并修改增加选项bug

秦鹏 3 年之前
父节点
当前提交
d24a730904

+ 11 - 3
src/components/Adult/common/SentenceModule.vue

@@ -40,6 +40,14 @@
       ></el-input>
     </div>
     <div class="Big-Book-top" v-if="type == 'recordHZ_inputPY_chs'">
+      <span>录音</span>
+      <el-radio v-model="curQueItem.IsRecord" :label="true">需要</el-radio>
+      <el-radio v-model="curQueItem.IsRecord" :label="false">不需要</el-radio>
+    </div>
+    <div
+      class="Big-Book-top"
+      v-if="type == 'recordHZ_inputPY_chs' && curQueItem.IsRecord"
+    >
       <img src="../../../assets/adult/pro-plus.png" alt="" />
     </div>
     <!-- <div class="Big-Book-mp3">
@@ -215,7 +223,7 @@ export default {
   &-top {
     display: flex;
     justify-content: flex-start;
-    align-items: flex-start;
+    align-items: center;
     margin-top: 10px;
     > span {
       width: 50px;
@@ -234,7 +242,7 @@ export default {
     .Big-Book-input {
       display: flex;
       justify-content: flex-start;
-      align-items: flex-start;
+      align-items: center;
       > span {
         line-height: 32px;
         margin-right: 6px;
@@ -249,7 +257,7 @@ export default {
     > div {
       display: flex;
       justify-content: flex-start;
-      align-items: flex-start;
+      align-items: center;
       margin-right: 10px;
       > span {
         line-height: 32px;

+ 1 - 1
src/components/Adult/inputModules/InputRecord.vue

@@ -62,7 +62,7 @@ export default {
   methods: {
     //添加一个选项
     addOption() {
-      let obj = this.data_structure.option[0];
+      let obj = JSON.parse(JSON.stringify(this.data_structure.option[0]));
       this.curQue.option.push(obj);
     },
     deleteOptionOne(index) {

+ 7 - 5
src/components/Adult/inputModules/Sentence.vue

@@ -69,6 +69,7 @@ export default {
             number: "",
             con: "",
             answer: "",
+            IsRecord: false,
           },
         ],
       },
@@ -111,11 +112,12 @@ export default {
     },
     // 新增选项
     addOption() {
-      // if (!last.hanzi && !last.pinyin) {
-      //   this.$message.warning("数据不能全是空");
-      //   return;
-      // }
-      let obj = this.data_structure.option[0];
+      let obj;
+      if (this.type == "recordHZ_inputPY_chs") {
+        obj = JSON.parse(JSON.stringify(this.data_structure.option[0]));
+      } else if (this.type == "inputItem_chs") {
+        obj = JSON.parse(JSON.stringify(this.data_structure2.option[0]));
+      }
       this.curQue.option.push(obj);
     },
     // 更多配置选择

+ 4 - 5
src/views/adultInput.vue

@@ -216,7 +216,7 @@
                     选择模板
                   </div>
                   <div
-                    v-if="!topicIitem.data && topicIitem.is_addModule"
+                    v-if="!topicIitem.data && topicIitem.is_add_module"
                     class="addoption"
                     @click="addModule(toindex, rowIndex, lineIndex, topicIitem)"
                   >
@@ -458,7 +458,7 @@ export default {
           for (let j = 0; j < this.line; j++) {
             let obj = {
               text: `第${i + 1}行,第${j + 1}列`,
-              is_addModule: true,
+              is_add_module: true,
               is_edit: true,
             };
             rowArr.push(obj);
@@ -477,7 +477,7 @@ export default {
       this.TopicIndex = topicIndex;
       this.RowIndex = rowindex;
       this.LineIndex = lineIndex;
-      item.is_addModule = false;
+      item.is_add_module = false;
     },
     // 删除模板
     remoeModule(topicIndex, rowindex, lineIndex, item) {
@@ -496,7 +496,7 @@ export default {
       this.TopicIndex = null;
       this.RowIndex = null;
       this.LineIndex = null;
-      item.is_addModule = true;
+      item.is_add_module = true;
     },
     handleClosePre() {
       if (window.stopAudioVoice) window.stopAudioVoice();
@@ -582,7 +582,6 @@ export default {
       ) {
         this.$message.warning("每列只能添加一个模板");
       } else {
-        debugger;
         console.log("不存在");
         this.module_type = item.type;
         this.$set(