import{G as e,P as a,O as l,C as t,D as s,y as u,S as o,h as r}from"./element-plus-DSMJnpwa.js";import{d}from"./index-mv7arXuk.js";/* empty css                *//* empty css                     */import{_ as i}from"./index.vue_vue_type_style_index_0_lang-BYkH3_xK.js";/* empty css               *//* empty css               */import{_ as n}from"./index-9_f6rNAP.js";import{g as m,u as p,a as c}from"./index-3R4kmKci.js";import{B as _,g as f,a4 as v,aB as h,aE as y,H as g,L as j,M as x,P as b,O as V,Y as B,d as q}from"./vue-vendor-DZekML78.js";import"./utils-cPVb2Haz.js";/* empty css                  */const M={class:"ResidentMainBox p-2 w-full"},k={class:"ResidentMainBody"},w={class:"addBuildingFormBody"},C={class:"formbox"},O=d(_({__name:"addActivity",setup(d){const{proxy:_}=f(),{com_repair_project_status:O}=v(_?.useDict("com_repair_project_status")),R=h(),U=y(),A=q(),D=q({id:null,title:"",author:"",content:"",status:"0"}),H={title:[{required:!0,message:"请输入活动标题",trigger:"blur"}],author:[{required:!0,message:"请输入作者",trigger:"blur"}],content:[{required:!0,message:"请输入内容",trigger:"blur"}]},P=q();R.query.id&&(P.value=R.query.id,m(P.value).then(e=>{D.value={...D.value,...e.data}}));const z=()=>{A.value?.validate(async e=>{e&&(P.value?p(D.value).then(()=>{r.success("编辑成功"),E()}):c(D.value).then(()=>{r.success("添加成功"),E()}))})};function E(){U.push({path:"/repair/Activity"})}return(r,d)=>{const m=s,p=t,c=l,_=a,f=i,v=u,h=e,y=o;return g(),j("div",M,[x(n,{title:"活动"}),b("div",k,[x(y,null,{header:V(()=>[...d[3]||(d[3]=[b("div",{class:"title"},"基本信息",-1)])]),default:V(()=>[b("div",w,[b("div",C,[x(h,{ref_key:"formRef",ref:A,model:D.value,rules:H,"label-width":"120px"},{default:V(()=>[x(_,null,{default:V(()=>[x(c,{span:12},{default:V(()=>[x(p,{label:"活动标题",prop:"title"},{default:V(()=>[x(m,{modelValue:D.value.title,"onUpdate:modelValue":d[0]||(d[0]=e=>D.value.title=e),modelModifiers:{trim:!0},placeholder:"请输入活动标题"},null,8,["modelValue"])]),_:1})]),_:1}),x(c,{span:12},{default:V(()=>[x(p,{label:"作者",prop:"author"},{default:V(()=>[x(m,{modelValue:D.value.author,"onUpdate:modelValue":d[1]||(d[1]=e=>D.value.author=e),modelModifiers:{trim:!0},placeholder:"请输入作者"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),x(_,null,{default:V(()=>[x(c,null,{default:V(()=>[x(p,{label:"活动详情",prop:"content"},{default:V(()=>[x(f,{modelValue:D.value.content,"onUpdate:modelValue":d[2]||(d[2]=e=>D.value.content=e),height:500,"min-height":300,"read-only":!1,"file-size":5,type:"url"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),x(p,null,{default:V(()=>[x(v,{type:"primary",onClick:z},{default:V(()=>[...d[4]||(d[4]=[B("提交",-1)])]),_:1}),x(v,{onClick:E},{default:V(()=>[...d[5]||(d[5]=[B("返回",-1)])]),_:1})]),_:1})]),_:1},8,["model"])])])]),_:1})])])}}}),[["__scopeId","data-v-04597cc8"]]);export{O as default};
