"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[522],{90503:function(L,i,d){d.d(i,{DH:function(){return c},Xk:function(){return f},n5:function(){return P},xu:function(){return g}});var p=d(97857),r=d.n(p),t=d(12578),f={Add:function(e){return(0,t.request)("/api/alarmlog/add",{method:"POST",data:r()({},e)})},Del:function(e){return(0,t.request)("/api/alarmlog/del",{method:"POST",data:r()({},e)})},Update:function(e){return(0,t.request)("/api/alarmlog/update",{method:"POST",data:r()({},e)})},Detail:function(e){return(0,t.request)("/api/alarmlog/detail?id=".concat(e),{method:"GET"})},List:function(e){return(0,t.request)("/api/alarmlog/list",{method:"POST",data:r()({},e)})},PagedList:function(e){return(0,t.request)("/api/alarmlog/pagedlist",{method:"POST",data:r()({},e)})}},c={Add:function(e){return(0,t.request)("/api/programlog/add",{method:"POST",data:r()({},e)})},Del:function(e){return(0,t.request)("/api/programlog/del",{method:"POST",data:r()({},e)})},Update:function(e){return(0,t.request)("/api/programlog/update",{method:"POST",data:r()({},e)})},Detail:function(e){return(0,t.request)("/api/programlog/detail?id=".concat(e),{method:"GET"})},List:function(e){return(0,t.request)("/api/programlog/list",{method:"POST",data:r()({},e)})},PagedList:function(e){return(0,t.request)("/api/programlog/pagedlist",{method:"POST",data:r()({},e)})}},P={Add:function(e){return(0,t.request)("/api/userlog/add",{method:"POST",data:r()({},e)})},Del:function(e){return(0,t.request)("/api/userlog/del",{method:"POST",data:r()({},e)})},Update:function(e){return(0,t.request)("/api/userlog/update",{method:"POST",data:r()({},e)})},Detail:function(e){return(0,t.request)("/api/userlog/detail?id=".concat(e),{method:"GET"})},List:function(e){return(0,t.request)("/api/userlog/list",{method:"POST",data:r()({},e)})},PagedList:function(e){return(0,t.request)("/api/userlog/pagedlist",{method:"POST",data:r()({},e)})}},g={Add:function(e){return(0,t.request)("/api/runlog/add",{method:"POST",data:r()({},e)})},Del:function(e){return(0,t.request)("/api/runlog/del",{method:"POST",data:r()({},e)})},Update:function(e){return(0,t.request)("/api/runlog/update",{method:"POST",data:r()({},e)})},Detail:function(e){return(0,t.request)("/api/runlog/detail?id=".concat(e),{method:"GET"})},List:function(e){return(0,t.request)("/api/runlog/list",{method:"POST",data:r()({},e)})},PagedList:function(e){return(0,t.request)("/api/runlog/pagedlist",{method:"POST",data:r()({},e)})}}},48350:function(L,i,d){d.r(i);var p=d(15009),r=d.n(p),t=d(99289),f=d.n(t),c=d(5574),P=d.n(c),g=d(85322),a=d(74254),e=d(71577),s=d(45360),D=d(67294),E=d(90503),_=d(85893);i.default=function(){var A=(0,D.useState)("table"),M=P()(A,2),T=M[0],O=M[1],h=(0,D.useRef)(),S=(0,D.useRef)(),b=function(){var n,o;(n=h.current)===null||n===void 0||n.resetFields(),(o=S.current)===null||o===void 0||o.reload()},I=[{title:"\u4E3B\u952E",dataIndex:"id",hideInForm:!0},{title:"\u8BBE\u5907\u540D\u79F0",dataIndex:"deviceName",copyable:!0,ellipsis:!0},{title:"\u62A5\u8B66\u7B49\u7EA7",dataIndex:"grade",copyable:!0,ellipsis:!0},{title:"\u62A5\u8B66\u503C",hideInTable:!0,hideInDescriptions:!0,dataIndex:"value",search:!1},{title:"\u62A5\u8B66\u4FE1\u606F",dataIndex:"msgInfo",width:120,search:!1}];return(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)(g.Z,{children:[T==="form"?(0,_.jsx)(e.ZP,{type:"link",onClick:function(){var n;(n=h.current)===null||n===void 0||n.resetFields(),O("table")},children:"\u2B05\u8FD4\u56DE"}):"",(0,_.jsx)(a.Z,{columns:I,type:T,formRef:h,actionRef:S,onSubmit:function(n){console.log(n),T==="form"&&(n.id?E.Xk.Update(n).then(function(o){o.statusCode===200?(s.ZP.info("\u66F4\u65B0\u6210\u529F!"),O("table"),b()):s.ZP.error(o.errors)}):E.Xk.Add(n).then(function(o){o.statusCode===200?(s.ZP.info("\u65B0\u589E\u6210\u529F!"),O("table"),b()):s.ZP.error(o.errors)}))},request:f()(r()().mark(function l(){var n,o,m,v=arguments;return r()().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return n=v.length>0&&v[0]!==void 0?v[0]:{},o={pageIndex:n.current||1,pageSize:n.pageSize||10,msgInfo:n.msgInfo,value:n.value,grade:n.grade,deviceName:n.deviceName},u.next=4,E.Xk.PagedList(o);case 4:if(m=u.sent,m.statusCode!==200){u.next=9;break}return u.abrupt("return",{data:m.data.items,success:!0,total:m.data.total});case 9:return u.abrupt("return",{data:[],success:!1,total:0});case 10:case"end":return u.stop()}},l)})),pagination:{pageSize:5},rowKey:"id",dateFormatter:"string",headerTitle:"\u5217\u8868",toolBarRender:!1})]})})}}}]);
