Преглед на файлове

Merge branch 'master' of http://221.216.211.14:3000/GCLS/GCLS_Page_Book_Component_NPC

gcj преди 3 години
родител
ревизия
fc3ef3be60
променени са 3 файла, в които са добавени 14 реда и са изтрити 10 реда
  1. 1 3
      src/components/Adult/preview/Soundrecord.vue
  2. 11 7
      src/components/Adult/preview/TableView.vue
  3. 2 0
      src/components/Adult/preview/TextInputRecord.vue

+ 1 - 3
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);
@@ -257,7 +256,6 @@ export default {
       }
     },
     playmicrophone(totalTimes) {
-      debugger;
       if (this.hasMicro) {
         this.isPlaying = true;
         if (this.selectIndex || this.selectIndex == 0) {

+ 11 - 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,11 @@ 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);
       }
   },
   //生命周期 - 挂载完成(可以访问DOM元素)

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

@@ -57,10 +57,12 @@
           v-model="curQue.Bookanswer[indexs].answer"
           @keyup.enter="handleReplaceTone($event, indexs)"
           placeholder="输入"
+          maxlength="200"
         />
         <template v-if="items.IsRecord">
           <Soundrecord
             @handleWav="handleWav"
+            :answerRecordList="curQue.Bookanswer[indexs].recordList"
             :tmIndex="indexs"
             type="pro"
             class="luyin-box"