1"use strict";(self.webpackChunkweb_admin=self.webpackChunkweb_admin||[]).push([[4019],{5593:function(e,t,n){n.d(t,{r:function(){return c}});var i,l=n(30969),r=["title","titleId"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},a.apply(this,arguments)}function s(e,t){if(null==e)return{};var n,i,l=function(e,t){if(null==e)return{};var n,i,l={},r=Object.keys(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||(l[n]=e[n]);return l}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i<r.length;i++)n=r[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(l[n]=e[n])}return l}function o(e,t){var n=e.title,o=e.titleId,c=s(e,r);return l.createElement("svg",a({width:18,height:20,viewBox:"0 0 18 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":o},c),n?l.createElement("title",{id:o},n):null,i||(i=l.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 1V4H1.01C0.453 4 0.003 4.448 0.003 5L0 19C0.0002613 19.2664 0.106664 19.5216 0.295659 19.7093C0.484653 19.897 0.740653 20.0016 1.007 20H12.993C13.55 20 14 19.552 14 19V16H17C17.5523 16 18 15.5523 18 15V1C18 0.447715 17.5523 0 17 0H5C4.44772 0 4 0.447715 4 1ZM14 4H6V2H16V14H14V4Z",fill:"#007BFF"})))}var c=l.forwardRef(o);n.p},18612:function(e,t,n){n.r(t),n.d(t,{default:function(){return M}});var i=n(32723),l=n(33028),r=n(34795),a=n(56666),s=n(96234),o=n(26275),c=n.n(o),d=n(30969),p=n(13697),m=n(69405),u=n(86822),v=n(27798),h=n(43679),f=n(59717),x=n(6114),y=n.n(x),j=n(30734),b=n(19401),_=n(4715),w=n(47400),g=n(70043),Z=n(34573),N=n(5593),C=n(21749),L=n(33250),A=n(78643),k=n(16619),D={"whitespace-no-wrap":"List_whitespace-no-wrap__vv1DZ","invited-color":"List_invited-color__Vc9bG","deleted-color":"List_deleted-color__veUQ5","withdrawal-color":"List_withdrawal-color__fcBEM","notification-type":"List_notification-type__d-Eb5",all:"List_all__0qbh7","notification-major":"List_notification-major__xYHju",hidden:"List_hidden__uE2DK","event-wrapper":"List_event-wrapper__8fAWA","filter-wrapper":"List_filter-wrapper__GWI9I",btn:"List_btn__NaQiW","btn-wrapper":"List_btn-wrapper__ws9m9","value-wrapper":"List_value-wrapper__PDY10","form-item":"List_form-item__9bck0","input-item":"List_input-item__8ngLY","table-wrapper":"List_table-wrapper__108a7","btn-create":"List_btn-create__58jKg",table:"List_table__iQDgg","copy-wrapper":"List_copy-wrapper__XnOxV","title-wrapper":"List_title-wrapper__NWE4Y","title-name":"List_title-name__7V3GP","title-description":"List_title-description__lxRPz","title-company-id":"List_title-company-id__--6V6",icon:"List_icon__deADA"},O=n(37574),S=y().bind(D),E=function(e){var t=e.handleDelete,n=e.isAdmin,i=(0,p.$G)().t;return(0,L.$)({columns:[{title:(0,O.jsx)("span",{children:i("event.list.company-info-label")}),key:"name",render:function(e){return null!==e&&void 0!==e&&e.companyId?(0,O.jsxs)("div",{className:S("title-wrapper"),children:[(0,O.jsx)("span",{children:null===e||void 0===e?void 0:e.companyName}),(0,O.jsx)("span",{className:S("title-company-id"),children:"".concat(i("event.list.company-id-label"),": \n ").concat(null===e||void 0===e?void 0:e.companyId)})]}):(0,O.jsx)(O.Fragment,{})},width:200,roles:[A.GW.SystemAdmin]},{title:(0,O.jsx)("span",{children:i("event.list.name-description-label")}),key:"name",render:function(e){return(0,O.jsxs)("div",{className:S("title-wrapper"),children:[(0,O.jsx)("span",{className:S("title-name"),children:null===e||void 0===e?void 0:e.name}),(0,O.jsx)("span",{className:S("title-description"),children:null===e||void 0===e?void 0:e.description})]})}},{title:(0,O.jsx)("span",{children:i("event.list.start-date-label")}),key:"startDate",render:function(e){return(0,O.jsx)(O.Fragment,{children:(0,k.p6)(null===e||void 0===e?void 0:e.startDate,w.wO)})},sorter:!0,width:200},{title:(0,O.jsx)("span",{children:i("event.list.end-date-label")}),key:"endDate",render:function(e){return(0,O.jsx)(O.Fragment,{children:(0,k.p6)(e.endDate,w.wO)})},sorter:!0,width:200},{title:(0,O.jsx)("span",{children:i("event.list.created-at-label")}),key:"createdAt",render:function(e){return(0,O.jsx)(O.Fragment,{children:(0,k.p6)(e.createdAt,w.wO)})},sorter:!0,width:200},{title:(0,O.jsx)("span",{children:i("event.list.total-user-label")}),key:"eventUsers",sorter:!0,render:function(e){return(0,O.jsx)(u.rU,{to:g.Z.event[n?"system":"company"].user(null===e||void 0===e?void 0:e.id),children:i("event.list.total-user-value",{value:null===e||void 0===e?void 0:e.totalUsers})})},width:100},{title:(0,O.jsx)("span",{children:i("event.list.action-label")}),key:"action",align:"center",render:function(e){return(0,O.jsxs)("div",{className:S("btn-wrapper"),children:[(0,O.jsx)(u.rU,{to:g.Z.event[n?"system":"company"].edit(null===e||void 0===e?void 0:e.id),children:(0,O.jsx)(f.ZP,{type:"primary",children:i("event.list.btn-edit")})}),(0,O.jsx)(u.rU,{to:g.Z.event[n?"system":"company"].detail(null===e||void 0===e?void 0:e.id),children:(0,O.jsx)(f.ZP,{type:"primary",children:i("event.list.btn-detail")})}),(0,O.jsx)(C.Z,{roles:[A.GW.Company,A.GW.CompanyMember,A.GW.SystemAdmin],children:(0,O.jsx)(f.ZP,{onClick:function(){return function(e){(0,k.j3)((function(){return t(null===e||void 0===e?void 0:e.id)}
1))}(e)},type:"primary",children:i("event.list.btn-delete")})})]})}},{title:(0,O.jsx)("span",{children:i("event.list.copy-label")}),key:"copy-action",align:"center",render:function(e){return(0,O.jsx)("div",{className:S("btn-wrapper"),children:(0,O.jsx)(u.rU,{className:S("copy-wrapper"),to:"".concat(g.Z.event.company.create,"?copyId=").concat(null===e||void 0===e?void 0:e.id),children:(0,O.jsx)(N.r,{})})})},width:80,roles:[A.GW.Company,A.GW.CompanyMember]}]})},I=n(92262),P=n(91395),F=n(13456),G=n(57476),W=n(63485),V=y().bind(D),U=function(e){var t=e.handleFilter,n=(0,p.$G)().t,i=P.Z.useForm(),l=(0,s.Z)(i,1)[0];return(0,O.jsx)("div",{className:V("filter-wrapper"),children:(0,O.jsxs)(P.Z,{layout:"vertical",form:l,onFinish:function(e){t(e)},children:[(0,O.jsxs)(v.Z,{gutter:[32,32],children:[(0,O.jsxs)(C.Z,{roles:[A.GW.SystemAdmin],children:[(0,O.jsx)(h.Z,{lg:{span:4},sm:{span:8},children:(0,O.jsx)(W.Z,{isCheckFullWidth:!0,name:"companyId",className:V("form-item"),label:n("event.list.company-id-label"),children:(0,O.jsx)(F.Z,{className:V("input-item"),placeholder:n("event.list.search-placeholder"),suffix:(0,O.jsx)(I.Z,{className:V("icon")})})})}),(0,O.jsx)(h.Z,{lg:{span:4},sm:{span:8},children:(0,O.jsx)(W.Z,{name:"companyName",className:V("form-item"),label:n("event.list.company-name-label"),children:(0,O.jsx)(F.Z,{className:V("input-item"),placeholder:n("event.list.search-placeholder"),suffix:(0,O.jsx)(I.Z,{className:V("icon")})})})})]}),(0,O.jsx)(h.Z,{lg:{span:4},sm:{span:8},children:(0,O.jsx)(W.Z,{name:"name",className:V("form-item"),label:n("event.list.name-label"),children:(0,O.jsx)(F.Z,{className:V("input-item"),placeholder:n("event.list.search-placeholder"),suffix:(0,O.jsx)(I.Z,{className:V("icon")})})})}),(0,O.jsx)(h.Z,{lg:{span:8},sm:{span:8},children:(0,O.jsx)("div",{className:V("value-wrapper"),children:(0,O.jsx)(W.Z,{name:"createdAt",className:V("form-item"),label:n("event.list.created-at-label"),children:(0,O.jsx)(G.Z,{style:{flex:1},placeholder:[n("event.list.created-at-placeholder"),n("event.list.created-at-placeholder")]})})})}),(0,O.jsx)(h.Z,{lg:{span:8},sm:{span:8},children:(0,O.jsx)("div",{className:V("value-wrapper"),children:(0,O.jsx)(W.Z,{name:"schedule",className:V("form-item"),label:n("event.list.schedule-label"),children:(0,O.jsx)(G.Z,{style:{flex:1},placeholder:[n("event.list.start-date-placeholder"),n("event.list.end-date-placeholder")]})})})})]}),(0,O.jsx)(v.Z,{children:(0,O.jsxs)(h.Z,{className:V("btn-wrapper"),lg:{span:5,offset:19},sm:{span:10,offset:14},children:[(0,O.jsx)(f.ZP,{className:V("btn"),onClick:function(){l.resetFields(),l.submit()},children:n("metType.list.btn-clear")}),(0,O.jsx)(f.ZP,{type:"primary",htmlType:"submit",onClick:l.submit,children:n("metType.list.btn-search")})]})})]})})},H=y().bind(D),R=function(e){var t,n=e.handleChangePage,i=e.handleDelete,l=e.handleFilter,r=e.handleSort,a=e.isAdmin,s=(0,p.$G)().t,o=(0,m.v9)((function(e){return e.event.loading})),c=(0,m.v9)((function(e){return e.auth.userInfo})),u=null===c||void 0===c||null===(t=c.userRoles)||void 0===t?void 0:t.includes(A.GW.SystemAdmin),x=(0,m.v9)((function(e){var t;return null===(t=e.event.listEvent)||void 0===t?void 0:t.data})),y=(0,m.v9)((function(e){var t,n;return null===(t=e.event.listEvent)||void 0===t||null===(n=t.pagination)||void 0===n?void 0:n.total})),N=(0,m.v9)((function(e){var t,n;return null===(t=e.event.listEvent)||void 0===t||null===(n=t.pagination)||void 0===n?void 0:n.currentPage})),C=(0,j.s0)();(0,d.useEffect)((function(){0===x.length&&N>1&&n(1)}),[N,y]);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(_.Z,{loading:o}),(0,O.jsx)(Z.Z,{title:s("event.list.title"),children:(0,O.jsxs)("div",{className:H("event-wrapper"),children:[(0,O.jsx)(U,{handleFilter:l,isAdmin:a}),(0,O.jsxs)("div",{className:H("table-wrapper"),children:[(0,O.jsx)(v.Z,{children:(0,O.jsx)(h.Z,{className:H("btn-create"),lg:{span:3,offset:21},sm:{span:8,offset:16},children:(0,O.jsx)(f.ZP,{type:"primary",onClick:function(){C(g.Z.event[u?"system":"company"].create)},children:s("event.list.btn-create")})})}),(0,O.jsx)(b.Z,{columns:E({handleDelete:i,isAdmin:a}),dataSource:x,rowKey:"id",pagination:{showSizeChanger:!1,pageSize:w.aQ,current:N,total:y,onChange:n,position:["bottomCenter"]},className:H("table"),scroll:{x:1120},onChange:function(e,t,n){var i=n.columnKey,l=n.field,a=n.order;null===r||void 0===r||r({columnKey:i,field:l,order:a})}})]})]})})]})},K=n(7242),M=function(e){var t=e.isAdmin,n=(0,p.$G)().t,o=d.useState({}),v=(0,s.Z)(o,2),h=v[0],f=v[1],x=d.useState({createdAt:A.As.Desc}),y=(0,s.Z)(x,2),j=y[0],b=y[1],_=(0,u.lr)(),g=(0,s.Z)(_,2),Z=g[0],N=g[1],C=(0,m.I0)(),L=Z.get("page")||1,D=function(){var e=(0,r.Z)((0,i.Z)().mark((function e(t){var r;return(0,i.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,C((0,K.S5)({eventId:t}));case 2:null!==(r=e.sent)&&void 0!==r&&r.error?(0,k.S3)(r,n("event.list.delete-fail")):((0,k.h4)(w.WV.SUCCESS,n("event.list.delete-success")),f((0,l.Z)({},h)));case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,d.useEffect)((function(){C((0,K._b)({pagination:{page:Number(L),perPage:w.aQ},where:h,orderBy:j})).then((function(e){null!==e&&void 0!==e&&e.error&&(0,k.S3)(e,n("common.error"))}))}),[L,h,j]),(0,O.jsx)(R,{handleChangePage:function(e){Z.set("page",e.toString()),N(Z),window.scrollTo({top:0,behavior:"smooth"})},handleFilter:function(e){Z.set("page","1"),N(Z),window.scrollTo({top:0,behavior:"smooth"});var n=e.name,i=e.schedule,l=e.createdAt,r=e.companyId,a=e.companyName;f({name:n?{contains:n,mode:A.nJ.Insensitive}:void 0,createdAt:l&&l[0]&&l[1]?{gte:c()(l[0]).startOf("date").toDate(),lte:c()(l[1]).endOf("date").toDate()}:void 0,startDate:null!==i&&void 0!==i&&i[0]?{gte:c()(i[0]).startOf("date").toDate()}:void 0,endDate:null!==i&&void 0!==i&&i[1]?{lte:c()(i[1]).endOf("date").toDate()}:void 0,company:t&&(r||a)?{is:{id:r?{contains:r,mode:A.nJ.Insensitive}
1:void 0,name:a?{contains:a,mode:A.nJ.Insensitive}:void 0}}:void 0})},handleDelete:D,handleSort:function(e){var t=e.columnKey,n=e.order;void 0!==t&&b("eventUsers"===t?{eventUsers:n?{_count:w.ER[n]||void 0}:void 0}:(0,a.Z)({},t,w.ER[n]||void 0))},isAdmin:t})}}}]); 2//# sourceMappingURL=4019.2ddb1090.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.