From 9f950db8622a81878b9bc97cf3bd1a97185ea331 Mon Sep 17 00:00:00 2001 From: wenjinbo <599483010@qq.com> Date: Mon, 29 Sep 2025 17:42:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E7=9F=A5=E8=AF=86?= =?UTF-8?q?=E5=BA=93=E6=96=87=E6=A1=A3=E5=88=97=E8=A1=A8=E5=8F=8A=E9=97=AE?= =?UTF-8?q?=E7=AD=94=E6=B6=88=E6=81=AF=E6=B0=94=E6=B3=A1markdown=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/chatweb/components/MessageItem.vue | 24 +- .../chatweb/composables/useMessageHandlers.ts | 2 +- .../views/chatweb/intelRetrieval/index.vue | 450 +++++++++++++++--- .../datasets/components/DocumentList.vue | 9 +- 4 files changed, 417 insertions(+), 68 deletions(-) diff --git a/chat-client/src/views/chatweb/components/MessageItem.vue b/chat-client/src/views/chatweb/components/MessageItem.vue index e1a9176..a4888f5 100644 --- a/chat-client/src/views/chatweb/components/MessageItem.vue +++ b/chat-client/src/views/chatweb/components/MessageItem.vue @@ -944,9 +944,10 @@ const hasAnySources = (sources: TraceData | null | undefined) => { overflow: auto; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); background: white; - font-size: 0.83rem; /* 比正文(0.95rem)小2px,约为0.83rem */ - line-height: 1.4; + font-size: 0.75rem; /* 12px */ + line-height: 1.3; border: 1px solid #e5e7eb; + table-layout: auto; /* 允许列宽根据内容自适应 */ } ::v-deep .table-wrapper summary { @@ -971,15 +972,15 @@ const hasAnySources = (sources: TraceData | null | undefined) => { .answer-content :deep(th), .answer-content :deep(td) { - padding: 0.75rem 1rem; + padding: 0.5rem 0.75rem; /* 减少内边距,使表格更紧凑 */ border: 1px solid #e5e7eb; text-align: left; vertical-align: top; word-wrap: break-word; - max-width: 200px; + max-width: none; /* 移除最大宽度限制,允许列宽自适应 */ word-break: break-word; white-space: normal; - font-size: 0.83rem; /* 确保表格单元格字体也比正文小2px */ + font-size: 0.75rem; /* 12px */ } .answer-content :deep(th) { @@ -987,7 +988,7 @@ const hasAnySources = (sources: TraceData | null | undefined) => { background: #f8fafc; font-weight: 600; color: #374151; - font-size: 0.83rem; /* 与表格整体字体大小保持一致,比正文小2px */ + font-size: 0.8125rem; /* 13px */ text-transform: uppercase; letter-spacing: 0.025em; position: sticky; @@ -1043,21 +1044,22 @@ const hasAnySources = (sources: TraceData | null | undefined) => { @media (max-width: 768px) { .answer-content :deep(table) { min-width: 600px; - font-size: 0.75rem; /* 移动端保持比正文小的比例 */ + font-size: 0.6875rem; /* 11px 移动端 */ margin: 1rem 0; border: 1px solid #e5e7eb; + line-height: 1.2; /* 移动端更紧凑的行高 */ } .answer-content :deep(th), .answer-content :deep(td) { - padding: 0.5rem 0.75rem; - max-width: 150px; + padding: 0.375rem 0.5rem; /* 移动端更紧凑的内边距 */ + max-width: none; /* 移动端也允许列宽自适应 */ border: 1px solid #e5e7eb; - font-size: 0.75rem; /* 移动端表格单元格字体 */ + font-size: 0.6875rem; /* 11px 移动端表格内容 */ } .answer-content :deep(th) { - font-size: 0.75rem; /* 移动端表头字体 */ + font-size: 0.75rem; /* 12px 移动端表头 */ border-bottom: 2px solid #e5e7eb; } } diff --git a/chat-client/src/views/chatweb/composables/useMessageHandlers.ts b/chat-client/src/views/chatweb/composables/useMessageHandlers.ts index 0dcdaa7..364db84 100644 --- a/chat-client/src/views/chatweb/composables/useMessageHandlers.ts +++ b/chat-client/src/views/chatweb/composables/useMessageHandlers.ts @@ -77,7 +77,7 @@ export function useMessageHandlers() { //g, `
- Expand / Collapse table + 展开 / 折叠表格
` ).replace( diff --git a/chat-client/src/views/chatweb/intelRetrieval/index.vue b/chat-client/src/views/chatweb/intelRetrieval/index.vue index 0383f81..8f29d8e 100644 --- a/chat-client/src/views/chatweb/intelRetrieval/index.vue +++ b/chat-client/src/views/chatweb/intelRetrieval/index.vue @@ -1,14 +1,27 @@