import{d as D,r as u,f as G,B as M,o,l as i,w as r,i as t,a,j as _,C as j,c as O,F as b,k,y as L,t as A,a2 as U,D as B,G as J,H as K,ag as W,ah as Q,K as X,J as Y,N as Z,_ as $,__tla as ee}from"./index-2c56227b.js";import{_ as ae,__tla as le}from"./Dialog-1050d437.js";import{g as re,__tla as se}from"./index-0f7aa9db.js";import{a as te,D as ue,__tla as oe}from"./dict-763dd292.js";import{P as ne,__tla as de}from"./index-ed7289d5.js";import{u as ie,__tla as _e}from"./useMessage-96878a4a.js";let I,me=Promise.all([(()=>{try{return ee}catch{}})(),(()=>{try{return le}catch{}})(),(()=>{try{return se}catch{}})(),(()=>{try{return oe}catch{}})(),(()=>{try{return de}catch{}})(),(()=>{try{return _e}catch{}})()]).then(async()=>{I=$(D({name:"CrmTransferForm",__name:"TransferForm",emits:["success"],setup(ve,{expose:C,emit:E}){const F=ie(),d=u(!1),c=u(""),m=u(!1),V=u([]),v=u(!1),s=u({id:void 0,newOwnerUserId:void 0,oldOwnerPermissionLevel:void 0}),R=G({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"}]}),f=u(),h=u(()=>{});C({open:async(n,l,w)=>{d.value=!0,c.value=n,h.value=w,N(),s.value.id=l}});const x=E,H=async()=>{if(f&&await f.value.validate()){m.value=!0;try{const n=s.value;await h.value(a(n)),F.success(c.value+"\u6210\u529F"),d.value=!1,x("success")}finally{m.value=!1}}},N=()=>{var n;(n=f.value)==null||n.resetFields(),s.value={id:void 0,newOwnerUserId:void 0,oldOwnerPermissionLevel:void 0}};return M(async()=>{V.value=await re()}),(n,l)=>{const w=B,S=J,p=K,y=W,g=Q,T=X,P=Y,q=ae,z=Z;return o(),i(q,{modelValue:a(d),"onUpdate:modelValue":l[5]||(l[5]=e=>L(d)?d.value=e:null),title:a(c),width:"30%"},{footer:r(()=>[t(P,{disabled:a(m),type:"primary",onClick:H},{default:r(()=>[_("\u786E \u5B9A")]),_:1},8,["disabled"]),t(P,{onClick:l[4]||(l[4]=e=>d.value=!1)},{default:r(()=>[_("\u53D6 \u6D88")]),_:1})]),default:r(()=>[j((o(),i(T,{ref_key:"formRef",ref:f,model:a(s),rules:a(R),"label-width":"150px"},{default:r(()=>[t(p,{label:"\u9009\u62E9\u65B0\u8D1F\u8D23\u4EBA",prop:"newOwnerUserId"},{default:r(()=>[t(S,{modelValue:a(s).newOwnerUserId,"onUpdate:modelValue":l[0]||(l[0]=e=>a(s).newOwnerUserId=e)},{default:r(()=>[(o(!0),O(b,null,k(a(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(g,{modelValue:a(v),"onUpdate:modelValue":l[1]||(l[1]=e=>L(v)?v.value=e:null),onChange:l[2]||(l[2]=e=>a(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}),a(v)?(o(),i(p,{key:0,label:"\u8001\u8D1F\u8D23\u4EBA\u6743\u9650\u7EA7\u522B",prop:"oldOwnerPermissionLevel"},{default:r(()=>[t(g,{modelValue:a(s).oldOwnerPermissionLevel,"onUpdate:modelValue":l[3]||(l[3]=e=>a(s).oldOwnerPermissionLevel=e)},{default:r(()=>[(o(!0),O(b,null,k(a(te)(a(ue).CRM_PERMISSION_LEVEL),e=>(o(),O(b,{key:e.value},[e.value!=a(ne).OWNER?(o(),i(y,{key:0,label:e.value},{default:r(()=>[_(A(e.label),1)]),_:2},1032,["label"])):U("",!0)],64))),128))]),_:1},8,["modelValue"])]),_:1})):U("",!0)]),_:1},8,["model","rules"])),[[z,a(m)]])]),_:1},8,["modelValue","title"])}}}),[["__file","E:/GAOHP_2023/mall/newfeifan-front/yudao-ui-admin-vue3/src/views/crm/permission/components/TransferForm.vue"]])});export{me as __tla,I as default};
