(this["webpackJsonpiot-gdoor-ui"]=this["webpackJsonpiot-gdoor-ui"]||[]).push([[13],{186:function(t,e,r){"use strict";r(208);var n=r(209),a=r(13),o=(r(0),r(16)),i=n.a.Content;e.a=Object(o.f)((function(t){var e=t.location.pathname;return"/"===e&&(e="/doors"),Object(a.jsx)(n.a,{children:Object(a.jsx)(i,{className:"site-layout",style:{padding:"30px",minHeight:"100vh",background:"#ffffff"},children:t.children})})}))},411:function(t,e,r){"use strict";r.r(e);r(220);var n=r(217),a=r(1),o=r.n(a),i=r(11),c=r(4),s=r(84),u=r(13),d=r(0),f=r.n(d),l=r(186),p=r(35);e.default=function(t){var e=f.a.useState([]),r=Object(s.a)(e,2),a=r[0],d=r[1],b=f.a.useState(!0),h=Object(s.a)(b,2),g=h[0],j=h[1],m=f.a.useRef({pagination:{total:0,pageSize:8,current:1,showSizeChanger:!1},filters:{includes:["door","room"]},sorter:{sort_field:"ctime",sort_order:"D"}}),v=f.a.useCallback(Object(c.a)(o.a.mark((function t(){var e,r,n,a,c,s,u,d;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=m.current,r=e.pagination,n=e.filters,a=e.sorter,c=m.current.pagination,s=c.current,u=c.pageSize,t.next=4,p.f.getRecords(Object(i.a)(Object(i.a)(Object(i.a)({},n),a),{},{st:((s||0)-1)*(u||0),pp:u}));case 4:return d=t.sent,r.total=d.total,t.abrupt("return",d.items.map((function(t){return Object.assign(t,{key:t.id})})));case 7:case"end":return t.stop()}}),t)}))),[]);f.a.useEffect((function(){var t=!0;if(g)return Object(c.a)(o.a.mark((function e(){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:v().then((function(e){t&&d(e)})).finally((function(){t&&j(!1)}));case 1:case"end":return e.stop()}}),e)})))(),function(){t=!1}}),[g,v]);var O=f.a.useMemo((function(){return[{title:"#",width:"5%",render:function(t,e,r){return r+1}},{title:"\u59d3\u540d",dataIndex:"user_name",sorter:!0,width:"30%"},{title:"\u623f\u95f4\u540d\u79f0",dataIndex:["door","name"],sorter:!0},{title:"\u8fdb\u95e8\u65f6\u95f4",dataIndex:"ctime",sorter:!0,defaultSortOrder:"descend",width:"20%"},{title:"\u95e8\u7981\u5730\u5740",sorter:!0,dataIndex:["door","room"],render:function(t,e){var r;return null===e||void 0===e||null===(r=e.room)||void 0===r?void 0:r.fullName}}]}),[]);return Object(u.jsx)(l.a,{children:Object(u.jsx)(n.a,{columns:O,dataSource:a,loading:g,onChange:function(t,e,r){m.current=Object(i.a)(Object(i.a)({},m.current),{},{pagination:t,sorter:{sort_field:r.field,sort_order:"descend"===r.order?"D":"A"}}),j(!0)},pagination:m.current.pagination,scroll:{y:"70vh"},bordered:!0,rowClassName:function(t,e){var r="light-row";return e%2===1&&(r="dark-row"),r}})})}}}]);
//# sourceMappingURL=13.2f2a7579.chunk.js.map