包含后厨 团餐 门店分支
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2 lines
8.6 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[3976],{69513:function(Ee,V,t){"use strict";t.r(V),t.d(V,{default:function(){return ve}});var Pe=t(57663),W=t(71577),Re=t(62350),b=t(24565),c=t(39428),Te=t(34792),y=t(48086),K=t(11849),g=t(3182),j=t(2824),L=t(49101),h=t(67294),z=t(28790),H=t(85224),N=t(16894),Ae=t(62255),We=t(71194),O=t(50146),Ve=t(77883),J=t(21888),Ye=t(62999),Q=t(85733),Ge=t(13062),D=t(71230),Me=t(89032),m=t(15746),$e=t(9715),i=t(55843),Ue=t(47673),F=t(4107),be=t(88983),Y=t(47933),S=t(28991),X=t(81253),e=t(85893),w=t(22270),k=t(64893),q=t(31649),_=["fieldProps","options","radioType","layout","proFieldProps","valueEnum"],ee=h.forwardRef(function(n,s){var p=n.fieldProps,Z=n.options,x=n.radioType,B=n.layout,C=n.proFieldProps,E=n.valueEnum,R=(0,X.Z)(n,_);return(0,e.jsx)(q.Z,(0,S.Z)((0,S.Z)({valueType:x==="button"?"radioButton":"radio",ref:s,valueEnum:(0,w.h)(E,void 0)},R),{},{fieldProps:(0,S.Z)({options:Z,layout:B},p),proFieldProps:C,filedConfig:{customLightMode:!0}}))}),te=h.forwardRef(function(n,s){var p=n.fieldProps,Z=n.children;return(0,e.jsx)(Y.ZP,(0,S.Z)((0,S.Z)({},p),{},{ref:s,children:Z}))}),ne=(0,k.G)(te,{valuePropName:"checked",ignoreWidth:!0}),P=ne;P.Group=ee,P.Button=Y.ZP.Button,P.displayName="ProFormComponent";var ae=P,re=function(s){var p=(0,h.useState)(),Z=(0,j.Z)(p,2),x=Z[0],B=Z[1];return(0,e.jsx)(O.Z,{title:s.values.id?"\u7F16\u8F91\u83DC\u5355":"\u65B0\u5EFA\u83DC\u5355",width:1e3,visible:s.modalVisible,bodyStyle:{padding:"32px 40px 1px 48px"},footer:null,maskClosable:!1,onCancel:function(){s.onCancel()},destroyOnClose:!0,children:(0,e.jsxs)(i.Z,{preserve:!1,layout:"horizontal",labelCol:{span:4},initialValues:s.values,onFinish:s.onFinish,children:[(0,e.jsx)(i.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(F.Z,{})}),(0,e.jsxs)(D.Z,{children:[(0,e.jsx)(m.Z,{span:12,children:(0,e.jsx)(i.Z.Item,{name:"code",label:"\u83DC\u5355\u7F16\u7801",rules:[{required:!0}],children:(0,e.jsx)(F.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u7F16\u7801"})})}),(0,e.jsx)(m.Z,{span:12,children:(0,e.jsx)(i.Z.Item,{name:"name",label:"\u83DC\u5355\u540D\u79F0",rules:[{required:!0}],children:(0,e.jsx)(F.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u540D\u79F0"})})})]}),(0,e.jsxs)(D.Z,{children:[(0,e.jsx)(m.Z,{span:12,children:(0,e.jsx)(i.Z.Item,{name:"router",label:"\u83DC\u5355\u8DEF\u5F84",rules:[{required:!0}],children:(0,e.jsx)(F.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u540D\u79F0"})})}),(0,e.jsx)(m.Z,{span:12,children:(0,e.jsx)(i.Z.Item,{name:"pid",label:"\u4E0A\u7EA7\u83DC\u5355",children:(0,e.jsx)(Q.Z,{allowClear:!0,style:{width:"100%"},dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:s.treeDatas,placeholder:"\u8BF7\u9009\u62E9\u4E0A\u7EA7\u83DC\u5355",treeDefaultExpandAll:!0})})})]}),(0,e.jsxs)(D.Z,{children:[(0,e.jsx)(m.Z,{span:12,children:(0,e.jsx)(i.Z.Item,{name:"component",label:"\u83DC\u5355\u7EC4\u4EF6",children:(0,e.jsx)(F.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u7EC4\u4EF6"})})}),(0,e.jsx)(m.Z,{span:12,children:(0,e.jsxs)(D.Z,{children:[(0,e.jsx)(m.Z,{span:12,children:(0,e.jsx)(i.Z.Item,{name:"sort",label:"\u6392\u5E8F",style:{marginLeft:"2.5em",overflow:"auto"},children:(0,e.jsx)(J.Z,{min:1,style:{marginLeft:"0.8em"}})})}),(0,e.jsx)(m.Z,{span:12,children:(0,e.jsx)(i.Z.Item,{name:"icon",label:"\u56FE\u6807",children:(0,e.jsx)(F.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u56FE\u6807"})})})]})})]}),(0,e.jsx)(D.Z,{children:(0,e.jsx)(m.Z,{span:12,children:(0,e.jsx)(i.Z.Item,{defaultValue:s.values.isAdmin,name:"isAdmin",label:"\u8D85\u7BA1\u83DC\u5355",rules:[{required:!0}],children:(0,e.jsx)(ae.Group,{initialValue:0,onChange:function(E){B(E.target.value)},options:[{label:"\u5426",value:0},{label:"\u662F",value:1}]})})})}),(0,e.jsxs)(i.Z.Item,{children:[(0,e.jsx)(W.Z,{htmlType:"button",style:{float:"right",left:10},onClick:s.onCancel,children:"\u53D6\u6D88"}),(0,e.jsx)(W.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})]})]})})},ue=re,f=t(48971),v=t(96690);function le(n){return(0,f.WY)((0,v.w)()+"/api\u200B/menu/getmenutreepage",{method:"post",data:n})}function se(n){return(0,f.WY)((0,v.w)()+"/api\u200B/menu/enable?Id=".concat(n))}function oe(n){return(0,f.WY)((0,v.w)()+"/api/menu/disable?Id=".concat(n))}function ie(n){return(0,f.WY)((0,v.w)()+"/api\u200B/menu/delete",{method:"post",data:n})}function de(n){return(0,f.WY)((0,v.w)()+"/api\u200B/menu/add",{method:"post",data:n})}function ce(n){return(0,f.WY)((0,v.w)()+"/api\u200B/menu/update",{method:"post",data:n})}function he(){return(0,f.WY)((0,v.w)()+"\u200B/api/menu/menutreesall",{method:"Get"})}function me(n){return(0,f.WY)((0,v.w)()+"/api/select/getdictvalue/?TypeCode=".concat(n))}var I={menutreepage:le,trees:he,enable:se,disable:oe,add:de,remove:ie,update:ce,getDicData:me},Ke="Menu",fe=function(){var s=(0,h.useState)(),p=(0,j.Z)(s,2),Z=p[0],x=p[1],B=(0,h.useState)({}),C=(0,j.Z)(B,2),E=C[0],R=C[1],T=(0,h.useRef)(),pe=(0,h.useState)(),G=(0,j.Z)(pe,2),A=G[0],Ze=G[1],xe=(0,h.useState)(),M=(0,j.Z)(xe,2),ye=M[0],je=M[1],Fe=(0,h.useState)(),$=(0,j.Z)(Fe,2),Ce=$[0],Le=$[1],ge=function(){var o=(0,g.Z)((0,c.Z)().mark(function r(u){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,I.add((0,K.Z)({},u)).then(function(d){d.succeeded?(y.default.success("\u6DFB\u52A0\u6210\u529F"),T.current.reloadAndRest(),x(!1)):y.default.error(d.errors)});case 2:case"end":return a.stop()}},r)}));return function(u){return o.apply(this,arguments)}}(),De=function(){var o=(0,g.Z)((0,c.Z)().mark(function r(u){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:I.update(u).then(function(d){d.succeeded?(y.default.success("\u66F4\u65B0\u6210\u529F"),T.current.reloadAndRest(),x(!1)):y.default.error(d.errors)});case 1:case"end":return a.stop()}},r)}));return function(u){return o.apply(this,arguments)}}(),U=function(){var o=(0,g.Z)((0,c.Z)().mark(function r(){return(0,c.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,I.trees().then(function(a){je(a.data)});case 2:case"end":return l.stop()}},r)}));return function(){return o.apply(this,arguments)}}();(0,h.useEffect)(function(){},[]);var Se=function(r){var u=[];return u.push((0,e.jsx)("a",{onClick:function(){U(),x(!0),R(r)},children:"\u66F4\u65B0"})),u.push((0,e.jsx)(b.Z,{type:"primary",title:"\u5220\u9664\u4F1A\u5C06\u5B50\u83DC\u5355\u4E00\u8D77\u5220\u9664\uFF0C\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){I.remove([r.id]).then(function(a){a.succeeded?(y.default.success("\u64CD\u4F5C\u6210\u529F"),T.current.reloadAndRest()):y.default.error(a.errors)})},onCancel:function(){},children:(0,e.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")),u},Ie=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"key",hideInSearch:!0,hideInTable:!0},{title:"\u83DC\u5355\u540D\u79F0",dataIndex:"name",ellipsis:!0},{title:"\u83DC\u5355\u7F16\u7801",dataIndex:"code",ellipsis:!0},{title:"\u6392\u5E8F",dataIndex:"sort",ellipsis:!0},{title:"\u83DC\u5355\u56FE\u6807",dataIndex:"icon",hideInSearch:!0},{title:"\u83DC\u5355\u8DEF\u5F84",dataIndex:"router",hideInSearch:!0,ellipsis:!0},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",hideInSearch:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",fixed:"right",width:350,render:function(r,u){return Se(u)}}];return(0,e.jsxs)(z.ZP,{ghost:!0,header:{title:"",breadcrumb:{}},children:[(0,e.jsx)(N.ZP,{style:{marginTop:"20px"},headerTitle:"\u83DC\u5355\u5217\u8868",actionRef:T,rowKey:"id",pagination:{defaultPageSize:10},search:{labelWidth:120},toolBarRender:function(){return(0,e.jsxs)(W.Z,{type:"primary",onClick:function(){U(),x(!0)},children:[(0,e.jsx)(L.Z,{})," \u65B0\u5EFA"]},"primary1")},request:function(){var o=(0,g.Z)((0,c.Z)().mark(function r(u){var l;return(0,c.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return l=[],d.next=3,I.menutreepage(u).then(function(Be){l=Be.data,console.log("UserData",l)});case 3:return d.abrupt("return",{data:l,success:!0});case 4:case"end":return d.stop()}},r)}));return function(r){return o.apply(this,arguments)}}(),columns:Ie,rowSelection:{onChange:function(r,u){Ze(u)},checkStrictly:!1}}),(A==null?void 0:A.length)>0&&(0,e.jsx)(H.Z,{extra:(0,e.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,e.jsx)("a",{style:{fontWeight:600},children:A.length})," ","\u9879"]})}),(0,e.jsx)(ue,{treeDatas:ye,dictData:Ce,onFinish:function(){var o=(0,g.Z)((0,c.Z)().mark(function r(u){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(!u.id){a.next=5;break}return a.next=3,De(u);case 3:a.next=7;break;case 5:return a.next=7,ge(u);case 7:case"end":return a.stop()}},r)}));return function(r){return o.apply(this,arguments)}}(),onCancel:function(){x(!1),R({})},modalVisible:Z,values:E||{}})]})},ve=fe}}]);