Prechádzať zdrojové kódy

修改teambition种的问题和解决

秦鹏 3 rokov pred
rodič
commit
2bf25947c0

BIN
src/assets/NPC/down.png


BIN
src/assets/NPC/up.png


+ 66 - 15
src/components/Adult/inputModules/Sentence.vue

@@ -27,6 +27,26 @@
             :handleMp3Base64="handleChange"
           />
         </div>
+        <div class="adult-book-input-item">
+          <span class="adult-book-lable">题目lrc:</span>
+          <Upload
+            :changeFillId="changeLrc"
+            :datafileList="curQue.lrc_list"
+            :filleNumber="mp3Number"
+            :uploadType="'lrc'"
+          />
+        </div>
+        <div class="adult-book-input-item">
+          <span class="adult-book-lable"></span>
+          <el-button
+            type="primary"
+            size="small"
+            class="distribution"
+            @click="parseLrcFile"
+          >
+            分配lrc
+          </el-button>
+        </div>
       </template>
       <div
         class="Big-Book-main"
@@ -85,6 +105,7 @@ import {
   createPinyin,
   prepareTranscribe,
   getWordTime,
+  getContentFile,
 } from "@/api/ajax";
 export default {
   name: "Single",
@@ -147,6 +168,8 @@ export default {
         name: "句子模板",
         title: "",
         mp3_list: [],
+        lrc_list: [],
+        lrc_arr: [],
         taskId: "",
         wordTime: [],
         detail: [],
@@ -206,7 +229,7 @@ export default {
         });
         for (let i = 0; i < this.curQue.detail.length; i++) {
           verseList = verseList.concat(
-            `${numberArr[i]}` + this.curQue.detail[i].sentence
+            `${numberArr[i]} ` + this.curQue.detail[i].sentence
           );
         }
         if (verseList.length > 0) {
@@ -231,19 +254,19 @@ export default {
     },
     numberToChinese(num) {
       var AA = new Array(
-        "",
-        "",
-        "",
-        "",
-        "",
-        "",
-        "",
-        "",
-        "",
-        "",
-        ""
+        "ling",
+        "yi",
+        "er",
+        "san",
+        "si",
+        "wu",
+        "liu",
+        "qi",
+        "ba",
+        "jiu",
+        "shi"
       );
-      var BB = new Array("", "十", "百", "仟", "萬", "億", "点", "");
+      var BB = new Array("", "shi", "bai", "qian", "wan", "yi", "dian", "");
       var a = ("" + num).replace(/(^0*)/g, "").split("."),
         k = 0,
         re = "";
@@ -275,8 +298,8 @@ export default {
         re += BB[6];
         for (var i = 0; i < a[1].length; i++) re += AA[a[1].charAt(i)];
       }
-      if (re == "一十") re = "十";
-      if (re.match(/^一/) && re.length == 3) re = re.replace("", "");
+      if (re == "yishi") re = "shi";
+      if (re.match(/^一/) && re.length == 3) re = re.replace("yi", "");
       return re;
     },
     // 上传音频文件
@@ -293,6 +316,34 @@ export default {
         });
       });
     },
