import{i as I,f as A,e3 as P,aT as C,bU as H,__tla as M}from"./index-7d5b26d3.js";import{e as S,t as g,f as x}from"./tree-0af4953a.js";import{c as D,a as N,g as U,__tla as j}from"./dict-37d1dfe8.js";import{_ as k,__tla as q}from"./DictTag-89bfbd38.js";let E,z=Promise.all([(()=>{try{return M}catch{}})(),(()=>{try{return j}catch{}})(),(()=>{try{return q}catch{}})()]).then(async()=>{let y,T,w,F,v,_;({t:y}=I()),E=l=>{const o=A({searchSchema:[],tableColumns:[],formSchema:[],detailSchema:[]}),a=T(l,o);o.searchSchema=a||[];const s=w(l);o.tableColumns=s||[];const t=F(l,o);o.formSchema=t;const r=v(l);return o.detailSchema=r,{allSchemas:o}},T=(l,o)=>{const a=[],s=[];S(l,t=>{var r,m,e,p;if(t!=null&&t.isSearch||(r=t.search)!=null&&r.show){let u=((m=t==null?void 0:t.search)==null?void 0:m.component)||"Input";const f=[];let h={};if(t.dictType){const i={label:"\u5168\u90E8",value:""};f.push(i),D(t.dictType).forEach(c=>{f.push(c)}),h={options:f},(e=t.search)!=null&&e.component||(u="Select")}const d=P({component:u,...t.search,field:t.field,label:((p=t.search)==null?void 0:p.label)||t.label},{componentProps:h});d.api&&s.push(async()=>{var c;const i=await d.api();if(i){const n=C(o.searchSchema,b=>b.field===d.field);n!==-1&&(o.searchSchema[n].componentProps.options=_(i,(c=d.componentProps.optionsAlias)==null?void 0:c.labelField))}}),delete d.show,a.push(d)}});for(const t of s)t();return a},w=l=>{const o=g(l,{conversion:a=>{var s;if((a==null?void 0:a.isTable)!==!1&&((s=a==null?void 0:a.table)==null?void 0:s.show)!==!1)return!a.formatter&&a.dictType&&(a.formatter=(t,r,m)=>H(k,{type:a.dictType,value:m})),{...a.table,...a}}});return x(o,a=>(a.children===void 0&&delete a.children,!!a.field))},F=(l,o)=>{const a=[],s=[];S(l,t=>{var r,m,e,p,u;if((t==null?void 0:t.isForm)!==!1&&((r=t==null?void 0:t.form)==null?void 0:r.show)!==!1){let f=((m=t==null?void 0:t.form)==null?void 0:m.component)||"Input",h="";(e=t.form)!=null&&e.value?h=(p=t.form)==null?void 0:p.value:f==="InputNumber"&&(h=0);let d={};if(t.dictType){const c=[];t.dictClass&&t.dictClass==="number"?N(t.dictType).forEach(n=>{c.push(n)}):t.dictClass&&t.dictClass==="boolean"?U(t.dictType).forEach(n=>{c.push(n)}):D(t.dictType).forEach(n=>{c.push(n)}),d={options:c},t.form&&t.form.component||(f="Select")}const i=P({component:f,value:h,...t.form,field:t.field,label:((u=t.form)==null?void 0:u.label)||t.label},{componentProps:d});i.api&&s.push(async()=>{var n;const c=await i.api();if(c){const b=C(o.formSchema,Y=>Y.field===i.field);b!==-1&&(o.formSchema[b].componentProps.options=_(c,(n=i.componentProps.optionsAlias)==null?void 0:n.labelField))}}),delete i.show,a.push(i)}});for(const t of s)t();return a},v=l=>{const o=[];return S(l,a=>{var s,t,r,m,e;if((a==null?void 0:a.isDetail)!==!1&&((s=a.detail)==null?void 0:s.show)!==!1){const p={...a.detail,field:a.field,label:((t=a.detail)==null?void 0:t.label)||a.label};a.dictType&&(p.dictType=a.dictType),((r=a.detail)!=null&&r.dateFormat||a.formatter=="formatDate")&&(p.dateFormat=(m=a==null?void 0:a.detail)!=null&&m.dateFormat?(e=a==null?void 0:a.detail)==null?void 0:e.dateFormat:"YYYY-MM-DD HH:mm:ss"),delete p.show,o.push(p)}}),o},_=(l,o)=>l==null?void 0:l.map(a=>(o?a.labelField=y(a.labelField):a.label=y(a.label),a))});export{z as __tla,E as u};
