Files
weiyu/deploy/server/admin/p__Dashboard__Ai__Statistic__index.a24ef52a.async.js
jack ning c560b5b43d update
2025-08-09 16:03:42 +08:00

1 line
24 KiB
JavaScript

"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[524],{67253:function(t,e,s){s.r(e);var i=s(90819),a=s.n(i),n=s(89933),r=s.n(n),o=s(45332),d=s.n(o),c=s(44194),u=s(70877),l=s(69466),g=s(15716),x=s(31218),p=s(12722),f=s(20374),m=s(13252),j=s(55599),h=s(29507),y=s(4959),v=s(89323),Z=s(23377),k=s(8421),M=s(48430),F=s(94011),w=s(35911),R=s(60107),b=s(80597),I=s(65794),q=s(13883),A=s(4108),S=s(17137),P=s(11575),W=s(96108),C=s(59318),Y=s(49373),D=s(86559),T=s(86905),U=s(83316),O=s(97043),z=s(88633),E=s(67794),K=s(89520),B=s(84065),H=s(68279),Q=s(2622),L=s(28977),G=s.n(L),J=s(90216),N=s(32157),$=s(31549),_=u.default.RangePicker,V=l.Z.Option;e.default=function(){var t,e,s=(0,C.useIntl)(),i=(0,E.Z)().translateStringTranct,n=(0,c.useState)(G()().startOf("day")),o=d()(n,2),u=o[0],L=o[1],X=(0,c.useState)(G()().endOf("day")),tt=d()(X,2),et=tt[0],st=tt[1],it=(0,c.useState)("today"),at=d()(it,2),nt=at[0],rt=at[1],ot=(0,c.useState)(Q.whQ),dt=d()(ot,2),ct=dt[0],ut=dt[1],lt=(0,c.useState)(),gt=d()(lt,2),xt=gt[0],pt=gt[1],ft=(0,c.useState)(),mt=d()(ft,2),jt=mt[0],ht=mt[1],yt=(0,K.u)((function(t){return t.currentOrg})),vt=(0,B.E)((function(t){return t})),Zt=vt.agentResult,kt=vt.setAgentResult,Mt=(0,H.$)((function(t){return t})),Ft=Mt.workgroupResult,wt=Mt.setWorkgroupResult,Rt=(0,c.useState)(),bt=d()(Rt,2),It=(bt[0],bt[1]),qt=(0,c.useState)(Q.OwA),At=d()(qt,2),St=At[0],Pt=At[1],Wt=(0,c.useState)(!1),Ct=d()(Wt,2),Yt=(Ct[0],Ct[1]),Dt=[{label:(0,$.jsx)(C.FormattedMessage,{id:"ticket.statistic.timeRange.today"}),value:"today"},{label:(0,$.jsx)(C.FormattedMessage,{id:"ticket.statistic.timeRange.yesterday"}),value:"yesterday"},{label:(0,$.jsx)(C.FormattedMessage,{id:"ticket.statistic.timeRange.week"}),value:"week"},{label:(0,$.jsx)(C.FormattedMessage,{id:"ticket.statistic.timeRange.lastWeek"}),value:"lastWeek"},{label:(0,$.jsx)(C.FormattedMessage,{id:"ticket.statistic.timeRange.month"}),value:"month"},{label:(0,$.jsx)(C.FormattedMessage,{id:"ticket.statistic.timeRange.custom"}),value:"custom"}],Tt=12580,Ut=85.6,Ot=25600,zt=78.9,Et=[{date:"2024-01-01",type:s.formatMessage({id:"ai.statistic.trend.total"}),value:1200},{date:"2024-01-02",type:s.formatMessage({id:"ai.statistic.trend.total"}),value:1300},{date:"2024-01-01",type:s.formatMessage({id:"ai.statistic.trend.resolved"}),value:1e3},{date:"2024-01-02",type:s.formatMessage({id:"ai.statistic.trend.resolved"}),value:1100}],Kt=(s.formatMessage({id:"ai.statistic.intent.product"}),s.formatMessage({id:"ai.statistic.intent.technical"}),s.formatMessage({id:"ai.statistic.intent.account"}),s.formatMessage({id:"ai.statistic.intent.other"}),.8),Bt=2.5,Ht=256,Qt=1580.5,Lt=[{key:"1",question:s.formatMessage({id:"ai.statistic.question.password"}),count:256,solved:245},{key:"2",question:s.formatMessage({id:"ai.statistic.question.upgrade"}),count:198,solved:180},{key:"3",question:s.formatMessage({id:"ai.statistic.question.price"}),count:156,solved:156}],Gt={totalArticles:1580,hitRate:78.5,updateFrequency:s.formatMessage({id:"ai.statistic.frequency.daily"}),unmatchedCount:125},Jt=[{depth:s.formatMessage({id:"ai.statistic.depth.one"}),count:3500},{depth:s.formatMessage({id:"ai.statistic.depth.two"}),count:2800},{depth:s.formatMessage({id:"ai.statistic.depth.three"}),count:1500},{depth:s.formatMessage({id:"ai.statistic.depth.more"}),count:800}],Nt=(s.formatMessage({id:"ai.statistic.cost.api"}),s.formatMessage({id:"ai.statistic.cost.token"}),s.formatMessage({id:"ai.statistic.cost.storage"}),[{key:"u1",question:s.formatMessage({id:"ai.statistic.question.complex"}),count:45,category:s.formatMessage({id:"ai.statistic.category.product"})},{key:"u2",question:s.formatMessage({id:"ai.statistic.question.unclear"}),count:38,category:s.formatMessage({id:"ai.statistic.category.technical"})}]),$t=[{type:s.formatMessage({id:"ai.statistic.feedback.positive"}),value:75},{type:s.formatMessage({id:"ai.statistic.feedback.neutral"}),value:15},{type:s.formatMessage({id:"ai.statistic.feedback.negative"}),value:10}],_t={rate:15.5,reasons:[{type:s.formatMessage({id:"ai.statistic.abandon.timeout"}),count:120},{type:s.formatMessage({id:"ai.statistic.abandon.userQuit"}),count:85}]},Vt={rate:15.8,reasons:[{type:s.formatMessage({id:"ai.statistic.transfer.complex"}),count:156},{type:s.formatMessage({id:"ai.statistic.transfer.emotion"}),count:89},{type:s.formatMessage({id:"ai.statistic.transfer.request"}),count:67}],trend:[{date:"2024-01-01",value:16.2},{date:"2024-01-02",value:15.8}]},Xt={overall:92.5,byCategory:[{key:"intent-1",category:s.formatMessage({id:"ai.statistic.intent.product"}),accuracy:94.2,samples:1200},{key:"intent-2",category:s.formatMessage({id:"ai.statistic.intent.technical"}),accuracy:91.8,samples:800}]},te=[{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.similar.group"}),dataIndex:"group",key:"group"},{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.similar.questions"}),dataIndex:"questions",key:"questions",render:function(t){return(0,$.jsx)(g.Z,{size:"small",dataSource:t,renderItem:function(t,e){return(0,$.jsx)(g.Z.Item,{children:t},"question-".concat(e))}})}},{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.similar.count"}),dataIndex:"count",key:"count",sorter:function(t,e){return t.count-e.count}},{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.similar.similarity"}),dataIndex:"similarity",key:"similarity",render:function(t){return(0,$.jsx)(x.Z,{percent:100*t,size:"small",status:t>.9?"success":"normal"})}},{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.table.operation"}),key:"action",render:function(){return(0,$.jsxs)(p.Z,{children:[(0,$.jsx)(f.ZP,{type:"link",children:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.similar.merge"})}),(0,$.jsx)(f.ZP,{type:"link",children:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.similar.split"})})]})}}];(0,c.useEffect)((function(){if("custom"===nt)L(u),st(et),Pt(Q.dd4);else{var t=G()();"today"===nt?(L(t),st(t),Pt(Q.OwA)):"yesterday"===nt?(L(t.subtract(1,"day")),st(t.subtract(1,"day")),Pt(Q.OwA)):"week"===nt?(L(t.startOf("week")),st(t.endOf("week")),Pt(Q.dd4)):"lastWeek"===nt?(L(t.subtract(1,"week").startOf("week")),st(t.subtract(1,"week").endOf("week")),Pt(Q.dd4)):"month"===nt&&(L(t.startOf("month")),st(t.endOf("month")),Pt(Q.dd4))}}),[nt]);var ee=function(){var t=r()(a()().mark((function t(){var e,s;return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return m.ZP.loading("loading"),e={pageNumber:0,pageSize:50,orgUid:null==yt?void 0:yt.uid},t.next=4,(0,z.LE)(e);case 4:s=t.sent,console.log("fetchAllWorkgroups: ",s),200===s.code?(m.ZP.destroy(),wt(s),s.data.content.length>0&&ht(s.data.content[0].uid)):(m.ZP.destroy(),m.ZP.error(s.message));case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),se=function(){var t=r()(a()().mark((function t(){var e,s;return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return m.ZP.loading("loading"),e={pageNumber:0,pageSize:50,orgUid:null==yt?void 0:yt.uid},t.next=4,(0,O._t)(e);case 4:s=t.sent,console.log("fetchAllAgents: ",s),200===s.code?(m.ZP.destroy(),kt(s),s.data.content.length>0&&pt(s.data.content[0].uid)):(m.ZP.destroy(),m.ZP.error(i(s.message))),console.log("queryAllAgents response",s);case 8:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ie=function(){var t=r()(a()().mark((function t(){var e,i;return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Yt(!0),t.prev=1,m.ZP.loading("loading"),e={type:ct,startDate:null==u?void 0:u.format("YYYY-MM-DD 00:00:00"),endDate:null==et?void 0:et.format("YYYY-MM-DD 23:59:59"),workgroupUid:jt,agentUid:xt,orgUid:null==yt?void 0:yt.uid},t.next=6,(0,J.RU)(e);case 6:i=t.sent,console.log("queryStatisticServicesByOrg response",i,e),200===i.code?(m.ZP.destroy(),It(i.data)):(m.ZP.destroy(),m.ZP.error(i.message)),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),m.ZP.error(s.formatMessage({id:"ticket.message.operation.failed"}));case 14:return t.prev=14,Yt(!1),t.finish(14);case 17:case"end":return t.stop()}}),t,null,[[1,11,14,17]])})));return function(){return t.apply(this,arguments)}}(),ae=function(){var t=r()(a()().mark((function t(){var e,s;return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return m.ZP.loading("loading"),e={type:ct,startDate:null==u?void 0:u.format("YYYY-MM-DD 00:00:00"),endDate:null==et?void 0:et.format("YYYY-MM-DD 23:59:59"),workgroupUid:jt,agentUid:xt,orgUid:null==yt?void 0:yt.uid},t.next=4,(0,J.RU)(e);case 4:s=t.sent,console.log("queryStatisticServicesByOrg response",s,e),200===s.code?m.ZP.destroy():(m.ZP.destroy(),m.ZP.error(s.message));case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return(0,c.useEffect)((function(){ee(),se()}),[]),(0,c.useEffect)((function(){ie()}),[ct,xt,jt]),(0,c.useEffect)((function(){ae()}),[St,ct,xt,jt]),(0,c.useEffect)((function(){ie()}),[u,et]),(0,$.jsxs)("div",{style:{padding:16},children:[(0,$.jsx)(j.Z,{style:{marginBottom:16},children:(0,$.jsxs)(p.Z,{direction:"vertical",style:{width:"100%"},children:[(0,$.jsxs)(p.Z,{wrap:!0,children:[(0,$.jsx)(h.ZP.Group,{value:nt,onChange:function(t){return rt(t.target.value)},children:Dt.map((function(t){return(0,$.jsx)(h.ZP.Button,{value:t.value,children:t.label},t.value)}))}),"custom"===nt&&(0,$.jsx)(_,{value:[u,et],onChange:function(t){L(t[0]),st(t[1])}})]}),(0,$.jsxs)(p.Z,{wrap:!0,children:[(0,$.jsxs)(l.Z,{placeholder:(0,$.jsx)(C.FormattedMessage,{id:"ticket.statistic.filter.type"}),style:{width:200},value:ct,onChange:function(t){return ut(t)},children:[(0,$.jsx)(V,{value:Q.whQ,children:(0,$.jsx)(C.FormattedMessage,{id:"i18n.all"})}),(0,$.jsx)(V,{value:Q.fyH,children:(0,$.jsx)(C.FormattedMessage,{id:"ticket.statistic.filter.agent"})}),(0,$.jsx)(V,{value:Q.v5D,children:(0,$.jsx)(C.FormattedMessage,{id:"ticket.statistic.filter.workgroup"})})]}),ct===Q.fyH&&(0,$.jsx)(l.Z,{placeholder:(0,$.jsx)(C.FormattedMessage,{id:"ticket.statistic.filter.agent"}),style:{width:200},value:xt,onChange:function(t){return pt(t)},children:null===(t=Zt.data)||void 0===t||null===(t=t.content)||void 0===t?void 0:t.map((function(t){return(0,$.jsx)(V,{value:null==t?void 0:t.uid,children:i(null==t?void 0:t.nickname)},null==t?void 0:t.uid)}))}),ct===Q.v5D&&(0,$.jsx)(l.Z,{placeholder:(0,$.jsx)(C.FormattedMessage,{id:"ticket.statistic.filter.department"}),style:{width:200},value:jt,onChange:function(t){return ht(t)},children:null===(e=Ft.data)||void 0===e||null===(e=e.content)||void 0===e?void 0:e.map((function(t){return(0,$.jsx)(V,{value:null==t?void 0:t.uid,children:i(null==t?void 0:t.nickname)},null==t?void 0:t.uid)}))}),(0,$.jsx)(y.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ticket.statistic.filter.export"}),children:(0,$.jsx)(f.ZP,{icon:(0,$.jsx)(F.Z,{}),onClick:function(){var t=localStorage.getItem(Q.LA8);window.open((0,N.kG)()+"/api/v1/statistic/export?"+new URLSearchParams({type:ct,startDate:null==u?void 0:u.format("YYYY-MM-DD 00:00:00"),endDate:null==et?void 0:et.format("YYYY-MM-DD 23:59:59"),workgroupUid:jt,agentUid:xt,orgUid:null==yt?void 0:yt.uid,accessToken:t||""}).toString())},children:(0,$.jsx)(C.FormattedMessage,{id:"ticket.statistic.filter.export"})})}),(0,$.jsx)(y.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ticket.statistic.filter.refresh"}),children:(0,$.jsx)(f.ZP,{icon:(0,$.jsx)(w.Z,{}),onClick:function(){return ie()},children:(0,$.jsx)(C.FormattedMessage,{id:"ticket.statistic.filter.refresh"})})}),!1]})]})}),(0,$.jsxs)(v.Z,{gutter:[16,16],children:[(0,$.jsx)(Z.Z,{span:6,children:(0,$.jsx)(j.Z,{children:(0,$.jsx)(k.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.totalSessions"}),value:Tt,prefix:(0,$.jsx)(R.Z,{}),suffix:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.unit.count"})})})}),(0,$.jsx)(Z.Z,{span:6,children:(0,$.jsx)(j.Z,{children:(0,$.jsx)(k.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.resolveRate"}),value:Ut,prefix:(0,$.jsx)(b.Z,{}),suffix:"%"})})}),(0,$.jsx)(Z.Z,{span:6,children:(0,$.jsx)(j.Z,{children:(0,$.jsx)(k.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.apiCalls"}),value:Ot,prefix:(0,$.jsx)(I.Z,{}),suffix:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.unit.count"})})})}),(0,$.jsx)(Z.Z,{span:6,children:(0,$.jsx)(j.Z,{children:(0,$.jsx)(k.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.kbCoverage"}),value:zt,prefix:(0,$.jsx)(q.Z,{}),suffix:"%"})})})]}),(0,$.jsxs)(v.Z,{gutter:[16,16],style:{marginTop:16},children:[(0,$.jsx)(Z.Z,{span:6,children:(0,$.jsx)(j.Z,{children:(0,$.jsx)(k.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.avgResponseTime"}),value:Kt,prefix:(0,$.jsx)(I.Z,{}),suffix:"s"})})}),(0,$.jsx)(Z.Z,{span:6,children:(0,$.jsx)(j.Z,{children:(0,$.jsx)(k.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.errorRate"}),value:Bt,prefix:(0,$.jsx)(A.Z,{}),suffix:"%"})})}),(0,$.jsx)(Z.Z,{span:6,children:(0,$.jsx)(j.Z,{children:(0,$.jsx)(k.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.tokenCost"}),value:Qt,prefix:(0,$.jsx)(S.Z,{}),precision:2})})}),(0,$.jsx)(Z.Z,{span:6,children:(0,$.jsx)(j.Z,{children:(0,$.jsx)(k.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.concurrentUsers"}),value:Ht,prefix:(0,$.jsx)(P.Z,{})})})})]}),(0,$.jsxs)(v.Z,{gutter:[16,16],style:{marginTop:16},children:[(0,$.jsx)(Z.Z,{span:12,children:(0,$.jsx)(j.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.trend"}),children:(0,$.jsx)(Y.Z,{data:Et,xField:"date",yField:"value",seriesField:"type",animation:{appear:{duration:1e3}}})})}),(0,$.jsx)(Z.Z,{span:12,children:(0,$.jsx)(j.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.intent"}),children:(0,$.jsx)(D.Z,{})})})]}),(0,$.jsxs)(v.Z,{gutter:[16,16],style:{marginTop:16},children:[(0,$.jsx)(Z.Z,{span:12,children:(0,$.jsx)(j.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.sessionDepth"}),extra:(0,$.jsx)(y.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.sessionDepth.tip"}),children:(0,$.jsx)(W.Z,{})}),children:(0,$.jsx)(T.Z,{data:Jt,xField:"depth",yField:"count",label:{position:"top"}})})}),(0,$.jsx)(Z.Z,{span:12,children:(0,$.jsx)(j.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.satisfaction"}),children:(0,$.jsx)(Y.Z,{data:[{date:"2024-01-01",value:4.2},{date:"2024-01-02",value:4.3}],xField:"date",yField:"value",yAxis:{min:0,max:5}})})})]}),(0,$.jsx)(j.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.hotQuestions"}),style:{marginTop:16},children:(0,$.jsx)(M.Z,{dataSource:Lt,columns:[{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.question"}),dataIndex:"question",key:"question"},{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.askCount"}),dataIndex:"count",key:"count",sorter:function(t,e){return t.count-e.count}},{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.solvedCount"}),dataIndex:"solved",key:"solved"},{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.solveRate"}),key:"solveRate",render:function(t,e){return(0,$.jsx)(x.Z,{percent:Math.round(e.solved/e.count*100),size:"small"})}}],pagination:{pageSize:5},rowKey:"key"})}),(0,$.jsx)(j.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.kbase"}),style:{marginTop:16},children:(0,$.jsxs)(v.Z,{gutter:[16,16],children:[(0,$.jsx)(Z.Z,{span:6,children:(0,$.jsx)(k.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.kbase.total"}),value:Gt.totalArticles,suffix:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.unit.article"})})}),(0,$.jsx)(Z.Z,{span:6,children:(0,$.jsx)(k.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.kbase.hitRate"}),value:Gt.hitRate,suffix:"%"})}),(0,$.jsx)(Z.Z,{span:6,children:(0,$.jsx)(k.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.kbase.update"}),value:Gt.updateFrequency})}),(0,$.jsx)(Z.Z,{span:6,children:(0,$.jsx)(k.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.kbase.unmatched"}),value:Gt.unmatchedCount,suffix:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.unit.question"})})})]})}),(0,$.jsx)(j.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.cost"}),style:{marginTop:16},children:(0,$.jsxs)(v.Z,{gutter:[16,16],children:[(0,$.jsx)(Z.Z,{span:12,children:(0,$.jsx)(j.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.cost.trend"}),children:(0,$.jsx)(Y.Z,{data:[{date:"2024-01-01",type:"API",value:580},{date:"2024-01-02",type:"API",value:620},{date:"2024-01-01",type:"Token",value:380},{date:"2024-01-02",type:"Token",value:420}],xField:"date",yField:"value",seriesField:"type"})})}),(0,$.jsx)(Z.Z,{span:12,children:(0,$.jsx)(j.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.cost.distribution"}),children:(0,$.jsx)(D.Z,{})})})]})}),(0,$.jsx)(j.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.peakHour.title"}),style:{marginTop:16},children:(0,$.jsx)(U.Z,{data:[{hour:"00",day:"Mon",value:30},{hour:"01",day:"Mon",value:25}],xField:"hour",yField:"day",colorField:"value",tooltip:{formatter:function(t){return{name:s.formatMessage({id:"ai.statistic.peakHour.sessions"}),value:t.value}}}})}),(0,$.jsx)(j.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.unsolved.title"}),style:{marginTop:16},children:(0,$.jsx)(M.Z,{dataSource:Nt,columns:[{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.question"}),dataIndex:"question",key:"question"},{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.category"}),dataIndex:"category",key:"category"},{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.count"}),dataIndex:"count",key:"count",sorter:function(t,e){return t.count-e.count}}],pagination:{pageSize:5},rowKey:"key"})}),(0,$.jsx)(j.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.feedback.title"}),style:{marginTop:16},children:(0,$.jsxs)(v.Z,{gutter:[16,16],children:[(0,$.jsx)(Z.Z,{span:12,children:(0,$.jsx)(D.Z,{})}),(0,$.jsx)(Z.Z,{span:12,children:(0,$.jsx)(g.Z,{dataSource:$t,renderItem:function(t,e){return(0,$.jsx)(g.Z.Item,{children:(0,$.jsx)(k.Z,{title:t.type,value:t.value,suffix:"%"})},"feedback-".concat(e))}})})]})}),(0,$.jsx)(j.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.abandon.title"}),style:{marginTop:16},children:(0,$.jsxs)(v.Z,{gutter:[16,16],children:[(0,$.jsx)(Z.Z,{span:8,children:(0,$.jsx)(k.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.abandon.rate"}),value:_t.rate,suffix:"%",valueStyle:{color:_t.rate>20?"#cf1322":"#3f8600"}})}),(0,$.jsx)(Z.Z,{span:16,children:(0,$.jsx)(T.Z,{data:_t.reasons,xField:"type",yField:"count",label:{position:"top"}})})]})}),(0,$.jsx)(j.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.similar.title"}),style:{marginTop:16},children:(0,$.jsx)(M.Z,{dataSource:[{key:"s1",group:"账户登录问题",questions:["无法登录","登录失败","登录报错"],count:156,similarity:.85}],columns:te,rowKey:"key"})}),(0,$.jsx)(j.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.repeat.title"}),style:{marginTop:16},children:(0,$.jsx)(M.Z,{dataSource:[{key:"r1",userId:"user123",question:"如何修改密码",frequency:"每日",lastTime:"2024-01-23 14:30",totalTimes:8}],columns:[{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.repeat.user"}),dataIndex:"userId",key:"userId"}],rowKey:"key"})}),(0,$.jsx)(j.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.coverage.title"}),style:{marginTop:16},children:(0,$.jsx)(v.Z,{gutter:[16,16],children:[{domain:"产品功能",points:120,covered:98,missing:["高级配置","自定义功能"]}].map((function(t,e){return(0,$.jsx)(Z.Z,{span:8,children:(0,$.jsxs)(j.Z,{children:[(0,$.jsx)(k.Z,{title:t.domain,value:Math.round(t.covered/t.points*100),suffix:"%"}),(0,$.jsx)(x.Z,{percent:Math.round(t.covered/t.points*100),status:t.covered/t.points<.8?"exception":"success"})]})},"coverage-".concat(e))}))})}),(0,$.jsx)(j.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.transfer.title"}),style:{marginTop:16},children:(0,$.jsxs)(v.Z,{gutter:[16,16],children:[(0,$.jsx)(Z.Z,{span:8,children:(0,$.jsx)(k.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.transfer.rate"}),value:Vt.rate,suffix:"%",valueStyle:{color:Vt.rate>20?"#cf1322":"#3f8600"}})}),(0,$.jsx)(Z.Z,{span:16,children:(0,$.jsx)(T.Z,{data:Vt.reasons,xField:"type",yField:"count",label:{position:"top"}})})]})}),(0,$.jsx)(j.Z,{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.intent.accuracy.title"}),style:{marginTop:16},children:(0,$.jsxs)(v.Z,{gutter:[16,16],children:[(0,$.jsx)(Z.Z,{span:6}),(0,$.jsx)(Z.Z,{span:18,children:(0,$.jsx)(M.Z,{dataSource:Xt.byCategory,columns:[{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.intent.category"}),dataIndex:"category",key:"category"},{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.intent.accuracy"}),dataIndex:"accuracy",key:"accuracy",render:function(t){return(0,$.jsx)(x.Z,{percent:t,size:"small"})}},{title:(0,$.jsx)(C.FormattedMessage,{id:"ai.statistic.intent.samples"}),dataIndex:"samples",key:"samples"}],pagination:!1,rowKey:"key"})})]})})]})}},84065:function(t,e,s){s.d(e,{E:function(){return l}});var i=s(73193),a=s.n(i),n=s(76711),r=s.n(n),o=s(2622),d=s(16894),c=s(45034),u=s(47401),l=(0,d.Ue)()((0,c.mW)((0,c.tJ)((0,u.n)((function(t,e){return{agentResult:{data:{content:[]}},currentAgent:{uid:"",orgUid:""},insertAgent:function(e){t((function(t){t.agentResult.data.content.unshift(e)}))},updateAgent:function(e){t((function(t){var s=t.agentResult.data.content,i=s.findIndex((function(t){return t.uid===e.uid}));-1!==i?s[i]=e:console.warn("Agent with uid ".concat(e.uid," not found."))}))},setAgentResult:function(s){var i;(t({agentResult:s}),""===e().currentAgent.uid)&&((null===(i=s.data)||void 0===i||null===(i=i.content)||void 0===i?void 0:i.length)>0&&t({currentAgent:s.data.content[0]}))},setCurrentAgent:function(s){var i=e().agentResult.data.content,n=i.findIndex((function(t){return t.uid===s.uid}));if(-1!==n){var o=[].concat(r()(i.slice(0,n)),[s],r()(i.slice(n+1))),d=a()(a()({},e().agentResult),{},{data:{content:o}});t({agentResult:d,currentAgent:s})}else console.warn("Agent with the specified uid not found."),t({currentAgent:s})},deleteCurrentAgent:function(s){var i=e().agentResult.data.content,n=i.findIndex((function(t){return t.uid===s}));-1!==n?t({agentResult:a()(a()({},e().agentResult),{},{data:{content:[].concat(r()(i.slice(0,n)),r()(i.slice(n+1)))}})}):console.warn("Agent not found in cache:",s),e().currentAgent.uid===s&&t({currentAgent:{uid:"",orgUid:""}})},deleteAgentCache:function(){return t({},!0)}}})),{name:o.zzK})))},68279:function(t,e,s){s.d(e,{$:function(){return l}});var i=s(73193),a=s.n(i),n=s(76711),r=s.n(n),o=s(2622),d=s(16894),c=s(45034),u=s(47401),l=(0,d.Ue)()((0,c.mW)((0,c.tJ)((0,u.n)((function(t,e){return{workgroupResult:{data:{content:[]}},currentWorkgroup:{uid:"",nickname:"",avatar:"",description:"",orgUid:""},insertWorkgroup:function(e){t((function(t){t.workgroupResult.data.content.unshift(e)}))},updateWorkgroup:function(e){t((function(t){var s=t.workgroupResult.data.content,i=s.findIndex((function(t){return t.uid===e.uid}));-1!==i?s[i]=e:console.warn("Workgroup with uid ".concat(e.uid," not found."))}))},deleteWorkgroup:function(e){t((function(t){var s=t.workgroupResult.data.content,i=s.findIndex((function(t){return t.uid===e.uid}));-1!==i?s.splice(i,1):console.warn("Workgroup with uid ".concat(e.uid," not found."))}))},setWorkgroupResult:function(s){var i;(t({workgroupResult:s}),""===e().currentWorkgroup.uid)&&((null===(i=s.data)||void 0===i||null===(i=i.content)||void 0===i?void 0:i.length)>0&&t({currentWorkgroup:s.data.content[0]}))},setCurrentWorkgroup:function(s){var i=e().workgroupResult.data.content,n=i.findIndex((function(t){return t.uid===s.uid}));if(-1!==n){var o=[].concat(r()(i.slice(0,n)),[s],r()(i.slice(n+1))),d=a()(a()({},e().workgroupResult),{},{data:{content:o}});t({workgroupResult:d,currentWorkgroup:s})}else console.warn("Workgroup with the specified uid not found."),t({currentWorkgroup:s})},deleteCurrentWorkgroup:function(s){var i=e().workgroupResult.data.content,n=i.findIndex((function(t){return t.uid===s}));-1!==n?t({workgroupResult:a()(a()({},e().workgroupResult),{},{data:{content:[].concat(r()(i.slice(0,n)),r()(i.slice(n+1)))}})}):console.warn("Workgroup not found in cache:",s),e().currentWorkgroup.uid===s&&t({currentWorkgroup:{uid:"",orgUid:""}})},deleteWorkgroupCache:function(){return t({},!0)}}})),{name:o.b6l})))}}]);