import{C as U,D as w,F as I}from"./element-plus.55d71530.js";import{P as q}from"./index.8e3b20a1.js";import{r as i}from"./index.75e08341.js";import"./lodash.d6737109.js";import"./dayjs.37feae28.js";import{d as F,s as f,r as x,b as P,_ as B,o as R,c as k,V as o,M as d,u as r}from"./@vue.96c135a1.js";function K(a){return i.get({url:"/property.property_user/lists",params:a})}function j(a){return i.post({url:"/property.property_user/add",params:a})}function L(a){return i.post({url:"/property.property_user/edit",params:a})}function M(a){return i.get({url:"/property.property_user/detail",params:a})}const N={class:"edit-popup"},O=F({name:"propertyUserEdit"}),Q=F({...O,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(a,{expose:h,emit:D}){const _=D,c=f(),n=f(),m=x("add"),y=P(()=>m.value=="edit"?"\u7F16\u8F91\u4EE3\u7406\u6237\u4E3B\u8868":"\u65B0\u589E\u4EE3\u7406\u6237\u4E3B\u8868"),u=B({id:"",property_head_id:"",householder_name:"",householder_mobile:"",address:"",user_id:""}),b=B({property_head_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7406\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"]}]}),E=async l=>{for(const e in u)l[e]!=null&&l[e]!=null&&(u[e]=l[e])},g=async l=>{const e=await M({id:l.id});E(e)},V=async()=>{var e,s;await((e=c.value)==null?void 0:e.validate());const l={...u};m.value=="edit"?await L(l):await j(l),(s=n.value)==null||s.close(),_("success")},C=(l="add")=>{var e;m.value=l,(e=n.value)==null||e.open()},v=()=>{_("close")};return h({open:C,setFormData:E,getDetail:g}),(l,e)=>{const s=U,p=w,A=I;return R(),k("div",N,[o(q,{ref_key:"popupRef",ref:n,title:r(y),async:!0,width:"550px",onConfirm:V,onClose:v},{default:d(()=>[o(A,{ref_key:"formRef",ref:c,model:r(u),"label-width":"90px",rules:r(b)},{default:d(()=>[o(p,{label:"\u4EE3\u7406\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\u4EE3\u7406\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{Q as _,K as a};