+    changeLrc(fileList) {
+      let lrc_list = [];
+      fileList.forEach(({ response, name }) => {
+        if (response) {
+          let fileList = response.file_info_list[0];
+          lrc_list.push({
+            name,
+            duration: fileList.media_duration,
+            url: fileList.file_url,
+            id: "[FID##" + fileList.file_id + "##FID]",
+            file_id: fileList.file_id,
+          });
+        }
+      });
+      this.curQue.lrc_list = lrc_list;
+    },
+    parseLrcFile() {
+      let lrcList = this.curQue.lrc_list;
+      if (lrcList.length === 0) {
+        return this.$message.warning("请先上传lrc文件");
+      }
+      getContentFile("tool-ParseLRCFile", {
+        content_type: "FILE",
+        file_id: this.curQue.lrc_list[0].file_id,
+      }).then(({ lrc_list }) => {
+        this.curQue.lrc_arr = lrc_list;
+      });
+    },
     getBase64(file) {
       return new Promise(function (resolve, reject) {
         let reader = new FileReader();

+ 35 - 6
src/components/Adult/inputModules/UploadControl.vue

@@ -1,12 +1,22 @@
 <!--  -->
 <template>
   <div class="Big-Book-prev-Textdes Tinydemo" v-if="curQue">
-    <UploadView
+    <!-- <UploadView
       :changeFillId="changeFillId"
       :accept="accept"
       :filleNumber="1"
       :fileList="curQue.fileList"
-    />
+    /> -->
+    <div>
+      <div class="uploadBtn">
+        <img
+          style="width: 24px; height: 24px"
+          src="../../../assets/adult/uploadview.png"
+          alt=""
+        />
+        上传文件
+      </div>
+    </div>
     <div class="dv" v-loading="loading" v-if="type == 'upload_control_chs'">
       <div class="main">
         <div class="content">
@@ -75,10 +85,10 @@ export default {
   //方法集合
   methods: {
     remove() {
-      this.data = null;
-      this.curQue.data = null;
-      this.curQue.fileList = [];
-      this.$message.success("删除成功");
+      // this.data = null;
+      // this.curQue.data = null;
+      // this.curQue.fileList = [];
+      // this.$message.success("删除成功");
     },
     changeFillId(fileList, item, index) {
       this.curQue.fileList = JSON.parse(JSON.stringify(fileList));
@@ -163,6 +173,25 @@ export default {
       }
     }
   }
+  .uploadBtn {
+    width: 141px;
+    height: 39px;
+    background: #ffffff;
+    border: 1px solid rgba(0, 0, 0, 0.1);
+    box-sizing: border-box;
+    box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.1);
+    border-radius: 4px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    font-size: 16px;
+    line-height: 150%;
+    color: #000000;
+
+    img {
+      margin-right: 13px;
+    }
+  }
   .main {
     margin-top: 23px;
     width: 477px;

+ 3 - 0
src/components/Adult/preview/DialogueArticleViewChs/NormalModelChs.vue

@@ -38,6 +38,9 @@
           v-for="(item, index) in resArr"
           :key="'detail' + index"
         >
+        <!-- {{curTime}}
+        {{item.timeList[0].bg}}
+        {{item.timeList[item.timeList.length - 1].ed}} -->
           <div :class="['article-content', isHasRemark ? 'hasRemark' : '']">
             <RoleChs :curRole="item.roleDetail" :type="1" />
             <div class="wordsList-box">

+ 2 - 3
src/components/Adult/preview/InputHasRecord.vue

@@ -82,7 +82,7 @@
                             <p :class="['content-con',items.font]" v-if="items.detail.sentence">{{items.detail.sentence}}</p>
                         </template>
                         <template v-else>
-                            <div class="con-box">
+                            <div class="con-box">   
                                 <div :class="['con-item',indexCon===0?'con-item-0':'']" v-for="(itemCon,indexCon) in items.detail.resArr" :key="indexCon" v-show="itemCon.isShow">
                                     <template v-if="items.detail.wordsList[indexCon + 1] && items.detail.wordsList[indexCon + 1].chs && chsFhList.indexOf(items.detail.wordsList[indexCon + 1].chs) > -1">
                                         <div class="synthesis-box">
@@ -106,14 +106,13 @@
                         </template>
                     </div>
                 <div class="inputInner">
-                    <el-input :class="['textarea',items.record?'':'textareaNoRecord']" type="textarea" v-model="textareaCon" placeholder="输入"></el-input>
+                    <el-input :class="['textarea',items.record?'':'textareaNoRecord']" type="textarea" v-model="items.answer" placeholder="输入"></el-input>
                     <div v-if="items.record" class="luyin-inner">
                         <Soundrecord @handleWav="handleWav" type="promax" class="luyin-box"/>
                     </div>
                 </div>
             </div>
       </template>
-      
   </div>
 </template>
 

+ 115 - 113
src/components/Adult/preview/TextInputRecord.vue

@@ -1,25 +1,31 @@
 <!--  -->
 <template>
   <div class="Big-Book-prev-Textdes" v-if="curQue">
-    <h2 v-if="curQue.title">{{curQue.title}}</h2>
+    <h2 v-if="curQue.title">{{ curQue.title }}</h2>
     <ul>
       <li v-for="(items, indexs) in curQue.option" :key="indexs">
-          <Audio
-                :mp3="items.mp3_list.length > 0 ? items.mp3_list[0].url : ''"
-                :themeColor="themeColor"
-                class="audio-play"
-            />
-          <b v-if="items.number">{{ items.number }}</b>
-          <span class="item-con" :class="[items.font]" v-if="items.con">{{items.con}}</span>
-          <input
-                @input="handleInput"
-                :class="['item-input']"
-                v-model="curQue.Bookanswer[indexs]"
-                placeholder="输入"
-            >
-          <template v-if="items.IsRecord">
-              <Soundrecord @handleWav="handleWav" type="promax" class="luyin-box"/>
-          </template>
+        <Audio
+          :mp3="items.mp3_list.length > 0 ? items.mp3_list[0].url : ''"
+          :themeColor="themeColor"
+          class="audio-play"
+        />
+        <b v-if="items.number">{{ items.number }}</b>
+        <span
+          :style="{ width: items.con ? '260px' : '' }"
+          class="item-con"
+          :class="[items.font]"
+          v-if="items.con"
+          >{{ items.con }}</span
+        >
+        <input
+          @input="handleInput"
+          :class="['item-input']"
+          v-model="curQue.Bookanswer[indexs]"
+          placeholder="输入"
+        />
+        <template v-if="items.IsRecord">
+          <Soundrecord @handleWav="handleWav" type="promax" class="luyin-box" />
+        </template>
       </li>
     </ul>
   </div>
@@ -29,41 +35,37 @@
 import Soundrecord from "../preview/Soundrecord.vue"; // 录音模板
 import Audio from "../preview/components/AudioRed.vue"; // 音频播放
 export default {
-  components: {Soundrecord,Audio},
-  props: ["curQue","themeColor"],
+  components: { Soundrecord, Audio },
+  props: ["curQue", "themeColor"],
   data() {
-    return {
-    };
+    return {};
   },
   computed: {},
   watch: {},
   //方法集合
   methods: {
-        // input 输入时
-        handleInput (e) {
-            e.target.value = e.target.value ? e.target.value.trim() : '';
-        },
-        // 处理数据
-        handleData(){
-            // if(!this.curQue.Bookanswer){
-                let curCorrect = [];
-                this.curQue.option.forEach(item => {
-                    curCorrect.push('')
-                });
-                this.$set(this.curQue, "Bookanswer", curCorrect);
-            // }
-        },
-        handleWav(data) {
-        
-        },
+    // input 输入时
+    handleInput(e) {
+      e.target.value = e.target.value ? e.target.value.trim() : "";
+    },
+    // 处理数据
+    handleData() {
+      // if(!this.curQue.Bookanswer){
+      let curCorrect = [];
+      this.curQue.option.forEach((item) => {
+        curCorrect.push("");
+      });
+      this.$set(this.curQue, "Bookanswer", curCorrect);
+      // }
+    },
+    handleWav(data) {},
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
-      this.handleData()
+    this.handleData();
   },
   //生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {
-  },
+  mounted() {},
   beforeCreate() {}, //生命周期 - 创建之前
   beforeMount() {}, //生命周期 - 挂载之前
   beforeUpdate() {}, //生命周期 - 更新之前
@@ -75,82 +77,82 @@ export default {
 </script>
 <style lang='scss' scoped>
 //@import url(); 引入公共css类
-.Big-Book-prev-Textdes{
-    width: 100%;
-    // margin-top: 16px;
-    h2{
-        font-weight: normal;
+.Big-Book-prev-Textdes {
+  width: 100%;
+  // margin-top: 16px;
+  h2 {
+    font-weight: normal;
+    font-size: 16px;
+    line-height: 150%;
+    color: #000000;
+    margin: 0 2px 8px 2px;
+  }
+  ul {
+    display: flex;
+    flex-flow: wrap;
+    justify-content: start;
+    list-style: none;
+    li {
+      width: 100%;
+      background: #ffffff;
+      border: 1px solid rgba(0, 0, 0, 0.1);
+      box-sizing: border-box;
+      border-radius: 8px;
+      display: flex;
+      align-items: center;
+      padding: 8px 8px 8px 16px;
+      margin-bottom: 8px;
+      .audio-play {
+        width: 16px;
+        margin-right: 8px;
+      }
+      > b {
+        width: 24px;
+        line-height: 24px;
+        font-size: 16px;
+        text-align: right;
+        margin-right: 8px;
+        font-weight: 400;
+        color: #000000;
+        font-family: "FZJCGFKTK";
+      }
+      .item-con {
+        min-width: 80px;
         font-size: 16px;
         line-height: 150%;
         color: #000000;
-        margin: 0 2px 8px 2px;
-    }
-    ul{
-        display: flex;
-        flex-flow: wrap;
-        justify-content: start;
-        list-style: none;
-        li{
-            width: 100%;
-            background: #FFFFFF;
-            border: 1px solid rgba(0, 0, 0, 0.1);
-            box-sizing: border-box;
-            border-radius: 8px;
-            display: flex;
-            align-items: center;
-            padding: 8px 8px 8px 16px;
-            margin-bottom: 8px;
-            .audio-play{
-                width: 16px;
-                margin-right: 8px;
-            }
-            >b{
-               width: 24px;
-               line-height: 24px; 
-               font-size: 16px;
-               text-align: right;
-               margin-right: 8px;
-               font-weight: 400;
-               color: #000000;
-               font-family: 'FZJCGFKTK';
-            }
-            .item-con{
-                min-width: 80px;
-                font-size: 16px;
-                line-height: 150%;
-                color: #000000;
-                margin-right: 8px;
-                word-break: break-word;
-                font-family: 'FZJCGFKTK';
-                &.py{
-                    font-family: 'GB-PINYINOK-B';  
-                }
-                &.en{
-                    font-family: 'robot';  
-                }
-            }
-            input{
-                flex: 1;
-                min-width: 150px;
-                border: 1px solid rgba(0, 0, 0, 0.15);
-                box-sizing: border-box;
-                border-radius: 8px;
-                outline: none;
-                height: 40px;
-                padding: 8px;
-                color: #000000;
-                font-size: 16px;
-                line-height: 150%;
-            }
-            .luyin-box{
-                border: 1px solid rgba(0, 0, 0, 0.1);
-                border-radius: 8px;
-                width: 280px;
-                height: 40px;
-                margin-left: 8px;
-                padding: 0 12px;
-            }
+        margin-right: 8px;
+        word-break: break-word;
+        font-family: "FZJCGFKTK";
+        &.py {
+          font-family: "GB-PINYINOK-B";
         }
+        &.en {
+          font-family: "robot";
+        }
+      }
+      input {
+        flex: 1;
+        min-width: 150px;
+        border: 1px solid rgba(0, 0, 0, 0.15);
+        box-sizing: border-box;
+        border-radius: 8px;
+        outline: none;
+        height: 40px;
+        padding: 8px;
+        color: #000000;
+        font-size: 16px;
+        line-height: 150%;
+      }
+      .luyin-box {
+        border: 1px solid rgba(0, 0, 0, 0.1);
+        border-radius: 8px;
+        width: 280px;
+        height: 40px;
+        margin-left: 8px;
+        padding: 0 12px;
+      }
     }
+  }
 }
 </style>

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

@@ -7,14 +7,14 @@
         :accept="accept"
         :filleNumber="1"
       />
-      <div class="uploadBtn" @click="downLoad">
+      <!-- <div class="uploadBtn" @click="downLoad">
         <img
           style="width: 24px; height: 24px"
           src="../../../assets/adult/download.png"
           alt=""
         />
         下载表格
-      </div>
+      </div> -->
     </div>
     <div class="dv" v-loading="loading">
       <div class="main">

+ 6 - 6
src/components/Adult/preview/WordPhrase.vue

@@ -20,12 +20,7 @@
                 src="../../../assets/NPC/down.png"
                 alt=""
               />
-              <img
-                v-else
-                class="rotate"
-                src="../../../assets/NPC/down.png"
-                alt=""
-              />
+              <img v-else src="../../../assets/NPC/up.png" alt="" />
             </div>
           </div>
         </template>
@@ -523,6 +518,11 @@ export default {
         line-height: 16px;
         color: #ffffff;
       }
+      img {
+        width: 16px;
+        height: 16px;
+        margin-left: 4px;
+      }
     }
     img {
       width: 24px;