|
|
|
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[776],{47870:function(J,C,a){a.r(C),a.d(C,{default:function(){return O}});var D=a(15009),f=a.n(D),E=a(99289),F=a.n(E),V=a(5574),S=a.n(V),k=a(51042),$=a(74254),d=a(40741),B=a(86738),c=a(45360),P=a(15867),G=a(5914),g=a(12096),y=a(67294),L=a(97857),I=a.n(L),h=a(12578),j={Getdatavalarmlimitpage:function(l){return(0,h.request)("/api/kepdata/getdatavalarmlimitlist",{method:"POST",data:I()({},l)})},Adddatavalarmlimit:function(l){return(0,h.request)("/api/kepdata/adddatavalarmlimit",{method:"POST",data:I()({},l)})},Updatedatavalarmlimit:function(l){return(0,h.request)("/api/kepdata/updatedatavalarmlimit",{method:"POST",data:I()({},l)})},Del:function(l){return(0,h.request)("/api/kepdata/deldatavalarmlimitlist/"+l,{method:"POST"})},getdatavData:function(){return(0,h.request)("/api/kepdata/getdatavlist",{method:"GET"})},getlogs:function(){return(0,h.request)("/api/kepdata/getlogs",{method:"GET"})}},e=a(85893),O=function(){var n=(0,y.useRef)(),l=(0,y.useState)({}),A=S()(l,2),b=A[0],U=A[1],z=(0,y.useState)(!1),R=S()(z,2),M=R[0],x=R[1],H=d.Z.useForm(),K=S()(H,1),T=K[0],N=0,W=[{title:"id",dataIndex:"id",key:"id",hideInSearch:!0},{title:"\u540D\u79F0",dataIndex:"name",key:"name"},{title:"\u4EE3\u7801",dataIndex:"code",key:"code"},{title:"\u6700\u5C0F\u533A\u95F4\u503C",dataIndex:"minLimitValue",key:"minLimitValue",hideInSearch:!0},{title:"\u6700\u5927\u533A\u95F4\u503C",dataIndex:"maxLimitValue",key:"maxLimitValue",hideInSearch:!0},{title:"\u64CD\u4F5C",valueType:"option",key:"option",render:function(o,s,v,i){return[(0,e.jsx)("a",{onClick:function(){U(s),T.setFieldsValue(s),x(!0)},children:"\u7F16\u8F91"},"editable"),(0,e.jsx)(B.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u5417\uFF1F",onConfirm:F()(f()().mark(function t(){var m,r;return f()().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,j.Del(s.id);case 2:m=Z.sent,m.data?(c.ZP.success("\u5220\u9664\u6210\u529F"),(r=n.current)===null||r===void 0||r.reload()):c.ZP.error(m.msg||"\u5220\u9664\u5931\u8D25");case 4:case"end":return Z.stop()}},t)})),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,e.jsx)("a",{children:"\u5220\u9664"})},"del")]}}];return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)($.Z,{columns:W,actionRef:n,cardBordered:!0,rowKey:"id",request:F()(f()().mark(function p(){var o,s,v,i,t=arguments;return f()().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return o=t.length>0&&t[0]!==void 0?t[0]:{},s=t.length>1?t[1]:void 0,v=t.length>2?t[2]:void 0,console.log(s,v),r.next=6,j.Getdatavalarmlimitpage({pageIndex:o.current||1,pageSize:o.pageSize||10});case 6:if(i=r.sent,i.statusCode!==200){r.next=11;break}return r.abrupt("return",{data:i.data.items,success:!0,total:i.data.total});case 11:return c.ZP.error(i.errors||"\u83B7\u53D6\u5217\u8868\u5931\u8D25"),r.abrupt("return",{data:[],success:!1,total:0});case 13:case"end":return r.stop()}},p)})),search:{labelWidth:"auto"},options:{setting:{listsHeight:400}},headerTitle:"\u5927\u5C4F\u914D\u7F6E",toolBarRender:function(){return[(0,e.jsx)(P.ZP,{icon:(0,e.jsx)(k.Z,{}),onClick:function(){T.resetFields(),x(!0)},type:"primary",children:"\u65B0\u5EFA"},"button")]}}),(0,e.jsx)(G.Z,{footer:null,title:b.id===""?"\u6DFB\u52A0":"\u7F16\u8F91",open:M,onCancel:function(){return x(!1)},children:(0,e.jsxs)(d.Z,{name:"basic",form:T,onFinish:function(){var p=F()(f()().mark(function o(s){var v,i,t,m;return f()().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!s.id){u.next=7;break}return u.next=3,j.Updatedatavalarmlimit(s);case 3:v=u.sent,v.data?(c.ZP.success("\u66F4\u65B0\u4FE1\u606F\u6210\u529F"),x(!1),(i=n.current)===null||i===void 0||i.reload()):c.ZP.error(v.msg||"\u66F4\u65B0\u4FE1\u606F\u5931\u8D25"),u.next=11;break;case 7:return u.next=9,j.Adddatavalarmlimit(s);case 9:t=u.sent,t.data?(c.ZP.success("\u521B\u5EFA\u6210\u529F"),x(!1),(m=n.current)===null||m===void 0||m.reload()):c.ZP.error(t.msg||"\u521B\u5EFA\u5931\u8D25");case 11:case"end":return u.stop()}},o)}));return function(o){return p.apply(this,arguments)}}(),children:[(0,e.jsx)(d.Z.Item,{label:"id",name:"id",hidden:!0,children:(0,e.jsx)(g.Z,{})}),(0,e.jsx)(d.Z.Item,{label:"\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF01"}],children:(0,e.jsx)(g.Z,{})}),(0,e.jsx)(d.Z.Item,{label:"\u4EE3\u7801",name:"code",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\uFF01"}],children:(0,e.jsx)(g.Z,{})}),(0,e.jsx)(d.Z.Item,{label:"\u6700\u5C0F\u533A\u95F4\u503C",name:"minLimitValue",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u503C\uFF01"}],children:(0,e.jsx)(g.Z,{})}),(0,e.jsx)(d.Z.Item,{label:"\u6700\u5927\u533A\u95F4\u503C",name:"maxLimitValue",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u503C\uFF01"}],children:(0,e.jsx)(g.Z,{})}),(0,e.jsx)(d.Z.Item,{children:(0,e.jsx)(P.ZP,{type:"primary",htmlType:"submit",children:"\u786E\u5B9A"})})]})})]})}}}]); |