perf: streamline rule reads and unblock background discovery

This commit is contained in:
abaishu0730 committed 2026-10-26 16:13:15 +08:00
1 parent b14fa2f4d1
commit b17b975812
19 files changed
+263 -42

No files matched your search

+1
View File
@@ -78,6 +78,7 @@ async function updateAutomationStatus(isActive){
if(typeof data?.settings?.enabled!=='boolean')throw Error('服务端未返回有效通知开关');
const missing=Object.entries({liveTodo:'实时待办接入',pdfExport:'PDF 导出',automaticArchive:'自动归档'}).filter(([key])=>data.capabilities?.[key]!==true).map(([,label])=>label);
if(!data.settings.enabled)apply('自动通知已暂停','secondary','自动发信保持暂停;请完成类别字段、目录、邮箱与预览核验。'+(missing.length?' 待检查:'+missing.join('、'):' 点击查看发送设置。'));
else if(missing.length&&data.capabilities?.liveTodo===true&&data.counts?.orders===0&&!(data.scans||[]).some(scan=>scan.status==='failed'))apply('自动通知待验证','yellow','当前没有匹配订单;'+missing.join('、')+'尚待实际业务验证。匹配订单到达后按流程核验。');
else if(missing.length)apply('自动通知受阻','yellow','未通过实际检查:'+missing.join('、')+'。点击查看发送设置。');
else apply('自动通知已启用','green','通知开关已启用;实际任务、类别及批次仍按各自检查结果执行。');
}catch(error){apply('通知状态待确认','yellow',error.message+';请刷新重试。');}