import{b as T,a as I,_ as j}from"./index-f6f689f9-1782572373740v=1.0.0.js";import{y as z,c as y,r as p,m as M,al as d,z as _,I as C,J as n,B as r,a8 as c,a9 as g,u as t,R as a,M as k,A as J,Q as P,a4 as q,O as F,P as $}from"./vendor-866bb149-1782572373740v=1.0.0.js";import"./eleVendor-48a7d3b8-1782572373740v=1.0.0.js";const Q={type:[],title:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u9898",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"}]},G={class:"flex",style:{gap:"8px"}},H={class:"pt20 mt30"},K=z({__name:"BaseForm",props:{value:Object,loading:{type:Boolean,default:!1}},emits:["update:value","update:loading","cancel","submit"],setup(A,{emit:E}){T();let B=A;const f=E,l=y({get(){return O(B.value)},set(u){f("update:value",u)}}),V=y({get(){return B.loading},set(u){f("update:loading",u)}});I();const v=p(),m=p({xs:24,sm:22,md:20,lg:14,xl:13});p({xs:24,sm:24,md:12,lg:12,xl:12}),p({xs:24,sm:22,md:18,lg:16,xl:8});const h=p(["\u5F84\u8D5B","\u51B3\u8D5B","\u83B7\u5956\u77AC\u95F4","\u7530\u8D5B","\u7CBE\u5F69\u77AC\u95F4","\u7834\u7EAA\u5F55"]),D=u=>{l.value.tags.includes(u)?l.value.tags.splice(l.value.tags.indexOf(u),1):l.value.tags.push(u)},O=u=>u,S=()=>{let u=JSON.parse(JSON.stringify(l.value));const e=u.tags.filter(i=>i);return u.tags=e.join(","),u.eventId=sessionStorage.getItem("eventId"),u},U=u=>{u.validate(async(e,i)=>{if(e){let s=S();f("submit",s)}else{const s=Object.keys(i)[0];u.scrollToField(s)}})},w=()=>{f("cancel")};return M(()=>{}),(u,e)=>{const i=d("el-input"),s=d("el-form-item"),R=d("el-check-tag"),L=d("DocumentMul"),b=d("el-button"),N=d("el-form");return _(),C(N,{model:t(l),ref_key:"formRef",ref:v,rules:t(Q),"label-width":"160px","label-position":"top"},{default:n(()=>[r("div",null,[r("div",c(g(t(m))),[a(s,{label:"\u6807\u9898 ",prop:"title"},{default:n(()=>[a(i,{modelValue:t(l).title,"onUpdate:modelValue":e[0]||(e[0]=o=>t(l).title=o),placeholder:"\u8BF7\u8F93\u5165\u6807\u9898 "},null,8,["modelValue"])]),_:1})],16),r("div",c(g(t(m))),[a(s,{label:"\u6807\u7B7E",prop:"tags"},{default:n(()=>[k(` <el-checkbox-group v-model="form.tags">\r
								<el-checkbox-button v-for="item in tagsOptions" :key="item" :label="item" :value="item"></el-checkbox-button>\r
							</el-checkbox-group> `),r("div",G,[(_(!0),J(P,null,q(t(h),o=>{var x;return _(),C(R,{onChange:W=>D(o),checked:(x=t(l).tags)==null?void 0:x.includes(o),key:o,label:o},{default:n(()=>[F($(o),1)]),_:2},1032,["onChange","checked","label"])}),128))])]),_:1})],16),r("div",c(g(t(m))),[a(s,{label:"\u56FE\u7247\u4E0A\u4F20",prop:"images"},{default:n(()=>[k(' 			:drag="false" '),a(L,{fileList:t(l).images,"onUpdate:fileList":e[1]||(e[1]=o=>t(l).images=o),showFileList:!0,fileSize:5,limit:999,mutiple:!0,uploadType:"img",accept:".png,.jpg"},null,8,["fileList"])]),_:1})],16),r("div",c(g(t(m))),[a(s,{label:"\u6587\u5B57\u63CF\u8FF0",prop:"description"},{default:n(()=>[a(i,{modelValue:t(l).description,"onUpdate:modelValue":e[2]||(e[2]=o=>t(l).description=o),type:"textarea",placeholder:"\u8BF7\u8F93\u5165\u98CE\u91C7\u63CF\u8FF0\u5185\u5BB9\uFF0C\u6700\u591A500\u5B57",maxlength:500,autosize:{minRows:6,maxRows:8},"show-word-limit":!0},null,8,["modelValue"])]),_:1})],16),r("div",c(g(t(m))),[a(s,{label:"\u56FE\u6587\u76F4\u64AD\u94FE\u63A5\uFF1A",prop:"liveUrl","label-position":"left"},{default:n(()=>[a(i,{modelValue:t(l).liveUrl,"onUpdate:modelValue":e[3]||(e[3]=o=>t(l).liveUrl=o),placeholder:"\u8BF7\u8F93\u5165\u56FE\u6587\u76F4\u64AD\u94FE\u63A5"},null,8,["modelValue"])]),_:1})],16)]),a(s,null,{default:n(()=>[r("div",H,[a(b,{onClick:w},{default:n(()=>e[5]||(e[5]=[F("\u53D6\u6D88",-1)])),_:1,__:[5]}),a(b,{type:"primary",loading:t(V),onClick:e[4]||(e[4]=o=>U(t(v)))},{default:n(()=>e[6]||(e[6]=[F("\u4FDD\u5B58",-1)])),_:1,__:[6]},8,["loading"])])]),_:1})]),_:1},8,["model","rules"])}}});const ee=j(K,[["__scopeId","data-v-079ceecb"]]);export{ee as default};
