1import{r as e,j as t}from"./vendor-react-DejgYtBM.js";import{W as s,f as a,l as i,E as r,J as n,K as o,c as l,B as d,a1 as c,M as u,y as h,i as p,m,j as y,T as x,a as g,F as f,k as _,x as j,s as v,t as w,u as b,z as S}from"./vendor-semi-D8d7bTtM.js";import{A as k,s as C,w as z,Y as I,N as $,$ as T,K as B}from"./index-BeIIFw6E.js";import{w as N,R as L,X as R}from"./vendor-icons-EJvJ5X-w.js";import"./vendor-motion-Chfy_MiU.js";const{Text:W,Title:D}=a,P=({visible:a,onClose:u,customer:h})=>{const[p,m]=e.useState([]),[y,x]=e.useState(!1),[g,f]=e.useState(!1),[_,j]=e.useState(""),[v,w]=e.useState(1),[b,S]=e.useState(0),I=e.useCallback(async(e=1)=>{if(h?.user_id){x(!0);try{const t=await k.get(`/api/follow-notes/${h.user_id}?page=${e}&page_size=50`);if(t.data.success){const s=t.data.data.list||[];m(t=>1===e?s:[...t,...s]),S(t.data.data.total||0),w(e)}}catch(t){C("è·åè·è¿è®°å½å¤±è´¥")}finally{x(!1)}}},[h?.user_id]);e.useEffect(()=>{a&&h?.user_id&&I(1)},[a,h?.user_id,I]);const $=h?.display_name||h?.username||"";return t.jsx(s,{title:`è·è¿è®°å½ - ${$}`,visible:a,onCancel:()=>{m([]),j(""),w(1),S(0),u()},placement:"right",width:520,children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[t.jsxs("div",{style:{marginBottom:16,padding:"12px 16px",background:"hsl(var(--foreground) / 0.02)",borderRadius:8},children:[t.jsx(D,{heading:6,style:{marginBottom:4},children:$}),h?.email&&t.jsxs(W,{type:"tertiary",size:"small",style:{display:"block"},children:["é®ç®±ï¼",h.email]}),h?.phone&&t.jsxs(W,{type:"tertiary",size:"small",style:{display:"block"},children:["çµè¯ï¼",h.phone]})]}),t.jsxs("div",{style:{flex:1,overflow:"auto",marginBottom:16},children:[y?t.jsx("div",{style:{textAlign:"center",padding:40},children:t.jsx(i,{})}):0===p.length?t.jsx(r,{image:t.jsx(o,{style:{width:120,height:120}}),darkModeImage:t.jsx(n,{style:{width:120,height:120}}),description:"ææ è·è¿è®°å½",style:{padding:40}}):t.jsx(l,{children:p.map(e=>{return t.jsxs(l.Item,{time:(s=e.created_at,s?new Date(1e3*s).toLocaleString("zh-CN"):""),children:[t.jsx("div",{style:{marginBottom:4},children:t.jsx(W,{strong:!0,size:"small",children:e.author_name})}),t.jsx(W,{style:{whiteSpace:"pre-wrap"},children:e.content})]},e.id);var s})}),p.length<b&&t.jsx("div",{style:{textAlign:"center",marginTop:8},children:t.jsx(d,{size:"small",onClick:()=>I(v+1),children:"å è½½æ´å¤"})})]}),t.jsxs("div",{style:{borderTop:"1px solid hsl(var(--border))",paddingTop:12},children:[t.jsx(c,{value:_,onChange:j,placeholder:"è¾å
¥è·è¿å¤æ³¨...",autosize:{minRows:2,maxRows:5},maxCount:500,style:{marginBottom:8}}),t.jsx(d,{theme:"solid",type:"primary",block:!0,loading:g,disabled:!_.trim(),onClick:async()=>{if(_.trim()){f(!0);try{const e=await k.post("/api/follow-notes/",{customer_uid:h.user_id,content:_.trim()});e.data.success?(z("夿³¨æ·»å æå"),j(""),I(1)):C(e.data.message)}catch(e){C("æäº¤å¤±è´¥")}finally{f(!1)}}},children:"æäº¤å¤æ³¨"})]})]})})},{Text:E}=a,F=({visible:s,onClose:a,customer:i,onCreateNew:l,refreshKey:c})=>{const[m,y]=e.useState([]),[x,g]=e.useState(!1),[f,_]=e.useState(0),[j,v]=e.useState(1),[w,b]=e.useState(10),S=e.useCallback(async()=>{if(i?.user_id){g(!0);try{const e=new URLSearchParams;e.set("page",j),e.set("page_size",w);const t=await k.get(`/api/enterprise-follow/${i.user_id}/corporate-topup-history?${e.toString()}`);t.data.success?(y(t.data.data?.list||[]),_(t.data.data?.total||0)):C(t.data.message||"å è½½åå²å¤±è´¥")}catch(e){C("å è½½åå²å¤±è´¥")}finally{g(!1)}}},[i?.user_id,j,w]);e.useEffect(()=>{s&&i?.user_id&&(1===j?S():v(1))},[s,i?.user_id,c]),e.useEffect(()=>{s&&i?.user_id&&S()},[j,w]);const z=e=>{if(null==e)return"Â¥0.00";const t=Number(e);return`${t<0?"-":""}Â¥${Math.abs(t).toFixed(2)}`},T=[{title:"æ¶é´",dataIndex:"created_at",key:"created_at",width:170,render:e=>e?I(e):"-"},{title:"ç±»å",dataIndex:"change_amount",key:"type",width:80,render:e=>{const s=Number(e)||0;return s<0?t.jsx(p,{color:"red",children:"æ£é¤"}):s>0?t.jsx(p,{color:"green",children:"å
å¼"}):t.jsx(p,{color:"grey",children:"è°æ´"})}}
1,{title:"é¢åº¦åå¨",dataIndex:"change_amount",key:"change_amount",width:140,render:e=>{const s=Number(e)||0;if(0===s)return t.jsx(E,{children:"-"});const a=s<0,i=$(Math.abs(s),2);return t.jsxs(p,{color:a?"red":"green",children:[a?"- ":"+ ",i]})}},{title:"å®ä»éé¢",dataIndex:"actual_amount",key:"actual_amount",width:130,render:e=>{const s=Number(e)||0;return t.jsx(E,{type:s<0?"danger":"success",children:z(e)})}},{title:"åå¨åä½é¢",dataIndex:"after_balance",key:"after_balance",width:130,render:e=>$(e||0,2)},{title:"说æ",dataIndex:"description",key:"description",ellipsis:{showTitle:!0},render:e=>e||"-"}],B=i?.ep_cert_name||i?.display_name||i?.username||"";return t.jsx(u,{title:`对å
Œ
å¼åå² - ${B}`,visible:s,onCancel:a,footer:t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t.jsxs(E,{type:"tertiary",style:{fontSize:12},children:["å
± ",f," æ¡è®°å½"]}),t.jsxs("div",{style:{display:"flex",gap:8},children:[t.jsx(d,{onClick:a,children:"å
³é"}),t.jsx(d,{theme:"solid",type:"primary",onClick:l,children:"æ°å¢å
å¼"})]})]}),width:960,bodyStyle:{padding:"12px 24px"},children:t.jsx(h,{columns:T,dataSource:m,rowKey:"id",loading:x,size:"small",pagination:{currentPage:j,pageSize:w,total:f,onPageChange:e=>v(e),onPageSizeChange:e=>{b(e),v(1)},showSizeChanger:!0,pageSizeOpts:[10,20,50]},empty:t.jsx(r,{image:t.jsx(o,{style:{width:120,height:120}}),darkModeImage:t.jsx(n,{style:{width:120,height:120}}),description:"ææ å¯¹å
Œ
å¼è®°å½"})})})},{Title:O,Text:U}=a,K=()=>{const[s,a]=e.useState([]),[i,l]=e.useState(!1),[c,I]=e.useState(0),[W,D]=e.useState(1),[E,U]=e.useState(20),[K,M]=e.useState(""),[q,A]=e.useState(""),[Y,H]=e.useState(""),[J,X]=e.useState("main"),[G,Q]=e.useState([]),[V,Z]=e.useState(""),[ee,te]=e.useState(""),[se,ae]=e.useState(!1),[ie,re]=e.useState(null),[ne,oe]=e.useState(!1),[le,de]=e.useState(null),[ce,ue]=e.useState(""),[he,pe]=e.useState(!1),[me,ye]=e.useState(null),[xe,ge]=e.useState(""),[fe,_e]=e.useState(""),[je,ve]=e.useState(""),[we,be]=e.useState("credit"),[Se,ke]=e.useState(!1),[Ce,ze]=e.useState(!1),[Ie,$e]=e.useState(null),[Te,Be]=e.useState(0),[Ne,Le]=e.useState(null),[Re,We]=e.useState(!1),[De,Pe]=e.useState(!1),[Ee,Fe]=e.useState(""),[Oe,Ue]=e.useState(""),[Ke,Me]=e.useState(""),[qe,Ae]=e.useState(!1),[Ye,He]=e.useState(!1),Je=T(),Xe=e.useCallback(async()=>{if(Je)try{const e=await k.get("/api/business-users/");e.data.success&&Q(e.data.data||[])}catch(e){}},[Je]),Ge=e.useCallback(async()=>{l(!0);try{const e=new URLSearchParams;e.set("page",W),e.set("page_size",E),e.set("site_type",J),K&&e.set("keyword",K),q&&e.set("business_uid",q),Y&&e.set("month",Y),V&&(e.set("sort_by",V),e.set("order",ee||"desc"));const t=await k.get(`/api/enterprise-follow/?${e.toString()}`);t.data.success?(a(t.data.data.list||[]),I(t.data.data.total||0)):C(t.data.message)}catch(e){C("å è½½æ°æ®å¤±è´¥")}finally{l(!1)}},[W,E,K,q,Y,J,V,ee]),Qe=e.useCallback(async()=>{We(!0);try{const e=new URLSearchParams;e.set("site_type",J),K&&e.set("keyword",K),q&&e.set("business_uid",q),Y&&e.set("month",Y);const t=await k.get(`/api/enterprise-follow/summary?${e.toString()}`);t.data.success?Le(t.data.data||null):console.warn("[EnterpriseFollow] load summary failed:",t.data.message)}catch(e){console.warn("[EnterpriseFollow] load summary error:",e)}finally{We(!1)}},[K,q,Y,J]);e.useEffect(()=>{Xe()},[Xe]),e.useEffect(()=>{Ge()},[Ge]),e.useEffect(()=>{Qe()},[Qe]);const Ve=()=>{1!==W?D(1):Ge()},Ze=()=>{const e=new URLSearchParams;return e.set("site_type",J),K&&e.set("keyword",K),q&&e.set("business_uid",q),Y&&e.set("month",Y),e},et=()=>{if(Y)return Y;const e=new Date;return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}`},tt=e=>{de(e),ue(e.business_uid>0?String(e.business_uid):""),oe(!0)},st=e=>null==e?"Â¥0.00":`Â¥${Number(e).toFixed(2)}`,at=(e,s,a)=>t.jsxs("div",{style:{lineHeight:"20px"},children:[t.jsx("div",{style:{fontWeight:500},children:st(e)}),t.jsxs("div",{style:{fontSize:12,color:"hsl(var(--muted-foreground))"},children:["ç´æ¥ ",st(s)]}),t.jsxs("div",{style:{fontSize:12,color:"hsl(var(--muted-foreground))"},children:["对å
¬ ",st(a)]})]}),it=[{title:"ä¼ä¸åç§°",dataIndex:"ep_cert_name",key:"ep_cert_name",width:200,render:(e,s)=>s.is_manual&&!e?t.jsx(p,{color:"orange",children:"æå¨æ·»å "}):e||"-"},{title:"ä¼ä¸ID",dataIndex:"user_id",key:"user_id",width:80},{title:"ä¼ä¸ç¨æ·",key:"user_info",width:130,render:(e,t)=>t.display_name||t.username},{title:"èç³»æ¹å¼",dataIndex:"email",key:"email",width:200,ellipsis:!0,render:e=>e||"-"},{title:"æ»å
å¼",dataIndex:"total_topup",key:"total_topup",width:150,sorter:!0,render:(e,t)=>at(t.total_topup,t.total_direct_topup,t.total_corporate_topup)},{title:"æ¬æå
å¼",dataIndex:"current_monthly",key:"current_monthly",width:150,sorter:!0,render:(e,t)=>at(t.current_monthly,t.direct_topup,t.corporate_topup)},{title:"䏿å
å¼",dataIndex:"previous_monthly",key:"previous_monthly",width:150,sorter:!0,render:(e,t)=>at(t.previous_monthly,t.prev_direct_topup,t.prev_corporate_topup)},{title:"æ¬æAPIé¢åº¦",dataIndex:"api_call_count",key:"api_call_count",width:130,render:e=>$(e||0,2),sorter:!0},{title:"æ»è°ç¨é¢åº¦",dataIndex:"total_api_quota",key:"total_api_quota",width:130,render:e=>$(e||0,2),sorter:!0},{title:"å©ä½ä½é¢",dataIndex:"quota",key:"quota",width:130,render:e=>$(e||0,2),sorter:!0},{title:"å·²ç¨ä½é¢",dataIndex:"used_quota",key:"used_quota",width:130,render:e=>$(e||0,2),sorter:!0},{title:"æè¿è·è¿",dataIndex:"last_follow_time",key:"last_follow_time",width:170,render:e=>{return e>
10?(s=e)?new Date(1e3*s).toLocaleString("zh-CN"):"-":t.jsx(p,{color:"grey",children:"ææ "});var s},sorter:!0}],rt={title:"æ¥æºä»£çç«",dataIndex:"agent_name",key:"agent_name",width:150,render:e=>e||t.jsx(p,{color:"grey",children:"æªç¥"})},nt={title:"è´è´£åå¡",key:"business_name",width:120,render:(e,s)=>s.business_uid>0&&s.business_name?t.jsx(p,{color:"blue",style:{cursor:"pointer"},onClick:()=>tt(s),children:s.business_name}):t.jsx(p,{color:"grey",style:{cursor:"pointer"},onClick:()=>tt(s),children:"æªåé
"})},ot={title:"æä½",key:"action",width:Je?260:100,fixed:"right",render:(e,s)=>t.jsxs(y,{children:[t.jsx(d,{size:"small",theme:"light",type:"primary",onClick:()=>(e=>{re(e),ae(!0)})(s),children:"è·è¿è®°å½"}),Je&&t.jsx(d,{size:"small",theme:"light",type:"warning",onClick:()=>(e=>{$e(e),ze(!0)})(s),children:"对å
Œ
å¼/è®°å½"}),Je&&t.jsx(d,{size:"small",theme:"light",type:"tertiary",onClick:()=>(async e=>{try{const t=await k.post(`/api/enterprise-follow/${e.user_id}/refresh-stats`);t.data.success?(z("ç»è®¡å·²å·æ°"),Ge(),Qe()):C(t.data.message||"å·æ°å¤±è´¥")}catch(t){C("å·æ°å¤±è´¥")}})(s),children:"å·æ°ç»è®¡"})]})};return t.jsxs("div",{className:"px-2",children:[t.jsxs(m,{children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},children:[t.jsx(O,{heading:5,style:{margin:0},children:"ä¼ä¸è·è¿æ
åµ"}),t.jsxs(y,{children:[t.jsx(d,{theme:"light",type:"primary",onClick:()=>Pe(!0),children:"æå¨æ·»å "}),t.jsx(d,{icon:t.jsx(N,{size:16}),loading:Ye,onClick:async()=>{const e=et();let t=`å°å¯¼åº ${e} æçè·è¿è®°å½ä¸å¯¹å
¬è½¬è´¦æç»ï¼æ¯å¦ç»§ç»ï¼`;
1try{const s=await k.get(`/api/enterprise-follow/export/preview?${Ze().toString()}`);if(s.data.success){const a=s.data.data||{};t=`å°å¯¼åº ${e} ææç»ï¼ä¼ä¸ ${a.enterprise_count??0} å®¶ï¼è·è¿ ${a.follow_note_count??0} æ¡ï¼å¯¹å
¬ ${a.corporate_topup_count??0} æ¡ï¼æ¯å¦ç»§ç»ï¼`}else if(s.data.message)return void C(s.data.message)}catch(s){console.warn("[EnterpriseFollow] export preview failed:",s)}u.confirm({title:"确认导åº",content:t,okText:"确认导åº",cancelText:"åæ¶",onOk:()=>(async()=>{He(!0);try{const e=Ze().toString(),t="/api/enterprise-follow/export/xlsx"+(e?`?${e}`:""),a=await k.get(t,{responseType:"blob",disableDuplicate:!0});if((a.headers["content-type"]||"").toLowerCase().includes("application/json")){const e=await a.data.text();let t="导åºå¤±è´¥";try{const s=JSON.parse(e);s.message&&(t=s.message)}catch(s){}return void C(t)}const i=new Blob([a.data],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),r=window.URL.createObjectURL(i),n=document.createElement("a");n.href=r;const o=a.headers["content-disposition"];let l=`enterprise_follow_${et()}.xlsx`;if(o){const e=o.match(/filename\*=UTF-8''([^;\s]+)/i);if(e)l=decodeURIComponent(e[1]);else{const e=o.match(/filename="?([^";\s]+)"?/i);e&&(l=decodeURIComponent(e[1]))}}n.download=l,document.body.appendChild(n),n.click(),document.body.removeChild(n),window.URL.revokeObjectURL(r),z("å¯¼åºæå")}catch(s){C(s?.response?.data?.message||s?.message||"导åºå¤±è´¥")}finally{He(!1)}})()})},children:"导åº"}),t.jsx(d,{icon:t.jsx(L,{size:16}),onClick:()=>Ge(),children:"å·æ°"})]})]}),t.jsxs(x,{type:"line",activeKey:J,onChange:e=>{X(e),D(1),M(""),A(""),H(""),Z(""),te("")},style:{marginBottom:16},children:[t.jsx(g,{tab:"主ç«ä¼ä¸",itemKey:"main"}),t.jsx(g,{tab:"代çç«ä¼ä¸",itemKey:"agent"})]}),t.jsxs("div",{style:{display:"flex",gap:12,flexWrap:"wrap",marginBottom:16},children:[t.jsx(f,{prefix:t.jsx(R,{size:16}),placeholder:"æç´¢ä¼ä¸åç§°/è´¦å·/é®ç®±/ç¨æ·ID",value:K,onChange:M,onEnterPress:Ve,style:{width:240}}),Je&&t.jsx(_,{placeholder:"è´è´£åå¡",value:q,onChange:A,style:{width:160},optionList:[{label:"å
¨é¨",value:""},...G.map(e=>({label:e.display_name||e.username,value:String(e.id)}))],showClear:!0}),t.jsx(j,{type:"month",placeholder:"ç»è®¡æä»½",onChange:(e,t)=>
1(e=>{if(e){const t=new Date(e),s=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}`;H(s)}else H("");D(1)})(t),style:{width:160}}),t.jsx(d,{theme:"solid",type:"primary",onClick:Ve,children:"æ¥è¯¢"})]}),(()=>{const e=[{key:"cur_corp",label:`æ¬æå¯¹å
Œ
å¼ï¼${Ne?.current_month||"æ¬æ"}ï¼`,value:Ne?.current_corporate_topup,color:"rgba(59, 130, 246, 0.08)",accent:"rgb(37, 99, 235)"},{key:"cur_direct",label:`æ¬æç´æ¥å
å¼ï¼${Ne?.current_month||"æ¬æ"}ï¼`,value:Ne?.current_direct_topup,color:"rgba(16, 185, 129, 0.08)",accent:"rgb(5, 150, 105)"},{key:"prev_corp",label:`䏿坹å
Œ
å¼ï¼${Ne?.previous_month||"䏿"}ï¼`,value:Ne?.previous_corporate_topup,color:"rgba(99, 102, 241, 0.08)",accent:"rgb(79, 70, 229)"},{key:"prev_direct",label:`ä¸æç´æ¥å
å¼ï¼${Ne?.previous_month||"䏿"}ï¼`,value:Ne?.previous_direct_topup,color:"rgba(20, 184, 166, 0.08)",accent:"rgb(13, 148, 136)"}],s=Ne&&"number"==typeof Ne.enterprise_count?`å·²ç»è®¡ ${Ne.enterprise_count} å®¶æè·è¿äººåçä¼ä¸`:"ä»
ç»è®¡æè·è¿äººåçä¼ä¸";return t.jsxs("div",{style:{marginBottom:16},children:[t.jsx("div",{style:{display:"flex",gap:12,flexWrap:"wrap"},children:e.map(e=>t.jsxs("div",{style:{flex:"1 1 220px",minWidth:220,padding:"14px 16px",background:e.color,borderRadius:8,border:"1px solid hsl(var(--border))",opacity:Re?.6:1,transition:"opacity 0.2s"},children:[t.jsx("div",{style:{fontSize:12,color:"hsl(var(--muted-foreground))",marginBottom:6},children:e.label}),t.jsx("div",{style:{fontSize:22,fontWeight:600,color:e.accent},children:st(e.value)})]},e.key))}),t.jsxs("div",{style:{marginTop:8,fontSize:12,color:"hsl(var(--muted-foreground))",display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[t.jsxs("span",{children:[s,"ï¼éç鿡件ååï¼ï¼å表æ¾ç¤ºå
¨é¨ä¼ä¸ï¼æ¬å¡çä»
ç»è®¡æè·è¿äººåçé¨åã"]}),t.jsx(S,{content:t.jsxs("div",{style:{maxWidth:280,lineHeight:1.5},children:['管çåæªçéå塿¶ï¼ä¸æ¹å表ä¼å
å«å°æªåé
åå¡çä¼ä¸ï¼"æªåé
"è¡ï¼ï¼','èæ±æ»å¡çæ¯ä¸å¡å£å¾ï¼ä»
ç´¯å å·²åé
åå¡ï¼å³"æè·è¿äººå"ï¼çä¼ä¸ï¼',"å æ¤å¡çéé¢é常ä¼å°äºå表ææè¡çç´¯å ç»æãè¿æ¯è®¾è®¡è¡ä¸ºï¼å¹¶éæ°æ®æ¼ç®ã"]}),position:"top",children:t.jsx("span",{style:{color:"var(--semi-color-primary)",cursor:"help",textDecoration:"underline dotted"},children:"å·®å¼åå ?"})})]})]})})(),t.jsx(h,{columns:(()=>{const e=[...it];return"agent"===J&&e.push(rt),Je&&e.push(nt),e.push(ot),e})(),dataSource:s,rowKey:"user_id",loading:i,onChange:(e={})=>{const t=e?.currentPage??e?.pagination?.currentPage;var s;"number"==typeof t&&t!==W||"pagination"!==e?.extra?.changeType&&e?.sorter&&((s=e.sorter)&&s.sortOrder?(Z(s.dataIndex||s.key||""),te("ascend"===s.sortOrder?"asc":"desc")):(Z(""),te("")),D(1))},pagination:{currentPage:W,pageSize:E,total:c,onPageChange:e=>D(e),onPageSizeChange:e=>{U(e),D(1)},showSizeChanger:!0,pageSizeOpts:[10,20,50]},scroll:{x:"agent"===J?2190:1990},empty:t.jsx(r,{image:t.jsx(o,{style:{width:150,height:150}}),darkModeImage:t.jsx(n,{style:{width:150,height:150}}),description:"ææ æ°æ®"})})]}),t.jsx(P,{visible:se,onClose:()=>ae(!1),customer:ie}),Je&&t.jsx(F,{visible:Ce,refreshKey:Te,onClose:()=>ze(!1),customer:Ie,onCreateNew:()=>(ye(Ie),ge(""),_e(""),ve(""),be("credit"),ze(!1),void pe(!0))}),Je&&t.jsx(u,{title:`åé
åå¡ - ${le?.ep_cert_name||le?.display_name||le?.username||""}`,visible:ne,onOk:async()=>{if(le)try{if(ce){const e=await k.post("/api/assignments/",{business_uid:parseInt(ce),customer_uid:le.user_id});if(!e?.data?.success)return void C(e?.data?.message||"åé
失败");z("åé
æå")}else if(le.business_uid>0){const e=await k.delete(`/api/assignments/by-customer/${le.user_id}`);if(!e?.data?.success)return void C(e?.data?.message||"åæ¶åé
失败");z("已忶åé
")}oe(!1),Ge()}catch(e){C("æä½å¤±è´¥")}},onCancel:()=>oe(!1),okText:"确认",cancelText:"åæ¶",children:t.jsx(_,{placeholder:"éæ©åå¡åå·¥ï¼ç空ååæ¶åé
ï¼",value:ce,onChange:ue,style:{width:"100%"},optionList:[{label:"åæ¶åé
",value:""},...G.map(e=>({label:e.display_name||e.username,value:String(e.id)}))],showClear:!0})}),Je&&t.jsx(u,{title:`${"debit"===we?"对å
¬æ£é¤":"对å
Œ
å¼"} - ${me?.ep_cert_name||me?.display_name||""}`,visible:he,onOk:async()=>
1{if(!me)return;const e="debit"===we,t=parseFloat(xe),s=parseFloat(fe);if(Number.isNaN(t)||t<0)return void C(e?"请è¾å
¥ææçæ£åé¢åº¦":"请è¾å
¥ææçå
å¼é¢åº¦");if(Number.isNaN(s)||s<0)return void C(e?"请è¾å
¥ææçå®ä»å²åéé¢":"请è¾å
¥ææçå®é
æ¯ä»éé¢");if(0===t&&0===s)return void C("é¢åº¦åå¨ä¸å®é
æ¯ä»éé¢ä¸è½åæ¶ä¸º0");const a=Math.round(B(t));if(t>0&&(!a||a<=0))C("é¢åº¦è½¬æ¢å¤±è´¥ï¼è¯·æ£æ¥è¾å
¥");else{ke(!0);try{const t=await k.post(`/api/enterprise-follow/${me.user_id}/corporate-topup`,{quota_delta:a,actual_amount:s,remark:je,adjustment_type:we});t.data.success?(z(e?"对å
¬æ£é¤æå":"对å
Œ
弿å"),pe(!1),$e(me),ze(!0),Be(e=>e+1),Ge(),Qe()):C(t.data.message||(e?"对å
¬æ£é¤å¤±è´¥":"对å
Œ
å¼å¤±è´¥"))}catch(i){C("æä½å¤±è´¥")}finally{ke(!1)}}},onCancel:()=>pe(!1),okText:"debit"===we?"确认æ£é¤":"确认å
å¼",cancelText:"åæ¶",confirmLoading:Se,children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[t.jsxs("div",{children:[t.jsx("div",{style:{marginBottom:4,fontWeight:500},children:"æä½ç±»å"}),t.jsxs(v,{type:"button",buttonSize:"middle",value:we,onChange:e=>be(e.target.value),children:[t.jsx(w,{value:"credit",children:"å
å¼"}),t.jsx(w,{value:"debit",children:"æ£é¤"})]})]}),t.jsxs("div",{children:[t.jsx("div",{style:{marginBottom:4,fontWeight:500},children:"debit"===we?"æ£åé¢åº¦":"å
å¼é¢åº¦"}),t.jsx(b,{placeholder:"debit"===we?"è¾å
¥è¦æ£é¤çé¢åº¦ï¼æ¾ç¤ºåä½ï¼":"è¾å
¥å
å¼é¢åº¦ï¼æ¾ç¤ºåä½ï¼",value:xe,onChange:ge,min:0,style:{width:"100%"}}),t.jsx("div",{style:{fontSize:12,color:"hsl(var(--muted-foreground))",marginTop:4},children:"debit"===we?"ä»ç¨æ·è´¦æ·æ£é¤çé¢åº¦ï¼ä¸å¯è¶
è¿å½åä½é¢":"å
å¼å°ç¨æ·è´¦æ·çé¢åº¦ï¼ä¸ç³»ç»é¢åº¦åä½ä¸è´"})]}),t.jsxs("div",{children:[t.jsx("div",{style:{marginBottom:4,fontWeight:500},children:"debit"===we?"å®ä»å²åï¼Â¥ï¼":"å®é
æ¯ä»éé¢ï¼Â¥ï¼"}),t.jsx(b,{placeholder:"debit"===we?"对å
¬è®°è´¦å²åéé¢ï¼å¯å¡« 0":"è¾å
¥ä¼ä¸å®é
æ¯ä»çéé¢",value:fe,onChange:_e,min:0,precision:2,style:{width:"100%"},prefix:"Â¥"}),t.jsx("div",{style:{fontSize:12,color:"hsl(var(--muted-foreground))",marginTop:4},children:"debit"===we?"ç¨äºæ ¡æ£å¯¹å
¬éé¢çç»è®¡è®°å½ï¼å¯ä¸é¢åº¦åç¬è°æ´ï¼å¯å¡« 0ï¼":"ä¼ä¸å®é
æ¯ä»ç人æ°å¸éé¢ï¼ä¸åä¼ä¸ææ£ä¸åï¼"})]}),t.jsxs("div",{children:[t.jsx("div",{style:{marginBottom:4,fontWeight:500},children:"夿³¨ï¼éå¡«ï¼"}),t.jsx(f,{placeholder:"å¦ï¼ååç¼å·ãææ£è¯´æç",value:je,onChange:ve,style:{width:"100%"}})]})]})}),t.jsx(u,{title:"æå¨æ·»å ç¨æ·å°è·è¿å表",visible:De,onOk:async()=>{const e=parseInt(Ee);if(!e||e<=0)C("请è¾å
¥ææçç¨æ·ID");else{Ae(!0);try{const t=await k.post("/api/enterprise-follow/manual-add",{user_id:e,ep_name:Oe,remark:Ke});t.data.success?(z("æ·»å æå"),Pe(!1),Fe(""),Ue(""),Me(""),Ge()):C(t.data.message||"æ·»å 失败")}catch(t){C("æä½å¤±è´¥")}finally{Ae(!1)}}},onCancel:()=>{Pe(!1),Fe(""),Ue(""),Me("")},okText:"确认添å ",cancelText:"åæ¶",confirmLoading:qe,children:t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[t.jsxs("div",{children:[t.jsx("div",{style:{marginBottom:4,fontWeight:500},children:"ç¨æ·ID"}),t.jsx(b,{placeholder:"è¾å
¥è¦æ·»å çç¨æ·ID",value:Ee,onChange:Fe,min:1,style:{width:"100%"}}),t.jsx("div",{style:{fontSize:12,color:"hsl(var(--muted-foreground))",marginTop:4},children:"æ·»å æªè®¤è¯ä¼ä¸ææµ·å¤ç¨æ·æ¶æ éä¼ä¸è®¤è¯"})]}),t.jsxs("div",{children:[t.jsx("div",{style:{marginBottom:4,fontWeight:500},children:"ä¼ä¸åç§°"}),t.jsx(f,{placeholder:"è¾å
¥ä¼ä¸åç§°ï¼è®¤è¯åèªå¨æ¿æ¢ä¸ºè®¤è¯åç§°ï¼",value:Oe,onChange:Ue,style:{width:"100%"}})]}),t.jsxs("div",{children:[t.jsx("div",{style:{marginBottom:4,fontWeight:500},children:"夿³¨ï¼éå¡«ï¼"}),t.jsx(f,{placeholder:"å¦ï¼æµ·å¤ç¨æ·ãæ½å¨å®¢æ·ç",value:Ke,onChange:Me,style:{width:"100%"}})]})]})})]})};export{K 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.