var g=(t,o,r)=>new Promise((d,u)=>{var M=a=>{try{i(r.next(a))}catch(s){u(s)}},l=a=>{try{i(r.throw(a))}catch(s){u(s)}},i=a=>a.done?d(a.value):Promise.resolve(a.value).then(M,l);i((r=r.apply(t,o)).next())});import{d as O,e as j,r as V,f as $,U as c,a2 as b,ad as D,af as m,k,G as I,a3 as h,a5 as B,F as _,V as C}from"./vue-vendor-CxLCUzY4.js";import{B as L}from"./index-XZKTTfG1.js";import"./index-KOQNKxnC.js";import{useListPage as q}from"./useListPage-CevWQ3ci.js";import{g as v}from"./tenant.data-Byz3LKFo.js";import{q as K,o as z,t as E}from"./tenant.api-BupkcWMH.js";import G from"./TenantUserSelectModal-CbQrlSlZ.js";import{a8 as Q,a9 as H,u as J,_ as W}from"./index-CLZzJyTP.js";import{Q as X}from"./componentMap-DpsJvoqz.js";import Y from"./BasicTable-DUJWN3yz.js";import"./BasicModal-B8XmAOm7.js";import"./ModalHeader-DIFQSP_0.js";import"./antd-vue-vendor-CahNzUUa.js";import"./useTimeout-KpZCXEcl.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./index-DvqyyN77.js";import"./useWindowSizeFn-D9PllI8g.js";import"./index-DS3utcig.js";import"./index-BZbg0EjM.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./index-ByX9XNkE.js";import"./useForm-Dx3lJ3DG.js";import"./JAreaLinkage-M9TGy8nY.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./JSelectUser-CfAGgHjD.js";import"./props-BtZrRNiI.js";import"./JSelectBiz-CLnJTMe2.js";import"./JSelectDept-CaEHrQp6.js";import"./index-44tRnyoF.js";import"./bem-DT3DdmOs.js";import"./props-CG-jAkbI.js";import"./useContextMenu-BGU2vdqV.js";import"./JCodeEditor-CR57XeIe.js";import"./useFormItem-IOFWTdED.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./JAddInput-B36c3B5x.js";import"./index-C7yPiS0L.js";import"./depart.api-DHG2p2Yd.js";import"./JPopup-BvqhHpPl.js";import"./EasyCronInput-CWOTSpxK.js";import"./JEllipsis-C_gT_vEQ.js";import"./JDictSelectTag-CfF54ALX.js";import"./JImageUpload-BFwNYdm5.js";import"./download-DopMSmFN.js";import"./base64Conver-24EVOS6V.js";import"./index-CDa2_aYE.js";import"./index-D0jTtUNS.js";import"./useCountdown-BpP55PQ2.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JUpload-DgDEmizw.js";import"./index-Bn2zmO2L.js";import"./index-CEznvAVZ.js";import"./index-CfAukas3.js";import"./injectionKey-DPVn4AgL.js";import"./renderUtils-BgFeePLc.js";import"./validator-Dx9kcZ5e.js";import"./user.api-DAu0nuTv.js";const Z=O({name:"TenantPackUserModal",components:{BasicModal:L,BasicTable:Y,TableAction:X,TenantUserSelectModal:G},setup(){const t=j(()=>o.tenantId),o=V({}),[r,{setModalProps:d,closeModal:u}]=Q(e=>g(this,null,function*(){d({confirmLoading:!1,showCancelBtn:!0,showOkBtn:!1}),Object.assign(o,e.record),yield p()})),{createMessage:M}=J(),l=$("用户"),{tableContext:i}=q({tableProps:{api:K,immediate:!1,columns:v,canResize:!1,useSearchForm:!1,beforeFetch:e=>(e.tenantId=o.tenantId,e.packId=o.id,e.status=1,e),actionColumn:{width:120,fixed:"right"}}}),[a,{openModal:s,closeModal:T}]=H(),[n,{reload:p},{rowSelection:N,selectedRowKeys:ee}]=i;function y(e){return e.join(",")}function S(e){return[{label:"移除",popConfirm:{title:"是否确认移除",confirm:P.bind(null,e)}}]}function P(e){return g(this,null,function*(){let f={packId:e.packId,packName:e.packName,tenantId:o.tenantId,userId:e.id,realname:e.realname};yield E(f),yield p()})}function R(){s(!0,{list:[]})}function A(e){return g(this,null,function*(){if(e&&e.length>0){let f=[],w=[];for(let U of e)f.push(U.realname),w.push(U.id);let F={packId:o.id,packName:o.packName,tenantId:o.tenantId,userId:w.join(","),realname:f.join(",")};yield z(F),yield p()}T()})}return{title:l,registerModal:r,registerTable:n,rowSelection:N,getName:y,getTableAction:S,registerUserModal:a,addUser:R,onSelected:A,getTenantId:t}}});function x(t,o,r,d,u,M){const l=c("a-button"),i=c("TableAction"),a=c("BasicTable"),s=c("tenant-user-select-modal"),T=c("BasicModal");return b(),D(T,{onRegister:t.registerModal,destroyOnClose:"",title:t.title,width:1e3,footer:null},{default:m(()=>[k(a,{onRegister:t.registerTable,rowSelection:t.rowSelection},{departNames:m(({text:n,record:p})=>[n&&n.length>0?(b(),h(_,{key:0},[I(B(t.getName(n)),1)],64)):C("",!0)]),positionNames:m(({text:n,record:p})=>[n&&n.length>0?(b(),h(_,{key:0},[I(B(t.getName(n)),1)],64)):C("",!0)]),tableTitle:m(()=>[k(l,{preIcon:"ant-design:usergroup-add-outlined",type:"primary",onClick:t.addUser},{default:m(()=>o[0]||(o[0]=[I("邀请成员")])),_:1},8,["onClick"])]),action:m(({record:n})=>[k(i,{actions:t.getTableAction(n)},null,8,["actions"])]),_:1},8,["onRegister","rowSelection"]),k(s,{multi:!0,onRegister:t.registerUserModal,onOnSelect:t.onSelected,tenantId:t.getTenantId},null,8,["onRegister","onOnSelect","tenantId"])]),_:1},8,["onRegister","title"])}const lt=W(Z,[["render",x]]);export{lt as default};
