mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-01-29 01:10:16 +00:00
1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[3954],{93689:function(e,t,i){i.d(t,{Z:function(){return l}});var a=i(77260),n=i(44194),r={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"},s=i(54183),c=function(e,t){return n.createElement(s.Z,(0,a.Z)({},e,{ref:t,icon:r}))};var l=n.forwardRef(c)},15722:function(e,t,i){i.d(t,{Z:function(){return l}});var a=i(77260),n=i(44194),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{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"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},s=i(54183),c=function(e,t){return n.createElement(s.Z,(0,a.Z)({},e,{ref:t,icon:r}))};var l=n.forwardRef(c)},90151:function(e,t,i){i.d(t,{Z:function(){return l}});var a=i(77260),n=i(44194),r={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"},s=i(54183),c=function(e,t){return n.createElement(s.Z,(0,a.Z)({},e,{ref:t,icon:r}))};var l=n.forwardRef(c)},84854:function(e,t,i){i.r(t);var a=i(90819),n=i.n(a),r=i(89933),s=i.n(r),c=i(45332),l=i.n(c),o=i(44194),d=i(62558),u=i(27904),f=i(88344),m=i(63628),h=i(79401),g=i(49616),k=i(32973),v=i(5780),x=i(78875),p=i(20228),y=i(65532),j=i(61155),b=i(80556),M=i(90151),w=i(15722),Z=i(48004),T=i(93689),Y=i(14870),D=i(67165),S=i(5025),z=i(34599),R=i(16698),C=i(94956),O=i(18751),B=i(5488),H=i(28977),E=i.n(H),F=i(99109),I=i(68020),L=i(31549),U=d.default.RangePicker,P=u.Z.Option;t.default=function(){var e,t,i=(0,Y.useIntl)(),a=(0,O.Z)().translateStringTranct,r=(0,o.useState)(E()().startOf("day")),c=l()(r,2),d=c[0],H=c[1],V=(0,o.useState)(E()().endOf("day")),W=l()(V,2),A=W[0],N=W[1],Q=(0,o.useState)("today"),q=l()(Q,2),G=q[0],_=q[1],J=(0,o.useState)(B.whQ),K=l()(J,2),X=K[0],$=K[1],ee=(0,o.useState)(),te=l()(ee,2),ie=te[0],ae=te[1],ne=(0,o.useState)(),re=l()(ne,2),se=re[0],ce=re[1],le=(0,z.u)((function(e){return e.currentOrg})),oe=(0,R.E)((function(e){return e})),de=oe.agentResult,ue=oe.setAgentResult,fe=(0,I.H)((function(e){return e})),me=fe.departmentResult,he=fe.setDepartmentResult,ge=(0,o.useState)(),ke=l()(ge,2),ve=ke[0],xe=ke[1],pe=(0,o.useState)(!1),ye=l()(pe,2),je=ye[0],be=ye[1],Me=[{label:(0,L.jsx)(Y.FormattedMessage,{id:"bi.ticket.timeRange.today"}),value:"today"},{label:(0,L.jsx)(Y.FormattedMessage,{id:"bi.ticket.timeRange.yesterday"}),value:"yesterday"},{label:(0,L.jsx)(Y.FormattedMessage,{id:"bi.ticket.timeRange.week"}),value:"week"},{label:(0,L.jsx)(Y.FormattedMessage,{id:"bi.ticket.timeRange.lastWeek"}),value:"lastWeek"},{label:(0,L.jsx)(Y.FormattedMessage,{id:"bi.ticket.timeRange.month"}),value:"month"},{label:(0,L.jsx)(Y.FormattedMessage,{id:"bi.ticket.timeRange.custom"}),value:"custom"}];(0,o.useEffect)((function(){if("custom"===G)H(d),N(A);else{var e=E()();"today"===G?(H(e),N(e)):"yesterday"===G?(H(e.subtract(1,"day")),N(e.subtract(1,"day"))):"week"===G?(H(e.startOf("week")),N(e.endOf("week"))):"lastWeek"===G?(H(e.subtract(1,"week").startOf("week")),N(e.subtract(1,"week").endOf("week"))):"month"===G&&(H(e.startOf("month")),N(e.endOf("month")))}}),[G]);var we=function(){var e=s()(n()().mark((function e(){var t,i;return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return S.yw.loading("loading"),t={pageNumber:0,pageSize:100,orgUid:null==le?void 0:le.uid},e.next=4,(0,F.dF)(t);case 4:200===(i=e.sent).code?(S.yw.destroy(),he(i),i.data.content.length>0&&ce(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=s()(n()().mark((function e(){var t,i;return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return S.yw.loading("loading"),t={pageNumber:0,pageSize:50,orgUid:null==le?void 0:le.uid},e.next=4,(0,C._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=s()(n()().mark((function e(){var t,a;return n()().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==A?void 0:A.format("YYYY-MM-DD"),departmentUid:se,assigneeUid:ie,orgUid:null==le?void 0:le.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(),xe(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(){we(),Ze()}),[]),(0,o.useEffect)((function(){Te()}),[X,ie,se]),(0,o.useEffect)((function(){Te()}),[d,A]);var Ye=[{key:"1",date:null==d?void 0:d.format("YYYY-MM-DD"),criticalTickets:(null==ve?void 0:ve.criticalTickets)||0,highTickets:(null==ve?void 0:ve.highTickets)||0,mediumTickets:(null==ve?void 0:ve.mediumTickets)||0,lowTickets:(null==ve?void 0:ve.lowTickets)||0,totalTickets:(null==ve?void 0:ve.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,L.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,L.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,L.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,L.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,L.jsx)(m.Z,{percent:e,size:"small",format:function(e){return"".concat(e,"%")}})}}];return(0,L.jsxs)("div",{style:{padding:"24px"},children:[(0,L.jsxs)("div",{style:{marginBottom:"24px"},children:[(0,L.jsx)("h2",{children:i.formatMessage({id:"bi.ticket.title.classification"})}),(0,L.jsxs)("p",{children:[i.formatMessage({id:"bi.ticket.description.classification"}),"today"===G&&(0,L.jsxs)("span",{style:{color:"#666",marginLeft:8},children:["(",d.format("YYYY-MM-DD"),")"]}),"yesterday"===G&&(0,L.jsxs)("span",{style:{color:"#666",marginLeft:8},children:["(",d.format("YYYY-MM-DD"),")"]}),("week"===G||"lastWeek"===G||"month"===G||"custom"===G)&&(0,L.jsxs)("span",{style:{color:"#666",marginLeft:8},children:["(",d.format("YYYY-MM-DD")," ~ ",A.format("YYYY-MM-DD"),")"]})]})]}),(0,L.jsx)(h.Z,{style:{marginBottom:16},children:(0,L.jsx)(g.Z,{direction:"vertical",style:{width:"100%"},children:(0,L.jsxs)(g.Z,{wrap:!0,style:{width:"100%",justifyContent:"space-between"},children:[(0,L.jsxs)(g.Z,{wrap:!0,children:[(0,L.jsx)(k.ZP.Group,{value:G,onChange:function(e){return _(e.target.value)},children:Me.map((function(e){return(0,L.jsx)(k.ZP.Button,{value:e.value,children:e.label},e.value)}))}),"custom"===G&&(0,L.jsx)(U,{value:[d,A],onChange:function(e){H(e[0]),N(e[1])}})]}),(0,L.jsxs)(g.Z,{wrap:!0,children:[(0,L.jsxs)(u.Z,{value:X,onChange:$,style:{width:120},placeholder:i.formatMessage({id:"bi.ticket.filter.type"}),children:[(0,L.jsx)(P,{value:B.whQ,children:i.formatMessage({id:"bi.ticket.filterType.organization"})}),(0,L.jsx)(P,{value:B.fyH,children:i.formatMessage({id:"bi.ticket.filterType.agent"})}),(0,L.jsx)(P,{value:B.nYM,children:i.formatMessage({id:"bi.ticket.filterType.department"})})]}),X===B.fyH&&(0,L.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,L.jsx)(P,{value:e.uid,children:a(e.nickname)},e.uid)}))}),X===B.nYM&&(0,L.jsx)(u.Z,{value:se,onChange:ce,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,L.jsx)(P,{value:e.uid,children:a(e.name)},e.uid)}))}),(0,L.jsx)(v.ZP,{type:"primary",icon:(0,L.jsx)(b.Z,{}),onClick:function(){return Te()},children:(0,L.jsx)(Y.FormattedMessage,{id:"bi.common.refresh"})})]})]})})}),(0,L.jsxs)(x.Z,{gutter:16,style:{marginBottom:"24px"},children:[(0,L.jsx)(p.Z,{span:6,children:(0,L.jsx)(h.Z,{children:(0,L.jsx)(y.Z,{title:i.formatMessage({id:"bi.ticket.card.totalTickets"}),value:(null==ve?void 0:ve.totalTickets)||0,prefix:(0,L.jsx)(M.Z,{}),valueStyle:{color:"#3f8600"}})})}),(0,L.jsx)(p.Z,{span:6,children:(0,L.jsx)(h.Z,{children:(0,L.jsx)(y.Z,{title:i.formatMessage({id:"bi.ticket.card.criticalTickets"}),value:(null==ve?void 0:ve.criticalTickets)||0,prefix:(0,L.jsx)(w.Z,{}),valueStyle:{color:"#ff4d4f"}})})}),(0,L.jsx)(p.Z,{span:6,children:(0,L.jsx)(h.Z,{children:(0,L.jsx)(y.Z,{title:i.formatMessage({id:"bi.ticket.card.highTickets"}),value:(null==ve?void 0:ve.highTickets)||0,prefix:(0,L.jsx)(Z.Z,{}),valueStyle:{color:"#fa8c16"}})})}),(0,L.jsx)(p.Z,{span:6,children:(0,L.jsx)(h.Z,{children:(0,L.jsx)(y.Z,{title:i.formatMessage({id:"bi.ticket.card.resolvedTickets"}),value:(null==ve?void 0:ve.resolvedTickets)||0,prefix:(0,L.jsx)(T.Z,{}),valueStyle:{color:"#52c41a"}})})})]}),(0,L.jsxs)(x.Z,{gutter:16,style:{marginBottom:"24px"},children:[(0,L.jsx)(p.Z,{span:12,children:(0,L.jsx)(h.Z,{title:i.formatMessage({id:"bi.ticket.priorityDistribution"})})}),(0,L.jsx)(p.Z,{span:12,children:(0,L.jsx)(h.Z,{title:i.formatMessage({id:"bi.ticket.resolutionTrend"})})})]}),(0,L.jsx)(h.Z,{title:"优先级详细数据",loading:je,children:(0,L.jsx)(j.Z,{columns:De,dataSource:Ye,pagination:!1,size:"middle"})})]})}}}]); |