/* empty css             *//* empty css                   *//* empty css                     *//* empty css                  *//* empty css                 *//* empty css                    *//* empty css                          *//* empty css                  */import{d as e,a,e as l}from"./index-47a02500.js";/* empty css                   */import{d as s,q as t,m as d,z as o,Z as i,f as u,o as r,l as m,w as p,e as n,a as c,b as f,aq as h,a7 as v,a5 as g,a6 as j,ap as b,ar as V,X as y,a0 as k,a2 as x,_}from"./index-545c1a76.js";import"./http-795fd5dc.js";/* empty css                   */const w={class:"flex flex-row justify-between"},C={class:"w-full"},q={class:"flex justify-end"},z=_(s({__name:"depotsTransfer",props:{primary:Object},emits:["close"],setup(s,{emit:_}){const z=s,O=t(!1),T=d({miniProgramIds:[{required:!0,message:"请选择小程序"}]}),U=t({}),I=t([]),J=t([]),N=t([]),R=t([]),S=t({}),A=(e,a)=>{const l=JSON.parse(JSON.stringify(I.value)).filter((a=>e.includes(a.id))).map((e=>e.id));R.value=l,S.value={uids:R.value.join(","),action:"left"==a?"off":"on"},S.value,R.value},F=(e,a)=>a.username.includes(e),L=()=>{U.value.depotsValue,h(R.value),h(R.value).length<=0?v.warning("请选择投手公司"):l(z.primary.id,S.value).then((e=>{v.success(e.message),_("close",!1)}))};return o((()=>{e(z.primary.id).then((e=>{I.value=e.data.all;let a=setTimeout((()=>{var l;(null==(l=e.data.on)?void 0:l.length)>0&&(U.value.depotsValue=e.data.on.map((e=>e.id)),N.value=e.data.on.map((e=>e.id)),clearTimeout(a))}),10)})),a(z.primary.id).then((e=>{U.value=e.data}))})),(e,a)=>{const l=g,s=j,t=b,d=V,o=y,h=k,v=x;return i((r(),m(h,{model:u(U),"label-width":"130px",ref:"ruleForm",rules:u(T),class:"pr-4"},{default:p((()=>[n("div",w,[n("div",C,[c(s,{label:"小程序名称",prop:"email"},{default:p((()=>[c(l,{modelValue:u(U).name,"onUpdate:modelValue":a[0]||(a[0]=e=>u(U).name=e),disabled:"",placeholder:"请填写登录账号"},null,8,["modelValue"])])),_:1}),c(s,{label:"状态",prop:"status"},{default:p((()=>[c(t,{modelValue:u(U).status,"onUpdate:modelValue":a[1]||(a[1]=e=>u(U).status=e),disabled:"","active-value":1,"inactive-value":0},null,8,["modelValue"])])),_:1}),c(s,{label:"分配至投手公司",prop:"username"},{default:p((()=>[n("div",null,[c(d,{modelValue:u(U).depotsValue,"onUpdate:modelValue":a[2]||(a[2]=e=>u(U).depotsValue=e),props:{key:"id",label:"username"},titles:["未分配","已分配"],filterable:"","left-default-checked":u(J),"right-default-checked":u(N),onRightCheckChange:a[3]||(a[3]=e=>A(e,"right")),onLeftCheckChange:a[4]||(a[4]=e=>A(e,"left")),"filter-method":F,"filter-placeholder":"搜索",data:u(I)},null,8,["modelValue","left-default-checked","right-default-checked","data"])])])),_:1})])]),n("div",q,[c(o,{type:"primary",size:"default",onClick:L},{default:p((()=>[f("确定")])),_:1})])])),_:1},8,["model","rules"])),[[v,u(O)]])}}}),[["__scopeId","data-v-6fef127b"]]);export{z as default};
