From 683b64ed62ab6a00d6c65d2e045c8b48ad0cea7b Mon Sep 17 00:00:00 2001 From: Jeason <1710884619@qq.com> Date: Thu, 2 Apr 2026 15:21:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B7=A5=E5=8D=95=E8=AF=A6=E6=83=85AI?= =?UTF-8?q?=E5=BB=BA=E8=AE=AE=E5=8C=BA=E5=9F=9FUI=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E4=B8=BABootstrap=205=E9=A3=8E=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 去掉自定义 ai-suggestion-section/generate-ai-btn 等样式 - 改用 Bootstrap card + badge + btn 组件 - 相似度和审批状态用 badge bg-success/warning/danger - 按钮用 btn btn-sm 标准样式 - 租户管理飞书配置简化为只保留群绑定(去掉独立凭证字段) - 未绑定群的消息日志增加提示 --- src/web/blueprints/tenants.py | 1 + src/web/static/js/modules/workorders.js | 54 ++++++++++++------------- src/web/templates/dashboard.html | 12 +----- 3 files changed, 30 insertions(+), 37 deletions(-) diff --git a/src/web/blueprints/tenants.py b/src/web/blueprints/tenants.py index e056630..c71c8ae 100644 --- a/src/web/blueprints/tenants.py +++ b/src/web/blueprints/tenants.py @@ -155,6 +155,7 @@ def resolve_tenant_by_chat_id(chat_id: str) -> str: return t.tenant_id except Exception as e: logger.error(f"解析飞书群租户映射失败: {e}") + logger.warning(f"⚠️ 飞书群 {chat_id} 未绑定任何租户,使用默认租户。请在租户管理页面将此 chat_id 绑定到对应租户。") return DEFAULT_TENANT diff --git a/src/web/static/js/modules/workorders.js b/src/web/static/js/modules/workorders.js index aa50d0b..1a315b8 100644 --- a/src/web/static/js/modules/workorders.js +++ b/src/web/static/js/modules/workorders.js @@ -41,21 +41,21 @@ Object.assign(TSPDashboard.prototype, { const approveBtn = document.getElementById(`approveBtn_${workorderId}`); const percent = Math.round((data.similarity || 0) * 100); if (simEl) { - simEl.innerHTML = `语义相似度: ${percent}%`; - simEl.className = percent >= 90 ? 'similarity-badge high' : percent >= 80 ? 'similarity-badge medium' : 'similarity-badge low'; + simEl.innerHTML = `相似度: ${percent}%`; + simEl.className = percent >= 90 ? 'badge bg-success' : percent >= 80 ? 'badge bg-warning text-dark' : 'badge bg-danger'; simEl.title = this.getSimilarityExplanation(percent); } if (apprEl) { - if (data.use_human_resolution) { apprEl.textContent = '将使用人工描述入库'; apprEl.className = 'status-badge human-resolution'; } - else if (data.approved) { apprEl.textContent = '已自动审批'; apprEl.className = 'status-badge approved'; } - else { apprEl.textContent = '未审批'; apprEl.className = 'status-badge pending'; } + if (data.use_human_resolution) { apprEl.textContent = '使用人工描述'; apprEl.className = 'badge bg-info'; } + else if (data.approved) { apprEl.textContent = '已自动审批'; apprEl.className = 'badge bg-success'; } + else { apprEl.textContent = '未审批'; apprEl.className = 'badge bg-secondary'; } } if (approveBtn) { const canApprove = data.approved || data.use_human_resolution; approveBtn.disabled = !canApprove; - if (data.use_human_resolution) { approveBtn.textContent = '使用人工描述入库'; approveBtn.className = 'approve-btn'; } - else if (data.approved) { approveBtn.textContent = '已自动审批'; approveBtn.className = 'approve-btn approved'; } - else { approveBtn.textContent = '审批入库'; approveBtn.className = 'approve-btn'; } + if (data.use_human_resolution) { approveBtn.innerHTML = '使用人工描述入库'; approveBtn.className = 'btn btn-info btn-sm'; } + else if (data.approved) { approveBtn.innerHTML = '已自动审批'; approveBtn.className = 'btn btn-success btn-sm'; } + else { approveBtn.innerHTML = '审批入库'; approveBtn.className = 'btn btn-warning btn-sm'; } } const message = this.getSimilarityMessage(percent, data.approved, data.use_human_resolution); this.showNotification(message, data.approved ? 'success' : data.use_human_resolution ? 'warning' : 'info'); @@ -279,26 +279,26 @@ Object.assign(TSPDashboard.prototype, {
${workorder.description || '无问题描述'}
${workorder.resolution ? `
解决方案
${workorder.resolution}
` : ''} ${workorder.satisfaction_score ? `
满意度评分
${workorder.satisfaction_score}/5.0
` : ''} -
-
-
AI建议与人工描述
- +
+
+
AI建议与人工描述
+
-
- - -
-
- - -
-
- - 相似度: -- - 未审批 -
-
- +
+
+ + +
+
+ + +
+
+ + 相似度: -- + 未审批 + +
diff --git a/src/web/templates/dashboard.html b/src/web/templates/dashboard.html index df8e379..814c7a0 100644 --- a/src/web/templates/dashboard.html +++ b/src/web/templates/dashboard.html @@ -2266,19 +2266,11 @@

-
飞书配置(可选)
-
- - -
-
- - -
+
飞书群绑定
-
将飞书群绑定到此租户,机器人在该群收到消息时自动使用此租户的知识库
+
将飞书群绑定到此租户,机器人在该群收到消息时自动使用此租户的知识库。Chat ID 可从机器人日志中获取。