import{b as D}from"./index-f6f689f9-1782572373740v=1.0.0.js";import{y as S,c as y,r as g,m as P,al as d,z as R,I as w,J as t,B as b,R as u,a8 as i,a9 as f,u as l,O as V}from"./vendor-866bb149-1782572373740v=1.0.0.js";const N={type:[],name:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0",trigger:"blur"},{max:255,message:"\u6700\u591A 255 \u4E2A\u5B57\u7B26",trigger:"blur"}],dictTypeSign:[{required:!0,message:"\u8BF7\u8F93\u5165\u5B57\u5178\u6807\u8BC6",trigger:"blur"},{max:50,message:"\u6700\u591A 50 \u4E2A\u5B57\u7B26",trigger:"blur"}],status:[],creatorOrganUnitType:[{max:200,message:"\u6700\u591A 200 \u4E2A\u5B57\u7B26",trigger:"blur"}]},J={class:"pt20 mt30"},z=S({__name:"BaseForm",props:{value:Object,loading:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit"],setup(C,{emit:x}){D();let _=C;const B=x,o=y({get(){return A(_.value)},set(a){B("update:value",a)}}),v=y({get(){return _.loading},set(a){B("update:loading",a)}}),F=g();g({xs:24,sm:22,md:20,lg:14,xl:13});const m=g({xs:24,sm:24,md:12,lg:12,xl:12});g({xs:24,sm:22,md:18,lg:16,xl:8});const A=a=>a,E=()=>JSON.parse(JSON.stringify(o.value)),T=a=>{a.validate(async(e,s)=>{if(e){let r=E();B("submit",r)}else{const r=Object.keys(s)[0];a.scrollToField(r)}})},O=()=>{B("cancel")};return P(()=>{}),(a,e)=>{const s=d("el-input"),r=d("el-form-item"),p=d("PaCol"),U=d("PaRow"),c=d("el-button"),k=d("el-form");return R(),w(k,{model:l(o),ref_key:"formRef",ref:F,rules:l(N),"label-width":"160px"},{default:t(()=>[e[8]||(e[8]=b("div",{class:"divider mb30"},"\u57FA\u7840\u4FE1\u606F",-1)),u(U,null,{default:t(()=>[u(p,i(f(l(m))),{default:t(()=>[u(r,{label:"\u7C7B\u578B ",prop:"type"},{default:t(()=>[u(s,{modelValue:l(o).type,"onUpdate:modelValue":e[0]||(e[0]=n=>l(o).type=n),placeholder:"\u8BF7\u8F93\u5165\u7C7B\u578B "},null,8,["modelValue"])]),_:1})]),_:1},16),u(p,i(f(l(m))),{default:t(()=>[u(r,{label:"\u540D\u79F0",prop:"name"},{default:t(()=>[u(s,{modelValue:l(o).name,"onUpdate:modelValue":e[1]||(e[1]=n=>l(o).name=n),placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue"])]),_:1})]),_:1},16),u(p,i(f(l(m))),{default:t(()=>[u(r,{label:"\u5B57\u5178\u6807\u8BC6",prop:"dictTypeSign"},{default:t(()=>[u(s,{modelValue:l(o).dictTypeSign,"onUpdate:modelValue":e[2]||(e[2]=n=>l(o).dictTypeSign=n),placeholder:"\u8BF7\u8F93\u5165\u5B57\u5178\u6807\u8BC6"},null,8,["modelValue"])]),_:1})]),_:1},16),u(p,i(f(l(m))),{default:t(()=>[u(r,{label:"\u72B6\u6001",prop:"status"},{default:t(()=>[u(s,{modelValue:l(o).status,"onUpdate:modelValue":e[3]||(e[3]=n=>l(o).status=n),placeholder:"\u8BF7\u8F93\u5165\u72B6\u6001"},null,8,["modelValue"])]),_:1})]),_:1},16),u(p,i(f(l(m))),{default:t(()=>[u(r,{label:"\u521B\u5EFA\u4EBA",prop:"creatorOrganUnitType"},{default:t(()=>[u(s,{modelValue:l(o).creatorOrganUnitType,"onUpdate:modelValue":e[4]||(e[4]=n=>l(o).creatorOrganUnitType=n),placeholder:"\u8BF7\u8F93\u5165\u521B\u5EFA\u4EBA"},null,8,["modelValue"])]),_:1})]),_:1},16)]),_:1}),u(r,null,{default:t(()=>[b("div",J,[u(c,{onClick:O},{default:t(()=>e[6]||(e[6]=[V("\u8FD4\u56DE",-1)])),_:1,__:[6]}),u(c,{type:"primary",loading:l(v),onClick:e[5]||(e[5]=n=>T(l(F)))},{default:t(()=>e[7]||(e[7]=[V("\u4FDD\u5B58",-1)])),_:1,__:[7]},8,["loading"])])]),_:1})]),_:1,__:[8]},8,["model","rules"])}}});export{z as _};
