Merge branch 'dev' into test

This commit is contained in:
sophie committed 2026-05-14 16:37:50 +08:00
commit 49f4ea1281
1 file changed
+19
+19
View File
@@ -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
);