feat(web): 申请单预览编辑器增强与报销流程细节适配
- useApplicationPreviewEditor 扩展字段编辑与校验,useTravelReimbursementApplicationPreviewDateEditor 微调日期处理 - travelReimbursementExpenseQueryModel/reimbursements 服务/expenseApplicationPreview 适配工号/邮箱字段与关联动作 - useWorkbenchAiApplicationPreviewFlow/usePersonalWorkbenchAiMode 接入关联门控后的预览流转 - TravelReimbursementCreateView 调整入口,TravelReimbursementMessageItem 适配 - 新增 expense-application-fast-preview 测试,更新 attachment-association-confirmation、review-drawer-switch 测试
This commit is contained in:
@@ -210,6 +210,7 @@ export function usePersonalWorkbenchAiMode(props, emit) {
|
||||
currentUser,
|
||||
persistCurrentConversation,
|
||||
pushInlineUserMessage,
|
||||
replaceInlineMessage,
|
||||
removeWorkbenchDateTag,
|
||||
resolveLatestInlineUserPrompt,
|
||||
scrollInlineConversationToBottom,
|
||||
@@ -565,6 +566,20 @@ export function usePersonalWorkbenchAiMode(props, emit) {
|
||||
return files.length ? '请帮我处理已上传的附件。' : ''
|
||||
}
|
||||
|
||||
function isReimbursementCreationIntent(prompt = '') {
|
||||
const compact = String(prompt || '').replace(/\s+/g, '')
|
||||
if (!compact || !/报销|报账/.test(compact)) {
|
||||
return false
|
||||
}
|
||||
if (/标准|制度|规则|政策|口径|怎么|如何|能不能|可以吗|查一下|查询|状态|进度|多少钱|多少/.test(compact)) {
|
||||
return false
|
||||
}
|
||||
return (
|
||||
/^(我要|我想|我需要|帮我|请帮我|需要|发起|新建|创建|提交|办理|走).{0,16}(报销|报账)/.test(compact) ||
|
||||
/^(报销|报账)(一下|一笔|单|流程)?$/.test(compact)
|
||||
)
|
||||
}
|
||||
|
||||
function handleAiAnswerMarkdownClick(event) {
|
||||
const target = event?.target
|
||||
const link = target?.closest?.('a[href^="#ai-open-document-detail:"], a[href^="#ai-open-application-detail:"]')
|
||||
@@ -600,6 +615,11 @@ export function usePersonalWorkbenchAiMode(props, emit) {
|
||||
return
|
||||
}
|
||||
|
||||
if (isReimbursementCreationIntent(cleanPrompt)) {
|
||||
void expenseFlow.startAiReimbursementAssociationGate(cleanPrompt, entry.label || '我要报销')
|
||||
return
|
||||
}
|
||||
|
||||
if (conversationId.value === AI_SEARCH_CONVERSATION_ID) {
|
||||
conversationId.value = ''
|
||||
conversationMessages.value = []
|
||||
@@ -636,7 +656,7 @@ export function usePersonalWorkbenchAiMode(props, emit) {
|
||||
|
||||
function runAiModeAction(item) {
|
||||
if (String(item?.label || '').trim() === '发起报销') {
|
||||
expenseFlow.pushInlineExpenseSceneSelectionPrompt(item.prompt, item.label)
|
||||
void expenseFlow.startAiReimbursementAssociationGate(item.prompt, item.label)
|
||||
return
|
||||
}
|
||||
startInlineConversation(item.prompt, item, Array.from(selectedFiles.value))
|
||||
|
||||
@@ -40,7 +40,7 @@ function isApplicationPreviewEstimatePendingPreview(applicationPreview = {}) {
|
||||
}
|
||||
|
||||
function shouldRefreshInlineApplicationPreviewEstimate(fieldKey = '') {
|
||||
return ['transportMode', 'time', 'location', 'days'].includes(String(fieldKey || '').trim())
|
||||
return ['transportMode', 'time', 'time_return', 'location', 'days'].includes(String(fieldKey || '').trim())
|
||||
}
|
||||
|
||||
export function useWorkbenchAiApplicationPreviewFlow({
|
||||
|
||||
Reference in New Issue
Block a user