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
9.2 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[3976,1322],{69513:function(Pe,W,t){"use strict";t.r(W),t.d(W,{default:function(){return xe}});var Re=t(57663),A=t(71577),Te=t(43358),b=t(34041),C=t(2824),L=t(11849),We=t(34792),Z=t(48086),D=t(3182),K=t(94043),m=t.n(K),O=t(49101),p=t(67294),U=t(78009),H=t(85224),N=t(16894),Ae=t(62255),be=t(71194),z=t(50146),Ve=t(77883),J=t(85482),Ye=t(62999),Q=t(54680),Ge=t(13062),S=t(71230),Me=t(89032),x=t(15746),$e=t(9715),v=t(86835),Le=t(47673),F=t(4107),Ke=t(88983),V=t(47933),I=t(28991),X=t(81253),e=t(85893),w=t(22270),k=t(64893),q=t(31649),_=["fieldProps","options","radioType","layout","proFieldProps","valueEnum"],ee=p.forwardRef(function(n,r){var o=n.fieldProps,l=n.options,f=n.radioType,a=n.layout,c=n.proFieldProps,E=n.valueEnum,R=(0,X.Z)(n,_);return(0,e.jsx)(q.Z,(0,I.Z)((0,I.Z)({mode:"edit",valueType:f==="button"?"radioButton":"radio",ref:r,valueEnum:(0,w.h)(E,void 0)},R),{},{fieldProps:(0,I.Z)({options:l,layout:a},o),proFieldProps:c,filedConfig:{customLightMode:!0}}))}),te=p.forwardRef(function(n,r){var o=n.fieldProps,l=n.children;return(0,e.jsx)(V.ZP,(0,I.Z)((0,I.Z)({},o),{},{ref:r,children:l}))}),ne=(0,k.G)(te,{valuePropName:"checked",ignoreWidth:!0}),P=ne;P.Group=ee,P.Button=V.ZP.Button,P.displayName="ProFormComponent";var ae=P,re=function(r){var o=(0,p.useState)(),l=(0,C.Z)(o,2),f=l[0],a=l[1];return(0,e.jsx)(z.Z,{title:r.values.id?"\u7F16\u8F91\u83DC\u5355":"\u65B0\u5EFA\u83DC\u5355",width:1e3,visible:r.modalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){r.onCancel()},destroyOnClose:!0,children:(0,e.jsxs)(v.Z,{preserve:!1,layout:"horizontal",labelCol:{span:4},initialValues:r.values,onFinish:r.onFinish,children:[(0,e.jsx)(v.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(F.Z,{})}),(0,e.jsxs)(S.Z,{children:[(0,e.jsx)(x.Z,{span:12,children:(0,e.jsx)(v.Z.Item,{name:"code",label:"\u83DC\u5355\u7F16\u7801",rules:[{required:!0,max:255}],children:(0,e.jsx)(F.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u7F16\u7801"})})}),(0,e.jsx)(x.Z,{span:12,children:(0,e.jsx)(v.Z.Item,{name:"name",label:"\u83DC\u5355\u540D\u79F0",rules:[{required:!0,max:255}],children:(0,e.jsx)(F.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u540D\u79F0"})})})]}),(0,e.jsxs)(S.Z,{children:[(0,e.jsx)(x.Z,{span:12,children:(0,e.jsx)(v.Z.Item,{name:"router",label:"\u83DC\u5355\u8DEF\u5F84",children:(0,e.jsx)(F.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u540D\u79F0"})})}),(0,e.jsx)(x.Z,{span:12,children:(0,e.jsx)(v.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:r.treeDatas,placeholder:"\u8BF7\u9009\u62E9\u4E0A\u7EA7\u83DC\u5355",treeDefaultExpandAll:!0})})})]}),(0,e.jsxs)(S.Z,{children:[(0,e.jsx)(x.Z,{span:12,children:(0,e.jsx)(v.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)(x.Z,{span:12,children:(0,e.jsxs)(S.Z,{children:[(0,e.jsx)(x.Z,{span:12,children:(0,e.jsx)(v.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)(x.Z,{span:12,children:(0,e.jsx)(v.Z.Item,{name:"icon",label:"\u56FE\u6807",children:(0,e.jsx)(F.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u56FE\u6807"})})})]})})]}),(0,e.jsxs)(S.Z,{children:[(0,e.jsx)(x.Z,{span:12,children:(0,e.jsx)(v.Z.Item,{defaultValue:r.values.type,name:"type",label:"\u83DC\u5355\u5C42\u7EA7",rules:[{required:!0}],children:(0,e.jsx)(ae.Group,{initialValue:0,onChange:function(E){a(E.target.value)},options:[{label:"\u6309\u94AE",value:0},{label:"\u83DC\u5355",value:1}]})})}),(0,e.jsx)(x.Z,{span:12,children:f!=0&&r.values.type!=0?"":(0,e.jsx)(v.Z.Item,{name:"permission",label:"\u6743\u9650\u6807\u8BC6",children:(0,e.jsx)(b.Z,{placeholder:"\u8BF7\u9009\u62E9\u6743\u9650\u6807\u8BC6",children:r.dictData})})})]}),(0,e.jsx)(v.Z.Item,{children:(0,e.jsx)(A.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},ue=re,j=t(48971);function se(n){return(0,j.WY)("/kitchen/api\u200B/menu/getmenutreepage",{method:"post",data:n})}function le(n){return(0,j.WY)("/kitchen/api\u200B/menu/enable?Id=".concat(n))}function ie(n){return(0,j.WY)("/kitchen/api/menu/disable?Id=".concat(n))}function oe(n){return(0,j.WY)("/kitchen/api\u200B/menu/delete",{method:"post",data:n})}function de(n){return(0,j.WY)("/kitchen/api\u200B/menu/add",{method:"post",data:n})}function ce(n){return(0,j.WY)("/kitchen/api\u200B/menu/update",{method:"post",data:n})}function he(){return(0,j.WY)("\u200B/kitchen/api/select/menutree/?GetType=ALL")}function ve(n){return(0,j.WY)("/kitchen/api/select/getdictvalue/?TypeCode=".concat(n))}var y={menutreepage:se,trees:he,enable:le,disable:ie,add:de,remove:oe,update:ce,getDicData:ve},fe=function(){var n=(0,D.Z)(m().mark(function r(o){var l;return m().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return l=Z.default.loading("\u6B63\u5728\u6DFB\u52A0"),a.prev=1,a.next=4,y.add((0,L.Z)({},o)).then(function(c){if(!c.data.data)return Z.default.success(c.errors),!1});case 4:return l(),Z.default.success("\u6DFB\u52A0\u6210\u529F"),a.abrupt("return",!0);case 9:return a.prev=9,a.t0=a.catch(1),l(),Z.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),a.abrupt("return",!1);case 14:case"end":return a.stop()}},r,null,[[1,9]])}));return function(o){return n.apply(this,arguments)}}(),me=function(){var n=(0,D.Z)(m().mark(function r(o){var l;return m().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return l=Z.default.loading("\u6B63\u5728\u914D\u7F6E"),a.prev=1,y.update(o).then(function(c){if(!c.data)return Z.default.error(c.errors),!1}),l(),Z.default.success("\u914D\u7F6E\u6210\u529F"),a.abrupt("return",!0);case 8:return a.prev=8,a.t0=a.catch(1),l(),Z.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),a.abrupt("return",!1);case 13:case"end":return a.stop()}},r,null,[[1,8]])}));return function(o){return n.apply(this,arguments)}}(),Oe=null,Ue="Menu",pe=function(){var r=(0,p.useState)(),o=(0,C.Z)(r,2),l=o[0],f=o[1],a=(0,p.useState)({}),c=(0,C.Z)(a,2),E=c[0],R=c[1],B=(0,p.useRef)(),Ze=(0,p.useState)(),Y=(0,C.Z)(Ze,2),T=Y[0],je=Y[1],ye=(0,p.useState)(),G=(0,C.Z)(ye,2),Ce=G[0],Fe=G[1],ge=(0,p.useState)(),M=(0,C.Z)(ge,2),De=M[0],Se=M[1],$=function(){var h=(0,D.Z)(m().mark(function u(){return m().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,y.trees().then(function(g){Fe(g.data)});case 2:case"end":return i.stop()}},u)}));return function(){return h.apply(this,arguments)}}();(0,p.useEffect)(function(){y.getDicData("hand_type").then(function(h){var u=[];for(var s in h.data)u.push((0,e.jsx)(b.Z.Option,{value:s,children:h.data[s]}));Se(u)})},[]);var Ie=function(u){var s=[];return s.push((0,e.jsx)("a",{onClick:function(){$(),f(!0),R(u)},children:"\u4FEE\u6539"})),u.status==1&&s.push((0,e.jsx)("a",{onClick:function(){y.enable(u.id).then(function(g){B.current.reload()})},children:"\u542F\u7528"})),u.status==0&&s.push((0,e.jsx)("a",{onClick:function(){y.disable(u.id).then(function(g){B.current.reload()})},children:"\u7981\u7528"})),s.push((0,e.jsx)("a",{onClick:function(){y.remove([u.id]).then(function(g){B.current.reload()})},children:"\u5220\u9664"})),s},Ee=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"key",hideInSearch:!0,hideInTable:!0},{title:"\u83DC\u5355\u540D\u79F0",dataIndex:"name"},{title:"\u83DC\u5355\u7F16\u7801",dataIndex:"code"},{title:"\u83DC\u5355\u56FE\u6807",dataIndex:"icon",hideInSearch:!0},{title:"\u83DC\u5355\u8DEF\u5F84",dataIndex:"router",hideInSearch:!0},{title:"\u72B6\u6001",dataIndex:"status",hideInSearch:!0,valueEnum:{0:{text:"\u542F\u7528",status:"Success"},1:{text:"\u7981\u7528",status:"Warning"}}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",sorter:!0,hideInSearch:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(u,s){return Ie(s)}}];return(0,e.jsxs)(U.ZP,{children:[(0,e.jsx)(N.ZP,{headerTitle:"\u83DC\u5355\u5217\u8868",actionRef:B,rowKey:"id",search:{labelWidth:120},toolBarRender:function(){return(0,e.jsxs)(A.Z,{type:"primary",onClick:function(){$(),f(!0)},children:[(0,e.jsx)(O.Z,{})," \u65B0\u5EFA"]},"primary1")},request:function(){var h=(0,D.Z)(m().mark(function u(s){var i;return m().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return i=[],d.next=3,y.menutreepage(s).then(function(Be){i=Be.data});case 3:return d.abrupt("return",{data:i,success:!0});case 4:case"end":return d.stop()}},u)}));return function(u){return h.apply(this,arguments)}}(),columns:Ee,rowSelection:{onChange:function(u,s){je(s)},checkStrictly:!1}}),(T==null?void 0:T.length)>0&&(0,e.jsx)(H.Z,{extra:(0,e.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,e.jsx)("a",{style:{fontWeight:600},children:T.length})," ","\u9879"]})}),(0,e.jsx)(ue,{treeDatas:Ce,dictData:De,onFinish:function(){var h=(0,D.Z)(m().mark(function u(s){var i;return m().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(i=!1,!s.id){d.next=7;break}return d.next=4,me(s);case 4:i=d.sent,d.next=10;break;case 7:return d.next=9,fe(s);case 9:i=d.sent;case 10:i&&(f(!1),B.current.reload());case 11:case"end":return d.stop()}},u)}));return function(u){return h.apply(this,arguments)}}(),onCancel:function(){f(!1),R({})},modalVisible:l,values:E||{}})]})},xe=pe}}]);