diff --git a/pages/mine/details2.vue b/pages/mine/details2.vue index 4b7f2d1..02a1b5c 100644 --- a/pages/mine/details2.vue +++ b/pages/mine/details2.vue @@ -59,7 +59,7 @@ 复制 - 常错词 常错词: - + 正确词: - + @@ -756,7 +758,7 @@ }, methods: { - // 对话加命中标签 + // 对话加命中标签 dealTypes(type){ if(type){ let tem = type.substring(1).split(',') @@ -776,34 +778,95 @@ return [] } }, - //挖掘率话术客户标签展示 - getKeywordsList(list) { - let keywords = []; - if (list && list.length) { - keywords = list.map((item) => item.name); - } else { - return "--"; - } - return keywords.join(","); - }, - // 计算挖掘执行的完成率 - getPercent(){ - let countArr = this.KeyWordsfractionList.filter(item=> item.selected==0) - // console.log(countArr) - this.percent = (countArr.length / this.KeyWordsfractionList.length)*100 - // console.log(this.percent.toFixed(0)) - this.percent = this.percent.toFixed(0) - - }, - // 点击话术 - clickWajue(item){ - if(item.isAskQuestions==0){ + clickWajue(item) { + if (item.selected == 0) { this.Pinspeak = false uni.navigateTo({ - url: '/pages/learning/Keywordsearch?customerId=' + this.customerId + "&keyword=" + item.showFormatExpression + + url: '/pages/learning/Keywordsearch?customerId=' + this.customerId + "&keyword=" + item + .question + "&skpl=" + "2" + '&UpDateEvent=DETAILS2INIT' - }) - } + }) + } + }, + //获取画像标签 + getWordMiningList() { + this.treelist = []; + this.$u.get("/corpus/findSelectedWordMiningTemplate", { + houseId: this.buildingID, + selected: 0 + }) + .then((res) => { + // console.log(res) + if (res.length) { + res.forEach(item => { + item.value = item.id; + item.label = item.name; + if (item.children.length) { + item.children.forEach(subitem => { + subitem.value = subitem.id; + subitem.label = subitem.name; + }) + } else { + item.children = [{ + value: 'default' + item.id, + label: '--' + }] + } + }) + } + this.treelist = res; + }); + }, + // 添加挖掘词 + wajueConfirm() { + if (this.thewrongword.length > 20) { + uni.showToast({ + title: '该话术不能超过20个字', + icon: 'none', + duration: 2000 + }); + this.wajueshow = true + return; + } + + this.wajueshow = true + if (!this.flag) { + this.flag = true + uni.request({ + url: config.service.addWordMining, + method: "post", + header: { + 'content-type': 'application/json', + 'Access-Token': uni.getStorageSync('weapp_session_login_data').token + }, + data: { + "houseId": this.buildingID, // 楼盘id + "cusId": this.customerId, //客户id + "question": this.thewrongword, // 问题 + "keywordsId": this.wordBiao.wordBiaoqianId, // 标签id + "level": this.wordBiao.level // 标签等级 + }, + success: (res) => { + // console.log(res) + this.flag = false; + if (res.data.code == 10000) { + uni.showToast({ + title: '添加成功', + icon: 'none', + duration: 2000 + }); + this.wajueshow = false + } else { + uni.showToast({ + title: res.data.message, + icon: 'none', + duration: 2000 + }); + this.wajueshow = false + } + } + }) + } }, // 选中取反 cbChange(item) { @@ -1616,9 +1679,12 @@ this.cancelBeast() }, //加入长错词 - Oftenthewrongword() { + Oftenthewrongword(item) { this.reswrongword = ""; this.isshow2 = true; + this.$nextTick(() => { + this.thewrongword = item.onebest.replace(/<.*?>/ig, ""); + }) }, //加精华 Addtheessence() { @@ -1712,8 +1778,8 @@ 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, ""); + // let onebest = item.onebest; + // this.thewrongword = onebest.replace(/<.*?>/ig, ""); this.messagelisy = this.dialogList[i].message this.argtextindex1 = i; this.argtextindex2 = index; @@ -1980,7 +2046,7 @@ -