|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[5523,7975,1322],{40471:function(ae,P,r){"use strict";r.r(P),r.d(P,{default:function(){return _}});var te=r(57663),R=r(71577),w=r(2824),t=r(39428),ue=r(34792),d=r(48086),h=r(3182),j=r(67294),W=r(78009),k=r(85224),E=r(49101),V=r(53779),le=r(71194),Y=r(50146),se=r(9715),y=r(55843),ie=r(47673),$=r(4107),de=r(43358),G=r(34041),u=r(85893),b=function(a){var i=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=r(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(i){return(0,t.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,d.default.loading("\u6B63\u5728\u6DFB\u52A0",g),n.next=4,z(JSON.stringify(i)).then(function(s){return d.default.destroy(g),s.data?(d.default.success("\u6DFB\u52A0\u6210\u529F"),!0):(d.default.error("\u6DFB\u52A0\u5931\u8D25"),!1)});case 4:n.next=10;break;case 6:return n.prev=6,n.t0=n.catch(0),d.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),n.abrupt("return",!1);case 10:case"end":return n.stop()}},a,null,[[0,6]])}));return function(i){return l.apply(this,arguments)}}(),Q=function(){var l=(0,h.Z)((0,t.Z)().mark(function a(i){return(0,t.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,d.default.loading("\u6B63\u5728\u4FEE\u6539",g),d.default.destroy(g),n.next=5,K(JSON.stringify(i)).then(function(s){return d.default.destroy(g),s.data?(d.default.success("\u4FEE\u6539\u6210\u529F"),!0):(d.default.success("\u4FEE\u6539\u5931\u8D25"),!1)});case 5:n.next=11;break;case 7:return n.prev=7,n.t0=n.catch(0),d.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),n.abrupt("return",!1);case 11:case"end":return n.stop()}},a,null,[[0,7]])}));return function(i){return l.apply(this,arguments)}}(),X=function(){var l=(0,h.Z)((0,t.Z)().mark(function a(i){var e;return(0,t.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,d.default.loading("\u6B63\u5728\u5220\u9664"),e=[],i.forEach(function(F){e.push(F.id)}),s.next=6,H(e).then(function(F){return F.data?(d.default.success("\u5220\u9664\u6210\u529F"),!0):(d.default.success("\u5220\u9664\u5931\u8D25"),!1)});case 6:s.next=12;break;case 8:return s.prev=8,s.t0=s.catch(0),d.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(i){return l.apply(this,arguments)}}(),q=function(){var a=(0,j.useState)(!1),i=(0,w.Z)(a,2),e=i[0],n=i[1],s=(0,j.useRef)(),F=(0,j.useState)(),D=(0,w.Z)(F,2),ee=D[0],O=D[1],ne=(0,j.useState)([]),B=(0,w.Z)(ne,2),M=B[0],U=B[1],re=[{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(){n(!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(){n(!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:re,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&&(n(!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(){n(!1),O(void 0)},createModalVisible:e,values:ee||{}})]})},_=q}}]);
|