/* 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-1d279c71.js";/* empty css                 *//* empty css                   */import{d as s,m as t,V as o,x as d,X as i,f as r,o as u,l as m,w as p,e as n,a as c,b as f,P as v,a5 as h,a3 as b,a4 as g,ar as j,as as V,U as k,Z as x,a0 as y,_}from"./index-0ffeeea6.js";import"./http-ffb58baa.js";/* empty css                   */const w={class:"flex flex-row justify-between"},C={class:"w-full"},U={class:"flex justify-end"},I=_(s({__name:"depotsTransferAgo",props:{primary:Object},emits:["close"],setup(s,{emit:_}){const I=s,O=t(!1),T=o({miniProgramIds:[{required:!0,message:"请选择小程序"}]}),q=t({}),F=t([]),J=t([]),N=t([]),P=t([]),S=t({}),X=(e,a)=>{const l=JSON.parse(JSON.stringify(F.value)).filter((a=>e.includes(a.id))).map((e=>e.id));P.value=l,S.value={uids:P.value.join(","),action:"left"==a?"off":"on"},S.value,P.value},z=(e,a)=>a.username.includes(e),A=()=>{q.value.depotsValue,v(P.value),v(P.value).length<=0?h.warning("请选择投手公司"):l(I.primary.id,S.value).then((e=>{h.success(e.message),_("close",!1)}))};return d((()=>{e(I.primary.id).then((e=>{F.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(I.primary.id).then((e=>{q.value=e.data}))})),(e,a)=>{const l=b,s=g,t=j,o=V,d=k,v=x,h=y;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(o,{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=>X(e,"right")),onLeftCheckChange:a[4]||(a[4]=e=>X(e,"left")),"filter-method":z,"filter-placeholder":"搜索",data:r(F)},null,8,["modelValue","left-default-checked","right-default-checked","data"])])])),_:1})])]),n("div",U,[c(d,{type:"primary",size:"default",onClick:A},{default:p((()=>[f("确定")])),_:1})])])),_:1},8,["model","rules"])),[[h,r(O)]])}}}),[["__scopeId","data-v-a951364a"]]);export{I as default};
