diff --git a/frontend/src/views/ChatView.vue b/frontend/src/views/ChatView.vue index 0a6e2f58..ce73a026 100644 --- a/frontend/src/views/ChatView.vue +++ b/frontend/src/views/ChatView.vue @@ -634,6 +634,25 @@ const isStrongLeaveIntent = (content: string) => { return /(我要请假|申请请假|发起请假|请假申请|我要休假|申请休假|我要请个假|想请假|帮我请假|代我请假|提交请假)/.test(normalized); }; +const startLocalLeaveFlow = (content: string) => { + const formId = newLocalMessageId('leave-form'); + const payload: LeaveFormPayload = { + formId, + form: createLeaveFormData(), + submitting: false, + confirmationGenerated: false, + }; + messages.value.push({ role: 'user', content, type: 'text' }); + messages.value.push({ + role: 'assistant', + type: 'leave-form', + content: '已为你生成请假申请表,请直接在下方填写并提交。或登录OA系统直接申请', + payload, + local_id: formId, + local_only: true, + }); +}; + const getLeaveFormPayload = (msg: any): LeaveFormPayload | null => ( msg?.type === 'leave-form' && msg?.payload ? msg.payload as LeaveFormPayload : null );