集成,总结MES功能
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

2 lines
15 KiB

  1. "use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[990],{37387:function(C,S,t){var g=t(97857),l=t.n(g),u=t(56002);S.Z={Add:function(e){return(0,u.request)("/api/devicesinfo/add",{method:"POST",data:l()({},e)})},Del:function(e){return(0,u.request)("/api/devicesinfo/del",{method:"POST",data:l()({},e)})},Update:function(e){return(0,u.request)("/api/devicesinfo/update",{method:"POST",data:l()({},e)})},Detail:function(e){return(0,u.request)("/api/devicesinfo/detail?id=".concat(e),{method:"GET"})},List:function(){return(0,u.request)("/api/devicesinfo/list",{method:"POST"})},UnBindList:function(){return(0,u.request)("/api/devicesinfo/UnBindList",{method:"GET"})},PagedList:function(e){return(0,u.request)("/api/devicesinfo/pagedlist",{method:"POST",data:l()({},e)})},BatchUpdate:function(e){return(0,u.request)("/api/devicerecipe/batchupdate",{method:"POST",data:e})},RecipeList:function(e){return(0,u.request)(" api/devicerecipe/list",{method:"POST",data:{deviceId:e}})},selectlist:function(){return(0,u.request)("/api/devicesinfo/selectlist",{method:"GET"})}}},24493:function(C,S,t){var g=t(97857),l=t.n(g),u=t(56002);S.Z={Add:function(e){return(0,u.request)("/api/process/add",{method:"POST",data:l()({},e)})},Del:function(e){return(0,u.request)("/api/process/del",{method:"POST",data:l()({},e)})},Update:function(e){return(0,u.request)("/api/process/update",{method:"POST",data:l()({},e)})},Detail:function(e){return(0,u.request)("/api/process/detail?id=".concat(e),{method:"GET"})},List:function(e){return(0,u.request)("/api/process/list",{method:"POST",data:l()({},e)})},PagedList:function(e){return(0,u.request)("/api/process/pagedlist",{method:"POST",data:l()({},e)})},Selectlist:function(){return(0,u.request)("/api/process/selectlist",{method:"GET"})}}},93132:function(C,S,t){var g=t(97857),l=t.n(g),u=t(56002);S.Z={Add:function(e){return(0,u.request)("/api/productline/add",{method:"POST",data:l()({},e)})},Del:function(e){return(0,u.request)("/api/productline/del",{method:"POST",data:l()({},e)})},Update:function(e){return(0,u.request)("/api/productline/update",{method:"POST",data:l()({},e)})},Detail:function(e){return(0,u.request)("/api/productline/detail?id=".concat(e),{method:"GET"})},List:function(){return(0,u.request)("/api/productline/list",{method:"POST"})},selectlist:function(){return(0,u.request)("/api/productline/selectlist",{method:"GET"})},PagedList:function(e){return(0,u.request)("/api/productline/pagedlist",{method:"POST",data:l()({},e)})},Batchdevice:function(e){return(0,u.request)("/api/productline/addbatchdevice",{method:"POST",data:l()({},e)})},devicelist:function(e){return(0,u.request)("/api/productline/devicelist",{method:"POST",data:l()({},e)})}}},93561:function(C,S,t){var g=t(97857),l=t.n(g),u=t(56002);S.Z={Add:function(e){return(0,u.request)("/api/productlinesteps/add",{method:"POST",data:l()({},e)})},Del:function(e){return(0,u.request)("/api/productlinesteps/del",{method:"POST",data:l()({},e)})},Update:function(e){return(0,u.request)("/api/productlinesteps/update",{method:"POST",data:l()({},e)})},Detail:function(e){return(0,u.request)("/api/productlinesteps/detail?id=".concat(e),{method:"GET"})},List:function(e){return(0,u.request)("/api/productlinesteps/list",{method:"POST",data:l()({},e)})},PagedList:function(e){return(0,u.request)("/api/productlinesteps/pagedlist",{method:"POST",data:l()({},e)})},BatchUpdateStep:function(e){return(0,u.request)("/api/productlinesteps/batchupdate",{method:"POST",data:e})},Devicelist:function(e){return(0,u.request)("/api/productline/devicelist",{method:"POST",data:l()({},e)})}}},39140:function(C,S,t){t.r(S),t.d(S,{default:function(){return ve}});var g=t(15009),l=t.n(g),u=t(99289),d=t.n(u),e=t(5574),p=t.n(e),ie=t(51042),ue=t(83145),de=t(62763),W=t(42075),v=t(14726),z=t(86738),_=t(45360),P=t(8232),X=t(85576),B=t(34041),f=t(67294),oe=t(43775),le=t(60258),ce=t(87080),me=t(27484),pe=t.n(me),y=t(57632),D=t(93132),fe=t(24493),G=t(37387),Z=t(93561),he=[{id:"a1",data:{title:"XXX_API_a1",logo:"https://mdn.alipayobjects.com/huamei_ntgeqc/afts/img/A*kgyiRKi04eUAAAAAAAAAAAAADvuvAQ/original",description:"XXX_XXX_XXX_API"}},{id:"a2",data:{title:"XXX_API_a2",logo:"https://mdn.alipayobjects.com/huamei_ntgeqc/afts/img/A*kgyiRKi04eUAAAAAAAAAAAAADvuvAQ/original",description:"XXX_XXX_XXX_API"}},{id:"a3",data:{title:"XXX_API_a3",logo:"https://mdn.alipayobjects.com/huamei_ntgeqc/afts/img/A*kgyiRKi04eUAAAAAAAAAAAAADvuvAQ/original",description:"XXX_XXX_XXX_API"}}],we=[{id:"a1-a2",source:"a1",target:"a2"},{id:"a1-a3",source:"a1",target:"a3",type:"radius"}],r=t(85893),ve=function(){var _e=(0,f.useState)("table"),q=p()(_e,2),x=q[0],O=q[1],L=(0,f.useRef)(),w=(0,f.useRef)(),U=function(){var a,s;(a=L.current)===null||a===void 0||a.resetFields(),(s=w.current)===null||s===void 0||s.reload()},Pe=(0,f.useState)(!1),$=p()(Pe,2),Se=$[0],R=$[1],ge=(0,f.useState)(!1),J=p()(ge,2),Ae=J[0],E=J[1],Ee=(0,f.useState)(!1),V=p()(Ee,2),De=V[0],I=V[1],Ie=(0,f.useState)(0),Y=p()(Ie,2),$e=Y[0],Je=Y[1],je=[{title:"\u4E3B\u952E",dataIndex:"id",formItemProps:{hidden:!0},hideInSearch:!0},{title:"\u540D\u79F0",dataIndex:"name",ellipsis:!0,formItemProps:{rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}]}},{title:"\u63CF\u8FF0",dataIndex:"describe",search:!1},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createTime",render:function(a,s){return(0,r.jsx)(r.Fragment,{children:pe()(s.createTime).format("YYYY-MM-DD HH:mm:ss")})},search:!1,hideInForm:!0},{title:"\u64CD\u4F5C",valueType:"option",fixed:"right",render:function(a,s){return[(0,r.jsxs)(W.Z,{children:[(0,r.jsx)(v.ZP,{type:"primary",size:"small",onClick:function(){R(!0),Be({lineId:s.id})},target:"_blank",rel:"noopener noreferrer",children:"\u914D\u7F6E\u5DE5\u5E8F\u4E0E\u8BBE\u5907"},+new Date+Math.random()),(0,r.jsx)(v.ZP,{type:"primary",size:"small",onClick:function(){var o;O("form"),(o=L.current)===null||o===void 0||o.setFieldsValue(s)},target:"_blank",rel:"noopener noreferrer",children:"\u7F16\u8F91"},+new Date+Math.random()),(0,r.jsx)(z.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u6B64\u6761\u6570\u636E\u5417\uFF1F",onConfirm:function(){D.Z.Del(s).then(function(o){o.statusCode===200?(_.ZP.info("\u5220\u9664\u6210\u529F!"),U()):_.ZP.error(o.errors)})},onCancel:function(){_.ZP.info("\u5DF2\u53D6\u6D88\u5220\u9664")},okText:"\u786E\u8BA4",cancelText:"\u5173\u95ED",children:(0,r.jsx)(v.ZP,{type:"primary",danger:!0,size:"small",children:"\u5220\u9664"})},"del")]},+new Date+Math.random())]}}],Fe=(0,ce.kc)(function(){return{container:{width:"100%",height:"400px"}}}),Ze=(0,f.useState)(),Q=p()(Ze,2),Ve=Q[0],Ye=Q[1],Oe=(0,f.useState)(),H=p()(Oe,2),Qe=H[0],Te=H[1],Ce=(0,f.useState)(),ee=p()(Ce,2),T=ee[0],Be=ee[1],ye=P.Z.useForm(),xe=p()(ye,1),He=xe[0],Le=Fe(),et=Le.styles,N=(0,oe.Zi)(),tt=N.selectNode,nt=N.selectEdges,at=N.selectNodes,be=(0,le.R)(he),te=p()(be,3),rt=te[0],st=te[2],Me=(0,f.useState)(null),ne=p()(Me,2),it=ne[0],ut=ne[1],j=(0,f.useRef)(),Xe=(0,f.useState)([]),ae=p()(Xe,2),b=ae[0],Ue=ae[1],Re=(0,f.useState)([]),re=p()(Re,2),Ne=re[0],Ke=re[1],ke=P.Z.useForm(),We=p()(ke,1),M=We[0],ze=P.Z.useForm(),Ge=p()(ze,1),K=Ge[0],dt=P.Z.useWatch("processId",M);return(0,f.useEffect)(function(){fe.Z.List({name:""}).then(function(n){n.statusCode===200&&(console.log("processAPI.List",n.data),Ue(n.data))}),G.Z.selectlist().then(function(n){n.statusCode===200&&(console.log("v.data",n.data),Ke(n.data))})},[]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ue.Z,{columns:je,type:x,formRef:L,cardBordered:!0,bordered:!0,scroll:{x:!0},rowClassName:function(a,s,c){return s%2===0?"":"even-row-background"},actionRef:w,onSubmit:function(a){console.log(a),x==="form"&&(a.id?D.Z.Update(a).then(function(s){s.statusCode===200?(_.ZP.info("\u66F4\u65B0\u6210\u529F!"),O("table"),U()):_.ZP.error(s.errors)}):D.Z.Add(a).then(function(s){s.statusCode===200?(_.ZP.info("\u65B0\u589E\u6210\u529F!"),O("table"),U()):_.ZP.error(s.errors)}))},form:{ignoreRules:!0,submitter:{onReset:function(){var a;(a=L.current)===null||a===void 0||a.resetFields(),O("table")},searchConfig:{resetText:x==="form"?"\u8FD4\u56DE":"\u91CD\u7F6E",submitText:x==="form"?"\u63D0\u4EA4":"\u67E5\u8BE2"}}},request:d()(l()().mark(function n(){var a,s,c,o=arguments;return l()().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return a=o.length>0&&o[0]!==void 0?o[0]:{},s={pageIndex:a.current||1,pageSize:a.pageSize||10,name:a.name||""},i.next=4,D.Z.PagedList(s);case 4:if(c=i.sent,c.statusCode!==200){i.next=9;break}return i.abrupt("return",{data:c.data.items,success:!0,total:c.data.total});case 9:return i.abrupt("return",{data:[],success:!1,total:0});case 10:case"end":return i.stop()}},n)})),pagination:{pageSize:10,showSizeChanger:!1},rowKey:"id",dateFormatter:"string",headerTitle:"\u5217\u8868",toolBarRender:function(){return[(0,r.jsxs)(v.ZP,{type:"primary",onClick:function(){O("form")},children:[(0,r.jsx)(ie.Z,{}),"\u65B0\u5EFA"]},"3")]}}),(0,r.jsx)(X.Z,{open:Se,maskClosable:!1,footer:null,width:"80%",height:"80%",title:"\u914D\u7F6E\u5DE5\u827A\u6D41\u7A0B",onOk:function(){R(!1)},onCancel:function(a){return R(!1)},children:(0,r.jsx)(de.Z,{toolBarRender:function(){return[(0,r.jsx)(v.ZP,{type:"primary",onClick:function(){M.resetFields(),E(!0)},children:"\u6DFB\u52A0\u6B65\u9AA4"},new Date().toDateString())]},actionRef:j,columns:[{title:"\u5DE5\u5E8F",dataIndex:"step",tooltip:"\u62D6\u62FD\u66F4\u6539\u987A\u5E8F",align:"center",hideInSearch:!0,render:function(a,s,c){return(0,r.jsx)("span",{className:"customRender",children:"".concat(c+1)})}},{title:"\u4E3B\u952E",dataIndex:"id",align:"center",hideInSearch:!0},{title:"\u5DE5\u827A\u540D\u79F0",dataIndex:"processId",align:"center",width:120,hideInSearch:!0,render:function(a,s,c,o,m){var i;return(0,r.jsx)(r.Fragment,{children:(i=b.find(function(h){return h.id==s.processId}))===null||i===void 0?void 0:i.name})}},{title:"\u5DE5\u827A\u7C7B\u578B",dataIndex:"processType",align:"center",width:120,hideInSearch:!0,render:function(a,s,c,o,m){var i;return(0,r.jsx)(r.Fragment,{children:((i=b.find(function(h){return h.id==s.processId}))===null||i===void 0?void 0:i.processType)==0?"\u4EBA\u5DE5":"\u8BBE\u5907"})}},{title:"\u5DE5\u827A\u8BBE\u5907",dataIndex:"deviceId",align:"center",hideInSearch:!0,valueType:"select",request:function(){var n=d()(l()().mark(function s(){var c,o;return l()().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,G.Z.selectlist();case 2:return c=i.sent,o=c.data,o.map(function(h){return h.label=h.value,h.value=h.key}),i.abrupt("return",o);case 6:case"end":return i.stop()}},s)}));function a(){return n.apply(this,arguments)}return a}()},{title:"\u64CD\u4F5C",align:"center",valueType:"option",key:"option",render:function(a,s,c,o){var m;return[(0,r.jsxs)(W.Z,{size:"middle",children:[(0,r.jsx)(v.ZP,{type:"primary",ghost:!0,onClick:d()(l()().mark(function i(){var h;return l()().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:h=JSON.parse(JSON.stringify(s)),M.setFieldsValue(h),E(!0);case 3:case"end":return F.stop()}},i)})),children:"\u7F16\u8F91"},(0,y.Z)()),(0,r.jsx)(v.ZP,{disabled:((m=b.find(function(i){return i.id==s.processId}))===null||m===void 0?void 0:m.processType)==0,type:"primary",ghost:!0,onClick:d()(l()().mark(function i(){return l()().wrap(function(A){for(;;)switch(A.prev=A.next){case 0:D.Z.devicelist({stepId:s.id,lineId:""}).then(function(F){if(F.statusCode===200){var k=JSON.parse(JSON.stringify(s));k.deviceId=F.data.map(function(qe){return qe.deviceId}),K.setFieldsValue(k),console.log("\u914D\u7F6E\u8BBE\u5907",k),I(!0)}else{var se=JSON.parse(JSON.stringify(s));K.setFieldsValue(se),console.log("\u914D\u7F6E\u8BBE\u5907",se),I(!0)}});case 1:case"end":return A.stop()}},i)})),children:"\u914D\u7F6E\u8BBE\u5907"},(0,y.Z)()),(0,r.jsx)(z.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u6B64\u6761\u6570\u636E\u5417\uFF1F",onConfirm:function(){var h={id:s.id};Z.Z.Del(h).then(function(A){A.statusCode===200&&(_.ZP.success(A.statusCode===200?"\u5220\u9664\u6210\u529F":A.message),o==null||o.reload())})},onCancel:function(){_.ZP.info("\u5DF2\u53D6\u6D88\u5220\u9664")},okText:"\u786E\u8BA4",cancelText:"\u5173\u95ED",children:(0,r.jsx)(v.ZP,{type:"primary",danger:!0,ghost:!0,children:"\u5220\u9664"})},(0,y.Z)())]},(0,y.Z)())]}}],rowKey:"step",search:!1,pagination:{pageSize:100,showSizeChanger:!1},params:T,request:d()(l()().mark(function n(){var a,s,c,o=arguments;return l()().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return a=o.length>0&&o[0]!==void 0?o[0]:{},s={lineId:a.lineId},i.next=4,Z.Z.List(s);case 4:if(c=i.sent,c.statusCode!==200){i.next=10;break}return Te(c.data),i.abrupt("return",{data:c.data,success:!0});case 10:return i.abrupt("return",{data:[],success:!1,total:0});case 11:case"end":return i.stop()}},n)})),dragSortKey:"step",onDragSortEnd:function(a,s,c){console.log("newDataSource",c),c.map(function(o,m){o.step=m+1}),console.log("\u6392\u5E8F\u540E\u7684\u6570\u636E",c),Z.Z.BatchUpdateStep(c).then(function(o){if(o.data){var m;(m=j.current)===null||m===void 0||m.reload(),_.ZP.success("\u4FEE\u6539\u5217\u8868\u6392\u5E8F\u6210\u529F")}})}})}),(0,r.jsx)(X.Z,{open:Ae,maskClosable:!1,title:"\u6DFB\u52A0\u6B65\u9AA4",footer:[(0,r.jsx)(v.ZP,{onClick:function(){E(!1)},children:"\u8FD4\u56DE"},"back"),(0,r.jsx)(v.ZP,{form:"addprocessForm",type:"primary",htmlType:"submit",children:"\u63D0\u4EA4"},"submit")],onOk:function(){E(!1)},onCancel:function(a){return E(!1)},children:(0,r.jsxs)(P.Z,{id:"addprocessForm",form:M,onFinish:function(a){if(console.log(a),a.id){var s={step:0,processId:a.processId,id:a.id,lineId:T.lineId,processName:""};Z.Z.Update(s).then(function(o){if(o.statusCode===200){var m;E(!1),(m=j.current)===null||m===void 0||m.reload()}})}else{var c={step:0,processId:a.processId,id:"",lineId:T.lineId,processName:""};Z.Z.Add(c).then(function(o){if(o.statusCode===200){var m;E(!1),(m=j.current)===null||m===void 0||m.reload()}})}},children:[(0,r.jsx)(P.Z.Item,{label:"\u4E3B\u952E",name:"id",hidden:!0}),(0,r.jsx)(P.Z.Item,{label:"\u6B65\u9AA4",name:"step",hidden:!0}),(0,r.jsx)(P.Z.Item,{label:"\u5DE5\u827A",name:"processId",rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}],children:(0,r.jsx)(B.Z,{onChange:function(a){},placeholder:"\u8BF7\u9009\u62E9\u5DE5\u827A",style:{width:375},children:b.map(function(n){return(0,r.jsx)(B.Z.Option,{value:n.id,children:(0,r.jsx)("span",{children:n.name})},n.id)})})})]})}),(0,r.jsx)(X.Z,{open:De,maskClosable:!1,width:500,title:"\u914D\u7F6E\u5DE5\u827A\u6240\u9700\u8BBE\u5907",footer:[(0,r.jsx)(v.ZP,{onClick:function(){I(!1)},children:"\u8FD4\u56DE"},"back"),(0,r.jsx)(v.ZP,{form:"adddeviceForm",type:"primary",htmlType:"submit",children:"\u63D0\u4EA4"},"submit")],onOk:function(){I(!1)},onCancel:function(){I(!1)},children:(0,r.jsxs)(P.Z,{form:K,id:"adddeviceForm",onFinish:function(a){console.log(a,T);var s={id:a.id,lineId:T.lineId,deviceId:a.deviceId};D.Z.Batchdevice(s).then(function(c){if(c.statusCode===200){var o;_.ZP.info("\u66F4\u65B0\u6210\u529F!"),I(!1),(o=j.current)===null||o===void 0||o.reload()}else{var m;_.ZP.info(c.errors),(m=j.current)===null||m===void 0||m.reload()}})},children:[(0,r.jsx)(P.Z.Item,{label:"\u4E3B\u952E",name:"id",hidden:!0}),(0,r.jsx)(P.Z.Item,{label:"\u8BF7\u9009\u62E9\u8BBE\u5907",name:"deviceId",rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}],children:(0,r.jsx)(B.Z,{mode:"multiple",placeholder:"\u8BF7\u9009\u62E9\u8BBE\u5907",style:{width:375},children:Ne.map(function(n){return(0,r.jsx)(B.Z.Option,{value:n.key,children:(0,r.jsx)("span",{children:n.value})},n.key)})})})]})})]})}}}]);