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-D2AmS0aU.js";import"./index-LwlFn7Y4.js";import{useListPage as q}from"./useListPage-BEtybUiF.js";import{g as v}from"./tenant.data-jovtG_GO.js";import{q as K,o as z,t as E}from"./tenant.api-CpQl223K.js";import G from"./TenantUserSelectModal-CadNCd_G.js";import{a8 as Q,a9 as H,u as J,_ as W}from"./index-B_2CoVdl.js";import{Q as X}from"./componentMap-CzCGDP7x.js";import Y from"./BasicTable-Clbg3fHx.js";import"./BasicModal-D3g2CFhF.js";import"./ModalHeader-C-C0dUi_.js";import"./antd-vue-vendor-CDWW6V_M.js";import"./useTimeout-CB9F1PLu.js";import"./vxe-table-vendor-B5h3MVdD.js";import"./index-DAURrYyA.js";import"./useWindowSizeFn-C3WExEpc.js";import"./index-Dz2zbQB_.js";import"./index-exs4VcBw.js";import"./index-ByLO0zSl.js";import"./useIntersectionObserver-FVRzwlSd.js";import"./index-ARbUvvsq.js";import"./useForm-CcjrODHR.js";import"./JAreaLinkage-CSgDAlrn.js";import"./areaDataUtil-DFHnz1wu.js";import"./china-area-data-vendor-D0sJ9kfX.js";import"./JSelectUser-BQIJUcBR.js";import"./props-BCVPj-bG.js";import"./JSelectBiz-CJyWq5s2.js";import"./JSelectDept-wKz_Qtmc.js";import"./index-BKs2x_To.js";import"./bem-C6eT35UB.js";import"./props-BLY2qIO5.js";import"./useContextMenu-CSt5a1-F.js";import"./JCodeEditor-esTLnfS3.js";import"./useFormItem-CWa0w7fA.js";import"./htmlmixed-DRe7JlAp.js";import"./vue-B0b3nX1K.js";/* empty css             */import"./JAddInput-YFlAniYT.js";import"./index-CkL00Q0a.js";import"./depart.api-0qTriT9h.js";import"./JPopup-BJBYqoWe.js";import"./EasyCronInput-DclSHT47.js";import"./JEllipsis-Cn7GCKHR.js";import"./JDictSelectTag-CxpDdimB.js";import"./download-2tYEzlDW.js";import"./base64Conver-24EVOS6V.js";import"./index-Cgt544dC.js";import"./index-BZ9ST2iq.js";import"./useCountdown-ImUE7YaG.js";import"./useFormItemSingle-DM34aWgK.js";import"./JUpload-DzM-D4DX.js";import"./index-khU3p_On.js";import"./index-DPEnuI0R.js";import"./index-Cnb8BkwG.js";import"./injectionKey-DPVn4AgL.js";import"./renderUtils-Cbe4E0PZ.js";import"./validator-jM63P_3m.js";import"./user.api-BLHI3_6c.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};
