feat: collect editable scheduled batches and show order details in modals

This commit is contained in:
abaishu0730 committed 2026-10-26 09:53:45 +08:00
1 parent 8d010a05cd
commit c19be938fc
20 files changed
+212 -34

No files matched your search

+2
View File
@@ -12,6 +12,8 @@ async function orderRuleApi({orderRules,mail,workspace,user,url,route,method,bod
if(method!=='POST')fail('没有找到此规则操作。',404);
if(user.role==='viewer')fail('只读成员不能编辑规则或提交样本。',403);
const actor=user.username;
const content=/^\/api\/order-rules\/batches\/(collecting-[a-f0-9]{32})\/content$/.exec(route);
if(content){const saved=require('./collecting-batches.cjs').save(orderRules,content[1],body,user);workspace?.record(user,'编辑批次内容',saved.id);reply(200,require('./query.cjs').batchDetail({orderRules,workspace},saved.id,user));return true;}
const migration=/^\/api\/order-rules\/rules\/([\w-]+)\/migration\/(preview|apply)$/.exec(route);
if(migration){if(user.role!=='admin')fail('仅管理员可迁移规则。',403);if(!body||Object.keys(body).some(k=>!['version','idempotencyKey','note'].includes(k)))fail('迁移参数无效。');reply(200,orderRules[migration[2]==='preview'?'previewMigration':'applyMigration'](migration[1],body,actor));return true;}
const trial=/^\/api\/order-rules\/rules\/([\w-]+)\/trial$/.exec(route);