Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 

2 рядки
7.1 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[3174,7975,1322,1793,7005,3042,3721,607,8863,1587,4001],{1983:function(ie,W,r){"use strict";r.r(W),r.d(W,{default:function(){return ne}});var oe=r(57663),G=r(71577),de=r(58024),B=r(91894),ce=r(32157),K=r(7573),j=r(2824),t=r(39428),R=r(11849),fe=r(34792),m=r(48086),f=r(3182),L=r(49101),y=r(67294),z=r(78009),U=r(85224),V=r(16894),he=r(71194),H=r(50146),b=r(48971);function J(u,a){return D.apply(this,arguments)}function D(){return D=(0,f.Z)((0,t.Z)().mark(function u(a,l){return(0,t.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.abrupt("return",(0,b.WY)("/kitchen/api/FoodMenu/GetStoreFoodMenuPage",{method:"POST",data:(0,R.Z)({},a)}));case 1:case"end":return o.stop()}},u)})),D.apply(this,arguments)}function N(u){return A.apply(this,arguments)}function A(){return A=(0,f.Z)((0,t.Z)().mark(function u(a){return(0,t.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/kitchen/api/FoodMenu/StoreAddFoodMenu",{method:"POST",data:(0,R.Z)({},a)}));case 1:case"end":return e.stop()}},u)})),A.apply(this,arguments)}function Q(u){return k.apply(this,arguments)}function k(){return k=(0,f.Z)((0,t.Z)().mark(function u(a){return(0,t.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("\u200B/kitchen/api/FoodMenu/DelStoreFoodMenu",{method:"POST",data:a}));case 1:case"end":return e.stop()}},u)})),k.apply(this,arguments)}function X(u){return x.apply(this,arguments)}function x(){return x=(0,f.Z)((0,t.Z)().mark(function u(a){return(0,t.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/kitchen/\u200Bapi/FoodMenu/tree",{data:(0,R.Z)({},a)}));case 1:case"end":return e.stop()}},u)})),x.apply(this,arguments)}function q(u){return O.apply(this,arguments)}function O(){return O=(0,f.Z)((0,t.Z)().mark(function u(a){return(0,t.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/kitchen/\u200Bapi/FoodMenu/GetStorePage",{method:"POST",data:(0,R.Z)({},a)}));case 1:case"end":return e.stop()}},u)})),O.apply(this,arguments)}var i=r(85893),_=function(a){console.log("fdsfadsa",a.modalVisible);var l=(0,y.useState)([]),e=(0,j.Z)(l,2),o=e[0],n=e[1],F=[{title:"\u5546\u54C1id",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0},{title:"\u95E8\u5E97\u540D\u79F0",dataIndex:"name"}];return(0,i.jsx)(H.Z,{width:700,bodyStyle:{padding:"32px 40px 48px"},destroyOnClose:!0,title:"\u9009\u62E9\u95E8\u5E97",visible:a.modalVisible,onCancel:function(){return a.onCancel()},onOk:function(){return a.onSubmit(o)},maskClosable:!1,children:(0,i.jsx)(V.ZP,{headerTitle:"\u5546\u54C1\u4FE1\u606F",rowKey:"id",pagination:{defaultPageSize:20},search:!1,toolBarRender:!1,params:{FoodMenuId:a.values},request:function(){var s=(0,f.Z)((0,t.Z)().mark(function Z(I){var P,C;return(0,t.Z)().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return P=[],C=0,S.next=4,q(I).then(function($){P=$.data.data,C=$.data.total});case 4:return S.abrupt("return",{data:P,success:!0,total:C});case 5:case"end":return S.stop()}},Z)}));return function(Z){return s.apply(this,arguments)}}(),columns:F,rowSelection:{onChange:function(Z,I){return n(I)}}})})},ee=_,ae=function(){var u=(0,f.Z)((0,t.Z)().mark(function a(l){var e;return(0,t.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(l.FoodMenuId!=null){n.next=3;break}return m.default.error("\u8BF7\u9009\u62E9\u83DC\u8C31"),n.abrupt("return",!1);case 3:return e=m.default.loading("\u6B63\u5728\u6DFB\u52A0"),n.prev=4,N((0,R.Z)({},l)).then(function(F){return F.succeeded?(e(),m.default.success("\u6DFB\u52A0\u6210\u529F"),!0):(m.default.error(F.errors),e(),!1)}),n.abrupt("return",!0);case 9:return n.prev=9,n.t0=n.catch(4),e(),m.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),n.abrupt("return",!1);case 14:case"end":return n.stop()}},a,null,[[4,9]])}));return function(l){return u.apply(this,arguments)}}(),re=function(){var u=(0,f.Z)((0,t.Z)().mark(function a(l,e){var o,n;return(0,t.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:debugger;s.prev=1,o=m.default.loading("\u6B63\u5728\u5220\u9664"),n=[],l.forEach(function(Z){n.push(Z.id)});debugger;return s.next=8,Q({storeIds:n,foodMenuId:e}).then(function(Z){return o(),Z.data?(m.default.success("\u5220\u9664\u6210\u529F"),!0):(m.default.success("\u5220\u9664\u5931\u8D25"),!1)});case 8:s.next=14;break;case 10:return s.prev=10,s.t0=s.catch(1),m.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),s.abrupt("return",!1);case 14:case"end":return s.stop()}},a,null,[[1,10]])}));return function(l,e){return u.apply(this,arguments)}}(),te=function(){var a=(0,y.useState)(),l=(0,j.Z)(a,2),e=l[0],o=l[1],n=(0,y.useRef)(),F=(0,y.useState)(),s=(0,j.Z)(F,2),Z=s[0],I=s[1],P=(0,y.useState)(),C=(0,j.Z)(P,2),w=C[0],S=C[1],$=(0,y.useState)(),Y=(0,j.Z)($,2),T=Y[0],ue=Y[1];(0,y.useEffect)(function(){function h(){X().then(function(d){I(d.data)})}h()},[]);var se=[{title:"\u5E97\u94FA\u540D\u79F0",dataIndex:"name",search:!1}];return(0,i.jsxs)(z.ZP,{children:[(0,i.jsx)(V.ZP,{headerTitle:"\u5E97\u94FA\u5217\u8868",actionRef:n,rowKey:"id",search:{labelWidth:120},tableRender:function(d,p){return(0,i.jsxs)("div",{style:{display:"flex",width:"100%"},children:[(0,i.jsx)(B.Z,{title:"\u83DC\u8C31\u5217\u8868",children:(0,i.jsx)(K.Z,{defaultExpandAll:!0,onSelect:function(c){return ue(c[0])},treeData:Z})}),(0,i.jsx)("div",{style:{flex:1},children:p})]})},toolBarRender:function(){return[(0,i.jsxs)(G.Z,{type:"primary",onClick:function(){o(!0)},children:[(0,i.jsx)(L.Z,{})," \u9009\u62E9\u5E97\u94FA"]},"primary")]},params:{FoodMenuId:T},request:function(){var h=(0,f.Z)((0,t.Z)().mark(function d(p){var g,c;return(0,t.Z)().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return g=[],c=0,M.next=4,J(p).then(function(v){g=v.data.data,c=v.data.total});case 4:return M.abrupt("return",{data:g,success:!0,total:c});case 5:case"end":return M.stop()}},d)}));return function(d){return h.apply(this,arguments)}}(),columns:se,rowSelection:{onChange:function(d,p){S(p)}}}),(w==null?void 0:w.length)>0&&(0,i.jsx)(U.Z,{extra:(0,i.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,i.jsx)("a",{style:{fontWeight:600},children:w.length})," ","\u9879 \xA0\xA0"]}),children:(0,i.jsx)(G.Z,{onClick:(0,f.Z)((0,t.Z)().mark(function h(){var d,p;return(0,t.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,re(w,T);case 2:S([]),(d=n.current)===null||d===void 0||(p=d.reloadAndRest)===null||p===void 0||p.call(d);case 4:case"end":return c.stop()}},h)})),children:"\u6279\u91CF\u5220\u9664"})}),(0,i.jsx)(ee,{onSubmit:function(){var h=(0,f.Z)((0,t.Z)().mark(function d(p){var g,c,E;return(0,t.Z)().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(typeof T!=null){v.next=4;break}o(!1),v.next=12;break;case 4:return g=[],p.map(function(le){g.push({StoreId:le.id})}),c={FoodMenuId:T,StoreIds:g},E=!1,v.next=10,ae(c);case 10:E=v.sent,E&&(o(!1),n.current&&n.current.reload());case 12:case"end":return v.stop()}},d)}));return function(d){return h.apply(this,arguments)}}(),onCancel:function(){o(!1)},modalVisible:e,values:T})]})},ne=te}}]);