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 {