import{d as M,r as u,x as N,b as A,o,A as i,B as r,f as t,E as _,a as l,k as B,c as b,R as h,F as O,a2 as k,G as K,D as L,S as j,U as G,V as Z,as as H,at as J,W as Q,K as X,Z as Y,__tla as $}from"./index-92ad187a.js";import{_ as ee,__tla as le}from"./Dialog-44c9fa34.js";import{g as ae,__tla as re}from"./index-343decc0.js";import{a as se,D as te,__tla as ue}from"./dict-221f3e01.js";import{P as oe,__tla as de}from"./index-a4b5469a.js";import{u as ne,__tla as ie}from"./useMessage-d9788660.js";let I,_e=Promise.all([(()=>{try{return $}catch{}})(),(()=>{try{return le}catch{}})(),(()=>{try{return re}catch{}})(),(()=>{try{return ue}catch{}})(),(()=>{try{return de}catch{}})(),(()=>{try{return ie}catch{}})()]).then(async()=>{I=M({name:"CrmTransferForm",__name:"TransferForm",emits:["success"],setup(me,{expose:C,emit:R}){const E=ne(),n=u(!1),f=u(""),m=u(!1),V=u([]),v=u(!1),s=u({id:void 0,newOwnerUserId:void 0,oldOwnerPermissionLevel:void 0}),x=N({newOwnerUserId:[{required:!0,message:"\u65B0\u8D1F\u8D23\u4EBA\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],oldOwnerPermissionLevel:[{required:!0,message:"\u8001\u8D1F\u8D23\u4EBA\u52A0\u5165\u56E2\u961F\u540E\u7684\u6743\u9650\u7EA7\u522B\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),c=u(),P=u(()=>{});C({open:async(d,a,w)=>{n.value=!0,f.value=d,P.value=w,S(),s.value.id=a}});const F=R,D=async()=>{if(c&&await c.value.validate()){m.value=!0;try{const d=s.value;await P.value(l(d)),E.success(f.value+"\u6210\u529F"),n.value=!1,F("success")}finally{m.value=!1}}},S=()=>{var d;(d=c.value)==null||d.resetFields(),s.value={id:void 0,newOwnerUserId:void 0,oldOwnerPermissionLevel:void 0}};return A(async()=>{V.value=await ae()}),(d,a)=>{const w=j,T=G,p=Z,y=H,U=J,W=Q,g=X,q=ee,z=Y;return o(),i(q,{modelValue:l(n),"onUpdate:modelValue":a[5]||(a[5]=e=>k(n)?n.value=e:null),title:l(f),width:"30%"},{footer:r(()=>[t(g,{disabled:l(m),type:"primary",onClick:D},{default:r(()=>[_("\u786E \u5B9A")]),_:1},8,["disabled"]),t(g,{onClick:a[4]||(a[4]=e=>n.value=!1)},{default:r(()=>[_("\u53D6 \u6D88")]),_:1})]),default:r(()=>[B((o(),i(W,{ref_key:"formRef",ref:c,model:l(s),rules:l(x),"label-width":"150px"},{default:r(()=>[t(p,{label:"\u9009\u62E9\u65B0\u8D1F\u8D23\u4EBA",prop:"newOwnerUserId"},{default:r(()=>[t(T,{modelValue:l(s).newOwnerUserId,"onUpdate:modelValue":a[0]||(a[0]=e=>l(s).newOwnerUserId=e)},{default:r(()=>[(o(!0),b(O,null,h(l(V),e=>(o(),i(w,{key:e.id,label:e.nickname,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(p,{label:"\u8001\u8D1F\u8D23\u4EBA"},{default:r(()=>[t(U,{modelValue:l(v),"onUpdate:modelValue":a[1]||(a[1]=e=>k(v)?v.value=e:null),onChange:a[2]||(a[2]=e=>l(s).oldOwnerPermissionLevel=void 0)},{default:r(()=>[t(y,{label:!1,size:"large"},{default:r(()=>[_("\u79FB\u9664")]),_:1}),t(y,{label:!0,size:"large"},{default:r(()=>[_("\u52A0\u5165\u56E2\u961F")]),_:1})]),_:1},8,["modelValue"])]),_:1}),l(v)?(o(),i(p,{key:0,label:"\u8001\u8D1F\u8D23\u4EBA\u6743\u9650\u7EA7\u522B",prop:"oldOwnerPermissionLevel"},{default:r(()=>[t(U,{modelValue:l(s).oldOwnerPermissionLevel,"onUpdate:modelValue":a[3]||(a[3]=e=>l(s).oldOwnerPermissionLevel=e)},{default:r(()=>[(o(!0),b(O,null,h(l(se)(l(te).CRM_PERMISSION_LEVEL),e=>(o(),b(O,{key:e.value},[e.value!=l(oe).OWNER?(o(),i(y,{key:0,label:e.value},{default:r(()=>[_(K(e.label),1)]),_:2},1032,["label"])):L("",!0)],64))),128))]),_:1},8,["modelValue"])]),_:1})):L("",!0)]),_:1},8,["model","rules"])),[[z,l(m)]])]),_:1},8,["modelValue","title"])}}})});export{I as _,_e as __tla};
