import{d as F,l as J,B as V,a as M,c as k,b as a,w as t,e as r,o as l,j as C,n as e,I as h,f as _,t as u,L as O,M as U,J as m,T as b,a9 as q,m as w,p as A,h as G,_ as H}from"./index-FX23dEwE.js";const Q=d=>(A("data-v-4c314c51"),d=d(),G(),d),W={class:"__container_common_config"},X={class:"title"},Y=Q(()=>C("div",{class:"bg"},null,-1)),Z={class:"truncate-text"},ee={key:0,style:{float:"right"}},te=F({__name:"ConfigPage",props:{options:{}},setup(d){let y=d,s=J(()=>y.options.list[y.options.current[0]]),x=V(null),g=V(!1),I=M();async function z(){g.value=!0,await x.value.validate().catch(c=>{w.error("submit failed [form check]: "+c),g.value=!1});let n=y.options.list[y.options.current[0]];await n.submit(n.form).catch(c=>{w.error("submit failed [server error]: "+c)}),g.value=!1,w.success("submit success")}function K(){s.value.reset(s.value.form)}return(n,c)=>{const L=r("a-tooltip"),P=r("a-menu-item"),R=r("a-menu"),$=r("a-card"),B=r("a-col"),v=r("a-button"),T=r("a-form"),j=r("a-form-item"),D=r("a-spin"),E=r("a-row");return l(),k("div",W,[a(E,{gutter:20},{default:t(()=>[a(B,{span:6},{default:t(()=>[a($,{class:"__opt"},{title:t(()=>[C("div",X,[Y,a(e(h),{class:"title-icon",icon:"icon-park-twotone:application-one"}),a(L,{placement:"topLeft"},{title:t(()=>{var o;return[_(u((o=e(I).params)==null?void 0:o.pathId),1)]}),default:t(()=>{var o;return[C("span",Z,u((o=e(I).params)==null?void 0:o.pathId),1)]}),_:1})])]),default:t(()=>[a(R,{selectedKeys:n.options.current,"onUpdate:selectedKeys":c[0]||(c[0]=o=>n.options.current=o)},{default:t(()=>[(l(!0),k(O,null,U(n.options.list,(o,i)=>(l(),m(P,{key:i},{default:t(()=>[i===n.options.current[0]?(l(),m(e(h),{key:0,style:{"margin-bottom":"-5px","font-size":"20px"},icon:"material-symbols:settings-b-roll-rounded"})):(l(),m(e(h),{key:1,style:{"margin-bottom":"-5px","font-size":"20px",color:"grey"},icon:"material-symbols:settings-b-roll-outline-rounded"})),_(" "+u(n.$t(o.title)),1)]),_:2},1024))),128))]),_:1},8,["selectedKeys"])]),_:1})]),_:1}),a(B,{span:18},{default:t(()=>[a($,null,{title:t(()=>{var o;return[_(u(n.$t(e(s).title))+" ",1),(o=e(s))!=null&&o.ext?(l(),k("div",ee,[a(v,{type:"primary",onClick:c[1]||(c[1]=i=>{var p,f,S,N;return(N=(p=e(s))==null?void 0:p.ext)==null?void 0:N.fun((S=(f=e(s))==null?void 0:f.form)==null?void 0:S.rules)})},{default:t(()=>{var i,p;return[_(u((p=(i=e(s))==null?void 0:i.ext)==null?void 0:p.title),1)]}),_:1})])):b("",!0)]}),default:t(()=>[a(D,{spinning:e(g)},{default:t(()=>{var o,i;return[(l(),m(T,{style:{overflow:"auto","max-height":"calc(100vh - 450px)"},ref_key:"__config_form",ref:x,key:n.options.current,"wrapper-col":{span:14},model:e(s).form,"label-col":{style:{width:"100px"}},layout:"horizontal"},{default:t(()=>[q(n.$slots,"form_"+e(s).key,{current:e(s)},void 0,!0)]),_:3},8,["model"])),(o=e(s))!=null&&o.submit||(i=e(s))!=null&&i.reset?(l(),m(j,{key:0,style:{margin:"20px 0 0 100px"}},{default:t(()=>{var p,f;return[(p=e(s))!=null&&p.submit?(l(),m(v,{key:0,type:"primary",onClick:z},{default:t(()=>[_(u(n.$t("submit")),1)]),_:1})):b("",!0),(f=e(s))!=null&&f.reset?(l(),m(v,{key:1,style:{"margin-left":"10px"},onClick:K},{default:t(()=>[_(u(n.$t("reset")),1)]),_:1})):b("",!0)]}),_:1})):b("",!0)]}),_:3},8,["spinning"])]),_:3})]),_:3})]),_:3})])}}}),se=H(te,[["__scopeId","data-v-4c314c51"]]);export{se as C};
