From 2c630eac70ad0c6f3a5876b46e6a6cecc1de2795 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=98=B1=E8=BE=BE?= Date: Sun, 28 Sep 2025 11:28:36 +0800 Subject: [PATCH] =?UTF-8?q?feat(ai-chat):=20=E5=AE=9E=E7=8E=B0=E6=A1=88?= =?UTF-8?q?=E4=BE=8B=E4=B8=93=E5=AE=B6=E5=8A=9F=E8=83=BD=E5=85=A5=E5=8F=A3?= =?UTF-8?q?=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6=E5=8F=8A=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E4=BC=98=E5=8C=96-=20=E4=BF=AE=E6=94=B9AI?= =?UTF-8?q?=E8=81=8A=E5=A4=A9=E6=8E=A5=E5=8F=A3=E5=9C=B0=E5=9D=80=E4=B8=BA?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E5=BC=80=E5=8F=91=E7=8E=AF=E5=A2=83=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=20-=20=E6=96=B0=E5=A2=9EshowCaseAiEntrance=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E7=94=A8=E4=BA=8E=E6=8E=A7=E5=88=B6=E6=A1=88=E4=BE=8B?= =?UTF-8?q?=E4=B8=93=E5=AE=B6=E5=8A=9F=E8=83=BD=E5=85=A5=E5=8F=A3=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=20-=20=E4=BC=98=E5=8C=96=E6=B6=88=E6=81=AF=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=B8=AD=E7=9A=84=E6=A1=88=E4=BE=8B=E5=BC=95=E7=94=A8?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E9=80=BB=E8=BE=91=EF=BC=8C=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=B1=95=E5=BC=80/=E6=94=B6=E8=B5=B7=E5=8A=9F=E8=83=BD=20-=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=A1=88=E4=BE=8B=E5=BC=95=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=97=B6=E9=97=B4=E3=80=81=E4=BD=9C=E8=80=85?= =?UTF-8?q?=E6=9C=BA=E6=9E=84=E7=AD=89=E4=BF=A1=E6=81=AF=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=20-=20=E5=AE=9E=E7=8E=B0=E6=89=93=E5=AD=97=E6=9C=BA=E6=95=88?= =?UTF-8?q?=E6=9E=9C=E7=9A=84=E6=96=87=E6=9C=AC=E9=80=90=E5=AD=97=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=8A=9F=E8=83=BD=20-=20=E4=BC=98=E5=8C=96AI=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E5=93=8D=E5=BA=94=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E6=94=AF=E6=8C=81think=E6=A0=87=E7=AD=BE=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/boe/aiChat.js | 15 +- src/views/portal/case/Index.vue | 14 +- src/views/portal/case/components/map.svg | 1 + src/views/portal/case/components/messages.vue | 115 ++++++++++- .../portal/case/components/sendMessage.vue | 179 ++++++++++++++---- src/views/portal/case/components/user.svg | 1 + 6 files changed, 278 insertions(+), 47 deletions(-) create mode 100644 src/views/portal/case/components/map.svg create mode 100644 src/views/portal/case/components/user.svg diff --git a/src/api/boe/aiChat.js b/src/api/boe/aiChat.js index d023eef0..fc2282ca 100644 --- a/src/api/boe/aiChat.js +++ b/src/api/boe/aiChat.js @@ -1,4 +1,4 @@ -import ajax from '@/api/boe/boeApiAjax.js' +import ajax from '@/utils/xajax.js' /** * AI聊天对话接口 @@ -8,7 +8,7 @@ import ajax from '@/api/boe/boeApiAjax.js' * @returns {Promise} - 返回SSE流 */ export function aiChat(data) { - return ajax.postJson('/xboe/m/boe/case/ai/chat', data) + return ajax.postJson('http://192.168.3.178/xboe/m/boe/case/ai/chat', data) } /** @@ -18,4 +18,13 @@ export function aiChat(data) { */ export function getChatMessages(conversationId) { return ajax.get('/xboe/m/boe/case/ai/messages?conversationId=' + conversationId) -} \ No newline at end of file +} + +/** + * 案例专家功能入口显示权限判断接口 + * 判断当前登录用户是否显示"案例专家"功能入口 + * @returns {Promise} - 返回是否显示功能入口的布尔值 + */ +export function showCaseAiEntrance() { + return ajax.get('/xboe/m/boe/case/ai/show-entrance') +} diff --git a/src/views/portal/case/Index.vue b/src/views/portal/case/Index.vue index a93c9d71..b31e930e 100644 --- a/src/views/portal/case/Index.vue +++ b/src/views/portal/case/Index.vue @@ -310,7 +310,7 @@
-
+
@@ -501,6 +501,8 @@ import apiType from "@/api/modules/type.js"; import { cutFullName } from "@/utils/tools.js"; import apiPlace from "@/api/phase2/place.js" import AICall from '@/views/portal/case/AICall.vue' +import { showCaseAiEntrance } from '@/api/boe/aiChat.js' + export default { name: "case", components: { @@ -514,6 +516,7 @@ export default { }, data() { return { + showAiCase:false, showAICall:false, timeoutId: null, isTimeData: false, @@ -787,6 +790,7 @@ export default { }, mounted() { let $this = this; + this.getShowAiCase() // if(this.speciData.length==0){ // this.specialized(); // } @@ -871,6 +875,14 @@ export default { }, methods: { +// 是否展示入口 + getShowAiCase(){ + showCaseAiEntrance().then(res=>{ + this.showAiCase = res.data + }) + }, + + allRequests() { window.addEventListener( "scroll", diff --git a/src/views/portal/case/components/map.svg b/src/views/portal/case/components/map.svg new file mode 100644 index 00000000..c35539ec --- /dev/null +++ b/src/views/portal/case/components/map.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/views/portal/case/components/messages.vue b/src/views/portal/case/components/messages.vue index 0bec7d95..9d7cfb38 100644 --- a/src/views/portal/case/components/messages.vue +++ b/src/views/portal/case/components/messages.vue @@ -18,7 +18,21 @@ export default { return { displayText: '', typingTimer: null, - typingSpeed: 30 // 打字机速度(毫秒/字符) + typingSpeed: 30, // 打字机速度(毫秒/字符) + showAllCaseRefers: false // 控制是否显示所有案例引用 + } + }, + computed: { + // 计算需要显示的案例引用 + displayedCaseRefers() { + if (this.showAllCaseRefers || !this.messageData.caseRefers) { + return this.messageData.caseRefers || []; + } + return this.messageData.caseRefers.slice(0, 3); + }, + // 判断是否需要显示"查看更多"按钮 + shouldShowMoreButton() { + return this.messageData.caseRefers && this.messageData.caseRefers.length > 3; } }, watch: { @@ -57,6 +71,10 @@ export default { this.typingTimer = null } }, this.typingSpeed) + }, + // 切换显示所有案例引用 + toggleShowAllCaseRefers() { + this.showAllCaseRefers = !this.showAllCaseRefers; } }, beforeDestroy() { @@ -72,27 +90,35 @@ export default {