|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[976],{69513:function(Ee,W,t){"use strict";t.r(W),t.d(W,{default:function(){return ve}});var Pe=t(57663),A=t(71577),Te=t(62350),L=t(24565),c=t(39428),Re=t(34792),h=t(48086),$=t(11849),D=t(3182),j=t(2824),K=t(49101),f=t(67294),U=t(28790),z=t(85224),H=t(16894),Ae=t(62255),We=t(71194),N=t(50146),be=t(43358),O=t(34041),Ve=t(77883),J=t(85986),Ye=t(62999),Q=t(54680),Ge=t(13062),S=t(71230),Me=t(89032),m=t(15746),Le=t(9715),o=t(55843),$e=t(47673),C=t(4107),Ke=t(88983),b=t(47933),I=t(28991),X=t(81253),e=t(85893),w=t(22270),k=t(64893),q=t(50643),_=["fieldProps","options","radioType","layout","proFieldProps","valueEnum"],ee=f.forwardRef(function(n,s){var x=n.fieldProps,Z=n.options,v=n.radioType,B=n.layout,F=n.proFieldProps,E=n.valueEnum,T=(0,X.Z)(n,_);return(0,e.jsx)(q.Z,(0,I.Z)((0,I.Z)({valueType:v==="button"?"radioButton":"radio",ref:s,valueEnum:(0,w.h)(E,void 0)},T),{},{fieldProps:(0,I.Z)({options:Z,layout:B},x),proFieldProps:F,filedConfig:{customLightMode:!0}}))}),te=f.forwardRef(function(n,s){var x=n.fieldProps,Z=n.children;return(0,e.jsx)(b.ZP,(0,I.Z)((0,I.Z)({},x),{},{ref:s,children:Z}))}),ae=(0,k.G)(te,{valuePropName:"checked",ignoreWidth:!0}),P=ae;P.Group=ee,P.Button=b.ZP.Button,P.displayName="ProFormComponent";var ne=P,re=function(s){var x=(0,f.useState)(),Z=(0,j.Z)(x,2),v=Z[0],B=Z[1];return(0,e.jsx)(N.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,onCancel:function(){s.onCancel()},destroyOnClose:!0,children:(0,e.jsxs)(o.Z,{preserve:!1,layout:"horizontal",labelCol:{span:4},initialValues:s.values,onFinish:s.onFinish,children:[(0,e.jsx)(o.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(C.Z,{})}),(0,e.jsxs)(S.Z,{children:[(0,e.jsx)(m.Z,{span:12,children:(0,e.jsx)(o.Z.Item,{name:"code",label:"\u83DC\u5355\u7F16\u7801",rules:[{required:!0,max:255}],children:(0,e.jsx)(C.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u7F16\u7801"})})}),(0,e.jsx)(m.Z,{span:12,children:(0,e.jsx)(o.Z.Item,{name:"name",label:"\u83DC\u5355\u540D\u79F0",rules:[{required:!0,max:255}],children:(0,e.jsx)(C.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u540D\u79F0"})})})]}),(0,e.jsxs)(S.Z,{children:[(0,e.jsx)(m.Z,{span:12,children:(0,e.jsx)(o.Z.Item,{name:"router",label:"\u83DC\u5355\u8DEF\u5F84",children:(0,e.jsx)(C.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u540D\u79F0"})})}),(0,e.jsx)(m.Z,{span:12,children:(0,e.jsx)(o.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)(S.Z,{children:[(0,e.jsx)(m.Z,{span:12,children:(0,e.jsx)(o.Z.Item,{name:"component",label:"\u83DC\u5355\u7EC4\u4EF6",children:(0,e.jsx)(C.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u7EC4\u4EF6"})})}),(0,e.jsx)(m.Z,{span:12,children:(0,e.jsxs)(S.Z,{children:[(0,e.jsx)(m.Z,{span:12,children:(0,e.jsx)(o.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)(o.Z.Item,{name:"icon",label:"\u56FE\u6807",children:(0,e.jsx)(C.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u56FE\u6807"})})})]})})]}),(0,e.jsxs)(S.Z,{children:[(0,e.jsx)(m.Z,{span:12,children:(0,e.jsx)(o.Z.Item,{defaultValue:s.values.isAdmin,name:"isAdmin",label:"\u8D85\u7BA1\u83DC\u5355",rules:[{required:!0}],children:(0,e.jsx)(ne.Group,{initialValue:0,onChange:function(E){B(E.target.value)},options:[{label:"\u5426",value:0},{label:"\u662F",value:1}]})})}),(0,e.jsx)(m.Z,{span:12,children:v!=0&&s.values.type!=0?"":(0,e.jsx)(o.Z.Item,{name:"permission",label:"\u6743\u9650\u6807\u8BC6",children:(0,e.jsx)(O.Z,{placeholder:"\u8BF7\u9009\u62E9\u6743\u9650\u6807\u8BC6",children:s.dictData})})})]}),(0,e.jsxs)(o.Z.Item,{children:[(0,e.jsx)(A.Z,{htmlType:"button",style:{float:"right",left:10},onClick:s.onCancel,children:"\u53D6\u6D88"}),(0,e.jsx)(A.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})]})]})})},ue=re,p=t(48971);function se(n){return(0,p.WY)("/saasbase/api\u200B/menu/getmenutreepage",{method:"post",data:n})}function le(n){return(0,p.WY)("/saasbase/api\u200B/menu/enable?Id=".concat(n))}function ie(n){return(0,p.WY)("/saasbase/api/menu/disable?Id=".concat(n))}function oe(n){return(0,p.WY)("/saasbase/api\u200B/menu/delete",{method:"post",data:n})}function de(n){return(0,p.WY)("/saasbase/api\u200B/menu/add",{method:"post",data:n})}function ce(n){return(0,p.WY)("/saasbase/api\u200B/menu/update",{method:"post",data:n})}function he(){return(0,p.WY)("\u200B/saasbase/api/menu/menutrees?getType=ALL",{method:"Get"})}function fe(n){return(0,p.WY)("/saasbase/api/select/getdictvalue/?TypeCode=".concat(n))}var y={menutreepage:se,trees:he,enable:le,disable:ie,add:de,remove:oe,update:ce,getDicData:fe},Ue="Menu",me=function(){var s=(0,f.useState)(),x=(0,j.Z)(s,2),Z=x[0],v=x[1],B=(0,f.useState)({}),F=(0,j.Z)(B,2),E=F[0],T=F[1],g=(0,f.useRef)(),pe=(0,f.useState)(),V=(0,j.Z)(pe,2),R=V[0],xe=V[1],Ze=(0,f.useState)(),Y=(0,j.Z)(Ze,2),ye=Y[0],je=Y[1],Ce=(0,f.useState)(),G=(0,j.Z)(Ce,2),Fe=G[0],ze=G[1],ge=function(){var i=(0,D.Z)((0,c.Z)().mark(function r(u){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return u.type=2,a.next=3,y.add((0,$.Z)({},u)).then(function(d){d.succeeded?(h.default.success("\u6DFB\u52A0\u6210\u529F"),g.current.reload(),v(!1)):h.default.error(d.errors)});case 3:case"end":return a.stop()}},r)}));return function(u){return i.apply(this,arguments)}}(),De=function(){var i=(0,D.Z)((0,c.Z)().mark(function r(u){return(0,c.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:y.update(u).then(function(d){d.succeeded?(h.default.success("\u66F4\u65B0\u6210\u529F"),g.current.reload(),v(!1)):h.default.error(d.errors)});case 1:case"end":return a.stop()}},r)}));return function(u){return i.apply(this,arguments)}}(),M=function(){var i=(0,D.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,y.trees().then(function(a){je(a.data)});case 2:case"end":return l.stop()}},r)}));return function(){return i.apply(this,arguments)}}();(0,f.useEffect)(function(){},[]);var Se=function(r){var u=[];return u.push((0,e.jsx)("a",{onClick:function(){M(),v(!0),T(r)},children:"\u66F4\u65B0"})),r.status==1&&u.push((0,e.jsx)("a",{onClick:function(){y.enable(r.id).then(function(a){a.succeeded?(h.default.success("\u64CD\u4F5C\u6210\u529F"),g.current.reload()):h.default.error(a.errors)})},children:"\u542F\u7528"})),r.status==0&&u.push((0,e.jsx)("a",{onClick:function(){y.disable(r.id).then(function(a){a.succeeded?(h.default.success("\u64CD\u4F5C\u6210\u529F"),g.current.reload()):h.default.error(a.errors)})},children:"\u7981\u7528"})),u.push((0,e.jsx)(L.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){y.remove([r.id]).then(function(a){a.succeeded?(h.default.success("\u64CD\u4F5C\u6210\u529F"),g.current.reload()):h.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:"\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",fixed:"right",width:350,render:function(r,u){return Se(u)}}];return(0,e.jsxs)(U.ZP,{ghost:!0,header:{title:"",breadcrumb:{}},children:[(0,e.jsx)(H.ZP,{style:{marginTop:"20px"},headerTitle:"\u83DC\u5355\u5217\u8868",actionRef:g,rowKey:"id",pagination:{defaultPageSize:10},search:{labelWidth:120},toolBarRender:function(){return(0,e.jsxs)(A.Z,{type:"primary",onClick:function(){M(),v(!0)},children:[(0,e.jsx)(K.Z,{})," \u65B0\u5EFA"]},"primary1")},request:function(){var i=(0,D.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,y.menutreepage(u).then(function(Be){l=Be.data});case 3:return d.abrupt("return",{data:l,success:!0});case 4:case"end":return d.stop()}},r)}));return function(r){return i.apply(this,arguments)}}(),columns:Ie,rowSelection:{onChange:function(r,u){xe(u)},checkStrictly:!1}}),(R==null?void 0:R.length)>0&&(0,e.jsx)(z.Z,{extra:(0,e.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,e.jsx)("a",{style:{fontWeight:600},children:R.length})," ","\u9879"]})}),(0,e.jsx)(ue,{treeDatas:ye,dictData:Fe,onFinish:function(){var i=(0,D.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 i.apply(this,arguments)}}(),onCancel:function(){v(!1),T({})},modalVisible:Z,values:E||{}})]})},ve=me}}]);
|