集成,总结MES功能
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

2 righe
4.2 KiB

  1. "use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[988],{24493:function(R,f,e){var M=e(97857),o=e.n(M),a=e(56002);f.Z={Add:function(n){return(0,a.request)("/api/process/add",{method:"POST",data:o()({},n)})},Del:function(n){return(0,a.request)("/api/process/del",{method:"POST",data:o()({},n)})},Update:function(n){return(0,a.request)("/api/process/update",{method:"POST",data:o()({},n)})},Detail:function(n){return(0,a.request)("/api/process/detail?id=".concat(n),{method:"GET"})},List:function(n){return(0,a.request)("/api/process/list",{method:"POST",data:o()({},n)})},PagedList:function(n){return(0,a.request)("/api/process/pagedlist",{method:"POST",data:o()({},n)})},Selectlist:function(){return(0,a.request)("/api/process/selectlist",{method:"GET"})}}},60744:function(R,f,e){e.r(f);var M=e(15009),o=e.n(M),a=e(99289),u=e.n(a),n=e(5574),T=e.n(n),B=e(51042),L=e(83145),b=e(42075),h=e(14726),g=e(86738),m=e(45360),E=e(67294),S=e(27484),F=e.n(S),P=e(24493),_=e(85893);f.default=function(){var U=(0,E.useState)("table"),v=T()(U,2),D=v[0],c=v[1],p=(0,E.useRef)(),j=(0,E.useRef)(),x=(0,E.useState)(),I=T()(x,2),O=I[0],C=I[1],A=function(){var t,r;(t=p.current)===null||t===void 0||t.resetFields(),(r=j.current)===null||r===void 0||r.reload()},K=[{title:"\u4E3B\u952E",dataIndex:"id",hideInForm:!0,hideInSearch:!0},{title:"\u540D\u79F0",dataIndex:"name",ellipsis:!0,formItemProps:{rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}]}},{title:"\u7C7B\u578B",hideInDescriptions:!0,dataIndex:"processType",search:!1,valueEnum:{0:{text:"\u4EBA\u5DE5"},1:{text:"\u8BBE\u5907"}},formItemProps:{rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}]}},{title:"\u63CF\u8FF0",dataIndex:"des",search:!1},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createTime",render:function(t,r){return(0,_.jsx)(_.Fragment,{children:F()(r.createTime).format("YYYY-MM-DD HH:mm:ss")})},search:!1,hideInForm:!0},{title:"\u64CD\u4F5C",valueType:"option",fixed:"right",render:function(t,r){return[(0,_.jsxs)(b.Z,{children:[(0,_.jsx)(h.ZP,{type:"primary",size:"small",onClick:function(){var s;c("form"),C(r),(s=p.current)===null||s===void 0||s.setFieldsValue(r)},target:"_blank",rel:"noopener noreferrer",children:"\u7F16\u8F91"},+new Date+Math.random()),(0,_.jsx)(g.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u6B64\u6761\u6570\u636E\u5417\uFF1F",onConfirm:function(){P.Z.Del(r).then(function(s){s.statusCode===200?(m.ZP.info("\u5220\u9664\u6210\u529F!"),A()):m.ZP.error(s.errors)})},onCancel:function(){m.ZP.info("\u5DF2\u53D6\u6D88\u5220\u9664")},okText:"\u786E\u8BA4",cancelText:"\u5173\u95ED",children:(0,_.jsx)(h.ZP,{type:"primary",danger:!0,size:"small",children:"\u5220\u9664"})},"del")]},+new Date+Math.random())]}}];return(0,_.jsx)(_.Fragment,{children:(0,_.jsx)(L.Z,{columns:K,type:D,formRef:p,actionRef:j,cardBordered:!0,bordered:!0,scroll:{x:!0},rowClassName:function(t,r,i){return r%2===0?"":"even-row-background"},onSubmit:function(t){t.id=O==null?void 0:O.id,console.log(t),D==="form"&&(t.id?P.Z.Update(t).then(function(r){r.statusCode===200?(m.ZP.info("\u66F4\u65B0\u6210\u529F!"),c("table"),A()):m.ZP.error(r.errors)}):P.Z.Add(t).then(function(r){r.statusCode===200?(m.ZP.info("\u65B0\u589E\u6210\u529F!"),c("table"),A()):m.ZP.error(r.errors)}))},form:{ignoreRules:!0,submitter:{onReset:function(){var t;(t=p.current)===null||t===void 0||t.resetFields(),c("table")},searchConfig:{resetText:D==="form"?"\u8FD4\u56DE":"\u91CD\u7F6E",submitText:D==="form"?"\u63D0\u4EA4":"\u67E5\u8BE2"}}},request:u()(o()().mark(function d(){var t,r,i,s=arguments;return o()().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return t=s.length>0&&s[0]!==void 0?s[0]:{},r={pageIndex:t.current||1,pageSize:t.pageSize||10,name:t.name||""},l.next=4,P.Z.PagedList(r);case 4:if(i=l.sent,i.statusCode!==200){l.next=9;break}return l.abrupt("return",{data:i.data.items,success:!0,total:i.data.total});case 9:return l.abrupt("return",{data:[],success:!1,total:0});case 10:case"end":return l.stop()}},d)})),pagination:{pageSize:10,showSizeChanger:!1},rowKey:"id",dateFormatter:"string",headerTitle:"\u5217\u8868",toolBarRender:function(){return[(0,_.jsxs)(h.ZP,{type:"primary",onClick:function(){c("form"),C({id:"",createTime:new Date})},children:[(0,_.jsx)(B.Z,{}),"\u65B0\u5EFA"]},"3")]}})})}}}]);