Files
qhmes/web-dist/js/TenantUserList-CsXEUpvn.js
2026-06-16 18:19:57 +08:00

4 lines
13 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var De=Object.defineProperty,$e=Object.defineProperties;var Pe=Object.getOwnPropertyDescriptors;var le=Object.getOwnPropertySymbols;var Oe=Object.prototype.hasOwnProperty,Fe=Object.prototype.propertyIsEnumerable;var pe=(t,o,s)=>o in t?De(t,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[o]=s,ue=(t,o)=>{for(var s in o||(o={}))Oe.call(o,s)&&pe(t,s,o[s]);if(le)for(var s of le(o))Fe.call(o,s)&&pe(t,s,o[s]);return t},ce=(t,o)=>$e(t,Pe(o));var v=(t,o,s)=>new Promise((I,p)=>{var d=r=>{try{i(s.next(r))}catch(f){p(f)}},b=r=>{try{i(s.throw(r))}catch(f){p(f)}},i=r=>r.done?I(r.value):Promise.resolve(r.value).then(d,b);i((s=s.apply(t,o)).next())});import Ne from"./BasicTable-C6eG0bgK.js";import ze from"./TableAction-BiXnWkvt.js";import"./TableImg.vue_vue_type_style_index_0_lang-65ZOQtFn.js";import{d as we,gT as me,aR as je,aS as He,s as be,M as H,ce as Qe,au as ke,u as Ke,dh as Je,T as Ve,gU as Ge,bG as q}from"./index-X7Y8jykP.js";import"./index-CfNJyBRj.js";import{D as qe}from"./dropdown-jkliuVyN.js";import{e as K,K as W,y as x,z as T,A as l,f as a,E as w,G as O,H as Q,c as Y,C as Z,F as de,r as R,B as fe,a1 as ye,i as j,o as Xe,u as c,Q as A}from"./vue-vendor-DNhG1Cve.js";import We from"./UserQuitModal-C5Wl5LJO.js";import"./index-D9GWo192.js";import{u as Ye}from"./useListPage-CK9oQ-1O.js";import"./index-BDvqZ5j4.js";import{x as Ze,y as et,o as tt}from"./user.api-M95RuX7p.js";import{u as nt,b as ot}from"./user.data-CjEdmD2E.js";import{U as st}from"./UserSelectModal-RTq67Ki6.js";import{m as at}from"./UserSetting.api-B68C7q5l.js";import{o as rt,m as ge,w as it}from"./tenant.api-CINwvO59.js";import lt from"./TenantUserDrawer-BydxEoIY.js";import pt from"./TenantPackAllotModal-Carm3rPu.js";import ut from"./TenantInviteUserModal-CoB7Uhk1.js";import{a as ct}from"./useDrawer-BDPywy9W.js";import{u as P}from"./useModal-DaJ3Bflg.js";import"./BasicTable.vue_vue_type_style_index_0_lang-B9DxrWas.js";import"./BasicForm-ClUSoD_-.js";import"./helper-DcLcf4v6.js";import"./index-BzChaRPg.js";import"./useAppInject-DPZGPcR3.js";import"./emoji-mart-vue-fast-R0uJEDq-.js";import"./BasicForm.vue_vue_type_style_index_0_lang-B29PWQy0.js";import"./index-DO7ZhK45.js";import"./index-ByCwbQDV.js";import"./index-Upeu4GGa.js";import"./index-C4wWpZeQ.js";import"./useTimeout-D5AmIBZw.js";import"./index-M9QP6cvf.js";import"./Skeleton-CimgOdM7.js";import"./useScrollTo-0FPEw5-K.js";import"./useIntersectionObserver-BGOgyKyu.js";import"./index-saD4h7VJ.js";import"./useBreakpoint-DXhPW7nV.js";import"./useEventListener-BRXjwk7A.js";import"./breakpointEnum-BhAg6bcX.js";import"./uniqBy--vsL0WVB.js";import"./BasicModal-xH56XuRZ.js";import"./ModalHeader-Sr8KwhJJ.js";import"./useWindowSizeFn-C-0M9_Ul.js";import"./index-CuWaQdlK.js";import"./useForm-D61zovon.js";import"./injectionKey-DPVn4AgL.js";import"./index-DSsDi_fL.js";import"./Group-UHkub2tu.js";import"./Checkbox-Dbxs4we4.js";import"./index-BuONesFs.js";import"./FormOutlined-Y84itqS0.js";import"./useTableContext-CncNVXgp.js";import"./index-DTjkSGYl.js";import"./eagerComputed-BTlOruLW.js";import"./fromPairs-Dx9PT-t0.js";import"./useMaxLevel-DE205ncc.js";import"./index-DfHu-LAS.js";import"./Group-DBzJABA_.js";import"./RadioButton-DRBix2Fq.js";import"./index-C7ckZv9Z.js";import"./DirectoryTree-nk_YTTIy.js";import"./FolderOpenOutlined-SzIPA7z0.js";import"./index-Cl-8Hzo4.js";import"./scrollTo-D49dA-9c.js";import"./operationUnit-vCu2co3e.js";import"./index-C69VKHba.js";import"./index-DklMb9Qc.js";import"./UpOutlined-B1UMbtrP.js";import"./index-DsixALRt.js";import"./dayjs-jnKD3YGS.js";import"./index-aCD42OrZ.js";import"./quarterOfYear-BU2sPnff.js";import"./index-J2mOtM3w.js";import"./dayjs-ALi1pEeb.js";import"./clickOutside-DHfwTU6R.js";import"./onMountedOrActivated-DhSdLlqP.js";import"./throttle-De_jAmBh.js";import"./uuid-CODpppBC.js";import"./sortable.esm-DJNoJSdJ.js";import"./RedoOutlined-Cq2g4Slp.js";import"./index-CeNCCWzL.js";import"./TableAction.vue_vue_type_style_index_0_lang-BIWZ0bGo.js";import"./index-fAAIzD3j.js";import"./index-DfX9t4DO.js";import"./isNumeric-DjvBa-1E.js";import"./validator-CQGbnGwd.js";import"./sysPasswordRules-B0k1_Tad.js";import"./check.rule.api-DN4OQWpA.js";import"./renderUtils-BiIzV8ua.js";import"./index-Cmtq_YLa.js";import"./Editor-DbH9VuAv.js";import"./index-Cq6YxX27.js";import"./JDictSelectUtil-DwVTEDM5.js";import"./index-B4gPlWQt.js";import"./useTable-DbHE4FHE.js";import"./useMethods-D3efiSSd.js";import"./useApprovalSelection-D4wlWO_T.js";import"./ArrowLeftOutlined-B3JgaWh-.js";import"./index-DZJwICFr.js";import"./useSelectBiz-C58pZLPQ.js";import"./props-BWd0f6uH.js";import"./tenant.data-DaXPsI2H.js";const he={getEnabledType:"/sys/thirdApp/getEnabledType",wechatEnterprise:{user:"/sys/thirdApp/sync/wechatEnterprise/user",depart:"/sys/thirdApp/sync/wechatEnterprise/depart"},dingtalk:{user:"/sys/thirdApp/sync/dingtalk/user",depart:"/sys/thirdApp/sync/dingtalk/depart"}};let X=null;const mt=()=>v(null,null,function*(){if(X!=null)return me(X);{let{success:t,result:o}=yield we.get({url:he.getEnabledType},{isTransformResponse:!1});if(t)return X=me(o),o}return{}}),Te=K({__name:"JThirdAppDropdown",props:{type:String,name:String,syncToApp:Boolean,syncToLocal:Boolean},emits:["to-app","to-local"],setup(t,{emit:o}){const s=t,I=o,p=Y(()=>s.type==="wechatEnterprise"?!1:s.syncToLocal);function d(b){I(b.key,{type:s.type})}return(b,i)=>{const r=W("a-button"),f=He,L=je,h=qe;return t.syncToApp&&t.syncToLocal?(T(),x(h,{key:0},{overlay:l(()=>[a(L,{onClick:d},{default:l(()=>[t.syncToApp?(T(),x(f,{key:"to-app"},{default:l(()=>[w("同步到"+O(t.name),1)]),_:1})):Q("",!0),p.value?(T(),x(f,{key:"to-local"},{default:l(()=>[...i[2]||(i[2]=[w("同步到本地",-1)])]),_:1})):Q("",!0)]),_:1})]),default:l(()=>[a(r,{type:"primary",preIcon:"ant-design:sync-outlined"},{default:l(()=>[w("同步"+O(t.name),1)]),_:1})]),_:1})):t.syncToApp?(T(),x(r,{key:1,type:"primary",preIcon:"ant-design:sync-outlined",onClick:i[0]||(i[0]=S=>d({key:"to-app"}))},{default:l(()=>[w("同步"+O(t.name),1)]),_:1})):(T(),x(r,{key:2,type:"primary",preIcon:"ant-design:sync-outlined",onClick:i[1]||(i[1]=S=>d({key:"to-local"}))},{default:l(()=>[w("同步"+O(t.name)+"到本地",1)]),_:1}))}}}),dt=K({__name:"JThirdAppButton",props:{bizType:{type:String,required:!0},syncToApp:Boolean,syncToLocal:Boolean,selectedRowKeys:Array},emits:["sync-ok","sync-error","sync-finally"],setup(t,{emit:o}){const{createMessage:s,createWarningModal:I}=be(),p=t,d=o,b=R({}),i=Y(()=>({syncToApp:p.syncToApp,syncToLocal:p.syncToLocal})),r=Y(()=>({"to-app":f,"to-local":L}));function f(y){S(y.type,"/toApp")}function L(y){S(y.type,"/toLocal")}function h(){return v(this,null,function*(){b.value=yield mt()})}function S(y,k){let F=he[y];if(!(F&&F[p.bizType]))return;let ee=F[p.bizType]+k,_=p.selectedRowKeys,m="确定要开始同步全部数据吗?可能花费较长时间!";return Array.isArray(_)&&_.length>0?m=`确定要开始同步这 ${_.length} 项吗`:_=[],new Promise((J,te)=>{const V=H.confirm({icon:a(Qe),title:"同步",content:m,onOk:()=>{V.update({keyboard:!1,okText:"同步中…",cancelButtonProps:{disabled:!0}});let G={ids:_.join(",")};return we.get({url:ee,params:G},{isTransformResponse:!1}).then(g=>{let C={};g.result&&(C={width:600,title:g.message,content:()=>{let B,E=["成功信息如下:",M(j,g.result.successInfo.map((D,$)=>`${$+1}. ${D}`).join(`
`))];return g.success?B=[...E,j("br"),"无失败信息!"]:B=["失败信息如下:",M(j,g.result.failInfo.map((D,$)=>`${$+1}. ${D}`).join(`
`)),j("br"),...E],B}}),g.success?(C!=null?H.success(C):s.warning(g.message),d("sync-ok")):(C!=null?H.warning(C):s.warning(g.message),d("sync-error"))}).catch(()=>V.destroy()).finally(()=>{J(),d("sync-finally",{type:y,direction:k,isToApp:k==="/toApp",isToLocal:k==="/toLocal"})})},onCancel(){J()}})})}function M(y,k){return y("div",{id:"box",style:{minHeight:"100px",border:"1px solid #d9d9d9",fontSize:"14px",maxHeight:"250px",whiteSpace:"pre",overflow:"auto",padding:"10px"}},k)}return h(),(y,k)=>t.syncToApp||t.syncToLocal?(T(),Z(de,{key:0},[b.value.wechatEnterprise?(T(),x(Te,fe({key:0,type:"wechatEnterprise",name:"企微"},i.value,ye(r.value)),null,16)):Q("",!0),b.value.dingtalk?(T(),x(Te,fe({key:1,type:"dingtalk",name:"钉钉"},i.value,ye(r.value)),null,16)):Q("",!0)],64)):(T(),Z(de,{key:1},[w("未设置任何同步方向")],64))}}),ft=ke(dt,[["__scopeId","data-v-dfd2b7af"]]),yt={style:{"margin-left":"10px","margin-top":"5px"}},gt={class:"tenant-name"},Tt=K({name:"tenant-system-user"}),wt=K(ce(ue({},Tt),{setup(t){const{createMessage:o,createConfirm:s}=be(),[I,{openDrawer:p}]=ct(),[d,{openModal:b}]=P(),[i,{openModal:r}]=P(),[f,{openModal:L}]=P(),h=Ke(),S=h.getUserInfo.username,M=R(!1),{prefixCls:y,tableContext:k,onExportXls:F,onImportXls:ee}=Ye({designScope:"user-list",tableProps:{title:"租户用户列表",api:Ze,columns:ot,size:"small",formConfig:{schemas:nt},actionColumn:{width:120},beforeFetch:e=>(e.userTenantStatus="1,3,4",Object.assign({column:"createTime",order:"desc"},e))}}),[_,{reload:m,updateTableDataRecord:J},{rowSelection:te,selectedRows:V,selectedRowKeys:G}]=k;function g(){p(!0,{isUpdate:!1,showFooter:!0,tenantSaas:!0})}function C(e){return v(this,null,function*(){p(!0,{record:e,isUpdate:!0,showFooter:!0,tenantSaas:!0})})}function B(e){return v(this,null,function*(){p(!0,{record:e,isUpdate:!0,showFooter:!1,tenantSaas:!0})})}function E(){m()}function D({isToLocal:e}){e&&m()}function $(e){return[{label:"编辑",onClick:C.bind(null,e)}]}function ve(e){return[{label:"查看详情",onClick:B.bind(null,e)},{label:"移除用户",onClick:Ee.bind(null,e.id)},{label:"删除用户",popConfirm:{title:"是否确认删除该用户",confirm:Re.bind(null,e)},ifShow:()=>{var n;return e.username!==((n=h.getUserInfo)==null?void 0:n.username)&&Ge(e.createTime)}},{label:"变更拥有者",onClick:xe.bind(null,e),ifShow:()=>e.username===e.createBy},{label:"同意",onClick:ne.bind(null,e.id,"1"),ifShow:()=>(e.status==="3"||e.status==="4")&&e.createBy===S},{label:"拒绝",popConfirm:{title:"是否确认拒绝",confirm:ne.bind(null,e.id,"4")},ifShow:()=>e.status==="3"&&e.createBy===S},{label:"用户套餐",onClick:Ue.bind(null,e)}]}function ne(e,n){et({userId:e,status:n}).then(u=>{u.success?E():o.warning(u.message)}).catch(u=>{o.warning(u.message)})}const oe=R(""),se=R([]),[Ae,{openModal:Se}]=P(),[_e,{openModal:Ce}]=P(),ae=R("");function xe(e){oe.value=q(),se.value=[e.id],ae.value=e.createBy,Se(!0)}function Ie(e,n){if(n&&n.length>0){let u=n[0];at({userId:u,tenantId:c(oe)}).then(N=>{var z;N.success?(o.success("交接成功"),((z=h.getUserInfo)==null?void 0:z.username)==ae.value?h.logout(!0):m()):o.warning(N.message)})}}const re=R("");Me();function Me(){return v(this,null,function*(){re.value=yield rt()})}function Ue(e){L(!0,{record:e})}function Re(e){tt({id:e.id},m)}function Le(){Ce(!0,{})}function Be(e,n){return v(this,null,function*(){let u=q();e&&(yield ge({ids:u,phone:e}),m()),n&&(yield ge({ids:u,username:n}),m())})}function Ee(e){return v(this,null,function*(){yield it({userIds:e,tenantId:q()},m)})}return Xe(()=>{Je("租户用户")}),(e,n)=>{const u=W("a-button"),N=W("a-icon"),z=Ve,ie=H;return T(),Z("div",null,[a(c(Ne),{onRegister:c(_),rowSelection:c(te)},{tableTitle:l(()=>[a(u,{type:"primary",preIcon:"ant-design:plus-outlined",onClick:g},{default:l(()=>[...n[3]||(n[3]=[w("新增",-1)])]),_:1}),a(u,{preIcon:"ant-design:user-add-outlined",type:"primary",onClick:Le,style:{"margin-right":"5px"}},{default:l(()=>[...n[4]||(n[4]=[w(" 邀请用户加入 ",-1)])]),_:1}),a(ft,{"biz-type":"user","selected-row-keys":c(G),syncToApp:"",syncToLocal:"",onSyncFinally:D},null,8,["selected-row-keys"]),a(u,{type:"primary",onClick:n[0]||(n[0]=U=>c(r)(!0,{})),preIcon:"ant-design:user-delete-outlined"},{default:l(()=>[...n[5]||(n[5]=[w("离职人员",-1)])]),_:1}),A("div",yt,[n[6]||(n[6]=w(" 当前登录租户: ",-1)),A("span",gt,O(re.value),1)]),a(z,{title:"租户用户更多操作说明"},{default:l(()=>[a(N,{type:"question-circle",style:{"margin-left":"8px",cursor:"pointer"},onClick:n[1]||(n[1]=U=>M.value=!0)})]),_:1})]),action:l(({record:U})=>[a(c(ze),{actions:$(U),dropDownActions:ve(U)},null,8,["actions","dropDownActions"])]),_:1},8,["onRegister","rowSelection"]),a(lt,{onRegister:c(I),onSuccess:E},null,8,["onRegister"]),a(We,{onRegister:c(i),onSuccess:c(m)},null,8,["onRegister","onSuccess"]),a(st,{onRegister:c(Ae),excludeUserIdList:se.value,maxSelectCount:1,onGetSelectResult:Ie},null,8,["onRegister","excludeUserIdList"]),a(pt,{onRegister:c(f)},null,8,["onRegister"]),a(ut,{onRegister:c(_e),onInviteOk:Be},null,8,["onRegister"]),a(ie,{open:M.value,"onUpdate:open":n[2]||(n[2]=U=>M.value=U),footer:null,title:"租户用户更多操作说明",width:800},{default:l(()=>[...n[7]||(n[7]=[A("ul",{class:"user-tenant-tip"},[A("li",null,"移除将用户从当前租户中移除"),A("li",null,"删除仅可删除当天创建的用户删除后可在系统用户回收站恢复"),A("li",null,"离职非租户创建者可进行离职操作离职员工可在离职人员列表查看"),A("li",null,"交接租户创建者可进行租户交接交接后员工信息可在离职人员列表查看")],-1),A("div",{style:{height:"10px"}},null,-1)])]),_:1},8,["open"])])}}})),wo=ke(wt,[["__scopeId","data-v-cfa9e30d"]]);export{wo as default};