import{b as T,_ as q}from"./index-f6f689f9-1782572373740v=1.0.0.js";import{y as z,c as V,r as f,m as G,al as n,z as _,I as b,J as a,R as l,a8 as v,a9 as F,u,B as g,A as Q,Q as $,a4 as H,M as B,O as k}from"./vendor-866bb149-1782572373740v=1.0.0.js";import"./eleVendor-48a7d3b8-1782572373740v=1.0.0.js";const K={status:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001",trigger:"change"}],title:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BC1\u4E66\u6807\u9898",trigger:"blur"},{max:255,message:"\u6700\u591A 255 \u4E2A\u5B57\u7B26",trigger:"blur"}],content:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BC1\u4E66\u5185\u5BB9",trigger:"change"}],certificateCoverUrl:[],awardUnit:[{max:200,message:"\u6700\u591A 200 \u4E2A\u5B57\u7B26",trigger:"blur"}]},W={class:"flexBox"},X={class:"checkboxInput",style:{bottom:"60px"}},Y={class:"checkboxInput"},Z={class:"pt20 mt30"},ee=z({__name:"BaseForm",props:{value:Object,loading:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit"],setup(w,{emit:A}){T();let C=w;const c=A,t=V({get(){return O(C.value)},set(o){c("update:value",o)}}),N=V({get(){return C.loading},set(o){c("update:loading",o)}}),D=f(),p=f({xs:24,sm:22,md:20,lg:14,xl:13});f({xs:24,sm:24,md:12,lg:12,xl:12}),f({xs:24,sm:22,md:18,lg:16,xl:8});const E=[{label:"\u8D5B\u4E8B\u540D\u79F0",value:"isEventName"},{label:"\u9879\u76EE\u4E0E\u7EC4\u522B",value:"isEventGroup"},{label:"\u5355\u4F4D\u4E0E\u59D3\u540D",value:"isUnitName"},{label:"\u53C2\u8D5B\u8005\u59D3\u540D",value:"isTsName"},{label:"\u5956\u9879\u540D\u79F0",value:"isDictName"},{label:"\u88C1\u5224\u957F",value:"isReferee"},{label:"\u9881\u53D1\u5355\u4F4D",value:"isAwardUnit"},{label:"\u9881\u53D1\u65F6\u95F4",value:"isAwardDate"}],O=o=>o,P=()=>{var d;let o=JSON.parse(JSON.stringify(t.value));E.forEach(r=>{var m;(m=o.content)!=null&&m.includes(r.value)?o[r.value]=1:o[r.value]=0});const e=JSON.parse(o.certificateCoverUrl||"[]");return o.certificateCoverUrl=((d=e[0])==null?void 0:d.url)||"",o},R=o=>{o.validate(async(e,d)=>{if(e){let r=P();c("submit",r)}else{const r=Object.keys(d)[0];o.scrollToField(r)}})},L=()=>{c("cancel")};return G(()=>{}),(o,e)=>{const d=n("el-input"),r=n("el-form-item"),m=n("PaCol"),h=n("el-checkbox"),S=n("el-checkbox-group"),j=n("DocumentMul"),x=n("el-radio"),I=n("el-radio-group"),J=n("PaRow"),U=n("el-button"),M=n("el-form");return _(),b(M,{model:u(t),ref_key:"formRef",ref:D,rules:u(K)},{default:a(()=>[l(J,null,{default:a(()=>[l(m,v(F(u(p))),{default:a(()=>[l(r,{label:"\u8BC1\u4E66\u6807\u9898\uFF1A",prop:"title"},{default:a(()=>[l(d,{modelValue:u(t).title,"onUpdate:modelValue":e[0]||(e[0]=s=>u(t).title=s),placeholder:"\u8BF7\u8F93\u5165\u8BC1\u4E66\u6807\u9898 "},null,8,["modelValue"])]),_:1})]),_:1},16),l(m,v(F(u(p))),{default:a(()=>[l(r,{label:"\u8BC1\u4E66\u5185\u5BB9\uFF1A",prop:"content"},{default:a(()=>{var s,y;return[g("div",W,[l(S,{modelValue:u(t).content,"onUpdate:modelValue":e[1]||(e[1]=i=>u(t).content=i),min:0},{default:a(()=>[(_(),Q($,null,H(E,i=>l(h,{key:i.value,label:i.label,value:i.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"]),g("div",X,[(s=u(t).content)!=null&&s.includes("isReferee")?(_(),b(d,{key:0,modelValue:u(t).referee,"onUpdate:modelValue":e[2]||(e[2]=i=>u(t).referee=i),placeholder:"\u8BF7\u8F93\u5165\u88C1\u5224\u957F"},null,8,["modelValue"])):B("v-if",!0)]),g("div",Y,[(y=u(t).content)!=null&&y.includes("isAwardUnit")?(_(),b(d,{key:0,modelValue:u(t).awardUnit,"onUpdate:modelValue":e[3]||(e[3]=i=>u(t).awardUnit=i),placeholder:"\u8BF7\u8F93\u5165\u9881\u53D1\u5355\u4F4D"},null,8,["modelValue"])):B("v-if",!0)])])]}),_:1})]),_:1},16),l(m,v(F(u(p))),{default:a(()=>[l(r,{label:"\u8BC1\u4E66\u5C01\u9762",prop:"certificateCoverUrl"},{default:a(()=>[B(" {{ form.certificateCoverUrl }}certificateCoverUrl "),l(j,{fileList:u(t).certificateCoverUrl,"onUpdate:fileList":e[4]||(e[4]=s=>u(t).certificateCoverUrl=s),showFileList:!0,fileSize:5,limit:1,drag:!1,mutiple:!1,uploadType:"img",accept:".png,.jpg"},null,8,["fileList"])]),_:1})]),_:1},16),B(` <PaCol v-bind="oneLine"\r
				><el-form-item label="\u9881\u53D1\u5355\u4F4D\uFF1A" prop="awardUnit">\r
					<el-input v-model="form.awardUnit" placeholder="\u8BF7\u8F93\u5165\u9881\u53D1\u5355\u4F4D" /> </el-form-item\r
			></PaCol> `),l(m,v(F(u(p))),{default:a(()=>[l(r,{label:"\u72B6\u6001\uFF1A",prop:"status"},{default:a(()=>[l(I,{modelValue:u(t).status,"onUpdate:modelValue":e[5]||(e[5]=s=>u(t).status=s)},{default:a(()=>[l(x,{label:"\u542F\u7528",value:1}),l(x,{label:"\u7981\u7528",value:0})]),_:1},8,["modelValue"])]),_:1})]),_:1},16)]),_:1}),l(r,null,{default:a(()=>[g("div",Z,[l(U,{onClick:L},{default:a(()=>e[7]||(e[7]=[k("\u8FD4\u56DE",-1)])),_:1,__:[7]}),l(U,{type:"primary",loading:u(N),onClick:e[6]||(e[6]=s=>R(u(D)))},{default:a(()=>e[8]||(e[8]=[k("\u4FDD\u5B58",-1)])),_:1,__:[8]},8,["loading"])])]),_:1})]),_:1},8,["model","rules"])}}});const oe=q(ee,[["__scopeId","data-v-8e15f1af"]]);export{oe as default};
