|
|
|
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[522],{90503:function(A,i,n){n.d(i,{DH:function(){return c},Xk:function(){return E},n5:function(){return p},xu:function(){return g}});var P=n(97857),d=n.n(P),t=n(12578),E={Add:function(e){return(0,t.request)("/api/alarmlog/add",{method:"POST",data:d()({},e)})},Del:function(e){return(0,t.request)("/api/alarmlog/del",{method:"POST",data:d()({},e)})},Update:function(e){return(0,t.request)("/api/alarmlog/update",{method:"POST",data:d()({},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:d()({},e)})},PagedList:function(e){return(0,t.request)("/api/alarmlog/pagedlist",{method:"POST",data:d()({},e)})}},c={Add:function(e){return(0,t.request)("/api/programlog/add",{method:"POST",data:d()({},e)})},Del:function(e){return(0,t.request)("/api/programlog/del",{method:"POST",data:d()({},e)})},Update:function(e){return(0,t.request)("/api/programlog/update",{method:"POST",data:d()({},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:d()({},e)})},PagedList:function(e){return(0,t.request)("/api/programlog/pagedlist",{method:"POST",data:d()({},e)})}},p={Add:function(e){return(0,t.request)("/api/userlog/add",{method:"POST",data:d()({},e)})},Del:function(e){return(0,t.request)("/api/userlog/del",{method:"POST",data:d()({},e)})},Update:function(e){return(0,t.request)("/api/userlog/update",{method:"POST",data:d()({},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:d()({},e)})},PagedList:function(e){return(0,t.request)("/api/userlog/pagedlist",{method:"POST",data:d()({},e)})}},g={Add:function(e){return(0,t.request)("/api/runlog/add",{method:"POST",data:d()({},e)})},Del:function(e){return(0,t.request)("/api/runlog/del",{method:"POST",data:d()({},e)})},Update:function(e){return(0,t.request)("/api/runlog/update",{method:"POST",data:d()({},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:d()({},e)})},PagedList:function(e){return(0,t.request)("/api/runlog/pagedlist",{method:"POST",data:d()({},e)})}}},48350:function(A,i,n){n.r(i);var P=n(15009),d=n.n(P),t=n(99289),E=n.n(t),c=n(13769),p=n.n(c),g=n(5574),r=n.n(g),e=n(67286),b=n(15513),j=n(27484),D=n.n(j),I=n(76239),U=n(71577),m=n(45360),T=n(67294),O=n(90503),u=n(85893),C=["type","defaultRender"],B=I.Z.RangePicker;i.default=function(){var W=(0,T.useState)("table"),S=r()(W,2),h=S[0],M=S[1],v=(0,T.useRef)(),L=(0,T.useRef)(),R=function(){var a,_;(a=v.current)===null||a===void 0||a.resetFields(),(_=L.current)===null||_===void 0||_.reload()},K=[{title:"\u4E3B\u952E",dataIndex:"id",hideInForm:!0,search:!1},{title:"\u8BBE\u5907\u540D\u79F0",dataIndex:"deviceName"},{title:"\u65F6\u95F4",dataIndex:"createDate",renderFormItem:function(a,_,l){var f=_.type,Z=_.defaultRender,o=p()(_,C);return(0,u.jsx)(B,{showTime:!0})},render:function(a,_){return(0,u.jsx)(u.Fragment,{children:_.createDate?D()(_.createDate).format("YYYY-MM-DD HH:mm:ss"):""})}},{title:"\u62A5\u8B66\u7B49\u7EA7",dataIndex:"grade"},{title:"\u62A5\u8B66\u7C7B\u578B",dataIndex:"logType"},{title:"\u62A5\u8B66\u503C",dataIndex:"value",search:!1},{title:"\u62A5\u8B66\u4FE1\u606F",dataIndex:"msgInfo",search:!1}];return(0,u.jsx)(u.Fragment,{children:(0,u.jsxs)(e.Z,{children:[h==="form"?(0,u.jsx)(U.ZP,{type:"link",onClick:function(){var a;(a=v.current)===null||a===void 0||a.resetFields(),M("table")},children:"\u2B05\u8FD4\u56DE"}):"",(0,u.jsx)(b.Z,{columns:K,type:h,formRef:v,actionRef:L,onSubmit:function(a){console.log(a),h==="form"&&(a.id?O.Xk.Update(a).then(function(_){_.statusCode===200?(m.ZP.info("\u66F4\u65B0\u6210\u529F!"),M("table"),R()):m.ZP.error(_.errors)}):O.Xk.Add(a).then(function(_){_.statusCode===200?(m.ZP.info("\u65B0\u589E\u6210\u529F!"),M("table"),R()):m.ZP.error(_.errors)}))},request:E()(d()().mark(function s(){var a,_,l,f=arguments;return d()().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return a=f.length>0&&f[0]!==void 0?f[0]:{},_={pageIndex:a.current||1,pageSize:a.pageSize||10,msgInfo:a.msgInfo,value:a.value,grade:a.grade,deviceName:a.deviceName,startTime:a.createDate?D()(a.createDate[0]):null,endTime:a.createDate?D()(a.createDate[1]):null},o.next=4,O.Xk.PagedList(_);case 4:if(l=o.sent,l.statusCode!==200){o.next=9;break}return o.abrupt("return",{data:l.data.items,success:!0,total:l.data.total});case 9:return o.abrupt("return",{data:[],success:!1,total:0});case 10:case"end":return o.stop()}},s)})),pagination:{pageSize:5,showSizeChanger:!1},rowKey:"id",dateFormatter:"string",headerTitle:"\u5217\u8868",toolBarRender:!1})]})})}}}]); |