feat: 报销预审会话状态管理与工作台交互增强

- 新增差旅报销会话状态管理与对话模型重构
- 增强风险观测服务与运行时聊天上下文作用域
- 优化工作台图标资源、助理意图识别与摘要工具
- 完善报销创建视图样式与差旅详情页标准调整交互
- 补充风险观测、运行时聊天与报销端点测试覆盖
This commit is contained in:
caoxiaozhu
2026-06-04 11:03:29 +08:00
parent 87da5df91b
commit 1cbf3fee44
60 changed files with 4156 additions and 393 deletions

View File

@@ -9,7 +9,7 @@
<article class="panel assistant-hero" :style="{ '--assistant-bg-image': `url(${workbenchHeroBackground})` }">
<div class="assistant-copy">
<h1>{{ displayUserName }}我是您的 <span>AI 费用助手</span></h1>
<h1>{{ displayUserName }}我是您的 <span>小财管家</span></h1>
<input
ref="fileInputRef"
@@ -26,7 +26,7 @@
v-model="assistantDraft"
maxlength="1000"
rows="2"
placeholder="请输入费用申请、报销问题、预算查询或制度问答..."
placeholder="一次性描述申请、报销和附件处理事项,小财管家会先拆解再执行..."
:readonly="isComposerPending"
@keydown.enter.prevent="handleWorkbenchEnter"
/>
@@ -180,7 +180,12 @@
:class="`capability-card--${item.tone}`"
@click="openCapabilityAssistant(item)"
>
<span class="capability-icon"><i :class="item.icon"></i></span>
<WorkbenchListIcon
class="capability-icon"
:icon-key="item.key"
color="var(--capability-color)"
accent="var(--capability-soft)"
/>
<span class="capability-copy">
<strong>{{ item.title }}</strong>
<small>{{ item.primary }}</small>
@@ -221,8 +226,8 @@
<small>{{ item.id }}</small>
</span>
<span class="progress-type" :title="item.expenseTypeLabel || '其他费用'">
<strong>{{ item.expenseTypeLabel || '其他费用' }}</strong>
<span class="progress-type" :title="`${item.documentTypeLabel} · ${item.expenseTypeLabel || '其他费用'}`">
<strong>{{ item.documentTypeLabel }} · {{ item.expenseTypeLabel || '其他费用' }}</strong>
</span>
<span class="progress-steps" aria-hidden="true">
@@ -349,9 +354,10 @@
<script setup>
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
import PanelHead from '../shared/PanelHead.vue'
import WorkbenchListIcon from '../shared/WorkbenchListIcon.vue'
import ExpenseStatsDetailModal from './ExpenseStatsDetailModal.vue'
import ExpenseProfileDetailModal from './ExpenseProfileDetailModal.vue'
import workbenchHeroBackground from '../../assets/personal-workbench-hero-bg-theme-base.webp'
import workbenchHeroBackground from '../../assets/images/hero-3d-banner.png'
import { useSystemState } from '../../composables/useSystemState.js'
import { useToast } from '../../composables/useToast.js'
import { useWorkbenchComposerDate } from '../../composables/useWorkbenchComposerDate.js'
@@ -425,6 +431,7 @@ let employeeProfileLoadSeq = 0
const MAX_ATTACHMENTS = 10
const SESSION_TYPE_EXPENSE = 'expense'
const SESSION_TYPE_KNOWLEDGE = 'knowledge'
const SESSION_TYPE_STEWARD = 'steward'
const hasExpenseConversation = computed(() =>
Boolean(latestExpenseConversation.value?.conversation_id || latestExpenseConversation.value?.conversationId)
@@ -607,6 +614,7 @@ function buildAssistantPayload() {
return {
prompt: buildWorkbenchPromptText(),
source: 'workbench',
sessionType: SESSION_TYPE_STEWARD,
files: Array.from(selectedFiles.value)
}
}
@@ -674,7 +682,7 @@ function applyQuickPrompt(prompt) {
focusAssistantInput()
}
function openPromptAssistant(prompt) {
function openPromptAssistant(prompt, sessionType = SESSION_TYPE_STEWARD) {
if (pendingAction.value) {
return
}
@@ -682,6 +690,7 @@ function openPromptAssistant(prompt) {
const payload = {
prompt: buildWorkbenchPromptText(prompt),
source: 'workbench',
sessionType,
files: Array.from(selectedFiles.value),
conversation: null
}
@@ -704,7 +713,7 @@ function openWorkbenchTarget(item) {
return
}
openPromptAssistant(item?.prompt || `查询 ${item?.id || ''} 的费用进度`)
openPromptAssistant(item?.prompt || `查询 ${item?.id || ''} 的费用进度`, SESSION_TYPE_EXPENSE)
}
function openCapabilityAssistant(item) {