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