mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-08 16:32:46 +00:00
1 line
16 KiB
JavaScript
1 line
16 KiB
JavaScript
"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[9967],{28619:function(e,t,s){var i=s(18232),a=s(54305),r=s(43906);t.Z=function(){var e=(0,r.useIntl)();return{translateString:function(t){return null==t?t:t&&(null!=t&&t.startsWith(i.VoP)||null!=t&&t.startsWith("ROLE_"))?e.formatMessage({id:t,defaultMessage:t}):t},translateStringTranct:function(t){return null==t?t:null!=t&&t.startsWith(i.VoP)||null!=t&&t.startsWith("ROLE_")?(0,a.aS)(e.formatMessage({id:t,defaultMessage:t}),10):(0,a.aS)(t,10)}}}},64856:function(e,t,s){s.r(t);var i=s(90819),a=s.n(i),r=s(89933),n=s.n(r),d=s(45332),o=s.n(d),l=s(44194),c=s(46030),u=s(97868),x=s(64827),v=s(99898),g=s(39038),m=s(17966),j=s(34353),f=s(60762),h=s(99098),p=s(80057),Z=s(37141),M=s(61107),y=s(80556),F=s(58791),k=s(58368),w=s(86994),b=s(48004),T=s(93689),R=s(429),S=s(27995),C=s(24429),Y=s(34545),O=s(25640),A=s(52294),I=s(55567),D=s(9942),U=s(36914),W=s(17817),E=s(66942),P=s(28619),H=s(88192),q=s(18232),L=s(28977),B=s.n(L),z=s(43906),_=s(56293),G=s(68060),N=s(81343),V=s(31549),$=G.Z.Title,J=c.default.RangePicker,K=u.Z.Option;t.default=function(){var e,t,s=(0,z.useIntl)(),i=(0,P.Z)().translateStringTranct,r=(0,l.useState)(B()().startOf("day")),d=o()(r,2),c=d[0],L=d[1],G=(0,l.useState)(B()().endOf("day")),Q=o()(G,2),X=Q[0],ee=Q[1],te=(0,l.useState)("today"),se=o()(te,2),ie=se[0],ae=se[1],re=(0,l.useState)(q.AOk),ne=o()(re,2),de=ne[0],oe=ne[1],le=(0,l.useState)(),ce=o()(le,2),ue=ce[0],xe=ce[1],ve=(0,l.useState)(),ge=o()(ve,2),me=ge[0],je=ge[1],fe=(0,D.u)((function(e){return e.currentOrg})),he=(0,U.E)((function(e){return e})),pe=he.agentResult,Ze=he.setAgentResult,Me=(0,W.$)((function(e){return e})),ye=Me.workgroupResult,Fe=Me.setWorkgroupResult,ke=(0,l.useState)(),we=o()(ke,2),be=we[0],Te=we[1],Re=(0,l.useState)(q.OwA),Se=o()(Re,2),Ce=Se[0],Ye=Se[1],Oe=(0,l.useState)(!1),Ae=o()(Oe,2),Ie=(Ae[0],Ae[1]),De=[{label:(0,V.jsx)(z.FormattedMessage,{id:"ticket.statistic.timeRange.today"}),value:"today"},{label:(0,V.jsx)(z.FormattedMessage,{id:"ticket.statistic.timeRange.yesterday"}),value:"yesterday"},{label:(0,V.jsx)(z.FormattedMessage,{id:"ticket.statistic.timeRange.week"}),value:"week"},{label:(0,V.jsx)(z.FormattedMessage,{id:"ticket.statistic.timeRange.lastWeek"}),value:"lastWeek"},{label:(0,V.jsx)(z.FormattedMessage,{id:"ticket.statistic.timeRange.month"}),value:"month"},{label:(0,V.jsx)(z.FormattedMessage,{id:"ticket.statistic.timeRange.custom"}),value:"custom"}],Ue=(s.formatMessage({id:"service.statistic.status.online"}),s.formatMessage({id:"service.statistic.status.busy"}),s.formatMessage({id:"service.statistic.status.away"}),s.formatMessage({id:"service.statistic.status.offline"}),[{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.table.agent"}),dataIndex:"name",key:"name"},{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.table.onlineTime"}),dataIndex:"onlineTime",key:"onlineTime"},{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.table.sessionCount"}),dataIndex:"sessionCount",key:"sessionCount"},{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.table.avgResponseTime"}),dataIndex:"avgResponseTime",key:"avgResponseTime"},{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.table.avgSessionTime"}),dataIndex:"avgSessionTime",key:"avgSessionTime"},{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.table.satisfaction"}),dataIndex:"satisfaction",key:"satisfaction"},{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.table.workingHours"}),dataIndex:"workingHours",key:"workingHours"},{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.table.transferRate"}),dataIndex:"transferRate",key:"transferRate"},{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.table.firstResolutionRate"}),dataIndex:"firstResolutionRate",key:"firstResolutionRate"},{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.table.overdueCount"}),dataIndex:"overdueCount",key:"overdueCount"}]);(0,l.useEffect)((function(){if("custom"===ie)L(c),ee(X),Ye(q.dd4);else{var e=B()();"today"===ie?(L(e),ee(e),Ye(q.OwA)):"yesterday"===ie?(L(e.subtract(1,"day")),ee(e.subtract(1,"day")),Ye(q.OwA)):"week"===ie?(L(e.startOf("week")),ee(e.endOf("week")),Ye(q.dd4)):"lastWeek"===ie?(L(e.subtract(1,"week").startOf("week")),ee(e.subtract(1,"week").endOf("week")),Ye(q.dd4)):"month"===ie&&(L(e.startOf("month")),ee(e.endOf("month")),Ye(q.dd4))}}),[ie]);var We=function(){var e=n()(a()().mark((function e(){var t,s;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return I.yw.loading("loading"),t={pageNumber:0,pageSize:50,orgUid:null==fe?void 0:fe.uid},e.next=4,(0,H.LE)(t);case 4:s=e.sent,console.log("fetchAllWorkgroups: ",s),200===s.code?(I.yw.destroy(),Fe(s),s.data.content.length>0&&je(s.data.content[0].uid)):(I.yw.destroy(),I.yw.error(s.message));case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ee=function(){var e=n()(a()().mark((function e(){var t,s;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return I.yw.loading("loading"),t={pageNumber:0,pageSize:50,orgUid:null==fe?void 0:fe.uid},e.next=4,(0,E._t)(t);case 4:s=e.sent,console.log("fetchAllAgents: ",s),200===s.code?(I.yw.destroy(),Ze(s),s.data.content.length>0&&xe(s.data.content[0].uid)):(I.yw.destroy(),I.yw.error(i(s.message))),console.log("queryAllAgents response",s);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Pe=function(){var e=n()(a()().mark((function e(){var t,i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Ie(!0),e.prev=1,I.yw.loading("loading"),t={type:de,statisticStartTime:null==c?void 0:c.format("YYYY-MM-DD 00:00:00"),statisticEndTime:null==X?void 0:X.format("YYYY-MM-DD 23:59:59"),workgroupUid:me,agentUid:ue,orgUid:null==fe?void 0:fe.uid},e.next=6,(0,_.RU)(t);case 6:i=e.sent,console.log("queryStatisticServicesByOrg response",i,t),200===i.code?(I.yw.destroy(),Te(i.data)):(I.yw.destroy(),I.yw.error(i.message)),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),I.yw.error(s.formatMessage({id:"ticket.message.operation.failed"}));case 14:return e.prev=14,Ie(!1),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])})));return function(){return e.apply(this,arguments)}}(),He=function(){var e=n()(a()().mark((function e(){var t,s;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return I.yw.loading("loading"),t={type:de,statisticStartTime:null==c?void 0:c.format("YYYY-MM-DD 00:00:00"),statisticEndTime:null==X?void 0:X.format("YYYY-MM-DD 23:59:59"),workgroupUid:me,agentUid:ue,orgUid:null==fe?void 0:fe.uid},e.next=4,(0,_.RU)(t);case 4:s=e.sent,console.log("queryStatisticServicesByOrg response",s,t),200===s.code?I.yw.destroy():(I.yw.destroy(),I.yw.error(s.message));case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,l.useEffect)((function(){We(),Ee()}),[]),(0,l.useEffect)((function(){Pe()}),[de,ue,me]),(0,l.useEffect)((function(){He()}),[Ce,de,ue,me]),(0,l.useEffect)((function(){Pe()}),[c,X]),(0,V.jsxs)("div",{style:{padding:16},children:[(0,V.jsx)(x.Z,{style:{marginBottom:16},children:(0,V.jsxs)(v.Z,{direction:"vertical",style:{width:"100%"},children:[(0,V.jsxs)(v.Z,{wrap:!0,children:[(0,V.jsx)(g.ZP.Group,{value:ie,onChange:function(e){return ae(e.target.value)},children:De.map((function(e){return(0,V.jsx)(g.ZP.Button,{value:e.value,children:e.label},e.value)}))}),"custom"===ie&&(0,V.jsx)(J,{value:[c,X],onChange:function(e){L(e[0]),ee(e[1])}})]}),(0,V.jsxs)(v.Z,{wrap:!0,children:[(0,V.jsxs)(u.Z,{placeholder:(0,V.jsx)(z.FormattedMessage,{id:"ticket.statistic.filter.type"}),style:{width:200},value:de,onChange:function(e){return oe(e)},children:[(0,V.jsx)(K,{value:q.AOk,children:(0,V.jsx)(z.FormattedMessage,{id:"i18n.all"})}),(0,V.jsx)(K,{value:q.pHh,children:(0,V.jsx)(z.FormattedMessage,{id:"ticket.statistic.filter.agent"})}),(0,V.jsx)(K,{value:q.ti4,children:(0,V.jsx)(z.FormattedMessage,{id:"ticket.statistic.filter.workgroup"})})]}),de===q.pHh&&(0,V.jsx)(u.Z,{placeholder:(0,V.jsx)(z.FormattedMessage,{id:"ticket.statistic.filter.agent"}),style:{width:200},value:ue,onChange:function(e){return xe(e)},children:null===(e=pe.data)||void 0===e||null===(e=e.content)||void 0===e?void 0:e.map((function(e){return(0,V.jsx)(K,{value:null==e?void 0:e.uid,children:i(null==e?void 0:e.nickname)},null==e?void 0:e.uid)}))}),de===q.ti4&&(0,V.jsx)(u.Z,{placeholder:(0,V.jsx)(z.FormattedMessage,{id:"ticket.statistic.filter.department"}),style:{width:200},value:me,onChange:function(e){return je(e)},children:null===(t=ye.data)||void 0===t||null===(t=t.content)||void 0===t?void 0:t.map((function(e){return(0,V.jsx)(K,{value:null==e?void 0:e.uid,children:i(null==e?void 0:e.nickname)},null==e?void 0:e.uid)}))}),(0,V.jsx)(m.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"ticket.statistic.filter.export"}),children:(0,V.jsx)(j.ZP,{icon:(0,V.jsx)(M.Z,{}),onClick:function(){var e=localStorage.getItem(q.LA8);window.open((0,N.kG)()+"/api/v1/service/statistic/export?"+new URLSearchParams({type:de,statisticStartTime:null==c?void 0:c.format("YYYY-MM-DD 00:00:00"),statisticEndTime:null==X?void 0:X.format("YYYY-MM-DD 23:59:59"),workgroupUid:me,agentUid:ue,orgUid:null==fe?void 0:fe.uid,accessToken:e||""}).toString())},children:(0,V.jsx)(z.FormattedMessage,{id:"ticket.statistic.filter.export"})})}),(0,V.jsx)(m.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"ticket.statistic.filter.refresh"}),children:(0,V.jsx)(j.ZP,{icon:(0,V.jsx)(y.Z,{}),onClick:function(){return Pe()},children:(0,V.jsx)(z.FormattedMessage,{id:"ticket.statistic.filter.refresh"})})}),!1]})]})}),(0,V.jsxs)(f.Z,{gutter:24,children:[(0,V.jsx)(h.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,V.jsx)(x.Z,{variant:"borderless",children:(0,V.jsx)(p.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.onlineAgentCount"}),value:(null==be?void 0:be.onlineAgentCount)||0,prefix:(0,V.jsx)(F.Z,{}),suffix:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.unit.person"})})})}),(0,V.jsx)(h.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,V.jsx)(x.Z,{variant:"borderless",children:(0,V.jsx)(p.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.offlineAgentCount"}),value:(null==be?void 0:be.offlineAgentCount)||0,prefix:(0,V.jsx)(k.Z,{}),suffix:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.unit.person"})})})}),(0,V.jsx)(h.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,V.jsx)(x.Z,{variant:"borderless",children:(0,V.jsx)(p.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.queuingThreadCount"}),value:(null==be?void 0:be.queuingThreadCount)||0,prefix:(0,V.jsx)(F.Z,{}),suffix:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.unit.person"})})})}),(0,V.jsx)(h.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,V.jsx)(x.Z,{variant:"borderless",children:(0,V.jsx)(p.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.currentThreadCount"}),value:(null==be?void 0:be.currentThreadCount)||0,prefix:(0,V.jsx)(w.Z,{}),suffix:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.unit.session"})})})})]}),(0,V.jsxs)(f.Z,{gutter:24,style:{marginTop:24},children:[(0,V.jsx)(h.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,V.jsx)(x.Z,{variant:"borderless",children:(0,V.jsx)(p.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.maxResponseTime"}),value:(null==be?void 0:be.maxResponseTime)||0,prefix:(0,V.jsx)(b.Z,{}),suffix:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.unit.seconds"})})})}),(0,V.jsx)(h.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,V.jsx)(x.Z,{variant:"borderless",children:(0,V.jsx)(p.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.minResponseTime"}),value:(null==be?void 0:be.minResponseTime)||0,prefix:(0,V.jsx)(b.Z,{}),suffix:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.unit.seconds"})})})}),(0,V.jsx)(h.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,V.jsx)(x.Z,{variant:"borderless",children:(0,V.jsx)(p.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.avgFirstResponseTime"}),value:(null==be?void 0:be.avgFirstResponseTime)||0,prefix:(0,V.jsx)(b.Z,{}),suffix:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.unit.seconds"})})})}),(0,V.jsx)(h.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,V.jsx)(x.Z,{variant:"borderless",children:(0,V.jsx)(p.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.avgWaitingTime"}),value:(null==be?void 0:be.avgWaitingTime)||0,prefix:(0,V.jsx)(b.Z,{}),suffix:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.unit.seconds"})})})})]}),(0,V.jsxs)(f.Z,{gutter:24,style:{marginTop:24},children:[(0,V.jsx)(h.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,V.jsx)(x.Z,{variant:"borderless",children:(0,V.jsx)(p.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.totalIncomingThreads"}),value:(null==be?void 0:be.totalIncomingThreads)||0,prefix:(0,V.jsx)(w.Z,{}),suffix:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.unit.session"})})})}),(0,V.jsx)(h.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,V.jsx)(x.Z,{variant:"borderless",children:(0,V.jsx)(p.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.acceptedThreadCount"}),value:(null==be?void 0:be.acceptedThreadCount)||0,prefix:(0,V.jsx)(T.Z,{}),suffix:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.unit.session"})})})}),(0,V.jsx)(h.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,V.jsx)(x.Z,{variant:"borderless",children:(0,V.jsx)(p.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.acceptRate"}),value:(null==be?void 0:be.acceptRate)||0,prefix:(0,V.jsx)(T.Z,{}),suffix:"%"})})}),(0,V.jsx)(h.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,V.jsx)(x.Z,{variant:"borderless",children:(0,V.jsx)(p.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.firstSolveRate"}),value:(null==be?void 0:be.firstSolveRate)||0,prefix:(0,V.jsx)(R.Z,{}),suffix:"%"})})})]}),(0,V.jsxs)(f.Z,{gutter:24,style:{marginTop:24},children:[(0,V.jsx)(h.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,V.jsx)(x.Z,{variant:"borderless",children:(0,V.jsx)(p.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.robotThreadCount"}),value:(null==be?void 0:be.robotThreadCount)||0,prefix:(0,V.jsx)(S.Z,{}),suffix:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.unit.session"})})})}),(0,V.jsx)(h.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,V.jsx)(x.Z,{variant:"borderless",children:(0,V.jsx)(p.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.robotToHumanCount"}),value:(null==be?void 0:be.robotToHumanCount)||0,prefix:(0,V.jsx)(C.Z,{}),suffix:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.unit.session"})})})}),(0,V.jsx)(h.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,V.jsx)(x.Z,{variant:"borderless",children:(0,V.jsx)(p.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.robotSolveRate"}),value:(null==be?void 0:be.robotSolveRate)||0,prefix:(0,V.jsx)(T.Z,{}),suffix:"%"})})}),(0,V.jsx)(h.Z,{xl:6,lg:12,md:12,sm:24,xs:24,children:(0,V.jsx)(x.Z,{variant:"borderless",children:(0,V.jsx)(p.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.transferRate"}),value:(null==be?void 0:be.transferRate)||0,prefix:(0,V.jsx)(Y.Z,{}),suffix:"%"})})})]}),(0,V.jsxs)(x.Z,{style:{marginTop:24},children:[(0,V.jsx)($,{level:4,children:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.sessionDuration"})}),(0,V.jsxs)(f.Z,{gutter:24,children:[(0,V.jsx)(h.Z,{span:8,children:(0,V.jsx)(p.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.duration.within5min"}),value:(null==be?void 0:be.durationWithin5Min)||0,suffix:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.unit.sessions"})})}),(0,V.jsx)(h.Z,{span:8,children:(0,V.jsx)(p.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.duration.within15min"}),value:(null==be?void 0:be.durationWithin15Min)||0,suffix:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.unit.sessions"})})}),(0,V.jsx)(h.Z,{span:8,children:(0,V.jsx)(p.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.duration.over15min"}),value:(null==be?void 0:be.durationOver15Min)||0,suffix:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.unit.sessions"})})})]})]}),(0,V.jsx)(x.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.performance"}),style:{marginTop:24},extra:(0,V.jsxs)(v.Z,{children:[(0,V.jsx)(m.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.export.excel"}),children:(0,V.jsx)(j.ZP,{icon:(0,V.jsx)(O.Z,{})})}),(0,V.jsx)(m.Z,{title:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.export.pdf"}),children:(0,V.jsx)(j.ZP,{icon:(0,V.jsx)(A.Z,{})})})]}),children:(0,V.jsx)(Z.Z,{columns:Ue,dataSource:[],scroll:{x:!0},size:"small",locale:{emptyText:(0,V.jsx)(z.FormattedMessage,{id:"service.statistic.tips.noData"})}})})]})}}}]); |