|  | @@ -48,8 +48,11 @@
 | 
	
		
			
				|  |  |          :datafileList="fileCon.mp3_list"
 | 
	
		
			
				|  |  |          :filleNumber="mp3Number"
 | 
	
		
			
				|  |  |          :uploadType="'mp3'"
 | 
	
		
			
				|  |  | -        :handleMp3Base64="handleChange"
 | 
	
		
			
				|  |  |        />
 | 
	
		
			
				|  |  | +      <!-- 
 | 
	
		
			
				|  |  | +        :handleMp3Base64="handleChange"
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +       -->
 | 
	
		
			
				|  |  |      </div>
 | 
	
		
			
				|  |  |      <div class="adult-book-input-item">
 | 
	
		
			
				|  |  |        <span class="adult-book-lable">功能配置:</span>
 | 
	
	
		
			
				|  | @@ -68,6 +71,9 @@
 | 
	
		
			
				|  |  |          :changeIsPara="changeIsPara"
 | 
	
		
			
				|  |  |        />
 | 
	
		
			
				|  |  |      </div>
 | 
	
		
			
				|  |  | +    <el-button :loading="CreadMp3loading" size="small" @click="CreadMp3"
 | 
	
		
			
				|  |  | +      >生成音频</el-button
 | 
	
		
			
				|  |  | +    >
 | 
	
		
			
				|  |  |      <div class="NPC-Book-Paragraph" v-if="isPara">
 | 
	
		
			
				|  |  |        <Paragraph :curQue="curQue" :isClause="isClause" :sureSeg="sureSeg" />
 | 
	
		
			
				|  |  |      </div>
 | 
	
	
		
			
				|  | @@ -158,6 +164,8 @@ import {
 | 
	
		
			
				|  |  |    prepareTranscribe,
 | 
	
		
			
				|  |  |    getWordTime,
 | 
	
		
			
				|  |  |    compareSenTenceTime,
 | 
	
		
			
				|  |  | +  textCreadMp3,
 | 
	
		
			
				|  |  | +  getContentFile,
 | 
	
		
			
				|  |  |  } from "@/api/ajax";
 | 
	
		
			
				|  |  |  const Base64 = require("js-base64").Base64;
 | 
	
		
			
				|  |  |  import Upload from "../../common/Upload.vue";
 | 
	
	
		
			
				|  | @@ -215,14 +223,72 @@ export default {
 | 
	
		
			
				|  |  |        compareShow: false,
 | 
	
		
			
				|  |  |        compareData: null,
 | 
	
		
			
				|  |  |        compareloading: false,
 | 
	
		
			
				|  |  | +      CreadMp3loading: false,
 | 
	
		
			
				|  |  |      };
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  |    computed: {},
 | 
	
		
			
				|  |  |    watch: {},
 | 
	
		
			
				|  |  |    //方法集合
 | 
	
		
			
				|  |  |    methods: {
 | 
	
		
			
				|  |  | +    // 得到文件流
 | 
	
		
			
				|  |  | +    getfillLiu() {
 | 
	
		
			
				|  |  | +      this.loading = true;
 | 
	
		
			
				|  |  | +      let _this = this;
 | 
	
		
			
				|  |  | +      return new Promise(function (resolve, reject) {
 | 
	
		
			
				|  |  | +        let id = "";
 | 
	
		
			
				|  |  | +        if (_this.curQue.mp3_list[0].id.indexOf("#") != -1) {
 | 
	
		
			
				|  |  | +          id = _this.curQue.mp3_list[0].id.substring(
 | 
	
		
			
				|  |  | +            6,
 | 
	
		
			
				|  |  | +            _this.curQue.mp3_list[0].id.length - 6
 | 
	
		
			
				|  |  | +          );
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +          id = _this.curQue.mp3_list[0].id;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        let Mname = "file_store_manager-GetFileByteBase64Text";
 | 
	
		
			
				|  |  | +        let data = {
 | 
	
		
			
				|  |  | +          file_id: id,
 | 
	
		
			
				|  |  | +        };
 | 
	
		
			
				|  |  | +        getContentFile(Mname, data).then((res) => {
 | 
	
		
			
				|  |  | +          let taskIddata = {
 | 
	
		
			
				|  |  | +            fileName: _this.curQue.mp3_list[0].name,
 | 
	
		
			
				|  |  | +            speechBase64: res.base64_text,
 | 
	
		
			
				|  |  | +            language: "ch",
 | 
	
		
			
				|  |  | +          };
 | 
	
		
			
				|  |  | +          prepareTranscribe(taskIddata).then((res) => {
 | 
	
		
			
				|  |  | +            _this.$set(_this.curQue, "taskId", res.data.taskId);
 | 
	
		
			
				|  |  | +            _this.loading = false;
 | 
	
		
			
				|  |  | +            resolve();
 | 
	
		
			
				|  |  | +          });
 | 
	
		
			
				|  |  | +        });
 | 
	
		
			
				|  |  | +      });
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    // 根据文章生成MP3
 | 
	
		
			
				|  |  | +    CreadMp3() {
 | 
	
		
			
				|  |  | +      let _this = this;
 | 
	
		
			
				|  |  | +      if (!_this.curQue.article) {
 | 
	
		
			
				|  |  | +        _this.$message.warning("请先输入内容,在生成音频");
 | 
	
		
			
				|  |  | +        return;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +      _this.CreadMp3loading = true;
 | 
	
		
			
				|  |  | +      textCreadMp3({
 | 
	
		
			
				|  |  | +        text: _this.curQue.article,
 | 
	
		
			
				|  |  | +      }).then((res) => {
 | 
	
		
			
				|  |  | +        res.data.fileInfo.id = res.data.fileInfo.file_id;
 | 
	
		
			
				|  |  | +        res.data.fileInfo.name = res.data.fileInfo.file_name;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +        let fileList = [res.data.fileInfo];
 | 
	
		
			
				|  |  | +        //this.$set(this.curQue, "mp3_file_base64", res.data.fileBase64);
 | 
	
		
			
				|  |  | +        _this.$set(_this.curQue, "mp3_list", fileList);
 | 
	
		
			
				|  |  | +        _this.CreadMp3loading = false;
 | 
	
		
			
				|  |  | +      });
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  |      // 保存校对
 | 
	
		
			
				|  |  |      saveCompare() {
 | 
	
		
			
				|  |  | +      if (this.compareType == "文字") {
 | 
	
		
			
				|  |  | +        this.compareloading = false;
 | 
	
		
			
				|  |  | +        return;
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  |        this.compareloading = true;
 | 
	
		
			
				|  |  |        compareSenTenceTime({ matchList: JSON.stringify(this.compareData) }).then(
 | 
	
		
			
				|  |  |          (res) => {
 | 
	
	
		
			
				|  | @@ -381,27 +447,29 @@ export default {
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      createWordTime() {
 | 
	
		
			
				|  |  | -      if (this.curQue.taskId) {
 | 
	
		
			
				|  |  | -        let verseList = [];
 | 
	
		
			
				|  |  | -        this.curQue.detail.forEach((item) => {
 | 
	
		
			
				|  |  | -          verseList = verseList.concat(item.sentences);
 | 
	
		
			
				|  |  | -        });
 | 
	
		
			
				|  |  | -        if (verseList.length > 0) {
 | 
	
		
			
				|  |  | -          this.isWordTime = true;
 | 
	
		
			
				|  |  | -          let data = {
 | 
	
		
			
				|  |  | -            taskId: this.curQue.taskId,
 | 
	
		
			
				|  |  | -            verseList: JSON.stringify(verseList),
 | 
	
		
			
				|  |  | -            matchType: "chinese",
 | 
	
		
			
				|  |  | -            language: "ch",
 | 
	
		
			
				|  |  | -          };
 | 
	
		
			
				|  |  | -          getWordTime(data).then((res) => {
 | 
	
		
			
				|  |  | -            this.curQue.wordTime = res.data.result;
 | 
	
		
			
				|  |  | -            this.isWordTime = false;
 | 
	
		
			
				|  |  | +      this.getfillLiu().then(() => {
 | 
	
		
			
				|  |  | +        if (this.curQue.taskId) {
 | 
	
		
			
				|  |  | +          let verseList = [];
 | 
	
		
			
				|  |  | +          this.curQue.detail.forEach((item) => {
 | 
	
		
			
				|  |  | +            verseList = verseList.concat(item.sentences);
 | 
	
		
			
				|  |  |            });
 | 
	
		
			
				|  |  | +          if (verseList.length > 0) {
 | 
	
		
			
				|  |  | +            this.isWordTime = true;
 | 
	
		
			
				|  |  | +            let data = {
 | 
	
		
			
				|  |  | +              taskId: this.curQue.taskId,
 | 
	
		
			
				|  |  | +              verseList: JSON.stringify(verseList),
 | 
	
		
			
				|  |  | +              matchType: "chinese",
 | 
	
		
			
				|  |  | +              language: "ch",
 | 
	
		
			
				|  |  | +            };
 | 
	
		
			
				|  |  | +            getWordTime(data).then((res) => {
 | 
	
		
			
				|  |  | +              this.curQue.wordTime = res.data.result;
 | 
	
		
			
				|  |  | +              this.isWordTime = false;
 | 
	
		
			
				|  |  | +            });
 | 
	
		
			
				|  |  | +          }
 | 
	
		
			
				|  |  | +        } else {
 | 
	
		
			
				|  |  | +          this.$message.warning("请先上传音频");
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -      } else {
 | 
	
		
			
				|  |  | -        this.$message.warning("请先上传音频");
 | 
	
		
			
				|  |  | -      }
 | 
	
		
			
				|  |  | +      });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      againWordTime() {
 | 
	
		
			
				|  |  |        this.isWordTime = false;
 |