"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[675],{90503:function(b,s,n){n.d(s,{DH:function(){return P},Xk:function(){return f},n5:function(){return c},xu:function(){return g}});var p=n(97857),r=n.n(p),t=n(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)})}},P={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)})}},c={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)})}}},48098:function(b,s,n){n.r(s);var p=n(15009),r=n.n(p),t=n(99289),f=n.n(t),P=n(5574),c=n.n(P),g=n(85322),a=n(74254),e=n(71577),i=n(45360),D=n(67294),E=n(90503),_=n(85893);s.default=function(){var A=(0,D.useState)("table"),S=c()(A,2),T=S[0],O=S[1],h=(0,D.useRef)(),v=(0,D.useRef)(),L=function(){var d,o;(d=h.current)===null||d===void 0||d.resetFields(),(o=v.current)===null||o===void 0||o.reload()},R=[{title:"\u4E3B\u952E",dataIndex:"id",hideInForm:!0},{title:"\u65E5\u5FD7\u7C7B\u522B",dataIndex:"logType",copyable:!0,ellipsis:!0},{title:"\u65E5\u5FD7\u6D88\u606F",hideInTable:!0,hideInDescriptions:!0,dataIndex:"msgInfo",search:!1}];return(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)(g.Z,{children:[T==="form"?(0,_.jsx)(e.ZP,{type:"link",onClick:function(){var d;(d=h.current)===null||d===void 0||d.resetFields(),O("table")},children:"\u2B05\u8FD4\u56DE"}):"",(0,_.jsx)(a.Z,{columns:R,type:T,formRef:h,actionRef:v,onSubmit:function(d){console.log(d),T==="form"&&(d.id?E.xu.Update(d).then(function(o){o.statusCode===200?(i.ZP.info("\u66F4\u65B0\u6210\u529F!"),O("table"),L()):i.ZP.error(o.errors)}):E.xu.Add(d).then(function(o){o.statusCode===200?(i.ZP.info("\u65B0\u589E\u6210\u529F!"),O("table"),L()):i.ZP.error(o.errors)}))},request:f()(r()().mark(function l(){var d,o,m,M=arguments;return r()().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return d=M.length>0&&M[0]!==void 0?M[0]:{},o={pageIndex:d.current||1,pageSize:d.pageSize||10},u.next=4,E.xu.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})]})})}}}]);
