import{P as e,O as a,C as l,D as r,y as u,G as d,h as o}from"./element-plus-DSMJnpwa.js";import{d as s}from"./index-mv7arXuk.js";/* empty css                     *//* empty css               *//* empty css               */import{_ as t}from"./index-9_f6rNAP.js";import{g as i,u as m,a as n}from"./index-BnSqN4gk.js";import{B as p,aE as f,aB as v,H as c,L as _,M as g,P as V,O as h,Y as C,d as y}from"./vue-vendor-DZekML78.js";import"./utils-cPVb2Haz.js";const b={class:"AddBuildingBox"},k={class:"AddBuildingBody"},B={class:"addBuildingFormBody"},j=s(p({__name:"addCarArea",setup(s){const p=f(),j=v(),x=y(),M=y({id:null,areaName:null,areaCode:null,area:null,parkingCount:null,remark:null}),N=y({areaName:[{required:!0,message:"请输入区域名称",trigger:"blur"}],areaCode:[{required:!0,message:"请输入区域编号",trigger:"blur"}]}),A=y(null);j.query.id&&(A.value=j.query.id,i(A.value).then(e=>{M.value={...M.value,...e.data}}));const U=()=>{x.value?.validate(async e=>{e&&(A.value?m(M.value).then(()=>{o.success("编辑成功"),q()}):n(M.value).then(()=>{o.success("添加成功"),q()}))})},q=()=>{p.push({path:"/carArea/carAreaList"})};return(o,s)=>{const i=r,m=l,n=a,p=e,f=u,v=d;return c(),_("div",b,[g(t,{title:A.value?"编辑区域信息":"添加区域信息"},null,8,["title"]),V("div",k,[s[8]||(s[8]=V("div",{class:"title"},"基本信息",-1)),V("div",B,[g(v,{"label-position":"right",class:"formBody",ref_key:"formRef",ref:x,model:M.value,rules:N.value,"label-width":"130px"},{default:h(()=>[g(p,null,{default:h(()=>[g(n,{span:11},{default:h(()=>[g(m,{label:"区域名称",prop:"areaName"},{default:h(()=>[g(i,{modelValue:M.value.areaName,"onUpdate:modelValue":s[0]||(s[0]=e=>M.value.areaName=e),modelModifiers:{trim:!0},placeholder:"请输入区域名称"},null,8,["modelValue"])]),_:1})]),_:1}),g(n,{span:2}),g(n,{span:11},{default:h(()=>[g(m,{label:"区域编号",prop:"areaCode"},{default:h(()=>[g(i,{modelValue:M.value.areaCode,"onUpdate:modelValue":s[1]||(s[1]=e=>M.value.areaCode=e),modelModifiers:{trim:!0},placeholder:"请输入区域编号"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),g(p,null,{default:h(()=>[g(n,{span:11},{default:h(()=>[g(m,{label:"区域面积",prop:"area"},{default:h(()=>[g(i,{modelValue:M.value.area,"onUpdate:modelValue":s[2]||(s[2]=e=>M.value.area=e),modelModifiers:{number:!0},placeholder:"请输入区域面积"},{suffix:h(()=>[...s[5]||(s[5]=[C("㎡",-1)])]),_:1},8,["modelValue"])]),_:1})]),_:1}),g(n,{span:2}),g(n,{span:11},{default:h(()=>[g(m,{label:"车位数量",prop:"parkingCount"},{default:h(()=>[g(i,{modelValue:M.value.parkingCount,"onUpdate:modelValue":s[3]||(s[3]=e=>M.value.parkingCount=e),modelModifiers:{number:!0},placeholder:"请输入车位数量"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),g(p,null,{default:h(()=>[g(n,{span:24},{default:h(()=>[g(m,{label:"备注",prop:"remark"},{default:h(()=>[g(i,{type:"textarea",rows:5,modelValue:M.value.remark,"onUpdate:modelValue":s[4]||(s[4]=e=>M.value.remark=e),modelModifiers:{trim:!0},placeholder:"请输入"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),g(m,{style:{"margin-top":"30px"}},{default:h(()=>[g(f,{type:"primary",onClick:U},{default:h(()=>[...s[6]||(s[6]=[C("提交",-1)])]),_:1}),g(f,{onClick:q},{default:h(()=>[...s[7]||(s[7]=[C("返回",-1)])]),_:1})]),_:1})]),_:1},8,["model","rules"])])])])}}}),[["__scopeId","data-v-c8d614e6"]]);export{j as default};
