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-CF_FJn6P.js";import"./index-BN5Ac_IG.js";import{useListPage as q}from"./useListPage-i3Wl0_Fg.js";import{g as v}from"./tenant.data-C1uGOW6B.js";import{q as K,o as z,t as E}from"./tenant.api-SLCAStJX.js";import G from"./TenantUserSelectModal-BZdKFZlB.js";import{a8 as Q,a9 as H,u as J,_ as W}from"./index-CYriLmQo.js";import{Q as X}from"./componentMap-7D1QIeNI.js";import Y from"./BasicTable-DAfCfXmD.js";import"./BasicModal-BBgVjypv.js";import"./ModalHeader-jGKMr-DQ.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./useTimeout-DC8132dd.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./index-CxQILSKV.js";import"./useWindowSizeFn-BxrEMPtP.js";import"./index-BRTtls-l.js";import"./index-DOuVMe-q.js";import"./index-ByLO0zSl.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./index-BkgeZpOO.js";import"./useForm-8o5KRzWo.js";import"./JAreaLinkage-DFTeDmm8.js";import"./areaDataUtil-DFHnz1wu.js";import"./china-area-data-vendor-D0sJ9kfX.js";import"./JSelectUser-nVFm3ao2.js";import"./props-DoGpHXAD.js";import"./JSelectBiz-BW6f3e--.js";import"./JSelectDept-DorRVguN.js";import"./index-BTAl55Kt.js";import"./bem-2ra1afoV.js";import"./props-BLY2qIO5.js";import"./useContextMenu-DYyhcDf7.js";import"./JCodeEditor-_KZ8XnNK.js";import"./useFormItem-CWa0w7fA.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.js";/* empty css             */import"./JAddInput-CXT54-j9.js";import"./index-BTSd5ebC.js";import"./depart.api-C9T5xfw6.js";import"./JPopup-KP1kIsae.js";import"./EasyCronInput-XK54XB3r.js";import"./JEllipsis-287cEHxd.js";import"./JDictSelectTag-Jqy9TBcS.js";import"./download-CkbK5et1.js";import"./base64Conver-24EVOS6V.js";import"./index-QMJkXEyl.js";import"./index-Bb_NRLur.js";import"./useCountdown-C3-PRPLY.js";import"./useFormItemSingle-DM34aWgK.js";import"./JUpload-pyrTRFCz.js";import"./index-Bx9Mnn3N.js";import"./index-B1-pj6uh.js";import"./index-isxCPgHp.js";import"./injectionKey-DPVn4AgL.js";import"./renderUtils-CGtepdOw.js";import"./validator-0TDlyteC.js";import"./user.api-BUwWVSBN.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 mt=W(Z,[["render",x]]);export{mt as default};
