import{C as U,D as w,F as I}from"./element-plus.ae09c4a0.js";import{P as q}from"./index.e64ff1d1.js";import{r as n}from"./index.80696382.js";import"./lodash.fc1b942f.js";import{d as F,s as B,r as x,b as P,a0 as E,o as R,c as k,W as o,O as d,u as r}from"./@vue.a7a54728.js";function J(a){return n.get({url:"/property.property_user/lists",params:a})}function O(a){return n.post({url:"/property.property_user/add",params:a})}function j(a){return n.post({url:"/property.property_user/edit",params:a})}function L(a){return n.get({url:"/property.property_user/detail",params:a})}const N={class:"edit-popup"},S=F({name:"propertyUserEdit"}),K=F({...S,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(a,{expose:h,emit:D}){const _=D,c=B(),i=B(),m=x("add"),y=P(()=>m.value=="edit"?"\u7F16\u8F91\u7269\u4E1A\u6237\u4E3B\u8868":"\u65B0\u589E\u7269\u4E1A\u6237\u4E3B\u8868"),u=E({id:"",property_head_id:"",householder_name:"",householder_mobile:"",address:"",user_id:""}),b=E({property_head_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u7269\u4E1A\u8D1F\u8D23\u4EBAID",trigger:["blur"]}],householder_name:[{required:!0,message:"\u8BF7\u8F93\u5165\u6237\u4E3B\u4EBA\u540D\u79F0",trigger:["blur"]}],householder_mobile:[{required:!0,message:"\u8BF7\u8F93\u5165\u6237\u4E3B\u624B\u673A\u53F7/\u7535\u8BDD",trigger:["blur"]}],address:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BE6\u7EC6\u5730\u5740",trigger:["blur"]}],user_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u6CE8\u518C\u7528\u6237ID",trigger:["blur"]}]}),f=async l=>{for(const e in u)l[e]!=null&&l[e]!=null&&(u[e]=l[e])},g=async l=>{const e=await L({id:l.id});f(e)},V=async()=>{var e,s;await((e=c.value)==null?void 0:e.validate());const l={...u};m.value=="edit"?await j(l):await O(l),(s=i.value)==null||s.close(),_("success")},A=(l="add")=>{var e;m.value=l,(e=i.value)==null||e.open()},C=()=>{_("close")};return h({open:A,setFormData:f,getDetail:g}),(l,e)=>{const s=U,p=w,v=I;return R(),k("div",N,[o(q,{ref_key:"popupRef",ref:i,title:r(y),async:!0,width:"550px",onConfirm:V,onClose:C},{default:d(()=>[o(v,{ref_key:"formRef",ref:c,model:r(u),"label-width":"90px",rules:r(b)},{default:d(()=>[o(p,{label:"\u7269\u4E1A\u8D1F\u8D23\u4EBAID",prop:"property_head_id"},{default:d(()=>[o(s,{modelValue:r(u).property_head_id,"onUpdate:modelValue":e[0]||(e[0]=t=>r(u).property_head_id=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7269\u4E1A\u8D1F\u8D23\u4EBAID"},null,8,["modelValue"])]),_:1}),o(p,{label:"\u6237\u4E3B\u4EBA\u540D\u79F0",prop:"householder_name"},{default:d(()=>[o(s,{modelValue:r(u).householder_name,"onUpdate:modelValue":e[1]||(e[1]=t=>r(u).householder_name=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6237\u4E3B\u4EBA\u540D\u79F0"},null,8,["modelValue"])]),_:1}),o(p,{label:"\u6237\u4E3B\u624B\u673A\u53F7/\u7535\u8BDD",prop:"householder_mobile"},{default:d(()=>[o(s,{modelValue:r(u).householder_mobile,"onUpdate:modelValue":e[2]||(e[2]=t=>r(u).householder_mobile=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6237\u4E3B\u624B\u673A\u53F7/\u7535\u8BDD"},null,8,["modelValue"])]),_:1}),o(p,{label:"\u8BE6\u7EC6\u5730\u5740",prop:"address"},{default:d(()=>[o(s,{modelValue:r(u).address,"onUpdate:modelValue":e[3]||(e[3]=t=>r(u).address=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BE6\u7EC6\u5730\u5740"},null,8,["modelValue"])]),_:1}),o(p,{label:"\u6CE8\u518C\u7528\u6237ID",prop:"user_id"},{default:d(()=>[o(s,{modelValue:r(u).user_id,"onUpdate:modelValue":e[4]||(e[4]=t=>r(u).user_id=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6CE8\u518C\u7528\u6237ID"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{K as _,J as a};
