Files
weiyu/deploy/server/admin/p__Dashboard__Bi__Ticket__Classification.2817c105.async.js
jack ning 4c7623244a update
2025-07-30 11:08:35 +08:00

1 line
9.3 KiB
JavaScript

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