|
- "use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[262],{77846:function(z,x,t){t.d(x,{M:function(){return P},y:function(){return O}});var f=t(97857),d=t.n(f),i=t(56002),O={Add:function(l){return(0,i.request)("/api/dictType/add",{method:"POST",data:d()({},l)})},Del:function(l){return(0,i.request)("/api/dictType/del",{method:"POST",data:d()({},l)})},Update:function(l){return(0,i.request)("/api/dictType/update",{method:"POST",data:d()({},l)})},Detail:function(l){return(0,i.request)("/api/dictType/detail?id=".concat(l),{method:"GET"})},List:function(l){return(0,i.request)("/api/dictType/list",{method:"POST",data:d()({},l)})},PagedList:function(l){return(0,i.request)("/api/dictType/pagedlist",{method:"POST",data:d()({},l)})}},P={Add:function(l){return(0,i.request)("/api/dictData/add",{method:"POST",data:d()({},l)})},Del:function(l){return(0,i.request)("/api/dictData/del",{method:"POST",data:d()({},l)})},Update:function(l){return(0,i.request)("/api/dictData/update",{method:"POST",data:d()({},l)})},Detail:function(l){return(0,i.request)("/api/dictData/detail?id=".concat(l),{method:"GET"})},List:function(l){return(0,i.request)("/api/dictData/list",{method:"POST",data:d()({},l)})},PagedList:function(l){return(0,i.request)("/api/dictData/pagedlist",{method:"POST",data:d()({},l)})}}},48223:function(z,x,t){var f=t(97857),d=t.n(f),i=t(56002);x.Z={Add:function(P){return(0,i.request)("/api/materialsinfo/add",{method:"POST",data:d()({},P)})},Del:function(P){return(0,i.request)("/api/materialsinfo/del",{method:"POST",data:d()({},P)})},Update:function(P){return(0,i.request)("/api/materialsinfo/update",{method:"POST",data:d()({},P)})},List:function(){return(0,i.request)("/api/materialsinfo/list",{method:"GET"})},selectlist:function(){return(0,i.request)("/api/materialsinfo/selectlist",{method:"GET"})},PagedList:function(P){return(0,i.request)("/api/materialsinfo/pagedlist",{method:"POST",data:d()({},P)})}}},38494:function(z,x,t){t.r(x);var f=t(15009),d=t.n(f),i=t(99289),O=t.n(i),P=t(5574),p=t.n(P),l=t(83145),D=t(8232),S=t(45360),A=t(14726),H=t(86738),G=t(85576),V=t(66309),j=t(49978),N=t(34041),I=t(67294),B=t(48223),W=t(77846),o=t(85893),ee=function(){var w=D.Z.useForm(),X=p()(w,1),R=X[0],J=(0,I.useState)([]),L=p()(J,2),K=L[0],Q=L[1],re=(0,I.useState)(!1),U=p()(re,2),Y=U[0],e=U[1],s=(0,I.useState)("\u65B0\u589E\u4FE1\u606F"),u=p()(s,2),r=u[0],n=u[1],v=(0,I.useRef)(),C=function(){var c={typeCode:"wllx"};W.M.List(c).then(function(m){m.statusCode===200&&Q(m.data)})},M=function(){var g=O()(d()().mark(function c(m){var _,h,E,a;return d()().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(!m.id){b.next=7;break}return b.next=3,B.Z.Update(m);case 3:_=b.sent,_.statusCode===200?(S.ZP.success("\u4FEE\u6539\u6210\u529F"),(h=v.current)===null||h===void 0||h.reload(),e(!1)):S.ZP.error(_.errors||"\u4FEE\u6539\u5931\u8D25"),b.next=11;break;case 7:return b.next=9,B.Z.Add(m);case 9:E=b.sent,E.statusCode===200?(S.ZP.success("\u6DFB\u52A0\u6210\u529F"),(a=v.current)===null||a===void 0||a.reload(),e(!1)):S.ZP.error(E.errors||"\u6DFB\u52A0\u5931\u8D25");case 11:case"end":return b.stop()}},c)}));return function(m){return g.apply(this,arguments)}}();(0,I.useEffect)(function(){C()},[]);var y=[{title:"id",dataIndex:"id",tooltip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0},{title:"\u7269\u6599\u540D\u79F0",dataIndex:"name"},{title:"\u7269\u6599\u7F16\u7801",dataIndex:"code"},{title:"\u7269\u6599\u5355\u4F4D",dataIndex:"unit",hideInSearch:!0},{title:"\u7269\u6599\u7C7B\u578B",dataIndex:"type",hideInSearch:!0,render:function(c,m,_,h,E){var a;return(0,o.jsx)(o.Fragment,{children:(a=K.find(function($){return $.id==m.type}))===null||a===void 0?void 0:a.value})}},{title:"\u6BCF\u5347\u91CD\u91CF(g)",dataIndex:"weightPerLiter",hideInSearch:!0,tooltip:"\u6BCF\u4E00\u5347\u7269\u6599\u7684\u91CD\u91CF,\u7528\u4E8E\u8BA1\u7B97\u4F7F\u7528\u591A\u5C11\u4E2A\u6876"},{title:"\u64CD\u4F5C",valueType:"option",key:"option",fixed:"right",render:function(c,m){return[(0,o.jsx)(A.ZP,{type:"primary",size:"small",onClick:O()(d()().mark(function _(){var h;return d()().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:C(),e(!0),n("\u7F16\u8F91\u4FE1\u606F"),h=JSON.parse(JSON.stringify(m)),R.setFieldsValue(h);case 5:case"end":return a.stop()}},_)})),children:"\u7F16\u8F91"},"edit"),(0,o.jsx)(H.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u6B64\u6761\u6570\u636E\u5417\uFF1F",onConfirm:function(){var h={id:m.id};B.Z.Del(h).then(function(E){if(E.statusCode===200){var a;S.ZP.success(E.statusCode===200?"\u5220\u9664\u6210\u529F":E.message),(a=v.current)===null||a===void 0||a.reload()}})},onCancel:function(){S.ZP.info("\u5DF2\u53D6\u6D88\u5220\u9664")},okText:"\u786E\u8BA4",cancelText:"\u5173\u95ED",children:(0,o.jsx)(A.ZP,{type:"primary",size:"small",danger:!0,children:"\u5220\u9664"})},"del")]}}];return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(l.Z,{columns:y,actionRef:v,cardBordered:!0,bordered:!0,scroll:{x:!0},rowClassName:function(c,m,_){return m%2===0?"":"even-row-background"},request:O()(d()().mark(function g(){var c,m,_,h=arguments;return d()().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return c=h.length>0&&h[0]!==void 0?h[0]:{},m={pageIndex:c.current||1,pageSize:c.pageSize||10,name:c.name||"",code:c.code},a.next=4,B.Z.PagedList(m);case 4:if(_=a.sent,_.statusCode!==200){a.next=9;break}return a.abrupt("return",{data:_.data.items,success:!0,total:_.data.total});case 9:return a.abrupt("return",{data:[],success:!1,total:0});case 10:case"end":return a.stop()}},g)})),rowKey:"id",pagination:{pageSize:10,showSizeChanger:!1},dateFormatter:"string",headerTitle:"\u7269\u6599\u5217\u8868",toolBarRender:function(){return[(0,o.jsx)(A.ZP,{type:"primary",onClick:function(){R.resetFields(),e(!0),C(),n("\u65B0\u589E\u4FE1\u606F")},children:"\u6DFB\u52A0\u7269\u6599"},"button")]}},"myTable"),(0,o.jsx)(G.Z,{maskClosable:!1,width:800,title:(0,o.jsx)(V.Z,{color:"#cd201f",children:r}),open:Y,onCancel:function(){e(!1)},footer:[(0,o.jsx)(A.ZP,{onClick:function(){e(!1)},children:"\u8FD4\u56DE"},"back"),(0,o.jsx)(A.ZP,{form:"materialsForm",type:"primary",htmlType:"submit",children:"\u63D0\u4EA4"},"submit")],children:(0,o.jsxs)(D.Z,{form:R,labelAlign:"right",name:"basic",id:"materialsForm",labelCol:{span:4},wrapperCol:{span:12},onFinish:M,autoComplete:"off",children:[(0,o.jsx)(D.Z.Item,{label:"id",name:"id",hidden:!0,children:(0,o.jsx)(j.Z,{})}),(0,o.jsx)(D.Z.Item,{label:"\u7269\u6599\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u6B64\u9879\u5FC5\u586B\uFF01"}],children:(0,o.jsx)(j.Z,{})}),(0,o.jsx)(D.Z.Item,{label:"\u7269\u6599\u7F16\u7801",name:"code",rules:[{required:!0,message:"\u6B64\u9879\u5FC5\u586B\uFF01"}],children:(0,o.jsx)(j.Z,{})}),(0,o.jsx)(D.Z.Item,{label:"\u7269\u6599\u5355\u4F4D",name:"unit",rules:[{required:!0,message:"\u6B64\u9879\u5FC5\u586B\uFF01"}],children:(0,o.jsx)(j.Z,{})}),(0,o.jsx)(D.Z.Item,{label:"\u7269\u6599\u7C7B\u578B",name:"type",rules:[{required:!0,message:"\u6B64\u9879\u5FC5\u586B\uFF01"}],children:(0,o.jsx)(N.Z,{children:K.map(function(g,c){return(0,o.jsx)(N.Z.Option,{value:g.id,children:(0,o.jsx)("span",{children:g.value})},g.id)})})}),(0,o.jsx)(D.Z.Item,{tooltip:"\u6BCF\u4E00\u5347\u7269\u6599\u7684\u91CD\u91CF,\u7528\u4E8E\u8BA1\u7B97\u4F7F\u7528\u591A\u5C11\u4E2A\u6876",label:"\u6BCF\u5347\u91CD\u91CF(g)",name:"weightPerLiter",children:(0,o.jsx)(j.Z,{})})]})},"01")]})};x.default=ee},66309:function(z,x,t){t.d(x,{Z:function(){return Y}});var f=t(67294),d=t(93967),i=t.n(d),O=t(98423),P=t(98787),p=t(69760),l=t(96159),D=t(45353),S=t(53124),A=t(85088),H=t(10274),G=t(14747),V=t(45503),j=t(27036);const N=e=>{const{paddingXXS:s,lineWidth:u,tagPaddingHorizontal:r,componentCls:n,calc:v}=e,C=v(r).sub(u).equal(),M=v(s).sub(u).equal();return{[n]:Object.assign(Object.assign({},(0,G.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:C,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${(0,A.bf)(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${n}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${n}-close-icon`]:{marginInlineStart:M,fontSize:e.tagIconSize,color:e.colorTextDescription,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${n}-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(${n}-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:C}}),[`${n}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}},I=e=>{const{lineWidth:s,fontSizeIcon:u,calc:r}=e,n=e.fontSizeSM;return(0,V.TS)(e,{tagFontSize:n,tagLineHeight:(0,A.bf)(r(e.lineHeightSM).mul(n).equal()),tagIconSize:r(u).sub(r(s).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},B=e=>({defaultBg:new H.C(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText});var W=(0,j.I$)("Tag",e=>{const s=I(e);return N(s)},B),o=function(e,s){var u={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&s.indexOf(r)<0&&(u[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(e);n<r.length;n++)s.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(u[r[n]]=e[r[n]]);return u},te=f.forwardRef((e,s)=>{const{prefixCls:u,style:r,className:n,checked:v,onChange:C,onClick:M}=e,y=o(e,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:g,tag:c}=f.useContext(S.E_),m=b=>{C==null||C(!v),M==null||M(b)},_=g("tag",u),[h,E,a]=W(_),$=i()(_,`${_}-checkable`,{[`${_}-checkable-checked`]:v},c==null?void 0:c.className,n,E,a);return h(f.createElement("span",Object.assign({},y,{ref:s,style:Object.assign(Object.assign({},r),c==null?void 0:c.style),className:$,onClick:m})))}),w=t(98719);const X=e=>(0,w.Z)(e,(s,u)=>{let{textColor:r,lightBorderColor:n,lightColor:v,darkColor:C}=u;return{[`${e.componentCls}${e.componentCls}-${s}`]:{color:r,background:v,borderColor:n,"&-inverse":{color:e.colorTextLightSolid,background:C,borderColor:C},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}});var R=(0,j.bk)(["Tag","preset"],e=>{const s=I(e);return X(s)},B);function J(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}const L=(e,s,u)=>{const r=J(u);return{[`${e.componentCls}${e.componentCls}-${s}`]:{color:e[`color${u}`],background:e[`color${r}Bg`],borderColor:e[`color${r}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}};var K=(0,j.bk)(["Tag","status"],e=>{const s=I(e);return[L(s,"success","Success"),L(s,"processing","Info"),L(s,"error","Error"),L(s,"warning","Warning")]},B),Q=function(e,s){var u={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&s.indexOf(r)<0&&(u[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(e);n<r.length;n++)s.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(u[r[n]]=e[r[n]]);return u};const U=f.forwardRef((e,s)=>{const{prefixCls:u,className:r,rootClassName:n,style:v,children:C,icon:M,color:y,onClose:g,bordered:c=!0,visible:m}=e,_=Q(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","bordered","visible"]),{getPrefixCls:h,direction:E,tag:a}=f.useContext(S.E_),[$,b]=f.useState(!0),de=(0,O.Z)(_,["closeIcon","closable"]);f.useEffect(()=>{m!==void 0&&b(m)},[m]);const ae=(0,P.o2)(y),ne=(0,P.yT)(y),k=ae||ne,ue=Object.assign(Object.assign({backgroundColor:y&&!k?y:void 0},a==null?void 0:a.style),v),T=h("tag",u),[ce,me,_e]=W(T),fe=i()(T,a==null?void 0:a.className,{[`${T}-${y}`]:k,[`${T}-has-color`]:y&&!k,[`${T}-hidden`]:!$,[`${T}-rtl`]:E==="rtl",[`${T}-borderless`]:!c},r,n,me,_e),oe=Z=>{Z.stopPropagation(),g==null||g(Z),!Z.defaultPrevented&&b(!1)},[,pe]=(0,p.Z)((0,p.w)(e),(0,p.w)(a),{closable:!1,closeIconRender:Z=>{const he=f.createElement("span",{className:`${T}-close-icon`,onClick:oe},Z);return(0,l.wm)(Z,he,F=>({onClick:ie=>{var q;(q=F==null?void 0:F.onClick)===null||q===void 0||q.call(F,ie),oe(ie)},className:i()(F==null?void 0:F.className,`${T}-close-icon`)}))}}),ge=typeof _.onClick=="function"||C&&C.type==="a",se=M||null,Ce=se?f.createElement(f.Fragment,null,se,C&&f.createElement("span",null,C)):C,le=f.createElement("span",Object.assign({},de,{ref:s,className:fe,style:ue}),Ce,pe,ae&&f.createElement(R,{key:"preset",prefixCls:T}),ne&&f.createElement(K,{key:"status",prefixCls:T}));return ce(ge?f.createElement(D.Z,{component:"Tag"},le):le)});U.CheckableTag=te;var Y=U}}]);
|