import{t as C,a as B}from"./tagsManage.d96e36d0.js";import{d as $,r as u,L as D,N as T,c as r,e as _,I,i as s,h as i,j as w,f as h,F as q,J as z,x as O}from"./index.5bb861d3.js";const P=$({name:"editPersonInfoDialog"}),J=Object.assign(P,{props:{visible:{type:Boolean,default:!1,required:!0},data:Object},emits:["close"],setup(b,{emit:x}){const{proxy:k}=O(),n=b,c=x,m=u(!1),a=u({}),f=u(),j=async t=>{!t||t.validate(async e=>{if(e){m.value=!0;try{const l=a.value.tagId.map(d=>({tagId:d,projectCode:n.data.projectCode}));await B(l),k.$message.success("\u63D0\u4EA4\u6210\u529F\uFF01"),m.value=!1,c("close",!0)}catch{m.value=!1}}})},p=u([]),g=u(!1),F=async t=>{g.value=!0;const e=await C(n.data.areaCode,{pageNumber:1,pageSize:1e4,name:t});g.value=!1,p.value=e.data.records};return D(()=>n.visible,async t=>{var e,l;if(t){const d=await C(n.data.areaCode,{pageNumber:1,pageSize:1e4});p.value=d.data.records,(l=(e=n.data)==null?void 0:e.tags)!=null&&l.length?a.value={tagId:n.data.tags.map(v=>v.id)}:(a.value={tagId:[]},await T(),f.value.resetFields())}else a.value={}}),(t,e)=>{const l=r("el-option"),d=r("el-select"),v=r("el-form-item"),L=r("el-form"),y=r("el-button"),N=r("el-dialog");return _(),I(N,{"model-value":b.visible,title:"\u8BBE\u7F6E\u6807\u7B7E",width:"600px","destroy-on-close":"",onClose:e[3]||(e[3]=o=>c("close"))},{footer:s(()=>[i(y,{type:"primary",loading:m.value,onClick:e[1]||(e[1]=o=>j(f.value))},{default:s(()=>[w(" \u63D0\u4EA4 ")]),_:1},8,["loading"]),i(y,{onClick:e[2]||(e[2]=o=>c("close"))},{default:s(()=>[w(" \u5173\u95ED ")]),_:1})]),default:s(()=>[i(L,{ref_key:"dialogFormRef",ref:f,model:a.value,"label-width":"auto","status-icon":"",class:"mt-16","label-suffix":"\uFF1A"},{default:s(()=>[i(v,{label:"\u6807\u7B7E",prop:"tagId",rules:[{required:!0,message:"\u8BF7\u9009\u62E9"}]},{default:s(()=>[i(d,{modelValue:a.value.tagId,"onUpdate:modelValue":e[0]||(e[0]=o=>a.value.tagId=o),class:"w-full",multiple:"",filterable:"",remote:"","remote-method":F,loading:g.value},{default:s(()=>[(_(!0),h(q,null,z(p.value,(o,V)=>(_(),I(l,{key:V,label:o.name,value:o.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","loading"])]),_:1})]),_:1},8,["model"])]),_:1},8,["model-value"])}}});export{J as default};
