diff --git a/src/views/Receive/index.vue b/src/views/Receive/index.vue index e9540a1..2b819ad 100644 --- a/src/views/Receive/index.vue +++ b/src/views/Receive/index.vue @@ -415,7 +415,11 @@ > - + 文本优化 -
-
- - - - -
- -
纠正     - 删除 + 删除 { - return value.onebest.match(this.searchText) - }) - } }, destroyed() { this.aplayer.destroy(); @@ -922,27 +902,6 @@ export default { }, methods: { - // searchTextFun(){ - // let arr = this.optimizetext - // if(this.searchText==""){ - // this.optimizetext = arr - // }else{ - // this.optimizetext = this.optimizetext.filter(item=>{ - // return item.onebest.match(this.searchText) - // }) - // } - // let arr = this.optimizetext.filter((item,index)=>{ - // var reg = new RegExp(this.searchText); - // return item.onebest.match(reg); - // }) - // let tempArr = [] - // for (let i = 0; i < arr.length; i++) { - // tempArr.push(arr[i]); - // console.log(tempArr) - // } - // this.optimizetext = tempArr - - // }, // 格式化话术内容 formatAudioList() { let list = this.arr[0].audioContent @@ -1056,7 +1015,7 @@ export default { customerId: this.fileId, }, }).then((res) => { - this.optimizetext1[this.roleidx].speaker = this.roleFlag / 1 + 1; + this.optimizetext[this.roleidx].speaker = this.roleFlag / 1 + 1; this.roleVisible = false; }); }, @@ -1204,7 +1163,6 @@ export default { .then((res) => { this.dialogFormtext = false; this.$message.success("优化完成"); - if (i == 1) { this.init(); } @@ -1212,7 +1170,7 @@ export default { }, //文本编辑确认 summunct() { - this.optimizetext1[this.textareaindex].onebest = this.textarea; + this.optimizetext[this.textareaindex].onebest = this.textarea; this.texteditorishow = false; }, //文本编辑 @@ -1223,7 +1181,7 @@ export default { this.texteditorishow = true; }, //文本优化删除 - optimdel(t,i) { + optimdel(i) { console.log(i); var that = this; this.$confirm("此操作将删除该条, 是否继续?", "提示", { @@ -1232,8 +1190,7 @@ export default { type: "warning", }) .then(() => { - this.optimizetext = this.optimizetext.filter(tt=>tt.onebest!=t.onebest) - this.$forceUpdate() + that.optimizetext.splice(i, 1); this.$message({ type: "success", message: "删除成功!", @@ -1250,14 +1207,12 @@ export default { texttap() { this.optimizeobj = {}; this.optimizetext = []; - this.optimizetextTemp = []; this.$api.http .findText({ corpusId: this.arr[this.aplayerId].id }) .then((res) => { console.log(res, "获取文本"); this.optimizeobj = res.data; this.optimizetext = JSON.parse(res.data.textContent); - this.optimizetextTemp = JSON.parse(res.data.textContent); this.dialogFormtext = true; }); }, @@ -1508,8 +1463,8 @@ export default { }else{ this.$refs.form.validate((valid) => { if (valid) { - // this.form.correctWord = this.form.correctWord.replace(/[^\w\u4e00-\u9fa5]/g,"") - // this.form.wrongWord = this.form.wrongWord.replace(/[^\w\u4e00-\u9fa5]/g,"") + this.form.correctWord = this.form.correctWord.replace(/[^\w\u4e00-\u9fa5]/g,"") + this.form.wrongWord = this.form.wrongWord.replace(/[^\w\u4e00-\u9fa5]/g,"") this.dialogFormVisible = false; let sas = this.textItself.replace( this.form.wrongWord, @@ -1558,12 +1513,6 @@ export default { this.form.wrongWord = onebest.replace(/<.*?>/gi, ""); this.dialogFormVisible = true; this.argtextindex = index; - - this.isNum = false; - let reg = /^[0-9]+$/ - if (reg.test(this.form.wrongWord)) { - this.isNum = true - } }, // 销讲词禁忌tab recordclick(i) { @@ -1856,31 +1805,8 @@ export default { //下载 download() { console.log(this.recordPath); - // window.href = this.recordPath - // this.$api.api.filedownload({videoSrc:this.recordPath}).then((res) => { - // console.log(res); - // }) - // window.location.href = `https://zanyong.hfju.com/autoSR/zk/file/filedownload?videoSrc=${this.recordPath}` - // this.exportMethodPost("/autoSR/zk/file/filedownload", "接待详情", { - // videoSrc: this.recordPath, - // }); - this.downloadMp3(this.recordPath) - }, - - downloadMp3(filePath) { - fetch(filePath).then(res => res.blob()).then(blob => { - const a = document.createElement('a'); - document.body.appendChild(a) - a.style.display = 'none' - // 使用获取到的blob对象创建的url - const url = window.URL.createObjectURL(blob); - a.href = url; - // 指定下载的文件名,就‘’写默认的下载名字。不指定他就根据上传名直接下载了宝。 - a.download = ''; - a.click(); - document.body.removeChild(a) - // 移除blob对象的url - window.URL.revokeObjectURL(url); + this.exportMethodPost("/autoSR/zk/file/filedownload", "接待详情", { + videoSrc: this.recordPath, }); }, exportMethodPost(url, name, data = {}) { @@ -1895,26 +1821,21 @@ export default { let blob = new Blob([res], { type: "audio/*" }); let date = new Date(); let time = date.toLocaleDateString(); - // console.log(time, "时间"); - if ("download" in document.createElement("a")) { - const link = document.createElement("a"); - link.style.display = "none"; - link.href = URL.createObjectURL(blob); - // link.download = res.headers['content-disposition'] //下载后文件名 - link.download = (name || "导出文件") + time + ".mp3"; //下载的文件名 - document.body.appendChild(link); - link.click(); - document.body.removeChild(link); - } else { - // console.log("--------------------jingla") - let fileName = (name || "导出文件") + time + ".mp3"; //下载的文件名 - navigator.msSaveBlob(blob, fileName); - } + + const a = document.createElement('a'); + document.body.appendChild(a) + a.style.display = 'none' + // 使用获取到的blob对象创建的url + const url = window.URL.createObjectURL(res); + a.href = url; + // 指定下载的文件名,就‘’写默认的下载名字。不指定他就根据上传名直接下载了宝。 + a.download = ''; + a.click(); + document.body.removeChild(a) + // 移除blob对象的url + window.URL.revokeObjectURL(url); }) .catch((error) => { - // Message.error({ - // message: '网络连接错误' - // }) console.log(error); }); },