修复: 审批浮窗 reason 字段缺失(push 补 reason)+ 空态文案
This commit is contained in:
@@ -520,6 +520,11 @@ function handleToolEvent(event: AiChatEvent): boolean {
|
||||
args: event.args,
|
||||
status: 'pending_approval',
|
||||
kind: event.kind ?? 'risk',
|
||||
// BUG-260624-03(根因3):reason 必须写入 info,否则浮窗 ApprovalPopup.vue
|
||||
// 的 tc.reason 永远空(后端 build_approval_reason 生成的风险说明丢失)。
|
||||
// tc.reason 与 pendingApprovals[].reason 是两条独立赋值路径:tc 走 findToolCall,
|
||||
// 浮窗走主窗口推送的 pendingApprovals 快照,后者此前漏写 reason。
|
||||
reason: event.reason,
|
||||
}
|
||||
state.pendingApprovals.push(info)
|
||||
const tc = findToolCall(event.id)
|
||||
|
||||
@@ -57,6 +57,8 @@ export default {
|
||||
popupTagPath: 'Path auth',
|
||||
popupTagRisk: 'Risk action',
|
||||
popupOpenPanel: 'Open approval panel',
|
||||
// 根因1:首屏空态友好文案(数据未到达时,替代裸 spinner)
|
||||
popupEmptyHint: 'Waiting for approval data…',
|
||||
|
||||
// ── Provider status ──
|
||||
clickToSwitchProvider: 'Click to switch provider',
|
||||
|
||||
@@ -57,6 +57,8 @@ export default {
|
||||
popupTagPath: '路径授权',
|
||||
popupTagRisk: '风险操作',
|
||||
popupOpenPanel: '打开审批面板',
|
||||
// 根因1:首屏空态友好文案(数据未到达时,替代裸 spinner)
|
||||
popupEmptyHint: '等待审批数据…',
|
||||
|
||||
// ── Provider 状态 ──
|
||||
clickToSwitchProvider: '点击切换 Provider',
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
<div class="popup-body">
|
||||
<div v-if="approvals.length === 0" class="popup-empty">
|
||||
<span class="popup-empty-spinner"></span>
|
||||
<span class="popup-empty-hint">{{ $t('aiChat.popupEmptyHint') }}</span>
|
||||
</div>
|
||||
<div
|
||||
v-for="tc in approvals"
|
||||
@@ -317,17 +318,25 @@ function onDragEnd() { isDragging.value = false }
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex: 1;
|
||||
min-height: 80px;
|
||||
padding: 16px;
|
||||
}
|
||||
.popup-empty-spinner {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
border: 2px solid var(--df-border, #444);
|
||||
border-top-color: var(--df-accent);
|
||||
border-radius: 50%;
|
||||
animation: df-spin 0.8s linear infinite;
|
||||
display: inline-block;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.popup-empty-hint {
|
||||
font-size: 11px;
|
||||
color: var(--df-text-dim);
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
/* 单条审批项 */
|
||||
|
||||
Reference in New Issue
Block a user