diff --git a/src/views/Receive/index.vue b/src/views/Receive/index.vue index 9ec2924..27fd8fc 100644 --- a/src/views/Receive/index.vue +++ b/src/views/Receive/index.vue @@ -1,67 +1,121 @@ @@ -656,568 +1469,630 @@ import { getStore, setStore } from "@/util/store"; export default { data() { return { - roleVisible:false, - roleFlag:'0', - roleidx:'', - roleList:[], - dialogFormVisible:false, - dialogFormVisible11:false, - dialogFormVisible12:false, - dialogFormVisible13:false, - texteditorishow:false, - searchisshow:false, - effectiveindex:1, - effectiveitext:'', - form:{ - correctWord: '',//正确词 - cupid: '', - wrongWord: '', // 错词 - customerId:'', - }, - rules: { - correctWord: [ - { required: true, message: '请输入正确词', trigger: 'blur' }, - ], - wrongWord: [ - { required: true, message: '请输入错词', trigger: 'blur' }, - ], - }, + roleVisible: false, + roleFlag: "0", + roleidx: "", + roleList: [], + dialogFormVisible: false, + dialogFormVisible11: false, + dialogFormVisible12: false, + dialogFormVisible13: false, + texteditorishow: false, + searchisshow: false, + effectiveindex: 1, + effectiveitext: "", + form: { + correctWord: "", //正确词 + cupid: "", + wrongWord: "", // 错词 + customerId: "", + }, + rules: { + correctWord: [ + { required: true, message: "请输入正确词", trigger: "blur" }, + ], + wrongWord: [{ required: true, message: "请输入错词", trigger: "blur" }], + }, aplayer: null, aplayerSpeedNum: "1", //点击字体更换 - arr: [],//录音文件列表 + arr: [], //录音文件列表 aplayerId: 0, - aplayerLength: 0,//文件个数 - tablist:[ {name:'全部',}, {name:'A',}, {name:'b',}, {name:'c',},{name:'c',},{name:'c',},{name:'c',},], - roleindex:0, - zhixingcenterindex:0, - - corpusId:0,//录音文件id - fileId:'',//客户id - recordPath:'',//播放src - transcriptionlist:[],//转写内容 - playNow:0, - userinformationlist:{},//客户信息 - kehuyixiangcenterindex:0, - AudioIdx:0,//录音文件顺序 - isd:'', - dshfkjsdkksodofydwfkhwdfkjh:'', - roleindexbiaoji:0, - aplayerSpeedNum:'1',//倍速字体更换 - Getintentionlist:[],//客户意向 - argtextindex:'',//常错词下标 - ratelist:[],//评分集合 - prohibitedlist:[],//违禁集合 - textItself:'',//原词内容 - Acquirecustomerintentlist2:[],//校准列表 - dialogFormtext:false, - optimizetext:[],//文本优化list - optimizeobj:{},//文本优化obj - textarea:'', - textareacuowu:'', - textareaindex:0, - Searchcontent:[], - inputtest:'', - info:{}, - yibiaoji:'', - rec_index_flag:false, - rec_index_addJ:false, - rec_index_wrongword:false, - rec_index_makesure:false, - rec_index_todo:false, - rec_index_receflag:false, - rec_index_textyh:false + aplayerLength: 0, //文件个数 + tablist: [ + { name: "全部" }, + { name: "A" }, + { name: "b" }, + { name: "c" }, + { name: "c" }, + { name: "c" }, + { name: "c" }, + ], + roleindex: 0, + zhixingcenterindex: 0, + + corpusId: 0, //录音文件id + fileId: "", //客户id + recordPath: "", //播放src + transcriptionlist: [], //转写内容 + playNow: 0, + userinformationlist: {}, //客户信息 + kehuyixiangcenterindex: 0, + AudioIdx: 0, //录音文件顺序 + isd: "", + dshfkjsdkksodofydwfkhwdfkjh: "", + roleindexbiaoji: 0, + aplayerSpeedNum: "1", //倍速字体更换 + Getintentionlist: [], //客户意向 + argtextindex: "", //常错词下标 + ratelist: [], //评分集合 + prohibitedlist: [], //违禁集合 + textItself: "", //原词内容 + Acquirecustomerintentlist2: [], //校准列表 + dialogFormtext: false, + optimizetext: [], //文本优化list + optimizeobj: {}, //文本优化obj + textarea: "", + textareacuowu: "", + textareaindex: 0, + Searchcontent: [], + inputtest: "", + info: {}, + yibiaoji: "", + rec_index_flag: false, + rec_index_addJ: false, + rec_index_wrongword: false, + rec_index_makesure: false, + rec_index_todo: false, + rec_index_receflag: false, + rec_index_textyh: false, }; }, - created() { - this.rec_index_flag = this.permissions["rec_index_flag"];//标记顾问 - this.rec_index_addJ = this.permissions["rec_index_addJ"];//加精 - this.rec_index_wrongword = this.permissions["rec_index_wrongword"];//常错词 - this.rec_index_makesure = this.permissions["rec_index_makesure"];//校准 - this.rec_index_todo = this.permissions["rec_index_todo"];//禁忌 - this.rec_index_receflag = this.permissions["rec_index_receflag"];//接待标记 - this.rec_index_textyh = this.permissions["rec_index_textyh"];//文本优化 - + created() { + this.rec_index_flag = this.permissions["rec_index_flag"]; //标记顾问 + this.rec_index_addJ = this.permissions["rec_index_addJ"]; //加精 + this.rec_index_wrongword = this.permissions["rec_index_wrongword"]; //常错词 + this.rec_index_makesure = this.permissions["rec_index_makesure"]; //校准 + this.rec_index_todo = this.permissions["rec_index_todo"]; //禁忌 + this.rec_index_receflag = this.permissions["rec_index_receflag"]; //接待标记 + this.rec_index_textyh = this.permissions["rec_index_textyh"]; //文本优化 }, mounted() { - this.fileId=this.$route.query.flag; - this.AudioIdx=this.$route.query.AudioIdx; + this.fileId = this.$route.query.flag; + this.AudioIdx = this.$route.query.AudioIdx; this.info = getStore({ name: "userInfo" }); - this.init() + this.init(); }, computed: { ...mapGetters(["permissions"]), }, - destroyed(){ - this.aplayer.destroy() + destroyed() { + this.aplayer.destroy(); }, methods: { - editSure(){ - // console.log(this.roleFlag) - // this.optimizetext - // console.log(this.optimizetext[this.roleidx]) - // this.optimizetext[this.roleidx].speaker=this.roleFlag/1+1 - // this.optimizetext[this.roleidx].speaker=2 - // console.log(this.optimizetext[this.roleidx]) - // this.roleVisible=false - let speaker=this.roleFlag/1+1 - // return - let obj={} - obj=Object.assign({},this.optimizetext[this.roleidx]) - obj.onebest=obj.onebest.replace(/<.*?>/ig,"") - let arr=[] - arr.push(obj) - // console.log(arr) - axios({ - url: `autoSR/zk/file/updateRole`, - method: 'post', - data: { - speaker:speaker, - corpusId:this.corpusId, - transferContent:JSON.stringify(arr), - customerId:this.fileId, - } - }).then(res=>{ - this.optimizetext[this.roleidx].speaker=this.roleFlag/1+1 - this.roleVisible=false - }) - }, - //修改角色 - editRole(item,idx){ - // console.log(item,idx) - // console.log(this.roleList) - this.roleFlag=item.speaker-1 - // console.log(this.roleFlag) - this.roleidx=idx - this.roleVisible=true - }, - gojianyi(){ + editSure() { + // console.log(this.roleFlag) + // this.optimizetext + // console.log(this.optimizetext[this.roleidx]) + // this.optimizetext[this.roleidx].speaker=this.roleFlag/1+1 + // this.optimizetext[this.roleidx].speaker=2 + // console.log(this.optimizetext[this.roleidx]) + // this.roleVisible=false + let speaker = this.roleFlag / 1 + 1; + // return + let obj = {}; + obj = Object.assign({}, this.optimizetext[this.roleidx]); + obj.onebest = obj.onebest.replace(/<.*?>/gi, ""); + let arr = []; + arr.push(obj); + // console.log(arr) + axios({ + url: `autoSR/zk/file/updateRole`, + method: "post", + data: { + speaker: speaker, + corpusId: this.corpusId, + transferContent: JSON.stringify(arr), + customerId: this.fileId, + }, + }).then((res) => { + this.optimizetext[this.roleidx].speaker = this.roleFlag / 1 + 1; + this.roleVisible = false; + }); + }, + //修改角色 + editRole(item, idx) { + // console.log(item,idx) + // console.log(this.roleList) + this.roleFlag = item.speaker - 1; + // console.log(this.roleFlag) + this.roleidx = idx; + this.roleVisible = true; + }, + gojianyi() { // console.log(this.$route); - let tag={ - group:[], + let tag = { + group: [], label: "接待详情", - params:{}, - query:this.$route.query, - value:this.$route.fullPath, - } + params: {}, + query: this.$route.query, + value: this.$route.fullPath, + }; // console.log(tag); - this.$store.commit('DEL_TAG', tag) - this.$router.go(-1);//返回上一层 + this.$store.commit("DEL_TAG", tag); + this.$router.go(-1); //返回上一层 + }, + //上一首 + aplayerChange(str) { + this.aplayer.destroy(); + document.querySelector(".center2").scrollTop = 0; + if (str == "add") { + this.aplayerId++; + if (this.aplayerId >= this.aplayerLength) { + this.$message("没有下一首啦"); + this.aplayerId--; + this.bofangchushihua(); + return; + } else { + this.arr[this.aplayerId].audioContent != "" + ? (this.transcriptionlist = JSON.parse( + this.arr[this.aplayerId].audioContent + )) + : (this.transcriptionlist = []); + this.recordPath = this.arr[this.aplayerId].recordPath; + } + } else { + this.aplayerId--; + if (this.aplayerId < 0) { + this.$message("没有上一首啦"); + this.aplayerId++; + this.bofangchushihua(); + return; + } else { + this.arr[this.aplayerId].audioContent != "" + ? (this.transcriptionlist = JSON.parse( + this.arr[this.aplayerId].audioContent + )) + : (this.transcriptionlist = []); + this.recordPath = this.arr[this.aplayerId].recordPath; + } + } + this.bofangchushihua(); + this.aplayer.play(); + }, + //点击播放 + tabseek(item) { + this.centerindex = 0; + let num = parseInt(item.transferContent.bg / 1000); + if (item.corpusId == this.arr[this.aplayerId].id) { + this.aplayer.seek(num); + } else { + let idx = this.arr.findIndex((item1) => item1.id == item.corpusId); + if (idx == -1) { + this.$message("没有此条录音信息"); + } else { + this.aplayerId = idx; + this.aplayer.destroy(); + console.log(idx); + this.transcriptionlist = JSON.parse(this.arr[idx].audioContent); + this.recordPath = this.arr[idx].recordPath; + this.bofangchushihua(); + this.$nextTick(() => { + this.aplayer.audio.currentTime = num; + }); + } + } + this.searchisshow = false; + this.aplayer.play(); }, - //上一首 - aplayerChange(str){ - this.aplayer.destroy() - document.querySelector(".center2").scrollTop=0 - if(str=='add'){ - this.aplayerId++ - if(this.aplayerId>=this.aplayerLength){ - this.$message('没有下一首啦') - this.aplayerId-- - this.bofangchushihua() - return - }else{ - this.arr[this.aplayerId].audioContent!=''?this.transcriptionlist=JSON.parse(this.arr[this.aplayerId].audioContent):this.transcriptionlist=[] - this.recordPath=this.arr[this.aplayerId].recordPath; - } - }else{ - this.aplayerId-- - if(this.aplayerId<0){ - this.$message('没有上一首啦') - this.aplayerId++ - this.bofangchushihua() - return - }else { - this.arr[this.aplayerId].audioContent!=''?this.transcriptionlist=JSON.parse(this.arr[this.aplayerId].audioContent):this.transcriptionlist=[] - this.recordPath=this.arr[this.aplayerId].recordPath; - } - } - this.bofangchushihua() - this.aplayer.play() - }, - //点击播放 - tabseek(item){ - this.centerindex=0; - let num = parseInt(item.transferContent.bg / 1000) - if(item.corpusId==this.arr[this.aplayerId].id){ - this.aplayer.seek(num) - }else{ - let idx=this.arr.findIndex(item1=>item1.id==item.corpusId) - if(idx==-1){ - this.$message('没有此条录音信息') - }else{ - this.aplayerId=idx - this.aplayer.destroy() - console.log(idx) - this.transcriptionlist=JSON.parse(this.arr[idx].audioContent) - this.recordPath=this.arr[idx].recordPath - this.bofangchushihua() - this.$nextTick(()=>{ - this.aplayer.audio.currentTime=num - }) - } - } - this.searchisshow=false; - this.aplayer.play() - }, //点击搜索 - searchtab(){ - this.inputtest=''; - this.Searchcontent=[]; - this.searchisshow=true; + searchtab() { + this.inputtest = ""; + this.Searchcontent = []; + this.searchisshow = true; }, - tabinput(){ - if(this.inputtest==''){ - return - }else { - this.Searchcontent=[]; - this.$api.http.keyWordsMatching({ - keyword:this.inputtest, - customerId:this.fileId - }).then((res) => { - let list=res.data; + tabinput() { + if (this.inputtest == "") { + return; + } else { + this.Searchcontent = []; + this.$api.http + .keyWordsMatching({ + keyword: this.inputtest, + customerId: this.fileId, + }) + .then((res) => { + let list = res.data; // JSON.parse(); - list.map(item=>{ - item.transferContent=JSON.parse(item.transferContent) + list.map((item) => { + item.transferContent = JSON.parse(item.transferContent); - item.text=this.brightKeyword(item.transferContent.onebest) - }) - this.Searchcontent=list; - }) + item.text = this.brightKeyword(item.transferContent.onebest); + }); + this.Searchcontent = list; + }); + } + }, + //替换方法 + brightKeyword(val) { + if (val.indexOf(this.inputtest) !== -1) { + return val.replace( + this.inputtest, + "" + this.inputtest + "" + ); + } else { + return val; } }, - //替换方法 - brightKeyword(val) { - if (val.indexOf(this.inputtest) !== -1) { - return val.replace(this.inputtest, ""+this.inputtest+""); - } else { - return val; - } - }, //文本恢复 - textrestore(){ - this.optimizeobj=[]; - this.optimizetext={}; - this.$api.http.findText({corpusId:this.arr[this.aplayerId].id}).then((res) => { - this.optimizeobj=res.data; - this.optimizetext=JSON.parse(res.data.textContent) - }) + textrestore() { + this.optimizeobj = []; + this.optimizetext = {}; + this.$api.http + .findText({ corpusId: this.arr[this.aplayerId].id }) + .then((res) => { + this.optimizeobj = res.data; + this.optimizetext = JSON.parse(res.data.textContent); + }); }, //保存并更新文本 保存草稿 - savedraft(i){ - this.$api.http.saveText({ - saveType:i, - corpusId:this.arr[this.aplayerId].id, - id:this.optimizeobj.id, - textContent:JSON.stringify(this.optimizetext) - }).then((res) => { - this.dialogFormtext=false; - this.$message.success('优化完成') - if(i==1){ - this.init() - } + savedraft(i) { + this.$api.http + .saveText({ + saveType: i, + corpusId: this.arr[this.aplayerId].id, + id: this.optimizeobj.id, + textContent: JSON.stringify(this.optimizetext), }) - }, + .then((res) => { + this.dialogFormtext = false; + this.$message.success("优化完成"); + if (i == 1) { + this.init(); + } + }); + }, //文本编辑确认 - summunct(){ - this.optimizetext[this.textareaindex].onebest=this.textarea; - this.texteditorishow=false; - }, + summunct() { + this.optimizetext[this.textareaindex].onebest = this.textarea; + this.texteditorishow = false; + }, //文本编辑 - texteditor(item,index){ - this.textarea=''; - this.textareaindex=index; - this.textareacuowu=item.onebest; - this.texteditorishow=true; + texteditor(item, index) { + this.textarea = ""; + this.textareaindex = index; + this.textareacuowu = item.onebest; + this.texteditorishow = true; }, //文本优化删除 - optimdel(i){ - console.log(i) - var that=this; - this.$confirm('此操作将删除该条, 是否继续?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - that.optimizetext.splice(i,1) - this.$message({ - type: 'success', - message: '删除成功!' - }); - }).catch(() => { - // this.$message({ - // type: 'info', - // message: '已取消删除' - // }); + optimdel(i) { + console.log(i); + var that = this; + this.$confirm("此操作将删除该条, 是否继续?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + that.optimizetext.splice(i, 1); + this.$message({ + type: "success", + message: "删除成功!", + }); + }) + .catch(() => { + // this.$message({ + // type: 'info', + // message: '已取消删除' + // }); }); }, //获取文本 - texttap(){ - this.optimizeobj=[]; - this.optimizetext={}; - this.$api.http.findText({corpusId:this.arr[this.aplayerId].id}).then((res) => { - this.optimizeobj=res.data; - this.optimizetext=JSON.parse(res.data.textContent) - this.dialogFormtext=true; - }) + texttap() { + this.optimizeobj = []; + this.optimizetext = {}; + this.$api.http + .findText({ corpusId: this.arr[this.aplayerId].id }) + .then((res) => { + this.optimizeobj = res.data; + this.optimizetext = JSON.parse(res.data.textContent); + this.dialogFormtext = true; + }); }, // 接待标记 - alllogo(){ - if(this.userinformationlist.validInvalid!=0){ - this.$confirm('是否标记为"有效录音"?', "提示", { + alllogo() { + if (this.userinformationlist.validInvalid != 0) { + this.$confirm('是否标记为"有效录音"?', "提示", { confirmButtonText: "确定", cancelButtonText: "取消", type: "warning", - }).then(() => { - this.$api.http.updateValidInvalid({ - id:this.fileId, - validInvalid:0, - invalidReason:'', - houseId:localStorage.getItem('houseId') - }).then((res) => { - this.$message({ - type: "success", - message: "操作成功!", + }) + .then(() => { + this.$api.http + .updateValidInvalid({ + id: this.fileId, + validInvalid: 0, + invalidReason: "", + houseId: localStorage.getItem("houseId"), + }) + .then((res) => { + this.$message({ + type: "success", + message: "操作成功!", + }); + this.init(); }); - this.init() }) - }).catch(() => { - // this.$message({ - // type: "info", - // message: "已取消操作", - // }); - }); - }else{ - this.dialogFormVisible13=true; - } + .catch(() => { + // this.$message({ + // type: "info", + // message: "已取消操作", + // }); + }); + } else { + this.dialogFormVisible13 = true; + } }, //无效标记 - effectiveAdd(){ - if(this.effectiveindex==5){ - if(this.effectiveitext.length==0){ - this.$message({ - type: "error", - message: "备注不能为空!", - }); - return - } - } - this.$api.http.updateValidInvalid({ - id:this.fileId, - validInvalid:'', - validInvalid:1, - invalidReason:Number(this.effectiveindex), - invalidNote:this.effectiveitext, - houseId:localStorage.getItem('houseId') - }).then((res) => { - this.dialogFormVisible13=false; - this.$message({ - type: "success", - message: "操作成功!", - }); - this.init() - }) + effectiveAdd() { + if (this.effectiveindex == 5) { + if (this.effectiveitext.length == 0) { + this.$message({ + type: "error", + message: "备注不能为空!", + }); + return; + } + } + this.$api.http + .updateValidInvalid({ + id: this.fileId, + validInvalid: "", + validInvalid: 1, + invalidReason: Number(this.effectiveindex), + invalidNote: this.effectiveitext, + houseId: localStorage.getItem("houseId"), + }) + .then((res) => { + this.dialogFormVisible13 = false; + this.$message({ + type: "success", + message: "操作成功!", + }); + this.init(); + }); }, //加精華 - Addtodigest(){ + Addtodigest() { var that = this; - if(that.arr[that.aplayerId].status==0){ - that.$confirm("取消加精,是否继续?", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning", - }).then(() => { - that.$api.http.delATD({"carId": that.fileId,}).then((res) => { - that.$message({ - type: "success", - message: "操作成功!", - }); - this.init() + if (that.arr[that.aplayerId].status == 0) { + that + .$confirm("取消加精,是否继续?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", }) - }).catch(() => { - // that.$message({ - // type: "info", - // message: "已取消操作", - // }); - }); - }else{ - that.$confirm("加精,是否继续?", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning", - }).then(() => { - that.$api.http.addATD({"carId": that.fileId,"status": 0,}).then((res) => { - that.$message({ - type: "success", - message: "加精成功!", + .then(() => { + that.$api.http.delATD({ carId: that.fileId }).then((res) => { + that.$message({ + type: "success", + message: "操作成功!", + }); + this.init(); }); - this.init() }) - }).catch(() => { - // that.$message({ - // type: "info", - // message: "已取消加精", - // }); - }); - } + .catch(() => { + // that.$message({ + // type: "info", + // message: "已取消操作", + // }); + }); + } else { + that + .$confirm("加精,是否继续?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + that.$api.http + .addATD({ carId: that.fileId, status: 0 }) + .then((res) => { + that.$message({ + type: "success", + message: "加精成功!", + }); + this.init(); + }); + }) + .catch(() => { + // that.$message({ + // type: "info", + // message: "已取消加精", + // }); + }); + } }, //确认校准 - intentlist2click(){ - let param = { - keywordIds:'', - id: this.fileId, - }; - let str = []; - this.Acquirecustomerintentlist2.map(item => { - item.children.map(item1 => { - if (item1.selected == 0) { - str.push(item1.keywordsId) - } - }) - }); - str = str.join(','); - param.keywordIds = str; - this.$api.http.updateManualCalibration(param).then((res) => { - this.dialogFormVisible12=false; - this.findCARKeywords() - }) + intentlist2click() { + let param = { + keywordIds: "", + id: this.fileId, + }; + let str = []; + this.Acquirecustomerintentlist2.map((item) => { + item.children.map((item1) => { + if (item1.selected == 0) { + str.push(item1.keywordsId); + } + }); + }); + str = str.join(","); + param.keywordIds = str; + this.$api.http.updateManualCalibration(param).then((res) => { + this.dialogFormVisible12 = false; + this.findCARKeywords(); + }); }, // 选择校准 - Edittag(item,item1,index,i){ - if(this.Acquirecustomerintentlist2[index].children[i].selected==0){ - this.Acquirecustomerintentlist2[index].children[i].selected=1; - }else{ - this.Acquirecustomerintentlist2[index].children[i].selected=0; + Edittag(item, item1, index, i) { + if (this.Acquirecustomerintentlist2[index].children[i].selected == 0) { + this.Acquirecustomerintentlist2[index].children[i].selected = 1; + } else { + this.Acquirecustomerintentlist2[index].children[i].selected = 0; } - this.$forceUpdate() + this.$forceUpdate(); }, //获取校准列表 - Acqtap(){ - this.dialogFormVisible12=true; - this.$api.http.findSystemAnalysis({customerId:this.fileId,type:2}).then((res) => { - let newlist=res.data || []; - if(newlist.length==0){ - this.$message.success('暂无数据') - }else{ - newlist.forEach(item1 => { - item1.children.map(item => { - if (item.isInterval == 0) { - item.label = item.name + item.unit + '-' + item.endName + item - .unit; - } else { - item.label = item.name - } - item.value = item.id; - }) - }) - this.Acquirecustomerintentlist2 = newlist - } - }) + Acqtap() { + this.dialogFormVisible12 = true; + this.$api.http + .findSystemAnalysis({ customerId: this.fileId, type: 2 }) + .then((res) => { + let newlist = res.data || []; + if (newlist.length == 0) { + this.$message.success("暂无数据"); + } else { + newlist.forEach((item1) => { + item1.children.map((item) => { + if (item.isInterval == 0) { + item.label = + item.name + item.unit + "-" + item.endName + item.unit; + } else { + item.label = item.name; + } + item.value = item.id; + }); + }); + this.Acquirecustomerintentlist2 = newlist; + } + }); }, + addRole() { + console.log("添加角色"); + this.tablist.push({ + name: String.fromCharCode(this.tablist.length + 64), + }); + this.roleList.push({ + name: String.fromCharCode(this.roleList.length + 65), + }); + }, //标记 - biaoji(){ - this.dialogFormVisible11=true + biaoji() { + this.dialogFormVisible11 = true; }, //取消标记 - unmarktap(){ - this.dialogFormVisible11=false; - this.roleindexbiaoji=this.dshfkjsdkksodofydwfkhwdfkjh; + unmarktap() { + this.dialogFormVisible11 = false; + this.roleindexbiaoji = this.dshfkjsdkksodofydwfkhwdfkjh; }, // 标记选择 - biaojixuanze(index){ - this.roleindexbiaoji=index; + biaojixuanze(index) { + this.roleindexbiaoji = index; }, //确认标记 - subMsg11(){ - var num=this.roleindexbiaoji+1; - this.$api.http.markConsultant({ - speaker:num, - id:this.isd, - customerId:this.fileId, - houseId:localStorage.getItem('houseId') - }).then((res) => { - this.dialogFormVisible11=false; - this.init() - this.biaojiall() - this.$message.success('保存成功') - }) + subMsg11() { + var num = this.roleindexbiaoji + 1; + this.$api.http + .markConsultant({ + speaker: num, + id: this.isd, + customerId: this.fileId, + houseId: localStorage.getItem("houseId"), + }) + .then((res) => { + this.dialogFormVisible11 = false; + this.init(); + this.biaojiall(); + this.$message.success("保存成功"); + }); }, - biaojiall(){ - this.$api.http.toMatchKeywords({ - carId:this.fileId, - }).then((res) => {}) + biaojiall() { + this.$api.http + .toMatchKeywords({ + carId: this.fileId, + }) + .then((res) => {}); }, // 获取用户信息 - init(){ - this.$api.http.personalReceptionRecord({customerId:this.fileId}).then((res) => { - this.userinformationlist=res.data - this.userinformationlist.endTime=this.userinformationlist.endTime.substring(0, 19); - if(this.userinformationlist.calibration==0){ - this.kehuyixiangcenterindex=0; - }else { - this.kehuyixiangcenterindex=1; - } - this.findCARKeywords() - this.findBannedWordsByCusId() - this.Getsthetransliteratecontent() - }) + init() { + this.$api.http + .personalReceptionRecord({ customerId: this.fileId }) + .then((res) => { + this.userinformationlist = res.data; + this.userinformationlist.endTime = + this.userinformationlist.endTime.substring(0, 19); + if (this.userinformationlist.calibration == 0) { + this.kehuyixiangcenterindex = 0; + } else { + this.kehuyixiangcenterindex = 1; + } + this.findCARKeywords(); + this.findBannedWordsByCusId(); + this.Getsthetransliteratecontent(); + }); }, - - - //常错词确认 - subMsg(){ - this.$refs.form.validate((valid)=>{ - if(valid){ - this.dialogFormVisible = false; - let sas=this.textItself.replace(this.form.wrongWord,this.form.correctWord) - this.transcriptionlist[this.argtextindex].onebest=sas; - this.subWrongMsg() - } - }) + subMsg() { + this.$refs.form.validate((valid) => { + if (valid) { + this.dialogFormVisible = false; + let sas = this.textItself.replace( + this.form.wrongWord, + this.form.correctWord + ); + this.transcriptionlist[this.argtextindex].onebest = sas; + this.subWrongMsg(); + } + }); }, //常错词提交 - subWrongMsg(){ - this.$api.http.addCorrectWord({ - correctWord:this.form.correctWord, - cupid:this.form.cupid, - wrongWord: this.form.wrongWord, - customerId:this.fileId, - houseId:localStorage.getItem('houseId') - }).then((res) => { - this.$message.success('保存成功') - }) + subWrongMsg() { + this.$api.http + .addCorrectWord({ + correctWord: this.form.correctWord, + cupid: this.form.cupid, + wrongWord: this.form.wrongWord, + customerId: this.fileId, + houseId: localStorage.getItem("houseId"), + }) + .then((res) => { + this.$message.success("保存成功"); + }); }, //常错词点击 - checkMsg(row,index){ - if(this.rec_index_wrongword==false){ - return + checkMsg(row, index) { + if (this.rec_index_wrongword == false) { + return; } - this.aplayer.pause() - this.form.cupid=this.arr[this.aplayerId].id; - this.textItself=row.onebest; - let onebest=row.onebest; - this.form.wrongWord =onebest.replace(/<.*?>/ig,""); - this.dialogFormVisible=true; - this.argtextindex=index; + this.aplayer.pause(); + this.form.cupid = this.arr[this.aplayerId].id; + this.textItself = row.onebest; + let onebest = row.onebest; + this.form.wrongWord = onebest.replace(/<.*?>/gi, ""); + this.dialogFormVisible = true; + this.argtextindex = index; }, // 销讲词禁忌tab - recordclick(i){ - this.zhixingcenterindex=i; + recordclick(i) { + this.zhixingcenterindex = i; }, // 销讲词折叠 changeshow(index) { - this.ratelist[index].show=!this.ratelist[index].show + this.ratelist[index].show = !this.ratelist[index].show; }, //获取销讲词违禁词 - findBannedWordsByCusId(){ - this.$api.http.findBannedWordsByCusId({cusId:this.fileId}).then((res) => { - let list1=res.data.SalesTalk || []; - let list2=res.data.ProhibitedWords || []; - let level1 = [] // 一级 - list1.forEach(item =>{ - if(item.pid==0){ + findBannedWordsByCusId() { + this.$api.http + .findBannedWordsByCusId({ cusId: this.fileId }) + .then((res) => { + let list1 = res.data.SalesTalk || []; + let list2 = res.data.ProhibitedWords || []; + let level1 = []; // 一级 + list1.forEach((item) => { + if (item.pid == 0) { level1.push({ id: item.marketingId, rate: item.fraction, @@ -1225,13 +2100,13 @@ export default { percent: 0, ratepercent: 0, show: false, - children: [] - }) + children: [], + }); } - }) - list1.forEach(item =>{ - level1.forEach(el=>{ - if(item.pid==el.id){ + }); + list1.forEach((item) => { + level1.forEach((el) => { + if (item.pid == el.id) { if (item.selected == 0) { el.ratepercent += item.fraction; } @@ -1239,184 +2114,195 @@ export default { id: item.id, rate: item.fraction, selected: item.selected, - name: item.name - }) + name: item.name, + }); } - }) - }) - if(level1.length!=0){ + }); + }); + if (level1.length != 0) { level1[0].show = true; } - this.ratelist=level1; - this.prohibitedlist=list2; - }) + this.ratelist = level1; + this.prohibitedlist = list2; + }); }, - //系统分析切换人工校准 - customerofintention(i){ - this.kehuyixiangcenterindex=i; - this.findCARKeywords() + customerofintention(i) { + this.kehuyixiangcenterindex = i; + this.findCARKeywords(); }, //获去系统分析,人工校准 - findCARKeywords(){ - this.Getintentionlist=[] - if(this.kehuyixiangcenterindex==0){ - this.$api.http.findCARKeywords({customerId:this.fileId}).then((res) => { - let newlist=res.data ||[]; - if(newlist.length==0){ - this.Getintentionlist=[]; - return - }else{ - newlist.forEach(item=>{ - item.newchildren=[]; - item.children.forEach(fut=>{ - if(fut.selected==0){ - item.newchildren.push(fut) + findCARKeywords() { + this.Getintentionlist = []; + if (this.kehuyixiangcenterindex == 0) { + this.$api.http + .findCARKeywords({ customerId: this.fileId }) + .then((res) => { + let newlist = res.data || []; + if (newlist.length == 0) { + this.Getintentionlist = []; + return; + } else { + newlist.forEach((item) => { + item.newchildren = []; + item.children.forEach((fut) => { + if (fut.selected == 0) { + item.newchildren.push(fut); } - }) - }) - newlist.forEach(item=>{ - item.children.forEach(chen=>{ - if(chen.isInterval==0){ - chen.name=chen.name+chen.unit+'-'+chen.endName+chen.unit; - }else { - chen.name=chen.name; + }); + }); + newlist.forEach((item) => { + item.children.forEach((chen) => { + if (chen.isInterval == 0) { + chen.name = + chen.name + chen.unit + "-" + chen.endName + chen.unit; + } else { + chen.name = chen.name; } - }) - }) - this.Getintentionlist=newlist + }); + }); + this.Getintentionlist = newlist; } - }) - }else { - this.$api.http.findSystemAnalysis({customerId:this.fileId,type:1}).then((res) => { - if(res.data==null){ - this.Getintentionlist=[]; - return + }); + } else { + this.$api.http + .findSystemAnalysis({ customerId: this.fileId, type: 1 }) + .then((res) => { + if (res.data == null) { + this.Getintentionlist = []; + return; } - res.data.forEach(item=>{ - item.newchildren=[]; - item.children.forEach(fut=>{ - if(fut.selected==0){ - item.newchildren.push(fut) - } - }) - }) - res.data.forEach(item=>{ - item.children.forEach(chen=>{ - if(chen.isInterval==0){ - chen.name=chen.name+chen.unit+'-'+chen.endName+chen.unit; - }else { - chen.name=chen.name; - } - }) - }) - this.Getintentionlist=res.data; - }) - } + res.data.forEach((item) => { + item.newchildren = []; + item.children.forEach((fut) => { + if (fut.selected == 0) { + item.newchildren.push(fut); + } + }); + }); + res.data.forEach((item) => { + item.children.forEach((chen) => { + if (chen.isInterval == 0) { + chen.name = + chen.name + chen.unit + "-" + chen.endName + chen.unit; + } else { + chen.name = chen.name; + } + }); + }); + this.Getintentionlist = res.data; + }); + } }, //获取转写内容和播放列表 - Getsthetransliteratecontent(){ - this.$api.http.findByCusIdcusId({cusId:this.fileId}).then((res) => { - let audopbj=res.data; - this.recordPath=audopbj[this.AudioIdx].recordPath; - audopbj[this.AudioIdx].audioContent!=''?this.transcriptionlist=JSON.parse(audopbj[this.AudioIdx].audioContent):this.transcriptionlist=[] - // this.transcriptionlist=JSON.parse(audopbj[this.AudioIdx].audioContent) - this.tablist=[]; - if(this.userinformationlist.yon==0){ - this.isd=audopbj[this.AudioIdx].id; - for(var i=0;i<=audopbj[this.AudioIdx].speakerNum;i++){ - if(i==0){ - this.tablist.push({ - name:'全部' - }) - }else if(i==1){ - this.tablist.push({ - name:'A' - }) - }else if(i==2){ - this.tablist.push({ - name:'B' - }) - }else if(i==3){ - this.tablist.push({ - name:'C' - }) - }else if(i==4){ - this.tablist.push({ - name:'D' - }) - }else if(i==5){ - this.tablist.push({ - name:'E' - }) - }else if(i==6){ - this.tablist.push({ - name:'F' - }) - }else if(i==7){ - this.tablist.push({ - name:'G' - }) - }else if(i==8){ - this.tablist.push({ - name:'H' - }) - }else if(i==9){ - this.tablist.push({ - name:'I' - }) - }else if(i==10){ - this.tablist.push({ - name:'J' - }) - }else if(i==11){ - this.tablist.push({ - name:'K' - }) - }else if(i==12){ - this.tablist.push({ - name:'L' - }) - }else if(i==13){ - this.tablist.push({ - name:'M' - }) - }else if(i==14){ - this.tablist.push({ - name:'N' - }) - }else if(i==15){ - this.tablist.push({ - name:'O' - }) - }else { - this.tablist.push({ - name:'P' - }) - } - } - this.roleList=this.tablist.slice(1) - if(audopbj[this.AudioIdx].speaker==null){ - this.yibiaoji='未标记' - this.roleindexbiaoji=0; - this.dshfkjsdkksodofydwfkhwdfkjh=0; - }else{ - this.yibiaoji='已标记' - this.tablist[audopbj[this.AudioIdx].speaker].name=this.tablist[audopbj[this.AudioIdx].speaker].name+"顾问"; - this.roleindexbiaoji=audopbj[this.AudioIdx].speaker-1; - this.dshfkjsdkksodofydwfkhwdfkjh=audopbj[this.AudioIdx].speaker-1; - } - } - this.corpusId=audopbj[this.AudioIdx].id; - this.aplayerId=this.AudioIdx; - this.aplayerLength=audopbj.length; - this.arr=res.data; - this.bofangchushihua() - }) + Getsthetransliteratecontent() { + this.$api.http.findByCusIdcusId({ cusId: this.fileId }).then((res) => { + let audopbj = res.data; + this.recordPath = audopbj[this.AudioIdx].recordPath; + audopbj[this.AudioIdx].audioContent != "" + ? (this.transcriptionlist = JSON.parse( + audopbj[this.AudioIdx].audioContent + )) + : (this.transcriptionlist = []); + // this.transcriptionlist=JSON.parse(audopbj[this.AudioIdx].audioContent) + this.tablist = []; + if (this.userinformationlist.yon == 0) { + this.isd = audopbj[this.AudioIdx].id; + for (var i = 0; i <= audopbj[this.AudioIdx].speakerNum; i++) { + if (i == 0) { + this.tablist.push({ + name: "全部", + }); + } else if (i == 1) { + this.tablist.push({ + name: "A", + }); + } else if (i == 2) { + this.tablist.push({ + name: "B", + }); + } else if (i == 3) { + this.tablist.push({ + name: "C", + }); + } else if (i == 4) { + this.tablist.push({ + name: "D", + }); + } else if (i == 5) { + this.tablist.push({ + name: "E", + }); + } else if (i == 6) { + this.tablist.push({ + name: "F", + }); + } else if (i == 7) { + this.tablist.push({ + name: "G", + }); + } else if (i == 8) { + this.tablist.push({ + name: "H", + }); + } else if (i == 9) { + this.tablist.push({ + name: "I", + }); + } else if (i == 10) { + this.tablist.push({ + name: "J", + }); + } else if (i == 11) { + this.tablist.push({ + name: "K", + }); + } else if (i == 12) { + this.tablist.push({ + name: "L", + }); + } else if (i == 13) { + this.tablist.push({ + name: "M", + }); + } else if (i == 14) { + this.tablist.push({ + name: "N", + }); + } else if (i == 15) { + this.tablist.push({ + name: "O", + }); + } else { + this.tablist.push({ + name: "P", + }); + } + } + this.roleList = this.tablist.slice(1); + if (audopbj[this.AudioIdx].speaker == null) { + this.yibiaoji = "未标记"; + this.roleindexbiaoji = 0; + this.dshfkjsdkksodofydwfkhwdfkjh = 0; + } else { + this.yibiaoji = "已标记"; + this.tablist[audopbj[this.AudioIdx].speaker].name = + this.tablist[audopbj[this.AudioIdx].speaker].name + "顾问"; + this.roleindexbiaoji = audopbj[this.AudioIdx].speaker - 1; + this.dshfkjsdkksodofydwfkhwdfkjh = + audopbj[this.AudioIdx].speaker - 1; + } + } + this.corpusId = audopbj[this.AudioIdx].id; + this.aplayerId = this.AudioIdx; + this.aplayerLength = audopbj.length; + this.arr = res.data; + this.bofangchushihua(); + }); }, - tapspagek(i){ - this.roleindex=i; + tapspagek(i) { + this.roleindex = i; }, //播放实例 bofangchushihua() { @@ -1427,9 +2313,10 @@ export default { theme: "#2671E2", audio: [ { - url:this.recordPath, - cover:"https://qufang.oss-cn-beijing.aliyuncs.com/recording/1626251359408.png", - } + url: this.recordPath, + cover: + "https://qufang.oss-cn-beijing.aliyuncs.com/recording/1626251359408.png", + }, ], }); //结束的回调 @@ -1442,50 +2329,53 @@ export default { }); }, //音频播放中 - drawActive(playTime){ - var that=this; - that.playNow=playTime; - $(".center2 .text").each(function(index){ - if(this.dataset.bg { - document.querySelector(".center2").scrollTop=$(".center2 .activecoloc")[0].offsetTop - 380 - }) - }else{ - $(this).removeClass("activecoloc") - } - }); - }, + drawActive(playTime) { + var that = this; + that.playNow = playTime; + $(".center2 .text").each(function (index) { + if (this.dataset.bg < playTime && playTime < this.dataset.ed) { + $(this).addClass("activecoloc"); + that.$nextTick(() => { + document.querySelector(".center2").scrollTop = + $(".center2 .activecoloc")[0].offsetTop - 380; + }); + } else { + $(this).removeClass("activecoloc"); + } + }); + }, //倍速更改 - aplayerSpeed(num){ - this.aplayer.audio.playbackRate=num - this.aplayerSpeedNum=num + aplayerSpeed(num) { + this.aplayer.audio.playbackRate = num; + this.aplayerSpeedNum = num; }, //格式化时间 formatTime(num) { - num = parseInt(num / 1000) + num = parseInt(num / 1000); //格式化时间格式 num = num.toFixed(0); let second = num % 60; - if (second < 10) second = '0' + second; + if (second < 10) second = "0" + second; let min = Math.floor(num / 60); - if (min < 10) min = '0' + min; + if (min < 10) min = "0" + min; return min + ":" + second; }, - //下载 - download(){ - console.log(this.recordPath); - // this.$api.api.filedownload({videoSrc:this.recordPath}).then((res) => { - // console.log(res); - // }) - // window.location.href =this.recordPath - this.exportMethodPost("/autoSR/zk/file/filedownload", "接待详情",{videoSrc:this.recordPath}); - }, + //下载 + download() { + console.log(this.recordPath); + // this.$api.api.filedownload({videoSrc:this.recordPath}).then((res) => { + // console.log(res); + // }) + // window.location.href =this.recordPath + this.exportMethodPost("/autoSR/zk/file/filedownload", "接待详情", { + videoSrc: this.recordPath, + }); + }, exportMethodPost(url, name, data = {}) { axios({ method: "get", url: url, - params:data, + params: data, responseType: "blob", }) .then((res) => { @@ -1520,15 +2410,15 @@ export default { diff --git a/vue.config.js b/vue.config.js index c158c19..006679b 100644 --- a/vue.config.js +++ b/vue.config.js @@ -3,11 +3,11 @@ * https://cli.vuejs.org/zh/config/ */ // const url = 'http://pigx-gateway' -const url = 'http://39.97.167.65:9999' //测试 +// const url = 'http://39.97.167.65:9999' //测试 // const url = 'http://192.168.31.169:9999' //长龙 // const url = 'http://192.168.31.134:9999' //嘉豪 // const url = 'http://192.168.31.100:9999' //王笑 -// const url = 'http://62.234.122.43:9999' //正式 +const url = 'http://62.234.122.43:9999' //正式 const CompressionWebpackPlugin = require('compression-webpack-plugin') const productionGzipExtensions = ['js', 'css']