Browse Source

Merge branch 'NPC-lhd'

natasha 3 years ago
parent
commit
a77ad79391

+ 1 - 0
src/components/Adult/Preview.vue

@@ -314,6 +314,7 @@
                   <SelectTone
                     :cur-que="itemss.data"
                     :theme-color="themeColor"
+                    :TaskModel="TaskModel"
                     v-if="refresh"
                   />
                 </template>

+ 17 - 4
src/components/Adult/common/UploadView.vue

@@ -127,10 +127,23 @@ export default {
       }
     },
     handlebeforeUplaod(file) {
-      if (file.size > 20 * 1024 * 1024) {
-        this.$message.warning('上传pdf大小不能超过20M');
-        return false   //必须返回false
-      }
+        if(file.type.indexOf('image/') != -1 ){
+            if (file.size > 2 * 1024 * 1024) {
+                this.$message.warning('上传图片大小不能超过2M');
+                return false   //必须返回false
+            }
+        }else if(file.type.indexOf('application/pdf') != -1){
+            if (file.size > 20 * 1024 * 1024) {
+                this.$message.warning('上传pdf大小不能超过20M');
+                return false   //必须返回false
+            }
+        }else{
+            if (file.size > 500 * 1024 * 1024) {
+                this.$message.warning('上传文件大小不能超过500M');
+                return false   //必须返回false
+            }
+        }
+      
       this.loading = this.$loading({
         lock: true,
         text: "Loading",

+ 10 - 4
src/components/Adult/preview/CheckBoxModule.vue

@@ -2,14 +2,14 @@
 <template>
     <div class="Big-Book-prev-Textdes CheckboxModule" v-if="curQue">
         <h2>{{curQue.title}}</h2>
-        <el-checkbox v-model="userList[index]" v-for="(item,index) in curQue.option" :key="index">{{item.con}}</el-checkbox>
+        <el-checkbox v-model="curQue.Bookanswer[index]" v-for="(item,index) in curQue.option" :key="index" :readonly="TaskModel=='ANSWER'">{{item.con}}</el-checkbox>
     </div>
 </template>
 
 <script>
 export default {
   components: {},
-  props: ["curQue"],
+  props: ["curQue","TaskModel"],
   data() {
     return {
         userList: []
@@ -21,13 +21,19 @@ export default {
   methods: {
       handleData(){
           let _this = this
+          let userList = []
           _this.curQue.option.forEach(item => {
-              _this.userList.push(false)
+              userList.push(false)
           });
+          if (!this.curQue.Bookanswer) {
+            this.$set(this.curQue, "Bookanswer", userList);
+          }
       }
   },
   //生命周期 - 创建完成(可以访问当前this实例)
-  created() {},
+  created() {
+      this.handleData()
+  },
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {},
   beforeCreate() {}, //生命周期 - 创建之前

+ 67 - 0
src/components/Adult/preview/EditDiv.vue

@@ -0,0 +1,67 @@
+<template>
+    <div class="edit-div"
+         v-html="innerText"
+         :contenteditable="TaskModel=='ANSWER'?'false':'true'"
+         @focus="isLocked = true"
+         @blur="isLocked = false"
+         @input="changeText"
+         placeholder="输入">
+    </div>
+</template>
+<script>
+export default {
+        name: 'editDiv',
+        props: {
+            value: {
+                type: String,
+                default: ''
+            },
+            TaskModel: {
+                type: String,
+                default: ''
+            }
+        },
+        data(){
+            return {
+                innerText: this.value,
+                isLocked: false
+            }
+        },
+        watch: {
+            'value'(){
+                if (!this.isLocked || !this.innerText) {
+                    this.innerText = this.value;
+                }
+            }
+        },
+        methods: {
+            changeText(){
+                if(this.$el.innerHTML.length<210){
+                    this.$emit('input', this.$el.innerHTML);
+                }else{
+                    this.$el.innerHTML= this.$el.innerHTML.substring(0,210)
+                }
+            }
+        }
+    }
+</script>
+<style lang="scss" rel="stylesheet/scss">
+    .edit-div {
+        width: 100%;
+        height: 100%;
+        overflow: auto;
+        word-break: break-all;
+        outline: none;
+        user-select: text;
+        white-space: pre-wrap;
+        text-align: left;
+        &[contenteditable=true]{
+            user-modify: read-write-plaintext-only;
+            &:empty:before {
+                content: attr(placeholder);
+                display: block;
+                color: #ccc;
+            }
+        }
+    }
+</style>

+ 25 - 6
src/components/Adult/preview/InputHasRecord.vue

@@ -145,12 +145,17 @@
               <el-input
                 :class="['textarea', items.record ? '' : 'textareaNoRecord']"
                 type="textarea"
-                v-model="answerArr[indexs]"
+                v-model="curQue.Bookanswer[indexs].answer"
                 placeholder="输入"
+                maxlength="200"
+                :readonly="TaskModel=='ANSWER'"
               ></el-input>
               <div v-if="items.record" class="luyin-inner">
                 <Soundrecord
                   @handleWav="handleWav"
+                  :answerRecordList="curQue.Bookanswer[indexs].recordList"
+                  :tmIndex="indexs"
+                  :TaskModel="TaskModel"
                   type="promax"
                   class="luyin-box"
                 />
@@ -268,12 +273,17 @@
           <el-input
             :class="['textarea', items.record ? '' : 'textareaNoRecord']"
             type="textarea"
-            v-model="answerArr[indexs]"
+            v-model="curQue.Bookanswer[indexs].answer"
             placeholder="输入"
+            maxlength="200"
+            :readonly="TaskModel=='ANSWER'"
           ></el-input>
           <div v-if="items.record" class="luyin-inner">
             <Soundrecord
               @handleWav="handleWav"
+              :answerRecordList="curQue.Bookanswer[indexs].recordList"
+              :tmIndex="indexs"
+              :TaskModel="TaskModel"
               type="promax"
               class="luyin-box"
             />
@@ -288,7 +298,7 @@
 import Soundrecord from "../preview/Soundrecord.vue"; // 录音模板
 export default {
   components: { Soundrecord },
-  props: ["curQue"],
+  props: ["curQue","TaskModel"],
   data() {
     return {
       wordShow: true,
@@ -302,14 +312,20 @@ export default {
   watch: {},
   //方法集合
   methods: {
-    handleWav(data) {},
+    handleWav(list, tmIndex) {
+        tmIndex = tmIndex ? tmIndex : 0;
+        this.$set(this.curQue.Bookanswer[tmIndex], "recordList", list);
+    },
     // 处理数据
     handleData() {
       let _this = this;
-      this.answerArr = []
+      let curCorrect = [];
       let curQue = JSON.parse(JSON.stringify(this.curQue));
       curQue.option.forEach((dItem, dIndex) => {
-        this.answerArr.push('')
+        curCorrect.push({
+            answer: "",
+            recordList: [],
+          });
         let paraArr = [];
         dItem.detail.wordsList.forEach((sItem, sIndex) => {
           this.mergeWordSymbol(dItem.detail.wordsList, sItem, sIndex);
@@ -322,6 +338,9 @@ export default {
         });
         this.$set(_this.curQue.option[dIndex].detail, "resArr", paraArr);
       });
+      if (!this.curQue.Bookanswer) {
+          this.$set(this.curQue, "Bookanswer", curCorrect);
+      }
     },
     //词和标点合一起
     mergeWordSymbol(sItem, wItem, curIndex) {

+ 47 - 27
src/components/Adult/preview/Ligature.vue

@@ -179,7 +179,7 @@
       </div>
     </div>
     <!-- 清除所有连线及连线的状态 -->
-    <div class="fuwei">
+    <div class="fuwei" :class="[TaskModel == 'ANSWER'?'notAllow':'']">
       <div @click="clearLine">
         <img src="../../../assets/adult/fuwei.png" alt="" />
         复位
@@ -194,7 +194,7 @@
 export default {
   //import引入的组件需要注入到对象中才能使用
   components: {},
-  props: ["curQue"],
+  props: ["curQue","TaskModel"],
   data() {
     //这里存放数据
     return {
@@ -252,9 +252,11 @@ export default {
   methods: {
     //   清除所有连线
     clearLine() {
-      this.jsPlumb.deleteEveryConnection(); //清除连线方法
-      this.data = [];
-      sessionStorage.removeItem("LineData");
+        if(!this.TaskModel||this.TaskModel!='ANSWER'){
+            this.jsPlumb.deleteEveryConnection(); //清除连线方法
+            this.data = [];
+            sessionStorage.removeItem("LineData");
+        }
     },
     showPlumb() {
       this.jsPlumb = this.$jsPlumb.getInstance({
@@ -300,36 +302,42 @@ export default {
         for (let j = 0; j < this.curQue.option.length; j++) {
           this.initLeaf(this.curQue.option[j].nodeId, "target");
         }
-      });
+      });    
       this.setjsPlumb(true, true);
       //点击连线
       this.jsPlumb.bind("click", (conn, originalEvent) => {
-        // 删除点击的线
-        this.data.forEach((item, i) => {
-          if (item.source == conn.sourceId) {
-            this.data.splice(i, 1);
+          if(!this.TaskModel||this.TaskModel!='ANSWER'){
+            // 删除点击的线
+            this.data.forEach((item, i) => {
+            if (item.source == conn.sourceId) {
+                this.data.splice(i, 1);
+            }
+            });
+            let node = document.getElementById(conn.sourceId);
+            this.jsPlumb.removeAllEndpoints(node);
+            sessionStorage.setItem("LineData", JSON.stringify(this.data));
+            this.$set(this.curQue, "Bookanswer", JSON.stringify(this.data));
           }
-        });
-        let node = document.getElementById(conn.sourceId);
-        this.jsPlumb.removeAllEndpoints(node);
-        sessionStorage.setItem("LineData", JSON.stringify(this.data));
       });
 
       //连线时触发
       this.jsPlumb.bind("connection", (conn, originalEvent) => {
-        let fig = false;
-        this.data.forEach((item) => {
-          if (item.source == conn.sourceId && item.target == conn.targetId) {
-            fig = true;
+          if(!this.TaskModel||this.TaskModel!='ANSWER'){
+            let fig = false;
+            this.data.forEach((item) => {
+                if (item.source == conn.sourceId && item.target == conn.targetId) {
+                    fig = true;
+                }
+            });
+            if (!fig) {
+                this.data.push({
+                    source: conn.sourceId,
+                    target: conn.targetId,
+                });
+                sessionStorage.setItem("LineData", JSON.stringify(this.data));
+                this.$set(this.curQue, "Bookanswer", JSON.stringify(this.data));
+            }
           }
-        });
-        if (!fig) {
-          this.data.push({
-            source: conn.sourceId,
-            target: conn.targetId,
-          });
-          sessionStorage.setItem("LineData", JSON.stringify(this.data));
-        }
       });
 
       //右键触发
@@ -366,7 +374,13 @@ export default {
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
-    let sData = JSON.parse(sessionStorage.getItem("LineData"));
+    let sData = null
+    if (!this.curQue.Bookanswer) {
+        // sData = JSON.parse(sessionStorage.getItem("LineData"));
+        sData = []
+    }else{
+        sData = JSON.parse(this.curQue.Bookanswer)
+    }
     this.data = [];
     if (sData) {
       this.data = sData;
@@ -397,6 +411,7 @@ export default {
     }
     setTimeout(() => {
       if (this.data.length > 0) {
+          console.log(this.data)
         this.data.forEach((item) => {
           this.jsPlumb.connect({
             source: item.source,
@@ -588,6 +603,11 @@ export default {
   .fuwei {
     margin-top: 16px;
     height: 40px;
+    &.notAllow{
+        >div{
+            cursor: not-allowed;
+        }
+    }
     > div {
       float: right;
       width: 72px;

+ 1 - 3
src/components/Adult/preview/NewWordShow.vue

@@ -205,9 +205,7 @@ export default {
             }
           }
           item.imgarr = newimgarr;
-          if (index == this.curQue.option.length - 1) {
-            this.$forceUpdate();
-          }
+          this.$forceUpdate();
         });
       });
     },

+ 11 - 5
src/components/Adult/preview/SelectTone.vue

@@ -40,7 +40,7 @@
         <a
           v-for="(itmes, indexs) in toneList"
           :key="indexs"
-          :class="['tone-item', userSelect[index] === indexs ? 'active' : '']"
+          :class="['tone-item', curQue.Bookanswer[index] === indexs ? 'active' : '']"
           @click="handleClick(index, indexs)"
         >
           <img :src="itmes" />
@@ -56,7 +56,7 @@ import AudioLine from "../preview/AudioLine.vue";
 
 export default {
   components: { Audio, AudioLine },
-  props: ["curQue", "themeColor"],
+  props: ["curQue", "themeColor","TaskModel"],
   data() {
     return {
       toneList: [
@@ -80,13 +80,18 @@ export default {
     // 处理数据
     handleData() {
       let _this = this;
-      _this.userSelect = [];
+      let userSelect = [];
       _this.curQue.option.forEach((item) => {
-        _this.userSelect.push("");
+        userSelect.push("");
       });
+      if (!this.curQue.Bookanswer) {
+          this.$set(this.curQue, "Bookanswer", userSelect);
+      }
     },
     handleClick(index, indexs) {
-      this.$set(this.userSelect, index, indexs);
+        if(!this.TaskModel||this.TaskModel!='ANSWER'){
+            this.$set(this.curQue.Bookanswer, index, indexs);
+        }
     },
     handleChangeTime(time,edTime) {
       let _this = this;
@@ -122,6 +127,7 @@ export default {
       if(this.timer){
           clearInterval(this.timer);
       }
+      this.handleData()
   },
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {},

+ 21 - 12
src/components/Adult/preview/SelectYinjie.vue

@@ -38,7 +38,7 @@
       <b v-if="item.number">{{ item.number }}</b>
       <div class="zijie-box">
         <p
-          :class="[userList[index].indexOf(indexs) > -1 ? 'active' : '']"
+          :class="[curQue.Bookanswer[index].indexOf(indexs) > -1 ? 'active' : '']"
           v-for="(items, indexs) in item.option"
           :key="indexs"
           @click="handleClick(index, indexs)"
@@ -47,7 +47,7 @@
         </p>
       </div>
       <a
-        :class="['clear-btn', userList[index].length > 0 ? 'active' : '']"
+        :class="['clear-btn', curQue.Bookanswer[index].length > 0 && TaskModel != 'ANSWER' ? 'active' : '',TaskModel == 'ANSWER'?'notAllow':'']"
         @click="handleClear(index)"
       ></a>
     </div>
@@ -59,7 +59,7 @@ import AudioLine from "../preview/AudioLine.vue";
 
 export default {
   components: { AudioLine },
-  props: ["curQue", "themeColor"],
+  props: ["curQue", "themeColor","TaskModel"],
   data() {
     return {
       userList: [],
@@ -73,21 +73,26 @@ export default {
   //方法集合
   methods: {
     handleData() {
-      let _this = this;
+      let userList = [];
       this.curQue.option.forEach((item) => {
-        _this.userList.push([]);
+        userList.push([]);
       });
+      if (!this.curQue.Bookanswer) {
+          this.$set(this.curQue, "Bookanswer", userList);
+      }
     },
     handleClick(index, indexs) {
-      if (this.userList[index].indexOf(indexs) > -1) {
-        this.userList[index].splice(this.userList[index].indexOf(indexs), 1);
-      } else {
-        // this.userList[index].push(indexs);
-        this.$set(this.userList, index, [indexs]);
-      }
+        if(!this.TaskModel||this.TaskModel!='ANSWER'){
+            if (this.curQue.Bookanswer[index].indexOf(indexs) > -1) {
+                this.curQue.Bookanswer[index].splice(this.curQue.Bookanswer[index].indexOf(indexs), 1);
+            } else {
+                // this.userList[index].push(indexs);
+                this.$set(this.curQue.Bookanswer, index, [indexs]);
+            }
+        }
     },
     handleClear(index) {
-      this.$set(this.userList, index, []);
+      this.$set(this.curQue.Bookanswer, index, []);
     },
     getCurTime(curTime) {
       this.curTime = curTime * 1000;
@@ -160,6 +165,7 @@ export default {
     .play-btn {
         width: 16px;
         height: 16px;
+        margin-right: 8px;
         background: url("../../../assets/NPC/play-red.png") center no-repeat;
         background-size: cover;
         &.active {
@@ -208,6 +214,9 @@ export default {
           center no-repeat;
         background-size: 100%;
       }
+      &.notAllow{
+          cursor: not-allowed;
+      }
     }
   }
 }

+ 66 - 45
src/components/Adult/preview/SentenceInput.vue

@@ -99,20 +99,21 @@
                   <!-- 
                     v-model="answerList[indexs].pinyin"
                    -->
-                  <p class="pinyin" v-if="conent.pinyin != '__'">
+                  <p class="pinyin" v-if="conent.pinyin.indexOf('__')==-1">
                     {{ conent.pinyin }}
                   </p>
                 </template>
-                <template v-if="conent.chs == '__'">
-                  <div
-                    contenteditable="true"
+                <template v-if="conent.chs.indexOf('__')>-1">
+                  <EditDiv class="input chs" v-model='curQue.Bookanswer[indexs].answerList[items.detail.resArr[conIndex].inputNumber].chs' :TaskModel="TaskModel"></EditDiv>
+                  <!-- <el-input
                     class="input chs"
-                    v-html="answerList[indexs].chs"
-                    @change="changeAnswerList($event, indexs, 'chs')"
-                    @copy.native.capture.prevent="handleFalse"
-                    @paste.native.capture.prevent="handleFalse"
-                    @cut.native.capture.prevent="handleFalse"
-                  ></div>
+                    type="textarea"
+                    autosize
+                    placeholder="输入"
+                    v-model="curQue.Bookanswer[indexs].answerList[items.detail.resArr[conIndex].inputNumber].chs"
+                    :readonly="TaskModel=='ANSWER'"
+                    maxlength="200">
+                </el-input> -->
                 </template>
                 <template v-else>
                   <p class="chs">
@@ -130,7 +131,7 @@
                     v-html="answerList[indexs].pinyin"
                     @change="changeAnswerList($event, indexs, 'pinyin')"
                   ></div> -->
-                  <p class="pinyin" v-if="conent.pinyin != '__'">
+                  <p class="pinyin" v-if="conent.pinyin.indexOf('__')==-1">
                     {{ conent.pinyin }}
                   </p>
                 </template>
@@ -142,23 +143,23 @@
           <input
             @input="handleInput"
             :class="['item-input']"
-            v-model="curQue.Bookanswer[indexs]"
+            v-model="curQue.Bookanswer[indexs].answer"
             placeholder="输入"
           />
         </template>
         <template v-if="dataType.indexOf('sentence_judge_chs') > -1">
-          <div class="judge-box">
+          <div class="judge-box" :class="[TaskModel == 'ANSWER'?'notAllow':'']">
             <a
               :class="[
                 'right-btn',
-                curQue.Bookanswer[indexs] == 'right' ? 'active' : '',
+                curQue.Bookanswer[indexs].answer == 'right' ? 'active' : '',
               ]"
               @click="handleSelectJudge('right', indexs)"
             ></a>
             <a
               :class="[
                 'error-btn',
-                curQue.Bookanswer[indexs] == 'error' ? 'active' : '',
+                curQue.Bookanswer[indexs].answer == 'error' ? 'active' : '',
               ]"
               @click="handleSelectJudge('error', indexs)"
             ></a>
@@ -168,6 +169,9 @@
           <template v-if="dataType.indexOf('sentence_input_chs') != -1">
             <Soundrecord
               @handleWav="handleWav"
+              :answerRecordList="curQue.Bookanswer[indexs].recordList"
+              :tmIndex="indexs"
+              :TaskModel="TaskModel"
               type="normal"
               v-if="items.IsRecord"
             />
@@ -175,6 +179,9 @@
           <template v-else>
             <Soundrecord
               @handleWav="handleWav"
+              :answerRecordList="curQue.Bookanswer[indexs].recordList"
+              :tmIndex="indexs"
+              :TaskModel="TaskModel"
               type="mini"
               class="luyin-box"
               v-if="items.IsRecord"
@@ -188,9 +195,10 @@
 
 <script>
 import Soundrecord from "../preview/Soundrecord.vue"; // 录音模板
+import EditDiv from "../preview/EditDiv.vue"
 export default {
-  components: { Soundrecord },
-  props: ["curQue"],
+  components: { Soundrecord, EditDiv },
+  props: ["curQue","TaskModel"],
   data() {
     return {
       audio: new Audio(),
@@ -232,36 +240,50 @@ export default {
     handleData() {
       let _this = this;
       this.dataType = [];
+      this.curQue.fn_list.forEach((item) => {
+        if (item.isFn) {
+          _this.dataType.push(item.type);
+        }
+      });
       if (!this.curQue.Bookanswer) {
+        let answerList = []
         let curCorrect = [];
         this.curQue.option.forEach((item) => {
-          curCorrect.push("");
+        if (this.dataType.indexOf("sentence_input_chs") != -1) {
+            answerList = []
+            item.answer.forEach((it) => {
+                answerList.push({
+                    chs: "",
+                    pinyin: "",
+                });
+            });
+        }
+        curCorrect.push({
+            answer: "",
+            recordList: [],
+            answerList: answerList
+          });
         });
         this.$set(this.curQue, "Bookanswer", curCorrect);
       }
-      this.curQue.fn_list.forEach((item) => {
-        if (item.isFn) {
-          _this.dataType.push(item.type);
-        }
-      });
       let curQue = JSON.parse(JSON.stringify(this.curQue));
       curQue.option.forEach((dItem, dIndex) => {
         let paraArr = [];
+        let inputNumber = 0
         dItem.detail.wordsList.forEach((sItem, sIndex) => {
           this.mergeWordSymbol(dItem.detail.wordsList, sItem, sIndex);
           let obj = {
             pinyin: sItem.pinyin,
             chs: sItem.chs,
             isShow: sItem.isShow,
+            inputNumber: sItem.chs.indexOf('__')>-1?inputNumber:''
           };
           paraArr.push(obj);
+          if(sItem.chs.indexOf('__')>-1){
+              inputNumber++
+          }
         });
         this.$set(_this.curQue.option[dIndex].detail, "resArr", paraArr);
-        console.log();
-        if (paraArr.length == 0) {
-          let str = "就那天___";
-          let arrs = str.split(/_{2,}/g);
-        }
       });
     },
     //词和标点合一起
@@ -277,9 +299,14 @@ export default {
     },
     // 判断题选择
     handleSelectJudge(obj, index) {
-      this.$set(this.curQue.Bookanswer, index, obj);
+        if(!this.TaskModel||this.TaskModel!='ANSWER'){
+            this.curQue.Bookanswer[index].answer = obj
+        }
+    },
+    handleWav(list, tmIndex) {
+        tmIndex = tmIndex ? tmIndex : 0;
+        this.$set(this.curQue.Bookanswer[tmIndex], "recordList", list);
     },
-    handleWav(data) {},
     handleDatas(str, type) {
       str = str.trim();
       str = str.replace(/_{2,}/g, "^ ");
@@ -288,12 +315,11 @@ export default {
       let resArr = type == "hanzi" ? str.split("") : str.split(/\s+/);
       return resArr;
     },
-    changeAnswerList(e, index, type) {
+    changeAnswerList(e, index, type, indexs) {
       if (type == "pinyin") {
-        this.answerList[index].pinyin += e.target.innerHTML;
+        this.curQue.Bookanswer[index].answerList[indexs].pinyin += e.target.innerHTML;
       } else {
-        this.answerList[index].chs += e.target.innerHTML;
-        console.log(e.target.innerHTML)
+        this.curQue.Bookanswer[index].answerList[indexs].chs += e.target.innerHTML;
       }
     },
     handleFalse(){
@@ -303,16 +329,6 @@ export default {
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
     this.handleData();
-    if (this.dataType.indexOf("sentence_input_chs") != -1) {
-      this.curQue.option.forEach((item) => {
-        item.answer.forEach((it) => {
-          this.answerList.push({
-            chs: "",
-            pinyin: "",
-          });
-        });
-      });
-    }
   },
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
@@ -400,7 +416,7 @@ export default {
             border-bottom: 1px solid black;
           }
           .pinyin {
-            font-weight: "GB-PINYINOK-B";
+            font-family: "GB-PINYINOK-B";
             font-size: 14px;
             line-height: 130%;
             color: rgba(0, 0, 0, 0.6);
@@ -480,6 +496,11 @@ export default {
       .judge-box {
         display: flex;
         justify-content: center;
+        &.notAllow{
+            a,a.error-btn{
+                cursor: not-allowed;
+            }
+        }
         a {
           width: 32px;
           height: 32px;

+ 9 - 4
src/components/Adult/preview/SentenceListenRead.vue

@@ -109,7 +109,7 @@
           </template>
           <b class="content-en" v-if="items.en">{{ items.en }}</b>
         </div>
-        <Soundrecord @handleWav="handleWav" type="normal" class="luyin-box" />
+        <Soundrecord @handleWav="handleWav" type="normal" class="luyin-box" :answerRecordList="curQue.Bookanswer[index].recordList" :tmIndex="index" :TaskModel="TaskModel" />
       </div>
     </div>
   </div>
@@ -120,7 +120,7 @@ import AudioLine from "../preview/AudioLine.vue";
 import Soundrecord from "../preview/Soundrecord.vue"; // 录音模板
 export default {
   components: { AudioLine, Soundrecord },
-  props: ["curQue", "themeColor"],
+  props: ["curQue", "themeColor", "TaskModel"],
   data() {
     return {
       curTime: 0,
@@ -141,7 +141,9 @@ export default {
       if (!this.curQue.Bookanswer) {
         let curCorrect = [];
         this.curQue.option.forEach((item) => {
-          curCorrect.push("");
+          curCorrect.push({
+              recordList: []
+          });
         });
         this.$set(this.curQue, "Bookanswer", curCorrect);
       }
@@ -179,7 +181,10 @@ export default {
     getCurTime(curTime) {
       this.curTime = curTime * 1000;
     },
-    handleWav(data) {},
+    handleWav(list, tmIndex) {
+        tmIndex = tmIndex ? tmIndex : 0;
+        this.$set(this.curQue.Bookanswer[tmIndex], "recordList", list);
+    },
     //点击播放某个句子
     handleChangeTime(time,edTime) {
       let _this = this;

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

@@ -220,6 +220,7 @@ export default {
       font-family: "robot";
       line-height: 32px;
       margin-right: 4px;
+      flex-shrink: 0;
     }
     .content-box{
         background: #E9E9E9;

+ 14 - 5
src/components/Adult/preview/Single.vue

@@ -24,11 +24,12 @@
             </div>
         </div>
         <ul v-if="itemI.option">
-        <li v-for="(item, index) in itemI.option" :key="index" :class="['option'+itemI.numberList.con,single[indexI]===index?'active':'']">
+        <li v-for="(item, index) in itemI.option" :key="index" :class="['option'+itemI.numberList.con,curQue.Bookanswer[indexI].answer===index?'active':'']">
             <el-radio
-                v-model="single[indexI]"
+                v-model="curQue.Bookanswer[indexI].answer"
                 :label="index"
                 style="margin-right: 0"
+                :readonly="TaskModel=='ANSWER'"
             >
                 <span v-if="item.number">{{item.number}}</span>
                 <p :class="[item.font=='py'?'hasPinyin':item.font=='en'?'hasEn':item.font=='cn'?'hasCn':'']">{{ item.con }}</p>
@@ -51,7 +52,7 @@
             </template> -->
         </li>
         </ul>
-        <Soundrecord @handleWav="handleWav" type="pro" class="luyin-box" v-if="itemI.IsRecord"/>
+        <Soundrecord @handleWav="handleWav" type="pro" class="luyin-box" v-if="itemI.IsRecord" :answerRecordList="curQue.Bookanswer[indexI].recordList" :tmIndex="indexI" :TaskModel="TaskModel"/>
     </div>
     
   </div>
@@ -62,7 +63,7 @@ import Soundrecord from "../preview/Soundrecord.vue"; // 录音模板
 import Audio from "../preview/components/AudioRed.vue"; // 音频播放
 export default {
   components: {Soundrecord, Audio},
-  props: ["curQue","themeColor"],
+  props: ["curQue","themeColor","TaskModel"],
   data() {
     return {
         single:[]
@@ -75,9 +76,17 @@ export default {
     // 处理数据
     handleData(){
         let _this = this
+        let single = []
         _this.curQue.forEach(item => {
-            _this.single.push(null)
+            single.push({
+                answer: "",
+                recordList: [],
+            });
         });
+        if (!this.curQue.Bookanswer) {
+            this.$set(this.curQue, "Bookanswer", single);
+            debugger
+        }
     },
     handleWav(data) {
         

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

@@ -58,12 +58,14 @@
           @keyup.enter="handleReplaceTone($event, indexs)"
           placeholder="输入"
           maxlength="200"
+          :readonly="TaskModel=='ANSWER'"
         />
         <template v-if="items.IsRecord">
           <Soundrecord
             @handleWav="handleWav"
             :answerRecordList="curQue.Bookanswer[indexs].recordList"
             :tmIndex="indexs"
+            :TaskModel="TaskModel"
             type="pro"
             class="luyin-box"
           />
@@ -80,7 +82,7 @@ import AudioLine from "../preview/AudioLine.vue";
 
 export default {
   components: { Soundrecord, Audio, AudioLine },
-  props: ["curQue", "themeColor"],
+  props: ["curQue", "themeColor","TaskModel"],
   data() {
     return {
       resArr: [],

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

@@ -10,7 +10,8 @@
           <template
             v-if="
               curQue.data.file_name.indexOf('png') != -1 ||
-              curQue.data.file_name.indexOf('jpg') != -1
+              curQue.data.file_name.indexOf('jpg') != -1 ||
+              curQue.data.file_name.indexOf('jpeg') != -1
             "
           >
             <img :src="curQue.data.file_url" alt="" />

+ 14 - 1
src/components/Adult/preview/VoiceMatrix.vue

@@ -322,6 +322,9 @@
         @getSelectData="getSelectData"
         @handleParentPlay="pauseOtherAudio"
         @sentPause="sentPause"
+        @handleWav="handleWav"
+        :answerRecordList="curQue.Bookanswer.recordList"
+        :TaskModel="TaskModel"
       />
       <audio-compare
         :style="{ flex: 1 }"
@@ -368,7 +371,7 @@ export default {
     AudioCompare,
     VoiceFullscreen,
   },
-  props: ["curQue", "themeColor"],
+  props: ["curQue", "themeColor", "TaskModel"],
   data() {
     return {
       // 组件id
@@ -468,6 +471,12 @@ export default {
       if (this.$refs.luyin.microphoneStatus) this.$refs.luyin.microphone();
       this.handleParentPlay();
     });
+    if (!this.curQue.Bookanswer) {
+        let bookanswer = {
+            recordList: [],
+        }
+        this.$set(this.curQue, "Bookanswer", bookanswer);
+    }
   },
 
   mounted() {
@@ -783,6 +792,10 @@ export default {
         });
       });
     },
+    handleWav(list, tmIndex) {
+      tmIndex = tmIndex ? tmIndex : 0;
+      this.$set(this.curQue.Bookanswer, "recordList", list);
+    },
   },
 };
 </script>