import{E as B,a as C}from"./el-form-item-BvJauXBe.js";import{d as E,o as y,c as N,m as l,q as n,p as t,t as T,A as x,y as f,r as a,E as b,G as M}from"./index-XuO881sr.js";import{E as w}from"./el-input-number-DQoue9lR.js";import{P as A}from"./index-6fE1mQ4R.js";import{a as F}from"./index-BMymgPp9.js";import"./cloneDeep-CQdyn166.js";import"./_baseClone-CIlxLVYA.js";import"./index-fMbu6SLq.js";const U={class:"AddBuildingBox"},k={class:"AddBuildingBody"},I={class:"addBuildingFormBody"},q=E({__name:"AddBuilding",setup(S){const i=a(),o=a({buildingName:"",buildToward:"",buildTail:"",buildStructure:"",unitCount:null,floorCount:null}),g=a({buildingName:[{required:!0,message:"请输入楼栋名称",trigger:"blur"}],unitCount:[{required:!0,message:"请输入单元数",trigger:"blur"}],floorCount:[{required:!0,message:"请输入楼层数",trigger:"blur"}]}),_=a(),c=()=>{i.value?.validate(async m=>{m&&(console.log(o.value),F({...o.value,villageId:_.value.id}).then(e=>{console.log(e),b.success("添加成功")}).catch(e=>{console.log(e),b.error("添加失败")}))})},v=()=>{i.value?.resetFields()};return(m,e)=>{const r=T,d=B,s=w,p=x,V=C;return y(),N("div",U,[l(A,{title:"新建楼栋"}),n("div",k,[e[8]||(e[8]=n("div",{class:"title"},"基本信息",-1)),n("div",I,[l(V,{class:"formBody",ref_key:"formRef",ref:i,model:o.value,rules:g.value,"label-width":"100px"},{default:t(()=>[l(d,{label:"楼栋名称",prop:"buildingName"},{default:t(()=>[l(r,{modelValue:o.value.buildingName,"onUpdate:modelValue":e[0]||(e[0]=u=>o.value.buildingName=u),modelModifiers:{trim:!0},placeholder:"请输入楼栋名称"},null,8,["modelValue"])]),_:1}),l(d,{label:"楼栋朝向",prop:"buildToward"},{default:t(()=>[l(r,{modelValue:o.value.buildToward,"onUpdate:modelValue":e[1]||(e[1]=u=>o.value.buildToward=u),modelModifiers:{trim:!0},placeholder:"请输入楼栋朝向"},null,8,["modelValue"])]),_:1}),l(d,{label:"楼高(m)",prop:"buildTail"},{default:t(()=>[l(r,{modelValue:o.value.buildTail,"onUpdate:modelValue":e[2]||(e[2]=u=>o.value.buildTail=u),modelModifiers:{trim:!0},placeholder:"请输入楼高(m)"},null,8,["modelValue"])]),_:1}),l(d,{label:"楼栋结构",prop:"buildStructure"},{default:t(()=>[l(r,{modelValue:o.value.buildStructure,"onUpdate:modelValue":e[3]||(e[3]=u=>o.value.buildStructure=u),modelModifiers:{trim:!0},placeholder:"请输入楼栋结构"},null,8,["modelValue"])]),_:1}),l(d,{label:"单元数",prop:"unitCount"},{default:t(()=>[l(s,{min:1,modelValue:o.value.unitCount,"onUpdate:modelValue":e[4]||(e[4]=u=>o.value.unitCount=u),modelModifiers:{trim:!0},placeholder:"单元数"},null,8,["modelValue"])]),_:1}),l(d,{label:"楼层",prop:"floorCount"},{default:t(()=>[l(s,{min:1,modelValue:o.value.floorCount,"onUpdate:modelValue":e[5]||(e[5]=u=>o.value.floorCount=u),modelModifiers:{trim:!0},placeholder:"楼层数"},null,8,["modelValue"])]),_:1}),l(d,{style:{"margin-top":"30px"}},{default:t(()=>[l(p,{type:"primary",onClick:c},{default:t(()=>[...e[6]||(e[6]=[f("确定",-1)])]),_:1}),l(p,{onClick:v},{default:t(()=>[...e[7]||(e[7]=[f("取消",-1)])]),_:1})]),_:1})]),_:1},8,["model","rules"])])])])}}}),K=M(q,[["__scopeId","data-v-c3913430"]]);export{K as default};
