import{C as e,D as a,y as l,G as d,h as t}from"./element-plus-DSMJnpwa.js";import{d as s}from"./index-mv7arXuk.js";/* empty css                     */import{_ as i}from"./index-9_f6rNAP.js";import{g as o,u as r,a as n}from"./index-Cqy7TsGi.js";import{B as u,g as m,aE as p,aB as c,H as v,L as f,M as g,P as y,O as _,Y as h,d as B}from"./vue-vendor-DZekML78.js";import"./utils-cPVb2Haz.js";const x={class:"AddBuildingBox"},j={class:"AddBuildingBody"},N={class:"addBuildingFormBody"},S=s(u({__name:"addInspectionItem",setup(s){const{proxy:u}=m(),S=p(),b=c(),V=B(),q=B({id:null,itemName:"",inspectionStandard:null}),I=B({itemName:[{required:!0,message:"请输入项目名称",trigger:"blur"}],inspectionStandard:[{required:!0,message:"请输入 巡检标准",trigger:"blur"}]}),k=B(null);b.query.id&&(k.value=b.query.id,o(k.value).then(e=>{q.value={id:e.data.id,itemName:e.data.itemName,inspectionStandard:e.data.inspectionStandard}}));const C=()=>{V.value?.validate(async e=>{e&&(k.value?r(q.value).then(e=>{t.success("编辑成功"),M()}):n(q.value).then(e=>{t.success("添加成功"),M()}))})},M=()=>{S.push({path:"/Inspection/item"})};return(t,s)=>{const o=a,r=e,n=l,u=d;return v(),f("div",x,[g(i),y("div",j,[s[4]||(s[4]=y("div",{class:"title"},"基本信息",-1)),y("div",N,[g(u,{class:"formBody","label-position":"right",ref_key:"formRef",ref:V,model:q.value,rules:I.value,"label-width":"130px"},{default:_(()=>[g(r,{label:"项目名称",prop:"itemName"},{default:_(()=>[g(o,{modelValue:q.value.itemName,"onUpdate:modelValue":s[0]||(s[0]=e=>q.value.itemName=e),modelModifiers:{trim:!0},placeholder:"请输入项目名称"},null,8,["modelValue"])]),_:1}),g(r,{label:"巡检标准",prop:"inspectionStandard"},{default:_(()=>[g(o,{type:"textarea",rows:5,modelValue:q.value.inspectionStandard,"onUpdate:modelValue":s[1]||(s[1]=e=>q.value.inspectionStandard=e),modelModifiers:{trim:!0},placeholder:"请输入巡检标准"},null,8,["modelValue"])]),_:1}),g(r,{style:{"margin-top":"30px"}},{default:_(()=>[g(n,{type:"primary",onClick:C},{default:_(()=>[...s[2]||(s[2]=[h("提交",-1)])]),_:1}),g(n,{onClick:M},{default:_(()=>[...s[3]||(s[3]=[h("返回",-1)])]),_:1})]),_:1})]),_:1},8,["model","rules"])])])])}}}),[["__scopeId","data-v-8a062d62"]]);export{S as default};
