import{aV as u,J as C,A as D,c$ as w,dP as T,bS as F,a3 as E,M as Y,bW as A}from"./index-CHTXMeh8.js";import{e as S,b as I,f as M}from"./tree-BBZY150N.js";import{_ as H}from"./DictTag.vue_vue_type_script_lang-DPOZRs0A.js";const x=async s=>await u.get({url:"/system/mail-account/page",params:s}),J=async s=>await u.get({url:"/system/mail-account/get?id="+s}),N=async s=>await u.post({url:"/system/mail-account/create",data:s}),V=async s=>await u.put({url:"/system/mail-account/update",data:s}),W=async s=>await u.delete({url:"/system/mail-account/delete?id="+s}),_=async()=>u.get({url:"/system/mail-account/simple-list"}),{t:v}=C(),$=s=>{const o=D({searchSchema:[],tableColumns:[],formSchema:[],detailSchema:[]}),t=j(s,o);o.searchSchema=t||[];const l=k(s);o.tableColumns=l||[];const a=q(s,o);o.formSchema=a;const i=z(s);return o.detailSchema=i,{allSchemas:o}},j=(s,o)=>{const t=[],l=[];S(s,a=>{var i,m,d,p;if(a!=null&&a.isSearch||(i=a.search)!=null&&i.show){let b=((m=a==null?void 0:a.search)==null?void 0:m.component)||"Input";const f=[];let h={};if(a.dictType){const n={label:"\u5168\u90E8",value:""};f.push(n),w(a.dictType).forEach(c=>{f.push(c)}),h={options:f},(d=a.search)!=null&&d.component||(b="Select")}const e=T({component:b,...a.search,field:a.field,label:((p=a.search)==null?void 0:p.label)||a.label},{componentProps:h});e.api&&l.push(async()=>{var c;const n=await e.api();if(n){const r=F(o.searchSchema,y=>y.field===e.field);r!==-1&&(o.searchSchema[r].componentProps.options=P(n,(c=e.componentProps.optionsAlias)==null?void 0:c.labelField))}}),delete e.show,t.push(e)}});for(const a of l)a();return t},k=s=>{const o=I(s,{conversion:t=>{var l;if((t==null?void 0:t.isTable)!==!1&&((l=t==null?void 0:t.table)==null?void 0:l.show)!==!1)return!t.formatter&&t.dictType&&(t.formatter=(a,i,m)=>A(H,{type:t.dictType,value:m})),{...t.table,...t}}});return M(o,t=>(t.children===void 0&&delete t.children,!!t.field))},q=(s,o)=>{const t=[],l=[];S(s,a=>{var i,m,d,p,b;if((a==null?void 0:a.isForm)!==!1&&((i=a==null?void 0:a.form)==null?void 0:i.show)!==!1){let f=((m=a==null?void 0:a.form)==null?void 0:m.component)||"Input",h="";(d=a.form)!=null&&d.value?h=(p=a.form)==null?void 0:p.value:f==="InputNumber"&&(h=0);let e={};if(a.dictType){const c=[];a.dictClass&&a.dictClass==="number"?E(a.dictType).forEach(r=>{c.push(r)}):a.dictClass&&a.dictClass==="boolean"?Y(a.dictType).forEach(r=>{c.push(r)}):w(a.dictType).forEach(r=>{c.push(r)}),e={options:c},a.form&&a.form.component||(f="Select")}const n=T({component:f,value:h,...a.form,field:a.field,label:((b=a.form)==null?void 0:b.label)||a.label},{componentProps:e});n.api&&l.push(async()=>{var r;const c=await n.api();if(c){const y=F(o.formSchema,g=>g.field===n.field);y!==-1&&(o.formSchema[y].componentProps.options=P(c,(r=n.componentProps.optionsAlias)==null?void 0:r.labelField))}}),delete n.show,t.push(n)}});for(const a of l)a();return t},z=s=>{const o=[];return S(s,t=>{var l,a,i,m,d;if((t==null?void 0:t.isDetail)!==!1&&((l=t.detail)==null?void 0:l.show)!==!1){const p={...t.detail,field:t.field,label:((a=t.detail)==null?void 0:a.label)||t.label};t.dictType&&(p.dictType=t.dictType),((i=t.detail)!=null&&i.dateFormat||t.formatter=="formatDate")&&(p.dateFormat=(m=t==null?void 0:t.detail)!=null&&m.dateFormat?(d=t==null?void 0:t.detail)==null?void 0:d.dateFormat:"YYYY-MM-DD HH:mm:ss"),delete p.show,o.push(p)}}),o},P=(s,o)=>s==null?void 0:s.map(t=>(o?t.labelField=v(t.labelField):t.label=v(t.label),t));export{V as a,x as b,N as c,W as d,_ as e,J as g,$ as u};