feat: unify order workbench and stable paged evidence views

This commit is contained in:
abaishu0730 committed 2026-10-21 11:04:43 +08:00
1 parent 10eac70745
commit 84e2f0d9ba
30 files changed
+543 -294

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@ window.PageLifecycle=(()=>{
const entries=()=>[...forms].filter(([f,s])=>f.isConnected&&snapshot(f)!==s.baseline).map(([f,s])=>({dirty:()=>true,sensitive:s.sensitive,save:s.save})).concat([...registrations].filter(r=>r.dirty()));
function bind(){if(!host)return;for(const form of host.querySelectorAll('form')){
if(forms.has(form)||form.dataset.lifecycle==='custom'||form.id==='assistant-compose'||!form.onsubmit||!form.querySelector('button[type="submit"]'))continue;
const state={baseline:snapshot(form),busy:false,failed:false,sensitive:/password|^user-form$/.test(form.id)||!!form.querySelector('input[type="password"]')||form.matches('[data-rule-resend],[data-rule-resolve],[data-rule-recheck],[data-execution-retry],#execution-scan,#exception-action,#storage-archive-form,#storage-folder-form'),save:null};forms.set(form,state);const original=form.onsubmit;
const state={baseline:snapshot(form),busy:false,failed:false,sensitive:/password|^user-form$/.test(form.id)||!!form.querySelector('input[type="password"]')||form.matches('#user-lifecycle-form,[data-business-action],[data-business-scan],[data-owner-transfer],[data-rule-resend],[data-rule-resolve],[data-rule-recheck],[data-execution-retry],#execution-scan,#exception-action,#storage-archive-form,#storage-folder-form'),save:null};forms.set(form,state);const original=form.onsubmit;
form.onsubmit=async event=>{event.preventDefault();if(state.busy)return;state.busy=true;state.failed=false;state.committed=false;state.submitted=snapshot(form);form.setAttribute('aria-busy','true');const previous=activeSubmission;activeSubmission=state;
const locked=[...form.querySelectorAll('input,select,textarea')].filter(field=>!field.disabled);let restore=false;try{const work=original.call(form,event);if(form.id!=='schedule-form'&&work&&typeof work.then==='function'){restore=true;for(const field of locked)field.disabled=true;}await work;}catch(error){state.failed=true;window.dispatchEvent(new CustomEvent('page-operation-error',{detail:error}));}finally{if(restore&&form.isConnected)for(const field of locked)field.disabled=false;if(!state.failed&&state.committed)state.baseline=state.sensitive?snapshot(form):state.submitted;state.busy=false;form.removeAttribute('aria-busy');activeSubmission=previous;}
};
+6 -6
View File
@@ -1,14 +1,14 @@
'use strict';
window.AppNavigation=(()=>{
const primary=[['overview','overview'],['order-notifications','mail'],['records','file'],['exceptions','alert'],['assistant','spark'],['business-settings','rules'],['system-settings','settings']];
const primary=[['overview','overview'],['notification-orders','file'],['notification-batches','mail'],['tools','spark'],['exceptions','alert'],['business-settings','rules'],['system-settings','settings']];
const groups={
records:['records','records-pdf'],
'order-notifications':['order-notifications','notification-execution','notification-orders','notification-batches','notification-history','schedule'],
tools:['records','records-pdf','assistant','storage'],
'order-notifications':['notification-orders','notification-batches','schedule'],
'business-settings':['order-rules','rule-fields'],
'system-settings':['bpm','mail','storage','assistant-settings','health','users','audit']
'system-settings':['bpm','mail','assistant-settings','health','users','audit']
};
const configuration=['schedule','calendar','templates','notification-settings'];
const aliases={'business-settings':'order-rules','system-settings':'bpm',rules:'order-rules',notifications:'order-rules',supervisor:'health',connections:'health'};
const aliases={'order-notifications':'overview','notification-execution':'notification-orders','notification-history':'notification-batches',tools:'records','business-settings':'order-rules','system-settings':'bpm',rules:'order-rules',notifications:'order-rules',supervisor:'health',connections:'health'};
const icons={
overview:'M4 4h6v6H4z M14 4h6v6h-6z M4 14h6v6H4z M14 14h6v6h-6z',
mail:'M4 5h16v14H4z M4 6l8 6 8-6',
@@ -36,7 +36,7 @@ window.AppNavigation=(()=>{
if(item.left<box.left+5)container.scrollLeft-=box.left+5-item.left;
else if(item.right>box.right-5)container.scrollLeft+=item.right-box.right+5;
}
function links(ids,active,{views,esc},labels={}){return ids.map(id=>`<a class="nav-link settings-tab ${active===id?'active':''}" href="${window.RecordState?.href(id)||'#'+id}" ${['records','records-pdf'].includes(id)?'data-record-route="'+id+'"':''} ${active===id?'aria-current="page"':''}>${icon(routeIcons[id])}<span>${esc(labels[id]||views[id][0])}</span></a>`).join('');}
function links(ids,active,{views,esc},labels={}){return ids.map(id=>`<a class="nav-link settings-tab ${active===id?'active':''}" href="${window.RecordState?.href(id)||'#'+id}" ${['records','records-pdf','notification-orders','notification-batches'].includes(id)?'data-record-route="'+id+'"':''} ${active===id?'aria-current="page"':''}>${icon(routeIcons[id])}<span>${esc(labels[id]||views[id][0])}</span></a>`).join('');}
function renderTabs(container,{id,user,views,esc}){
const section=sectionFor(id);container.hidden=!section;
container.className='nav nav-segmented settings-tabs';container.setAttribute('aria-label',section==='records'?'记录导航':section==='order-notifications'?'订单通知管理导航':section==='business-settings'?'业务设置导航':'系统设置导航');