mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-15 19:58:00 +00:00
1 line
21 KiB
JavaScript
1 line
21 KiB
JavaScript
"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[1942],{66942:function(t,e,n){n.d(e,{AT:function(){return f},Lr:function(){return Z},_t:function(){return l},i8:function(){return y},n1:function(){return k},sE:function(){return m},x_:function(){return h}});var r=n(90819),a=n.n(r),s=n(73193),i=n.n(s),u=n(89933),o=n.n(u),c=n(18232),d=n(43906);function l(t){return p.apply(this,arguments)}function p(){return(p=o()(a()().mark((function t(e){return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,d.request)("/api/v1/agent/query/org",{method:"GET",params:i()(i()({},e),{},{channel:c.XtJ})}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function f(t){return g.apply(this,arguments)}function g(){return(g=o()(a()().mark((function t(e){return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,d.request)("/api/v1/agent/query/uid",{method:"GET",params:i()(i()({},e),{},{channel:c.XtJ})}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function h(t){return x.apply(this,arguments)}function x(){return(x=o()(a()().mark((function t(e){return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,d.request)("/api/v1/agent/create",{method:"POST",data:i()(i()({},e),{},{channel:c.XtJ})}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function m(t){return v.apply(this,arguments)}function v(){return(v=o()(a()().mark((function t(e){return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,d.request)("/api/v1/agent/update",{method:"POST",data:i()(i()({},e),{},{channel:c.XtJ})}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function k(t){return j.apply(this,arguments)}function j(){return(j=o()(a()().mark((function t(e){return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,d.request)("/api/v1/agent/update/avatar",{method:"POST",data:i()(i()({},e),{},{channel:c.XtJ})}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function y(t){return w.apply(this,arguments)}function w(){return(w=o()(a()().mark((function t(e){return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,d.request)("/api/v1/agent/update/autoreply",{method:"POST",data:i()(i()({},e),{},{channel:c.XtJ})}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function Z(t){return b.apply(this,arguments)}function b(){return(b=o()(a()().mark((function t(e){return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,d.request)("/api/v1/agent/delete",{method:"POST",data:i()(i()({},e),{},{channel:c.XtJ})}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}},88192:function(t,e,n){n.d(e,{LE:function(){return d},W5:function(){return x},c$:function(){return p},n1:function(){return v},p0:function(){return g},zl:function(){return j}});var r=n(90819),a=n.n(r),s=n(73193),i=n.n(s),u=n(89933),o=n.n(u),c=n(43906);function d(t){return l.apply(this,arguments)}function l(){return(l=o()(a()().mark((function t(e){return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.request)("/api/v1/workgroup/query/org",{method:"GET",params:i()({},e)}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function p(t){return f.apply(this,arguments)}function f(){return(f=o()(a()().mark((function t(e){return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.request)("/api/v1/workgroup/query/uid",{method:"GET",params:i()({},e)}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function g(t){return h.apply(this,arguments)}function h(){return(h=o()(a()().mark((function t(e){return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.request)("/api/v1/workgroup/create",{method:"POST",data:i()({},e)}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function x(t){return m.apply(this,arguments)}function m(){return(m=o()(a()().mark((function t(e){return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.request)("/api/v1/workgroup/update",{method:"POST",data:i()({},e)}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function v(t){return k.apply(this,arguments)}function k(){return(k=o()(a()().mark((function t(e){return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.request)("/api/v1/workgroup/update/avatar",{method:"POST",data:i()({},e)}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function j(t){return y.apply(this,arguments)}function y(){return(y=o()(a()().mark((function t(e){return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,c.request)("/api/v1/workgroup/delete",{method:"POST",data:i()({},e)}));case 1:case"end":return t.stop()}}),t)})))).apply(this,arguments)}},28619:function(t,e,n){var r=n(18232),a=n(54305),s=n(43906);e.Z=function(){var t=(0,s.useIntl)();return{translateString:function(e){return null==e?e:e&&(null!=e&&e.startsWith(r.VoP)||null!=e&&e.startsWith("ROLE_"))?t.formatMessage({id:e,defaultMessage:e}):e},translateStringTranct:function(e){return null==e?e:null!=e&&e.startsWith(r.VoP)||null!=e&&e.startsWith("ROLE_")?(0,a.aS)(t.formatMessage({id:e,defaultMessage:e}),10):(0,a.aS)(e,10)}}}},25599:function(t,e,n){n.r(e);var r=n(90819),a=n.n(r),s=n(89933),i=n.n(s),u=n(45332),o=n.n(u),c=n(44194),d=n(46030),l=n(97868),p=n(64827),f=n(99898),g=n(39038),h=n(17966),x=n(34353),m=n(60762),v=n(99098),k=n(80057),j=n(41313),y=n(89011),w=n(37141),Z=n(20097),b=n(20180),F=n(27938),M=n(95912),R=n(44064),A=n(61107),S=n(80556),W=n(90151),O=n(5321),T=n(90727),q=n(429),C=n(43906),E=n(66942),P=n(88192),Y=n(28619),U=n(9942),I=n(36914),z=n(17817),D=n(18232),J=n(28977),X=n.n(J),G=n(55567),L=n(31549),_=d.default.RangePicker,$=l.Z.Option;e.default=function(){var t,e,n=(0,C.useIntl)(),r=(0,Y.Z)().translateStringTranct,s=(0,c.useState)(X()().startOf("day")),u=o()(s,2),d=u[0],J=u[1],B=(0,c.useState)(X()().endOf("day")),H=o()(B,2),N=H[0],V=H[1],K=(0,c.useState)("today"),Q=o()(K,2),tt=Q[0],et=Q[1],nt=(0,c.useState)(D.AOk),rt=o()(nt,2),at=rt[0],st=rt[1],it=(0,c.useState)(),ut=o()(it,2),ot=ut[0],ct=ut[1],dt=(0,c.useState)(),lt=o()(dt,2),pt=lt[0],ft=lt[1],gt=(0,U.u)((function(t){return t.currentOrg})),ht=(0,I.E)((function(t){return t})),xt=ht.agentResult,mt=ht.setAgentResult,vt=(0,z.$)((function(t){return t})),kt=vt.workgroupResult,jt=vt.setWorkgroupResult,yt=(0,c.useState)(),wt=o()(yt,2),Zt=(wt[0],wt[1],(0,c.useState)(D.OwA)),bt=o()(Zt,2),Ft=bt[0],Mt=bt[1],Rt=(0,c.useState)(!1),At=o()(Rt,2),St=(At[0],At[1]),Wt=[{label:(0,L.jsx)(C.FormattedMessage,{id:"ticket.statistic.timeRange.today"}),value:"today"},{label:(0,L.jsx)(C.FormattedMessage,{id:"ticket.statistic.timeRange.yesterday"}),value:"yesterday"},{label:(0,L.jsx)(C.FormattedMessage,{id:"ticket.statistic.timeRange.week"}),value:"week"},{label:(0,L.jsx)(C.FormattedMessage,{id:"ticket.statistic.timeRange.lastWeek"}),value:"lastWeek"},{label:(0,L.jsx)(C.FormattedMessage,{id:"ticket.statistic.timeRange.month"}),value:"month"},{label:(0,L.jsx)(C.FormattedMessage,{id:"ticket.statistic.timeRange.custom"}),value:"custom"}],Ot={total:1580,newToday:12,updatedMonth:156,coverage:85.6},Tt={total:25600,avgClicks:35,searchCount:8900,hitRate:92.5},qt={helpful:2360,unhelpful:180,feedbackRate:15.8,comments:560},Ct=(C.FormattedMessage,C.FormattedMessage,C.FormattedMessage,C.FormattedMessage,C.FormattedMessage,{newArticles:85,updates:156,visits:12580,searches:4560}),Et=[{date:"2024-01",articles:1200,updates:580,visits:25600},{date:"2024-02",articles:1280,updates:620,visits:28900}];(0,c.useEffect)((function(){if("custom"===tt)J(d),V(N),Mt(D.dd4);else{var t=X()();"today"===tt?(J(t),V(t),Mt(D.OwA)):"yesterday"===tt?(J(t.subtract(1,"day")),V(t.subtract(1,"day")),Mt(D.OwA)):"week"===tt?(J(t.startOf("week")),V(t.endOf("week")),Mt(D.dd4)):"lastWeek"===tt?(J(t.subtract(1,"week").startOf("week")),V(t.subtract(1,"week").endOf("week")),Mt(D.dd4)):"month"===tt&&(J(t.startOf("month")),V(t.endOf("month")),Mt(D.dd4))}}),[tt]);var Pt=function(){var t=i()(a()().mark((function t(){var e,n;return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return G.yw.loading("loading"),e={pageNumber:0,pageSize:50,orgUid:null==gt?void 0:gt.uid},t.next=4,(0,P.LE)(e);case 4:n=t.sent,console.log("fetchAllWorkgroups: ",n),200===n.code?(G.yw.destroy(),jt(n),n.data.content.length>0&&ft(n.data.content[0].uid)):(G.yw.destroy(),G.yw.error(n.message));case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Yt=function(){var t=i()(a()().mark((function t(){var e,n;return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return G.yw.loading("loading"),e={pageNumber:0,pageSize:50,orgUid:null==gt?void 0:gt.uid},t.next=4,(0,E._t)(e);case 4:n=t.sent,console.log("fetchAllAgents: ",n),200===n.code?(G.yw.destroy(),mt(n),n.data.content.length>0&&ct(n.data.content[0].uid)):(G.yw.destroy(),G.yw.error(r(n.message))),console.log("queryAllAgents response",n);case 8:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),Ut=function(){var t=i()(a()().mark((function t(){return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:St(!0);try{G.yw.loading("loading"),{type:at,statisticStartTime:null==d?void 0:d.format("YYYY-MM-DD 00:00:00"),statisticEndTime:null==N?void 0:N.format("YYYY-MM-DD 23:59:59"),workgroupUid:pt,assigneeUid:ot,orgUid:null==gt?void 0:gt.uid}}catch(t){G.yw.error(n.formatMessage({id:"ticket.message.operation.failed"}))}finally{St(!1)}case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),It=function(){var t=i()(a()().mark((function t(){return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:G.yw.loading("loading"),{type:at,statisticStartTime:null==d?void 0:d.format("YYYY-MM-DD 00:00:00"),statisticEndTime:null==N?void 0:N.format("YYYY-MM-DD 23:59:59"),workgroupUid:pt,assigneeUid:ot,orgUid:null==gt?void 0:gt.uid};case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return(0,c.useEffect)((function(){Pt(),Yt()}),[]),(0,c.useEffect)((function(){Ut()}),[at,ot,pt]),(0,c.useEffect)((function(){It()}),[Ft,at,ot,pt]),(0,c.useEffect)((function(){Ut()}),[d,N]),(0,L.jsxs)("div",{style:{padding:16},children:[(0,L.jsx)(p.Z,{style:{marginBottom:16},children:(0,L.jsxs)(f.Z,{direction:"vertical",style:{width:"100%"},children:[(0,L.jsxs)(f.Z,{wrap:!0,children:[(0,L.jsx)(g.ZP.Group,{value:tt,onChange:function(t){return et(t.target.value)},children:Wt.map((function(t){return(0,L.jsx)(g.ZP.Button,{value:t.value,children:t.label},t.value)}))}),"custom"===tt&&(0,L.jsx)(_,{value:[d,N],onChange:function(t){J(t[0]),V(t[1])}})]}),(0,L.jsxs)(f.Z,{wrap:!0,children:[(0,L.jsxs)(l.Z,{placeholder:(0,L.jsx)(C.FormattedMessage,{id:"ticket.statistic.filter.type"}),style:{width:200},value:at,onChange:function(t){return st(t)},children:[(0,L.jsx)($,{value:D.AOk,children:(0,L.jsx)(C.FormattedMessage,{id:"i18n.all"})}),(0,L.jsx)($,{value:D.pHh,children:(0,L.jsx)(C.FormattedMessage,{id:"ticket.statistic.filter.agent"})}),(0,L.jsx)($,{value:D.ti4,children:(0,L.jsx)(C.FormattedMessage,{id:"ticket.statistic.filter.workgroup"})})]}),at===D.pHh&&(0,L.jsx)(l.Z,{placeholder:(0,L.jsx)(C.FormattedMessage,{id:"ticket.statistic.filter.agent"}),style:{width:200},value:ot,onChange:function(t){return ct(t)},children:null===(t=xt.data)||void 0===t||null===(t=t.content)||void 0===t?void 0:t.map((function(t){return(0,L.jsx)($,{value:null==t?void 0:t.uid,children:r(null==t?void 0:t.nickname)},null==t?void 0:t.uid)}))}),at===D.ti4&&(0,L.jsx)(l.Z,{placeholder:(0,L.jsx)(C.FormattedMessage,{id:"ticket.statistic.filter.department"}),style:{width:200},value:pt,onChange:function(t){return ft(t)},children:null===(e=kt.data)||void 0===e||null===(e=e.content)||void 0===e?void 0:e.map((function(t){return(0,L.jsx)($,{value:null==t?void 0:t.uid,children:r(null==t?void 0:t.nickname)},null==t?void 0:t.uid)}))}),(0,L.jsx)(h.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"ticket.statistic.filter.export"}),children:(0,L.jsx)(x.ZP,{icon:(0,L.jsx)(A.Z,{}),onClick:function(){G.yw.warning("TODO: 待实现")},children:(0,L.jsx)(C.FormattedMessage,{id:"ticket.statistic.filter.export"})})}),(0,L.jsx)(h.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"ticket.statistic.filter.refresh"}),children:(0,L.jsx)(x.ZP,{icon:(0,L.jsx)(S.Z,{}),onClick:function(){return Ut()},children:(0,L.jsx)(C.FormattedMessage,{id:"ticket.statistic.filter.refresh"})})}),!1]})]})}),(0,L.jsx)(p.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.time.analysis"}),children:(0,L.jsxs)(m.Z,{gutter:[16,16],children:[(0,L.jsx)(v.Z,{span:6,children:(0,L.jsx)(k.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.time.newArticles"}),value:Ct.newArticles,suffix:(0,L.jsx)(h.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.time.compare"}),children:(0,L.jsx)(j.Z,{color:"green",children:"+15%"})})})}),(0,L.jsx)(v.Z,{span:6,children:(0,L.jsx)(k.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.time.updates"}),value:Ct.updates,suffix:(0,L.jsx)(h.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.time.compare"}),children:(0,L.jsx)(j.Z,{color:"blue",children:"+8%"})})})}),(0,L.jsx)(v.Z,{span:6,children:(0,L.jsx)(k.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.time.visits"}),value:Ct.visits,suffix:(0,L.jsx)(h.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.time.compare"}),children:(0,L.jsx)(j.Z,{color:"green",children:"+23%"})})})}),(0,L.jsx)(v.Z,{span:6,children:(0,L.jsx)(k.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.time.searches"}),value:Ct.searches,suffix:(0,L.jsx)(h.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.time.compare"}),children:(0,L.jsx)(j.Z,{color:"blue",children:"+12%"})})})})]})}),(0,L.jsx)(p.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.growth.trend"}),style:{marginTop:16},children:(0,L.jsx)(Z.Z,{data:[Et,Et],xField:"date",yField:["articles","visits"],geometryOptions:[{geometry:"column",columnStyle:{radius:[4,4,0,0]}},{geometry:"line",lineStyle:{lineWidth:2}}]})}),(0,L.jsx)(p.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.time.heatmap"}),style:{marginTop:16},children:(0,L.jsx)(b.Z,{data:[{hour:"00:00",day:"周一",value:10},{hour:"01:00",day:"周一",value:5}],xField:"hour",yField:"day",colorField:"value",shape:"square"})}),(0,L.jsxs)(m.Z,{gutter:[16,16],style:{marginTop:16},children:[(0,L.jsx)(v.Z,{span:12,children:(0,L.jsx)(p.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.time.comparison"}),children:(0,L.jsx)(F.Z,{data:[{type:"上周",value:890},{type:"本周",value:1080},{type:"环比",value:980},{type:"同比",value:850}],xField:"type",yField:"value",label:{position:"top"}})})}),(0,L.jsx)(v.Z,{span:12,children:(0,L.jsx)(p.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.time.distribution"}),children:(0,L.jsx)(M.Z,{data:[{time:"工作时间",value:68},{time:"非工作时间",value:32}],angleField:"value",colorField:"time",radius:.8})})})]}),(0,L.jsxs)(m.Z,{gutter:[16,16],children:[(0,L.jsx)(v.Z,{span:6,children:(0,L.jsxs)(p.Z,{children:[(0,L.jsx)(k.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.articles.total"}),value:Ot.total,prefix:(0,L.jsx)(W.Z,{}),suffix:(0,L.jsxs)("small",{style:{fontSize:14},children:["(+",Ot.newToday,")"]})}),(0,L.jsx)(y.Z,{percent:Ot.coverage,size:"small",status:"active"})]})}),(0,L.jsx)(v.Z,{span:6,children:(0,L.jsxs)(p.Z,{children:[(0,L.jsx)(k.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.visits.total"}),value:Tt.total,prefix:(0,L.jsx)(O.Z,{})}),(0,L.jsx)(y.Z,{percent:Tt.avgClicks/50*100,size:"small"})]})}),(0,L.jsx)(v.Z,{span:6,children:(0,L.jsxs)(p.Z,{children:[(0,L.jsx)(k.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.search.count"}),value:Tt.searchCount,prefix:(0,L.jsx)(T.Z,{})}),(0,L.jsx)(y.Z,{percent:Tt.hitRate,size:"small",status:"active"})]})}),(0,L.jsx)(v.Z,{span:6,children:(0,L.jsxs)(p.Z,{children:[(0,L.jsx)(k.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.feedback.helpful"}),value:qt.helpful,prefix:(0,L.jsx)(q.Z,{})}),(0,L.jsx)(y.Z,{percent:qt.feedbackRate,size:"small"})]})})]}),(0,L.jsxs)(m.Z,{gutter:[16,16],style:{marginTop:16},children:[(0,L.jsx)(v.Z,{span:12,children:(0,L.jsx)(p.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.article.status"}),children:(0,L.jsx)(M.Z,{data:[{status:"已发布",value:1200},{status:"待审核",value:85},{status:"草稿",value:156},{status:"已归档",value:89},{status:"待更新",value:50}],angleField:"value",colorField:"status",radius:.8})})}),(0,L.jsx)(v.Z,{span:12,children:(0,L.jsx)(p.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.visit.trend"}),children:(0,L.jsx)(R.Z,{data:[{date:"2024-01-01",visits:580,searches:256},{date:"2024-01-02",visits:680,searches:312}],xField:"date",yField:"visits",seriesField:"type"})})})]}),(0,L.jsx)(p.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.search.hot"}),style:{marginTop:16},children:(0,L.jsx)(F.Z,{data:[{word:"登录问题",count:256},{word:"密码重置",count:198},{word:"账号注册",count:156}],xField:"word",yField:"count",label:{position:"top"}})}),(0,L.jsxs)(m.Z,{gutter:[16,16],style:{marginTop:16},children:[(0,L.jsx)(v.Z,{span:8,children:(0,L.jsx)(p.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.quality.score"})})}),(0,L.jsx)(v.Z,{span:16,children:(0,L.jsx)(p.Z,{title:(0,L.jsx)(C.FormattedMessage,{id:"kbase.statistic.quality.detail"}),children:(0,L.jsx)(w.Z,{columns:[{key:"metric",title:"指标",dataIndex:"metric"},{key:"score",title:"得分",dataIndex:"score"},{key:"trend",title:"趋势",dataIndex:"trend"}],dataSource:[{key:"metric",metric:"内容完整度",score:85,trend:"上升"},{key:"score",metric:"更新及时性",score:78,trend:"稳定"},{key:"trend",metric:"用户满意度",score:92,trend:"上升"}],size:"small"})})})]})]})}},36914:function(t,e,n){n.d(e,{E:function(){return l}});var r=n(73193),a=n.n(r),s=n(76711),i=n.n(s),u=n(18232),o=n(16894),c=n(45034),d=n(47401),l=(0,o.Ue)()((0,c.mW)((0,c.tJ)((0,d.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 n=t.agentResult.data.content,r=n.findIndex((function(t){return t.uid===e.uid}));-1!==r?n[r]=e:console.warn("Agent with uid ".concat(e.uid," not found."))}))},setAgentResult:function(n){var r;(t({agentResult:n}),""===e().currentAgent.uid)&&((null===(r=n.data)||void 0===r||null===(r=r.content)||void 0===r?void 0:r.length)>0&&t({currentAgent:n.data.content[0]}))},setCurrentAgent:function(n){var r=e().agentResult.data.content,s=r.findIndex((function(t){return t.uid===n.uid}));if(-1!==s){var u=[].concat(i()(r.slice(0,s)),[n],i()(r.slice(s+1))),o=a()(a()({},e().agentResult),{},{data:{content:u}});t({agentResult:o,currentAgent:n})}else console.warn("Agent with the specified uid not found."),t({currentAgent:n})},deleteCurrentAgent:function(n){var r=e().agentResult.data.content,s=r.findIndex((function(t){return t.uid===n}));-1!==s?t({agentResult:a()(a()({},e().agentResult),{},{data:{content:[].concat(i()(r.slice(0,s)),i()(r.slice(s+1)))}})}):console.warn("Agent not found in cache:",n),e().currentAgent.uid===n&&t({currentAgent:{uid:"",orgUid:""}})},deleteAgentCache:function(){return t({},!0)}}})),{name:u.zzK})))},17817:function(t,e,n){n.d(e,{$:function(){return l}});var r=n(73193),a=n.n(r),s=n(76711),i=n.n(s),u=n(18232),o=n(16894),c=n(45034),d=n(47401),l=(0,o.Ue)()((0,c.mW)((0,c.tJ)((0,d.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 n=t.workgroupResult.data.content,r=n.findIndex((function(t){return t.uid===e.uid}));-1!==r?n[r]=e:console.warn("Workgroup with uid ".concat(e.uid," not found."))}))},deleteWorkgroup:function(e){t((function(t){var n=t.workgroupResult.data.content,r=n.findIndex((function(t){return t.uid===e.uid}));-1!==r?n.splice(r,1):console.warn("Workgroup with uid ".concat(e.uid," not found."))}))},setWorkgroupResult:function(n){var r;(t({workgroupResult:n}),""===e().currentWorkgroup.uid)&&((null===(r=n.data)||void 0===r||null===(r=r.content)||void 0===r?void 0:r.length)>0&&t({currentWorkgroup:n.data.content[0]}))},setCurrentWorkgroup:function(n){var r=e().workgroupResult.data.content,s=r.findIndex((function(t){return t.uid===n.uid}));if(-1!==s){var u=[].concat(i()(r.slice(0,s)),[n],i()(r.slice(s+1))),o=a()(a()({},e().workgroupResult),{},{data:{content:u}});t({workgroupResult:o,currentWorkgroup:n})}else console.warn("Workgroup with the specified uid not found."),t({currentWorkgroup:n})},deleteCurrentWorkgroup:function(n){var r=e().workgroupResult.data.content,s=r.findIndex((function(t){return t.uid===n}));-1!==s?t({workgroupResult:a()(a()({},e().workgroupResult),{},{data:{content:[].concat(i()(r.slice(0,s)),i()(r.slice(s+1)))}})}):console.warn("Workgroup not found in cache:",n),e().currentWorkgroup.uid===n&&t({currentWorkgroup:{uid:"",orgUid:""}})},deleteWorkgroupCache:function(){return t({},!0)}}})),{name:u.b6l})))}}]); |