import{G as a,C as e,D as s,Z as l,_ as t,y as u,S as o,h as d}from"./element-plus-DSMJnpwa.js";import{d as r}from"./index-mv7arXuk.js";/* empty css                *//* empty css                     *//* empty css                 *//* empty css                       */import{_ as i}from"./index-9_f6rNAP.js";import{g as m,u as n,a as p}from"./index-owI_ozJS.js";import{B as c,g as f,a4 as v,aB as _,aE as y,H as j,L as h,M as x,P as b,O as g,F as B,ab as V,u as k,I as C,Y as M,Z as q,d as R}from"./vue-vendor-DZekML78.js";import"./utils-cPVb2Haz.js";const w={class:"ResidentMainBox p-2 w-full"},D={class:"ResidentMainBody"},F={class:"addBuildingFormBody"},I={class:"formbox"},L=r(c({__name:"addComplaintType",setup(r){const{proxy:c}=f(),{com_repair_project_status:L}=v(c?.useDict("com_repair_project_status")),T=_(),U=y(),Z=R(),E=R({id:null,name:"",status:"0"}),G={name:[{required:!0,message:"请输入投诉类型名称",trigger:"blur"}]},H=R();T.query.id&&(H.value=T.query.id,m(H.value).then(a=>{E.value={...E.value,...a.data}}));const O=()=>{Z.value?.validate(async a=>{a&&(H.value?n(E.value).then(()=>{d.success("编辑成功"),P()}):p(E.value).then(()=>{d.success("添加成功"),P()}))})};function P(){U.push({path:"/system/complaintType"})}return(d,r)=>{const m=s,n=e,p=t,c=l,f=u,v=a,_=o;return j(),h("div",w,[x(i,{title:"投诉类型"}),b("div",D,[x(_,null,{header:g(()=>[...r[2]||(r[2]=[b("div",{class:"title"},"基本信息",-1)])]),default:g(()=>[b("div",F,[b("div",I,[x(v,{ref_key:"formRef",ref:Z,model:E.value,rules:G,"label-width":"120px"},{default:g(()=>[x(n,{label:"投诉类型名称",prop:"name"},{default:g(()=>[x(m,{modelValue:E.value.name,"onUpdate:modelValue":r[0]||(r[0]=a=>E.value.name=a),modelModifiers:{trim:!0},placeholder:"请输入投诉类型名称"},null,8,["modelValue"])]),_:1}),x(n,{label:"投诉类型状态",prop:"status"},{default:g(()=>[x(c,{modelValue:E.value.status,"onUpdate:modelValue":r[1]||(r[1]=a=>E.value.status=a)},{default:g(()=>[(j(!0),h(B,null,V(k(L),(a,e)=>(j(),C(p,{key:e,value:a.value},{default:g(()=>[M(q(a.label),1)]),_:2},1032,["value"]))),128))]),_:1},8,["modelValue"])]),_:1}),x(n,null,{default:g(()=>[x(f,{type:"primary",onClick:O},{default:g(()=>[...r[3]||(r[3]=[M("提交",-1)])]),_:1}),x(f,{onClick:P},{default:g(()=>[...r[4]||(r[4]=[M("返回",-1)])]),_:1})]),_:1})]),_:1},8,["model"])])])]),_:1})])])}}}),[["__scopeId","data-v-2c053af1"]]);export{L as default};
