feat: 新增预算助手报告组件并优化报销交互细节
新增预算助手报告视图模型和组件,优化报销洞察面板和消息项 样式细节,完善预算中心页面布局和文档中心视图,增强报销创 建会话管理和提交编排器,调整 Vite 构建配置,补充单元测试。
This commit is contained in:
@@ -618,6 +618,7 @@ export default {
|
||||
const {
|
||||
flowRunId,
|
||||
flowSteps,
|
||||
activeFlowSteps,
|
||||
visibleFlowSteps,
|
||||
flowRefreshBusy,
|
||||
completedFlowStepCount,
|
||||
@@ -677,7 +678,7 @@ export default {
|
||||
})
|
||||
const hasQueryInsight = computed(() => Boolean(currentInsight.value.agent?.queryPayload))
|
||||
const hasInsightPanelContent = computed(() => {
|
||||
return isKnowledgeSession.value || hasScopedReviewPayload.value || hasQueryInsight.value || flowSteps.value.length > 0
|
||||
return isKnowledgeSession.value || hasScopedReviewPayload.value || hasQueryInsight.value || activeFlowSteps.value.length > 0
|
||||
})
|
||||
const showInsightPanel = computed(() => hasInsightPanelContent.value && !insightPanelCollapsed.value)
|
||||
const insightPanelToggleLabel = computed(() =>
|
||||
@@ -696,6 +697,9 @@ export default {
|
||||
if (activeSessionType.value === SESSION_TYPE_APPROVAL) {
|
||||
return '例如:查一下待我审核的单据,或帮我生成这张单据的审核意见。'
|
||||
}
|
||||
if (activeSessionType.value === SESSION_TYPE_BUDGET) {
|
||||
return '例如:查询市场部 Q1 预算编制情况,重点看差旅、通信、招待费和办公用品。'
|
||||
}
|
||||
return '例如:查一下近10日报销金额、解释酒店超标风险,或根据附件整理报销核对信息。'
|
||||
})
|
||||
const currentIntentLabel = computed(() => {
|
||||
@@ -807,7 +811,7 @@ export default {
|
||||
activeReviewPayload,
|
||||
activeReviewPanelScope,
|
||||
reviewFilePreviews,
|
||||
flowSteps,
|
||||
flowSteps: activeFlowSteps,
|
||||
submitting,
|
||||
reviewActionBusy,
|
||||
triggerFileUpload: (...args) => triggerFileUpload(...args),
|
||||
@@ -1087,15 +1091,19 @@ export default {
|
||||
})
|
||||
const isReviewOverviewDrawer = computed(() => reviewDrawerMode.value === REVIEW_DRAWER_MODE_REVIEW)
|
||||
|
||||
const shortcuts = computed(() =>
|
||||
filterAssistantSessionModes(ASSISTANT_SESSION_MODE_OPTIONS, currentUser.value).map((mode) => ({
|
||||
const shortcuts = computed(() => {
|
||||
const accessibleModes = filterAssistantSessionModes(ASSISTANT_SESSION_MODE_OPTIONS, currentUser.value)
|
||||
const visibleModes = props.entrySource === 'budget'
|
||||
? accessibleModes.filter((mode) => mode.key === SESSION_TYPE_BUDGET)
|
||||
: accessibleModes
|
||||
return visibleModes.map((mode) => ({
|
||||
label: mode.label,
|
||||
icon: mode.icon,
|
||||
action: 'switch_view',
|
||||
targetSessionType: mode.key,
|
||||
active: mode.key === activeSessionType.value
|
||||
}))
|
||||
)
|
||||
})
|
||||
watch(
|
||||
() => [activeReviewPayload.value, activeReviewPanelScope.value],
|
||||
([payload]) => {
|
||||
@@ -1103,7 +1111,7 @@ export default {
|
||||
// reviewDrawerMode.value = resolveReviewRiskBriefs(payload).length
|
||||
// ? REVIEW_DRAWER_MODE_RISK
|
||||
// : REVIEW_DRAWER_MODE_REVIEW
|
||||
const shouldKeepFlowDrawer = reviewDrawerMode.value === REVIEW_DRAWER_MODE_FLOW && flowSteps.value.length > 0
|
||||
const shouldKeepFlowDrawer = reviewDrawerMode.value === REVIEW_DRAWER_MODE_FLOW && activeFlowSteps.value.length > 0
|
||||
resetReviewDrawerFromPayload(payload)
|
||||
if (shouldKeepFlowDrawer) {
|
||||
reviewDrawerMode.value = REVIEW_DRAWER_MODE_FLOW
|
||||
@@ -1148,6 +1156,17 @@ export default {
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => [activeSessionType.value, activeFlowSteps.value.length],
|
||||
([, activeCount], [, previousActiveCount] = []) => {
|
||||
if (activeCount <= 0 || previousActiveCount > 0) {
|
||||
return
|
||||
}
|
||||
reviewDrawerMode.value = REVIEW_DRAWER_MODE_FLOW
|
||||
insightPanelCollapsed.value = false
|
||||
}
|
||||
)
|
||||
|
||||
watch(
|
||||
() => composerDraft.value,
|
||||
() => {
|
||||
@@ -1664,6 +1683,9 @@ export default {
|
||||
}
|
||||
|
||||
function buildMessageBubbleClass(message) {
|
||||
if (message?.role === 'assistant' && message?.budgetReport) {
|
||||
return 'message-bubble-budget-report'
|
||||
}
|
||||
if (message?.role === 'assistant' && message?.applicationPreview) {
|
||||
return 'message-bubble-application-preview'
|
||||
}
|
||||
@@ -2217,7 +2239,7 @@ export default {
|
||||
flowRunId: flowRunId.value,
|
||||
flowRefreshBusy: flowRefreshBusy.value,
|
||||
refreshFlowRunDetail,
|
||||
flowSteps: flowSteps.value,
|
||||
flowSteps: activeFlowSteps.value,
|
||||
visibleFlowSteps: visibleFlowSteps.value,
|
||||
resolveFlowStepStatusLabel,
|
||||
formatFlowStepDuration,
|
||||
|
||||
Reference in New Issue
Block a user