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.

p__Permission__List__index.787df597.async.js 16KB

1
  1. "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[359],{8214:function(ie,G,e){var M=e(1413),f=e(45987),c=e(62435),D=e(66758),S=e(49994),H=e(86074),m=["fieldProps","request","params","proFieldProps"],z=function(v,A){var B=v.fieldProps,P=v.request,t=v.params,W=v.proFieldProps,b=(0,f.Z)(v,m),Z=(0,c.useContext)(D.Z);return(0,H.jsx)(S.Z,(0,M.Z)({valueType:"cascader",fieldProps:(0,M.Z)({getPopupContainer:Z.getPopupContainer},B),ref:A,request:P,params:t,filedConfig:{customLightMode:!0},proFieldProps:W},b))};G.Z=c.forwardRef(z)},86615:function(ie,G,e){var M=e(1413),f=e(45987),c=e(22270),D=e(78045),S=e(62435),H=e(28614),m=e(49994),z=e(86074),y=["fieldProps","options","radioType","layout","proFieldProps","valueEnum"],v=S.forwardRef(function(t,W){var b=t.fieldProps,Z=t.options,I=t.radioType,p=t.layout,s=t.proFieldProps,T=t.valueEnum,F=(0,f.Z)(t,y);return(0,z.jsx)(m.Z,(0,M.Z)((0,M.Z)({valueType:I==="button"?"radioButton":"radio",ref:W,valueEnum:(0,c.h)(T,void 0)},F),{},{fieldProps:(0,M.Z)({options:Z,layout:p},b),proFieldProps:s,filedConfig:{customLightMode:!0}}))}),A=S.forwardRef(function(t,W){var b=t.fieldProps,Z=t.children;return(0,z.jsx)(D.ZP,(0,M.Z)((0,M.Z)({},b),{},{ref:W,children:Z}))}),B=(0,H.G)(A,{valuePropName:"checked",ignoreWidth:!0}),P=B;P.Group=v,P.Button=D.ZP.Button,P.displayName="ProFormComponent",G.Z=P},5966:function(ie,G,e){var M=e(97685),f=e(1413),c=e(45987),D=e(21770),S=e(23323),H=e(55241),m=e(97435),z=e(62435),y=e(49994),v=e(86074),A=["fieldProps","proFieldProps"],B=["fieldProps","proFieldProps"],P="text",t=function(p){var s=p.fieldProps,T=p.proFieldProps,F=(0,c.Z)(p,A);return(0,v.jsx)(y.Z,(0,f.Z)({valueType:P,fieldProps:s,filedConfig:{valueType:P},proFieldProps:T},F))},W=function(p){var s=(0,D.Z)(p.open||!1,{value:p.open,onChange:p.onOpenChange}),T=(0,M.Z)(s,2),F=T[0],X=T[1];return(0,v.jsx)(S.Z.Item,{shouldUpdate:!0,noStyle:!0,children:function($){var V,n=$.getFieldValue(p.name||[]);return(0,v.jsx)(H.Z,(0,f.Z)((0,f.Z)({getPopupContainer:function(r){return r&&r.parentNode?r.parentNode:r},onOpenChange:function(r){return X(r)},content:(0,v.jsxs)("div",{style:{padding:"4px 0"},children:[(V=p.statusRender)===null||V===void 0?void 0:V.call(p,n),p.strengthText?(0,v.jsx)("div",{style:{marginTop:10},children:(0,v.jsx)("span",{children:p.strengthText})}):null]}),overlayStyle:{width:240},placement:"rightTop"},p.popoverProps),{},{open:F,children:p.children}))}})},b=function(p){var s=p.fieldProps,T=p.proFieldProps,F=(0,c.Z)(p,B),X=(0,z.useState)(!1),q=(0,M.Z)(X,2),$=q[0],V=q[1];return s!=null&&s.statusRender&&F.name?(0,v.jsx)(W,{name:F.name,statusRender:s==null?void 0:s.statusRender,popoverProps:s==null?void 0:s.popoverProps,strengthText:s==null?void 0:s.strengthText,open:$,onOpenChange:V,children:(0,v.jsx)("div",{children:(0,v.jsx)(y.Z,(0,f.Z)({valueType:"password",fieldProps:(0,f.Z)((0,f.Z)({},(0,m.Z)(s,["statusRender","popoverProps","strengthText"])),{},{onBlur:function(a){var r;s==null||(r=s.onBlur)===null||r===void 0||r.call(s,a),V(!1)},onClick:function(a){var r;s==null||(r=s.onClick)===null||r===void 0||r.call(s,a),V(!0)}}),proFieldProps:T,filedConfig:{valueType:P}},F))})}):(0,v.jsx)(y.Z,(0,f.Z)({valueType:"password",fieldProps:s,proFieldProps:T,filedConfig:{valueType:P}},F))},Z=t;Z.Password=b,Z.displayName="ProFormComponent",G.Z=Z},70336:function(ie,G,e){e.r(G),e.d(G,{default:function(){return U}});var M=e(5574),f=e.n(M),c=e(62435),D=e(59530),S=e(28459),H=e(15009),m=e.n(H),z=e(99289),y=e.n(z),v=e(95338),A=e(40411),B=e(14726),P=e(39680),t=e(86074),W=function(u){var o=u.dispatch,E=u.openModel,K=u.getId,g=(0,c.useRef)(),J=(0,c.useState)([]),w=f()(J,2),R=w[0],ae=w[1],te=(0,c.useState)(0),le=f()(te,2),ne=le[0],Y=le[1],Q=(0,c.useState)(1),x=f()(Q,2),h=x[0],i=x[1],d=(0,c.useState)(10),oe=f()(d,2),k=oe[0],L=oe[1],fe=function(N){K(N)};return(0,c.useEffect)(function(){E.openParentModal||g.current.reload()},[E.openParentModal]),(0,c.useEffect)(function(){E.openModal||g.current.reload()},[E.openModal]),(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(S.ZP,{theme:{token:{colorPrimary:"#4FBE70",colorLink:"#4FBE70"}},children:(0,t.jsx)(v.Z,{scroll:{y:480,x:"auto"},bordered:!0,actionRef:g,dataSource:R,search:!1,columns:[{title:"ID",dataIndex:"id",width:200,search:!1},{title:"\u6743\u9650/\u83DC\u5355",dataIndex:"name",width:200,search:!1},{title:"\u7C7B\u578B",dataIndex:"p_type",search:!1,width:200,valueEnum:{1:{text:"\u6743\u9650",status:"Error"},2:{text:"\u83DC\u5355",status:"Processing"}}},{title:"\u8DEF\u5F84",dataIndex:"path",search:!1,width:200},{title:"\u6807\u8BC6\u540D\u79F0",dataIndex:"action",search:!1,width:200},{title:"\u6307\u5411\u9875\u9762",dataIndex:"module",search:!1,width:200},{title:"\u4E0A\u7EA7\u83DC\u5355id",dataIndex:"parent_id",search:!1,width:200,render:function(N,j){return(0,t.jsx)(t.Fragment,{children:j.parent_id==-1?(0,t.jsx)(A.Z,{status:"processing",text:"\u9876\u7EA7\u83DC\u5355"}):(0,t.jsx)(A.Z,{status:"error",text:j.parent_id})})}},{title:"\u63CF\u8FF0",dataIndex:"description",search:!1,width:200},{title:"\u64CD\u4F5C",key:"option",valueType:"option",render:function(N,j,he){return[(0,t.jsx)(B.ZP,{type:"link",onClick:function(){fe(j),o({type:"openModel/getOpenModal",payload:!0})},children:"\u7F16\u8F91"},"1"),(0,t.jsx)(B.ZP,{type:"link",onClick:function(){j.nextlevel=j.id,fe(j),o({type:"openModel/getOpenModal",payload:!0})},children:"\u6DFB\u52A0\u4E0B\u7EA7\u680F\u76EE"},"2"),(0,t.jsx)(B.ZP,{type:"link",onClick:function(){fe(j),o({type:"openModel/getOpenParentModal",payload:!0})},children:"\u66F4\u6362\u7236\u7EA7"},"3"),(0,t.jsx)(B.ZP,{type:"link",onClick:function(){},children:"\u5220\u9664"},"4")]}}],rowKey:"id",pagination:{current:h,pageSize:k,showSizeChanger:!0,total:ne,pageSizeOptions:[9,18,27,99],onChange:function(N,j){i(N),L(j)},onShowSizeChange:function(N,j){i(N),L(j)}},request:y()(m()().mark(function re(){var N,j=arguments;return m()().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return N=j.length>0&&j[0]!==void 0?j[0]:{},_.abrupt("return",(0,P.hWI)({page:h,pagesize:k,sort:"id",sortby:"desc",keyword:N.name}).then(function(me){ae(me.data.permissions),Y(me.data.total)}));case 2:case"end":return _.stop()}},re)})),headerTitle:"\u6743\u9650\u5217\u8868",toolBarRender:function(){return[(0,t.jsx)(B.ZP,{type:"primary",onClick:function(){o({type:"openModel/getOpenModal",payload:!0})},children:"\u6DFB\u52A0\u6743\u9650"})]},expandable:{childrenColumnName:"childs"}})})})},b=(0,D.connect)(function(C){var u=C.openModel;return{openModel:u}})(W),Z=e(97269),I=e(5966),p=e(86615),s=e(17788),T=e(86250),F=e(42075),X=e(68872),q=e(71230),$=e(15746),V={label:"name",value:"id"},n=function(u){var o=u.dispatch,E=u.dictModel,K=u.openModel,g=u.id,J=(0,c.useRef)(),w=(0,c.useState)(!1),R=f()(w,2),ae=R[0],te=R[1],le=(0,c.useState)(null),ne=f()(le,2),Y=ne[0],Q=ne[1];return(0,c.useEffect)(function(){te(K.openModal)},[K.openModal]),(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(S.ZP,{theme:{token:{colorPrimary:"#4FBE70"},components:{Segmented:{itemSelectedBg:"#19be6e",itemSelectedColor:"#ffffff"}}},children:(0,t.jsx)(s.Z,{open:ae,title:g?"\u7F16\u8F91\u6743\u9650/\u83DC\u5355":"\u6DFB\u52A0\u6743\u9650/\u83DC\u5355",centered:!0,maskClosable:!1,footer:null,destroyOnClose:!0,width:600,onCancel:function(){o({type:"openModel/getOpenModal",payload:!1})},children:(0,t.jsx)(Z.A,{formRef:J,request:y()(m()().mark(function x(){var h;return m()().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(!g){d.next=13;break}if(!g.nextlevel){d.next=6;break}return Q(null),d.abrupt("return",{name:"",path:"",action:"",module:"",p_type:2,parent_id:g.nextlevel,description:""});case 6:return d.next=8,(0,P.MJ0)({id:g.id});case 8:return h=d.sent,Q(h.data),d.abrupt("return",h.data);case 11:d.next=15;break;case 13:return Q(null),d.abrupt("return",{name:"",path:"",action:"",module:"",p_type:2,parent_id:0,description:""});case 15:case"end":return d.stop()}},x)})),submitter:{searchConfig:{resetText:"\u53D6\u6D88",submitText:"\u4FDD\u5B58"},render:function(h,i){return(0,t.jsxs)(T.Z,{justify:"flex-end",children:[" ",(0,t.jsx)(F.Z,{children:i})]})},onReset:function(){Q(null),o({type:"openModel/getOpenModal",payload:!1})}},onFinish:function(){var x=y()(m()().mark(function h(i){var d,oe;return m()().wrap(function(L){for(;;)switch(L.prev=L.next){case 0:if(g.nextlevel?i.parent_id=g.nextlevel:Y&&Y.id?i.parent_id=Y.parent_id:i.parent_id=-1,console.log(i),!Y){L.next=11;break}return i.id=g.id,L.next=6,(0,P.kY9)(i);case 6:d=L.sent,X.ZP.success("\u63D0\u4EA4\u6210\u529F"),o({type:"openModel/getOpenModal",payload:!1}),L.next=16;break;case 11:return L.next=13,(0,P.zJD)(i);case 13:oe=L.sent,X.ZP.success("\u63D0\u4EA4\u6210\u529F"),o({type:"openModel/getOpenModal",payload:!1});case 16:case"end":return L.stop()}},h)}));return function(h){return x.apply(this,arguments)}}(),children:(0,t.jsxs)(q.Z,{gutter:16,children:[(0,t.jsx)($.Z,{span:24,children:(0,t.jsx)(I.Z,{label:"\u6743\u9650/\u83DC\u5355\u540D\u79F0",name:"name",placeholder:"\u8BF7\u8F93\u5165\u6743\u9650/\u83DC\u5355\u540D\u79F0",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6743\u9650/\u83DC\u5355\u540D\u79F0"}]})}),(0,t.jsx)($.Z,{span:24,children:(0,t.jsx)(I.Z,{label:"\u8DEF\u5F84",name:"path",placeholder:"\u8BF7\u8F93\u5165\u8DEF\u5F84",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8DEF\u5F84"}]})}),(0,t.jsx)($.Z,{span:24,children:(0,t.jsx)(I.Z,{label:"\u6807\u8BC6\u540D\u79F0",name:"action",placeholder:"\u8BF7\u8F93\u5165\u6807\u8BC6\u540D\u79F0",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6807\u8BC6\u540D\u79F0"}]})}),(0,t.jsx)($.Z,{span:24,children:(0,t.jsx)(I.Z,{label:"\u6307\u5411\u9875\u9762",name:"module",placeholder:"\u8BF7\u8F93\u5165\u6307\u5411\u9875\u9762",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6307\u5411\u9875\u9762"}]})}),(0,t.jsx)($.Z,{span:24,children:(0,t.jsx)(p.Z.Group,{name:"p_type",label:"\u6743\u9650\u7C7B\u578B",request:y()(m()().mark(function x(){return m()().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",[{label:"\u6743\u9650",value:1},{label:"\u83DC\u5355",value:2}]);case 1:case"end":return i.stop()}},x)})),rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u6743\u9650\u7C7B\u578B"}]})}),(0,t.jsx)($.Z,{span:24,children:(0,t.jsx)(I.Z,{name:"description",label:"\u63CF\u8FF0",placeholder:"\u8BF7\u8F93\u5165\u63CF\u8FF0"})})]})})})})})},a=(0,D.connect)(function(C){var u=C.dictModel,o=C.openModel;return{dictModel:u,openModel:o}})(n),r=e(97857),l=e.n(r),O=e(8214),ve={label:"name",value:"id"},de={label:"name",value:"id",children:"childs"},ee=function(u){return u.map(function(o){return l()(l()({},o),{},{childs:o.childs?ue(o.childs,1):void 0})})},ue=function C(u,o){return u.filter(function(E){return E.p_type!==o}).map(function(E){return l()(l()({},E),{},{childs:E.childs?C(E.childs,o):void 0})})},se=function(u){var o=u.dispatch,E=u.dictModel,K=u.openModel,g=u.id,J=(0,c.useRef)(),w=(0,c.useState)(!1),R=f()(w,2),ae=R[0],te=R[1],le=(0,c.useState)(null),ne=f()(le,2),Y=ne[0],Q=ne[1];return(0,c.useEffect)(function(){te(K.openParentModal)},[K.openParentModal]),(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(S.ZP,{theme:{token:{colorPrimary:"#4FBE70"},components:{Segmented:{itemSelectedBg:"#19be6e",itemSelectedColor:"#ffffff"}}},children:(0,t.jsx)(s.Z,{open:ae,title:"\u66F4\u6362\u7236\u7EA7",centered:!0,maskClosable:!1,footer:null,destroyOnClose:!0,width:600,onCancel:function(){o({type:"openModel/getOpenParentModal",payload:!1})},children:(0,t.jsx)(Z.A,{formRef:J,request:y()(m()().mark(function x(){var h;return m()().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,(0,P.MJ0)({id:g.id});case 2:return h=d.sent,Q(h.data),d.abrupt("return",h.data);case 5:case"end":return d.stop()}},x)})),submitter:{searchConfig:{resetText:"\u53D6\u6D88",submitText:"\u4FDD\u5B58"},render:function(h,i){return(0,t.jsxs)(T.Z,{justify:"flex-end",children:[" ",(0,t.jsx)(F.Z,{children:i})]})},onReset:function(){Q(null),o({type:"openModel/getOpenParentModal",payload:!1})}},onFinish:function(){var x=y()(m()().mark(function h(i){var d;return m()().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return console.log(i),i.id=g.id,i.parent_id=i.parent_arr&&i.parent_arr.length>0?i.parent_arr[i.parent_arr.length-1]:Y==null?void 0:Y.parent_id,delete i.parent_arr,k.next=6,(0,P.kY9)(i);case 6:d=k.sent,X.ZP.success("\u63D0\u4EA4\u6210\u529F"),o({type:"openModel/getOpenParentModal",payload:!1});case 9:case"end":return k.stop()}},h)}));return function(h){return x.apply(this,arguments)}}(),children:(0,t.jsx)(O.Z,{label:"\u7236\u7EA7\u83DC\u5355",name:"parent_arr",fieldProps:{fieldNames:de,changeOnSelect:!0},request:y()(m()().mark(function x(){var h;return m()().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,(0,P.hWI)({page:1,pagesize:9999});case 2:return h=d.sent,d.abrupt("return",ee(h.data.permissions));case 4:case"end":return d.stop()}},x)})),placeholder:"\u8BF7\u9009\u62E9\u8981\u5F52\u5C5E\u7684\u7236\u7EA7\u83DC\u5355"})})})})})},ce=(0,D.connect)(function(C){var u=C.dictModel,o=C.openModel;return{dictModel:u,openModel:o}})(se),pe=function(u){var o=u.dispatch,E=u.openModel,K=(0,c.useState)(0),g=f()(K,2),J=g[0],w=g[1],R=function(te){w(te)};return(0,c.useEffect)(function(){E.openModal||w(0)},[E.openModal]),(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(S.ZP,{theme:{token:{colorPrimary:"#4FBE70"}},children:[(0,t.jsx)(b,{getId:R}),(0,t.jsx)(a,{id:J}),(0,t.jsx)(ce,{id:J})]})})},U=(0,D.connect)(function(C){var u=C.openModel;return{openModel:u}})(pe)},86250:function(ie,G,e){e.d(G,{Z:function(){return V}});var M=e(62435),f=e(93967),c=e.n(f),D=e(98423),S=e(98065),H=e(53124),m=e(92030),z=e(45503);const y=["wrap","nowrap","wrap-reverse"],v=["flex-start","flex-end","start","end","center","space-between","space-around","space-evenly","stretch","normal","left","right"],A=["center","start","end","flex-start","flex-end","self-start","self-end","baseline","normal","stretch"],B=(n,a)=>{const r=a.wrap===!0?"wrap":a.wrap;return{[`${n}-wrap-${r}`]:r&&y.includes(r)}},P=(n,a)=>{const r={};return A.forEach(l=>{r[`${n}-align-${l}`]=a.align===l}),r[`${n}-align-stretch`]=!a.align&&!!a.vertical,r},t=(n,a)=>{const r={};return v.forEach(l=>{r[`${n}-justify-${l}`]=a.justify===l}),r};function W(n,a){return c()(Object.assign(Object.assign(Object.assign({},B(n,a)),P(n,a)),t(n,a)))}var b=W;const Z=n=>{const{componentCls:a}=n;return{[a]:{display:"flex","&-vertical":{flexDirection:"column"},"&-rtl":{direction:"rtl"},"&:empty":{display:"none"}}}},I=n=>{const{componentCls:a}=n;return{[a]:{"&-gap-small":{gap:n.flexGapSM},"&-gap-middle":{gap:n.flexGap},"&-gap-large":{gap:n.flexGapLG}}}},p=n=>{const{componentCls:a}=n,r={};return y.forEach(l=>{r[`${a}-wrap-${l}`]={flexWrap:l}}),r},s=n=>{const{componentCls:a}=n,r={};return A.forEach(l=>{r[`${a}-align-${l}`]={alignItems:l}}),r},T=n=>{const{componentCls:a}=n,r={};return v.forEach(l=>{r[`${a}-justify-${l}`]={justifyContent:l}}),r},F=()=>({});var X=(0,m.I$)("Flex",n=>{const{paddingXS:a,padding:r,paddingLG:l}=n,O=(0,z.TS)(n,{flexGapSM:a,flexGap:r,flexGapLG:l});return[Z(O),I(O),p(O),s(O),T(O)]},F,{resetStyle:!1}),q=function(n,a){var r={};for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&a.indexOf(l)<0&&(r[l]=n[l]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var O=0,l=Object.getOwnPropertySymbols(n);O<l.length;O++)a.indexOf(l[O])<0&&Object.prototype.propertyIsEnumerable.call(n,l[O])&&(r[l[O]]=n[l[O]]);return r},V=M.forwardRef((n,a)=>{const{prefixCls:r,rootClassName:l,className:O,style:ve,flex:de,gap:ee,children:ue,vertical:se=!1,component:ce="div"}=n,pe=q(n,["prefixCls","rootClassName","className","style","flex","gap","children","vertical","component"]),{flex:U,direction:C,getPrefixCls:u}=M.useContext(H.E_),o=u("flex",r),[E,K,g]=X(o),J=se!=null?se:U==null?void 0:U.vertical,w=c()(O,l,U==null?void 0:U.className,o,K,g,b(o,n),{[`${o}-rtl`]:C==="rtl",[`${o}-gap-${ee}`]:(0,S.n)(ee),[`${o}-vertical`]:J}),R=Object.assign(Object.assign({},U==null?void 0:U.style),ve);return de&&(R.flex=de),ee&&!(0,S.n)(ee)&&(R.gap=ee),E(M.createElement(ce,Object.assign({ref:a,className:w,style:R},(0,D.Z)(pe,["justify","wrap","align"])),ue))})}}]);