25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

p__sys__menus.c2d55b10.async.js 9.2 KiB

1 yıl önce
1
  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[3976,7975,1322],{69513:function(Re,W,t){"use strict";t.r(W),t.d(W,{default:function(){return pe}});var Be=t(57663),A=t(71577),Pe=t(43358),b=t(34041),C=t(2824),m=t(39428),L=t(11849),Te=t(34792),Z=t(48086),D=t(3182),K=t(49101),p=t(67294),O=t(78009),U=t(85224),H=t(16894),We=t(62255),Ae=t(71194),N=t(50146),be=t(77883),z=t(85986),Ve=t(62999),J=t(54680),Ye=t(13062),S=t(71230),Ge=t(89032),x=t(15746),Me=t(9715),v=t(71257),$e=t(47673),F=t(4107),Le=t(88983),V=t(47933),I=t(28991),Q=t(81253),e=t(85893),X=t(22270),w=t(64893),k=t(31649),q=["fieldProps","options","radioType","layout","proFieldProps","valueEnum"],_=p.forwardRef(function(n,r){var o=n.fieldProps,l=n.options,f=n.radioType,a=n.layout,c=n.proFieldProps,E=n.valueEnum,P=(0,Q.Z)(n,q);return(0,e.jsx)(k.Z,(0,I.Z)((0,I.Z)({valueType:f==="button"?"radioButton":"radio",ref:r,valueEnum:(0,X.h)(E,void 0)},P),{},{fieldProps:(0,I.Z)({options:l,layout:a},o),proFieldProps:c,filedConfig:{customLightMode:!0}}))}),ee=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}))}),te=(0,w.G)(ee,{valuePropName:"checked",ignoreWidth:!0}),B=te;B.Group=_,B.Button=V.ZP.Button,B.displayName="ProFormComponent";var ne=B,ae=function(r){var o=(0,p.useState)(),l=(0,C.Z)(o,2),f=l[0],a=l[1];return(0,e.jsx)(N.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)(J.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)(z.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)(ne.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"})})]})})},re=ae,j=t(48971);function ue(n){return(0,j.WY)("/kitchen/api\u200B/menu/getmenutreepage",{method:"post",data:n})}function se(n){return(0,j.WY)("/kitchen/api\u200B/menu/enable?Id=".concat(n))}function le(n){return(0,j.WY)("/kitchen/api/menu/disable?Id=".concat(n))}function ie(n){return(0,j.WY)("/kitchen/api\u200B/menu/delete",{method:"post",data:n})}function oe(n){return(0,j.WY)("/kitchen/api\u200B/menu/add",{method:"post",data:n})}function de(n){return(0,j.WY)("/kitchen/api\u200B/menu/update",{method:"post",data:n})}function ce(){return(0,j.WY)("\u200B/kitchen/api/select/menutree/?GetType=ALL")}function he(n){return(0,j.WY)("/kitchen/api/select/getdictvalue/?TypeCode=".concat(n))}var y={menutreepage:ue,trees:ce,enable:se,disable:le,add:oe,remove:ie,update:de,getDicData:he},ve=function(){var n=(0,D.Z)((0,m.Z)().mark(function r(o){var l;return(0,m.Z)().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)}}(),fe=function(){var n=(0,D.Z)((0,m.Z)().mark(function r(o){var l;return(0,m.Z)().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)}}(),Ke=null,Oe="Menu",me=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],P=c[1],R=(0,p.useRef)(),xe=(0,p.useState)(),Y=(0,C.Z)(xe,2),T=Y[0],Ze=Y[1],je=(0,p.useState)(),G=(0,C.Z)(je,2),ye=G[0],Ce=G[1],Fe=(0,p.useState)(),M=(0,C.Z)(Fe,2),ge=M[0],De=M[1],$=function(){var h=(0,D.Z)((0,m.Z)().mark(function u(){return(0,m.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,y.trees().then(function(g){Ce(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]}));De(u)})},[]);var Se=function(u){var s=[];return s.push((0,e.jsx)("a",{onClick:function(){$(),f(!0),P(u)},children:"\u4FEE\u6539"})),u.status==1&&s.push((0,e.jsx)("a",{onClick:function(){y.enable(u.id).then(function(g){R.current.reload()})},children:"\u542F\u7528"})),u.status==0&&s.push((0,e.jsx)("a",{onClick:function(){y.disable(u.id).then(function(g){R.current.reload()})},children:"\u7981\u7528"})),s.push((0,e.jsx)("a",{onClick:function(){y.remove([u.id]).then(function(g){R.current.reload()})},children:"\u5220\u9664"})),s},Ie=[{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 Se(s)}}];return(0,e.jsxs)(O.ZP,{children:[(0,e.jsx)(H.ZP,{headerTitle:"\u83DC\u5355\u5217\u8868",actionRef:R,rowKey:"id",search:{labelWidth:120},toolBarRender:function(){return(0,e.jsxs)(A.Z,{type:"primary",onClick:function(){$(),f(!0)},children:[(0,e.jsx)(K.Z,{})," \u65B0\u5EFA"]},"primary1")},request:function(){var h=(0,D.Z)((0,m.Z)().mark(function u(s){var i;return(0,m.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return i=[],d.next=3,y.menutreepage(s).then(function(Ee){i=Ee.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:Ie,rowSelection:{onChange:function(u,s){Ze(s)},checkStrictly:!1}}),(T==null?void 0:T.length)>0&&(0,e.jsx)(U.Z,{extra:(0,e.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,e.jsx)("a",{style:{fontWeight:600},children:T.length})," ","\u9879"]})}),(0,e.jsx)(re,{treeDatas:ye,dictData:ge,onFinish:function(){var h=(0,D.Z)((0,m.Z)().mark(function u(s){var i;return(0,m.Z)().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(i=!1,!s.id){d.next=7;break}return d.next=4,fe(s);case 4:i=d.sent,d.next=10;break;case 7:return d.next=9,ve(s);case 9:i=d.sent;case 10:i&&(f(!1),R.current.reload());case 11:case"end":return d.stop()}},u)}));return function(u){return h.apply(this,arguments)}}(),onCancel:function(){f(!1),P({})},modalVisible:l,values:E||{}})]})},pe=me}}]);