|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[3976],{47919:function(ve,B,t){"use strict";t.r(B),t.d(B,{default:function(){return te}});var pe=t(57663),b=t(71577),Ze=t(62350),P=t(24565),i=t(39428),$=t(11849),xe=t(34792),d=t(48086),j=t(3182),y=t(2824),M=t(49101),m=t(67294),L=t(28790),K=t(85224),U=t(16894),je=t(62255),ye=t(71194),z=t(50146),Ce=t(77883),G=t(21888),ge=t(62999),H=t(85733),Fe=t(13062),F=t(71230),De=t(89032),v=t(15746),Se=t(9715),o=t(55843),Ie=t(47673),C=t(4107),a=t(85893),O=function(c){var D=(0,m.useState)(),S=(0,y.Z)(D,2),x=S[0],T=S[1];return(0,a.jsx)(z.Z,{title:c.values.id?"\u7F16\u8F91\u83DC\u5355":"\u65B0\u5EFA\u83DC\u5355",width:1e3,visible:c.modalVisible,bodyStyle:{padding:"32px 40px 1px 48px"},footer:null,onCancel:function(){c.onCancel()},destroyOnClose:!0,children:(0,a.jsxs)(o.Z,{preserve:!1,layout:"horizontal",labelCol:{span:4},initialValues:c.values,onFinish:c.onFinish,children:[(0,a.jsx)(o.Z.Item,{name:"id",hidden:!0,children:(0,a.jsx)(C.Z,{})}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(v.Z,{span:12,children:(0,a.jsx)(o.Z.Item,{name:"code",label:"\u83DC\u5355\u7F16\u7801",rules:[{required:!0,max:255}],children:(0,a.jsx)(C.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u7F16\u7801"})})}),(0,a.jsx)(v.Z,{span:12,children:(0,a.jsx)(o.Z.Item,{name:"name",label:"\u83DC\u5355\u540D\u79F0",rules:[{required:!0,max:255}],children:(0,a.jsx)(C.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u540D\u79F0"})})})]}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(v.Z,{span:12,children:(0,a.jsx)(o.Z.Item,{name:"router",label:"\u83DC\u5355\u8DEF\u5F84",children:(0,a.jsx)(C.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u540D\u79F0"})})}),(0,a.jsx)(v.Z,{span:12,children:(0,a.jsx)(o.Z.Item,{name:"pid",label:"\u4E0A\u7EA7\u83DC\u5355",children:(0,a.jsx)(H.Z,{allowClear:!0,style:{width:"100%"},dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:c.treeDatas,placeholder:"\u8BF7\u9009\u62E9\u4E0A\u7EA7\u83DC\u5355",treeDefaultExpandAll:!0})})})]}),(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(v.Z,{span:12,children:(0,a.jsx)(o.Z.Item,{name:"component",label:"\u83DC\u5355\u7EC4\u4EF6",children:(0,a.jsx)(C.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u7EC4\u4EF6"})})}),(0,a.jsx)(v.Z,{span:12,children:(0,a.jsxs)(F.Z,{children:[(0,a.jsx)(v.Z,{span:12,children:(0,a.jsx)(o.Z.Item,{name:"sort",label:"\u6392\u5E8F",style:{marginLeft:"2.5em",overflow:"auto"},children:(0,a.jsx)(G.Z,{min:1,style:{marginLeft:"0.8em"}})})}),(0,a.jsx)(v.Z,{span:12,children:(0,a.jsx)(o.Z.Item,{name:"icon",label:"\u56FE\u6807",children:(0,a.jsx)(C.Z,{placeholder:"\u8BF7\u8F93\u5165\u83DC\u5355\u56FE\u6807"})})})]})})]}),(0,a.jsxs)(o.Z.Item,{children:[(0,a.jsx)(b.Z,{htmlType:"button",style:{float:"right",left:10},onClick:c.onCancel,children:"\u53D6\u6D88"}),(0,a.jsx)(b.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})]})]})})},J=O,p=t(48971);function N(l){return(0,p.WY)("/saasbase/api\u200B/menu/getmenutreepage",{method:"post",data:l})}function Q(l){return(0,p.WY)("/saasbase/api\u200B/menu/enable?Id=".concat(l))}function X(l){return(0,p.WY)("/saasbase/api/menu/disable?Id=".concat(l))}function w(l){return(0,p.WY)("/saasbase/api\u200B/menu/delete",{method:"post",data:l})}function k(l){return(0,p.WY)("/saasbase/api\u200B/menu/add",{method:"post",data:l})}function q(l){return(0,p.WY)("/saasbase/api\u200B/menu/update",{method:"post",data:l})}function _(){return(0,p.WY)("\u200B/saasbase/api/menu/menutrees?getType=ALL",{method:"Get"})}function ee(l){return(0,p.WY)("/saasbase/api/select/getdictvalue/?TypeCode=".concat(l))}var Z={menutreepage:N,trees:_,enable:Q,disable:X,add:k,remove:w,update:q,getDicData:ee},be="Menu",ae=function(){var c=(0,m.useState)(),D=(0,y.Z)(c,2),S=D[0],x=D[1],T=(0,m.useState)({}),E=(0,y.Z)(T,2),ne=E[0],A=E[1],g=(0,m.useRef)(),re=(0,m.useState)(),R=(0,y.Z)(re,2),I=R[0],ue=R[1],se=(0,m.useState)(),W=(0,y.Z)(se,2),le=W[0],ie=W[1],de=(0,m.useState)(),Y=(0,y.Z)(de,2),oe=Y[0],Ee=Y[1],ce=function(){var s=(0,j.Z)((0,i.Z)().mark(function r(u){var n;return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=d.default.loading("\u6B63\u5728\u6DFB\u52A0"),e.prev=1,e.next=4,Z.add((0,$.Z)({},u)).then(function(f){f.succeeded?(n(),d.default.success("\u6DFB\u52A0\u6210\u529F"),x(!1)):d.default.error(f.errors)});case 4:e.next=11;break;case 6:return e.prev=6,e.t0=e.catch(1),n(),d.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 11:case"end":return e.stop()}},r,null,[[1,6]])}));return function(u){return s.apply(this,arguments)}}(),he=function(){var s=(0,j.Z)((0,i.Z)().mark(function r(u){var n;return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:n=d.default.loading("\u6B63\u5728\u914D\u7F6E"),e.prev=1,Z.update(u).then(function(f){f.succeeded?(n(),d.default.success("\u66F4\u65B0\u6210\u529F"),x(!1)):d.default.error(f.errors)}),e.next=10;break;case 5:return e.prev=5,e.t0=e.catch(1),n(),d.default.error("\u66F4\u65B0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 10:case"end":return e.stop()}},r,null,[[1,5]])}));return function(u){return s.apply(this,arguments)}}(),Be=function(){var s=(0,j.Z)((0,i.Z)().mark(function r(u){var n;return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=d.default.loading("\u6B63\u5728\u5220\u9664"),u){e.next=3;break}return e.abrupt("return",!0);case 3:return e.prev=3,e.next=6,Z.remove(u.map(function(f){return f.id}));case 6:return n(),d.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),e.abrupt("return",!0);case 11:return e.prev=11,e.t0=e.catch(3),n(),d.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),e.abrupt("return",!1);case 16:case"end":return e.stop()}},r,null,[[3,11]])}));return function(u){return s.apply(this,arguments)}}(),V=function(){var s=(0,j.Z)((0,i.Z)().mark(function r(){return(0,i.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Z.trees().then(function(h){ie(h.data)});case 2:case"end":return n.stop()}},r)}));return function(){return s.apply(this,arguments)}}();(0,m.useEffect)(function(){},[]);var fe=function(r){var u=[];return u.push((0,a.jsx)("a",{onClick:function(){V(),x(!0),A(r)},children:"\u66F4\u65B0"})),r.status==1&&u.push((0,a.jsx)("a",{onClick:function(){Z.enable(r.id).then(function(h){g.current.reload()})},children:"\u542F\u7528"})),r.status==0&&u.push((0,a.jsx)("a",{onClick:function(){Z.disable(r.id).then(function(h){g.current.reload()})},children:"\u7981\u7528"})),u.push((0,a.jsx)(P.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){Z.remove([r.id]).then(function(h){g.current.reload()})},onCancel:function(){},children:(0,a.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")),u},me=[{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:"\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 fe(u)}}];return(0,a.jsxs)(L.ZP,{ghost:!0,header:{title:"",breadcrumb:{}},children:[(0,a.jsx)(U.ZP,{style:{marginTop:"20px"},headerTitle:"\u83DC\u5355\u5217\u8868",actionRef:g,rowKey:"id",pagination:{defaultPageSize:10},search:{labelWidth:120},toolBarRender:function(){return(0,a.jsxs)(b.Z,{type:"primary",onClick:function(){V(),x(!0)},children:[(0,a.jsx)(M.Z,{})," \u65B0\u5EFA"]},"primary1")},request:function(){var s=(0,j.Z)((0,i.Z)().mark(function r(u){var n;return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],e.next=3,Z.menutreepage(u).then(function(f){n=f.data});case 3:return e.abrupt("return",{data:n,success:!0});case 4:case"end":return e.stop()}},r)}));return function(r){return s.apply(this,arguments)}}(),columns:me,rowSelection:{onChange:function(r,u){ue(u)},checkStrictly:!1}}),(I==null?void 0:I.length)>0&&(0,a.jsx)(K.Z,{extra:(0,a.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,a.jsx)("a",{style:{fontWeight:600},children:I.length})," ","\u9879"]})}),(0,a.jsx)(J,{treeDatas:le,dictData:oe,onFinish:function(){var s=(0,j.Z)((0,i.Z)().mark(function r(u){var n;return(0,i.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=!1,!u.id){e.next=7;break}return e.next=4,he(u);case 4:n=e.sent,e.next=10;break;case 7:return e.next=9,ce(u);case 9:n=e.sent;case 10:n&&(x(!1),g.current.reload());case 11:case"end":return e.stop()}},r)}));return function(r){return s.apply(this,arguments)}}(),onCancel:function(){x(!1),A({})},modalVisible:S,values:ne||{}})]})},te=ae}}]);
|