jyt 2 years ago
parent
commit
dc70c08647
1 changed files with 29 additions and 108 deletions
  1. +29
    -108
      src/views/Receive/index.vue

+ 29
- 108
src/views/Receive/index.vue View File

@@ -415,7 +415,11 @@
>
<el-form :model="form" ref="form" label-width="80px" :rules="rules">
<el-form-item label="常错词" prop="wrongWord">
<el-input v-model="form.wrongWord" :disabled="isNum" maxlength="8" autocomplete="off"></el-input>
<el-input
v-model="form.wrongWord"
maxlength="8"
autocomplete="off"
></el-input>
</el-form-item>
<el-form-item label="正确词" prop="correctWord">
<el-input
@@ -562,22 +566,6 @@
>
文本优化
</div>
<div style="width: 100%; display: flex; height: 32px;justify-content: space-between;padding: 0 15px; margin-bottom: 20px;">
<div style="width: 100%; height: 100%;display: flex;justify-content: center;">
<!-- <input
v-model="searchText"
class="inputclass"
type="text"
placeholder="请输入关键词搜索"
/> -->
<el-input placeholder="请输入关键词搜索" v-model="searchText" style="width:300px">
<el-button slot="append" icon="el-icon-search"></el-button>
</el-input>
</div>
<!-- <div style="height: 100%">
<div class="inputclass2" style="margin: 0 auto;width: 110px;">搜索</div>
</div> -->
</div>
<div
class="center3"
style="
@@ -592,7 +580,7 @@
class="text"
:data-bg="item.bg"
:data-ed="item.ed"
v-for="(item, index) in optimizetext1"
v-for="(item, index) in optimizetext"
:key="index"
:class="{ actRight: item.speaker % 2 == 0 }"
:data-speaker="item.speaker"
@@ -602,7 +590,7 @@
>纠正</span
>
&nbsp; &nbsp;
<span style="cursor: pointer" @click="optimdel(item,index)">删除</span>
<span style="cursor: pointer" @click="optimdel(index)">删除</span>
<span
style="cursor: pointer; margin-left: 10px"
@click="editRole(item, index)"
@@ -777,7 +765,6 @@ import JSZipUtils from "jszip-utils";
import { saveAs } from "file-saver";

export default {
name:"receiveIndex",
data() {
return {
recordsText:[],
@@ -842,7 +829,6 @@ export default {
textItself: "", //原词内容
Acquirecustomerintentlist2: [], //校准列表
dialogFormtext: false,
optimizetextTemp: [], //文本优化list
optimizetext: [], //文本优化list
optimizeobj: {}, //文本优化obj
textarea: "",
@@ -859,9 +845,8 @@ export default {
rec_index_todo: false,
rec_index_receflag: false,
rec_index_textyh: false,
isNum:false,
outSpeechSkillList: [], // 导出话术列表
searchText:"",
};
},
created() {
@@ -882,11 +867,6 @@ export default {
},
computed: {
...mapGetters(["permissions"]),
optimizetext1(){
return this.optimizetext.filter(value => {
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);
});
},


Loading…
Cancel
Save