Prechádzať zdrojové kódy

修改选择音调的bug

秦鹏 3 rokov pred
rodič
commit
6e72e8d0f6

+ 6 - 5
src/components/Adult/inputModules/ToneSelect.vue

@@ -71,6 +71,7 @@
             :datafileList="curQueItem.mp3_list"
             :filleNumber="mp3Number"
             :uploadType="'mp3'"
+            :index="index"
           />
         </div>
       </div>
@@ -170,9 +171,6 @@ export default {
     ConInput(e) {},
     //   选择声调
     selectTone(oindex, aindex) {
-      this.curQue.option.forEach((item) => {
-        item.answer = null;
-      });
       this.curQue.option[oindex].answer = aindex;
     },
     numberInput(value) {
@@ -184,7 +182,7 @@ export default {
     onBlur(item, field) {
       item[field] = item[field] ? item[field].trim() : "";
     },
-    changeMp3(fileList) {
+    changeMp3(fileList, item, index) {
       console.log(fileList);
       const articleImgList = JSON.parse(JSON.stringify(fileList));
       const articleImgRes = [];
@@ -200,7 +198,10 @@ export default {
         }
       });
       //this.articleImgList = articleImgRes;
-      this.curQueItem.mp3_list = JSON.parse(JSON.stringify(articleImgRes));
+      console.log(index);
+      this.curQue.option[index].mp3_list = JSON.parse(
+        JSON.stringify(articleImgRes)
+      );
     },
     addoption() {
       let leg = this.curQue.option.length;