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-zKZnG1QC.js";import"./index-gyz1IdHU.js";import{useListPage as q}from"./useListPage-TMORxSEa.js";import{g as v}from"./tenant.data-BTTBgNSE.js";import{q as K,o as z,t as E}from"./tenant.api-C9mls3Ap.js";import G from"./TenantUserSelectModal-CmTwf42g.js";import{a8 as Q,a9 as H,u as J,_ as W}from"./index-Cy4uayzW.js";import{Q as X}from"./componentMap-0iK4HQBq.js";import Y from"./BasicTable-CgafrQwz.js";import"./BasicModal-sKcs_9Ir.js";import"./ModalHeader-ByCVDoqO.js";import"./antd-vue-vendor-CahNzUUa.js";import"./useTimeout-gJpgadD6.js";import"./vxe-table-vendor-Cdi8WfTx.js";import"./index-Bdn0r8CG.js";import"./useWindowSizeFn-DDyhhqyw.js";import"./index-CYoRlduV.js";import"./index-DYB8Ashr.js";import"./index-CrdW4fN1.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./index-BN26Feep.js";import"./useForm-DfoT2G6J.js";import"./JAreaLinkage-CTMEfTuh.js";import"./areaDataUtil-Dk3xkGfK.js";import"./china-area-data-vendor-ByvEpbzN.js";import"./JSelectUser-B98pRPrS.js";import"./props-CtlWAg-s.js";import"./JSelectBiz-vYDBA0SK.js";import"./JSelectDept-D-TUaHvK.js";import"./index-CNQBnF3P.js";import"./bem-IZKqD41e.js";import"./props-CG-jAkbI.js";import"./useContextMenu-Q6J5bB_u.js";import"./JCodeEditor-U9QIstNN.js";import"./useFormItem-IOFWTdED.js";import"./htmlmixed-DoVLO6sG.js";import"./vue-DY75b9GC.js";/* empty css             */import"./JAddInput-DP4caUmw.js";import"./index-tDBMxW9-.js";import"./depart.api-B8q8MC-j.js";import"./JPopup-CVHkQZFq.js";import"./EasyCronInput-CZdChTcP.js";import"./JEllipsis-TuDc52fh.js";import"./JDictSelectTag-CalJXNVe.js";import"./JImageUpload-C5OCTlCG.js";import"./download-Bn4f3tzD.js";import"./base64Conver-24EVOS6V.js";import"./index-D6H6KsT6.js";import"./index-CLxBW_h0.js";import"./useCountdown-2P9HvnfJ.js";import"./useFormItemSingle-BEyrYQqf.js";import"./JUpload-DSWoDwh2.js";import"./index-B4vNk56t.js";import"./index-Dc7Jr5-j.js";import"./index-Dm1rPBfc.js";import"./injectionKey-DPVn4AgL.js";import"./renderUtils-BcsccCoe.js";import"./validator-CyHCj96y.js";import"./user.api-CoaMxYm2.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};
