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