胖子天骄的MES系统
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

2 linhas
14 KiB

  1. "use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[918],{77846:function(me,L,t){t.d(L,{M:function(){return U},y:function(){return p}});var W=t(97857),_=t.n(W),C=t(12578),p={Add:function(i){return(0,C.request)("/api/dictType/add",{method:"POST",data:_()({},i)})},Del:function(i){return(0,C.request)("/api/dictType/del",{method:"POST",data:_()({},i)})},Update:function(i){return(0,C.request)("/api/dictType/update",{method:"POST",data:_()({},i)})},Detail:function(i){return(0,C.request)("/api/dictType/detail?id=".concat(i),{method:"GET"})},List:function(i){return(0,C.request)("/api/dictType/list",{method:"POST",data:_()({},i)})},PagedList:function(i){return(0,C.request)("/api/dictType/pagedlist",{method:"POST",data:_()({},i)})}},U={Add:function(i){return(0,C.request)("/api/dictData/add",{method:"POST",data:_()({},i)})},Del:function(i){return(0,C.request)("/api/dictData/del",{method:"POST",data:_()({},i)})},Update:function(i){return(0,C.request)("/api/dictData/update",{method:"POST",data:_()({},i)})},Detail:function(i){return(0,C.request)("/api/dictData/detail?id=".concat(i),{method:"GET"})},List:function(i){return(0,C.request)("/api/dictData/list",{method:"POST",data:_()({},i)})},PagedList:function(i){return(0,C.request)("/api/dictData/pagedlist",{method:"POST",data:_()({},i)})}}},7863:function(me,L,t){t.r(L);var W=t(15009),_=t.n(W),C=t(99289),p=t.n(C),U=t(5574),m=t.n(U),i=t(51042),ae=t(67286),V=t(15513),M=t(12029),oe=t(42075),X=t(86738),g=t(45360),j=t(71577),k=t(5914),w=t(51904),F=t(12096),S=t(67294),y=t(77846),n=t(85893);L.default=function(){var se=(0,S.useState)("table"),K=m()(se,2),z=K[0],e=K[1],c=(0,S.useRef)(),u=(0,S.useRef)(),r=(0,S.useState)(),a=m()(r,2),h=a[0],E=a[1],O=(0,S.useRef)(),D=(0,S.useState)(),T=m()(D,2),$=T[0],A=T[1],N=(0,S.useState)([]),I=m()(N,2),le=I[0],Q=I[1],ie=(0,S.useState)(!1),J=m()(ie,2),H=J[0],Y=J[1],P=(0,S.useState)({}),q=m()(P,2),ee=q[0],de=q[1],G=(0,S.useState)(!1),te=m()(G,2),ue=te[0],x=te[1],ce=M.Z.useForm(),re=m()(ce,1),R=re[0],fe=function(){var o,s;(o=c.current)===null||o===void 0||o.resetFields(),(s=u.current)===null||s===void 0||s.reload()},_e=[{title:"\u4E3B\u952E",dataIndex:"id",hideInTable:!0,hideInForm:!0,search:!1},{title:"\u540D\u79F0",dataIndex:"name",ellipsis:!0},{title:"\u7F16\u7801",hideInDescriptions:!0,dataIndex:"code",copyable:!0},{title:"\u6392\u5E8F",dataIndex:"sort",ellipsis:!0,hideInTable:!0,search:!1},{title:"\u64CD\u4F5C",valueType:"option",dataIndex:"id",render:function(o,s){return[(0,n.jsxs)(oe.Z,{children:[(0,n.jsx)("a",{onClick:function(){var l;E(s),e("form"),(l=c.current)===null||l===void 0||l.setFieldsValue(s)},target:"_blank",rel:"noopener noreferrer",children:"\u7F16\u8F91"},+new Date+Math.random()),(0,n.jsx)("a",{onClick:p()(_()().mark(function f(){var l,b,d;return _()().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return de(s),b={pageIndex:1,pageSize:10,name:"",typeId:s.id},console.log(s.id),Z.next=5,y.M.PagedList(b);case 5:if(d=Z.sent,d.statusCode!==200){Z.next=10;break}Q(d.data.items),Z.next=11;break;case 10:return Z.abrupt("return",{data:[],success:!1,total:0});case 11:Y(!0),(l=O.current)===null||l===void 0||l.reload();case 13:case"end":return Z.stop()}},f)})),target:"_blank",rel:"noopener noreferrer",children:"\u8BBE\u7F6E\u5B50\u9879"},+new Date+Math.random()),(0,n.jsx)(X.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u6B64\u6761\u6570\u636E\u5417\uFF1F",onConfirm:function(){y.y.Del(s).then(function(l){l.statusCode===200?(g.ZP.info("\u5220\u9664\u6210\u529F!"),fe()):g.ZP.error(l.errors)})},onCancel:function(){g.ZP.info("\u5DF2\u53D6\u6D88\u5220\u9664")},okText:"\u786E\u8BA4",cancelText:"\u5173\u95ED",children:(0,n.jsx)("a",{children:"\u5220\u9664"})},"del")]},+new Date+Math.random())]}}],pe=[{title:"\u4E3B\u952E",dataIndex:"id",hideInTable:!0,hideInForm:!0,search:!0},{title:"\u5916\u952Eid",dataIndex:"typeId",ellipsis:!0,hindeInForm:!0,search:!1,hideInTable:!0},{title:"\u7F16\u7801",hideInDescriptions:!0,dataIndex:"code",copyable:!0},{title:"\u72B6\u6001",hideInDescriptions:!0,dataIndex:"value",search:!1},{title:"\u6392\u5E8F",dataIndex:"sort",ellipsis:!0,search:!1},{title:"\u64CD\u4F5C",valueType:"option",dataIndex:"id",render:function(o,s){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(j.ZP,{type:"primary",ghost:!0,className:"btn1",onClick:function(){A("\u7F16\u8F91\u5B50\u9879");var l=JSON.parse(JSON.stringify(s));console.log(l),l.state=l.state==="0",R.setFieldsValue(l),x(!0)},children:"\u7F16\u8F91"},"edit"),(0,n.jsx)(X.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u6B64\u6761\u6570\u636E\u5417\uFF1F",onConfirm:function(){var l={id:s.id,name:"",code:""};y.M.Del(l).then(function(b){if(b.statusCode===200){var d;g.ZP.success(b.statusCode===200?"\u5220\u9664\u6210\u529F":b.message),(d=O.current)===null||d===void 0||d.reload()}})},onCancel:function(){g.ZP.info("\u5DF2\u53D6\u6D88\u5220\u9664")},okText:"\u786E\u8BA4",cancelText:"\u5173\u95ED",children:(0,n.jsx)(j.ZP,{type:"primary",danger:!0,ghost:!0,className:"btn3",children:"\u5220\u9664"})},"del")]})}}],he=function(){var v=p()(_()().mark(function o(s){var f,l,b,d,ne;return _()().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:if(!s.id){B.next=7;break}return B.next=3,y.M.Update(s);case 3:f=B.sent,f.statusCode===200?(g.ZP.success("\u4FEE\u6539\u6210\u529F"),(l=O.current)===null||l===void 0||l.reload(),x(!1)):g.ZP.error(JSON.stringify(f.errors)||"\u4FEE\u6539\u5931\u8D25"),B.next=13;break;case 7:return B.next=9,y.M.Add(s);case 9:d=B.sent,(b=O.current)===null||b===void 0||b.reload(),console.log("response",d),d.statusCode===200?((ne=O.current)===null||ne===void 0||ne.reload(),g.ZP.success("\u6DFB\u52A0\u6210\u529F"),x(!1)):g.ZP.error(JSON.stringify(d.errors)||"\u6DFB\u52A0\u5931\u8D25");case 13:case"end":return B.stop()}},o)}));return function(s){return v.apply(this,arguments)}}();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(ae.Z,{children:[z==="form"?(0,n.jsx)(j.ZP,{type:"link",onClick:function(){var o;(o=c.current)===null||o===void 0||o.resetFields(),e("table")},children:"\u8FD4\u56DE"}):"",(0,n.jsx)(V.Z,{columns:_e,type:z,formRef:c,actionRef:u,onSubmit:function(o){console.log(o),o.id=h==null?void 0:h.id,z==="form"&&(o.id?y.y.Update(o).then(function(s){s.statusCode===200?(g.ZP.info("\u66F4\u65B0\u6210\u529F!"),e("table"),fe()):g.ZP.error(s.errors)}):y.y.Add(o).then(function(s){s.statusCode===200?(g.ZP.info("\u65B0\u589E\u6210\u529F!"),e("table"),fe()):g.ZP.error(s.errors)}))},request:p()(_()().mark(function v(){var o,s,f,l=arguments;return _()().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return o=l.length>0&&l[0]!==void 0?l[0]:{},s={pageIndex:o.current||1,pageSize:o.pageSize||10,name:o.name||"",code:o.code||""},d.next=4,y.y.PagedList(s);case 4:if(f=d.sent,f.statusCode!==200){d.next=9;break}return d.abrupt("return",{data:f.data.items,success:!0,total:f.data.total});case 9:return d.abrupt("return",{data:[],success:!1,total:0});case 10:case"end":return d.stop()}},v)})),pagination:{pageSize:10,showSizeChanger:!1},rowKey:"id",dateFormatter:"string",headerTitle:"\u5217\u8868",toolBarRender:function(){return[(0,n.jsxs)(j.ZP,{type:"primary",onClick:function(){e("form"),E(void 0)},children:[(0,n.jsx)(i.Z,{}),"\u65B0\u5EFA"]},"3")]}})]}),(0,n.jsx)(k.Z,{maskClosable:!1,title:"\u8BBE\u7F6E\u5B50\u9879",open:H,footer:!1,onCancel:function(){Y(!1)},width:1e3,children:(0,n.jsx)(V.Z,{search:!1,dataSource:le,actionRef:O,request:p()(_()().mark(function v(){var o,s,f,l=arguments;return _()().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return o=l.length>0&&l[0]!==void 0?l[0]:{},s={pageIndex:o.current||1,pageSize:o.pageSize||10,name:o.name||"",typeId:ee.id},d.next=4,y.M.PagedList(s);case 4:return f=d.sent,console.log(f),f.statusCode===200&&Q(f.data.items),d.abrupt("return",{data:f.data.items,success:!0,total:f.data.total});case 8:case"end":return d.stop()}},v)})),onChange:function(o){console.log(o)},pagination:{pageSize:5,showSizeChanger:!1},rowKey:"id",dateFormatter:"string",headerTitle:"\u5B50\u9879\u5217\u8868",columns:pe,toolBarRender:function(){return[(0,n.jsx)(j.ZP,{type:"primary",onClick:function(){R.resetFields(),x(!0),A("\u65B0\u589E\u5B50\u9879"),R.setFieldsValue({typeId:ee.id})},children:"\u65B0\u589E\u5B50\u9879"},"button")]}})}),(0,n.jsx)(k.Z,{maskClosable:!1,title:(0,n.jsx)(w.Z,{color:"#cd201f",children:$}),open:ue,onCancel:function(){x(!1)},footer:[(0,n.jsx)(j.ZP,{onClick:function(){x(!1)},children:"\u8FD4\u56DE"},"back"),(0,n.jsx)(j.ZP,{form:"itemForm",type:"primary",htmlType:"submit",children:"\u63D0\u4EA4"},"submit")],children:(0,n.jsxs)(M.Z,{form:R,name:"basic",id:"itemForm",wrapperCol:{span:12},onFinish:he,autoComplete:"off",children:[(0,n.jsx)(M.Z.Item,{label:"id",name:"id",hidden:!0,children:(0,n.jsx)(F.Z,{})}),(0,n.jsx)(M.Z.Item,{label:"\u5916\u952Eid",name:"typeId",hidden:!0,children:(0,n.jsx)(F.Z,{})}),(0,n.jsx)(M.Z.Item,{label:"\u540D\u79F0",name:"value",rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}],children:(0,n.jsx)(F.Z,{})}),(0,n.jsx)(M.Z.Item,{label:"\u7F16\u7801",name:"code",rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}],children:(0,n.jsx)(F.Z,{})}),(0,n.jsx)(M.Z.Item,{label:"\u6392\u5E8F",name:"sort",rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879!"}],children:(0,n.jsx)(F.Z,{})})]})})]})}},51904:function(me,L,t){t.d(L,{Z:function(){return z}});var W=t(62208),_=t(94184),C=t.n(_),p=t(67294),U=t(98787),m=t(45353),i=t(53124);function ae(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}var V=t(14747),M=t(98719),oe=t(67968),X=t(45503);const g=(e,c,u)=>{const r=ae(u);return{[`${e.componentCls}-${c}`]:{color:e[`color${u}`],background:e[`color${r}Bg`],borderColor:e[`color${r}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}},j=e=>(0,M.Z)(e,(c,u)=>{let{textColor:r,lightBorderColor:a,lightColor:h,darkColor:E}=u;return{[`${e.componentCls}-${c}`]:{color:r,background:h,borderColor:a,"&-inverse":{color:e.colorTextLightSolid,background:E,borderColor:E},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}}),k=e=>{const{paddingXXS:c,lineWidth:u,tagPaddingHorizontal:r,componentCls:a}=e,h=r-u,E=c-u;return{[a]:Object.assign(Object.assign({},(0,V.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:h,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",[`&${a}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${a}-close-icon`]:{marginInlineStart:E,color:e.colorTextDescription,fontSize:e.tagIconSize,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${a}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},["&-checkable"]:{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${a}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},["&-hidden"]:{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:h}}),[`${a}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}};var w=(0,oe.Z)("Tag",e=>{const{lineWidth:c,fontSizeIcon:u}=e,r=e.fontSizeSM,a=`${e.lineHeightSM*r}px`,h=(0,X.TS)(e,{tagFontSize:r,tagLineHeight:a,tagIconSize:u-2*c,tagPaddingHorizontal:8,tagBorderlessBg:e.colorFillTertiary});return[k(h),j(h),g(h,"success","Success"),g(h,"processing","Info"),g(h,"error","Error"),g(h,"warning","Warning")]},e=>({defaultBg:e.colorFillQuaternary,defaultColor:e.colorText})),F=function(e,c){var u={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&c.indexOf(r)<0&&(u[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)c.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(u[r[a]]=e[r[a]]);return u},y=e=>{const{prefixCls:c,className:u,checked:r,onChange:a,onClick:h}=e,E=F(e,["prefixCls","className","checked","onChange","onClick"]),{getPrefixCls:O}=p.useContext(i.E_),D=I=>{a==null||a(!r),h==null||h(I)},T=O("tag",c),[$,A]=w(T),N=C()(T,{[`${T}-checkable`]:!0,[`${T}-checkable-checked`]:r},u,A);return $(p.createElement("span",Object.assign({},E,{className:N,onClick:D})))},n=function(e,c){var u={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&c.indexOf(r)<0&&(u[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)c.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(u[r[a]]=e[r[a]]);return u};const se=(e,c)=>{const{prefixCls:u,className:r,rootClassName:a,style:h,children:E,icon:O,color:D,onClose:T,closeIcon:$,closable:A=!1,bordered:N=!0}=e,I=n(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:le,direction:Q}=p.useContext(i.E_),[ie,J]=p.useState(!0);p.useEffect(()=>{"visible"in I&&J(I.visible)},[I.visible]);const H=(0,U.o2)(D)||(0,U.yT)(D),Y=Object.assign({backgroundColor:D&&!H?D:void 0},h),P=le("tag",u),[q,ee]=w(P),de=C()(P,{[`${P}-${D}`]:H,[`${P}-has-color`]:D&&!H,[`${P}-hidden`]:!ie,[`${P}-rtl`]:Q==="rtl",[`${P}-borderless`]:!N},r,a,ee),G=R=>{R.stopPropagation(),T==null||T(R),!R.defaultPrevented&&J(!1)},te=p.useMemo(()=>A?$?p.createElement("span",{className:`${P}-close-icon`,onClick:G},$):p.createElement(W.Z,{className:`${P}-close-icon`,onClick:G}):null,[A,$,P,G]),ue=typeof I.onClick=="function"||E&&E.type==="a",x=O||null,ce=x?p.createElement(p.Fragment,null,x,p.createElement("span",null,E)):E,re=p.createElement("span",Object.assign({},I,{ref:c,className:de,style:Y}),ce,te);return q(ue?p.createElement(m.Z,null,re):re)},K=p.forwardRef(se);K.CheckableTag=y;var z=K}}]);