Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

2 řádky
12 KiB

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