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
12 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[5523,1322],{72887:function(re,b,a){"use strict";a.r(b),a.d(b,{default:function(){return Ce}});var Q=a(57663),x=a(71577),G=a(2824),t=a(39428),I=a(34792),s=a(48086),i=a(3182),S=a(67294),E=a(78009),V=a(85224),D=a(49101),B=a(16894),W=a(71194),X=a(50146),Ie=a(9715),R=a(55843),ke=a(47673),U=a(4107),xe=a(43358),q=a(34041),te=a(51496),u=a(85893),ae=function(n){var h=q.Z.Option,e=q.Z.OptGroup;return(0,u.jsx)(X.Z,{title:n.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:n.createModalVisible,bodyStyle:{padding:"32px 40px 1px 48px"},footer:null,onCancel:function(){n.onCancel()},destroyOnClose:!0,children:(0,u.jsxs)(R.Z,{layout:"vertical",preserve:!1,initialValues:n.values,onFinish:n.onFinish,children:[(0,u.jsx)(R.Z.Item,{name:"id",hidden:!0,children:(0,u.jsx)(U.Z,{})}),(0,u.jsx)(R.Z.Item,{label:"\u83DC\u8C31\u7F16\u7801",name:"code",initialValue:(0,te.x0)(20),rules:[{required:!0,max:20}],children:(0,u.jsx)(U.Z,{})}),(0,u.jsx)(R.Z.Item,{label:"\u83DC\u8C31\u540D\u79F0",name:"name",rules:[{required:!0,max:20}],children:(0,u.jsx)(U.Z,{})}),(0,u.jsx)(R.Z.Item,{label:"\u6392\u5E8F",name:"sort",rules:[{required:!0}],children:(0,u.jsx)(U.Z,{type:"number"})}),(0,u.jsxs)(R.Z.Item,{children:[(0,u.jsx)(x.Z,{htmlType:"button",style:{float:"right",left:10},onClick:n.onCancel,children:"\u53D6\u6D88"}),(0,u.jsx)(x.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})]})]})})},ue=ae,_=a(11849),A=a(48971);function se(l){return Y.apply(this,arguments)}function Y(){return Y=(0,i.Z)((0,t.Z)().mark(function l(n){return(0,t.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,A.WY)("/kitchen/api/FoodMenu/GetFoodMenuInfoPage",{method:"POST",data:n}));case 1:case"end":return e.stop()}},l)})),Y.apply(this,arguments)}function le(l){return K.apply(this,arguments)}function K(){return K=(0,i.Z)((0,t.Z)().mark(function l(n){return(0,t.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,A.WY)("/kitchen/api/FoodMenu/AddUpdateFoodMenu",{method:"POST",data:n}));case 1:case"end":return e.stop()}},l)})),K.apply(this,arguments)}function oe(l){return N.apply(this,arguments)}function N(){return N=(0,i.Z)((0,t.Z)().mark(function l(n){return(0,t.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,A.WY)("/kitchen/api/FoodMenu/AddUpdateFoodMenu",{method:"POST",data:n}));case 1:case"end":return e.stop()}},l)})),N.apply(this,arguments)}function ie(l){return J.apply(this,arguments)}function J(){return J=(0,i.Z)((0,t.Z)().mark(function l(n){return(0,t.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,A.WY)("\u200B/kitchen/api/FoodMenu/DelFoodMenu",{method:"POST",data:n}));case 1:case"end":return e.stop()}},l)})),J.apply(this,arguments)}function de(l){return z.apply(this,arguments)}function z(){return z=(0,i.Z)((0,t.Z)().mark(function l(n){return(0,t.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,A.WY)("/kitchen/api/FoodMenu/GetGoodsByMenuIdPage",{method:"POST",data:(0,_.Z)({},n)}));case 1:case"end":return e.stop()}},l)})),z.apply(this,arguments)}function ce(l){return L.apply(this,arguments)}function L(){return L=(0,i.Z)((0,t.Z)().mark(function l(n){return(0,t.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,A.WY)("/kitchen/api/FoodMenu/GetFoodMenuGoodsPage_V2",{method:"POST",data:(0,_.Z)({},n)}));case 1:case"end":return e.stop()}},l)})),L.apply(this,arguments)}function fe(l){return H.apply(this,arguments)}function H(){return H=(0,i.Z)((0,t.Z)().mark(function l(n){return(0,t.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,A.WY)("/kitchen/api/FoodMenu/EditFoodMenuGoods",{method:"POST",data:n}));case 1:case"end":return e.stop()}},l)})),H.apply(this,arguments)}var Ae=a(49111),he=a(19650),Ge=a(62350),pe=a(24565),ee=a(86582),ve=[{title:"\u5546\u54C1id",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0},{title:"\u5546\u54C1\u540D\u79F0",dataIndex:"name"}],me=function(n){var h=(0,S.useRef)(),e=(0,S.useState)([]),w=(0,G.Z)(e,2),r=w[0],m=w[1],$=function(){var y=(0,i.Z)((0,t.Z)().mark(function p(){var Z,c,o;return(0,t.Z)().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if((Z=n.foodMenu)!==null&&Z!==void 0&&Z.id){v.next=2;break}return v.abrupt("return");case 2:return c={goodsIds:[],foodMenuId:n.foodMenu.id},r.forEach(function(d){c.goodsIds.push({goodsId:d})}),v.next=6,fe(c);case 6:o=v.sent,o.statusCode===200?(s.default.success("\u66F4\u65B0\u83DC\u8C31\u5546\u54C1\u6210\u529F\uFF01"),n.onOk()):s.default.error(JSON.stringify(o.errors)||"\u66F4\u65B0\u83DC\u8C31\u5546\u54C1\u51FA\u9519");case 8:case"end":return v.stop()}},p)}));return function(){return y.apply(this,arguments)}}(),T=function(){var y=(0,i.Z)((0,t.Z)().mark(function p(){var Z,c,o,f;return(0,t.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(!n.foodMenu.id){d.next=5;break}return d.next=3,ce({current:1,pageSize:999,FoodMenuId:n.foodMenu.id});case 3:Z=d.sent,Z.statusCode===200&&(f=[],(c=Z.data)===null||c===void 0||(o=c.data)===null||o===void 0||o.forEach(function(P){f.push(P.goodid)}),m(f));case 5:case"end":return d.stop()}},p)}));return function(){return y.apply(this,arguments)}}();return(0,S.useEffect)(function(){T()},[]),(0,u.jsxs)(X.Z,{width:800,footer:null,bodyStyle:{padding:"32px 40px 1px 48px",height:"912px"},title:n.foodMenu.name,visible:n.open,onOk:$,onCancel:n.onCancel,children:[(0,u.jsx)(B.ZP,{columns:ve,actionRef:h,pagination:{pageSize:10},rowSelection:{type:"checkbox",selectedRowKeys:r,onSelect:function(p,Z){var c=(0,ee.Z)(r),o=c.findIndex(function(f){return f===p.id});Z?o<0&&c.push(p.id):o>-1&&c.splice(o,1),m(c)},onSelectAll:function(p,Z,c){var o=(0,ee.Z)(r);p?(console.log("11111111"),console.log(o),Z.forEach(function(f){if(!!f){var v=o.findIndex(function(d){return d===f.id});v<0&&o.push(f.id)}})):c.forEach(function(f){var v=o.findIndex(function(d){return d===f.id});v>-1&&o.splice(v,1)}),m(o)}},tableAlertOptionRender:function(){return(0,u.jsx)(he.Z,{size:16,children:(0,u.jsx)(pe.Z,{title:"\u6B64\u64CD\u4F5C\u4F1A\u53D6\u6D88\u6240\u6709\u9009\u4E2D\u9879\uFF0C\u786E\u5B9A\u8981\u53D6\u6D88\u5417\uFF1F",onConfirm:function(){return m([])},okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,u.jsx)("a",{children:"\u53D6\u6D88\u9009\u62E9"})})})},request:(0,i.Z)((0,t.Z)().mark(function y(){var p,Z,c,o,f=arguments;return(0,t.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return p=f.length>0&&f[0]!==void 0?f[0]:{},Z=f.length>1?f[1]:void 0,c=f.length>2?f[2]:void 0,p.FoodMenuId=n.foodMenu.id,d.next=6,de(p);case 6:if(o=d.sent,o.statusCode!==200){d.next=11;break}return d.abrupt("return",{data:o.data.data,success:!0,total:o.data.total});case 11:return d.abrupt("return",[]);case 12:case"end":return d.stop()}},y)})),rowKey:"id",headerTitle:"\u5546\u54C1\u5217\u8868"}),(0,u.jsx)(x.Z,{htmlType:"button",style:{float:"right",left:10},onClick:n.onCancel,children:"\u53D6\u6D88"}),(0,u.jsx)(x.Z,{type:"primary",htmlType:"submit",style:{float:"right"},onClick:function(){return $()},children:"\u4FDD\u5B58"})]})},Ze=me,O="message",ge=function(){var l=(0,i.Z)((0,t.Z)().mark(function n(h){var e;return(0,t.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return e=!1,r.prev=1,s.default.loading("\u6B63\u5728\u6DFB\u52A0",O),r.next=5,oe(JSON.stringify(h)).then(function(m){s.default.destroy(O),m.data?(s.default.success("\u6DFB\u52A0\u6210\u529F"),e=!0):(s.default.error(m.errors||"\u6DFB\u52A0\u5931\u8D25"),e=!1)});case 5:r.next=11;break;case 7:r.prev=7,r.t0=r.catch(1),s.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e=!1;case 11:return r.abrupt("return",e);case 12:case"end":return r.stop()}},n,null,[[1,7]])}));return function(h){return l.apply(this,arguments)}}(),ye=function(){var l=(0,i.Z)((0,t.Z)().mark(function n(h){var e;return(0,t.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return e=!1,r.prev=1,s.default.loading("\u6B63\u5728\u4FEE\u6539",O),s.default.destroy(O),r.next=6,le(JSON.stringify(h)).then(function(m){s.default.destroy(O),m.data?(s.default.success("\u4FEE\u6539\u6210\u529F"),e=!0):(s.default.error(m.errors||"\u4FEE\u6539\u5931\u8D25"),e=!1)});case 6:r.next=12;break;case 8:r.prev=8,r.t0=r.catch(1),s.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e=!1;case 12:return r.abrupt("return",e);case 13:case"end":return r.stop()}},n,null,[[1,8]])}));return function(h){return l.apply(this,arguments)}}(),Me=function(){var l=(0,i.Z)((0,t.Z)().mark(function n(h){var e;return(0,t.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,s.default.loading("\u6B63\u5728\u5220\u9664"),e=[],h.forEach(function(m){e.push(m.id)}),r.next=6,ie(e).then(function(m){return s.default.destroy(),m.data?(s.default.success("\u5220\u9664\u6210\u529F"),!0):(s.default.error("\u83DC\u8C31\u5DF2\u5173\u8054\u5230\u5546\u54C1\uFF0C\u5220\u9664\u5931\u8D25"),!1)});case 6:r.next=12;break;case 8:return r.prev=8,r.t0=r.catch(0),s.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),r.abrupt("return",!1);case 12:case"end":return r.stop()}},n,null,[[0,8]])}));return function(h){return l.apply(this,arguments)}}(),Fe=function(){var n=(0,S.useState)(!1),h=(0,G.Z)(n,2),e=h[0],w=h[1],r=(0,S.useRef)(),m=(0,S.useState)(),$=(0,G.Z)(m,2),T=$[0],y=$[1],p=(0,S.useState)([]),Z=(0,G.Z)(p,2),c=Z[0],o=Z[1],f=(0,S.useState)(!1),v=(0,G.Z)(f,2),d=v[0],P=v[1],Se=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u83DC\u8C31\u540D\u79F0",dataIndex:"name"},{title:"\u83DC\u8C31\u7F16\u7801",dataIndex:"code"},{title:"\u6392\u5E8F",dataIndex:"sort"},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(C,M){return[(0,u.jsx)("a",{onClick:function(){w(!0),y(M)},children:"\u7F16\u8F91"},"config"),(0,u.jsx)("a",{onClick:function(){y(M),P(!0)},children:"\u5173\u8054\u52A0\u76DF\u5546\u5546\u54C1"},"food")]}}],we=function(){P(!1)};return(0,u.jsxs)(E.ZP,{children:[(0,u.jsx)(B.ZP,{headerTitle:"\u83DC\u8C31\u57FA\u7840\u4FE1\u606F",actionRef:r,rowKey:"id",search:{labelWidth:120},toolBarRender:function(){return[(0,u.jsxs)(x.Z,{type:"primary",onClick:function(){w(!0)},children:[(0,u.jsx)(D.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var j=(0,i.Z)((0,t.Z)().mark(function C(M){var k,F;return(0,t.Z)().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return k=[],F=0,g.next=4,se(M).then(function(ne){k=ne.data.data,F=ne.data.total});case 4:return g.abrupt("return",{data:k,success:!0,total:F});case 5:case"end":return g.stop()}},C)}));return function(C){return j.apply(this,arguments)}}(),columns:Se,rowSelection:{onChange:function(C,M){o(M)}}}),(c==null?void 0:c.length)>0&&(0,u.jsx)(V.Z,{extra:(0,u.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,u.jsx)("a",{style:{fontWeight:600},children:c.length})," ","\u9879 \xA0\xA0"]}),children:(0,u.jsx)(x.Z,{onClick:(0,i.Z)((0,t.Z)().mark(function j(){var C,M;return(0,t.Z)().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,Me(c);case 2:o([]),(C=r.current)===null||C===void 0||(M=C.reloadAndRest)===null||M===void 0||M.call(C);case 4:case"end":return F.stop()}},j)})),children:"\u5220\u9664"})}),(0,u.jsx)(ue,{onFinish:function(){var j=(0,i.Z)((0,t.Z)().mark(function C(M){var k,F;return(0,t.Z)().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:if(F=!1,!M.id){g.next=7;break}return g.next=4,ye(M);case 4:F=g.sent,g.next=10;break;case 7:return g.next=9,ge(M);case 9:F=g.sent;case 10:console.log("success",F),F&&(w(!1),y(void 0)),(k=r.current)===null||k===void 0||k.reload();case 13:case"end":return g.stop()}},C)}));return function(C){return j.apply(this,arguments)}}(),onCancel:function(){w(!1),y(void 0)},createModalVisible:e,values:T||{}}),T&&d&&(0,u.jsx)(Ze,{foodMenu:T,open:d,onOk:we,onCancel:function(){return P(!1)}})]})},Ce=Fe},51496:function(re,b,a){"use strict";a.d(b,{x0:function(){return t}});let Q=I=>crypto.getRandomValues(new Uint8Array(I)),x=(I,s,i)=>{let S=(2<<Math.log(I.length-1)/Math.LN2)-1,E=-~(1.6*S*s/I.length);return(V=s)=>{let D="";for(;;){let B=i(E),W=E;for(;W--;)if(D+=I[B[W]&S]||"",D.length===V)return D}}},G=(I,s=21)=>x(I,s,Q),t=(I=21)=>crypto.getRandomValues(new Uint8Array(I)).reduce((s,i)=>(i&=63,i<36?s+=i.toString(36):i<62?s+=(i-26).toString(36).toUpperCase():i>62?s+="-":s+="_",s),"")}}]);