import{G as e,P as l,O as a,C as u,D as t,L as s,M as o,Z as i,_ as r,y as d,S as n,h as m}from"./element-plus-DSMJnpwa.js";import{d as p}from"./index-mv7arXuk.js";/* empty css                *//* empty css                     */import{_ as c}from"./index.vue_vue_type_style_index_0_lang-BYkH3_xK.js";/* empty css                 *//* empty css                       *//* empty css               *//* empty css                  *//* empty css               *//* empty css               */import{_ as v}from"./index-9_f6rNAP.js";import{g as _,u as f,a as h}from"./index-vkGqW-ow.js";import{B as b,g,a4 as y,aB as j,aE as V,H as x,L as C,M as L,P as B,O as k,F as q,ab as M,u as S,I as T,Y as U,Z as N,d as w}from"./vue-vendor-DZekML78.js";import"./utils-cPVb2Haz.js";/* empty css                  */const D={class:"ResidentMainBox p-2 w-full"},I={class:"ResidentMainBody"},O={class:"addBuildingFormBody"},P={class:"formbox"},R=p(b({__name:"addNoticePc",setup(p){const{proxy:b}=g(),{com_noticepc_level:R}=y(b?.useDict("com_noticepc_level")),{com_publish_status:F}=y(b?.useDict("com_publish_status")),H=j(),Z=V(),z=w(),E=w({id:null,author:"",noticeTitle:"",urgencyLevel:0,publishStatus:1,noticeContent:""}),G={noticeTitle:[{required:!0,message:"请输入公告标题",trigger:"blur"}],urgencyLevel:[{required:!0,message:"请选择紧急程度",trigger:"blur"}],author:[{required:!0,message:"请输入作者名称",trigger:"blur"}],noticeContent:[{required:!0,message:"请输入公告内容",trigger:"blur"}]},J=w();function W(e){E.value.noticeContent=e.trim()}H.query.id&&(J.value=H.query.id,_(J.value).then(e=>{E.value={...E.value,...e.data}}));const Y=()=>{z.value?.validate(async e=>{e&&(J.value?f(E.value).then(()=>{m.success("编辑成功"),A()}):h(E.value).then(()=>{m.success("添加成功"),A()}))})};function A(){Z.push({path:"/repair/noticepc"})}return(m,p)=>{const _=t,f=u,h=a,b=l,g=o,y=s,j=r,V=i,w=c,H=d,Z=e,J=n;return x(),C("div",D,[L(v,{title:"公告"}),B("div",I,[L(J,null,{header:k(()=>[...p[4]||(p[4]=[B("div",{class:"title"},"基本信息",-1)])]),default:k(()=>[B("div",O,[B("div",P,[L(Z,{ref_key:"formRef",ref:z,model:E.value,rules:G,"label-width":"120px"},{default:k(()=>[L(b,null,{default:k(()=>[L(h,{span:12},{default:k(()=>[L(f,{label:"公告标题",prop:"noticeTitle"},{default:k(()=>[L(_,{modelValue:E.value.noticeTitle,"onUpdate:modelValue":p[0]||(p[0]=e=>E.value.noticeTitle=e),modelModifiers:{trim:!0},placeholder:"请输入公告标题"},null,8,["modelValue"])]),_:1})]),_:1}),L(h,{span:12},{default:k(()=>[L(f,{label:"作者",prop:"author"},{default:k(()=>[L(_,{modelValue:E.value.author,"onUpdate:modelValue":p[1]||(p[1]=e=>E.value.author=e),modelModifiers:{trim:!0},placeholder:"请输入作者"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),L(b,null,{default:k(()=>[L(h,{span:12},{default:k(()=>[L(f,{label:"公告紧急程度",prop:"urgencyLevel"},{default:k(()=>[L(y,{modelValue:E.value.urgencyLevel,"onUpdate:modelValue":p[2]||(p[2]=e=>E.value.urgencyLevel=e),clearable:"",placeholder:"请选择公告紧急程度"},{default:k(()=>[(x(!0),C(q,null,M(S(R),e=>(x(),T(g,{key:e.value,label:e.label,value:Number(e.value)},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1}),L(h,{span:12},{default:k(()=>[L(f,{label:"是否发布",prop:"publishStatus"},{default:k(()=>[L(V,{modelValue:E.value.publishStatus,"onUpdate:modelValue":p[3]||(p[3]=e=>E.value.publishStatus=e)},{default:k(()=>[(x(!0),C(q,null,M(S(F),e=>(x(),T(j,{key:e.value,value:Number(e.value)},{default:k(()=>[U(N("0"===e.value?e.label:"发布"),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1})]),_:1}),L(b,null,{default:k(()=>[L(h,null,{default:k(()=>[L(f,{label:"公告详情",prop:"noticeContent"},{default:k(()=>[L(w,{"onUpdate:modelValue":W,"model-value":E.value.noticeContent,height:500,"min-height":300,"read-only":!1,"file-size":5},null,8,["model-value"])]),_:1})]),_:1})]),_:1}),L(f,null,{default:k(()=>[L(H,{type:"primary",onClick:Y},{default:k(()=>[...p[5]||(p[5]=[U("提交",-1)])]),_:1}),L(H,{onClick:A},{default:k(()=>[...p[6]||(p[6]=[U("返回",-1)])]),_:1})]),_:1})]),_:1},8,["model"])])])]),_:1})])])}}}),[["__scopeId","data-v-3ec1384d"]]);export{R as default};
