From f71e83bf7ca7e86a48e861d3e2d8426b760efb57 Mon Sep 17 00:00:00 2001 From: wanghanlin <1533525126@qq.com> Date: Wed, 9 Sep 2026 09:02:14 +0800 Subject: [PATCH] =?UTF-8?q?refactor(frontend):=20=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E7=BB=9F=E4=B8=80=E6=94=B9=E7=94=A8=20TDesig?= =?UTF-8?q?n=20=E6=A0=87=E5=87=86=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除 McpServerManager/ModelConfigManager 手写 fixed 浮层,连接测试结果改用 toast()(MessagePlugin) - 按钮加载态统一使用 :loading 替代 emoji/纯文字切换(刷新连接、测试连接、获取模型) - 登录错误、文档详情错误提示改 t-alert;目录树 / AI 执行链加载态改 t-loading - 导出图片等提示统一走 utils/toast,移除 PipelineFlow 对 MessagePlugin 的直接 import - 同步清理死代码与孤立样式(components.d.ts 补登记 TAlert) --- frontend/components.d.ts | 1 + frontend/src/views/DocDetail.vue | 9 +--- frontend/src/views/DocList.vue | 3 +- frontend/src/views/LoginPage.vue | 3 +- frontend/src/views/McpServerManager.vue | 19 +++------ frontend/src/views/ModelConfigManager.vue | 50 +++++++++-------------- frontend/src/views/PipelineFlow.vue | 36 +++++----------- 7 files changed, 42 insertions(+), 79 deletions(-) diff --git a/frontend/components.d.ts b/frontend/components.d.ts index 96e0dac..bda4497 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -14,6 +14,7 @@ declare module 'vue' { PromptSearchHighlight: typeof import('./src/components/PromptSearchHighlight.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + TAlert: typeof import('tdesign-vue-next')['Alert'] TButton: typeof import('tdesign-vue-next')['Button'] TCard: typeof import('tdesign-vue-next')['Card'] TCheckbox: typeof import('tdesign-vue-next')['Checkbox'] diff --git a/frontend/src/views/DocDetail.vue b/frontend/src/views/DocDetail.vue index 67a46e1..d3be730 100644 --- a/frontend/src/views/DocDetail.vue +++ b/frontend/src/views/DocDetail.vue @@ -19,9 +19,7 @@ 标签 {{ t }} -
- 错误信息{{ doc.errorMessage }} -
+ @@ -36,7 +34,7 @@ -
{{ chunksError }}
+
共 {{ chunks.length }} 个分块
@@ -104,8 +102,6 @@ function getTags(): string[] { .info-label { width: 70px; flex: none; font-size: 13px; color: var(--color-text-tertiary); } .info-val { font-size: 13px; color: var(--color-text-primary); word-break: break-all; } .info-tags { margin-top: 12px; display: flex; align-items: center; } -.info-error { margin-top: 8px; display: flex; align-items: flex-start; gap: 8px; } -.error-text { color: var(--color-error); font-size: 12px; } /* 原文 */ .raw-content { background: var(--color-bg-subtle); border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; } @@ -125,6 +121,5 @@ function getTags(): string[] { .chunk-footer { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--color-border); display: flex; justify-content: flex-end; } .chunk-len { font-size: 11px; color: var(--color-text-disabled); } -.error-msg { color: var(--color-error); padding: 8px 0; } .empty-detail { color: var(--color-text-tertiary); padding: 40px; text-align: center; } diff --git a/frontend/src/views/DocList.vue b/frontend/src/views/DocList.vue index ea35a2b..0a2377d 100644 --- a/frontend/src/views/DocList.vue +++ b/frontend/src/views/DocList.vue @@ -8,7 +8,7 @@ 刷新
-
加载中...
+ 登 录 - +
@@ -74,6 +74,5 @@ async function handleLogin() { } .login-card h2 { text-align: center; margin-bottom: 6px; color: var(--color-text-primary); } .login-subtitle { text-align: center; color: var(--color-text-tertiary); font-size: 13px; margin-bottom: 32px; } -.login-error { color: var(--color-error); font-size: 13px; text-align: center; margin-top: 8px; } .login-footer { color: rgba(255,255,255,.6); font-size: 12px; margin-top: 24px; } diff --git a/frontend/src/views/McpServerManager.vue b/frontend/src/views/McpServerManager.vue index de6995d..c934fb4 100644 --- a/frontend/src/views/McpServerManager.vue +++ b/frontend/src/views/McpServerManager.vue @@ -3,7 +3,7 @@

管理 MCP (Model Context Protocol) 服务端配置,支持 SSE 和 Stdio 两种传输方式

新建配置 - {{ refreshLoading?'刷新中...':'刷新连接' }} + 刷新连接 刷新列表
共 {{ total }} 条配置 @@ -16,19 +16,13 @@ - -
- {{ testResult.success?'连接成功':'连接失败' }} - {{ testResult.message }} -
- @@ -60,7 +54,7 @@ +.ellipsis{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block;} diff --git a/frontend/src/views/ModelConfigManager.vue b/frontend/src/views/ModelConfigManager.vue index c744835..b4f98d6 100644 --- a/frontend/src/views/ModelConfigManager.vue +++ b/frontend/src/views/ModelConfigManager.vue @@ -35,13 +35,12 @@
🔗 Fallback 链(按优先级排列) - ❓ 帮助 -
-
-
📖 Fallback 链使用说明
-

Fallback 链是高可用性机制,主模型故障时自动切换到备用模型。

-

✔ 勾选「设为活跃配置」启用 | 📊 调整「优先级」数值(越大越优先)| 🔀 拖拽列表项快速调整

+ ❓ 帮助
+ +

Fallback 链是高可用性机制,主模型故障时自动切换到备用模型。

+

✔ 勾选「设为活跃配置」启用 | 📊 调整「优先级」数值(越大越优先)| 🔀 拖拽列表项快速调整

+
{{ getAppTypeLabel(chain.appType) }}
✏️ - {{ testLoading[row.id] ? '⏳' : '🔌' }} + 测试 📋 ▶️ ⏸️ @@ -105,15 +104,6 @@ - -
-
{{ testResult.success ? '✅ 连接成功' : '❌ 连接失败' }}
-
延迟:{{ testResult.latencyMs }}ms · 维度:{{ testResult.dimensions }}
-
{{ testResult.errorMessage }}
-
- ✕ - - {{ fetchLoading ? '⏳ 获取中...' : '🔍 获取模型' }} + 获取模型
@@ -264,8 +254,8 @@ @@ -298,8 +288,7 @@ diff --git a/frontend/src/views/PipelineFlow.vue b/frontend/src/views/PipelineFlow.vue index c9a28e0..15eace8 100644 --- a/frontend/src/views/PipelineFlow.vue +++ b/frontend/src/views/PipelineFlow.vue @@ -26,13 +26,11 @@
-
-

⚠️ 图表渲染失败: {{ error }}

- 重试 -
-
-

⏳ 正在生成流程图...

-
+ + + + +
@@ -40,7 +38,7 @@