import{C as h,D as x,F as U}from"./element-plus.55d71530.js";import{P as A}from"./index.e651cfa0.js";import{r as n}from"./index.e2bd5212.js";import"./lodash.d6737109.js";import"./dayjs.37feae28.js";import{_ as I}from"./index.vue_vue_type_style_index_0_lang.e4b84c64.js";import{d as g,s as F,r as D,b as q,_ as E,o as P,c as S,a as j,V as u,M as i,u as o,j as N,U as $}from"./@vue.96c135a1.js";function re(a){return n.get({url:"/master_worker.master_worker_team/lists",params:a})}function L(a){return n.post({url:"/master_worker.master_worker_team/add",params:a})}function O(a){return n.post({url:"/master_worker.master_worker_team/edit",params:a})}function te(a){return n.post({url:"/master_worker.master_worker_team/delete",params:a})}function z(a){return n.get({url:"/master_worker.master_worker_team/detail",params:a})}const G={class:"edit-popup"},H=g({name:"masterWorkerTeamEdit"}),ae=g({...H,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(a,{expose:v,emit:V}){const c=V,d=F(),_=F(),p=D("add"),b=q(()=>p.value=="edit"?"\u7F16\u8F91\u56E2\u961F":"\u65B0\u589E\u56E2\u961F"),t=E({id:"",team_name:"",master_worker_id:"",master_worker_name:""}),B=E({team_name:[{required:!0,message:"\u8BF7\u8F93\u5165\u56E2\u961F\u540D\u79F0",trigger:["blur"]}],master_worker_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u8D1F\u8D23\u5DE5\u7A0B\u5E08ID",trigger:["blur"]}]}),f=async r=>{for(const e in t)r[e]!=null&&r[e]!=null&&(t[e]=r[e])},y=async r=>{const e=await z({id:r.id});f(e)},M=async()=>{var e,l;await((e=d.value)==null?void 0:e.validate());const r={...t};p.value=="edit"?await O(r):await L(r),(l=_.value)==null||l.close(),c("success")},W=(r="add")=>{var e;p.value=r,(e=_.value)==null||e.open()},T=()=>{c("close")},m=D(!1),k=async(r=!1)=>{m.value=r},C=r=>{var e;console.log("getdata",r),t.master_worker_id=r==null?void 0:r.id,t.master_worker_name=r.real_name?r.real_name:r.nickname,console.log("getdata-formData",t),(e=d.value)==null||e.validate()};return v({open:W,setFormData:f,getDetail:y}),(r,e)=>{const l=h,w=x,R=U;return P(),S($,null,[j("div",G,[u(A,{ref_key:"popupRef",ref:_,title:o(b),async:!0,width:"550px",onConfirm:M,onClose:T},{default:i(()=>[u(R,{ref_key:"formRef",ref:d,model:o(t),"label-width":"90px",rules:o(B)},{default:i(()=>[u(w,{label:"\u56E2\u961F\u540D\u79F0",prop:"team_name"},{default:i(()=>[u(l,{modelValue:o(t).team_name,"onUpdate:modelValue":e[0]||(e[0]=s=>o(t).team_name=s),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u56E2\u961F\u540D\u79F0"},null,8,["modelValue"])]),_:1}),u(w,{label:"\u8D1F\u8D23\u5DE5\u7A0B\u5E08",prop:"master_worker_id"},{default:i(()=>[u(l,{modelValue:o(t).master_worker_name,"onUpdate:modelValue":e[1]||(e[1]=s=>o(t).master_worker_name=s),placeholder:"\u8BF7\u9009\u62E9\u5DE5\u7A0B\u5E08",onClick:e[2]||(e[2]=s=>k(!0))},null,8,["modelValue"]),u(l,{type:"hidden",modelValue:o(t).master_worker_id,"onUpdate:modelValue":e[3]||(e[3]=s=>o(t).master_worker_id=s)},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])]),u(I,{show:o(m),"onUpdate:show":e[4]||(e[4]=s=>N(m)?m.value=s:null),"dict-data":a.dictData,onSuccessToManager:C,onPopShow:k},null,8,["show","dict-data"])],64)}}});export{ae as _,te as a,re as b};
