From 39a6daf8fef086f66f9023a4407e9271544929e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AD=90=E9=BB=98?= <925456043@qq.com> Date: Wed, 18 Mar 2026 22:26:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E5=85=BC=E5=AE=B9=E4=B8=8E=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E9=AB=98=E4=BA=AE=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 为管理端补充 vue-element-plus-x 模块声明与 BotInfo 兼容字段 - 修正用户中心全局搜索高亮片段 key 生成,减少渲染告警风险 --- .../app/src/types/vue-element-plus-x.d.ts | 6 ++++++ easyflow-ui-admin/packages/types/src/bot.ts | 1 + .../src/widgets/global-search/search-panel.vue | 17 +++++++++-------- 3 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 easyflow-ui-admin/app/src/types/vue-element-plus-x.d.ts diff --git a/easyflow-ui-admin/app/src/types/vue-element-plus-x.d.ts b/easyflow-ui-admin/app/src/types/vue-element-plus-x.d.ts new file mode 100644 index 0000000..db99992 --- /dev/null +++ b/easyflow-ui-admin/app/src/types/vue-element-plus-x.d.ts @@ -0,0 +1,6 @@ +declare module 'vue-element-plus-x/es/*/index.js' { + import type { DefineComponent } from 'vue'; + + const component: DefineComponent, Record, any>; + export default component; +} diff --git a/easyflow-ui-admin/packages/types/src/bot.ts b/easyflow-ui-admin/packages/types/src/bot.ts index 7e467ba..244dbd2 100644 --- a/easyflow-ui-admin/packages/types/src/bot.ts +++ b/easyflow-ui-admin/packages/types/src/bot.ts @@ -8,6 +8,7 @@ interface BotInfo { icon: string; id: string; modelId: string; + name?: string; modelOptions: { maxMessageCount: number; maxReplyLength: number; diff --git a/easyflow-ui-usercenter/packages/effects/layouts/src/widgets/global-search/search-panel.vue b/easyflow-ui-usercenter/packages/effects/layouts/src/widgets/global-search/search-panel.vue index b08552f..b6fa899 100644 --- a/easyflow-ui-usercenter/packages/effects/layouts/src/widgets/global-search/search-panel.vue +++ b/easyflow-ui-usercenter/packages/effects/layouts/src/widgets/global-search/search-panel.vue @@ -124,10 +124,10 @@ function getHighlightedChunks(text: string, keyword: string) { const queryChars = [...keyword.trim().toLowerCase()]; if (queryChars.length === 0) { - return [{ text, matched: false }]; + return [{ key: '0', text, matched: false }]; } - const chunks: Array<{ matched: boolean; text: string }> = []; + const chunks: Array<{ key: string; matched: boolean; text: string }> = []; let queryIndex = 0; sourceChars.forEach((char, index) => { @@ -141,7 +141,11 @@ function getHighlightedChunks(text: string, keyword: string) { if (previousChunk && previousChunk.matched === matched) { previousChunk.text += char; } else { - chunks.push({ matched, text: char }); + chunks.push({ + key: `${index}-${matched ? '1' : '0'}`, + matched, + text: char, + }); } }); @@ -237,11 +241,8 @@ onMounted(() => { class="block truncate text-sm font-medium leading-6 text-[hsl(var(--text-strong))]" >