(this["webpackJsonpocpp-cs"]=this["webpackJsonpocpp-cs"]||[]).push([[36],{1327:function(e,t,a){"use strict";a.r(t);var n=a(3),s=a(9),r=a(27),c=a(22),i=a(21),o=a(29),d=a(30),l=a(0),h=a.n(l),u=a(210),p=a(53),j=a(769),m=a(800),b=a(868),O=a(447),x=a(871),f=a(164),g=a(144),v=a(872),y=a(1310),S=a(747),N=a(742),M=a(739),w=a(111),k=a(750),D=a(783),T=a(831),H=a(784),I=a(780),C=a(2),P=b.a.Text,E=function(e){Object(o.a)(a,e);var t=Object(d.a)(a);function a(e){var i;return Object(c.a)(this,a),(i=t.call(this,e)).pendingStart=function(){i.setState({pending:!0})},i.pendingEnd=function(){i.setState({pending:!1})},i.setParams=function(){var e=i.props.match.params.param1;i.setState({groupId:e,treeKey:Object(j.a)()})},i.load=Object(r.a)(Object(s.a)().mark((function e(){var t,a;return Object(s.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.pendingStart(),t=[],i.state.treeSearch&&t.push({field:"name",compare:"IKE",value:"%".concat(i.state.treeSearch,"%")}),e.next=5,i.context.api.q("/admin/group/list",{search:t},{toTree:!0});case 5:a=e.sent,i.setState({tree:a||[],treeKey:Object(j.a)()}),i.pendingEnd();case 8:case"end":return e.stop()}}),e)}))),i.save=function(){var e=Object(r.a)(Object(s.a)().mark((function e(t){var a,r,c,o;return Object(s.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=i.state.groupId,r=i.props.intl,c=Object(n.a)(Object(n.a)({},t),{},{id:a&&"add"!==a?a:null}),i.pendingStart(),e.next=6,i.context.api.q("/admin/group/set",c);case 6:if(!1!==(o=e.sent)){e.next=12;break}i.pendingEnd(),O.b.error(r.formatMessage({id:"save.fail"})),e.next=16;break;case 12:return O.b.success(r.formatMessage({id:"save.success"})),e.next=15,i.load();case 15:"add"===a&&o.id&&i.props.history.push("/admin/groups/".concat(o.id,"/"));case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),i.getItem=function(){var e=i.state,t=e.groupId;return e.tree.find((function(e){return e.id===t}))||{}},i.onTreeSelect=function(e){Array.isArray(e)&&e[0]&&i.props.history.push("/admin/groups/".concat(e[0]))},i.onTreeSearch=function(e){i.setState({treeSearch:e},(function(){return i.load()}))},i.onAddStart=function(){i.props.history.push("/admin/groups/add")},i.onDelete=Object(r.a)(Object(s.a)().mark((function e(){var t,a,n,r;return Object(s.a)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=i.props,a=t.intl,n=t.history,r=i.state.groupId,i.pendingStart(),e.next=5,i.context.api.q("/admin/group/delete",{id:r});case 5:!1!==e.sent?(O.b.success(a.formatMessage({id:"delete.success"})),n.push("/admin/groups/"),i.load()):(O.b.error(a.formatMessage({id:"delete.fail"})),i.pendingEnd());case 7:case"end":return e.stop()}}),e)}))),i.m=function(e){return i.props.intl.formatMessage({id:"admin.groups."+e})},i.state={treeSearch:"",treeKey:Object(j.a)(),tree:[]},i}return Object(i.a)(a,[{key:"componentDidMount",value:function(){this.setParams(),this.load()}},{key:"componentDidUpdate",value:function(e){Object(H.a)(e,this.props)&&this.setParams(),e.intl.locale!==this.props.intl.locale&&this.load()}},{key:"render",value:function(){var e=this,t=this.state,a=t.pending,n=t.treeKey,s=t.groupId,r=this.props.intl,c=this.getItem();return Object(C.jsxs)(C.Fragment,{children:[Object(C.jsx)(I.a,{title:this.m("groups"),url:"/admin/groups",icon:Object(C.jsx)(k.a,{})}),Object(C.jsxs)(m.a,{pending:a,onSearch:this.onTreeSearch,children:[Object(C.jsx)("div",{children:c.id&&Object(C.jsx)(C.Fragment,{children:Object(C.jsx)(P,{type:"secondary",children:c.name})})}),Object(C.jsx)("div",{className:"isoNoteBtns",children:Object(C.jsxs)(x.b,{children:[Object(C.jsx)(f.a,{title:this.m("btn.add"),children:Object(C.jsx)(g.a,{onClick:this.onAddStart,type:"primary",icon:Object(C.jsx)(D.a,{})})}),s&&"add"!==s&&Object(C.jsx)(v.a,{title:"".concat(r.formatMessage({id:"delete.sure"})),onConfirm:function(){return e.onDelete()},okText:r.formatMessage({id:"yes"}),cancelText:r.formatMessage({id:"no"}),children:Object(C.jsx)(f.a,{title:this.m("btn.delete"),children:Object(C.jsx)(g.a,{icon:Object(C.jsx)(T.a,{})})})})]})}),Object(C.jsx)(y.a,{defaultExpandAll:!0,defaultExpandParent:!0,defaultSelectedKeys:[s],defaultExpandedKeys:[s],treeData:this.state.tree,onSelect:this.onTreeSelect},n),Object(C.jsxs)("div",{children:[c.system&&Object(C.jsx)(S.a,{style:{marginBottom:"15px"},type:"warning",message:this.m("system")}),s&&Object(C.jsx)(N.a,{layout:"vertical",name:"type",initialValues:{name:c.name||"",username:c.username||"",description:c.description||""},onFinish:this.save,children:Object(C.jsxs)(x.b,{direction:"vertical",style:{width:"100%"},children:[Object(C.jsx)(N.a.Item,{rules:[{required:!0}],label:this.m("name"),name:"name",children:Object(C.jsx)(M.a,{})}),Object(C.jsx)(N.a.Item,{rules:[{required:!0}],label:this.m("username"),name:"username",children:Object(C.jsx)(M.a,{})}),Object(C.jsx)(N.a.Item,{label:this.m("description"),name:"description",children:Object(C.jsx)(M.a,{})}),Object(C.jsx)(N.a.Item,{children:Object(C.jsx)(x.b,{children:Object(C.jsx)(g.a,{loading:a,type:"primary",htmlType:"submit",children:r.formatMessage({id:"save"})})})})]})},c.id)]})]})]})}}]),a}(h.a.Component);E.contextType=w.a,t.default=Object(p.i)(Object(u.c)(E))},769:function(e,t,a){"use strict";function n(){return"f".concat((+new Date).toString(16)).concat((e=1e3,t=9999,e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e));var e,t}a.d(t,"a",(function(){return n}))},780:function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a(871),s=(a(0),a(112)),r=a(32),c=a(2);function i(e){return Object(c.jsxs)(c.Fragment,{children:[Object(c.jsx)(s.a,{children:Object(c.jsx)("title",{children:e.title})}),Object(c.jsx)("h2",{className:"title gx-mb-4",children:Object(c.jsx)(r.a,{to:e.url,className:"gx-text-dark",children:Object(c.jsxs)(n.b,{children:[e.icon,e.title]})})})]})}},784:function(e,t,a){"use strict";function n(e,t){var a=e.match.params||{},n=t.match.params||{};return a.param1!==n.param1||a.param2!==n.param2||a.param3!==n.param3}a.d(t,"a",(function(){return n}))},792:function(e,t,a){"use strict";var n=a(22),s=a(21),r=a(29),c=a(30),i=a(0),o=a.n(i),d=a(739),l=a(210),h=a(2),u=null,p=function(e){Object(r.a)(a,e);var t=Object(c.a)(a);function a(e){var s;return Object(n.a)(this,a),(s=t.call(this,e)).searchHandle=function(e){s.setState({searchValue:e}),s.state.searchDelay||!s.props.onSearch?(s.setState({searchPending:!0}),window.clearTimeout(u),u=window.setTimeout((function(){s.setState({searchPending:!1}),s.props.onSearch&&s.props.onSearch(e)}),s.state.searchDelay)):s.props.onSearch(e)},s.searchOnChange=function(e){s.searchHandle(e.target.value)},s.state={searchValue:e.defaultValue||"",searchPending:!1,searchDelay:e.hasOwnProperty("searchDelay")?e.searchDelay:1e3},s}return Object(s.a)(a,[{key:"render",value:function(){var e=this,t=this.props,a=t.intl,n=t.className,s=this.state,r=s.searchValue,c=s.searchPending,i=this.props.placeholder||a.formatMessage({id:"search.placeholder"});return Object(h.jsx)(d.a.Search,{placeholder:i,className:n,value:r,onChange:this.searchOnChange,onSearch:function(){return e.searchHandle(r)},loading:c})}}]),a}(o.a.Component);t.a=Object(l.c)(p)},800:function(e,t,a){"use strict";var n=a(7),s=a(22),r=a(21),c=a(29),i=a(30),o=a(0),d=a.n(o),l=a(143),h=a(309),u=a(2),p=function(e){var t=e.id,a=e.style,n=e.children,s=e.className;return Object(u.jsx)(h.Scrollbars,{id:t,className:s,style:a,autoHide:!0,autoHideTimeout:1e3,autoHideDuration:200,autoHeightMin:0,autoHeightMax:200,thumbMinSize:30,universal:!0,children:n})},j=a(792),m=a(740),b=a(834),O=a(210),x=m.a.Header,f=m.a.Content,g=function(e){Object(c.a)(a,e);var t=Object(i.a)(a);function a(){return Object(s.a)(this,a),t.apply(this,arguments)}return Object(r.a)(a,[{key:"render",value:function(){var e=Object(n.a)(this.props.children,4),t=e[0],a=e[1],s=e[2],r=e[3];return Object(u.jsx)(u.Fragment,{children:Object(u.jsx)(b.a,{spinning:!!this.props.pending,children:Object(u.jsxs)("div",{className:"isomorphicNoteComponent",children:[Object(u.jsx)("div",{style:{width:"340px"},className:"isoNoteListSidebar",children:Object(u.jsxs)("div",{className:"isoNoteListWrapper",children:[this.props.onSearch&&Object(u.jsx)(j.a,{placeholder:this.props.searchPlaceholder,className:"isoSearchNotes",onSearch:this.props.onSearch,searchDelay:this.props.searchDelay}),Object(u.jsx)("div",{className:"isoNoteList",children:s?Object(u.jsx)(p,{children:Object(u.jsx)("div",{className:"isoNoteListHolder",children:s})}):Object(u.jsx)("span",{className:"isoNoResultMsg",children:Object(u.jsx)(l.a,{id:"nothing.found"})})})]})}),Object(u.jsxs)(m.a,{className:"isoNotepadWrapper",children:[Object(u.jsxs)(x,{className:"isoHeader",children:[t,a]}),Object(u.jsx)(f,{className:"isoNoteEditingArea",children:r&&Object(u.jsx)(p,{children:Object(u.jsx)("div",{className:"isoNoteContentHolder",children:r})})})]})]})})})}}]),a}(d.a.Component);t.a=Object(O.c)(g)}}]);
//# sourceMappingURL=36.50d0f628.chunk.js.map