Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

2 lignes
15 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[7350],{47848:function(y){y.exports={table_search_item:"table_search_item___Js49t",edit_image_item:"edit_image_item___HRulD",edit_image_prev:"edit_image_prev___3DVAW"}},61969:function(y,Q,i){"use strict";i.r(Q);var D=i(71194),E=i(50146),g=i(11849),d=i(43185),ae=i(93009),$e=i(47673),L=i(4107),ea=i(57663),N=i(71577),te=i(86582),aa=i(58024),ne=i(91894),ta=i(43358),R=i(34041),na=i(34792),m=i(48086),ia=i(62350),ie=i(24565),ra=i(12968),re=i(6122),c=i(39428),P=i(3182),h=i(2824),U=i(49101),se=i(16894),le=i(78009),A=i(67294),v=i(73999),ue=i(47848),_=i.n(ue),oe=i(9669),de=i.n(oe),t=i(85893),Ae=function(C){return new Promise(function(j,S){var f=new FileReader;f.readAsDataURL(C),f.onload=function(){return j(f.result)},f.onerror=function(I){return S(I)}})},_e=function(){var C=(0,A.useRef)(),j=(0,A.useState)(""),S=(0,h.Z)(j,2),f=S[0],I=S[1],me=(0,A.useState)([]),F=(0,h.Z)(me,2),ge=F[0],ce=F[1],he=(0,A.useState)(!1),J=(0,h.Z)(he,2),fe=J[0],B=J[1],pe=(0,A.useState)({id:"",pageId:"",materialName:"",materialCode:"",materialPath:[],materialType:0}),x=(0,h.Z)(pe,2),u=x[0],p=x[1],ve=(0,A.useState)(!1),b=(0,h.Z)(ve,2),Ce=b[0],W=b[1],Pe=(0,A.useState)(""),k=(0,h.Z)(Pe,2),Be=k[0],Me=k[1],Qe=(0,A.useState)(""),Y=(0,h.Z)(Qe,2),De=Y[0],Se=Y[1],Ie=(0,A.useState)([]),w=(0,h.Z)(Ie,2),O=w[0],T=w[1],Oe=(0,A.useState)([]),z=(0,h.Z)(Oe,2),ye=z[0],Ne=z[1],Re=(0,A.useState)(1),G=(0,h.Z)(Re,2),je=G[0],sa=G[1],Te=(0,A.useState)(10),H=(0,h.Z)(Te,2),Ke=H[0],la=H[1],Ze=(0,A.useState)(0),X=(0,h.Z)(Ze,2),ua=X[0],oa=X[1],Le=function(){return W(!1)},Ue=function(){var n=(0,P.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,Ae(e.originFileObj);case 3:e.preview=s.sent;case 4:Me(e.url||e.preview),W(!0),Se(e.name||e.url.substring(e.url.lastIndexOf("/")+1));case 7:case"end":return s.stop()}},a)}));return function(e){return n.apply(this,arguments)}}(),Fe=function(a){var e=a.fileList;e.forEach(function(r){r.status="done"}),T(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)(re.Z,{style:{width:"50%",height:"50%"},src:JSON.parse(e.materialPath)[0],fallback:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCX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sw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/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)(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"})})]}}],V=(0,t.jsxs)("div",{children:[(0,t.jsx)(U.Z,{}),(0,t.jsx)("div",{style:{marginTop:8},children:"Upload"})]}),xe=function(){var n=(0,P.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,v.Z.GetAllStore();case 2:e=s.sent,e.isSuccess?(ce(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 n.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,o=a.onError,l=a.onProgress,ze=a.withCredentials,Ge=r.name.lastIndexOf("."),He=r.name.substr(Ge+1),$=null;return v.Z.GetCosRequestURL({directory:"applet",fileExtension:He,method:"PUT"}).then(function(K){e=K.allUrl;var ee=new FileReader;ee.readAsArrayBuffer(r),ee.onload=function(Xe){$=Xe.target.result,de().put(e,$,{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(Z){if(Z.status==200||Z.statusText=="OK"){var M=JSON.parse(JSON.stringify(u));M.materialPath.push(K.seeUrl),p(M),m.default.success("\u4E0A\u4F20\u6210\u529F\uFF01")}}).catch(o)}}),{abort:function(){console.log("upload progress is aborted.")}}}},q=function(){var n=(0,P.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,v.Z.UpdateMiniMaterial(e);case 23:r=l.sent,r.statusCode===200?(m.default.success("\u66F4\u65B0\u6210\u529F"),B(!1),C.current.reload()):m.default.error("\u66F4\u65B0\u5931\u8D25"),l.next=31;break;case 27:return l.next=29,v.Z.AddMinimaterial(e);case 29:s=l.sent,s.statusCode===200?(m.default.success("\u6DFB\u52A0\u6210\u529F"),B(!1),C.current.reload()):m.default.error("\u6DFB\u52A0\u5931\u8D25");case 31:case"end":return l.stop()}},a)}));return function(){return n.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(o,l){s.push({uid:l,name:o.split("/applet/")[1]||"\u56FE\u7247.jpg",status:"done",url:o})}),T(s),p(r),B(!0)},ke=function(){var n=(0,P.Z)((0,c.Z)().mark(function a(e){var r;return(0,c.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,v.Z.DeleteMiniMaterial(e.id);case 2:r=o.sent,r.statusCode===200?(C.current.reload(),m.default.success("\u5220\u9664\u6210\u529F")):m.default.error(r.errors||"\u5220\u9664\u5931\u8D25");case 4:case"end":return o.stop()}},a)}));return function(e){return n.apply(this,arguments)}}(),Ye=function(){var n=(0,P.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,v.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 n.apply(this,arguments)}}(),we=function(){T([]),p({pageId:"",materialName:"",materialCode:"",materialPath:[],materialType:0})};return(0,A.useEffect)(function(){xe()},[]),(0,A.useEffect)(function(){!f||(Ye(),C.current.reload())},[f]),(0,t.jsxs)(le.ZP,{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:f,onChange:function(a){I(a)},children:ge.map(function(n){return(0,t.jsx)(Option,{value:n.id,children:n.store_Name},n.id)})})]})}),(0,t.jsx)(se.ZP,{search:!1,columns:Je,actionRef:C,cardBordered:!0,editable:{type:"multiple"},request:(0,P.Z)((0,c.Z)().mark(function n(){var a,e,r;return(0,c.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(f){o.next=2;break}return o.abrupt("return");case 2:return a={current:je,pageSize:Ke,storeId:f},o.next=5,v.Z.MinimaterialListByStore(a);case 5:return e=o.sent,r=[],e.data.forEach(function(l){r.push.apply(r,(0,te.Z)(l.list))}),o.abrupt("return",{data:r,success:!0,total:10});case 9:case"end":return o.stop()}},n)})),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)(N.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:fe,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)(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,p(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,p(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,p(e)},children:ye.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,p(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)(ae.Z,(0,g.Z)((0,g.Z)({listType:"picture-card",fileList:O,onPreview:Ue,onChange:Fe,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),p(r)}}},be),{},{children:function(){return u.materialType===0?O.length>=1?null:V:(0,t.jsx)(t.Fragment,{children:O.length>=9?null:V})}()})),(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:Le,children:(0,t.jsx)("img",{alt:"example",style:{width:"100%"},src:Be})})]})};Q.default=_e},73999:function(y,Q,i){"use strict";var D=i(11849),E=i(48971);Q.Z={GetAllStore:function(){return(0,E.WY)("/kitchen/api/StoreHelper/GetAllStore",{method:"GET"})},GetCosRequestURL:function(d){return(0,E.WY)("/kitchen/api/systemconfig/GetCosRequestSignURL",{method:"POST",data:d})},AddMinimaterial:function(d){return(0,E.WY)("/kitchen/api/minimaterial/add",{method:"POST",data:d})},UpdateMiniMaterial:function(d){return(0,E.WY)("/kitchen/api/minimaterial/update",{method:"POST",data:d})},MinimaterialListByStore:function(d){return(0,E.WY)("/kitchen/api/minimaterial/store",{method:"POST",data:d})},DeleteMiniMaterial:function(d){return(0,E.WY)("/kitchen/api/minimaterial/del",{method:"POST",data:{id:d}})},MiniPageAdd:function(d){return(0,E.WY)("/kitchen/api/minipage/add",{method:"POST",data:(0,D.Z)({},d)})},MiniPageDelete:function(d){return(0,E.WY)("/kitchen/api/minipage/del",{method:"POST",data:{id:d}})},MiniPageUpdate:function(d){return(0,E.WY)("/kitchen/api/minipage/update",{method:"POST",data:(0,D.Z)({},d)})},MiniPageList:function(d){return(0,E.WY)("/kitchen/api/minipage/page",{method:"POST",data:(0,D.Z)({},d)})}}}}]);