|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604 |
- <template>
- <view class="translation">
- <!-- 暂时注释,暂缓使用 -->
- <!-- <view style="width: 690rpx;height: 64rpx;margin: 0 auto;margin-top: 30rpx;background: #F2F2F2;border-radius: 32rpx;
- display: flex;align-items: center;" @tap="toKeywordsearch()">
- <image style="width: 28rpx;height: 28rpx;margin-left: 30rpx;" src="/static/images/search.png" mode=""></image>
- <text style="margin-left: 10rpx;color: #999999;font-size: 24rpx;">请输入关键字</text>
- </view> -->
- <view class="top" style="margin-top: 30rpx;">
- <view class="title">
- <view class="call_record_time">{{date}}</view>
- </view>
- <view class="call_record_time_one">接待时长 {{alltimeStr}}
- <u-icon name="list-dot" color="#333" size="48" @click="showFile"></u-icon>
- <view class="audoioyouxiao" @click="alllogo()" v-if="permissions.commonly2">
- {{userlistobj.validInvalidName||''}}
- </view>
- <view class="file-change" v-if="isshowFile">
- <view class="file-item" @click="filechange(item, index)"
- :class="csdFileindex == index ? 'fileactive' : ''" v-for="(item,index) in luyinList"
- :key="index">录音文件{{index+1}}</view>
- </view>
- <view class="diangweitupian" v-if="jiaoseshow">
- <image v-if="status==1" @click="tappick()" style="width: 100%;height: 100%;"
- src="../../static/images/pike.png" mode=""></image>
- <image v-if="status==0" @click="notappick()" style="width: 100%;height: 100%;"
- src="../../static/images/nopike.png" mode=""></image>
- </view>
- </view>
- <zaudio theme="theme4"></zaudio>
- </view>
- <scroll-view :scroll-top="scrollTop" lower-threshold='20px' @scrolltolower="ltolower()"
- :scroll-into-view="scrollId" scroll-y="true" class="text scroll-Y">
- <!-- tab 栏切换 -->
- <view class="tab-box" id="top">
- <view class="yinpinshibie" @click="changeTab(0)" :class="{active: tab==0}">
- 音频识别
- </view>
- <view class="rate" @click="changeTab(1)" :class="{active: tab==1}">
- 评分
- </view>
- </view>
- <!-- 音频识别模块 -->
- <view v-if="tab==0">
- <!-- 聊天记录-->
- <view class="dialog-block" v-for="(dialog,i) in dialogList" :key="i">
- <view :id="'dialog'+i" class="fileName">录音文件
- <!-- {{i+1}} -->
- </view>
- <view class="text" :id="'dialog'+csdFileindex+'text'+item.bg"
- :class="{active: Math.floor(item.bg/1000) <= playNow && Math.floor(item.ed/1000) > playNow && i==0}"
- v-for="(item,index) in dialog.message" :key="index" :data-speaker="item.speaker">
- <view class="avatar">
- <text :style="[SPEAKERSTYLE(item.speaker)]">{{ item.speaker | toCapital }}</text>
- </view>
- <view class="content">
- <view @longpress="changanxiaoguo(item,index,i)" v-html="item.onebest"></view>
- <view class="tankuangcss" v-if="item.isshow">
- <view @click="clickcopy()"
- style="width: 60rpx;font-size: 24rpx;text-align: center;margin-left: 24rpx;">复制
- </view>
- <view @click="Oftenthewrongword()" v-if="permissions.commonly4"
- style="width: 80rpx;font-size: 24rpx;text-align: center;margin-left: 22rpx;">常错词
- </view>
- <view @click="Addtheessence()" v-if="permissions.commonly3"
- style="width: 80rpx;font-size: 24rpx;text-align: center;margin-left: 22rpx;">加精华
- </view>
- <view @click="clickbofang(dialog.backindex,item)"
- style="width: 80rpx;font-size: 24rpx;text-align: center;margin-left: 14rpx;">播放
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- <!-- 评分模块 -->
- <view v-if="tab==1" class="rate-box">
- <view class="title">总执行率 {{totalRate}}%</view>
- <view v-for="(item,index) in ratelist" :key="index" class="u-m-b-14">
- <view class="level1">
- <view class="level-name u-line-1">
- {{item.name}}
- </view>
- <view class="level-progress">
- <view class="color" :style="{width: item.ratepercent/item.rate*100+'%'}"></view>
- </view>
- <view class="level-rate">{{((item.ratepercent/item.rate).toFixed(2)*100).toFixed()}}%</view>
- <image v-if="!item.show" class="arrow rotatearrow" @click="changeshow(item,1)"
- src="/static/images/down.png" mode="" />
- <image v-else class="arrow" @click="changeshow(item,0)" src="/static/images/up.png" mode="" />
- </view>
- <view class="level1-subbox" v-if="item.show">
- <view class="sub-name" v-for="(subitem,i) in item.children" :key="i">
- <view class="subitem-name u-line-1">{{subitem.name}}</view>
- <image class="checkimg" v-if="!subitem.selected" src="/static/images/rate-checked.png"
- mode="" />
- <image class="checkimg" v-else src="/static/images/rate-nocheck.png" mode="" />
- </view>
- </view>
- </view>
- </view>
- </scroll-view>
-
- <!-- 回到顶部 -->
- <view class="backTop" @click="gotoTop">
- <image src="/static/images/backTop.png" mode=""></image>
- </view>
- <!-- 加入常错词 -->
- <view class="zhezhoa" v-if="isshow2" @tap="Cancelout"></view>
-
- <u-modal v-model="isshow2" title="添加常错词" :show-cancel-button="true" @cancel="Cancelout" @confirm="Confirmtheexit">
- <view class="tian-view">
- <viwe class="tian-view-t1"></viwe>
- <viwe class="tian-view-t2">常错词:</viwe>
- <viwe class="tian-view-t3">
- <textarea :auto-height="true" type="text" v-model="thewrongword" :disabled="isNum" class="tian-input" placeholder="请输入" />
- </viwe>
- </view>
- <view class="tian-view" style="margin-bottom: 74rpx;">
- <viwe class="tian-view-t1"></viwe>
- <viwe class="tian-view-t2">正确词:</viwe>
- <viwe class="tian-view-t3">
- <input class="tian-input" v-model="reswrongword" type="text" placeholder="请输入" />
- </viwe>
- </view>
- </u-modal>
-
- <!-- <view class="bounced" v-if="isshow2">
- <view class="tian-view">
- <viwe class="tian-view-t1"></viwe>
- <viwe class="tian-view-t2">常错词:</viwe>
- <viwe class="tian-view-t3">
- <input type="text" v-model="thewrongword" :disabled="isNum" class="tian-input" placeholder="请输入" />
- </viwe>
- </view>
- <view class="tian-view">
- <viwe class="tian-view-t1"></viwe>
- <viwe class="tian-view-t2">正确词:</viwe>
- <viwe class="tian-view-t3">
- <input class="tian-input" v-model="reswrongword" type="text" placeholder="请输入" />
- </viwe>
- </view>
- <view class="bounced3">
- <view class="bounced3-1" @tap="Cancelout">取消</view>
- <view class="bounced3-2" @tap="Confirmtheexit">确认</view>
- </view>
- </view> -->
- <!-- 加精华 -->
- <view class="zhezhoa" v-if="isshow3" @tap="Cancelout2"></view>
- <view class="bounced" v-if="isshow3">
- <view class="jiajinghuatit">加精华</view>
- <view style="width: 100%;text-indent: 20rpx;font-size: 28rpx;">选择标签</view>
- <view class="jiajinghuaview">
- <view class="jighuaview2" v-for="(item,index) in biaoqianlist" :key="index"
- :class="biaoqianindex == index ? 'biaoqiantom' : ''">
- <view class="view1-text" @click="tapbiaoqianclisck(index)">{{item.name}}</view>
- </view>
- </view>
- <view class="bounced3">
- <view class="bounced3-1" @tap="Cancelout2">取消</view>
- <view class="bounced3-2" @tap="Confirmtheexit2">确认</view>
- </view>
- </view>
-
- <view class="zhezhoa" v-if="effective"></view>
- <view class="bounced" v-if="effective">
- <view class="jiajinghuatit">选择</view>
- <view>
- <view class="uni-list">
- <radio-group @change="radioChange">
- <label style="display: flex;align-items: center;font-size: 30rpx;
- width: 94%;height: 80rpx;margin: 0 auto;" v-for="(item, index) in effectiveitems" :key="item.value">
- <view style="margin-top: 2rpx;flex: 1; text-indent: 20rpx;">{{item.name}}</view>
- <view style="width: 80rpx;">
- <radio :value="item.value" :checked="index == effectiveindex" />
- </view>
- </label>
- </radio-group>
- </view>
- <view v-if="effectiveindex==4">
- <textarea class="ffectivetext" v-model="effectiveitext" placeholder="备注" />
- </view>
- </view>
- <view class="bounced3">
- <view class="bounced3-1" @click="effective=false">取消</view>
- <view class="bounced3-2" @click="$noMultipleClicks(effectiveAdd)">确认</view>
- </view>
- </view>
-
- <u-toast ref="uToast" />
- </view>
- </template>
-
- <script>
- var util = require("../../utils/util.js");
- var config = require("../../config");
- import zaudio from '@/components/uniapp-zaudio/zaudio';
- export default {
- components: {
- zaudio
- },
- data() {
- return {
- noClick: true,
- recordPath: "",
- customerId: "",
- luyinList: [], //录音文件
- dialogList: [], //录音识别列表
- csdFileindex: 0,
- isshowFile: false, //录音列表隐藏
- date: "", //年月日
- tab: 0, // 默认是音频识别
- scrollTop: 0,
- scrollId: "",
- playNow: 0,
- alltimeStr: "00:00:00",
- ratelist: [], //评分列表
- totalRate: "",
- thewrongword: "", //错误词
- reswrongword: "", //正确词
- isshow2: false,
- messagelisy: [],
- isshow3: false,
- biaoqianlist: [],
- biaoqianindex: 0,
- changanitem: {},
- duihuawenjianid: "",
- biaoqianid: "",
- status: 0,
- num: 0, //上拉 转写文件下标
- Bnum: 0, //下拉 转写文件下标
- itemobj: {},
- buildingID: '',
- userlistobj: {},
-
- effective: false,
- effectiveindex: '0',
- effectiveitems: [{
- value: '1',
- name: '没电指派无录音',
- checked: true
- },
- {
- value: '2',
- name: '离线指派无录音',
- },
- {
- value: '3',
- name: '系统测试误操作'
- },
- {
- value: '4',
- name: '非接访场景录音'
- },
- {
- value: '5',
- name: '其他'
- }
- ],
- effectiveitext: '',
- textItself: '',
- argtextindex1: 0,
- argtextindex2: 0,
- permissions: {
- commonly2: false,
- commonly3: false,
- commonly4: false,
- },
-
- ACTION: Symbol('zaudios'), // 唯一值区分每个页面的方法
- isPageHide: false, // 是否息屏
- isNum:false
- };
- },
-
-
- onLoad(options) {
- this.status = options.status;
- this.customerId = options.customerId;
- this.itemobj = uni.getStorageSync('searchobj');
- this.stateisshow = options.stateisshow;
-
- this.$zaudio.autoPlay = true
-
- //注意: 不同的回调方法, 相同的业务函数方法名, 不会相互影响;
- this.$zaudio.on('stop', this.ACTION, () => {
- console.log('我是强制暂停或关闭小程序音频浮窗触发的')
- })
- this.$zaudio.on('seek', this.ACTION, (time) => {
- this.sliderChangeComplate(this.TIMEEVENT(time))
- })
- this.$zaudio.on('playing', this.ACTION, (obj) => {
- this.TimeUpdate(this.TIMEEVENT(obj.current))
- })
- this.$zaudio.on('ended', this.ACTION, e => {
- this.$nextTick(() => {
- this.scrollId = "";
- })
- this.qeihuanwenjian()
- })
- this.$zaudio.on('error', this.ACTION, e => {
-
- })
- uni.$on('DETAILSINIT', info => {
- this.init(info)
- })
- },
- onShow() {
- //实时渲染当前的播放状态
- this.$zaudio.syncRender()
- let newmenulist = uni.getStorageSync('weapp_session_Menu_data');
- this.permissions.commonly2 = newmenulist.jdwxbj; //1 接待无效标记 jdwxbj
- this.permissions.commonly3 = newmenulist.swyxal; //1 设为优秀案例 swyxal
- this.permissions.commonly4 = newmenulist.ccc; // 常错词 ccc
- this.buildingID = uni.getStorageSync('buildingID').id;
- if (this.stateisshow == 2) {
- var info = this.itemobj;
- }
- this.gituserlist()
- !this.isPageHide && this.init(info)
- },
-
- onHide() {
- this.isPageHide = true
- },
-
- onUnload() {
- //卸载不需要的业务和获取播放状态的业务,提高页面性能
- this.$zaudio.off('seek', this.ACTION);
- this.$zaudio.off('stop', this.ACTION);
- this.$zaudio.off('playing', this.ACTION);
- this.$zaudio.off('ended', this.ACTION);
- this.$zaudio.off('error', this.ACTION);
- },
-
-
- methods: {
- effectiveAdd() {
- if (this.effectiveindex == 4) {
- if (this.effectiveitext.length == 0) {
- uni.showToast({
- title: '备注不能为空',
- icon: "none",
- duration: 2000
- });
- return
- }
- }
- this.effective = false;
- let parames = {
- id: this.customerId,
- validInvalid: '',
- validInvalid: 1,
- invalidReason: Number(this.effectiveindex) + 1,
- invalidNote: this.effectiveitext
- }
- this.$u.post("/customer/updateValidInvalid", parames).then(res => {
- console.log(res)
- this.gituserlist()
- })
- },
- radioChange(evt) {
- this.effectiveitext = "";
- for (let i = 0; i < this.effectiveitems.length; i++) {
- if (this.effectiveitems[i].value === evt.detail.value) {
- this.effectiveindex = i;
- break;
- }
- }
- },
- //标记
- alllogo() {
- let msg = '';
- var that = this;
- if (this.userlistobj.validInvalid != 0) {
- msg = '是否标记为"有效录音"?';
- uni.showModal({
- title: '提示',
- content: msg,
- success: (res) => {
- if (that.noClick) {
- that.noClick= false;
- if (res.confirm) {
- let parames = {
- id: this.customerId,
- validInvalid: '',
- invalidReason: 0
- }
- if (this.userlistobj.validInvalid == 0) {
- parames.validInvalid = 1;
- } else {
- parames.validInvalid = 0;
- }
- this.$u.post("/customer/updateValidInvalid", parames).then(res => {
- console.log(res)
- this.gituserlist()
- })
- }
- setTimeout(()=> {
- that.noClick= true;
- }, 2000)
-
- }
- }
- });
- } else {
- this.effective = true;
- }
- },
-
- //获取用户信息
- gituserlist() {
- this.$u.get("/matchKeywords/personalReceptionRecord", {
- customerId: this.customerId
- }).then(res => {
- try {
- res.endTime1 = res.endTime.substring(0, 19);
- this.userlistobj = res;
- } catch(e) {
- console.log(e)
- }
- })
- },
- toKeywordsearch() {
- this.stateisshow = 1;
- uni.navigateTo({
- url: '/pages/learning/Keywordsearch?customerId=' + this.customerId + "&status=" + this.status +
- "&skpl=" + "1" + '$UpDateEvent=DETAILSINIT'
- })
- },
-
-
-
- TimeUpdate(currentTime) {
- this.playNow = Number(currentTime)
- if (this.dialogList.length == 0) {
- return
- } else {
- const message = this.dialogList[0].message;
- if (!message) return
- for (let i = 0; i < message.length; i++) {
- if ((Math.floor(message[i].bg / 1000) <= this.playNow && this.playNow < Math.floor(message[i].ed / 1000))) {
- console.log(message[i])
- this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg;
- break;
- }
- if (i < message.length - 1 && Math.floor(message[i].ed / 1000) < this.playNow && this.playNow < Math.floor(message[i + 1].bg / 1000)) {
- this.scrollId = "dialog" + this.csdFileindex + "text" + message[i].bg;
- break;
- }
- }
- }
- this.$forceUpdate()
- },
-
- init(info) {
- const parames = {
- pageNum: 1,
- pageSize: 100,
- query: {
- customerId: this.customerId
- }
- }
- this.$u.post("/corpus/findByPage", parames).then(res => {
- if (res && res.length) {
- let alltime = 1;
- res.forEach(item => {
- item.recordDuration = item.recordDuration / 1
- alltime += item.recordDuration
- })
- this.recordDuration = this.getTime(res[0].recordDuration)
- this.alltimeStr = this.getTime(alltime)
- if (info) {
- res.forEach((item, index) => {
- // console.log(item, '打印音频列表内容')
- if (item.id == info.id) {
- this.luyinList = res;
- this.csdFileindex = index;
- this.recordPath = res[index].recordPath
- this.date = res[index].receptionTime;
- this.isshowFile = false;
- this.getCorpusAnalysis(info);
- var itc = info.bg / 1000
- this.adasdasdasd(itc)
- }
- })
- } else {
- this.recordPath = res[0].recordPath
- this.date = res[0].receptionTime
- this.luyinList = res;
- this.getCorpusAnalysis()
- }
- this.zyAudio()
- }
- })
- },
-
- //搜索跳转
- adasdasdasd(e) {
- this.stepPlay(e)
- },
- //下一页
- ltolower() {
- var lengthcz = this.luyinList.length - 1;
- if (this.num >= lengthcz) {
- uni.showToast({
- title: '到底了',
- icon: 'none',
- duration: 2000
- });
- return
- } else {
- this.num = this.num + 1;
- let obj = {
- corpusId: this.luyinList[this.num].id,
- customerId: this.customerId,
- }
- this.$u.get(config.service.getCorpusAnalysis, obj).then(data => {
- console.log(data)
- if (!data.audioContent) {
- setTimeout(function() {}, 2000);
- } else {
- const jsonInfo = JSON.parse(data.audioContent);
- this.dialogList.push({
- message: jsonInfo,
- backindex: this.num
- });
- this.dialogList.forEach((asd, idx) => {
- asd.message.forEach((qwe, inde) => {
- qwe.isshow = false;
- })
- })
- }
- uni.hideLoading();
- }).catch(e => {
- uni.hideLoading();
- })
- }
- },
-
- // 取消全部加精
- notappick() {
- uni.showModal({
- title: '提示',
- content: '确认取消加精?',
- success: (res) => {
- if (res.confirm) {
- let params = {
- carId: this.customerId,
- }
- this.$u.get(config.service.delATD, params).then(data => {
- console.log(data)
- this.status = 1
- uni.showToast({
- title: data.message,
- duration: 2000
- });
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- },
- //全部加精
- tappick(i) {
- uni.showModal({
- title: '提示',
- content: '确认加精?',
- success: (res) => {
- if (res.confirm) {
- let objdata = {
- "carId": that.customerId, //客户id
- "status": 0,
- "itemId": that.buildingID,
- }
- this.$u.post(config.service.addATD, objdata).then(data => {
- this.status = 0
- uni.showToast({
- title: data.message,
- duration: 2000
- });
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- },
- //标签选择
- tapbiaoqianclisck(index) {
- this.biaoqianindex = index;
- this.biaoqianid = this.biaoqianlist[index].id
- },
- //复制
- clickcopy() {
- var that = this;
- uni.setClipboardData({
- data: that.thewrongword,
- success: function() {
- that.dialogList.forEach(res => {
- res.message.forEach(asd => {
- asd.isshow = false;
- })
- })
- that.$forceUpdate();
- }
- });
- },
- //确认加入常错词
- Confirmtheexit() {
- if(this.reswrongword.length>8 || this.thewrongword.length>8){
- this.$refs.uToast.show({
- title: '正确词错误词不能超过8个字',
- type: 'warning',
- })
- }else{
- let reg = /^[0-9]+$/
- if(reg.test(this.thewrongword)){
- this.$refs.uToast.show({
- title: '错误词不能为纯数字',
- type: 'warning',
- })
- }else{
- if (this.thewrongword) {
- if (this.reswrongword) {
- let parames = {
- customerId: this.customerId,
- cupid: this.luyinList[this.csdFileindex].id,
- wrongWord: this.thewrongword, //错误词
- correctWord: this.reswrongword, //正确词
- translateHtmlContent: this.messagelisy,
-
- }
- this.isshow2 = false;
- let sas = this.textItself.replace(this.thewrongword, this.reswrongword)
- this.dialogList[this.argtextindex1].message[this.argtextindex2].onebest = sas
- this.dialogList.forEach(res => {
- res.message.forEach(asd => {
- asd.isshow = false;
- })
- })
- this.$u.post("/corpus/addCorrectWord", parames).then(data => {
- this.thewrongword = "";
- this.reswrongword = "";
- })
- } else {
- uni.showToast({
- title: '正确值不能为空',
- duration: 2000
- });
- return
- }
- } else {
- uni.showToast({
- title: '错误词不能为空',
- duration: 2000
- });
- return
- }
- }
- }
-
- },
- //取消加入常错词
- Cancelout() {
- this.isshow2 = false;
- this.dialogList.forEach(res => {
- res.message.forEach(asd => {
- asd.isshow = false;
- })
- })
- },
- //加入长错词
- Oftenthewrongword() {
- this.isNum = false;
- this.reswrongword = "";
- this.isshow2 = true;
- let reg = /^[0-9]+$/
- if (reg.test(this.thewrongword)) {
- this.isNum = true
- }
- },
- //加精华
- Addtheessence() {
- this.isshow3 = true;
- this.biaoqianlist = []
- this.$u.post('/addtodigest/findAllYi', {}).then(data => {
- this.biaoqianlist = data
- this.biaoqianlist.unshift({
- name: "逼单话术",
- id: 0
- })
- })
- },
- // 取消加精
- Cancelout2() {
- this.isshow3 = false;
- this.dialogList.forEach(res => {
- res.message.forEach(asd => {
- asd.isshow = false;
- })
- })
- },
- // 确认加精
- Confirmtheexit2() {
- if (this.biaoqianid) {
- this.biaoqianid = this.biaoqianid
- } else {
- this.biaoqianid = 0
- }
- this.isshow3 = false;
- this.dialogList.forEach(res => {
- res.message.forEach(asd => {
- asd.isshow = false;
- })
- })
- let objdata = {
- "carId": this.customerId, //客户id
- "startTime": this.changanitem.bg, //开始时间
- "startFile": this.duihuawenjianid, //对话所在录音文件id
- "endTime": this.changanitem.ed, //结束时间
- "marketingId": this.biaoqianid, //对应一级父id
- "jjTransfer": this.changanitem.onebest, //选中对话
- "status": 1
- }
- this.$u.post(config.service.addATD, objdata).then(data => {
- uni.showToast({
- title: '加精成功',
- duration: 2000
- });
- }).catch(e => {
- uni.showToast({
- title: e.message,
- icon: 'none',
- duration: 2000
- });
- })
- },
- //长按对话
- changanxiaoguo(item, index, i) {
- this.messagelisy = [];
- this.changanitem = {};
- this.duihuawenjianid = "",
- this.dialogList.forEach(res => {
- res.message.forEach(asd => {
- asd.isshow = false;
- })
- })
- this.changanitem = item;
- this.duihuawenjianid = this.luyinList[this.csdFileindex].id;
- this.dialogList[i].message[index].isshow = !this.dialogList[i].message[index].isshow;
- this.textItself = item.onebest;
- let onebest = item.onebest;
- this.thewrongword = onebest.replace(/<.*?>/ig, "");
- this.thewrongword = item.onebest;
- this.messagelisy = this.dialogList[i].message
- this.argtextindex1 = i;
- this.argtextindex2 = index;
- },
- //回到顶部
- gotoTop() {
- this.scrollId = null;
- this.$nextTick(() => {
- this.scrollId = "top";
- })
- },
- //切换tab
- changeTab(type) {
- if (type == 0) {
- this.tab = 0
- } else {
- this.tab = 1;
- this.getRatelist();
- }
- },
- //录音列表显示隐藏
- showFile() {
- this.isshowFile = !this.isshowFile;
- },
-
- //评分上下显隐
- changeshow(item, type) {
- if (type == 1) {
- item.show = true
- } else {
- item.show = false
- }
- },
- // 获取评分
- getRatelist() {
- if (this.ratelist.length == 0) {
- this.$u.get("/customer/findzkMByCusId", {
- cusId: this.customerId
- }).then(res => {
- if (res.length) {
- let level1 = []
- let level2rate = 0
- res.forEach(item => {
- if (item.pid == 0) {
- level1.push({
- id: item.marketingId,
- rate: item.fraction,
- name: item.name,
- sort: item.sort,
- show: false,
- ratepercent: 0,
- children: []
- })
- } else {
- if (item.selected == 0) {
- level2rate += item.fraction
- }
- }
- })
- this.totalRate = level2rate
- res.forEach(subitem => {
- let subitempid = subitem.pid
- level1.forEach(item => {
- if (subitempid == item.id) {
- if (subitem.selected == 0) {
- item.ratepercent += subitem.fraction
- }
- item.children.push({
- id: subitem.id,
- rate: subitem.fraction,
- selected: subitem.selected,
- name: subitem.name
- })
- }
- })
- })
- level1[0].show = true;
- this.ratelist = level1
- }
- setTimeout(function() {
- uni.hideLoading();
- }, 1000);
- })
- }
-
-
- },
-
- // 获取转义后的对话结果
- getCorpusAnalysis(info) {
- this.dialogList = [];
- let obj = {
- corpusId: this.luyinList[this.csdFileindex].id,
- customerId: this.customerId
- }
- this.$u.get(config.service.getCorpusAnalysis, obj).then(data => {
- try {
- const jsonInfo = JSON.parse(data.audioContent);
- // console.log(jsonInfo)
- if (this.luyinList[this.csdFileindex].recordDuration > 360) {
- //拿到总条数
- var stusnum = jsonInfo.length;
- this.dialogList.push({
- message: jsonInfo.splice(0, 80),
- backindex: this.csdFileindex
- });
-
- var auth_timetimer = setInterval(() => {
- stusnum -= 100;
- // console.log("还剩下" + stusnum)
- if (stusnum <= 0) {
- clearInterval(auth_timetimer);
- } else {
- var newlistwang = [];
- newlistwang = jsonInfo.splice(0, 100);
- newlistwang.forEach(item => {
- this.dialogList[0].message.push(item)
- })
- }
- }, 1000);
- } else {
- this.dialogList.push({
- message: jsonInfo,
- backindex: this.csdFileindex
- });
- }
- this.dialogList.forEach((asd, idx) => {
- asd.message.forEach((qwe, inde) => {
- qwe.isshow = false;
- })
- })
- } catch(e) {
- if (data.whetherFinishName == '转写中') {
- uni.showModal({
- title: '提示',
- content: '录音正在转写中,请稍后重试!',
- showCancel: false
- });
- }
- }
- }).catch(e => {
- // if (e.da)
- uni.showModal({
- title: '提示',
- content: '请求数据失败,请重新尝试',
- showCancel: false
- });
- })
- },
- getTime(time) {
- return util.formatSecond(time)
- },
-
- //音频前进回退
- sliderChangeComplate(currentTime) {
- // 暂时没有处理
- // this.$refs.zyAudio.seek(e.detail.value);
- // this.$refs.zyAudio.play();
- },
- //长按点击播放
- clickbofang(dialog, item) {
- this.dialogList.forEach(res => {
- res.message.forEach(asd => {
- asd.isshow = false;
- })
- })
- this.$forceUpdate()
- if (dialog == this.csdFileindex) {
- let time = item.bg / 1000
- this.stepPlay(time);
- return
- } else {
- let time = item.bg / 1000
- this.csdFileindex = dialog;
- this.recordPath = this.luyinList[dialog].recordPath;
- this.date = this.luyinList[dialog].receptionTime;
- this.getCorpusAnalysis()
- this.stepPlay(time);
- }
- },
- // 文件切换播放
- filechange(item, i) {
- this.num = i; //下拉起始位置
- this.Bnum = i;
- this.csdFileindex = i;
- this.recordPath = item.recordPath;
- this.date = item.receptionTime;
- this.isshowFile = false;
- setTimeout(() => {
- this.$zaudio.operate(i)
- }, 50)
- this.getCorpusAnalysis()
- },
- // 自动播放下一个文件
- qeihuanwenjian() {
- // this.$zaudio.paused()
- let index = this.csdFileindex + 1;
- if (index < this.luyinList.length) {
- this.csdFileindex = index;
- this.getCorpusAnalysis()
- let item = this.luyinList[this.csdFileindex];
- let i = this.csdFileindex;
- this.filechange(item, i)
- }
- },
- formatTime(num) {
- //格式化时间格式
- num = num.toFixed(0);
- let second = num % 60;
- if (second < 10) second = '0' + second;
- let min = Math.floor(num / 60);
- if (min < 10) min = '0' + min;
- return min + ":" + second;
- },
- changeEditing() {
- this.dialogList.forEach(res => {
- res.message.forEach(asd => {
- asd.isshow = false;
- })
- })
- },
-
- //录音实例
- zyAudio() {
- let data = this.luyinList.map((item, index) => {
- return {
- src: item.recordPath,
- title: `录音文件${index + 1}`,
- singer: '',
- coverImgUrl: ''
- }
- })
- this.$zaudio.setAudio(data)
- //渲染第一首音频
- this.$zaudio.setRender(0)
-
- setTimeout(() => {
- this.$zaudio.operate()
- }, 150)
- this.$forceUpdate()
- },
-
- // 跳转指定位置播放
- stepPlay(t) {
- this.$zaudio.seek(t)
- if (this.$zaudio.paused) {
- this.$zaudio.operate()
- }
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .ffectivetext {
- width: 85%;
- margin: 10rpx auto;
- height: 100rpx;
- padding: 20rpx;
- border: 1rpx solid #E4F0FF;
- }
-
- .biaoqiantom {
- background-color: #008EF2;
- color: #FFFFFF;
- border: none;
- }
-
- // 表单
- .tian-view {
- width: 570rpx;
- background-color: #FFFFFF;
- border-bottom: 1px solid #ededee;
- display: flex;
- min-height: 96rpx;
-
- .tian-view-t1 {
- width: 20rpx;
- font-size: 34rpx;
- height: 34rpx;
- line-height: 110rpx;
- letter-spacing: 0px;
- color: red;
- }
-
- .tian-view-t2 {
- width: 30%;
- min-height: 96rpx;
- line-height: 96rpx;
- font-size: 34rpx;
- color: #333;
- }
-
- .tian-view-t3 {
- width: 61%;
- padding-top: 31rpx;
- padding-bottom: 31rpx;
- display: flex;
-
- .tian-input {
- width: 98%;
- font-size: 34rpx;
- border: none;
- }
- }
- }
-
- .zhezhoa {
- position: fixed;
- top: 0;
- left: 0;
- z-index: 999;
- width: 100%;
- height: 100vh;
- opacity: 0.5;
- background-color: #666666;
- }
-
- .bounced {
- width: 570rpx;
- background: #FFFFFF;
- z-index: 1000;
- border-radius: 10rpx;
- position: fixed;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
-
- /* 50%为自身尺寸的一半 */
- .jiajinghuatit {
- width: 100%;
- height: 68rpx;
- font-size: 30rpx;
- text-align: center;
- line-height: 68rpx;
- }
-
- .jiajinghuaview {
- padding: 18rpx 18rpx 18rpx 18rpx;
- display: flex;
- flex-wrap: wrap;
- height: 50vh;
- overflow-y: scroll;
-
- .jiajinghuaview1 {
- padding: 8rpx 8rpx 8rpx 8rpx;
- font-size: 26rpx;
- border-radius: 12rpx;
- border: 1px solid #979797;
- margin-left: 8rpx;
- }
-
- .jighuaview2 {
- padding: 8rpx 18rpx 8rpx 18rpx;
- font-size: 26rpx;
- border-radius: 12rpx;
- border: 1px solid #979797;
- margin-left: 20rpx;
- margin-top: 10rpx;
- display: flex;
-
- .view1-text {
- text-align: center;
- }
-
- .view1-img {
- width: 50rpx;
- }
- }
- }
-
- .bounced3 {
- height: 100rpx;
- width: 100%;
- margin-top: 40rpx;
- border-top: 1px solid #dddddd;
- display: flex;
- }
-
- .bounced3-1 {
- width: 50%;
- height: 100%;
- text-align: center;
- line-height: 100rpx;
- border-right: 1px solid #dddddd;
- font-size: 36rpx;
- color: #999999;
- }
-
- .bounced3-2 {
- width: 50%;
- height: 100%;
- text-align: center;
- line-height: 100rpx;
- font-size: 36rpx;
- color: #108ee9;
- }
- }
-
- .translation {
- padding-left: 30rpx;
- padding-right: 30rpx;
- background: #FFFFFF;
- display: flex;
- flex-direction: column;
- height: 100vh;
- }
-
- .translation .top {
- margin: 0 -30rpx;
- padding: 0 30rpx;
- background: #ffffff;
- border-bottom: 1rpx solid #F2F2F2;
- padding-bottom: 10rpx;
- }
-
- .translation .top .title {
- display: flex;
- justify-content: space-between;
-
- .hash {
- color: rgba(21, 144, 233, 1);
- font-size: 24rpx;
- }
- }
-
- .call_record_time {
- height: 44rpx;
- font-size: 28rpx;
- font-weight: 600;
- color: #008EF2;
- line-height: 44rpx;
- }
-
- .call_record_time_one {
- height: 48rpx;
- font-size: 24rpx;
- font-weight: 500;
- color: #70798d;
- line-height: 48rpx;
- display: flex;
- justify-content: space-between;
- position: relative;
-
- .audoioyouxiao {
- height: 46rpx;
- position: absolute;
- top: 0rpx;
- right: 140rpx;
- font-size: 30rpx;
- }
-
- .diangweitupian {
- width: 46rpx;
- height: 46rpx;
- position: absolute;
- top: 0rpx;
- right: 75rpx;
- }
-
- .file-change {
- position: absolute;
- top: 50rpx;
- right: 0rpx;
- width: 184rpx;
- background: #FFFFFF;
- box-shadow: 0rpx 0rpx 6rpx 2rpx rgba(230, 230, 230, 0.5);
- border-radius: 4rpx;
- z-index: 99;
- height: auto;
- max-height: 600rpx;
- overflow: auto;
- }
-
- .file-item {
- width: 184rpx;
- height: 60rpx;
- line-height: 60rpx;
- text-align: center;
- font-size: 30rpx;
- font-weight: 400;
- color: #333333;
- border-bottom: 1rpx solid #E2E2E2;
- }
-
- .file-item:last-child {
- border: 0
- }
-
- .fileactive {
- color: #008EF2
- }
- }
-
- .audio-container {
- width: 100%;
- display: flex;
- justify-content: space-between;
- align-items: center;
-
- .audio-head {
- width: 60rpx;
- height: 60rpx;
- flex-shrink: 0;
- }
-
- .audio-head .image {
- width: 100%;
- height: 100%;
- }
-
- .audio-slider {
- width: 96%;
- position: relative;
- padding: 2px 0rpx 0px 20px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
-
- .audio-slider .slider {
- width: 100%;
- padding: 0px 15rpx;
- box-sizing: border-box;
- }
-
- .audio-time {
- width: 110rpx;
- text-align: right;
- font-size: 24rpx;
- line-height: 28rpx;
- color: #70798D;
- display: flex;
- justify-content: space-between;
- }
-
- .audio-play {
- width: 40rpx;
- height: 40rpx;
- flex-shrink: 0;
- }
-
- .audio-play .image {
- width: 100%;
- height: 100%;
- }
- }
-
- .scroll-Y {
- font-size: 36rpx;
- color: #999999;
- background: #FFFFFF;
- margin-top: 30rpx;
- flex: 1;
- overflow-y: scroll;
- width: 100%;
- }
-
- .scroll-Y .text {
- margin: 50rpx 30rpx;
- line-height: 80rpx;
- display: flex;
- align-items: center;
- }
-
- .scroll-Y .text[data-speaker="2"],
- .scroll-Y .text[data-speaker="4"],
- .scroll-Y .text[data-speaker="6"] {
- flex-direction: row-reverse;
- text-align: right;
-
- .content {
- margin-left: 0;
- margin-right: 30rpx;
- }
- }
-
- .scroll-Y .text .avatar {
- width: 64rpx;
- height: 64rpx;
- line-height: 64rpx;
- text-align: center;
- font-size: 36rpx;
- border-radius: 50%;
- background: #F2F2F2;
- color: #008EF2;
-
- }
-
- .scroll-Y .text .content {
- margin-left: 30rpx;
- line-height: 60rpx;
- text-align: left;
- padding: 0 5px;
- background: #F6F6F6;
- border-radius: 8rpx;
- max-width: 442rpx;
- color: #999;
- position: relative;
-
- .tankuangcss {
- position: absolute;
- top: -140rpx;
- left: -120rpx;
- width: 308rpx;
- height: 130rpx;
- background-color: #333333;
- font-size: 24rpx;
- color: #FFFFFF;
- padding-top: 4rpx;
- padding-bottom: 4rpx;
- display: flex;
- flex-wrap: wrap;
- border-radius: 15rpx;
- z-index: 1000;
- }
- }
-
- .scroll-Y .text.active .content {
- color: #FF7538 !important;
- position: relative;
- }
-
- .scroll-Y .text.active[data-speaker="2"] .content,
- .scroll-Y .text.active[data-speaker="4"] .content,
- .scroll-Y .text.active[data-speaker="6"] .content {
- color: #FF7538 !important;
- position: relative;
- }
-
- .scroll-Y .isGreen .contentInfo .contentMain .content {
- background: #2BC805 !important;
- color: #FFFFFF;
- }
-
- .tab-box {
- width: 100%;
- display: flex;
- justify-content: center;
- align-items: center;
-
- .yinpinshibie {
- width: 156rpx;
- height: 50rpx;
- font-size: 36rpx;
- font-weight: 400;
- color: #333333;
- text-align: center;
- line-height: 50rpx;
- letter-spacing: 2rpx;
- margin-right: 188rpx;
-
- &.active {
- position: relative;
-
- &::after {
- position: absolute;
- content: '';
- width: 119rpx;
- height: 8rpx;
- background: #008EF2;
- border-radius: 4rpx;
- top: 50rpx;
- right: 0;
- left: 0;
- margin: 0 auto;
- }
- }
- }
-
- .rate {
- width: 156rpx;
- height: 50rpx;
- font-size: 36rpx;
- font-weight: 400;
- color: #333333;
- line-height: 50rpx;
- letter-spacing: 2rpx;
- text-align: center;
-
- &.active {
- position: relative;
-
- &::after {
- position: absolute;
- content: '';
- width: 119rpx;
- height: 8rpx;
- background: #008EF2;
- border-radius: 4rpx;
- top: 50rpx;
- right: 0;
- left: 0;
- margin: 0 auto;
- }
- }
- }
- }
-
- .backTop {
- width: 60rpx;
- height: 60rpx;
- background: rgba(211, 235, 253, 1);
- box-shadow: 0rpx 0rpx 2rpx 4rpx rgba(38, 161, 255, 0.04);
- border-radius: 50%;
- position: fixed;
- bottom: 200rpx;
- right: 8rpx;
- display: flex;
- justify-content: center;
- align-items: center;
-
- image {
- width: 26rpx;
- height: 34rpx;
- }
- }
-
- // 评分
- .rate-box {
- padding: 10rpx 20rpx;
-
- .date {
- width: 300rpx;
- height: 33rpx;
- font-size: 24rpx;
- font-weight: 400;
- color: #333333;
- line-height: 33rpx;
- letter-spacing: 1rpx;
- margin-bottom: 8rpx;
- }
-
- .title {
- width: 100%;
- height: 42rpx;
- font-size: 30rpx;
- font-weight: 500;
- color: #333333;
- line-height: 42rpx;
- letter-spacing: 2rpx;
- margin-bottom: 20rpx;
- }
-
- .level1 {
- display: flex;
- align-items: center;
-
- .level-name {
- width: 104rpx;
- height: 33rpx;
- font-size: 24rpx;
- font-weight: 500;
- color: #333333;
- line-height: 33rpx;
- letter-spacing: 1rpx;
- margin-right: 10rpx;
- }
-
- .level-progress {
- flex: 1;
- border-radius: 11rpx;
- height: 21rpx;
- background-color: #BEE4FF;
- position: relative;
-
- .color {
- width: 0;
- position: absolute;
- top: 0;
- left: 0;
- height: 21rpx;
- border-radius: 11rpx 0 0 11rpx;
- background-color: #008EF2;
- }
- }
-
- .level-rate {
- width: 65rpx;
- height: 33rpx;
- font-size: 24rpx;
- font-weight: 500;
- color: #333333;
- line-height: 33rpx;
- letter-spacing: 1rpx;
- margin: 0 20rpx 0 15rpx;
- }
-
- .arrow {
- width: 37rpx;
- height: 21rpx;
- padding: 5rpx 20rpx;
- }
-
- .rotatearrow {
- transform: rotate(270deg);
- }
- }
-
- .level1-subbox {
- display: flex;
- margin-top: 20rpx;
- flex-wrap: wrap;
-
- .sub-name {
- width: 50%;
- display: flex;
- margin-bottom: 18rpx;
-
- .subitem-name {
- width: 104rpx;
- height: 33rpx;
- font-size: 24rpx;
- font-weight: 400;
- color: #999999;
- line-height: 33rpx;
- letter-spacing: 1rpx;
- margin-right: 12rpx;
- }
-
- .checkimg {
- width: 27rpx;
- height: 27rpx;
- }
- }
- }
- }
-
- .dialog-block {
- margin: 20rpx 0;
- border-bottom: 1px solid #ccc;
-
- .fileName {
- text-align: center;
- margin: 10rpx auto;
- width: 115rpx;
- height: 42rpx;
- line-height: 42rpx;
- background: #EFEFEF;
- border-radius: 4rpx;
- font-size: 20rpx;
- font-weight: 400;
- color: #333333;
- }
- }
- /deep/ .u-model-title{
- padding: 34rpx 0 16rpx !important;
- }
- </style>
|