import{C as e,D as a,Z as l,_ as s,y as u,G as t,h as o}from"./element-plus-DSMJnpwa.js";import{d as r}from"./index-mv7arXuk.js";/* empty css                     *//* empty css                 *//* empty css                       */import{_ as d}from"./index-9_f6rNAP.js";import{g as i,u as m,a as n}from"./index-GRb7qMcM.js";import{B as p,g as v,a4 as c,aE as f,aB as _,H as g,L as y,M as b,P as j,O as h,F as B,ab as x,u as V,I as k,Y as q,d as F}from"./vue-vendor-DZekML78.js";import"./utils-cPVb2Haz.js";const C={class:"AddBuildingBox"},H={class:"AddBuildingBody"},A={class:"addBuildingFormBody"},D=r(p({__name:"addHouseFacilities",setup(r){const{proxy:p}=v(),{com_repair_project_status:D}=c(p?.useDict("com_repair_project_status")),I=f(),L=_(),M=F(),U=F({id:null,status:"0",name:null}),w=F({name:[{required:!0,message:"请输入设施名称",trigger:"blur"}],status:[{required:!0,message:"请选择状态",trigger:"blur"}]}),E=F(null);L.query.id&&(E.value=L.query.id,i(E.value).then(e=>{U.value={...U.value,...e.data}}));const G=()=>{M.value?.validate(async e=>{e&&(E.value?m(U.value).then(e=>{o.success("编辑成功"),O()}):n(U.value).then(e=>{o.success("添加成功"),O()}))})},O=()=>{I.push({path:"/system/HouseFacilities"})};return(o,r)=>{const i=a,m=e,n=s,p=l,v=u,c=t;return g(),y("div",C,[b(d,{title:E.value?"编辑房屋设施":"添加房屋设施"},null,8,["title"]),j("div",H,[r[4]||(r[4]=j("div",{class:"title"},"基本信息",-1)),j("div",A,[b(c,{class:"formBody","label-position":"right",ref_key:"formRef",ref:M,model:U.value,rules:w.value,"label-width":"130px"},{default:h(()=>[b(m,{label:"房屋设施名称",prop:"name"},{default:h(()=>[b(i,{modelValue:U.value.name,"onUpdate:modelValue":r[0]||(r[0]=e=>U.value.name=e),modelModifiers:{trim:!0},placeholder:"请输入房屋设施名称"},null,8,["modelValue"])]),_:1}),b(m,{label:"房屋设置状态",prop:"status"},{default:h(()=>[b(p,{modelValue:U.value.status,"onUpdate:modelValue":r[1]||(r[1]=e=>U.value.status=e)},{default:h(()=>[(g(!0),y(B,null,x(V(D),e=>(g(),k(n,{value:e.value,key:e.value,label:e.label},null,8,["value","label"]))),128))]),_:1},8,["modelValue"])]),_:1}),b(m,{style:{"margin-top":"30px"}},{default:h(()=>[b(v,{type:"primary",onClick:G},{default:h(()=>[...r[2]||(r[2]=[q("提交",-1)])]),_:1}),b(v,{onClick:O},{default:h(()=>[...r[3]||(r[3]=[q("返回",-1)])]),_:1})]),_:1})]),_:1},8,["model","rules"])])])])}}}),[["__scopeId","data-v-339b2721"]]);export{D as default};
