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