From 2aae7d66b8b4d4f457eb413deb4c40d8e0019c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E7=BB=A7=E7=BB=AD=E5=90=B9?= <17611323298@163.com> Date: Mon, 26 Jun 2023 14:52:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/mine/details2.vue | 106 ++++++++++++++++++++++------------------ 1 file changed, 59 insertions(+), 47 deletions(-) diff --git a/pages/mine/details2.vue b/pages/mine/details2.vue index cd4d280..d5193fa 100644 --- a/pages/mine/details2.vue +++ b/pages/mine/details2.vue @@ -63,11 +63,11 @@ 常错词 + @click="publicEvents('sureRefinement')"> 加精华 - + 修改角色 @@ -132,7 +132,7 @@ @@ -197,9 +197,8 @@ 标记为顾问 - + {{item.name}} @@ -673,6 +672,7 @@ prohibitedlist: [], guanjianciishow: false, tablist: [], + tablists: [], // 角色列表 roleindex: 0, roleSelectArr: [0], // 当前选中的角色标记点 @@ -708,7 +708,6 @@ toptextindex: 0, //上拉 转写文件下标 biojiisshow: false, speaker: '', - dshfkjsdkksodofydwfkhwdfkjh: 0, userlistobj: {}, Acquirecustomerintentlist: [], options1: [], @@ -769,6 +768,10 @@ projectId: uni.getStorageSync('buildingID').id, // 当前项目id visitRecordNum: 1, // 默认到访次数 }, + + + eventParams: '', // 触发的事件 + consultant: '', // 顾问身份id字符串 }; }, computed: { @@ -1104,32 +1107,33 @@ // 添加角色 addRole() { this.tablist.push({ - name: String.fromCharCode(this.tablist.length + 64) + name: String.fromCharCode(this.tablist.length + 64), + checked: false, }) }, rolexuanze(index) { this.roleindexrow = index; }, - - // 修改角色 - Modifyrole(dialog, item) { - this.roleisshaw = true; - this.roletiaoshu = dialog; - this.roleindexrow = this.dialogList[this.csdFileindex].message[this.roletiaoshu].speaker - 1; + showRoleisshaw() { + this.roleisshaw = true }, + // 修改角色 roletab() { - // let itso=this.dialogList[this.csdFileindex].message[this.roletiaoshu]; - let itso = Object.assign({}, this.dialogList[this.csdFileindex].message[this.roletiaoshu]); - itso.onebest = itso.onebest.replace(/<.*?>/ig, ""); - this.$u.post("/corpus/updateRole", { + this.dialogList[this.csdFileindex].message.forEach(item => { + if (item.checked) { + item.speaker = this.roleindexrow + 1 + } + }) + this.$u.post("/corpus/batchUpdateRole", { corpusId: this.luyinList[this.csdFileindex].id, - transferContent: JSON.stringify([itso]), + transferContent: JSON.stringify(this.dialogList[this.csdFileindex].message), speaker: this.roleindexrow + 1, customerId: this.customerId }).then(res => { this.dialogList[this.csdFileindex].message[this.roletiaoshu].speaker = this.roleindexrow + 1 this.roleisshaw = false; this.cancelBeast() + this.cancelAllAdd() uni.showToast({ title: '修改成功', duration: 2000 @@ -1440,22 +1444,24 @@ }) }, //标记选择角色 - biaojixuanze(index) { - this.roleindexbiaoji = index; + biaojixuanze(item) { + item.checked = !item.checked + this.$forceUpdate() }, //标记顾问 tagtap() { + this.tablists = this.tablist.slice(1, this.tablist.length) this.biojiisshow = !this.biojiisshow; }, //取消标记 unmarktap() { this.biojiisshow = false; - this.roleindexbiaoji = this.dshfkjsdkksodofydwfkhwdfkjh; this.roleisshaw = false }, //确认标记 Confirmthetag() { - if (this.roleindexbiaoji == -1) { + let arr = this.tablists.filter(item => item.checked) + if (arr.lenght == 0) { uni.showToast({ title: '请选择标记角色~', duration: 2000 @@ -1464,7 +1470,7 @@ } let params = { id: this.luyinList[this.csdFileindex].id, - speaker: this.roleindexbiaoji + 1, + speaker: arr.map(item => { return item.speaker }).join(","), customerId: this.customerId } this.$u.get(config.service.markConsultant, params).then((data) => { @@ -1522,13 +1528,15 @@ this.tablist.push({ name: '全部', select: false, - speaker: i + speaker: i, + checked: false, }) } else { this.tablist.push({ name: String.fromCharCode(i + 64), select: false, - speaker: i + speaker: i, + checked: false, }) } } @@ -1576,7 +1584,8 @@ this.roleSelectArr = [0] this.creatTabList(res.speakerNum) this.tablist[0].select = true - this.tablist[res.speaker].name = this.tablist[res.speaker].name + "顾问"; + this.consultant = res.speaker + this.setConsultant() } if (this.roleSelectArr.length == 0) { this.tablist[0].select = true @@ -1591,7 +1600,17 @@ } }) }, - + + // 设置顾问 + setConsultant() { + let arr = this.consultant.split(',') || [] + console.log(this.consultant,arr) + this.tablist.map(obj => { + if (arr.includes(obj.speaker.toString())) { + obj.name += '顾问' + } + }) + }, toKeywordsearch() { this.stateisshow = 1; @@ -1908,13 +1927,18 @@ }) }, - //加精华 - Addtheessence() { + // 触发事件 + publicEvents(params) { + this.eventParams = params this.refined = true this.cancelBeast() }, - // 重置选择加精的内容 + surePublic() { + this[this.eventParams]() + }, + + // 重置选择的内容 cancelAllAdd() { console.log('chufa') this.dialogList.forEach(item => { @@ -1964,15 +1988,7 @@ status: 1, startFile: this.duihuawenjianid, //对话所在录音文件id marketingId: this.biaoqianid, //对应一级父id - - // jjTransfer: this.changanitem.onebest, //选中对话 - // endTime: this.changanitem.ed, //结束时间 - // startTime: this.changanitem.bg, //开始时间 - toDigestList: [], // 加精多选的内容 - // jjTransfer: this.changanitem.onebest, //选中对话 - // endTime: this.changanitem.ed, //结束时间 - // startTime: this.changanitem.bg, //开始时间 } // 将数据筛选出来并排序并且翻转数据让后端获取第一条加精的数据在分点加精的学习列表使用 this.dialogList.forEach(items => { @@ -2141,14 +2157,10 @@ this.creatTabList(data.data.data.speakerNum) this.tablist[0].select = true // 默认选中第一个 - if (data.data.data.speaker == null) { - this.roleindexbiaoji = -1; - this.dshfkjsdkksodofydwfkhwdfkjh = -1; - } else { - this.tablist[data.data.data.speaker].name = this.tablist[data.data.data.speaker] - .name + "顾问"; - this.roleindexbiaoji = data.data.data.speaker - 1; - this.dshfkjsdkksodofydwfkhwdfkjh = data.data.data.speaker - 1; + // 设置顾问 + if (data.data.data.speaker) { + this.consultant = data.data.data.speaker + this.setConsultant() } //上拉标记点