Files
weiyu/deploy/server/admin/p__Welcome.d23d1304.async.js
jack ning 9af4c18d20 update
2025-12-13 12:02:49 +08:00

1 line
35 KiB
JavaScript
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.
"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[8185],{7992:function(e,t,n){n.d(t,{EN:function(){return d},G_:function(){return p},Vh:function(){return g},WN:function(){return y},ry:function(){return x}});var r=n(90819),i=n.n(r),a=n(73193),s=n.n(a),o=n(89933),u=n.n(o),c=n(6844),l=n(19736);function d(e){return h.apply(this,arguments)}function h(){return(h=u()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/ai/statistic/token/query/org",{method:"GET",params:s()(s()({},t),{},{channel:c.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e){return f.apply(this,arguments)}function f(){return(f=u()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/ai/statistic/token/delete",{method:"POST",data:s()(s()({},t),{},{channel:c.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function x(e,t){return v.apply(this,arguments)}function v(){return(v=u()(i()().mark((function e(t,n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/ai/statistic/token/hourly",{method:"GET",params:{orgUid:t,date:n,channel:c.XtJ}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(e,t,n){return m.apply(this,arguments)}function m(){return(m=u()(i()().mark((function e(t,n,r){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/ai/statistic/token/hourly/provider",{method:"GET",params:{orgUid:t,date:n,aiProvider:r,channel:c.XtJ}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(e,t,n){return j.apply(this,arguments)}function j(){return(j=u()(i()().mark((function e(t,n,r){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/ai/statistic/token/hourly/model",{method:"GET",params:{orgUid:t,date:n,aiModelType:r,channel:c.XtJ}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},68462:function(e,t,n){n.d(t,{K_:function(){return g},Np:function(){return p},dx:function(){return x},xH:function(){return y},xs:function(){return d}});var r=n(90819),i=n.n(r),a=n(73193),s=n.n(a),o=n(89933),u=n.n(o),c=n(6844),l=n(19736);function d(e){return h.apply(this,arguments)}function h(){return(h=u()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/freeswitch/cdr/query/org",{method:"GET",params:s()(s()({},t),{},{channel:c.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e){return f.apply(this,arguments)}function f(){return(f=u()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/freeswitch/cdr/create",{method:"POST",data:s()(s()({},t),{},{channel:c.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function x(e){return v.apply(this,arguments)}function v(){return(v=u()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/freeswitch/cdr/update",{method:"POST",data:s()(s()({},t),{},{channel:c.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(e){return m.apply(this,arguments)}function m(){return(m=u()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/freeswitch/cdr/delete",{method:"POST",data:s()(s()({},t),{},{channel:c.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(e){return j.apply(this,arguments)}function j(){return(j=u()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/freeswitch/cdr/delete/org",{method:"POST",data:s()(s()({},t),{},{channel:c.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},57985:function(e,t,n){n.d(t,{Az:function(){return d},Bv:function(){return T},DO:function(){return g},L0:function(){return S},RF:function(){return k},Xc:function(){return x},YO:function(){return b},jX:function(){return y},tu:function(){return p}});var r=n(90819),i=n.n(r),a=n(73193),s=n.n(a),o=n(89933),u=n.n(o),c=n(6844),l=n(19736);function d(e){return h.apply(this,arguments)}function h(){return(h=u()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/article/query/org",{method:"GET",params:s()(s()({},t),{},{channel:c.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e){return f.apply(this,arguments)}function f(){return(f=u()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/article/create",{method:"POST",data:s()(s()({},t),{},{channel:c.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function x(e){return v.apply(this,arguments)}function v(){return(v=u()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/article/update",{method:"POST",data:s()(s()({},t),{},{channel:c.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function y(e){return m.apply(this,arguments)}function m(){return(m=u()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/article/delete",{method:"POST",data:s()(s()({},t),{},{channel:c.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(e){return j.apply(this,arguments)}function j(){return(j=u()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/article/deleteAll",{method:"POST",data:s()(s()({},t),{},{channel:c.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(e){return Z.apply(this,arguments)}function Z(){return(Z=u()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/article/updateIndex",{method:"POST",data:s()(s()({},t),{},{channel:c.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function b(e){return w.apply(this,arguments)}function w(){return(w=u()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/article/updateVectorIndex",{method:"POST",data:s()(s()({},t),{},{channel:c.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function S(e){return C.apply(this,arguments)}function C(){return(C=u()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/article/updateAllIndex",{method:"POST",data:s()(s()({},t),{},{channel:c.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function T(e){return M.apply(this,arguments)}function M(){return(M=u()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/article/updateAllVectorIndex",{method:"POST",data:s()(s()({},t),{},{channel:c.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},68478:function(e,t,n){n.d(t,{Wq:function(){return d}});var r=n(90819),i=n.n(r),a=n(73193),s=n.n(a),o=n(89933),u=n.n(o),c=n(6844),l=n(19736);function d(e){return h.apply(this,arguments)}function h(){return(h=u()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/queue/query/org",{method:"GET",params:s()(s()({},t),{},{channel:c.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},23111:function(e,t,n){n.d(t,{Eb:function(){return d},RU:function(){return p}});var r=n(90819),i=n.n(r),a=n(73193),s=n.n(a),o=n(89933),u=n.n(o),c=n(6844),l=n(19736);function d(){return h.apply(this,arguments)}function h(){return(h=u()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/service/statistic/query",{method:"GET",params:{channel:c.XtJ}}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e){return f.apply(this,arguments)}function f(){return(f=u()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/service/statistic/query/date",{method:"GET",params:s()(s()({},t),{},{channel:c.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},10375:function(e,t,n){n.d(t,{AD:function(){return d}});var r=n(90819),i=n.n(r),a=n(73193),s=n.n(a),o=n(89933),u=n.n(o),c=n(6844),l=n(19736);function d(e){return h.apply(this,arguments)}function h(){return(h=u()(i()().mark((function e(t){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,l.request)("/api/v1/ticket/statistic/query/date",{method:"GET",params:s()(s()({},t),{},{channel:c.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},88449:function(e,t,n){var r=n(26710);t.Z=function(){var e=(0,r.Z)().isDarkMode;return{leftSiderStyle:{borderRight:e?"1px solid #333":"1px solid #ccc",background:e?"#141414":"#f5f5f5",height:"100vh",overflow:"auto"},leftSiderWidth:250,headerStyle:{background:e?"#141414":"#fff"},rightSiderStyle:{borderLeft:e?"1px solid #333":"1px solid #ccc",background:e?"#141414":"#f5f5f5"},contentStyle:{minHeight:120,background:e?"#141414":"#f5f5f5",height:"100vh",overflow:"auto",padding:10}}}},9556:function(e,t,n){n.r(t),n.d(t,{default:function(){return he}});var r=n(45332),i=n.n(r),a=n(14888),s=n(19736),o=n(44194),u=n(86947),c=n(46141),l=n(3925),d=n(31549),h=function(e){var t=e.open,n=e.onClose,r=(0,s.useIntl)(),i=(0,s.useNavigate)(),a=function(){localStorage.setItem("skipVerification","true"),n()};return(0,d.jsx)(c.Z,{title:r.formatMessage({id:"welcome.verify.modal.title",defaultMessage:"账号验证提示"}),open:t,onCancel:a,footer:[(0,d.jsx)(l.ZP,{onClick:a,children:r.formatMessage({id:"welcome.verify.later",defaultMessage:"稍后验证"})},"later"),(0,d.jsx)(l.ZP,{type:"primary",onClick:function(){n(),i("/setting/certification")},children:r.formatMessage({id:"welcome.verify.now",defaultMessage:"立即验证"})},"now")],children:(0,d.jsx)("p",{children:r.formatMessage({id:"welcome.verify.modal.description",defaultMessage:"您的邮箱和手机号尚未验证,为保障账号安全,建议您尽快完成验证。"})})})},p=n(12792),f=n(36125),x=n(73193),v=n.n(x),y=n(90819),m=n.n(y),g=n(89933),j=n.n(g),k=n(45516),Z=n(57075),b=n(5089),w=n(1691),S=n(66810),C=n(9428),T=n(51891),M=n(98986),I=n(96123),P=n(31543),q=n(37326),O=n(48907),D=n(60115),A=n(32967),R=n(77753),E=n(80556),J=n(58791),X=n(93878),F=n(70424),N=n(82741),z=n(74840),H=n(58087),L=n(79479),Y=n(17811),G=n(97876),U=n(71194),W=n(96596),K=n.n(W),V=n(93527),_=n(23111),B=n(10375),Q=n(7992),$=n(68462),ee=n(57985),te=n(6844);function ne(e){return re.apply(this,arguments)}function re(){return(re=j()(m()().mark((function e(t){return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,s.request)("/api/v1/notice/query/org",{method:"GET",params:v()(v()({},t),{},{channel:te.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var ie=n(68478),ae=Z.default.RangePicker,se=b.Z.Title,oe=b.Z.Text,ue=function(e){if(!e||e<=0)return"0s";if(e<60)return"".concat(Math.round(e),"s");var t=Math.floor(e/60),n=Math.round(e%60);return"".concat(t,"m ").concat(n,"s")},ce=function(e){return null==e||Number.isNaN(e)?0:Math.max(0,Math.min(100,Math.round(e)))},le=function(){var e,t,n,r,s,u,c=(0,k.s0)(),h=function(){try{return!1}catch(e){return!1}}(),p=(0,a.u)((function(e){return e.currentOrg})),f=(0,o.useState)([K()().startOf("day").subtract(6,"day"),K()().endOf("day")]),x=i()(f,2),y=x[0],g=x[1],Z=(0,o.useState)(),b=i()(Z,2),W=b[0],re=b[1],le=(0,o.useState)(),de=i()(le,2),he=de[0],pe=de[1],fe=(0,o.useState)(),xe=i()(fe,2),ve=xe[0],ye=xe[1],me=(0,o.useState)([]),ge=i()(me,2),je=ge[0],ke=ge[1],Ze=(0,o.useState)(0),be=i()(Ze,2),we=be[0],Se=be[1],Ce=(0,o.useState)([]),Te=i()(Ce,2),Me=Te[0],Ie=Te[1],Pe=(0,o.useState)(0),qe=i()(Pe,2),Oe=qe[0],De=qe[1],Ae=(0,o.useState)([]),Re=i()(Ae,2),Ee=Re[0],Je=Re[1],Xe=(0,o.useState)(0),Fe=i()(Xe,2),Ne=Fe[0],ze=Fe[1],He=(0,o.useState)([]),Le=i()(He,2),Ye=Le[0],Ge=Le[1],Ue=(0,o.useMemo)((function(){return{kpis:!0,ticketStatusPie:!0,aiTokenLine:!0,serviceStatusPie:!0,serviceDurationLine:!0,serviceHourlyLine:!0,recentCalls:h,articles:!0,notices:!0,agentPerformance:!0}}),[h]),We=(0,o.useState)(Ue),Ke=i()(We,2),Ve=Ke[0],_e=Ke[1],Be=(0,o.useState)(!1),Qe=i()(Be,2),$e=Qe[0],et=Qe[1],tt=(0,o.useState)(!1),nt=i()(tt,2),rt=nt[0],it=nt[1],at=(0,o.useMemo)((function(){var e;return null===(e=y[0])||void 0===e?void 0:e.format("YYYY-MM-DD")}),[y]),st=(0,o.useMemo)((function(){var e;return null===(e=y[1])||void 0===e?void 0:e.format("YYYY-MM-DD")}),[y]),ot=(0,o.useCallback)(j()(m()().mark((function e(){var t,n,r,a,s,o,u,c,l,d,f,x,v,y,g,j,k,Z,b,w,S,C,T;return m()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=p&&p.uid){e.next=2;break}return e.abrupt("return");case 2:return it(!0),e.prev=3,t=p.uid,n=h?(0,$.xs)({orgUid:t,pageNumber:0,pageSize:10,startStamp:"".concat(at," 00:00:00"),endStamp:"".concat(st," 23:59:59"),sortBy:"startStamp",sortDirection:"DESC"}):Promise.resolve(void 0),e.next=8,Promise.all([(0,_.RU)({orgUid:t,startDate:at,endDate:st,type:te.whQ}),(0,B.AD)({orgUid:t,startDate:at,endDate:st,type:te.whQ}),(0,Q.ry)(t,st||K()().format("YYYY-MM-DD")),n,(0,ee.Az)({orgUid:t,pageNumber:0,pageSize:5,sortBy:"createdAt",sortDirection:"DESC"}),ne({orgUid:t,pageNumber:0,pageSize:5,sortBy:"createdAt",sortDirection:"DESC"}),(0,ie.Wq)({orgUid:t,pageNumber:0,pageSize:100,day:st})]);case 8:if(r=e.sent,a=i()(r,7),s=a[0],o=a[1],u=a[2],c=a[3],l=a[4],d=a[5],f=a[6],200!==(null==s?void 0:s.code)||!s.data){e.next=21;break}re(s.data),e.next=25;break;case 21:return e.next=23,(0,_.Eb)();case 23:200===(null==(x=e.sent)?void 0:x.code)&&re(x.data);case 25:200===(null==o?void 0:o.code)&&pe(o.data),200===(null==u?void 0:u.code)&&ye(u.data),h&&c&&"number"==typeof c.code&&200===c.code?(ke((null===(v=(g=c).data)||void 0===v?void 0:v.content)||[]),Se((null===(y=g.data)||void 0===y?void 0:y.totalElements)||0)):h||(ke([]),Se(0)),200===(null==l?void 0:l.code)&&(Ie((null===(j=l.data)||void 0===j?void 0:j.content)||[]),De((null===(k=l.data)||void 0===k?void 0:k.totalElements)||0)),200===(null==d?void 0:d.code)&&(Je((null===(Z=d.data)||void 0===Z?void 0:Z.content)||[]),ze((null===(b=d.data)||void 0===b?void 0:b.totalElements)||0)),200===(null==f?void 0:f.code)&&(S=(null===(w=f.data)||void 0===w?void 0:w.content)||[],C=Array.from({length:24},(function(){return 0})),S.forEach((function(e){(e.threadsCountByHour||[]).forEach((function(e,t){t>=0&&t<24&&(C[t]+=e||0)}))})),Ge(C.map((function(e,t){return{hour:"".concat(t,":00"),count:e}})))),e.next=37;break;case 33:e.prev=33,e.t0=e.catch(3),T=e.t0 instanceof Error?e.t0.message:"加载仪表盘数据失败",V.yw.error(T);case 37:return e.prev=37,it(!1),e.finish(37);case 40:case"end":return e.stop()}}),e,null,[[3,33,37,40]])}))),[null==p?void 0:p.uid,at,st]);(0,o.useEffect)((function(){if(null!=p&&p.uid){var e="dashboard_visibility_".concat(p.uid);try{var t=localStorage.getItem(e);if(t){var n=JSON.parse(t);_e(v()(v()({},Ue),n))}else _e(Ue)}catch(e){_e(Ue)}}}),[null==p?void 0:p.uid]),(0,o.useEffect)((function(){if(null!=p&&p.uid){var e="dashboard_visibility_".concat(p.uid);try{localStorage.setItem(e,JSON.stringify(Ve))}catch(e){}}}),[Ve,null==p?void 0:p.uid]),(0,o.useEffect)((function(){ot()}),[ot]);var ut=(0,o.useMemo)((function(){var e=he,t=(null==e?void 0:e.totalTickets)||0;return[{type:"新建",value:(null==e?void 0:e.newTickets)||0},{type:"处理中",value:(null==e?void 0:e.processingTickets)||0},{type:"已解决",value:(null==e?void 0:e.resolvedTickets)||0},{type:"已关闭",value:(null==e?void 0:e.closedTickets)||0},{type:"挂起",value:(null==e?void 0:e.holdingTickets)||0},{type:"待处理",value:(null==e?void 0:e.pendingTickets)||0}].filter((function(e){return e.value>0||0===t}))}),[he]),ct=(0,o.useMemo)((function(){var e=(null==ve?void 0:ve.hourlyData)||[],t=new Map;return e.forEach((function(e){"number"==typeof e.hour&&t.set(e.hour,e)})),Array.from({length:24},(function(e,n){var r,i;return{hour:"".concat(n,":00"),tokens:(null===(r=t.get(n))||void 0===r?void 0:r.totalTokens)||0,requests:(null===(i=t.get(n))||void 0===i?void 0:i.totalRequests)||0}}))}),[ve]),lt=(0,o.useMemo)((function(){var e=W||{},t=[{type:"排队中",value:e.queuingThreadCount||0},{type:"正在服务",value:e.currentThreadCount||0},{type:"已接入",value:e.acceptedThreadCount||0},{type:"已放弃",value:e.abandonedThreadCount||0},{type:"已转接",value:e.transferredThreadCount||0},{type:"邀请接入",value:e.invitedThreadCount||0}],n=t.reduce((function(e,t){return e+(t.value||0)}),0);return t.filter((function(e){return e.value>0||0===n}))}),[W]),dt=(0,o.useMemo)((function(){var e=W||{};return[{bucket:"0-5分钟",value:e.durationWithin5Min||0},{bucket:"5-15分钟",value:e.durationWithin15Min||0},{bucket:"15分钟以上",value:e.durationOver15Min||0}]}),[W]),ht=[{title:"主叫",dataIndex:"callerIdNumber",key:"callerIdNumber",width:140},{title:"被叫",dataIndex:"destinationNumber",key:"destinationNumber",width:140},{title:"开始时间",dataIndex:"startStamp",key:"startStamp",render:function(e){return K()(e).format("MM-DD HH:mm")}},{title:"时长",dataIndex:"billsec",key:"billsec",render:function(e){return ue(e)}},{title:"挂断原因",dataIndex:"hangupCause",key:"hangupCause",ellipsis:!0}],pt=[{title:"标题",dataIndex:"title",key:"title",render:function(e){return(0,d.jsx)(w.Z,{title:e,children:(0,d.jsx)(oe,{ellipsis:!0,style:{maxWidth:220,display:"inline-block"},children:e})})}},{title:"阅读",dataIndex:"readCount",key:"readCount",width:100},{title:"发布时间",dataIndex:"createdAt",key:"createdAt",width:160,render:function(e){return K()(e).format("MM-DD HH:mm")}},{title:"状态",key:"published",width:100,render:function(e,t){return t.published?(0,d.jsx)(S.Z,{color:"green",children:"已发布"}):(0,d.jsx)(S.Z,{children:"草稿"})}}],ft=[{title:"标题",dataIndex:"title",key:"title",render:function(e){return(0,d.jsx)(w.Z,{title:e,children:(0,d.jsx)(oe,{ellipsis:!0,style:{maxWidth:320,display:"inline-block"},children:e||"-"})})}},{title:"类型",dataIndex:"type",key:"type",width:120,render:function(e){return e?(0,d.jsx)(S.Z,{color:"blue",children:e}):"-"}},{title:"状态",dataIndex:"status",key:"status",width:120,render:function(e){return e?(0,d.jsx)(S.Z,{color:"published"===e?"green":"draft"===e?"default":"gold",children:e}):"-"}},{title:"发布时间",dataIndex:"createdAt",key:"createdAt",width:160,render:function(e){return e?K()(e).format("MM-DD HH:mm"):"-"}}],xt=[{title:"客服",dataIndex:"name",key:"name"},{title:"在线时长",dataIndex:"onlineTime",key:"onlineTime",render:function(e){return void 0!==e?"".concat(e,"h"):"-"}},{title:"会话数",dataIndex:"sessionCount",key:"sessionCount"},{title:"平均响应",dataIndex:"avgResponseTime",key:"avgResponseTime",render:function(e){return void 0!==e?"".concat(e,"分钟"):"-"}},{title:"平均会话",dataIndex:"avgSessionTime",key:"avgSessionTime",render:function(e){return void 0!==e?"".concat(e,"分钟"):"-"}},{title:"满意度",dataIndex:"satisfaction",key:"satisfaction",render:function(e){return void 0!==e?"".concat(e,"%"):"-"}},{title:"工时",dataIndex:"workingHours",key:"workingHours",render:function(e){return void 0!==e?"".concat(e,"h"):"-"}},{title:"转接率",dataIndex:"transferRate",key:"transferRate",render:function(e){return void 0!==e?"".concat(e,"%"):"-"}},{title:"一次解决率",dataIndex:"firstResolutionRate",key:"firstResolutionRate",render:function(e){return void 0!==e?"".concat(e,"%"):"-"}},{title:"超时数",dataIndex:"overdueCount",key:"overdueCount"}],vt=(0,o.useMemo)((function(){if(!W)return[];var e=W,t=Number(e.acceptedThreadCount||0),n=Number(e.transferredThreadCount||0),r=Number(e.onlineTime||0),i=Number(e.avgFirstResponseTime||0),a=Number(e.avgConversationTime||0),s=r>0?Math.round(r/3600*10)/10:0,o=i>0?Math.round(i/60):0,u=a>0?Math.round(a/60):0,c=ce(e.satisfactionRate),l=t>0?ce(n/t*100):0,d=void 0!==e.firstResolutionRate?ce(e.firstResolutionRate):void 0,h=void 0!==e.overdueThreadCount?Number(e.overdueThreadCount):void 0;return[{key:"org-summary",name:(null==p?void 0:p.name)||"组织汇总",onlineTime:s,sessionCount:t,avgResponseTime:o,avgSessionTime:u,satisfaction:c,workingHours:s,transferRate:l,firstResolutionRate:d,overdueCount:h}]}),[W,null==p?void 0:p.name]);return(0,d.jsxs)(C.Z,{direction:"vertical",size:16,style:{width:"100%"},children:[(0,d.jsx)(T.Z,{variant:"borderless",styles:{body:{padding:16}},children:(0,d.jsxs)(M.Z,{justify:"space-between",align:"middle",gutter:[16,16],children:[(0,d.jsxs)(I.Z,{flex:"auto",children:[(0,d.jsx)(se,{level:4,style:{margin:0},children:"运营概览"}),(0,d.jsx)(oe,{type:"secondary",children:"在线客服、工单、呼叫中心、知识库、AI助手 一体化总览"})]}),(0,d.jsx)(I.Z,{children:(0,d.jsxs)(C.Z,{children:[(0,d.jsx)(ae,{allowClear:!1,value:y,onChange:function(e){return e&&g([e[0].startOf("day"),e[1].endOf("day")])},presets:[{label:"今日",value:[K()().startOf("day"),K()().endOf("day")]},{label:"昨日",value:[K()().subtract(1,"day").startOf("day"),K()().subtract(1,"day").endOf("day")]},{label:"近7天",value:[K()().startOf("day").subtract(6,"day"),K()().endOf("day")]},{label:"近30天",value:[K()().startOf("day").subtract(29,"day"),K()().endOf("day")]}]}),(0,d.jsx)(l.ZP,{icon:(0,d.jsx)(E.Z,{}),onClick:ot,children:"刷新"}),(0,d.jsx)(P.Z,{trigger:["click"],open:$e,onOpenChange:et,title:(0,d.jsx)("b",{children:"显示设置"}),content:(0,d.jsxs)(C.Z,{direction:"vertical",size:8,children:[(0,d.jsx)(q.Z,{checked:Ve.kpis,onChange:function(e){return _e((function(t){return v()(v()({},t),{},{kpis:e.target.checked})}))},children:"KPI 指标"}),(0,d.jsx)(O.Z,{style:{margin:"4px 0"}}),(0,d.jsx)(q.Z,{checked:Ve.ticketStatusPie,onChange:function(e){return _e((function(t){return v()(v()({},t),{},{ticketStatusPie:e.target.checked})}))},children:"工单状态分布"}),(0,d.jsx)(q.Z,{checked:Ve.aiTokenLine,onChange:function(e){return _e((function(t){return v()(v()({},t),{},{aiTokenLine:e.target.checked})}))},children:"AI Token 今日使用趋势"}),(0,d.jsx)(O.Z,{style:{margin:"4px 0"}}),(0,d.jsx)(q.Z,{checked:Ve.serviceStatusPie,onChange:function(e){return _e((function(t){return v()(v()({},t),{},{serviceStatusPie:e.target.checked})}))},children:"会话状态分布"}),(0,d.jsx)(q.Z,{checked:Ve.serviceDurationLine,onChange:function(e){return _e((function(t){return v()(v()({},t),{},{serviceDurationLine:e.target.checked})}))},children:"会话时长分布"}),(0,d.jsx)(q.Z,{checked:Ve.serviceHourlyLine,onChange:function(e){return _e((function(t){return v()(v()({},t),{},{serviceHourlyLine:e.target.checked})}))},children:"会话请求时间点"}),(0,d.jsx)(O.Z,{style:{margin:"4px 0"}}),h&&(0,d.jsx)(q.Z,{checked:Ve.recentCalls,onChange:function(e){return _e((function(t){return v()(v()({},t),{},{recentCalls:e.target.checked})}))},children:"最近呼叫"}),(0,d.jsx)(q.Z,{checked:Ve.articles,onChange:function(e){return _e((function(t){return v()(v()({},t),{},{articles:e.target.checked})}))},children:"最近知识库文章"}),(0,d.jsx)(q.Z,{checked:Ve.notices,onChange:function(e){return _e((function(t){return v()(v()({},t),{},{notices:e.target.checked})}))},children:"平台动态"}),(0,d.jsx)(O.Z,{style:{margin:"4px 0"}}),(0,d.jsx)(q.Z,{checked:Ve.agentPerformance,onChange:function(e){return _e((function(t){return v()(v()({},t),{},{agentPerformance:e.target.checked})}))},children:"客服绩效统计"}),(0,d.jsxs)(C.Z,{size:8,children:[(0,d.jsx)(l.ZP,{size:"small",onClick:function(){return _e(Ue)},children:"恢复默认"}),(0,d.jsx)(l.ZP,{size:"small",type:"primary",onClick:function(){return et(!1)},children:"完成"})]})]}),children:(0,d.jsx)(l.ZP,{children:"显示设置"})})]})})]})}),Ve.kpis&&(0,d.jsxs)(M.Z,{gutter:[16,16],children:[(0,d.jsx)(I.Z,{xs:24,sm:12,md:8,lg:6,xl:4,children:(0,d.jsx)(T.Z,{loading:rt,children:(0,d.jsx)(D.Z,{title:(0,d.jsx)(w.Z,{title:"当前在线客服数量 / 总客服数",children:(0,d.jsxs)("span",{style:{cursor:"pointer"},onClick:function(){return c("/bi/online-service/agent")},children:[(0,d.jsx)(J.Z,{})," 在线客服"]})}),value:null!==(e=null==W?void 0:W.onlineAgentCount)&&void 0!==e?e:0,suffix:"/ ".concat(Math.max(0,(null!==(t=null==W?void 0:W.onlineAgentCount)&&void 0!==t?t:0)+(null!==(n=null==W?void 0:W.offlineAgentCount)&&void 0!==n?n:0)))})})}),(0,d.jsx)(I.Z,{xs:24,sm:12,md:8,lg:6,xl:4,children:(0,d.jsx)(T.Z,{loading:rt,children:(0,d.jsx)(D.Z,{title:(0,d.jsx)(w.Z,{title:"当前排队中的会话数量",children:(0,d.jsxs)("span",{style:{cursor:"pointer"},onClick:function(){return c("/bi/online-service/thread")},children:[(0,d.jsx)(X.Z,{})," 排队会话"]})}),value:null!==(r=null==W?void 0:W.queuingThreadCount)&&void 0!==r?r:0})})}),(0,d.jsx)(I.Z,{xs:24,sm:12,md:8,lg:6,xl:4,children:(0,d.jsx)(T.Z,{loading:rt,children:(0,d.jsx)(D.Z,{title:(0,d.jsx)(w.Z,{title:"选定时间内已接入会话占比",children:(0,d.jsxs)("span",{style:{cursor:"pointer"},onClick:function(){return c("/bi/online-service/thread")},children:[(0,d.jsx)(F.Z,{})," 接通率"]})}),value:ce(null==W?void 0:W.acceptRate),suffix:"%"})})}),(0,d.jsx)(I.Z,{xs:24,sm:12,md:8,lg:6,xl:4,children:(0,d.jsx)(T.Z,{loading:rt,children:(0,d.jsx)(D.Z,{title:(0,d.jsx)(w.Z,{title:"从用户发起到客服首次回复的平均时长",children:(0,d.jsxs)("span",{style:{cursor:"pointer"},onClick:function(){return c("/bi/online-service/thread")},children:[(0,d.jsx)(F.Z,{})," 平均首响"]})}),value:ue(null==W?void 0:W.avgFirstResponseTime)})})}),(0,d.jsx)(I.Z,{xs:24,sm:12,md:8,lg:6,xl:4,children:(0,d.jsx)(T.Z,{loading:rt,children:(0,d.jsx)(D.Z,{title:(0,d.jsx)(w.Z,{title:"选定时间内创建的工单总量",children:(0,d.jsxs)("span",{style:{cursor:"pointer"},onClick:function(){return c("/bi/ticket-service/overview")},children:[(0,d.jsx)(N.Z,{})," 工单总数"]})}),value:null!==(s=null==he?void 0:he.totalTickets)&&void 0!==s?s:0})})}),(0,d.jsx)(I.Z,{xs:24,sm:12,md:8,lg:6,xl:4,children:(0,d.jsx)(T.Z,{loading:rt,children:(0,d.jsx)(D.Z,{title:(0,d.jsx)(w.Z,{title:"客户评价的满意度比例",children:(0,d.jsxs)("span",{style:{cursor:"pointer"},onClick:function(){return c("/bi/ticket-service/rating")},children:[(0,d.jsx)(z.Z,{})," 满意度"]})}),value:ce(null!==(u=null==he?void 0:he.customerSatisfactionRate)&&void 0!==u?u:null==W?void 0:W.satisfactionRate),suffix:"%"})})})]}),(Ve.serviceStatusPie||Ve.serviceDurationLine)&&(0,d.jsx)(M.Z,{gutter:[16,16],children:Ve.serviceStatusPie&&Ve.serviceDurationLine?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(I.Z,{xs:24,lg:10,children:(0,d.jsx)(T.Z,{title:(0,d.jsx)(w.Z,{title:"在线客服会话的状态分布",children:(0,d.jsxs)("span",{style:{cursor:"pointer"},onClick:function(){return c("/bi/online-service/thread")},children:[(0,d.jsx)(J.Z,{})," 会话状态分布"]})}),loading:rt,children:rt?(0,d.jsx)(A.Z,{active:!0,paragraph:{rows:6}}):(0,d.jsx)(G.Z,{data:lt,angleField:"value",colorField:"type",radius:.9,legend:{position:"bottom"},height:300})})}),(0,d.jsx)(I.Z,{xs:24,lg:14,children:(0,d.jsx)(T.Z,{title:(0,d.jsx)(w.Z,{title:"会话时长区间内的会话数量",children:(0,d.jsxs)("span",{style:{cursor:"pointer"},onClick:function(){return c("/bi/online-service/thread")},children:[(0,d.jsx)(F.Z,{})," 会话时长分布"]})}),extra:(0,d.jsx)(oe,{type:"secondary",children:"单位:会话数"}),loading:rt,children:rt?(0,d.jsx)(A.Z,{active:!0,paragraph:{rows:6}}):(0,d.jsx)(U.Z,{data:dt,xField:"bucket",yField:"value",smooth:!0,height:300,tooltip:{showMarkers:!1},xAxis:{label:{autoRotate:!1}}})})})]}):Ve.serviceStatusPie?(0,d.jsx)(I.Z,{xs:24,children:(0,d.jsx)(T.Z,{title:(0,d.jsx)(w.Z,{title:"在线客服会话的状态分布",children:(0,d.jsxs)("span",{style:{cursor:"pointer"},onClick:function(){return c("/bi/online-service/thread")},children:[(0,d.jsx)(J.Z,{})," 会话状态分布"]})}),loading:rt,children:rt?(0,d.jsx)(A.Z,{active:!0,paragraph:{rows:6}}):(0,d.jsx)(G.Z,{data:lt,angleField:"value",colorField:"type",radius:.9,legend:{position:"bottom"},height:300})})}):(0,d.jsx)(I.Z,{xs:24,children:(0,d.jsx)(T.Z,{title:(0,d.jsx)(w.Z,{title:"会话时长区间内的会话数量",children:(0,d.jsxs)("span",{style:{cursor:"pointer"},onClick:function(){return c("/bi/online-service/thread")},children:[(0,d.jsx)(F.Z,{})," 会话时长分布"]})}),extra:(0,d.jsx)(oe,{type:"secondary",children:"单位:会话数"}),loading:rt,children:rt?(0,d.jsx)(A.Z,{active:!0,paragraph:{rows:6}}):(0,d.jsx)(U.Z,{data:dt,xField:"bucket",yField:"value",smooth:!0,height:300,tooltip:{showMarkers:!1},xAxis:{label:{autoRotate:!1}}})})})}),Ve.serviceHourlyLine&&(0,d.jsx)(M.Z,{gutter:[16,16],children:(0,d.jsx)(I.Z,{xs:24,children:(0,d.jsx)(T.Z,{title:(0,d.jsx)(w.Z,{title:"每小时发起会话请求的人次",children:(0,d.jsxs)("span",{style:{cursor:"pointer"},onClick:function(){return c("/bi/online-service/thread")},children:[(0,d.jsx)(X.Z,{})," 在线客服会话请求时间点"]})}),extra:(0,d.jsx)(oe,{type:"secondary",children:"单位:人次/小时"}),loading:rt,children:rt?(0,d.jsx)(A.Z,{active:!0,paragraph:{rows:6}}):(0,d.jsx)(U.Z,{data:Ye,xField:"hour",yField:"count",smooth:!0,height:300,tooltip:{showMarkers:!1},xAxis:{tickCount:12}})})})}),Ve.agentPerformance&&(0,d.jsx)(M.Z,{gutter:[16,16],children:(0,d.jsx)(I.Z,{xs:24,children:(0,d.jsx)(T.Z,{title:(0,d.jsx)(w.Z,{title:"客服维度关键绩效指标汇总",children:(0,d.jsxs)("span",{style:{cursor:"pointer"},onClick:function(){return c("/bi/online-service/agent")},children:[(0,d.jsx)(J.Z,{})," 客服绩效统计"]})}),extra:(0,d.jsx)(oe,{type:"secondary",children:"按客服汇总"}),loading:rt,children:(0,d.jsx)(R.Z,{rowKey:function(e){return e.key||"".concat(e.name)},size:"small",columns:xt,dataSource:vt,scroll:{x:!0},pagination:{pageSize:10},locale:{emptyText:"暂无数据"}})})})}),(Ve.ticketStatusPie||Ve.aiTokenLine)&&(0,d.jsx)(M.Z,{gutter:[16,16],children:Ve.ticketStatusPie&&Ve.aiTokenLine?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(I.Z,{xs:24,lg:10,children:(0,d.jsx)(T.Z,{title:(0,d.jsx)(w.Z,{title:"选定时间内各状态工单数量占比",children:(0,d.jsxs)("span",{style:{cursor:"pointer"},onClick:function(){return c("/bi/ticket-service/overview")},children:[(0,d.jsx)(N.Z,{})," 工单状态分布"]})}),loading:rt,children:rt?(0,d.jsx)(A.Z,{active:!0,paragraph:{rows:6}}):(0,d.jsx)(G.Z,{data:ut,angleField:"value",colorField:"type",radius:.9,legend:{position:"bottom"},height:300})})}),(0,d.jsx)(I.Z,{xs:24,lg:14,children:(0,d.jsx)(T.Z,{title:(0,d.jsx)(w.Z,{title:"今日各小时 Token 消耗趋势",children:(0,d.jsxs)("span",{style:{cursor:"pointer"},onClick:function(){return c("/bi/robot-service/token")},children:[(0,d.jsx)(H.Z,{})," AI Token 今日使用趋势"]})}),extra:(0,d.jsx)(oe,{type:"secondary",children:"单位Token"}),loading:rt,children:rt?(0,d.jsx)(A.Z,{active:!0,paragraph:{rows:6}}):(0,d.jsx)(U.Z,{data:ct,xField:"hour",yField:"tokens",smooth:!0,height:300,tooltip:{showMarkers:!1},xAxis:{tickCount:12}})})})]}):Ve.ticketStatusPie?(0,d.jsx)(I.Z,{xs:24,children:(0,d.jsx)(T.Z,{title:(0,d.jsx)(w.Z,{title:"选定时间内各状态工单数量占比",children:(0,d.jsxs)("span",{style:{cursor:"pointer"},onClick:function(){return c("/bi/ticket-service/overview")},children:[(0,d.jsx)(N.Z,{})," 工单状态分布"]})}),loading:rt,children:rt?(0,d.jsx)(A.Z,{active:!0,paragraph:{rows:6}}):(0,d.jsx)(G.Z,{data:ut,angleField:"value",colorField:"type",radius:.9,legend:{position:"bottom"},height:300})})}):(0,d.jsx)(I.Z,{xs:24,children:(0,d.jsx)(T.Z,{title:(0,d.jsx)(w.Z,{title:"今日各小时 Token 消耗趋势",children:(0,d.jsxs)("span",{style:{cursor:"pointer"},onClick:function(){return c("/bi/robot-service/token")},children:[(0,d.jsx)(H.Z,{})," AI Token 今日使用趋势"]})}),extra:(0,d.jsx)(oe,{type:"secondary",children:"单位Token"}),loading:rt,children:rt?(0,d.jsx)(A.Z,{active:!0,paragraph:{rows:6}}):(0,d.jsx)(U.Z,{data:ct,xField:"hour",yField:"tokens",smooth:!0,height:300,tooltip:{showMarkers:!1},xAxis:{tickCount:12}})})})}),h&&Ve.recentCalls&&(0,d.jsx)(M.Z,{gutter:[16,16],children:(0,d.jsx)(I.Z,{xs:24,children:(0,d.jsx)(T.Z,{title:(0,d.jsx)(w.Z,{title:"FreeSWITCH 最近呼入/呼出记录(仅调试)",children:(0,d.jsxs)("span",{style:{cursor:"pointer"},onClick:function(){return c("/bi/callcenter-service/summary")},children:[(0,d.jsx)(L.Z,{})," 最近呼叫"]})}),extra:(0,d.jsxs)(oe,{type:"secondary",children:["共 ",we," 通"]}),children:(0,d.jsx)(R.Z,{rowKey:function(e){return e.uid},size:"small",loading:rt,columns:ht,dataSource:je,pagination:!1})})})}),(Ve.articles||Ve.notices)&&(0,d.jsx)(M.Z,{gutter:[16,16],children:Ve.articles&&Ve.notices?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(I.Z,{xs:24,lg:12,children:(0,d.jsx)(T.Z,{title:(0,d.jsxs)("span",{children:[(0,d.jsx)(Y.Z,{})," 最近知识库文章"]}),extra:(0,d.jsxs)(oe,{type:"secondary",children:["共 ",Oe," 篇"]}),children:(0,d.jsx)(R.Z,{rowKey:function(e){return e.uid},size:"small",loading:rt,columns:pt,dataSource:Me,pagination:!1})})}),(0,d.jsx)(I.Z,{xs:24,lg:12,children:(0,d.jsx)(T.Z,{title:(0,d.jsx)("span",{children:"平台动态"}),extra:(0,d.jsxs)(oe,{type:"secondary",children:["共 ",Ne," 条"]}),children:(0,d.jsx)(R.Z,{rowKey:function(e){return e.uid},size:"small",loading:rt,columns:ft,dataSource:Ee,pagination:!1})})})]}):Ve.articles?(0,d.jsx)(I.Z,{xs:24,children:(0,d.jsx)(T.Z,{title:(0,d.jsxs)("span",{children:[(0,d.jsx)(Y.Z,{})," 最近知识库文章"]}),extra:(0,d.jsxs)(oe,{type:"secondary",children:["共 ",Oe," 篇"]}),children:(0,d.jsx)(R.Z,{rowKey:function(e){return e.uid},size:"small",loading:rt,columns:pt,dataSource:Me,pagination:!1})})}):(0,d.jsx)(I.Z,{xs:24,children:(0,d.jsx)(T.Z,{title:(0,d.jsx)("span",{children:"平台动态"}),extra:(0,d.jsxs)(oe,{type:"secondary",children:["共 ",Ne," 条"]}),children:(0,d.jsx)(R.Z,{rowKey:function(e){return e.uid},size:"small",loading:rt,columns:ft,dataSource:Ee,pagination:!1})})})})]})},de=n(88449),he=function(){var e=(0,de.Z)().contentStyle,t=((0,s.useModel)("@@initialState").initialState||{}).userInfo,n=(0,a.u)((function(e){return e.setCurrentOrg})),r=((0,s.useIntl)(),(0,s.useAccess)());r.canDebug&&f.Z.log("Developing canDebug");var c=(0,o.useState)(!1),l=i()(c,2),x=l[0],v=l[1],y=(0,o.useState)(!1),m=i()(y,2),g=m[0],j=m[1];return(0,o.useEffect)((function(){!function(){if(t){if(!t.currentOrganization)return f.Z.log("before initOrganization",t),void v(!0);f.Z.log("after initOrganization"),n(t.currentOrganization)}}(),"true"!==localStorage.getItem("skipVerification")&&(!t||t.emailVerified||t.mobileVerified||j(!0))}),[t]),(0,d.jsxs)("div",{style:e,children:[(0,d.jsx)(s.Access,{accessible:r.canAdmin()&&!r.isCommunityEdition(),fallback:(0,d.jsx)("div",{style:{marginTop:100,textAlign:"center"},children:(0,d.jsx)(p.Z,{description:"企业版&&平台版在此显示统计数据等"})}),children:(0,d.jsx)(le,{})}),(0,d.jsx)(u.Z,{open:x,onClose:function(){return v(!1)},onSuccess:function(e){n(e),window.location.reload()}}),(0,d.jsx)(h,{open:g,onClose:function(){return j(!1)}})]})}}}]);