"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[2845],{85968:function(y,v,e){var j=e(23674),s=e(62086),m=function(O){var o=(0,j.useModel)("@@initialState"),M=o.initialState,n=o.loading,u=o.error,i=o.refresh,f=o.setInitialState,P=M==null?void 0:M.authPermissionAction;if(!P)return(0,s.jsx)("span",{children:O.children});var A=P.indexOf(O.action);return A>=0?(0,s.jsx)("span",{children:O.children}):(0,s.jsx)(s.Fragment,{})};v.Z=m},64608:function(y,v,e){e.r(v);var j=e(28931),s=e(61786),m=e(40882),p=e(36428),O=e(13912),o=e(93236),M=e(81512),n=e(62086);v.default=function(u){var i=u.values,f=u.modalOpenState,P=u.onModalOpenState,A=u.onSubmit,x=u.permissionTreeData,E=(0,o.useRef)();return(0,o.useEffect)(function(){var D;(D=E.current)===null||D===void 0||D.setFieldsValue(i)},[i]),(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(j.Y,{title:"\u6743\u9650\u7BA1\u7406-\u6DFB\u52A0",formRef:E,submitter:{searchConfig:{resetText:"\u91CD\u7F6E"},resetButtonProps:{onClick:function(){var C;(C=E.current)===null||C===void 0||C.resetFields()}}},initialValues:i,onFinish:A,open:f,onOpenChange:P,children:[(0,n.jsx)(s.Z,{hidden:!0,width:"md",name:"id"}),(0,n.jsxs)(m.A.Group,{children:[(0,n.jsx)(m.A.Item,{label:"\u9009\u62E9\u4E0A\u7EA7",name:"pid",style:{width:"220px"},children:(0,n.jsx)(O.Z,{defaultValue:i==null?void 0:i.pid,allowClear:!0,fieldNames:{value:"id",label:"name",children:"children"},treeDefaultExpandAll:!0,placeholder:"\u8BF7\u9009\u62E9\u4E0A\u7EA7",treeData:x})}),(0,n.jsx)(p.Z.Group,{name:"type",label:"\u7C7B\u578B",radioType:"button",options:[{label:"\u83DC\u5355\u6743\u9650",value:1},{label:"\u64CD\u4F5C\u6743\u9650",value:2}]})]}),(0,n.jsxs)(m.A.Group,{children:[(0,n.jsx)(s.Z,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0!"}],width:"md",name:"name",label:"\u540D\u79F0",placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"}),(0,n.jsx)(s.Z,{width:"md",name:"path",label:"\u8DEF\u5F84",placeholder:"\u8BF7\u8F93\u5165\u8DEF\u5F84"})]}),(0,n.jsxs)(m.A.Group,{children:[(0,n.jsx)(s.Z,{tooltip:"\u7531\u5C0F\u5230\u5927",width:"md",name:"sort",label:"\u6392\u5E8F",placeholder:"\u8BF7\u8F93\u5165\u6392\u5E8F"}),(0,n.jsx)(m.A.Item,{width:"md",name:"icon",label:"\u56FE\u6807",children:(0,n.jsx)(M.Z,{})})]})]})})}},41372:function(y,v,e){e.r(v);var j=e(28931),s=e(61786),m=e(40882),p=e(36428),O=e(13912),o=e(93236),M=e(81512),n=e(62086);v.default=function(u){var i=u.values,f=u.modalOpenState,P=u.onModalOpenState,A=u.onSubmit,x=u.permissionTreeData,E=(0,o.useRef)();return(0,o.useEffect)(function(){var D;(D=E.current)===null||D===void 0||D.setFieldsValue(i)},[i]),(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(j.Y,{title:"\u6743\u9650\u7BA1\u7406-\u7F16\u8F91",formRef:E,submitter:{searchConfig:{resetText:"\u91CD\u7F6E"},resetButtonProps:{onClick:function(){var C;(C=E.current)===null||C===void 0||C.resetFields()}}},initialValues:i,onFinish:A,open:f,onOpenChange:P,children:[(0,n.jsx)(s.Z,{hidden:!0,width:"md",name:"id"}),(0,n.jsxs)(m.A.Group,{children:[(0,n.jsx)(m.A.Item,{label:"\u9009\u62E9\u4E0A\u7EA7",name:"pid",style:{width:"220px"},children:(0,n.jsx)(O.Z,{defaultValue:i==null?void 0:i.pid,allowClear:!0,fieldNames:{value:"id",label:"name",children:"children"},treeDefaultExpandAll:!0,placeholder:"\u8BF7\u9009\u62E9\u4E0A\u7EA7",treeData:x})}),(0,n.jsx)(p.Z.Group,{name:"type",label:"\u7C7B\u578B",radioType:"button",options:[{label:"\u83DC\u5355\u6743\u9650",value:1},{label:"\u64CD\u4F5C\u6743\u9650",value:2}]})]}),(0,n.jsxs)(m.A.Group,{children:[(0,n.jsx)(s.Z,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u540D\u79F0!"}],width:"md",name:"name",label:"\u540D\u79F0",placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"}),(0,n.jsx)(s.Z,{width:"md",name:"path",label:"\u8DEF\u5F84",placeholder:"\u8BF7\u8F93\u5165\u8DEF\u5F84"})]}),(0,n.jsxs)(m.A.Group,{children:[(0,n.jsx)(s.Z,{tooltip:"\u7531\u5C0F\u5230\u5927",width:"md",name:"sort",label:"\u6392\u5E8F",placeholder:"\u8BF7\u8F93\u5165\u6392\u5E8F"}),(0,n.jsx)(m.A.Item,{width:"md",name:"icon",label:"\u56FE\u6807",children:(0,n.jsx)(M.Z,{defaultValue:i.icon})})]})]})})}},63207:function(y,v,e){e.r(v);var j=e(57213),s=e.n(j),m=e(25359),p=e.n(m),O=e(49811),o=e.n(O),M=e(54306),n=e.n(M),u=e(93236),i=e(61385),f=e(14649),P=e(51676),A=e(50336),x=e(87708),E=e(85968),D=e(64608),C=e(41372),N=e(90627),a=e(62086),I=N.Z.PermissionController,L=I.permissionTree,Y=I.permissionCreate,H=I.permissionUpdate,J=I.permissionDelete;v.default=function(){var Q=(0,u.useState)(!1),W=n()(Q,2),X=W[0],S=W[1],k=(0,u.useState)(!1),g=n()(k,2),q=g[0],K=g[1],ee=(0,u.useState)([]),b=n()(ee,2),Z=b[0],$=b[1],B=(0,u.useRef)(),U={id:"",pid:0,name:"",path:"",type:1,sort:50,permission_ids:[]},ne=(0,u.useState)(U),G=n()(ne,2),w=G[0],T=G[1],te=(0,u.useState)([]),V=n()(te,2),le=V[0],ae=V[1];(0,u.useEffect)(function(){L().then(function(c){var t=c.data;$(t)})},[]);var z=function(){var c=o()(p()().mark(function t(r){var d,h,_;return p()().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,J(r);case 2:d=l.sent,h=d.success,h&&(B.current.clearSelected(),(_=B.current)===null||_===void 0||_.reload());case 5:case"end":return l.stop()}},t)}));return function(r){return c.apply(this,arguments)}}(),re=function(){var c=o()(p()().mark(function t(r){var d,h,_;return p()().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return T(r),l.next=3,Y(s()({},r));case 3:d=l.sent,h=d.success,h&&(T(U),(_=B.current)===null||_===void 0||_.reload(),S(!1));case 6:case"end":return l.stop()}},t)}));return function(r){return c.apply(this,arguments)}}(),se=function(){var c=o()(p()().mark(function t(r){var d,h,_;return p()().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,H(s()({},r));case 2:d=l.sent,h=d.success,h&&((_=B.current)===null||_===void 0||_.reload(),K(!1));case 5:case"end":return l.stop()}},t)}));return function(r){return c.apply(this,arguments)}}(),ue=[{title:"\u540D\u79F0",dataIndex:"name"},{title:"\u56FE\u6807",dataIndex:"icon"},{title:"\u6392\u5E8F",dataIndex:"sort"},{title:"\u7C7B\u578B",dataIndex:"type",render:function(t){return t===1?"\u83DC\u5355":"\u6743\u9650"}},{title:"\u8DEF\u5F84",dataIndex:"path"},{title:"\u66F4\u65B0\u65F6\u95F4",dataIndex:"updated_at",search:!1},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(t,r){return(0,a.jsxs)(i.Z,{children:[(0,a.jsx)(E.Z,{action:"admin/permission/update",children:(0,a.jsx)(f.ZP,{type:"link",onClick:function(){T(r),K(!0)},children:"\u7F16\u8F91"})},"admin/permission/update"),r.type==1?(0,a.jsx)(E.Z,{action:"admin/permission/create",children:(0,a.jsx)(f.ZP,{type:"link",onClick:function(){T(s()(s()({},U),{},{pid:r.id})),S(!0)},children:"\u6DFB\u52A0\u5B50\u83DC\u5355"})},"admin/permission/create"):"",(0,a.jsx)(E.Z,{action:"admin/permission/delete",children:(0,a.jsx)(P.Z,{title:"\u786E\u8BA4\u5220\u9664\uFF1F",onConfirm:function(){z({id:r.id})},children:(0,a.jsx)(f.ZP,{type:"link",danger:!0,children:"\u5220\u9664"})})},"admin/permission/delete")]})}}];return(0,a.jsx)(A._z,{ghost:!0,children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(C.default,{values:w,modalOpenState:q,onModalOpenState:K,onSubmit:se,permissionTreeData:Z}),(0,a.jsx)(D.default,{values:w,modalOpenState:X,onModalOpenState:S,onSubmit:re,permissionTreeData:Z}),(0,a.jsx)(x.Z,{actionRef:B,rowKey:"id",search:!1,toolBarRender:function(){return[(0,a.jsx)(E.Z,{action:"admin/permission/create",children:(0,a.jsx)(f.ZP,{type:"primary",onClick:function(){T(U),S(!0)},children:"\u6DFB\u52A0"})},"admin/permission/create")]},request:function(){var c=o()(p()().mark(function t(r,d,h){var _,R,l;return p()().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,L(s()(s()({},r),{},{sorter:d,filter:h}));case 2:return _=F.sent,R=_.data,l=_.success,$(R),F.abrupt("return",{data:R,success:l});case 7:case"end":return F.stop()}},t)}));return function(t,r,d){return c.apply(this,arguments)}}(),columns:ue,rowSelection:{onChange:function(t,r){ae(r)}},tableAlertRender:function(t){var r=t.selectedRowKeys,d=t.selectedRows,h=t.onCleanSelected;return(0,a.jsxs)(i.Z,{size:24,children:[(0,a.jsxs)("span",{children:["\u5DF2\u9009 ",r.length," \u9879"]}),(0,a.jsx)("span",{children:(0,a.jsx)("a",{style:{marginInlineStart:8},onClick:h,children:"\u53D6\u6D88\u9009\u62E9"})})]})},tableAlertOptionRender:function(t){var r=t.selectedRowKeys,d=t.selectedRows,h=t.onCleanSelected;return(0,a.jsx)(i.Z,{size:16,children:(0,a.jsx)(E.Z,{action:"admin/permission/delete",children:(0,a.jsx)(P.Z,{title:"\u786E\u8BA4\u5220\u9664\uFF1F",onConfirm:function(){z({id:r})},children:(0,a.jsx)(f.ZP,{type:"link",danger:!0,children:"\u6279\u91CF\u5220\u9664"})})},"admin/permission/delete")})},pagination:!1})]})})}}}]);