Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 

2 rindas
15 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[7350],{47848:function(N){N.exports={table_search_item:"table_search_item___Js49t",edit_image_item:"edit_image_item___HRulD",edit_image_prev:"edit_image_prev___3DVAW"}},61969:function(N,Q,n){"use strict";n.r(Q);var S=n(71194),E=n(50146),g=n(11849),o=n(43185),$=n(93009),$e=n(47673),L=n(4107),ea=n(57663),ee=n(71577),ae=n(86582),aa=n(58024),te=n(91894),ta=n(43358),R=n(34041),na=n(34792),m=n(48086),ia=n(62350),ne=n(24565),ra=n(12968),ie=n(6122),c=n(39428),C=n(3182),h=n(2824),U=n(49101),re=n(16894),se=n(78009),A=n(67294),p=n(73999),le=n(47848),_=n.n(le),ue=n(9669),de=n.n(ue),t=n(85893),oe=function(P){return new Promise(function(j,D){var f=new FileReader;f.readAsDataURL(P),f.onload=function(){return j(f.result)},f.onerror=function(I){return D(I)}})},Ae=function(){var P=(0,A.useRef)(),j=(0,A.useState)(""),D=(0,h.Z)(j,2),f=D[0],I=D[1],Ee=(0,A.useState)([]),Z=(0,h.Z)(Ee,2),me=Z[0],ge=Z[1],ce=(0,A.useState)(!1),F=(0,h.Z)(ce,2),he=F[0],B=F[1],fe=(0,A.useState)({id:"",pageId:"",materialName:"",materialCode:"",materialPath:[],materialType:0}),J=(0,h.Z)(fe,2),u=J[0],v=J[1],ve=(0,A.useState)(!1),b=(0,h.Z)(ve,2),pe=b[0],x=b[1],Pe=(0,A.useState)(""),W=(0,h.Z)(Pe,2),Ce=W[0],Be=W[1],Me=(0,A.useState)(""),Y=(0,h.Z)(Me,2),Qe=Y[0],Se=Y[1],De=(0,A.useState)([]),k=(0,h.Z)(De,2),O=k[0],T=k[1],Ie=(0,A.useState)([]),w=(0,h.Z)(Ie,2),Oe=w[0],Ne=w[1],Re=(0,A.useState)(1),z=(0,h.Z)(Re,2),je=z[0],sa=z[1],Te=(0,A.useState)(10),G=(0,h.Z)(Te,2),Ke=G[0],la=G[1],ye=(0,A.useState)(0),H=(0,h.Z)(ye,2),ua=H[0],da=H[1],Le=function(){return x(!1)},Ue=function(){var i=(0,C.Z)((0,c.Z)().mark(function a(e){return(0,c.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!(!e.url&&!e.preview)){s.next=4;break}return s.next=3,oe(e.originFileObj);case 3:e.preview=s.sent;case 4:Be(e.url||e.preview),x(!0),Se(e.name||e.url.substring(e.url.lastIndexOf("/")+1));case 7:case"end":return s.stop()}},a)}));return function(e){return i.apply(this,arguments)}}(),Ze=function(a){var e=a.fileList;e.forEach(function(r){r.status="done"}),T(e)},Fe=[{title:"\u7D20\u6750\u540D\u79F0",dataIndex:"materialName",ellipsis:!0},{title:"\u7D20\u6750\u7F16\u7801",dataIndex:"materialCode",ellipsis:!0},{title:"\u7D20\u6750\u56FE\u7247",dataIndex:"materialPath",render:function(a,e){return(0,t.jsx)(ie.Z,{style:{width:"50%",height:"50%"},src:JSON.parse(e.materialPath)[0],fallback:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/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nI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="})}},{title:"\u64CD\u4F5C",valueType:"option",key:"option",render:function(a,e){return[(0,t.jsx)("a",{onClick:function(){return We(e)},children:"\u7F16\u8F91"}),(0,t.jsx)(ne.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u6B64\u7D20\u6750\u5417\uFF1F",onConfirm:function(){return Ye(e)},okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,t.jsx)("a",{href:"#",children:"\u5220\u9664"})})]}}],X=(0,t.jsxs)("div",{children:[(0,t.jsx)(U.Z,{}),(0,t.jsx)("div",{style:{marginTop:8},children:"Upload"})]}),Je=function(){var i=(0,C.Z)((0,c.Z)().mark(function a(){var e;return(0,c.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,p.Z.GetAllStore();case 2:e=s.sent,e.isSuccess?(ge(e.data),I(e.data[0].id)):m.default.error(e.msg||"\u83B7\u53D6\u5E97\u94FA\u5217\u8868\u5931\u8D25");case 4:case"end":return s.stop()}},a)}));return function(){return i.apply(this,arguments)}}(),be={name:"file",showUploadList:!0,multiple:!1,accept:".png, .jpg, .jpeg, .gif",headers:{"Content-Type":"application/octet-stream"},customRequest:function(a){var e=a.action,r=a.file,s=a.headers,d=a.onError,l=a.onProgress,ze=a.withCredentials,Ge=r.name.lastIndexOf("."),He=r.name.substr(Ge+1),V=null;return p.Z.GetCosRequestURL({directory:"applet",fileExtension:He,method:"PUT"}).then(function(K){e=K.allUrl;var q=new FileReader;q.readAsArrayBuffer(r),q.onload=function(Xe){V=Xe.target.result,de().put(e,V,{withCredentials:ze,headers:s,onUploadProgress:function(M){var Ve=M.total,qe=M.loaded;l({percent:Math.round(qe/Ve*100).toFixed(2)},r)}}).then(function(y){if(y.status==200||y.statusText=="OK"){var M=JSON.parse(JSON.stringify(u));M.materialPath.push(K.seeUrl),v(M),m.default.success("\u4E0A\u4F20\u6210\u529F\uFF01")}}).catch(d)}}),{abort:function(){console.log("upload progress is aborted.")}}}},xe=function(){var i=(0,C.Z)((0,c.Z)().mark(function a(){var e,r,s;return(0,c.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(u.pageId){l.next=5;break}return m.default.info("\u8BF7\u9009\u62E9\u6240\u5C5E\u9875\u9762"),l.abrupt("return");case 5:if(u.materialName){l.next=10;break}return m.default.info("\u8BF7\u586B\u5199\u7D20\u6750\u540D\u79F0"),l.abrupt("return");case 10:if(u.materialCode){l.next=15;break}return m.default.info("\u8BF7\u586B\u5199\u7D20\u6750\u7F16\u7801"),l.abrupt("return");case 15:if(u.materialPath.length!==0){l.next=18;break}return m.default.info("\u8BF7\u9009\u62E9\u81F3\u5C11\u4E0A\u4F20\u4E00\u5F20\u7D20\u6750\u56FE\u7247"),l.abrupt("return");case 18:if(e={pageId:u.pageId,materialName:u.materialName,materialCode:u.materialCode,materialPath:JSON.stringify(u.materialPath),materialType:u.materialType},!u.id){l.next=27;break}return e.id=u.id,l.next=23,p.Z.UpdateMiniMaterial(e);case 23:r=l.sent,r.statusCode===200?(m.default.success("\u66F4\u65B0\u6210\u529F"),B(!1),P.current.reload()):m.default.error("\u66F4\u65B0\u5931\u8D25"),l.next=31;break;case 27:return l.next=29,p.Z.AddMinimaterial(e);case 29:s=l.sent,s.statusCode===200?(m.default.success("\u6DFB\u52A0\u6210\u529F"),B(!1),P.current.reload()):m.default.error("\u6DFB\u52A0\u5931\u8D25");case 31:case"end":return l.stop()}},a)}));return function(){return i.apply(this,arguments)}}(),We=function(a){var e=JSON.parse(a.materialPath),r={id:a.id,pageId:a.pageId,materialName:a.materialName,materialCode:a.materialCode,materialPath:e};e.length>1?r.materialType=1:r.materialType=0;var s=[];e.forEach(function(d,l){s.push({uid:l,name:d.split("/applet/")[1]||"\u56FE\u7247.jpg",status:"done",url:d})}),T(s),v(r),B(!0)},Ye=function(){var i=(0,C.Z)((0,c.Z)().mark(function a(e){var r;return(0,c.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,p.Z.DeleteMiniMaterial(e.id);case 2:r=d.sent,r.statusCode===200?(P.current.reload(),m.default.success("\u5220\u9664\u6210\u529F")):m.default.error(r.errors||"\u5220\u9664\u5931\u8D25");case 4:case"end":return d.stop()}},a)}));return function(e){return i.apply(this,arguments)}}(),ke=function(){var i=(0,C.Z)((0,c.Z)().mark(function a(){var e;return(0,c.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,p.Z.MiniPageList({current:1,pageSize:999,storeId:f});case 2:e=s.sent,e.statusCode===200?Ne(e.data.items):m.default.error(e.errors||"\u83B7\u53D6\u9875\u9762\u5217\u8868\u5931\u8D25");case 4:case"end":return s.stop()}},a)}));return function(){return i.apply(this,arguments)}}(),we=function(){T([]),v({pageId:"",materialName:"",materialCode:"",materialPath:[],materialType:0})};return(0,A.useEffect)(function(){Je()},[]),(0,A.useEffect)(function(){!f||(ke(),P.current.reload())},[f]),(0,t.jsxs)(se.ZP,{children:[(0,t.jsx)(te.Z,{style:{marginBottom:"10px"},children:(0,t.jsxs)("div",{className:_().table_search_item,children:[(0,t.jsx)("div",{children:"\u5F53\u524D\u95E8\u5E97\uFF1A"}),(0,t.jsx)(R.Z,{style:{width:300},value:f,onChange:function(a){I(a)},children:me.map(function(i){return(0,t.jsx)(Option,{value:i.id,children:i.store_Name},i.id)})})]})}),(0,t.jsx)(re.ZP,{search:!1,columns:Fe,actionRef:P,cardBordered:!0,editable:{type:"multiple"},request:(0,C.Z)((0,c.Z)().mark(function i(){var a,e,r;return(0,c.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(f){d.next=2;break}return d.abrupt("return");case 2:return a={current:je,pageSize:Ke,storeId:f},d.next=5,p.Z.MinimaterialListByStore(a);case 5:return e=d.sent,r=[],e.data.forEach(function(l){r.push.apply(r,(0,ae.Z)(l.list))}),d.abrupt("return",{data:r,success:!0,total:10});case 9:case"end":return d.stop()}},i)})),columnsState:{persistenceKey:"pro-table-singe-demos",persistenceType:"localStorage",onChange:function(a){}},rowKey:"id",options:{setting:{listsHeight:400}},pagination:{pageSize:5,onChange:function(a){return console.log(a)}},dateFormatter:"string",headerTitle:"\u56FE\u7247\u7BA1\u7406",toolBarRender:function(){return[(0,t.jsx)(ee.Z,{icon:(0,t.jsx)(U.Z,{}),type:"primary",onClick:function(){B(!0),we()},children:"\u65B0\u5EFA"},"button")]}}),(0,t.jsx)(E.Z,{title:"\u7F16\u8F91\u7D20\u6750",visible:he,onOk:xe,onCancel:function(){return B(!1)},children:(0,t.jsxs)("div",{className:_().edit_image_card,children:[(0,t.jsxs)("div",{className:_().edit_image_item,children:[(0,t.jsx)("div",{className:_().edit_image_prev,children:"\u7D20\u6750\u540D\u79F0\uFF1A"}),(0,t.jsx)("div",{className:_().edit_image_suffix,children:(0,t.jsx)(L.Z,{placeholder:"\u8BF7\u8F93\u5165\u7D20\u6750\u540D\u79F0",value:u.materialName,onChange:function(a){var e=JSON.parse(JSON.stringify(u));e.materialName=a.target.value,v(e)}})})]}),(0,t.jsxs)("div",{className:_().edit_image_item,children:[(0,t.jsx)("div",{className:_().edit_image_prev,children:"\u7D20\u6750\u7F16\u7801\uFF1A"}),(0,t.jsx)("div",{className:_().edit_image_suffix,children:(0,t.jsx)(L.Z,{placeholder:"\u8BF7\u8F93\u5165\u7D20\u6750\u7F16\u7801",value:u.materialCode,onChange:function(a){var e=JSON.parse(JSON.stringify(u));e.materialCode=a.target.value,v(e)}})})]}),(0,t.jsxs)("div",{className:_().edit_image_item,children:[(0,t.jsx)("div",{className:_().edit_image_prev,children:"\u6240\u5C5E\u9875\u9762\uFF1A"}),(0,t.jsx)("div",{className:_().edit_image_suffix,children:(0,t.jsx)(R.Z,{placeholder:"\u8BF7\u9009\u62E9\u6240\u5728\u9875\u9762",style:{width:"100%"},value:u.pageId,onChange:function(a){var e=JSON.parse(JSON.stringify(u));e.pageId=a,v(e)},children:Oe.map(function(i){return(0,t.jsx)(Option,{value:i.id,children:i.pageName},i.id)})})})]}),(0,t.jsxs)("div",{className:_().edit_image_item,children:[(0,t.jsx)("div",{className:_().edit_image_prev,children:"\u6570\u91CF\uFF1A"}),(0,t.jsx)("div",{className:_().edit_image_suffix,children:(0,t.jsxs)(R.Z,{placeholder:"\u8BF7\u9009\u62E9\u7D20\u6750\u6570\u91CF",style:{width:"100%"},value:u.materialType,onChange:function(a){var e=JSON.parse(JSON.stringify(u));e.materialType=a,v(e)},children:[(0,t.jsx)(Option,{value:0,children:"\u5355\u5F20"},0),(0,t.jsx)(Option,{value:1,children:"\u591A\u5F20"},1)]})})]}),(0,t.jsx)($.Z,(0,g.Z)((0,g.Z)({listType:"picture-card",fileList:O,onPreview:Ue,onChange:Ze,onRemove:function(a){var e=O.findIndex(function(s){return s.uid===a.uid});if(e>-1){var r=JSON.parse(JSON.stringify(u));r.materialPath.splice(e,1),v(r)}}},be),{},{children:function(){return u.materialType===0?O.length>=1?null:X:(0,t.jsx)(t.Fragment,{children:O.length>=9?null:X})}()}))]})}),(0,t.jsx)(E.Z,{visible:pe,title:Qe,footer:null,onCancel:Le,children:(0,t.jsx)("img",{alt:"example",style:{width:"100%"},src:Ce})})]})};Q.default=Ae},73999:function(N,Q,n){"use strict";var S=n(11849),E=n(48971);Q.Z={GetAllStore:function(){return(0,E.WY)("/kitchen/api/StoreHelper/GetAllStore",{method:"GET"})},GetCosRequestURL:function(o){return(0,E.WY)("/kitchen/api/systemconfig/GetCosRequestSignURL",{method:"POST",data:o})},AddMinimaterial:function(o){return(0,E.WY)("/kitchen/api/minimaterial/add",{method:"POST",data:o})},UpdateMiniMaterial:function(o){return(0,E.WY)("/kitchen/api/minimaterial/update",{method:"POST",data:o})},MinimaterialListByStore:function(o){return(0,E.WY)("/kitchen/api/minimaterial/store",{method:"POST",data:o})},DeleteMiniMaterial:function(o){return(0,E.WY)("/kitchen/api/minimaterial/del",{method:"POST",data:{id:o}})},MiniPageAdd:function(o){return(0,E.WY)("/kitchen/api/minipage/add",{method:"POST",data:(0,S.Z)({},o)})},MiniPageDelete:function(o){return(0,E.WY)("/kitchen/api/minipage/del",{method:"POST",data:{id:o}})},MiniPageUpdate:function(o){return(0,E.WY)("/kitchen/api/minipage/update",{method:"POST",data:(0,S.Z)({},o)})},MiniPageList:function(o){return(0,E.WY)("/kitchen/api/minipage/page",{method:"POST",data:(0,S.Z)({},o)})}}}}]);