Files
weiyu/deploy/server/admin/p__Dashboard__Bi__Ticket__CustomReport.0ed0b012.async.js
jack ning 0cd9a7595d 0.9.2
2025-08-16 21:59:41 +08:00

1 line
12 KiB
JavaScript

"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[674],{93689:function(e,t,a){a.d(t,{Z:function(){return c}});var i=a(77260),n=a(44194),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"},r=a(54183),o=function(e,t){return n.createElement(r.Z,(0,i.Z)({},e,{ref:t,icon:s}))};var c=n.forwardRef(o)},90151:function(e,t,a){a.d(t,{Z:function(){return c}});var i=a(77260),n=a(44194),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM790.2 326H602V137.8L790.2 326zm1.8 562H232V136h302v216a42 42 0 0042 42h216v494zM504 618H320c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h184c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM312 490v48c0 4.4 3.6 8 8 8h384c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H320c-4.4 0-8 3.6-8 8z"}}]},name:"file-text",theme:"outlined"},r=a(54183),o=function(e,t){return n.createElement(r.Z,(0,i.Z)({},e,{ref:t,icon:s}))};var c=n.forwardRef(o)},74840:function(e,t,a){a.d(t,{Z:function(){return c}});var i=a(77260),n=a(44194),s={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M288 421a48 48 0 1096 0 48 48 0 10-96 0zm352 0a48 48 0 1096 0 48 48 0 10-96 0zM512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm263 711c-34.2 34.2-74 61-118.3 79.8C611 874.2 562.3 884 512 884c-50.3 0-99-9.8-144.8-29.2A370.4 370.4 0 01248.9 775c-34.2-34.2-61-74-79.8-118.3C149.8 611 140 562.3 140 512s9.8-99 29.2-144.8A370.4 370.4 0 01249 248.9c34.2-34.2 74-61 118.3-79.8C413 149.8 461.7 140 512 140c50.3 0 99 9.8 144.8 29.2A370.4 370.4 0 01775.1 249c34.2 34.2 61 74 79.8 118.3C874.2 413 884 461.7 884 512s-9.8 99-29.2 144.8A368.89 368.89 0 01775 775zM664 533h-48.1c-4.2 0-7.8 3.2-8.1 7.4C604 589.9 562.5 629 512 629s-92.1-39.1-95.8-88.6c-.3-4.2-3.9-7.4-8.1-7.4H360a8 8 0 00-8 8.4c4.4 84.3 74.5 151.6 160 151.6s155.6-67.3 160-151.6a8 8 0 00-8-8.4z"}}]},name:"smile",theme:"outlined"},r=a(54183),o=function(e,t){return n.createElement(r.Z,(0,i.Z)({},e,{ref:t,icon:s}))};var c=n.forwardRef(o)},12942:function(e,t,a){a.r(t);var i=a(90819),n=a.n(i),s=a(89933),r=a.n(s),o=a(45332),c=a.n(o),l=a(44194),d=a(62558),u=a(27904),f=a(79401),m=a(49616),g=a(32973),v=a(5780),k=a(78875),p=a(20228),h=a(65532),x=a(61155),y=a(80556),b=a(90151),M=a(93689),j=a(74840),w=a(48004),Z=a(14870),R=a(67165),T=a(5025),Y=a(34599),C=a(16698),D=a(94956),S=a(18751),z=a(5488),O=a(28977),H=a.n(O),I=a(99109),B=a(68020),E=a(31549),F=d.default.RangePicker,A=u.Z.Option;t.default=function(){var e,t,a=(0,Z.useIntl)(),i=(0,S.Z)().translateStringTranct,s=(0,l.useState)(H()().startOf("day")),o=c()(s,2),d=o[0],O=o[1],L=(0,l.useState)(H()().endOf("day")),P=c()(L,2),U=P[0],W=P[1],V=(0,l.useState)("today"),N=c()(V,2),Q=N[0],q=N[1],G=(0,l.useState)(z.whQ),_=c()(G,2),J=_[0],K=_[1],X=(0,l.useState)(),$=c()(X,2),ee=$[0],te=$[1],ae=(0,l.useState)(),ie=c()(ae,2),ne=ie[0],se=ie[1],re=(0,Y.u)((function(e){return e.currentOrg})),oe=(0,C.E)((function(e){return e})),ce=oe.agentResult,le=oe.setAgentResult,de=(0,B.H)((function(e){return e})),ue=de.departmentResult,fe=de.setDepartmentResult,me=(0,l.useState)(),ge=c()(me,2),ve=ge[0],ke=ge[1],pe=(0,l.useState)(!1),he=c()(pe,2),xe=he[0],ye=he[1],be=[{label:(0,E.jsx)(Z.FormattedMessage,{id:"bi.ticket.timeRange.today"}),value:"today"},{label:(0,E.jsx)(Z.FormattedMessage,{id:"bi.ticket.timeRange.yesterday"}),value:"yesterday"},{label:(0,E.jsx)(Z.FormattedMessage,{id:"bi.ticket.timeRange.week"}),value:"week"},{label:(0,E.jsx)(Z.FormattedMessage,{id:"bi.ticket.timeRange.lastWeek"}),value:"lastWeek"},{label:(0,E.jsx)(Z.FormattedMessage,{id:"bi.ticket.timeRange.month"}),value:"month"},{label:(0,E.jsx)(Z.FormattedMessage,{id:"bi.ticket.timeRange.custom"}),value:"custom"}];(0,l.useEffect)((function(){if("custom"===Q)O(d),W(U);else{var e=H()();"today"===Q?(O(e),W(e)):"yesterday"===Q?(O(e.subtract(1,"day")),W(e.subtract(1,"day"))):"week"===Q?(O(e.startOf("week")),W(e.endOf("week"))):"lastWeek"===Q?(O(e.subtract(1,"week").startOf("week")),W(e.subtract(1,"week").endOf("week"))):"month"===Q&&(O(e.startOf("month")),W(e.endOf("month")))}}),[Q]);var Me=function(){var e=r()(n()().mark((function e(){var t,a;return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T.yw.loading("loading"),t={pageNumber:0,pageSize:100,orgUid:null==re?void 0:re.uid},e.next=4,(0,I.dF)(t);case 4:200===(a=e.sent).code?(T.yw.destroy(),fe(a),a.data.content.length>0&&se(a.data.content[0].uid)):(T.yw.destroy(),T.yw.error(a.message));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),je=function(){var e=r()(n()().mark((function e(){var t,a;return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return T.yw.loading("loading"),t={pageNumber:0,pageSize:50,orgUid:null==re?void 0:re.uid},e.next=4,(0,D._t)(t);case 4:200===(a=e.sent).code?(T.yw.destroy(),le(a),a.data.content.length>0&&te(a.data.content[0].uid)):(T.yw.destroy(),T.yw.error(i(a.message)));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),we=function(){var e=r()(n()().mark((function e(){var t,i;return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return ye(!0),e.prev=1,T.yw.loading("loading"),t={type:J,startDate:null==d?void 0:d.format("YYYY-MM-DD"),endDate:null==U?void 0:U.format("YYYY-MM-DD"),departmentUid:ne,assigneeUid:ee,orgUid:null==re?void 0:re.uid},e.next=6,(0,R.AD)(t);case 6:i=e.sent,console.log("queryStatisticTicketByDate response:",i.data,t),200===i.code?(T.yw.destroy(),ke(i.data)):(T.yw.destroy(),T.yw.error(i.message)),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),T.yw.error(a.formatMessage({id:"ticket.message.operation.failed"}));case 14:return e.prev=14,ye(!1),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[1,11,14,17]])})));return function(){return e.apply(this,arguments)}}();(0,l.useEffect)((function(){Me(),je()}),[]),(0,l.useEffect)((function(){we()}),[J,ee,ne]),(0,l.useEffect)((function(){we()}),[d,U]);var Ze=[{key:"1",date:null==d?void 0:d.format("YYYY-MM-DD"),totalTickets:(null==ve?void 0:ve.totalTickets)||0,resolvedTickets:(null==ve?void 0:ve.resolvedTickets)||0,openTickets:(null==ve?void 0:ve.openTickets)||0,closedTickets:(null==ve?void 0:ve.closedTickets)||0,satisfactionRate:(null==ve?void 0:ve.customerSatisfactionRate)||0,avgResolutionTime:"".concat((null==ve?void 0:ve.averageResolutionTime)||0,"小时"),avgResponseTime:"".concat((null==ve?void 0:ve.averageFirstResponseTime)||0,"分钟"),slaComplianceRate:(null==ve?void 0:ve.slaComplianceRate)||0}],Re=[{title:a.formatMessage({id:"bi.ticket.table.date"}),dataIndex:"date",key:"date"},{title:a.formatMessage({id:"bi.ticket.table.totalTickets"}),dataIndex:"totalTickets",key:"totalTickets"},{title:a.formatMessage({id:"bi.ticket.table.resolvedTickets"}),dataIndex:"resolvedTickets",key:"resolvedTickets"},{title:a.formatMessage({id:"bi.ticket.table.processingTickets"}),dataIndex:"openTickets",key:"openTickets"},{title:a.formatMessage({id:"bi.ticket.table.closedTickets"}),dataIndex:"closedTickets",key:"closedTickets"},{title:a.formatMessage({id:"bi.ticket.table.satisfactionRate"}),dataIndex:"satisfactionRate",key:"satisfactionRate",render:function(e){return"".concat(e,"%")}},{title:a.formatMessage({id:"bi.ticket.table.avgResolutionTime"}),dataIndex:"avgResolutionTime",key:"avgResolutionTime",render:function(e){return"".concat(e).concat(a.formatMessage({id:"bi.ticket.unit.minute"}))}},{title:a.formatMessage({id:"bi.ticket.table.avgResponseTime"}),dataIndex:"avgResponseTime",key:"avgResponseTime",render:function(e){return"".concat(e).concat(a.formatMessage({id:"bi.ticket.unit.minute"}))}},{title:a.formatMessage({id:"bi.ticket.table.slaComplianceRate"}),dataIndex:"slaComplianceRate",key:"slaComplianceRate",render:function(e){return"".concat(e,"%")}}];return(0,E.jsxs)("div",{style:{padding:"24px"},children:[(0,E.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,E.jsx)("h2",{children:a.formatMessage({id:"bi.ticket.title.customReport"})}),(0,E.jsxs)("p",{children:[a.formatMessage({id:"bi.ticket.description.customReport"}),"today"===Q&&(0,E.jsxs)("span",{style:{color:"#666",marginLeft:8},children:["(",d.format("YYYY-MM-DD"),")"]}),"yesterday"===Q&&(0,E.jsxs)("span",{style:{color:"#666",marginLeft:8},children:["(",d.format("YYYY-MM-DD"),")"]}),("week"===Q||"lastWeek"===Q||"month"===Q||"custom"===Q)&&(0,E.jsxs)("span",{style:{color:"#666",marginLeft:8},children:["(",d.format("YYYY-MM-DD")," ~ ",U.format("YYYY-MM-DD"),")"]})]})]}),(0,E.jsx)(f.Z,{style:{marginBottom:16},children:(0,E.jsx)(m.Z,{direction:"vertical",style:{width:"100%"},children:(0,E.jsxs)(m.Z,{wrap:!0,style:{width:"100%",justifyContent:"space-between"},children:[(0,E.jsxs)(m.Z,{wrap:!0,children:[(0,E.jsx)(g.ZP.Group,{value:Q,onChange:function(e){return q(e.target.value)},children:be.map((function(e){return(0,E.jsx)(g.ZP.Button,{value:e.value,children:e.label},e.value)}))}),"custom"===Q&&(0,E.jsx)(F,{value:[d,U],onChange:function(e){O(e[0]),W(e[1])}})]}),(0,E.jsxs)(m.Z,{wrap:!0,children:[(0,E.jsxs)(u.Z,{value:J,onChange:K,style:{width:120},placeholder:a.formatMessage({id:"bi.ticket.filter.type"}),children:[(0,E.jsx)(A,{value:z.whQ,children:a.formatMessage({id:"bi.ticket.filterType.organization"})}),(0,E.jsx)(A,{value:z.fyH,children:a.formatMessage({id:"bi.ticket.filterType.agent"})}),(0,E.jsx)(A,{value:z.nYM,children:a.formatMessage({id:"bi.ticket.filterType.department"})})]}),J===z.fyH&&(0,E.jsx)(u.Z,{value:ee,onChange:te,style:{width:150},placeholder:a.formatMessage({id:"bi.ticket.filter.agent"}),allowClear:!0,children:null===(e=ce.data)||void 0===e||null===(e=e.content)||void 0===e?void 0:e.map((function(e){return(0,E.jsx)(A,{value:e.uid,children:i(e.nickname)},e.uid)}))}),J===z.nYM&&(0,E.jsx)(u.Z,{value:ne,onChange:se,style:{width:150},placeholder:a.formatMessage({id:"bi.ticket.filter.department"}),allowClear:!0,children:null===(t=ue.data)||void 0===t||null===(t=t.content)||void 0===t?void 0:t.map((function(e){return(0,E.jsx)(A,{value:e.uid,children:i(e.name)},e.uid)}))}),(0,E.jsx)(v.ZP,{type:"primary",icon:(0,E.jsx)(y.Z,{}),onClick:function(){return we()},children:(0,E.jsx)(Z.FormattedMessage,{id:"bi.common.refresh"})}),(0,E.jsx)(v.ZP,{type:"default",onClick:function(){T.yw.warning("TODO: 待实现导出功能")},children:a.formatMessage({id:"bi.ticket.filter.export"})})]})]})})}),(0,E.jsxs)(k.Z,{gutter:16,style:{marginBottom:"24px"},children:[(0,E.jsx)(p.Z,{span:6,children:(0,E.jsx)(f.Z,{children:(0,E.jsx)(h.Z,{title:a.formatMessage({id:"bi.ticket.card.totalTickets"}),value:(null==ve?void 0:ve.totalTickets)||0,prefix:(0,E.jsx)(b.Z,{}),valueStyle:{color:"#3f8600"}})})}),(0,E.jsx)(p.Z,{span:6,children:(0,E.jsx)(f.Z,{children:(0,E.jsx)(h.Z,{title:a.formatMessage({id:"bi.ticket.card.resolutionRate"}),value:null!=ve&&ve.totalTickets?Math.round(ve.resolvedTickets/ve.totalTickets*100):0,prefix:(0,E.jsx)(M.Z,{}),valueStyle:{color:"#1890ff"},suffix:a.formatMessage({id:"bi.ticket.unit.percent"})})})}),(0,E.jsx)(p.Z,{span:6,children:(0,E.jsx)(f.Z,{children:(0,E.jsx)(h.Z,{title:a.formatMessage({id:"bi.ticket.card.satisfactionRate"}),value:(null==ve?void 0:ve.customerSatisfactionRate)||0,prefix:(0,E.jsx)(j.Z,{}),valueStyle:{color:"#722ed1"},suffix:a.formatMessage({id:"bi.ticket.unit.percent"})})})}),(0,E.jsx)(p.Z,{span:6,children:(0,E.jsx)(f.Z,{children:(0,E.jsx)(h.Z,{title:a.formatMessage({id:"bi.ticket.card.slaComplianceRate"}),value:(null==ve?void 0:ve.slaComplianceRate)||0,prefix:(0,E.jsx)(w.Z,{}),valueStyle:{color:"#eb2f96"},suffix:a.formatMessage({id:"bi.ticket.unit.percent"})})})})]}),(0,E.jsxs)(k.Z,{gutter:16,style:{marginBottom:"24px"},children:[(0,E.jsx)(p.Z,{span:12,children:(0,E.jsx)(f.Z,{title:a.formatMessage({id:"bi.ticket.workloadEfficiency"})})}),(0,E.jsx)(p.Z,{span:12,children:(0,E.jsx)(f.Z,{title:a.formatMessage({id:"bi.ticket.statusDistribution"})})})]}),(0,E.jsx)(f.Z,{title:"综合报表数据",loading:xe,children:(0,E.jsx)(x.Z,{columns:Re,dataSource:Ze,pagination:!1,size:"middle"})})]})}}}]);