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