|
1 |
- "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[359],{70336:function(pe,N,r){r.r(N),r.d(N,{default:function(){return de}});var H=r(5574),v=r.n(H),d=r(62435),R=r(59530),k=r(28459),Q=r(15009),f=r.n(Q),U=r(99289),Z=r.n(U),V=r(67211),L=r(66309),w=r(14726),B=r(39680),e=r(86074),X=function(a){var l=a.dispatch,p=a.openModel,M=a.getId,o=(0,d.useRef)(),j=(0,d.useState)([]),y=v()(j,2),P=y[0],b=y[1],E=(0,d.useState)(0),I=v()(E,2),O=I[0],g=I[1],F=(0,d.useState)(1),u=v()(F,2),s=u[0],n=u[1],t=(0,d.useState)(10),T=v()(t,2),x=T[0],m=T[1],$=function(h){M(h)};return(0,d.useEffect)(function(){p.openParentModal||o.current.reload()},[p.openParentModal]),(0,d.useEffect)(function(){p.openModal||o.current.reload()},[p.openModal]),(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(k.ZP,{theme:{token:{colorPrimary:"#4FBE70",colorLink:"#4FBE70"}},children:(0,e.jsx)(V.Z,{size:"small",search:!1,bordered:!0,scroll:{x:1300},actionRef:o,dataSource:P,columns:[{title:"ID",dataIndex:"id",width:100,search:!1},{title:"\u6743\u9650/\u83DC\u5355",dataIndex:"name",width:300,search:!1,render:function(h,i){return(0,e.jsx)(e.Fragment,{children:i.p_type==1?(0,e.jsxs)(e.Fragment,{children:[i.name," ",(0,e.jsx)(L.Z,{children:"\u6743\u9650"})]}):(0,e.jsxs)(e.Fragment,{children:[i.name," ",(0,e.jsx)(L.Z,{color:"green",children:"\u83DC\u5355"})]})})}},{title:"\u6743\u9650/\u83DC\u5355",dataIndex:"p_type",search:!1,width:100,render:function(h,i){return(0,e.jsx)(e.Fragment,{children:i.p_type==1?(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(L.Z,{children:"\u6743\u9650"})}):(0,e.jsxs)(e.Fragment,{children:[" ",(0,e.jsx)(L.Z,{color:"green",children:"\u83DC\u5355"})]})})}},{title:"\u8DEF\u5F84",dataIndex:"path",search:!1,width:180},{title:"\u6807\u8BC6\u540D\u79F0",dataIndex:"action",search:!1,width:180},{title:"\u6307\u5411\u9875\u9762",dataIndex:"module",search:!1,width:180},{title:"\u4E0A\u7EA7\u83DC\u5355id",dataIndex:"parent_id",search:!1,width:180,render:function(h,i){return(0,e.jsx)(e.Fragment,{children:i.parent_id==-1?"\u5F53\u524D\u5DF2\u662F\u9876\u7EA7\u83DC\u5355":i.parent_id})}},{title:"\u63CF\u8FF0",dataIndex:"description",search:!1,width:180},{title:"\u64CD\u4F5C",width:400,key:"option",valueType:"option",fixed:"right",render:function(h,i,ce){return[(0,e.jsx)(w.ZP,{type:"link",onClick:function(){$(i),l({type:"openModel/getOpenModal",payload:!0})},children:"\u7F16\u8F91"},"1"),(0,e.jsx)(w.ZP,{type:"link",onClick:function(){i.nextlevel=i.id,$(i),l({type:"openModel/getOpenModal",payload:!0})},children:"\u6DFB\u52A0\u4E0B\u7EA7\u680F\u76EE"},"2"),(0,e.jsx)(w.ZP,{type:"link",onClick:function(){$(i),l({type:"openModel/getOpenParentModal",payload:!0})},children:"\u66F4\u6362\u7236\u7EA7"},"3"),(0,e.jsx)(w.ZP,{type:"link",onClick:function(){},children:"\u5220\u9664"},"4")]}}],rowKey:"id",pagination:{current:s,pageSize:x,showSizeChanger:!0,total:O,pageSizeOptions:[9,18,27,99],onChange:function(h,i){n(h),m(i)},onShowSizeChange:function(h,i){n(h),m(i)}},request:Z()(f()().mark(function C(){var h,i=arguments;return f()().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return h=i.length>0&&i[0]!==void 0?i[0]:{},S.abrupt("return",(0,B.hWI)({page:s,pagesize:x,sort:"id",sortby:"desc",keyword:h.name}).then(function(K){b(K.data.permissions),g(K.data.total)}));case 2:case"end":return S.stop()}},C)})),headerTitle:"\u6743\u9650\u5217\u8868",toolBarRender:function(){return[(0,e.jsx)(w.ZP,{type:"primary",onClick:function(){l({type:"openModel/getOpenModal",payload:!0})},children:"\u6DFB\u52A0\u6743\u9650"})]},expandable:{childrenColumnName:"childs"}})})})},q=(0,R.connect)(function(c){var a=c.openModel;return{openModel:a}})(X),J=r(97269),D=r(5966),_=r(21134),G=r(17788),W=r(86250),Y=r(42075),A=r(68872),fe={label:"name",value:"id"},ee=function(a){var l=a.dispatch,p=a.dictModel,M=a.openModel,o=a.id,j=(0,d.useRef)(),y=(0,d.useState)(!1),P=v()(y,2),b=P[0],E=P[1],I=(0,d.useState)(null),O=v()(I,2),g=O[0],F=O[1];return(0,d.useEffect)(function(){E(M.openModal)},[M.openModal]),(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(k.ZP,{theme:{token:{colorPrimary:"#4FBE70"},components:{Segmented:{itemSelectedBg:"#19be6e",itemSelectedColor:"#ffffff"}}},children:(0,e.jsx)(G.Z,{open:b,title:o?"\u7F16\u8F91\u6743\u9650/\u83DC\u5355":"\u6DFB\u52A0\u6743\u9650/\u83DC\u5355",centered:!0,maskClosable:!1,footer:null,destroyOnClose:!0,width:1e3,onCancel:function(){l({type:"openModel/getOpenModal",payload:!1})},children:(0,e.jsxs)(J.A,{formRef:j,request:Z()(f()().mark(function u(){var s;return f()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!o){t.next=13;break}if(!o.nextlevel){t.next=6;break}return F(null),t.abrupt("return",{name:"",path:"",action:"",module:"",p_type:"",parent_id:o.nextlevel,description:""});case 6:return t.next=8,(0,B.MJ0)({id:o.id});case 8:return s=t.sent,F(s.data),t.abrupt("return",s.data);case 11:t.next=15;break;case 13:return F(null),t.abrupt("return",{name:"",path:"",action:"",module:"",p_type:"",parent_id:0,description:""});case 15:case"end":return t.stop()}},u)})),submitter:{searchConfig:{resetText:"\u53D6\u6D88",submitText:"\u4FDD\u5B58"},render:function(s,n){return(0,e.jsxs)(W.Z,{justify:"flex-end",children:[" ",(0,e.jsx)(Y.Z,{children:n})]})},onReset:function(){F(null),l({type:"openModel/getOpenModal",payload:!1})}},onFinish:function(){var u=Z()(f()().mark(function s(n){var t,T;return f()().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(o.nextlevel?n.parent_id=o.nextlevel:g&&g.id?n.parent_id=g.parent_id:n.parent_id=-1,console.log(n),!g){m.next=11;break}return n.id=o.id,m.next=6,(0,B.kY9)(n);case 6:t=m.sent,A.ZP.success("\u63D0\u4EA4\u6210\u529F"),l({type:"openModel/getOpenModal",payload:!1}),m.next=16;break;case 11:return m.next=13,(0,B.zJD)(n);case 13:T=m.sent,A.ZP.success("\u63D0\u4EA4\u6210\u529F"),l({type:"openModel/getOpenModal",payload:!1});case 16:case"end":return m.stop()}},s)}));return function(s){return u.apply(this,arguments)}}(),children:[(0,e.jsx)(D.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,e.jsx)(D.Z,{label:"\u8DEF\u5F84",name:"path",placeholder:"\u8BF7\u8F93\u5165\u8DEF\u5F84",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8DEF\u5F84"}]}),(0,e.jsx)(D.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,e.jsx)(D.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,e.jsx)(_.Z,{name:"p_type",label:"\u6743\u9650\u7C7B\u578B",request:Z()(f()().mark(function u(){return f()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",[{label:"\u6743\u9650",value:1},{label:"\u83DC\u5355",value:2}]);case 1:case"end":return n.stop()}},u)})),rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u662F\u5426\u7F6E\u9876"}]}),(0,e.jsx)(D.Z,{name:"description",label:"\u63CF\u8FF0",placeholder:"\u8BF7\u8F93\u5165\u63CF\u8FF0"})]})})})})},ne=(0,R.connect)(function(c){var a=c.dictModel,l=c.openModel;return{dictModel:a,openModel:l}})(ee),te=r(97857),z=r.n(te),ae=r(8214),he={label:"name",value:"id"},re={label:"name",value:"id",children:"childs"},le=function(a){return a.map(function(l){return z()(z()({},l),{},{childs:l.childs?se(l.childs,1):void 0})})},se=function c(a,l){return a.filter(function(p){return p.p_type!==l}).map(function(p){return z()(z()({},p),{},{childs:p.childs?c(p.childs,l):void 0})})},ie=function(a){var l=a.dispatch,p=a.dictModel,M=a.openModel,o=a.id,j=(0,d.useRef)(),y=(0,d.useState)(!1),P=v()(y,2),b=P[0],E=P[1],I=(0,d.useState)(null),O=v()(I,2),g=O[0],F=O[1];return(0,d.useEffect)(function(){E(M.openParentModal)},[M.openParentModal]),(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(k.ZP,{theme:{token:{colorPrimary:"#4FBE70"},components:{Segmented:{itemSelectedBg:"#19be6e",itemSelectedColor:"#ffffff"}}},children:(0,e.jsx)(G.Z,{open:b,title:"\u66F4\u6362\u7236\u7EA7",centered:!0,maskClosable:!1,footer:null,destroyOnClose:!0,width:1e3,onCancel:function(){l({type:"openModel/getOpenParentModal",payload:!1})},children:(0,e.jsx)(J.A,{formRef:j,request:Z()(f()().mark(function u(){var s;return f()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,B.MJ0)({id:o.id});case 2:return s=t.sent,F(s.data),t.abrupt("return",s.data);case 5:case"end":return t.stop()}},u)})),submitter:{searchConfig:{resetText:"\u53D6\u6D88",submitText:"\u4FDD\u5B58"},render:function(s,n){return(0,e.jsxs)(W.Z,{justify:"flex-end",children:[" ",(0,e.jsx)(Y.Z,{children:n})]})},onReset:function(){F(null),l({type:"openModel/getOpenParentModal",payload:!1})}},onFinish:function(){var u=Z()(f()().mark(function s(n){var t;return f()().wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return console.log(n),n.id=o.id,n.parent_id=n.parent_arr&&n.parent_arr.length>0?n.parent_arr[n.parent_arr.length-1]:g==null?void 0:g.parent_id,delete n.parent_arr,x.next=6,(0,B.kY9)(n);case 6:t=x.sent,A.ZP.success("\u63D0\u4EA4\u6210\u529F"),l({type:"openModel/getOpenParentModal",payload:!1});case 9:case"end":return x.stop()}},s)}));return function(s){return u.apply(this,arguments)}}(),children:(0,e.jsx)(ae.Z,{label:"\u7236\u7EA7\u83DC\u5355",name:"parent_arr",fieldProps:{fieldNames:re,changeOnSelect:!0},request:Z()(f()().mark(function u(){var s;return f()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,B.hWI)({page:1,pagesize:9999});case 2:return s=t.sent,t.abrupt("return",le(s.data.permissions));case 4:case"end":return t.stop()}},u)})),placeholder:"\u8BF7\u9009\u62E9\u8981\u5F52\u5C5E\u7684\u7236\u7EA7\u83DC\u5355"})})})})})},ue=(0,R.connect)(function(c){var a=c.dictModel,l=c.openModel;return{dictModel:a,openModel:l}})(ie),oe=function(a){var l=a.dispatch,p=a.openModel,M=(0,d.useState)(0),o=v()(M,2),j=o[0],y=o[1],P=function(E){y(E)};return(0,d.useEffect)(function(){p.openModal||y(0)},[p.openModal]),(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(k.ZP,{theme:{token:{colorPrimary:"#4FBE70"}},children:[(0,e.jsx)(q,{getId:P}),(0,e.jsx)(ne,{id:j}),(0,e.jsx)(ue,{id:j})]})})},de=(0,R.connect)(function(c){var a=c.openModel;return{openModel:a}})(oe)}}]);
|