feat: simplify category rule configuration and add safe Excel import

This commit is contained in:
abaishu0730 committed 2026-10-19 17:52:42 +08:00
1 parent fbe39c8267
commit 3846e1598c
31 files changed
+437 -123

No files matched your search

+1 -1
View File
@@ -16,7 +16,7 @@ function effects(rule,event,store){
const file={name:result.filename,path:result.path,size:0,sha256:'0'.repeat(64),kind:'pdf'};
const order={id:'simulation',event,ruleSnapshot:rule,status:'pending',archive:{archivedAt:store.now(),files:[file]}};
const cutoff=new Date(Math.max(Date.parse(event.receivedAt),Date.parse(store.now()))).toISOString();
const snapshot=applyBodyTemplate(buildBatch(rule,[order],cutoff,{maxMessageBytes:store.settings().maxMessageBytes}),store.templateResolver?.(rule.categoryId),[order],store.settings().maxMessageBytes);
const snapshot=applyBodyTemplate(buildBatch(rule,[order],cutoff,{maxMessageBytes:store.settings().maxMessageBytes}),store.templateResolver?.(rule.categoryId,rule),[order],store.settings().maxMessageBytes);
result.mail={subject:snapshot.subject,text:snapshot.text,to:snapshot.to,cc:snapshot.cc,attachments:snapshot.attachments.map(f=>f.name),template:snapshot.template||null};
}catch(error){result.issues.push(error.message);}
return result;