natasha před 3 roky
rodič
revize
c119192b20

+ 1 - 2
src/components/Adult/preview/Soundrecord.vue

@@ -153,8 +153,7 @@ export default {
   // 生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
     let _this = this;
-    _this.recordList = JSON.parse(JSON.stringify(_this.answerRecordList));
-    console.log(_this.recordList);
+    _this.recordList = _this.answerRecordList ? JSON.parse(JSON.stringify(_this.answerRecordList)) : [];
     if (_this.recordList.length > 0) {
       _this.selectIndex = 0;
       _this.handleChangeRecord(0);

+ 12 - 7
src/components/Adult/preview/TableView.vue

@@ -24,7 +24,7 @@
               {{ col.con }}
             </template>
             <template v-else>
-                <div v-html="curQue.Bookanswer[rowIndex][colIndex]" contenteditable="true" placeholder="输入" class="input" @input="handleMaxlength" ></div>
+                <div v-html="curQue.Bookanswer.curCorrect[rowIndex][colIndex]" contenteditable="true" placeholder="输入" class="input" @input="handleMaxlength" ></div>
               <!-- <input type="text" v-model="col.con" /> -->
             </template>
           </td>
@@ -58,7 +58,7 @@ export default {
   components: {
     Soundrecord,
   },
-  props: ["curQue","Bookanswer"],
+  props: ["curQue"],
   data() {
     //这里存放数据
     return {};
@@ -69,7 +69,10 @@ export default {
   watch: {},
   //方法集合
   methods: {
-    handleWav(data) {},
+    handleWav(list, tmIndex) {
+      tmIndex = tmIndex ? tmIndex : 0;
+      this.$set(this.curQue.Bookanswer, "recordList", list);
+    },
     handleMaxlength(e){
         if(e.target.innerHTML.length>200){
             e.target.innerHTML = e.target.innerHTML.substring(0, 200);
@@ -92,10 +95,12 @@ export default {
             })
             curCorrect.push(curCorrectItem)
         });
-        this.$set(this.curQue, "Bookanswer", curCorrect);
-      } else {
-        let curCorrect = JSON.parse(JSON.stringify(this.Bookanswer));
-        this.$set(this.curQue, "Bookanswer", curCorrect);
+        let bookanswer = {
+            curCorrect : curCorrect,
+            recordList: [],
+        }
+        this.$set(this.curQue, "Bookanswer", bookanswer);
+        console.log(this.curQue.Bookanswer)
       }
   },
   //生命周期 - 挂载完成(可以访问DOM元素)

+ 1 - 0
src/components/Adult/preview/TextInputRecord.vue

@@ -62,6 +62,7 @@
         <template v-if="items.IsRecord">
           <Soundrecord
             @handleWav="handleWav"
+            :answerRecordList="curQue.Bookanswer[indexs].recordList"
             :tmIndex="indexs"
             type="pro"
             class="luyin-box"