(this["webpackJsonplab-clusters-ui"]=this["webpackJsonplab-clusters-ui"]||[]).push([[10],{641:function(e,t,a){e.exports={resource:"resource--3fzLk",actionBar:"actionBar--udlol",btn:"btn--uD-sB"}},642:function(e,t,a){e.exports={header:"header--1PLKB",tabs:"tabs--D0Lny"}},795:function(e,t,a){"use strict";a.r(t);a(281);var n=a(259),r=(a(228),a(231)),c=a(2),s=a.n(c),u=a(13),o=a(202),i=(a(172),a(171)),l=(a(176),a(178)),m=a(6),p=(a(319),a(292)),b=a(0),h=a.n(b),f=a(1),v=a(44),d=(a(10),a(9)),y=a(641),g=a.n(y),S=a(214),j=function(){var e=Object(c.useState)([]),t=Object(v.a)(e,2),a=t[0],n=t[1],r=Object(c.useState)(!1),o=Object(v.a)(r,2),b=o[0],y=o[1],j=Object(c.useState)(!1),O=Object(v.a)(j,2),k=O[0],w=O[1],E=Object(S.d)((function(){return u.a.envStore.systemSettings})),R=Object(c.useState)((function(){var e;return(null===(e=u.a.envStore.systemSettings)||void 0===e?void 0:e.showRoomResourceTypes)||[]})),x=Object(v.a)(R,2),T=x[0],B=x[1];Object(c.useEffect)((function(){Object(f.a)(h.a.mark((function e(){var t,a,r;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.a.roomResourceApi.getRoomResourceTypes();case 2:a=e.sent,null!==(t=u.a.envStore.systemSettings)&&void 0!==t&&t.showRoomResourceTypes&&Array.isArray(u.a.envStore.systemSettings.showRoomResourceTypes)&&(r=a.filter((function(e){return u.a.envStore.systemSettings.showRoomResourceTypes.includes(e.key)})).map((function(e){return e.key})),B(r),y(r.length>0&&r.length<a.length),w(r.length===a.length)),n(a.map((function(e){return{label:e.name,value:e.key}})));case 5:case"end":return e.stop()}}),e)})))()}),[]);var N=Object(c.useState)(!1),A=Object(v.a)(N,2),C=A[0],L=A[1],D=function(){var e=Object(f.a)(h.a.mark((function e(t){return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{B(t),y(!!t.length&&t.length<a.length),w(t.length===a.length)}catch(n){}case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),J=function(){var e=Object(f.a)(h.a.mark((function e(t){var n;return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:try{n=t.target.checked?a.map((function(e){return e.value})):[],B(n),y(!1),w(t.target.checked)}catch(t){}case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return s.a.createElement("div",{className:g.a.resource},s.a.createElement("div",{className:g.a.actionBar},s.a.createElement(p.a,{indeterminate:b,onChange:J,checked:k,disabled:C},"\u5168\u9009"),s.a.createElement(i.a,{type:"primary",className:g.a.btn,loading:C,onClick:Object(f.a)(h.a.mark((function e(){return h.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,L(!0),e.next=4,u.a.envStore.updateSystemSettings(Object(m.a)(Object(m.a)({},E),{},{showRoomResourceTypes:T}));case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),l.b.error("\u66f4\u65b0\u5931\u8d25");case 9:return e.prev=9,L(!1),e.finish(9);case 12:case"end":return e.stop()}}),e,null,[[0,6,9,12]])})))},"\u66f4\u65b0")),s.a.createElement(p.a.Group,{value:T,onChange:D},a.map((function(e){return s.a.createElement(p.a,{key:e.value,value:e.value,disabled:C},e.label)}))))},O=a(642),k=a.n(O);t.default=Object(o.a)((function(){return u.a.currentUserStore.isSuperAdmin?s.a.createElement("div",null,s.a.createElement("div",{className:k.a.header},"\u5b9e\u9a8c\u5ba4\u914d\u7f6e"),s.a.createElement(n.a,{className:k.a.tabs},s.a.createElement(n.a.TabPane,{tab:"\u623f\u95f4\u8d44\u6e90\u5c55\u793a"},s.a.createElement(j,null)))):s.a.createElement(r.a,{status:"403",title:"\u60a8\u6682\u65e0\u6743\u9650\u67e5\u770b\u8be5\u9875\u9762"})}))}}]);
//# sourceMappingURL=settings.704b70e3.chunk.js.map