Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

p__foodMenu__foodMenuInfo.00b22a9c.async.js 6.8 KiB

1 год назад
1
  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[5523,7975,1322],{40471:function(ae,P,n){"use strict";n.r(P),n.d(P,{default:function(){return _}});var te=n(57663),R=n(71577),w=n(2824),t=n(39428),ue=n(34792),i=n(48086),h=n(3182),j=n(67294),W=n(78009),k=n(85224),E=n(49101),V=n(16894),le=n(71194),Y=n(50146),se=n(9715),y=n(55843),ie=n(47673),$=n(4107),de=n(43358),G=n(34041),u=n(85893),b=function(a){var d=G.Z.Option,e=G.Z.OptGroup;return(0,u.jsx)(Y.Z,{title:a.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:a.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){a.onCancel()},destroyOnClose:!0,children:(0,u.jsxs)(y.Z,{layout:"vertical",preserve:!1,initialValues:a.values,onFinish:a.onFinish,children:[(0,u.jsx)(y.Z.Item,{name:"id",hidden:!0,children:(0,u.jsx)($.Z,{})}),(0,u.jsx)(y.Z.Item,{label:"\u83DC\u8C31\u7F16\u7801",name:"code",rules:[{required:!0,max:20}],children:(0,u.jsx)($.Z,{})}),(0,u.jsx)(y.Z.Item,{label:"\u83DC\u8C31\u540D\u79F0",name:"name",rules:[{required:!0,max:20}],children:(0,u.jsx)($.Z,{})}),(0,u.jsx)(y.Z.Item,{children:(0,u.jsx)(R.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},J=b,S=n(48971);function N(l){return T.apply(this,arguments)}function T(){return T=(0,h.Z)((0,t.Z)().mark(function l(a){return(0,t.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,S.WY)("/kitchen/api/FoodMenu/GetFoodMenuInfoPage",{method:"POST",data:a}));case 1:case"end":return e.stop()}},l)})),T.apply(this,arguments)}function K(l){return x.apply(this,arguments)}function x(){return x=(0,h.Z)((0,t.Z)().mark(function l(a){return(0,t.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,S.WY)("/kitchen/api/FoodMenu/AddUpdateFoodMenu",{method:"POST",data:a}));case 1:case"end":return e.stop()}},l)})),x.apply(this,arguments)}function z(l){return I.apply(this,arguments)}function I(){return I=(0,h.Z)((0,t.Z)().mark(function l(a){return(0,t.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,S.WY)("/kitchen/api/FoodMenu/AddUpdateFoodMenu",{method:"POST",data:a}));case 1:case"end":return e.stop()}},l)})),I.apply(this,arguments)}function H(l){return A.apply(this,arguments)}function A(){return A=(0,h.Z)((0,t.Z)().mark(function l(a){return(0,t.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,S.WY)("\u200B/kitchen/api/FoodMenu/DelFoodMenu",{method:"POST",data:a}));case 1:case"end":return e.stop()}},l)})),A.apply(this,arguments)}var g="message",L=function(){var l=(0,h.Z)((0,t.Z)().mark(function a(d){return(0,t.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,i.default.loading("\u6B63\u5728\u6DFB\u52A0",g),r.next=4,z(JSON.stringify(d)).then(function(s){return i.default.destroy(g),s.data?(i.default.success("\u6DFB\u52A0\u6210\u529F"),!0):(i.default.error("\u6DFB\u52A0\u5931\u8D25"),!1)});case 4:r.next=10;break;case 6:return r.prev=6,r.t0=r.catch(0),i.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),r.abrupt("return",!1);case 10:case"end":return r.stop()}},a,null,[[0,6]])}));return function(d){return l.apply(this,arguments)}}(),Q=function(){var l=(0,h.Z)((0,t.Z)().mark(function a(d){return(0,t.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,i.default.loading("\u6B63\u5728\u4FEE\u6539",g),i.default.destroy(g),r.next=5,K(JSON.stringify(d)).then(function(s){return i.default.destroy(g),s.data?(i.default.success("\u4FEE\u6539\u6210\u529F"),!0):(i.default.error("\u4FEE\u6539\u5931\u8D25"),!1)});case 5:r.next=11;break;case 7:return r.prev=7,r.t0=r.catch(0),i.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),r.abrupt("return",!1);case 11:case"end":return r.stop()}},a,null,[[0,7]])}));return function(d){return l.apply(this,arguments)}}(),X=function(){var l=(0,h.Z)((0,t.Z)().mark(function a(d){var e;return(0,t.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,i.default.loading("\u6B63\u5728\u5220\u9664"),e=[],d.forEach(function(F){e.push(F.id)}),s.next=6,H(e).then(function(F){return i.default.destroy(),F.data?(i.default.success("\u5220\u9664\u6210\u529F"),!0):(i.default.error("\u83DC\u8C31\u5DF2\u5173\u8054\u5230\u5546\u54C1\uFF0C\u5220\u9664\u5931\u8D25"),!1)});case 6:s.next=12;break;case 8:return s.prev=8,s.t0=s.catch(0),i.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),s.abrupt("return",!1);case 12:case"end":return s.stop()}},a,null,[[0,8]])}));return function(d){return l.apply(this,arguments)}}(),q=function(){var a=(0,j.useState)(!1),d=(0,w.Z)(a,2),e=d[0],r=d[1],s=(0,j.useRef)(),F=(0,j.useState)(),D=(0,w.Z)(F,2),ee=D[0],O=D[1],re=(0,j.useState)([]),B=(0,w.Z)(re,2),M=B[0],U=B[1],ne=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u83DC\u8C31\u7F16\u7801",dataIndex:"code",valueType:"textarea"},{title:"\u83DC\u8C31\u540D\u79F0",dataIndex:"name",valueType:"textarea"},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(o,c){return[(0,u.jsx)("a",{onClick:function(){r(!0),O(c)},children:" \u66F4\u65B0"},"config")]}}];return(0,u.jsxs)(W.ZP,{children:[(0,u.jsx)(V.ZP,{headerTitle:"\u83DC\u8C31\u57FA\u7840\u4FE1\u606F",actionRef:s,rowKey:"id",search:{labelWidth:120},toolBarRender:function(){return[(0,u.jsxs)(R.Z,{type:"primary",onClick:function(){r(!0)},children:[(0,u.jsx)(E.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var v=(0,h.Z)((0,t.Z)().mark(function o(c){var p,f;return(0,t.Z)().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return p=[],f=0,m.next=4,N(c).then(function(Z){p=Z.data.data,f=Z.data.total});case 4:return m.abrupt("return",{data:p,success:!0,total:f});case 5:case"end":return m.stop()}},o)}));return function(o){return v.apply(this,arguments)}}(),columns:ne,rowSelection:{onChange:function(o,c){U(c)}}}),(M==null?void 0:M.length)>0&&(0,u.jsx)(k.Z,{extra:(0,u.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,u.jsx)("a",{style:{fontWeight:600},children:M.length})," ","\u9879 \xA0\xA0"]}),children:(0,u.jsx)(R.Z,{onClick:(0,h.Z)((0,t.Z)().mark(function v(){var o,c;return(0,t.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,X(M);case 2:U([]),(o=s.current)===null||o===void 0||(c=o.reloadAndRest)===null||c===void 0||c.call(o);case 4:case"end":return f.stop()}},v)})),children:"\u5220\u9664"})}),(0,u.jsx)(J,{onFinish:function(){var v=(0,h.Z)((0,t.Z)().mark(function o(c){var p,f,C;return(0,t.Z)().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:C=!1,c.id?C=Q(c):C=L(c),C&&(r(!1),O(void 0)),(p=s.current)===null||p===void 0||(f=p.reloadAndRest)===null||f===void 0||f.call(p);case 4:case"end":return Z.stop()}},o)}));return function(o){return v.apply(this,arguments)}}(),onCancel:function(){r(!1),O(void 0)},createModalVisible:e,values:ee||{}})]})},_=q}}]);