|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[8024],{81629:function(ve){ve.exports={table_search_item:"table_search_item___23emW"}},46507:function(ve,me,a){"use strict";a.r(me),a.d(me,{default:function(){return Pe}});var tt=a(57338),Ie=a(83107),at=a(13062),Ue=a(71230),nt=a(89032),ee=a(15746),rt=a(47673),de=a(4107),st=a(57663),pe=a(71577),ut=a(43358),k=a(34041),lt=a(62350),Ee=a(24565),i=a(39428),ot=a(34792),v=a(48086),y=a(3182),it=a(9715),G=a(55843),m=a(2824),d=a(67294),ce=a(28790),Ae=a(49101),we=a(16894),Te=a(81629),Se=a.n(Te),ge=a(3996),Oe=a(9669),Be=a.n(Oe),O=a(48971),j={GetAllStore:function(){return(0,O.WY)("/groupmeal/api/shop/alllist",{method:"GET"})},GetGateListByStorePage:function(r,K,P){var F=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"";return(0,O.WY)("/groupmeal/api/GateInfo/gatelist?StoreId=".concat(r,"&Current=").concat(K,"&PageSize=").concat(P),{method:"GET",headers:{TenantId:F}})},AddGate:function(r){return(0,O.WY)("/groupmeal/api/GateInfo/add",{method:"POST",data:r})},UpdateGateInfo:function(r){var K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(0,O.WY)("/groupmeal/api/GateInfo/Update",{method:"POST",data:r,headers:{TenantId:K}})},GetDicList:function(r){return(0,O.WY)("/saasbase/api/dictdata/getdiclist?typeCode="+r,{method:"Get"})},AddGateSetUp:function(r){return(0,O.WY)("/groupmeal/api/GateInfo/AddGateSetUp",{method:"POST",data:r})},GetGateSetUp:function(r){return(0,O.WY)("/groupmeal/api/GateInfo/GetGateSetUp",{method:"POST",data:r})},Del:function(r){return(0,O.WY)("/groupmeal/api/GateInfo/del?id="+r,{method:"POST"})}},dt=a(71194),Ze=a(50146),ct=a(58996),ye=a(77933),se=a(86582),e=a(85893),De=function(r){var K=(0,d.useRef)(),P=(0,d.useState)(!0),F=(0,m.Z)(P,2),te=F[0],ue=F[1],A="sendCoupon",w=(0,d.useState)(r.gateSetUp),$=(0,m.Z)(w,2),x=$[0],I=$[1],B=(0,d.useState)([]),z=(0,m.Z)(B,2),Y=z[0],D=z[1],M=(0,d.useState)([]),W=(0,m.Z)(M,2),N=W[0],le=W[1],H=(0,d.useState)([]),L=(0,m.Z)(H,2),J=L[0],b=L[1];(0,d.useEffect)(function(){var l=function(){var s=(0,y.Z)((0,i.Z)().mark(function f(g){return(0,i.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:j.GetDicList("GateSetUp").then(function(C){var ne=C.data,q=[];C.succeeded&&ne.forEach(function(re){q.push({key:re.value,title:re.value,description:g,disabled:!1,tag:re.value})}),b(q),le(q)});case 1:case"end":return o.stop()}},f)}));return function(g){return s.apply(this,arguments)}}();l()},[]);var oe=function(){var l=(0,y.Z)((0,i.Z)().mark(function s(f){var g,u;return(0,i.Z)().wrap(function(C){for(;;)switch(C.prev=C.next){case 0:return C.next=2,j.GetGateSetUp({gateId:f});case 2:g=C.sent,u=[],g.data.forEach(function(ne){u.push(ne.key)});debugger;setGateSetUp(u);case 7:case"end":return C.stop()}},s)}));return function(f){return l.apply(this,arguments)}}(),ae=function(s,f,g){I(s)},Q=function(s,f){D([].concat((0,se.Z)(s),(0,se.Z)(f)))},V=function(s,f){},X=function(){var l=(0,y.Z)((0,i.Z)().mark(function s(f,g){return(0,i.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(f!="right"){o.next=2;break}return o.abrupt("return");case 2:case"end":return o.stop()}},s)}));return function(f,g){return l.apply(this,arguments)}}(),Z=function(){var l=(0,y.Z)((0,i.Z)().mark(function s(f){var g;return(0,i.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!(x==null||x.length<=0)){o.next=3;break}return v.default.error("\u8BF7\u9009\u62E9\u663E\u793A\u533A\u57DF"),o.abrupt("return");case 3:return v.default.loading("\u6B63\u5728\u6DFB\u52A0...",A),o.prev=4,g=[],x.forEach(function(C){g.push({Key:C,GateId:f.values.id,IsShow:!0})}),j.AddGateSetUp(g).then(function(C){v.default.destroy(A),C.data?(v.default.success("\u6DFB\u52A0\u6210\u529F"),I([]),D([]),f.onCancel()):v.default.error("\u6DFB\u52A0\u5931\u8D25")}),o.abrupt("return",!0);case 11:return o.prev=11,o.t0=o.catch(4),console.log(o.t0),v.default.destroy(A),v.default.error("\u6DFB\u52A0\u8BF7\u91CD\u8BD5\uFF01"),o.abrupt("return",!1);case 17:case"end":return o.stop()}},s,null,[[4,11]])}));return function(f){return l.apply(this,arguments)}}();return(0,e.jsx)(Ze.Z,{destroyOnClose:!0,visible:r.shows,width:700,onCancel:function(){b(N),I([]),r.onCancel()},onOk:function(){Z(r),r.actionRef.current.reload()},children:(0,e.jsx)(ce.ZP,{header:{title:"\u8BBE\u7F6E\u5C4F\u5E55\u663E\u793A",breadcrumb:{}},children:(0,e.jsx)(ye.Z,{oneWay:te,showSearch:!0,showSelectAll:!0,onSearch:X,dataSource:J,titles:["\u672A\u9009\u62E9","\u5DF2\u9009\u4E2D"],targetKeys:x,selectedKeys:Y,onChange:ae,onSelectChange:Q,onScroll:V,render:function(s){return s.title},pagination:{pageSize:8},listStyle:{width:500,height:400}})})})},be=De,Re=function(r){var K=(0,d.useRef)(),P=(0,d.useState)(!0),F=(0,m.Z)(P,2),te=F[0],ue=F[1],A="setGateFood",w=(0,d.useState)(),$=(0,m.Z)(w,2),x=$[0],I=$[1],B=(0,d.useState)([]),z=(0,m.Z)(B,2),Y=z[0],D=z[1],M=(0,d.useState)([]),W=(0,m.Z)(M,2),N=W[0],le=W[1],H=(0,d.useState)([]),L=(0,m.Z)(H,2),J=L[0],b=L[1];(0,d.useEffect)(function(){var Z=function(){var l=(0,y.Z)((0,i.Z)().mark(function s(f){return(0,i.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:case"end":return u.stop()}},s)}));return function(f){return l.apply(this,arguments)}}();Z()},[]);var oe=function(l,s,f){I(l)},ae=function(l,s){D([].concat((0,se.Z)(l),(0,se.Z)(s)))},Q=function(l,s){},V=function(){var Z=(0,y.Z)((0,i.Z)().mark(function l(s,f){return(0,i.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(s!="right"){u.next=2;break}return u.abrupt("return");case 2:case"end":return u.stop()}},l)}));return function(s,f){return Z.apply(this,arguments)}}(),X=function(){var Z=(0,y.Z)((0,i.Z)().mark(function l(s){var f;return(0,i.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!(x==null||x.length<=0)){u.next=3;break}return v.default.error("\u8BF7\u9009\u62E9\u83DC\u54C1"),u.abrupt("return");case 3:return v.default.loading("\u6B63\u5728\u6DFB\u52A0...",A),u.prev=4,f=[],x.forEach(function(o){f.push({FoodId:o,GateId:s.values.id,FoodName:""})}),j.AddGateFood(f).then(function(o){v.default.destroy(A),o.data?(v.default.success("\u6DFB\u52A0\u6210\u529F"),I([]),D([]),s.onCancel()):v.default.error("\u6DFB\u52A0\u5931\u8D25")}),u.abrupt("return",!0);case 11:return u.prev=11,u.t0=u.catch(4),console.log(u.t0),v.default.destroy(A),v.default.error("\u6DFB\u52A0\u8BF7\u91CD\u8BD5\uFF01"),u.abrupt("return",!1);case 17:case"end":return u.stop()}},l,null,[[4,11]])}));return function(s){return Z.apply(this,arguments)}}();return(0,e.jsx)(Ze.Z,{destroyOnClose:!0,visible:r.shows,width:700,onCancel:function(){b(N),r.onCancel()},onOk:function(){X(r),r.actionRef.current.reload()},children:(0,e.jsx)(ce.ZP,{header:{title:"\u8BBE\u7F6E\u5C4F\u5E55\u663E\u793A\u83DC\u54C1",breadcrumb:{}},children:(0,e.jsx)(ye.Z,{oneWay:te,showSearch:!0,showSelectAll:!0,onSearch:V,dataSource:J,titles:["\u672A\u9009\u62E9","\u5DF2\u9009\u4E2D"],targetKeys:x,selectedKeys:Y,onChange:oe,onSelectChange:ae,onScroll:Q,render:function(l){return l.title},pagination:{pageSize:8},listStyle:{width:500,height:400}})})})},ke=Re,Ke=function(){var r=(0,d.useRef)(),K=G.Z.useForm(),P=(0,m.Z)(K,1),F=P[0],te=(0,d.useState)(!1),ue=(0,m.Z)(te,2),A=ue[0],w=ue[1],$=(0,d.useState)({}),x=(0,m.Z)($,2),I=x[0],B=x[1],z=(0,d.useState)(!1),Y=(0,m.Z)(z,2),D=Y[0],M=Y[1],W=(0,d.useState)(!1),N=(0,m.Z)(W,2),le=N[0],H=N[1],L=(0,d.useState)([]),J=(0,m.Z)(L,2),b=J[0],oe=J[1],ae=(0,d.useState)(""),Q=(0,m.Z)(ae,2),V=Q[0],X=Q[1],Z=(0,d.useState)(1),l=(0,m.Z)(Z,2),s=l[0],f=l[1],g=(0,d.useState)(10),u=(0,m.Z)(g,2),o=u[0],C=u[1],ne=(0,d.useState)([]),q=(0,m.Z)(ne,2),re=q[0],$e=q[1],ze=(0,d.useState)(null),Ce=(0,m.Z)(ze,2),_=Ce[0],xe=Ce[1],We=(0,d.useState)(""),Ge=(0,m.Z)(We,2),fe=Ge[0],he=Ge[1],Le={},Ve={placeholder:"\u8BF7\u8F93\u5165\u5927\u5C4F\u6A2A\u5E45...",MENU_CONF:{fontSize:{fontSizeList:["10px","20px","40px","60px","80px","100px","150px","180px","200px"]},uploadImage:{customUpload:function(t,n){return(0,y.Z)((0,i.Z)().mark(function p(){var S,E,h;return(0,i.Z)().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:S=t.name.lastIndexOf("."),E=t.name.substr(S+1),h=null,j.GetCosRequestURL({directory:"kitchen",fileExtension:E,method:"PUT"}).then(function(ie){var _e=ie.allUrl,je=new FileReader;je.readAsArrayBuffer(t),je.onload=function(et){h=et.target.result,Be().put(_e,h).then(function(Fe){(Fe.status==200||Fe.statusText=="OK")&&(n(ie.seeUrl,ie.seeUrl,ie.seeUrl),v.default.success("\u4E0A\u4F20\u6210\u529F\uFF01"))})}});case 4:case"end":return T.stop()}},p)}))()}}}};(0,d.useEffect)(function(){return function(){_!=null&&(_.destroy(),xe(null))}},[_]);var Ye=function(){var c=(0,y.Z)((0,i.Z)().mark(function t(n){var p,S;return(0,i.Z)().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,j.GetGateSetUp({gateId:n});case 2:p=h.sent,S=[],p.data.forEach(function(R){S.push(R.key)}),$e(S);case 6:case"end":return h.stop()}},t)}));return function(n){return c.apply(this,arguments)}}(),Me=function(t){B(t),w(!0),he(t.remaek),F.setFieldsValue(t)},Ne=function(t){B(t),M(!0)},He=function(t){B(t),H(!0)},Je=function(){w(!0),_&&_.setHtml(""),he(""),F.resetFields()},Qe=function(){var c=(0,y.Z)((0,i.Z)().mark(function t(n){var p,S;return(0,i.Z)().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(!n.id){h.next=8;break}return n.remaek=fe,h.next=4,j.UpdateGateInfo(n);case 4:p=h.sent,p.statusCode===200?(v.default.success("\u66F4\u65B0\u6863\u53E3\u6210\u529F\uFF01"),w(!1),r.current.reload()):v.default.error(p.errors||"\u66F4\u65B0\u5931\u8D25"),h.next=14;break;case 8:return n.remaek=fe,n.status=0,h.next=12,j.AddGate(n);case 12:S=h.sent,S.statusCode===200?(v.default.success("\u65B0\u589E\u6863\u53E3\u6210\u529F\uFF01"),w(!1),r.current.reload()):v.default.error(S.errors||"\u65B0\u589E\u5931\u8D25");case 14:case"end":return h.stop()}},t)}));return function(n){return c.apply(this,arguments)}}(),Xe=[{title:"\u6863\u53E3\u540D\u79F0",dataIndex:"name",ellipsis:!0},{title:"\u5F53\u524D\u573A\u666F",dataIndex:"storeId",render:function(t,n){var p=b.find(function(S){return S.id===n.storeId});if(p)return(0,e.jsx)("div",{children:p.name})}},{title:"\u5C5E\u6027",dataIndex:"mode",valueType:"select",valueEnum:{1:{text:"\u56FA\u5B9A",status:"Success"},2:{text:"\u81EA\u7531\u8BBE\u5B9A",status:"Success"}}},{title:"\u91D1\u989D",dataIndex:"price"},{title:"\u72B6\u6001",dataIndex:"status",valueType:"select",valueEnum:{0:{text:"\u6B63\u5E38",status:"Success"},1:{text:"\u505C\u7528",status:"Error"},2:{text:"\u5220\u9664",status:"Error"}}},{title:"\u64CD\u4F5C",valueType:"option",key:"option",fixed:"right",width:300,render:function(t,n,p,S){return[(0,e.jsx)("a",{onClick:function(){return Me(n)},children:"\u66F4\u65B0"}),(0,e.jsx)("a",{onClick:function(){return He(n)},children:"\u8BBE\u7F6E\u83DC\u54C1"}),(0,e.jsx)("a",{onClick:(0,y.Z)((0,i.Z)().mark(function E(){return(0,i.Z)().wrap(function(R){for(;;)switch(R.prev=R.next){case 0:return R.next=2,Ye(n.id);case 2:Ne(n);case 3:case"end":return R.stop()}},E)})),children:"\u8BBE\u7F6E\u5C4F\u5E55\u663E\u793A"}),(0,e.jsx)(Ee.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u5417\uFF1F",onConfirm:(0,y.Z)((0,i.Z)().mark(function E(){var h;return(0,i.Z)().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return T.next=2,j.Del(n.id);case 2:h=T.sent,h.data?(v.default.success("\u5220\u9664\u6210\u529F"),r.current.reload()):v.default.error("\u5220\u9664\u5931\u8D25");case 4:case"end":return T.stop()}},E)})),okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,e.jsx)("a",{href:"#",children:"\u5220\u9664"})},"delete")]}}],qe=function(){var c=(0,y.Z)((0,i.Z)().mark(function t(){var n;return(0,i.Z)().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return S.next=2,j.GetAllStore();case 2:n=S.sent,n.statusCode=="200"?(oe(n.data),X(n.data[0].id),r.current.reload()):v.default.error(n.msg||"\u83B7\u53D6\u573A\u666F\u5217\u8868\u5931\u8D25");case 4:case"end":return S.stop()}},t)}));return function(){return c.apply(this,arguments)}}();return(0,d.useEffect)(function(){qe()},[]),(0,e.jsx)(ce.ZP,{header:{title:"",breadcrumb:{}},children:(0,e.jsxs)("div",{className:Se().member_card_container,children:[(0,e.jsx)(we.ZP,{columns:Xe,actionRef:r,pagination:{pageSize:o,onChange:function(t){return f(t)}},scroll:{x:1300},request:(0,y.Z)((0,i.Z)().mark(function c(){var t;return(0,i.Z)().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(!V){p.next=6;break}return p.next=3,j.GetGateListByStorePage(V,s,o);case 3:if(t=p.sent,t.statusCode!==200){p.next=6;break}return p.abrupt("return",{data:t.data.data,success:!0,total:t.data.total});case 6:case"end":return p.stop()}},c)})),cardBordered:!0,editable:{type:"multiple"},rowKey:"id",search:!1,options:{setting:{listsHeight:400}},dateFormatter:"string",headerTitle:"\u6863\u53E3\u7BA1\u7406",toolBarRender:function(){return[(0,e.jsxs)("div",{className:Se().table_search_item,children:[(0,e.jsx)("div",{children:"\u5F53\u524D\u573A\u666F\uFF1A"}),(0,e.jsx)(k.Z,{style:{width:300},value:V,onChange:function(n){X(n),r.current.reload()},children:b.map(function(t){return(0,e.jsx)(Option,{value:t.id,children:t.name},t.id)})})]}),(0,e.jsx)(pe.Z,{icon:(0,e.jsx)(Ae.Z,{}),type:"primary",onClick:function(){B({}),Je()},children:"\u65B0\u5EFA"},"button")]}}),(0,e.jsx)(Ie.Z,{destroyOnClose:!0,width:"85%",title:I.id?"\u66F4\u65B0":"\u65B0\u589E",visible:A,onClose:function(){return w(!1)},children:(0,e.jsxs)(G.Z,{name:"basic",onFinish:Qe,form:F,labelCol:{span:4},children:[(0,e.jsx)(G.Z.Item,{label:"id",name:"id",hidden:!0,children:(0,e.jsx)(de.Z,{size:"large"})}),(0,e.jsxs)(Ue.Z,{children:[(0,e.jsx)(ee.Z,{xs:12,sm:12,md:12,lg:12,xl:12,children:(0,e.jsx)(G.Z.Item,{label:"\u6863\u53E3\u540D\u79F0",name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6863\u53E3\u540D\u79F0\uFF01"}],children:(0,e.jsx)(de.Z,{size:"large"})})}),(0,e.jsx)(ee.Z,{xs:12,sm:12,md:12,lg:12,xl:12,children:(0,e.jsx)(G.Z.Item,{label:"\u5F52\u5C5E\u573A\u666F",name:"storeId",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5F52\u5C5E\u573A\u666F\uFF01"}],children:(0,e.jsx)(k.Z,{size:"large",children:b.map(function(c){return(0,e.jsx)(k.Z.Option,{value:c.id,children:c.name},c.id)})})})}),(0,e.jsx)(ee.Z,{xs:12,sm:12,md:12,lg:12,xl:12,children:(0,e.jsx)(G.Z.Item,{label:"\u5C5E\u6027",name:"mode",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5C5E\u6027\uFF01"}],children:(0,e.jsxs)(k.Z,{size:"large",children:[(0,e.jsx)(k.Z.Option,{value:1,children:"\u56FA\u5B9A\u91D1\u989D"}),(0,e.jsx)(k.Z.Option,{value:2,children:"\u81EA\u7531\u8BBE\u5B9A"})]})})}),(0,e.jsx)(ee.Z,{xs:12,sm:12,md:12,lg:12,xl:12,children:(0,e.jsx)(G.Z.Item,{noStyle:!0,shouldUpdate:function(t,n){return t.mode!==n.mode},children:function(t){var n=t.getFieldValue;return n("mode")=="1"?(0,e.jsx)(G.Z.Item,{label:"\u91D1\u989D",name:"price",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u91D1\u989D\uFF01"}],children:(0,e.jsx)(de.Z,{size:"large"})}):null}})}),(0,e.jsx)(ee.Z,{xs:12,sm:12,md:12,lg:12,xl:12,children:(0,e.jsx)(G.Z.Item,{noStyle:!0,shouldUpdate:function(t,n){return t.mode!==n.mode},children:function(t){var n=t.getFieldValue;return I.id?(0,e.jsx)(G.Z.Item,{label:"\u72B6\u6001",name:"status",children:(0,e.jsxs)(k.Z,{size:"large",defaultValue:0,children:[(0,e.jsx)(Option,{value:0,children:"\u6B63\u5E38"}),(0,e.jsx)(Option,{value:1,children:"\u7981\u7528"})]})}):null}})})]}),(0,e.jsxs)("div",{style:{border:"1px solid #ccc",zIndex:100},children:[(0,e.jsx)(ge.o,{editor:_,defaultConfig:Le,mode:"default",style:{borderBottom:"1px solid #ccc"}}),(0,e.jsx)(ge.M,{defaultConfig:Ve,value:fe,onCreated:xe,onChange:function(t){return he(t.getHtml())},mode:"default",style:{height:"500px",overflowY:"hidden"}})]}),(0,e.jsx)(G.Z.Item,{children:(0,e.jsx)(pe.Z,{type:"primary",htmlType:"submit",style:{marginTop:"10px"},children:"\u786E\u5B9A"})})]})}),D&&(0,e.jsx)(be,{shows:D,values:I,actionRef:r,gateSetUp:re,onCancel:function(){M(!1)}}),(0,e.jsx)(ke,{shows:le,values:I,actionRef:r,onCancel:function(){H(!1)}})]})})},Pe=Ke}}]);
|