1import{cg as q,cJ as r,c4 as ie,de as k,c3 as e,c6 as i,cX as l,c5 as K,f as V,cQ as T,cx as E,c$ as a,cO as c,dc as de,cF as pe,df as ce,da as ue,dg as xe,cd as C,d3 as ye,cc as P,d4 as ge}from"./vendor-vue-C3df0gLH.js";import{_ as me}from"./Pagination.vue_vue_type_script_setup_true_lang-BjWqQ8T1.js";import{f as be,a as fe}from"./user-DJ6Ve9dT.js";import{H,h as he,g as ve}from"./index-ByVTmJon.js";import{u as we}from"./useBatchUserToggle-CvHz4wv8.js";import{i as O}from"./iosButton-BqygnPia.js";/* empty css */import{i as J}from"./iosDialog-3t7wGQfZ.js";/* empty css */import"./vendor-BAp2x3JD.js";import"./vendor-charts-BofaT7g3.js";import"./vendor-vuetify-Cd8aE-6N.js";import"./vendor-vxe-D9xzQ_Nx.js";/* empty css */const _e={class:"space-y-4 max-h-[70vh] overflow-y-auto"},Ce={key:0,class:"text-sm text-gray-600"},ke={key:1,class:"flex items-center justify-center py-16"},$e={key:2,class:"flex flex-col items-center justify-center py-16 text-gray-400"},De={key:3,class:"overflow-x-auto border border-gray-200 rounded-lg"},Fe={class:"min-w-full divide-y divide-gray-200"},Ae={class:"bg-white divide-y divide-gray-200"},Ue={class:"px-4 py-3 whitespace-nowrap text-sm text-gray-900 font-mono"},Se={class:"px-4 py-3 whitespace-nowrap text-sm text-gray-900"},Ve={class:"px-4 py-3 whitespace-nowrap text-sm text-gray-900"},Ee={class:"px-4 py-3 whitespace-nowrap text-sm text-gray-900"},Le={class:"px-4 py-3 whitespace-nowrap text-sm text-gray-900"},Ne={class:"px-4 py-3 whitespace-nowrap text-sm"},Ie=q({__name:"userCompanyDialog",setup(Q,{expose:_}){const{showMessage:A}=H(),v={OWNER:"æå±è
",ADMIN:"管çå",MEMBER:"æå"},m={VALID:"ææ",DISABLED:"æå被ç¦ç¨",LEAVE:"主å¨éåºç»ç»",REMOVED:"被移åºç»ç»",DISSOLVE:"ç»ç»è§£æ£"},p=c(!1),f=c(!1),b=c([]),d=c(""),h=u=>v[u]||u,$=u=>m[u]||u,w=async(u,x)=>{p.value=!0,d.value=x||"",f.value=!0;try{const n=await be(u);b.value=n.list||[]}catch(n){console.error("å è½½å å
¥å
¬å¸å¤±è´¥:",n),b.value=[],A("å è½½å å
¥å
¬å¸å¤±è´¥","error")}finally{f.value=!1}},y=()=>{p.value=!1,b.value=[],d.value=""};return _({openDialog:w}),(u,x)=>(r(),ie(a(J),{modelValue:p.value,"onUpdate:modelValue":x[0]||(x[0]=n=>p.value=n),title:"å å
¥çå
¬å¸",size:"xl",onClose:y},{default:k(()=>[e("div",_e,[d.value?(r(),i("div",Ce," ç¨æ·ï¼"+l(d.value),1)):K("",!0),f.value?(r(),i("div",ke,[...x[1]||(x[1]=[e("div",{class:"inline-block h-8 w-8 animate-spin rounded-full border-b-2 border-[#6A5CFF]"},null,-1),e("p",{class:"ml-3 text-sm text-gray-500"},"å è½½ä¸...",-1)])])):b.value.length===0?(r(),i("div",$e,[...x[2]||(x[2]=[e("p",{class:"text-sm"},"ææ æ°æ®",-1)])])):(r(),i("div",De,[e("table",Fe,[x[3]||(x[3]=e("thead",{class:"bg-gray-50"},[e("tr",null,[e("th",{class:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"å
¬å¸ID"),e("th",{class:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"å
¬å¸åç§°"),e("th",{class:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"è§è²"),e("th",{class:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"ç¶æ"),e("th",{class:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"å å
¥æ¶é´"),e("th",{class:"px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},"å½åå
¬å¸")])],-1)),e("tbody",Ae,[(r(!0),i(V,null,T(b.value,(n,g)=>(r(),i("tr",{key:`${n.companyId}-${g}`,class:"hover:bg-gray-50"},[e("td",Ue,l(n.companyId),1),e("td",Se,l(n.companyName),1),e("td",Ve,l(h(n.role)),1),e("td",Ee,l($(n.status)),1),e("td",Le,l(n.joinedAt),1),e("td",Ne,[e("span",{class:E(["px-2 py-0.5 rounded-full text-[11px] font-medium",n.isCurrent?"bg-emerald-50 text-emerald-600":"bg-gray-100 text-gray-500"])},l(n.isCurrent?"æ¯":"å¦"),3)])]))),128))])])]))])]),_:1},8,["modelValue"]))}}),Me={class:"h-full overflow-y-auto bg-gray-50"},Re={class:"p-4 md:p-6 lg:p-8"},ze={class:"flex items-center justify-between mb-6 gap-3 flex-wrap"},Be={class:"flex items-center gap-3 flex-wrap"},je={class:"mt-1 text-sm text-gray-500"},Pe={class:"text-sm text-gray-500"},Oe=["disabled"],qe=["disabled"],Ke=["disabled"],Te={class:"mb-6 flex items-center gap-2 flex-wrap"},He=["disabled"],Je=["disabled"],Qe={key:0,class:"flex items-center justify-center py-20"},We={key:1,class:"flex flex-col items-center justify-center py-20 text-gray-400"},Xe={key:2,class:"bg-white rounded-2xl border border-gray-200/80 shadow-sm overflow-hidden"},Ge={class:"overflow-x-auto"},Ye={class:"w-full min-w-[1180px] text-[13px]"},Ze={class:"bg-gray-50 text-left"},et={class:"w-10 px-4 py-3"},tt=["checked","disabled"],st={class:"px-4 py-2.5"},ot=["checked","aria-label","onChange"],at={class:"px-4 py-2.5 text-gray-600 font-mono text-xs"},lt={class:"px-4 py-2.5 text-gray-900 font-medium whitespace-nowrap"},nt={class:"px-4 py-2.5 text-gray-600"},rt={class:"px-4 py-2.5 text-gray-600"},it={class:"px-4 py-2.5 text-gray-600 whitespace-nowrap"},dt={class:"px-4 py-2.5 text-gray-600 font-mono text-xs"},pt={class:"px-4 py-2.5 text-gray-600"},ct={class:"px-4 py-2.5 whitespace-nowrap"},ut={class:"px-4 py-2.5 text-gray-600 font-mono text-xs"},xt={class:"px-4 py-2.5 text-right whitespace-nowrap"},yt={class:"flex items-center justify-end gap-2"},gt=["onClick"],mt=["disabled","onClick"],bt=["disabled","onClick"],ft={class:"py-4 text-sm text-gray-600 leading-6"},ht={class:"flex justify-end gap-3 w-full"}
1,Nt=q({__name:"UserList",setup(Q){const _=ye(),A=ge(),{showMessage:v}=H(),m=c(!1),p=c(1),f=c(20),b=c(0),d=c(_.query.phone||""),h=c([]),$=c(),w=c(null),y=c({show:!1,title:"æä½ç¡®è®¤",content:"",onConfirm:()=>{}}),u=(s,t)=>{y.value={show:!0,title:"æä½ç¡®è®¤",content:s,onConfirm:t}},x=()=>{y.value.show=!1,typeof y.value.onConfirm=="function"&&y.value.onConfirm()},n=()=>{const s={..._.query};d.value.trim()?s.phone=d.value.trim():delete s.phone,A.push({query:s})},g=async()=>{m.value=!0,U();try{const s={pageNumber:p.value,pageSize:f.value};d.value.trim()&&(s.phone=d.value.trim());const t=await fe(s);h.value=t.list||[],p.value=t.pageNumber||p.value,f.value=t.pageSize||f.value,b.value=t.total||0}catch(s){console.error("å è½½ç¨æ·å表失败:",s),h.value=[],b.value=0,v("å è½½ç¨æ·å表失败","error")}finally{m.value=!1}},L=()=>{p.value=1,n(),g()},W=()=>{d.value="",p.value=1,n(),g()},X=s=>{p.value=s,g()},D=s=>s===!0||s===1,{selectedCount:N,enabledCount:I,disabledCount:M,isAllSelected:G,isRowSelected:Y,toggleRowSelection:Z,toggleSelectAll:R,clearSelection:U,isProcessing:z,batchDisable:B,batchEnable:j}=we({rows:h,getPhone:s=>s.phone,isEnabled:s=>D(s.enabled),confirm:u,onFinished:()=>g()}),ee=s=>s.id,te=s=>s.defaultCompanyName||"-",se=s=>s.defaultCompanyId??"-",oe=s=>s?new Date(s).toLocaleString("zh-CN"):"-",ae=s=>{var o;const t=s.username?`${s.phone} / ${s.username}`:s.phone;(o=$.value)==null||o.openDialog(s.id,t)},F=s=>w.value===s.phone,le=s=>{u("ç¡®å®è¦å¯ç¨è¯¥ç¨æ·åï¼",async()=>{w.value=s.phone;try{await he({phone:s.phone}),await g(),v("å¯ç¨ç¨æ·æå","success")}catch(t){console.error("å¯ç¨ç¨æ·å¤±è´¥:",t),v("å¯ç¨ç¨æ·å¤±è´¥","error")}finally{w.value=null}})},ne=s=>{u("ç¡®å®è¦ç¦ç¨è¯¥ç¨æ·åï¼ç¦ç¨åç¨æ·å°æ æ³ç»å½ç³»ç»ã",async()=>{w.value=s.phone;try{await ve({phone:s.phone}),await g(),v("ç¦ç¨ç¨æ·æå","success")}catch(t){console.error("ç¦ç¨ç¨æ·å¤±è´¥:",t),v("ç¦ç¨ç¨æ·å¤±è´¥","error")}finally{w.value=null}})};return de(()=>_.query.phone,s=>{const t=s||"";d.value!==t&&(d.value=t,p.value=1,g())}),pe(()=>{g()}),(s,t)=>(r(),i("div",Me,[e("div",Re,[e("div",ze,[e("div",Be,[e("div",null,[t[7]||(t[7]=e("h1",{class:"text-xl font-bold text-gray-900"},"ç¨æ·å表",-1)),e("p",je,"å
± "+l(b.value)+" ä¸ªç¨æ·",1)]),a(N)?(r(),i(V,{key:0},[e("span",Pe,"å·²é "+l(a(N))+" 个",1),e("button",{disabled:m.value||a(z)||!a(I),class:"px-4 py-2 text-[13px] font-semibold rounded-2xl bg-rose-600 text-white hover:bg-rose-700 transition-colors disabled:opacity-40",onClick:t[0]||(t[0]=(...o)=>a(B)&&a(B)(...o))}," æ¹éç¦ç¨ç¨æ·ï¼"+l(a(I))+"ï¼ ",9,Oe),e("button",{disabled:m.value||a(z)||!a(M),class:"px-4 py-2 text-[13px] font-semibold rounded-2xl bg-emerald-600 text-white hover:bg-emerald-700 transition-colors disabled:opacity-40",onClick:t[1]||(t[1]=(...o)=>a(j)&&a(j)(...o))}," æ¹éå¯ç¨ç¨æ·ï¼"+l(a(M))+"ï¼ ",9,qe),e("button",{class:"px-4 py-2 text-[13px] font-semibold rounded-2xl bg-white border border-gray-200 text-gray-600 hover:bg-gray-50 transition-colors",onClick:t[2]||(t[2]=(...o)=>a(U)&&a(U)(...o))}," åæ¶éæ© ")],64)):K("",!0)]),e("button",{onClick:g,disabled:m.value,class:"px-4 py-2 text-[13px] font-semibold rounded-2xl bg-white border border-gray-200 text-gray-600 hover:bg-gray-50 transition-colors disabled:opacity-50"}," å·æ° ",8,Ke)]),e("div",Te,[ce(e("input",{"onUpdate:modelValue":t[3]||(t[3]=o=>d.value=o),type:"text",placeholder:"æææºå·æç´¢",class:"w-full max-w-xs rounded-xl border border-gray-200 bg-white px-4 py-2 text-sm text-gray-700 outline-none transition focus:border-[#6A5CFF] focus:ring-2 focus:ring-[#6A5CFF]/10",onKeyup:xe(L,["enter"])},null,544),[[ue,d.value]]),e("button",{onClick:L,disabled:m.value,class:"px-4 py-2 text-[13px] font-semibold rounded-2xl bg-[#6A5CFF] text-white hover:opacity-90 transition-opacity disabled:opacity-50"}," æç´¢ ",8,He),e("button",{onClick:W,disabled:m.value,class:"px-4 py-2 text-[13px] font-semibold rounded-2xl bg-white border border-gray-200 text-gray-600 hover:bg-gray-50 transition-colors disabled:opacity-50"}," éç½® ",8,Je)]),m.value?(r(),i("div",Qe,[...t[8]||(t[8]=[e("div",{class:"inline-block h-8 w-8 animate-spin rounded-full border-b-2 border-[#6A5CFF]"},null,-1),e("p",{class:"ml-3 text-sm text-gray-500"},"å è½½ä¸...",-1)])])):h.value.length===0?(r(),i("div",We,[...t[9]||(t[9]=[e("p",{class:"text-sm"},"ææ æ°æ®",-1)])])):(r(),i("div",Xe,[e("div",Ge,[e("table",Ye,[e("thead",null,[e("tr",Ze,[e("th",et,[e("input",{type:"checkbox",class:"h-4 w-4 cursor-pointer rounded border-gray-300 text-[#6A5CFF] focus:ring-2 focus:ring-[#6A5CFF]/30 disabled:cursor-not-allowed disabled:opacity-40",checked:a(G),disabled:!h.value.length,"aria-label":"å
¨éå½åé¡µç¨æ·",onChange:t[4]||(t[4]=(...o)=>a(R)&&a(R)(...o))},null,40,tt)]),t[10]||(t[10]=e("th",{class:"px-4 py-3 font-semibold text-gray-700 whitespace-nowrap"},"ç¨æ·ID",-1)),t[11]||(t[11]=e("th",{class:"px-4 py-3 font-semibold text-gray-700 whitespace-nowrap"},"ææºå·",-1)),t[12]||(t[12]=e("th",{class:"px-4 py-3 font-semibold text-gray-700 whitespace-nowrap"},"ç¨æ·å",-1)),t[13]||(t[13]=e("th",{class:"px-4 py-3 font-semibold text-gray-700 whitespace-nowrap"},"æµç§°",-1)),t[14]||(t[14]=e("th",{class:"px-4 py-3 font-semibold text-gray-700 whitespace-nowrap"},"æ³¨åæ¶é´",-1)),t[15]||(t[15]=e("th",{class:"px-4 py-3 font-semibold text-gray-700 whitespace-nowrap"}
1,"é»è®¤å
¬å¸ID",-1)),t[16]||(t[16]=e("th",{class:"px-4 py-3 font-semibold text-gray-700 whitespace-nowrap"},"é»è®¤å
¬å¸åç§°",-1)),t[17]||(t[17]=e("th",{class:"px-4 py-3 font-semibold text-gray-700 whitespace-nowrap"},"ç¶æ",-1)),t[18]||(t[18]=e("th",{class:"px-4 py-3 font-semibold text-gray-700 whitespace-nowrap"},"æ¸ éå·",-1)),t[19]||(t[19]=e("th",{class:"px-4 py-3 font-semibold text-gray-700 whitespace-nowrap text-right"},"æä½",-1))])]),e("tbody",null,[(r(!0),i(V,null,T(h.value,(o,re)=>(r(),i("tr",{key:ee(o),class:E([re%2===0?"bg-white":"bg-gray-50/50","hover:bg-gray-50 transition-colors"])},[e("td",st,[e("input",{type:"checkbox",class:"h-4 w-4 cursor-pointer rounded border-gray-300 text-[#6A5CFF] focus:ring-2 focus:ring-[#6A5CFF]/30",checked:a(Y)(o),"aria-label":`éæ©ç¨æ· ${o.phone}`,onChange:S=>a(Z)(o)},null,40,ot)]),e("td",at,l(o.id),1),e("td",lt,l(o.phone),1),e("td",nt,l(o.username||"-"),1),e("td",rt,l(o.nickname||"-"),1),e("td",it,l(oe(o.createdAt)),1),e("td",dt,l(se(o)),1),e("td",pt,l(te(o)),1),e("td",ct,[e("span",{class:E(["px-2 py-0.5 rounded-full text-[11px] font-medium",D(o.enabled)?"bg-emerald-50 text-emerald-600":"bg-rose-50 text-rose-600"])},l(D(o.enabled)?"å¯ç¨":"ç¦ç¨"),3)]),e("td",ut,l(o.channel||"-"),1),e("td",xt,[e("div",yt,[e("button",{class:"px-3 py-1.5 text-xs font-medium rounded-lg border border-blue-200 text-blue-600 hover:bg-blue-50 transition-colors",onClick:S=>ae(o)}," æ¥çå
¬å¸ ",8,gt),D(o.enabled)?(r(),i("button",{key:0,disabled:F(o),class:"px-3 py-1.5 text-xs font-medium rounded-lg border border-rose-200 text-rose-600 hover:bg-rose-50 transition-colors disabled:opacity-50",onClick:S=>ne(o)},l(F(o)?"å¤çä¸...":"ç¦ç¨ç¨æ·"),9,mt)):(r(),i("button",{key:1,disabled:F(o),class:"px-3 py-1.5 text-xs font-medium rounded-lg border border-emerald-200 text-emerald-600 hover:bg-emerald-50 transition-colors disabled:opacity-50",onClick:S=>le(o)},l(F(o)?"å¤çä¸...":"å¯ç¨ç¨æ·"),9,bt))])])],2))),128))])])]),C(me,{"current-page":p.value,"page-size":f.value,total:b.value,onPageChange:X},null,8,["current-page","page-size","total"])]))]),C(Ie,{ref_key:"userCompanyDialogRef",ref:$},null,512),C(a(J),{modelValue:y.value.show,"onUpdate:modelValue":t[6]||(t[6]=o=>y.value.show=o),title:y.value.title,size:"small"},{footer:k(()=>[e("div",ht,[C(a(O),{variant:"secondary",onClick:t[5]||(t[5]=o=>y.value.show=!1),class:"flex-1"},{default:k(()=>[...t[20]||(t[20]=[P("åæ¶",-1)])]),_:1}),C(a(O),{variant:"primary",onClick:x,class:"flex-1"},{default:k(()=>[...t[21]||(t[21]=[P("ç¡®å®",-1)])]),_:1})])]),default:k(()=>[e("div",ft,l(y.value.content),1)]),_:1},8,["modelValue","title"])]))}});export{Nt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.