Files
weiyu/deploy/server/admin/p__Dashboard__Bi__Ticket__Rating.a4b9bfd2.async.js
jack ning 2d3433f934 update
2025-07-31 17:51:48 +08:00

1 line
12 KiB
JavaScript

"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[1065],{16829:function(e,t,a){a.d(t,{Z:function(){return o}});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(5901),c=function(e,t){return n.createElement(r.Z,(0,i.Z)({},e,{ref:t,icon:s}))};var o=n.forwardRef(c)},33e3:function(e,t,a){a.d(t,{Z:function(){return o}});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(5901),c=function(e,t){return n.createElement(r.Z,(0,i.Z)({},e,{ref:t,icon:s}))};var o=n.forwardRef(c)},12201:function(e,t,a){a.d(t,{Z:function(){return o}});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(5901),c=function(e,t){return n.createElement(r.Z,(0,i.Z)({},e,{ref:t,icon:s}))};var o=n.forwardRef(c)},42298:function(e,t,a){a.r(t);var i=a(90819),n=a.n(i),s=a(89933),r=a.n(s),c=a(45332),o=a.n(c),l=a(44194),d=a(41123),u=a(34251),f=a(71373),m=a(63065),g=a(43413),v=a(10337),h=a(77407),k=a(5858),p=a(9248),x=a(14318),y=a(68525),b=a(35911),j=a(33e3),M=a(12201),w=a(16829),Z=a(14546),T=a(75699),Y=a(61628),R=a(31756),S=a(31881),D=a(76001),z=a(7999),C=a(30234),F=a(25191),H=a(28977),O=a.n(H),B=a(89295),E=a(54693),I=a(31549),A=d.default.RangePicker,L=u.Z.Option;t.default=function(){var e,t,a=(0,T.useIntl)(),i=(0,C.Z)().translateStringTranct,s=(0,l.useState)(O()().startOf("day")),c=o()(s,2),d=c[0],H=c[1],U=(0,l.useState)(O()().endOf("day")),P=o()(U,2),W=P[0],V=P[1],N=(0,l.useState)("today"),Q=o()(N,2),q=Q[0],G=Q[1],_=(0,l.useState)(F.whQ),J=o()(_,2),K=J[0],X=J[1],$=(0,l.useState)(),ee=o()($,2),te=ee[0],ae=ee[1],ie=(0,l.useState)(),ne=o()(ie,2),se=ne[0],re=ne[1],ce=(0,S.u)((function(e){return e.currentOrg})),oe=(0,D.E)((function(e){return e})),le=oe.agentResult,de=oe.setAgentResult,ue=(0,E.H)((function(e){return e})),fe=ue.departmentResult,me=ue.setDepartmentResult,ge=(0,l.useState)(),ve=o()(ge,2),he=ve[0],ke=ve[1],pe=(0,l.useState)(!1),xe=o()(pe,2),ye=xe[0],be=xe[1],je=[{label:(0,I.jsx)(T.FormattedMessage,{id:"bi.ticket.timeRange.today"}),value:"today"},{label:(0,I.jsx)(T.FormattedMessage,{id:"bi.ticket.timeRange.yesterday"}),value:"yesterday"},{label:(0,I.jsx)(T.FormattedMessage,{id:"bi.ticket.timeRange.week"}),value:"week"},{label:(0,I.jsx)(T.FormattedMessage,{id:"bi.ticket.timeRange.lastWeek"}),value:"lastWeek"},{label:(0,I.jsx)(T.FormattedMessage,{id:"bi.ticket.timeRange.month"}),value:"month"},{label:(0,I.jsx)(T.FormattedMessage,{id:"bi.ticket.timeRange.custom"}),value:"custom"}];(0,l.useEffect)((function(){if("custom"===q)H(d),V(W);else{var e=O()();"today"===q?(H(e),V(e)):"yesterday"===q?(H(e.subtract(1,"day")),V(e.subtract(1,"day"))):"week"===q?(H(e.startOf("week")),V(e.endOf("week"))):"lastWeek"===q?(H(e.subtract(1,"week").startOf("week")),V(e.subtract(1,"week").endOf("week"))):"month"===q&&(H(e.startOf("month")),V(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 R.yw.loading("loading"),t={pageNumber:0,pageSize:100,orgUid:null==ce?void 0:ce.uid},e.next=4,(0,B.dF)(t);case 4:200===(a=e.sent).code?(R.yw.destroy(),me(a),a.data.content.length>0&&re(a.data.content[0].uid)):(R.yw.destroy(),R.yw.error(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,a;return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return R.yw.loading("loading"),t={pageNumber:0,pageSize:50,orgUid:null==ce?void 0:ce.uid},e.next=4,(0,z._t)(t);case 4:200===(a=e.sent).code?(R.yw.destroy(),de(a),a.data.content.length>0&&ae(a.data.content[0].uid)):(R.yw.destroy(),R.yw.error(i(a.message)));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Ze=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 be(!0),e.prev=1,R.yw.loading("loading"),t={type:K,startDate:null==d?void 0:d.format("YYYY-MM-DD"),endDate:null==W?void 0:W.format("YYYY-MM-DD"),departmentUid:se,assigneeUid:te,orgUid:null==ce?void 0:ce.uid},e.next=6,(0,Y.AD)(t);case 6:i=e.sent,console.log("queryStatisticTicketByDate response:",i.data,t),200===i.code?(R.yw.destroy(),ke(i.data)):(R.yw.destroy(),R.yw.error(i.message)),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),R.yw.error(a.formatMessage({id:"ticket.message.operation.failed"}));case 14:return e.prev=14,be(!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(),we()}),[]),(0,l.useEffect)((function(){Ze()}),[K,te,se]),(0,l.useEffect)((function(){Ze()}),[d,W]);var Te=[{key:"1",date:null==d?void 0:d.format("YYYY-MM-DD"),totalTickets:(null==he?void 0:he.totalTickets)||0,satisfiedTickets:(null==he?void 0:he.satisfiedTickets)||0,unsatisfiedTickets:(null==he?void 0:he.unsatisfiedTickets)||0,satisfactionRate:(null==he?void 0:he.customerSatisfactionRate)||0,avgResponseTime:"".concat((null==he?void 0:he.averageFirstResponseTime)||0,"分钟")}],Ye=[{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.satisfiedTickets"}),dataIndex:"satisfiedTickets",key:"satisfiedTickets",render:function(e,t){return(0,I.jsx)(f.Z,{percent:t.totalTickets>0?Math.round(e/t.totalTickets*100):0,size:"small",format:function(t){return"".concat(e," (").concat(t,"%)")}})}},{title:a.formatMessage({id:"bi.ticket.table.unsatisfiedTickets"}),dataIndex:"unsatisfiedTickets",key:"unsatisfiedTickets",render:function(e,t){return(0,I.jsx)(f.Z,{percent:t.totalTickets>0?Math.round(e/t.totalTickets*100):0,size:"small",format:function(t){return"".concat(e," (").concat(t,"%)")}})}},{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.avgResponseTime"}),dataIndex:"avgResponseTime",key:"avgResponseTime",render:function(e){return"".concat(e).concat(a.formatMessage({id:"bi.ticket.unit.minute"}))}}];return(0,I.jsxs)("div",{style:{padding:"24px"},children:[(0,I.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,I.jsx)("h2",{children:a.formatMessage({id:"bi.ticket.title.rating"})}),(0,I.jsxs)("p",{children:[a.formatMessage({id:"bi.ticket.description.rating"}),"today"===q&&(0,I.jsxs)("span",{style:{color:"#666",marginLeft:8},children:["(",d.format("YYYY-MM-DD"),")"]}),"yesterday"===q&&(0,I.jsxs)("span",{style:{color:"#666",marginLeft:8},children:["(",d.format("YYYY-MM-DD"),")"]}),("week"===q||"lastWeek"===q||"month"===q||"custom"===q)&&(0,I.jsxs)("span",{style:{color:"#666",marginLeft:8},children:["(",d.format("YYYY-MM-DD")," ~ ",W.format("YYYY-MM-DD"),")"]})]})]}),(0,I.jsx)(m.Z,{style:{marginBottom:16},children:(0,I.jsx)(g.Z,{direction:"vertical",style:{width:"100%"},children:(0,I.jsxs)(g.Z,{wrap:!0,style:{width:"100%",justifyContent:"space-between"},children:[(0,I.jsxs)(g.Z,{wrap:!0,children:[(0,I.jsx)(v.ZP.Group,{value:q,onChange:function(e){return G(e.target.value)},children:je.map((function(e){return(0,I.jsx)(v.ZP.Button,{value:e.value,children:e.label},e.value)}))}),"custom"===q&&(0,I.jsx)(A,{value:[d,W],onChange:function(e){H(e[0]),V(e[1])}})]}),(0,I.jsxs)(g.Z,{wrap:!0,children:[(0,I.jsxs)(u.Z,{value:K,onChange:X,style:{width:120},placeholder:a.formatMessage({id:"bi.ticket.filter.type"}),children:[(0,I.jsx)(L,{value:F.whQ,children:a.formatMessage({id:"bi.ticket.filterType.organization"})}),(0,I.jsx)(L,{value:F.fyH,children:a.formatMessage({id:"bi.ticket.filterType.agent"})}),(0,I.jsx)(L,{value:F.nYM,children:a.formatMessage({id:"bi.ticket.filterType.department"})})]}),K===F.fyH&&(0,I.jsx)(u.Z,{value:te,onChange:ae,style:{width:150},placeholder:a.formatMessage({id:"bi.ticket.filter.agent"}),allowClear:!0,children:null===(e=le.data)||void 0===e||null===(e=e.content)||void 0===e?void 0:e.map((function(e){return(0,I.jsx)(L,{value:e.uid,children:i(e.nickname)},e.uid)}))}),K===F.nYM&&(0,I.jsx)(u.Z,{value:se,onChange:re,style:{width:150},placeholder:a.formatMessage({id:"bi.ticket.filter.department"}),allowClear:!0,children:null===(t=fe.data)||void 0===t||null===(t=t.content)||void 0===t?void 0:t.map((function(e){return(0,I.jsx)(L,{value:e.uid,children:i(e.name)},e.uid)}))}),(0,I.jsx)(h.ZP,{type:"primary",icon:(0,I.jsx)(b.Z,{}),onClick:function(){return Ze()},children:(0,I.jsx)(T.FormattedMessage,{id:"bi.common.refresh"})})]})]})})}),(0,I.jsxs)(k.Z,{gutter:16,style:{marginBottom:"24px"},children:[(0,I.jsx)(p.Z,{span:6,children:(0,I.jsx)(m.Z,{children:(0,I.jsx)(x.Z,{title:a.formatMessage({id:"bi.ticket.card.totalTickets"}),value:(null==he?void 0:he.totalTickets)||0,prefix:(0,I.jsx)(j.Z,{}),valueStyle:{color:"#3f8600"}})})}),(0,I.jsx)(p.Z,{span:6,children:(0,I.jsx)(m.Z,{children:(0,I.jsx)(x.Z,{title:a.formatMessage({id:"bi.ticket.card.satisfactionRate"}),value:(null==he?void 0:he.customerSatisfactionRate)||0,prefix:(0,I.jsx)(M.Z,{}),valueStyle:{color:"#1890ff"},suffix:a.formatMessage({id:"bi.ticket.unit.percent"})})})}),(0,I.jsx)(p.Z,{span:6,children:(0,I.jsx)(m.Z,{children:(0,I.jsx)(x.Z,{title:a.formatMessage({id:"bi.ticket.table.satisfiedTickets"}),value:(null==he?void 0:he.satisfiedTickets)||0,prefix:(0,I.jsx)(w.Z,{}),valueStyle:{color:"#722ed1"}})})}),(0,I.jsx)(p.Z,{span:6,children:(0,I.jsx)(m.Z,{children:(0,I.jsx)(x.Z,{title:a.formatMessage({id:"bi.ticket.table.avgResponseTime"}),value:(null==he?void 0:he.averageFirstResponseTime)||0,prefix:(0,I.jsx)(Z.Z,{}),valueStyle:{color:"#eb2f96"},suffix:a.formatMessage({id:"bi.ticket.unit.minute"})})})})]}),(0,I.jsxs)(k.Z,{gutter:16,style:{marginBottom:"24px"},children:[(0,I.jsx)(p.Z,{span:12,children:(0,I.jsx)(m.Z,{title:a.formatMessage({id:"bi.ticket.satisfactionDistribution"})})}),(0,I.jsx)(p.Z,{span:12,children:(0,I.jsx)(m.Z,{title:a.formatMessage({id:"bi.ticket.satisfactionTrend"})})})]}),(0,I.jsx)(m.Z,{title:"满意度详细数据",loading:ye,children:(0,I.jsx)(y.Z,{columns:Ye,dataSource:Te,pagination:!1,size:"middle"})})]})}}}]);