胖子天骄的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
12 KiB

  1. "use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[402],{77386:function(J,E,t){var T=t(97857),m=t.n(T),s=t(12578);E.Z={Add:function(i){return(0,s.request)("/api/deviceProduct/add",{method:"POST",data:m()({},i)})},Del:function(i){return(0,s.request)("/api/deviceProduct/del",{method:"POST",data:m()({},i)})},Update:function(i){return(0,s.request)("/api/deviceProduct/update",{method:"POST",data:m()({},i)})},Detail:function(i){return(0,s.request)("/api/deviceProduct/detail?id=".concat(i),{method:"GET"})},List:function(i){return(0,s.request)("/api/deviceProduct/list",{method:"POST",data:m()({},i)})},PagedList:function(i){return(0,s.request)("/api/deviceProduct/pagedlist",{method:"POST",data:m()({},i)})},SelectList:function(){return(0,s.request)("/api/deviceProduct/selectlist",{method:"GET"})}}},16940:function(J,E,t){var T=t(97857),m=t.n(T),s=t(12578);E.Z={Add:function(i){return(0,s.request)("/api/deviceproductfunction/add",{method:"POST",data:m()({},i)})},Del:function(i){return(0,s.request)("/api/deviceproductfunction/del",{method:"POST",data:m()({},i)})},Update:function(i){return(0,s.request)("/api/deviceproductfunction/update",{method:"POST",data:m()({},i)})},Detail:function(i){return(0,s.request)("/api/deviceproductfunction/detail?id=".concat(i),{method:"GET"})},List:function(i){return(0,s.request)("/api/deviceproductfunction/list",{method:"POST",data:m()({},i)})},PagedList:function(i){return(0,s.request)("/api/deviceproductfunction/pagedlist",{method:"POST",data:m()({},i)})}}},69640:function(J,E,t){t.r(E),t.d(E,{default:function(){return he}});var T=t(19632),m=t.n(T),s=t(15009),l=t.n(s),i=t(99289),c=t.n(i),b=t(5574),j=t.n(b),N=t(82826),U=t(51042),W=t(26346),a=t(34994),u=t(67286),Z=t(15513),S=t(57632),P=t(12029),B=t(42075),Y=t(86738),p=t(45360),D=t(71577),ce=t(71230),fe=t(96074),me=t(5914),O=t(12096),ve=t(34041),x=t(67294),M=t(77386),L=t(16940),e=t(85893),pe=[{label:"\u6570\u636E",value:0},{label:"\u6570\u7EC4",value:1}],he=function(){var Ce=(0,x.useState)("table"),w=j()(Ce,2),G=w[0],I=w[1],$=(0,x.useRef)(),_=(0,x.useRef)(),Pe=(0,x.useState)("table"),q=j()(Pe,2),H=q[0],R=q[1],k=(0,x.useRef)(),ee=(0,x.useRef)(),xe=P.Z.useForm(),Fe=j()(xe,1),z=Fe[0],je=(0,x.useState)(),te=j()(je,2),C=te[0],Ze=te[1],ge=(0,x.useState)([]),ne=j()(ge,2),g=ne[0],y=ne[1],Ee=(0,x.useState)(),re=j()(Ee,2),ae=re[0],ue=re[1],Se=(0,x.useState)(!1),ie=j()(Se,2),De=ie[0],K=ie[1],ye=(0,x.useState)(!1),oe=j()(ye,2),de=oe[0],se=oe[1],V=function(){var n,r;(n=$.current)===null||n===void 0||n.resetFields(),(r=_.current)===null||r===void 0||r.reload()},le=function(){var n,r;(n=k.current)===null||n===void 0||n.resetFields(),(r=ee.current)===null||r===void 0||r.reload()},Te=[{title:"\u4E3B\u952E",dataIndex:"id",hideInForm:!0,search:!1},{title:"\u540D\u79F0",dataIndex:"name",ellipsis:!0},{title:"\u7F16\u7801",hideInTable:!0,hideInDescriptions:!0,dataIndex:"code",search:!1},{title:"\u63CF\u8FF0",dataIndex:"description",width:120,search:!1},{title:"\u64CD\u4F5C",valueType:"option",dataIndex:"id",render:function(n,r){return[(0,e.jsxs)(B.Z,{children:[(0,e.jsx)("a",{onClick:function(){var d;I("form"),(d=$.current)===null||d===void 0||d.setFieldsValue(r)},target:"_blank",rel:"noopener noreferrer",children:"\u7F16\u8F91"},+new Date+Math.random()),(0,e.jsx)("a",{onClick:function(){se(!0),Ze(r),y([])},children:"\u8BBE\u7F6E\u529F\u80FD"}),(0,e.jsx)(Y.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u6B64\u6761\u6570\u636E\u5417\uFF1F",onConfirm:function(){M.Z.Del(r).then(function(d){d.statusCode===200?(p.ZP.info("\u5220\u9664\u6210\u529F!"),V()):p.ZP.error(d.errors)})},onCancel:function(){p.ZP.info("\u5DF2\u53D6\u6D88\u5220\u9664")},okText:"\u786E\u8BA4",cancelText:"\u5173\u95ED",children:(0,e.jsx)("a",{children:"\u5220\u9664"})},"del")]},+new Date+Math.random())]}}];return(0,e.jsx)(e.Fragment,{children:de?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(u.Z,{bordered:!0,children:de?(0,e.jsx)(D.ZP,{icon:(0,e.jsx)(N.Z,{}),type:"link",size:"large",onClick:function(){se(!1)},children:"\u8FD4\u56DE\u4EA7\u54C1\u5217\u8868"}):""}),(0,e.jsxs)(u.Z,{bordered:!0,children:[(0,e.jsxs)("div",{children:["\u4EA7\u54C1\u540D\u79F0\uFF1A",C==null?void 0:C.name]}),(0,e.jsxs)("div",{children:["\u4EA7\u54C1\u63CF\u8FF0\uFF1A",C==null?void 0:C.description]})]}),(0,e.jsxs)(u.Z,{children:[(0,e.jsx)(B.Z,{direction:"vertical",children:H==="form"?(0,e.jsx)(D.ZP,{type:"primary",icon:(0,e.jsx)(W.Z,{}),onClick:function(){var n;(n=k.current)===null||n===void 0||n.resetFields(),R("table")},children:"\u8FD4\u56DE\u529F\u80FD\u5217\u8868"}):""}),(0,e.jsx)(Z.Z,{type:H,headerTitle:"\u5217\u8868",formRef:k,actionRef:ee,search:!1,columns:[{title:"\u529F\u80FD\u4E3B\u952E",dataIndex:"id",search:!1,readonly:!0},{title:"\u529F\u80FD\u540D\u79F0",dataIndex:"name",ellipsis:!0,search:!1},{title:"\u529F\u80FD\u7F16\u7801",hideInDescriptions:!0,dataIndex:"code",search:!1},{title:"\u8F93\u5165\u53C2\u6570",hideInDescriptions:!0,hideInTable:!0,dataIndex:"params",search:!1,renderFormItem:function(n,r,f,d){return(0,e.jsxs)("div",{children:[g.map(function(F,o){return(0,e.jsx)(ce.Z,{style:{borderBottom:"0.5px solid #f3e0e0",margin:"10px"},children:(0,e.jsxs)(B.Z,{split:(0,e.jsx)(fe.Z,{type:"vertical"}),children:[(0,e.jsxs)("div",{children:["\u53C2\u6570\u540D\u79F0\uFF1A",F.paramName]}),(0,e.jsxs)("div",{children:["\u53C2\u6570\u4EE3\u7801\uFF1A",F.paramCode]}),(0,e.jsx)(D.ZP,{type:"link",onClick:function(){K(!0),setTimeout(function(){z.setFieldsValue(g[o])},100)},children:"\u8BBE\u7F6E"}),(0,e.jsx)(D.ZP,{type:"link",onClick:function(){var h=m()(g);h.splice(o,1),setTimeout(function(){y(h)},100)},children:"\u5220\u9664"})]})},+new Date+Math.random())}),(0,e.jsx)(D.ZP,{type:"link",onClick:function(){z.resetFields(),K(!0)},children:"+\u589E\u52A0\u53C2\u6570"}),(0,e.jsx)(me.Z,{maskClosable:!1,destroyOnClose:!0,title:"\u8BBE\u7F6E\u53C2\u6570",footer:!1,onCancel:function(){return K(!1)},open:De,children:(0,e.jsxs)(a.A,{form:z,id:"paramsForm",onFinish:function(){var F=c()(l()().mark(function o(Q){var h;return l()().wrap(function(X){for(;;)switch(X.prev=X.next){case 0:console.log(Q),h=z.getFieldsValue(),h.id?(g.forEach(function(A){A.id===h.id&&(A.paramCode=h.paramCode,A.paramName=h.paramName,A.paramType=h.paramType,A.paramUnit=h.paramUnit)}),y(g)):(h.id=(0,S.Z)(),g.push(h)),y(g),console.log(h),K(!1);case 6:case"end":return X.stop()}},o)}));return function(o){return F.apply(this,arguments)}}(),children:[(0,e.jsx)(P.Z.Item,{label:"\u4E3B\u952E",hidden:!0,name:"id",children:(0,e.jsx)(O.Z,{})}),(0,e.jsx)(P.Z.Item,{label:"\u53C2\u6570\u540D\u79F0",name:"paramName",rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}],children:(0,e.jsx)(O.Z,{})}),(0,e.jsx)(P.Z.Item,{label:"\u53C2\u6570\u4EE3\u7801",name:"paramCode",rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}],children:(0,e.jsx)(O.Z,{})}),(0,e.jsx)(P.Z.Item,{label:"\u53C2\u6570\u7C7B\u578B",name:"paramType",rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}],children:(0,e.jsx)(ve.Z,{onChange:function(o){ue(o!==0)},placeholder:"\u9009\u62E9\u6570\u636E\u7C7B\u578B",options:pe})}),(0,e.jsx)(P.Z.Item,{label:"\u53C2\u6570\u5355\u4F4D",hidden:ae,name:"paramUnit",rules:[{required:!ae,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}],children:(0,e.jsx)(O.Z,{})})]})})]})}},{title:"\u63CF\u8FF0",dataIndex:"description",search:!1},{title:"\u64CD\u4F5C",valueType:"option",dataIndex:"id",render:function(n,r){return[(0,e.jsxs)(B.Z,{children:[(0,e.jsx)("a",{onClick:function(){R("form"),console.log("row",r),setTimeout(function(){var d;if((d=k.current)===null||d===void 0||d.setFieldsValue(r),r.params){var F=JSON.parse(r.params);y(F)}else y([])},200)},target:"_blank",rel:"noopener noreferrer",children:"\u7F16\u8F91"},+new Date+Math.random()),(0,e.jsx)(Y.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u6B64\u6761\u6570\u636E\u5417\uFF1F",onConfirm:function(){L.Z.Del(r).then(function(d){d.statusCode===200?(p.ZP.info("\u5220\u9664\u6210\u529F!"),V()):p.ZP.error(d.errors)})},onCancel:function(){p.ZP.info("\u5DF2\u53D6\u6D88\u5220\u9664")},okText:"\u786E\u8BA4",cancelText:"\u5173\u95ED",children:(0,e.jsx)("a",{children:"\u5220\u9664"})},"del")]},+new Date+Math.random())]}}],onSubmit:function(n){console.log(n,g),n.params=JSON.stringify(g),n.deviceProductId=C==null?void 0:C.id,H==="form"&&(n.id?L.Z.Update(n).then(function(r){r.statusCode===200?(p.ZP.info("\u66F4\u65B0\u6210\u529F!"),R("table"),le()):p.ZP.error(r.errors)}):L.Z.Add(n).then(function(r){r.statusCode===200?(p.ZP.info("\u65B0\u589E\u6210\u529F!"),R("table"),le()):p.ZP.error(r.errors)}))},request:c()(l()().mark(function v(){var n,r,f,d=arguments;return l()().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return n=d.length>0&&d[0]!==void 0?d[0]:{},r={pageIndex:n.current||1,pageSize:n.pageSize||10,deviceProductId:C==null?void 0:C.id},o.next=4,L.Z.PagedList(r);case 4:if(f=o.sent,f.statusCode!==200){o.next=9;break}return o.abrupt("return",{data:f.data.items,success:!0,total:f.data.total});case 9:return o.abrupt("return",{data:[],success:!1,total:0});case 10:case"end":return o.stop()}},v)})),pagination:{pageSize:5,showSizeChanger:!1},rowKey:"id",dateFormatter:"string",toolBarRender:function(){return[(0,e.jsxs)(D.ZP,{type:"primary",onClick:function(){R("form"),y([])},children:[(0,e.jsx)(U.Z,{}),"\u6DFB\u52A0\u529F\u80FD"]},"3")]}})]})]}):(0,e.jsxs)(u.Z,{children:[G==="form"?(0,e.jsx)(D.ZP,{icon:(0,e.jsx)(N.Z,{color:"black"}),type:"link",onClick:function(){var n;(n=$.current)===null||n===void 0||n.resetFields(),I("table")},children:"\u8FD4\u56DE"}):"",(0,e.jsx)(Z.Z,{columns:Te,type:G,formRef:$,actionRef:_,onSubmit:function(n){console.log(n),G==="form"&&(n.id?M.Z.Update(n).then(function(r){r.statusCode===200?(p.ZP.info("\u66F4\u65B0\u6210\u529F!"),I("table"),V()):p.ZP.error(r.errors)}):M.Z.Add(n).then(function(r){r.statusCode===200?(p.ZP.info("\u65B0\u589E\u6210\u529F!"),I("table"),V()):p.ZP.error(r.errors)}))},request:c()(l()().mark(function v(){var n,r,f,d=arguments;return l()().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return n=d.length>0&&d[0]!==void 0?d[0]:{},r={pageIndex:n.current||1,pageSize:n.pageSize||10,name:n.name||""},o.next=4,M.Z.PagedList(r);case 4:if(f=o.sent,f.statusCode!==200){o.next=9;break}return o.abrupt("return",{data:f.data.items,success:!0,total:f.data.total});case 9:return o.abrupt("return",{data:[],success:!1,total:0});case 10:case"end":return o.stop()}},v)})),pagination:{pageSize:5,showSizeChanger:!1},rowKey:"id",dateFormatter:"string",headerTitle:"\u5217\u8868",toolBarRender:function(){return[(0,e.jsxs)(D.ZP,{type:"primary",onClick:function(){I("form")},children:[(0,e.jsx)(U.Z,{}),"\u65B0\u5EFA"]},"3")]}})]})})}},57632:function(J,E,t){t.d(E,{Z:function(){return W}});var m={randomUUID:typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let s;const l=new Uint8Array(16);function i(){if(!s&&(s=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!s))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return s(l)}const c=[];for(let a=0;a<256;++a)c.push((a+256).toString(16).slice(1));function b(a,u=0){return(c[a[u+0]]+c[a[u+1]]+c[a[u+2]]+c[a[u+3]]+"-"+c[a[u+4]]+c[a[u+5]]+"-"+c[a[u+6]]+c[a[u+7]]+"-"+c[a[u+8]]+c[a[u+9]]+"-"+c[a[u+10]]+c[a[u+11]]+c[a[u+12]]+c[a[u+13]]+c[a[u+14]]+c[a[u+15]]).toLowerCase()}function j(a,u=0){const Z=b(a,u);if(!validate(Z))throw TypeError("Stringified UUID is invalid");return Z}var N=null;function U(a,u,Z){if(m.randomUUID&&!u&&!a)return m.randomUUID();a=a||{};const S=a.random||(a.rng||i)();if(S[6]=S[6]&15|64,S[8]=S[8]&63|128,u){Z=Z||0;for(let P=0;P<16;++P)u[Z+P]=S[P];return u}return b(S)}var W=U}}]);