From 5674d1a1868368431270ec5c70b5c21638903fa0 Mon Sep 17 00:00:00 2001 From: jiangjunjie Date: Mon, 28 Sep 2026 14:25:17 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E8=B7=9F=E5=BD=93=E5=89=8D=E5=AF=B9=E8=AF=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/chat-content.vue | 72 ++++++++++++++++----------------- src/components/text-content.vue | 19 ++++++++- src/components/text-folding.vue | 3 +- 3 files changed, 55 insertions(+), 39 deletions(-) diff --git a/src/components/chat-content.vue b/src/components/chat-content.vue index 0a364a0..fe4f5ba 100644 --- a/src/components/chat-content.vue +++ b/src/components/chat-content.vue @@ -295,7 +295,7 @@
- +
@@ -396,7 +396,7 @@
- +
@@ -459,7 +459,7 @@
- +
@@ -476,7 +476,7 @@
- +
@@ -527,9 +527,9 @@ --> - + :disabled="isHistory"> @@ -566,12 +566,12 @@ 'question-text': item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ', }"> - + :disabled="isHistory">
@@ -619,9 +619,9 @@
如需更多帮助,请点击。
--> - + :disabled="isHistory">
@@ -655,9 +655,9 @@
如需更多帮助,请点击。
--> - + :disabled="isHistory">
@@ -680,9 +680,9 @@
如需更多帮助,请点击。
--> - + :disabled="isHistory"> @@ -701,9 +701,9 @@
如需更多帮助,请点击。
--> - + :disabled="isHistory"> @@ -732,8 +732,8 @@
如需更多帮助,请点击。
--> - @@ -753,13 +753,13 @@ 'question-text': item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ', }"> - + :disabled="isHistory" heightMax="autoHeight">
@@ -790,13 +790,13 @@ 'question-text': item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ', }"> - + :disabled="isHistory" heightMax="autoHeight">
@@ -881,9 +881,9 @@
如需更多帮助,请点击。
--> - + :disabled="isHistory" heightMax="autoHeight">
@@ -1016,11 +1016,11 @@
- + :disabled="isHistory">
@@ -1038,12 +1038,12 @@ 'question-text': item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ', }"> - @@ -1076,13 +1076,13 @@ 'question-text': item.cmd != 'RGFWHS' && item.cmd != 'QXRGPJ', }"> - + :disabled="isHistory" heightMax="autoHeight">
diff --git a/src/components/text-content.vue b/src/components/text-content.vue index 353d45b..5c02e3d 100644 --- a/src/components/text-content.vue +++ b/src/components/text-content.vue @@ -49,6 +49,7 @@ const props = defineProps({ disabled: { type: Boolean, default: false }, heightMax: { type: String, default: '' }, itemlist: { type: Object, default: () => ({}) }, + isHistory: { type: Boolean, default: false }, }) const store = inject('appStore', null) @@ -252,6 +253,23 @@ function handleURL(url, params) { function replacementRagEmoticon(str) { str = str || '' let res = str.replace(/\\n/gm, '
') + // 历史消息里的内嵌跳转链接置为禁用态(与 text-folding 行为一致) + if (props.isHistory) { + if (res.indexOf('open-wx-web-button')) { + res = res.replace(/"open-wx-web-button"/g, '"open-wx-web-button-disable"') + } else if (res.indexOf('jump-web-button')) { + res = res.replace(/"jump-web-button"/g, '"jump-web-button-disable"') + } else if (res.indexOf('open-app-page-button')) { + res = res.replace(/"open-app-page-button"/g, '"open-app-page-button-disable"') + } + if (res.indexOf('open-wx-web')) { + res = res.replace(/"open-wx-web"/g, '"open-wx-web-disable"') + } else if (res.indexOf('jump-web')) { + res = res.replace(/"jump-web"/g, '"jump-web-disable"') + } else if (res.indexOf('open-app-page')) { + res = res.replace(/"open-app-page"/g, '"open-app-page-disable"') + } + } return emojiToImage(res) } @@ -429,7 +447,6 @@ function manualAnswer(event, item) { } .answer-items[disabled] { - opacity: 0.5; cursor: not-allowed; } diff --git a/src/components/text-folding.vue b/src/components/text-folding.vue index cbab0c3..d493eb2 100644 --- a/src/components/text-folding.vue +++ b/src/components/text-folding.vue @@ -26,7 +26,7 @@ " >
@@ -179,10 +179,10 @@
- - +
@@ -205,7 +205,7 @@
-
@@ -499,7 +499,7 @@
@@ -523,7 +523,7 @@ @@ -568,18 +568,18 @@ +
0101如需更多帮助,请点击。
-->
- - @@ -597,7 +597,7 @@
{{item.seatNum}}
-
如需更多帮助,请点击。
+
如需更多帮助,请点击。
--> @@ -617,7 +617,7 @@
- - @@ -651,9 +651,9 @@
- +
-
如需更多帮助,请点击。
+
如需更多帮助,请点击。
-->
- +
-
如需更多帮助,请点击。
+
如需更多帮助,请点击。
--> -
如需更多帮助,请点击。
+
如需更多帮助,请点击。
-->
- - @@ -792,7 +792,7 @@
- - @@ -853,11 +853,11 @@ :itemlist="item" />
- - @@ -879,7 +879,7 @@
-
如需更多帮助,请点击。
+
如需更多帮助,请点击。
-->
- - @@ -1078,7 +1078,7 @@
- - @@ -1112,7 +1112,7 @@
@@ -1963,62 +1963,25 @@ export default { // console.log(item, type); }, //评价接口 - appraise(evaluation, item, event) { - //evaluation 1为有帮助 2没有帮助 - let current = event.currentTarget; - let settled = event.currentTarget.parentNode.children[1]; //有帮助 - let unsettled = event.currentTarget.parentNode.children[0]; //没有帮助 - - let param = { - fromFlag: 1, - userId: this.userId, - sessionId: this.sessionId, - source: this.source, - qaId: item.qaId, - evaluation: evaluation, - reqAndResType: "3", - timestamp: new Date().valueOf(), - }; - - current.disabled = true; - //this.set_sendLoading(true); - // 满意度调查系统需求 - this.savePaperResult(param) - .then((res) => { }) - .catch((err) => { - console.log(err); - }); - - this.$post("evaluation/evaluateAnswer", param) - .then((res) => { - //this.set_sendLoading(false); - // console.log("评价接口==", res) - if (res.code && res.code != 0) { - showToast(res.msg); - - current.disabled = false; - return; - } - - // 禁掉按钮 - current.disabled = true; - current.classList.add("active"); - if (current.innerText === "有帮助") { - unsettled.disabled = true; - } else if (current.innerText === "没有帮助") { - settled.disabled = true; - } - - this.set_chatList(res.data); - this.scrollTopBody(); - - //评价返回数据 - }) - .catch((error) => { - current.disabled = false; - console.log(error); - }); - }, + appraise(evaluation, item, event) { + //evaluation 1为有帮助 2没有帮助 + // 基础评价数据交给 appraise-popup 弹窗:提交/关闭时统一落库并置灰按钮 + let current = event.currentTarget; + + let baseHandle = { + fromFlag: 1, + userId: this.userId, + sessionId: this.sessionId, + source: this.source, + qaId: item.qaId, + evaluation: evaluation, + reqAndResType: "3", + timestamp: new Date().valueOf(), + event: current, + }; + + this.$emit("handleAppraise", true, baseHandle); + }, //留言 leaveMessageBtn(event) { let current = event.currentTarget; diff --git a/src/components/chat-new.vue b/src/components/chat-new.vue index 640d955..f551370 100644 --- a/src/components/chat-new.vue +++ b/src/components/chat-new.vue @@ -10,6 +10,7 @@ import hotQuestionNew from '@/components/hot-question-new.vue' import welcomes from '@/components/welcomes.vue' import abstract from '@/components/abstract.vue' import chatContent from '@/components/chat-content.vue' +import appraisePopup from '@/components/appraise-popup.vue' import DynamicImage from '@/components/common/DynamicImage.vue' import bussinessHandle from '@/components/business-handle.vue' import imageService from '@/utils/imageService' @@ -41,6 +42,13 @@ const sessionId = inject('sessionId', ref('')) const userId = inject('userId', ref('')) const isLostMessage = inject('isLostMessage', ref(null)) const mainContainerRef = ref(null) +const appraiseShow = ref(false) // 有帮助/没帮助评价弹层 +const baseHandle = ref('') // 评价弹层基础数据(含被点按钮 event) + +function appraiseIsClose(val, param) { + appraiseShow.value = val + baseHandle.value = param || '' +} // 参考 liics/chat-main 的 tokenExist:token 获取成功后才渲染聊天主内容 @@ -518,16 +526,24 @@ watch( :isWX="isWX" :tokenExist="tokenExist" :lostChatInfoNum="lostChatInfoNum" + @handleAppraise="appraiseIsClose" />
+ + +