-
Notifications
You must be signed in to change notification settings - Fork 0
/
p__Main.c070776f.async.js
1 lines (1 loc) · 4.64 KB
/
p__Main.c070776f.async.js
1
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[363],{66948:function(R,Z,e){"use strict";e.r(Z),e.d(Z,{default:function(){return $}});var E=e(32059),T=e(34792),y=e(55026),l=e(3182),h=e(2824),j=e(94043),t=e.n(j),o=e(67294),D=e(52473),P=e(98537),a=e(16589),C=e(84787),U=e(48773),I=e(59544),v=e(11849),A=e(49498);function K(p,c){return B.apply(this,arguments)}function B(){return B=(0,l.Z)(t().mark(function p(c,g){return t().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.abrupt("return",(0,A.WY)("/start",(0,v.Z)((0,v.Z)({method:"GET",params:(0,v.Z)({},c)},g||{}),{},{skipErrorHandler:!0})));case 1:case"end":return m.stop()}},p)})),B.apply(this,arguments)}var M=e(3675);function W(p){return b.apply(this,arguments)}function b(){return b=(0,l.Z)(t().mark(function p(c){return t().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.abrupt("return",(0,A.WY)("/stop",(0,v.Z)((0,v.Z)({method:"GET"},c||{}),{},{skipErrorHandler:!0})));case 1:case"end":return d.stop()}},p)})),b.apply(this,arguments)}var n=e(85893),G=function(){var c=(0,o.useState)(!1),g=(0,h.Z)(c,2),d=g[0],m=g[1],L=(0,o.useState)(0),F=(0,h.Z)(L,2),z=F[0],x=F[1],H=(0,o.useState)(0),O=(0,h.Z)(H,2),Y=O[0],w=O[1];return(0,o.useEffect)(function(){var i=setInterval(function(){var s=(0,M.i)();s.then(function(r){x(r.temp/10)}).catch(function(r){console.log(r)})},5e3);return function(){clearInterval(i)}},[]),(0,o.useEffect)(function(){var i=(0,M.i)();i.then(function(){var s=(0,l.Z)(t().mark(function r(f){return t().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:x(f.temp/10),f.running&&f.remain!=null&&w(Date.now()+1e3*f.remain),m(f.running);case 3:case"end":return S.stop()}},r)}));return function(r){return s.apply(this,arguments)}}()).catch(function(s){console.log(s)})},[]),(0,n.jsx)(D.ZP,{pageHeaderRender:!1,children:(0,n.jsxs)(C.ZP,{direction:"column",style:{width:"100%",alignItems:"center"},ghost:!0,gutter:[16,16],children:[(0,n.jsx)(U.Z,{style:{width:300,height:260},layout:"center",direction:"column",title:"\u5F53\u524D\u6E29\u5EA6",statistic:{value:z,suffix:"\u2103",precision:1,valueStyle:{fontSize:56}}}),d?(0,n.jsxs)(C.ZP,{layout:"center",direction:"column",style:{width:300,height:260},title:"\u5269\u4F59\u65F6\u95F4",children:[(0,n.jsx)(I.Z,{value:Y,onFinish:function(){return console.log("finish")},valueStyle:{fontSize:56}}),(0,n.jsx)(P.ZP,{onFinish:(0,l.Z)(t().mark(function i(){return t().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,W();case 3:return m(!1),r.abrupt("return",!0);case 7:return r.prev=7,r.t0=r.catch(0),y.ZP.error("\u505C\u6B62\u5931\u8D25"),r.abrupt("return",!1);case 11:case"end":return r.stop()}},i,null,[[0,7]])})),submitter:{searchConfig:{submitText:"\u505C\u6B62"},submitButtonProps:{danger:!0,size:"large"},resetButtonProps:{style:{display:"none"}}}})]}):(0,n.jsx)(C.ZP,{title:"\u8BBE\u7F6E",style:{width:300},children:(0,n.jsxs)(P.ZP,{initialValues:{temp:42,time:9},layout:"vertical",submitter:{searchConfig:{submitText:"\u542F\u52A8"},resetButtonProps:{style:{display:"none"}},submitButtonProps:{size:"large"}},onFinish:function(){var i=(0,l.Z)(t().mark(function s(r){return t().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,u.next=3,K(r);case 3:return w(Date.now()+r.time*1e3),m(!0),u.abrupt("return",!0);case 8:return u.prev=8,u.t0=u.catch(0),y.ZP.error("\u542F\u52A8\u5931\u8D25"),u.abrupt("return",!1);case 12:case"end":return u.stop()}},s,null,[[0,8]])}));return function(s){return i.apply(this,arguments)}}(),children:[(0,n.jsx)(a.Z,{required:!0,label:"\u8BBE\u5B9A\u6E29\u5EA6",name:"temp",width:"xs",min:1,max:100,fieldProps:{addonAfter:"\u2103",step:1,precision:0},transform:function(s,r){return(0,E.Z)({},r,s*10)}}),(0,n.jsx)(a.Z,{required:!0,label:"\u8BBE\u5B9A\u65F6\u95F4",name:"time",width:"xs",min:4,max:12,fieldProps:{addonAfter:"\u5C0F\u65F6",step:.5,precision:1},transform:function(s,r){return(0,E.Z)({},r,s*60*60)}}),(0,n.jsxs)(P.ZP.Group,{title:"\u9AD8\u7EA7\u9009\u9879",collapsible:!0,defaultCollapsed:!0,children:[(0,n.jsx)(a.Z,{label:"Kp",name:"kp",width:"xs",min:0,fieldProps:{precision:1}}),(0,n.jsx)(a.Z,{label:"Ki",name:"ki",width:"xs",min:0,fieldProps:{precision:1}}),(0,n.jsx)(a.Z,{label:"Kd",name:"kd",width:"xs",min:0,fieldProps:{precision:1}})]})]})})]})})},$=G},3675:function(R,Z,e){"use strict";e.d(Z,{i:function(){return j}});var E=e(11849),T=e(3182),y=e(94043),l=e.n(y),h=e(49498);function j(o){return t.apply(this,arguments)}function t(){return t=(0,T.Z)(l().mark(function o(D){return l().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,h.WY)("/status",(0,E.Z)({method:"GET"},D||{})));case 1:case"end":return a.stop()}},o)})),t.apply(this,arguments)}}}]);