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.

2 lines
14 KiB

"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[816],{85099:function(Y,U,n){n.r(U),n.d(U,{default:function(){return Ie}});var L=n(15009),l=n.n(L),R=n(99289),g=n.n(R),K=n(5574),c=n.n(K),i=n(48357),E=n(35312),a=n(8232),v=n(66309),o=n(71230),h=n(15746),Z=n(14726),S=n(13169),C=n(72051),M=n(17788),w=n(55102),d=n(34041),J=n(37804),q=n(16250),y=n(67294),he=n(72269),e=n(85893),je=function(p){var $=function(){p.onSubmit()},O=[{title:"\u59D3\u540D",dataIndex:"name",ellipsis:!0},{title:"\u89D2\u8272",dataIndex:"role",render:function(B){var I="";switch(B){case 1:I="\u8D85\u7EA7\u7BA1\u7406\u5458";break;case 2:I="\u7BA1\u7406\u5458";break;case 3:I="\u6E38\u620F\u4E3B";break;case 4:I="\u8BBE\u5907\u4E3B";break;default:I=""}return I}},{title:"\u9690\u85CF",render:function(B){return(0,e.jsx)(he.Z,{defaultValue:B.hide!==0,onClick:function(k){B.id&&(0,i.tQ)({adminId:B.id,hide:k?1:0})}},B.id)}}];return(0,e.jsx)(M.Z,{title:"\u6279\u91CF\u7F16\u8F91",visible:!0,footer:[],onCancel:$,children:(0,e.jsx)(C.Z,{columns:O,dataSource:p.data})})},pe=je,xe=n(19632),ee=n.n(xe),ge=n(81072),be=n(3089),Ee=n(55241),ue=n(86250),G=n(2453),ie=n(38171),Ze=function(p){var $=(0,y.useState)([]),O=c()($,2),_=O[0],B=O[1],I=(0,y.useState)([]),k=c()(I,2),D=k[0],N=k[1],H=a.Z.useForm(),z=c()(H,1),W=z[0],ne=function(){var j=g()(l()().mark(function F(A){var m;return l()().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return P.next=2,(0,i.yC)({adminId:A});case 2:m=P.sent,B(m.data||[]);case 4:case"end":return P.stop()}},F)}));return function(A){return j.apply(this,arguments)}}();return(0,y.useEffect)(function(){p.data.id&&ne(p.data.id)},[p.data.id]),(0,e.jsxs)(M.Z,{title:"\u7ED1\u5B9A\u8D26\u53F7",visible:!0,centered:!0,onCancel:function(){p.onCancel()},footer:[(0,e.jsx)(Z.ZP,{onClick:function(){p.onCancel()},children:"\u53D6\u6D88"},"back"),(0,e.jsx)(Ee.Z,{title:"\u786E\u5B9A\u4FDD\u5B58\u5417",content:(0,e.jsxs)("div",{style:{textAlign:"center"},children:[(0,e.jsx)("p",{children:"\u8D26\u53F7\u4E00\u65E6\u7ED1\u5B9A\u540E\uFF0C\u65E0\u6CD5\u88AB\u5220\u9664"}),(0,e.jsx)("a",{onClick:g()(l()().mark(function j(){var F;return l()().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(F=[].concat(ee()(_),ee()(D)).map(function(T){return T.id}).filter(Boolean),!(p.data.id&&F)){m.next=7;break}return m.next=4,(0,i.cH)({adminId:p.data.id},F);case 4:p.onSubmit(),m.next=8;break;case 7:p.onCancel();case 8:case"end":return m.stop()}},j)})),children:"\u786E\u5B9A"})]}),children:(0,e.jsx)(Z.ZP,{type:"primary",children:"\u4FDD\u5B58"})},"confirm")],children:[_.length>0&&(0,e.jsxs)(o.Z,{gutter:6,style:{marginTop:20},children:[(0,e.jsx)(h.Z,{span:4,children:"\u5DF2\u7ED1\u5B9A:"}),(0,e.jsx)(ue.Z,{vertical:!0,gap:"small",children:_.map(function(j){return(0,e.jsx)(o.Z,{children:(0,e.jsx)(ie.Z,{data:j})},j.id)})})]}),D.length>0&&(0,e.jsxs)(o.Z,{gutter:6,style:{marginTop:20},children:[(0,e.jsx)(h.Z,{span:4,children:"\u672C\u6B21\u65B0\u589E:"}),(0,e.jsx)(ue.Z,{vertical:!0,gap:"small",children:D.map(function(j){return(0,e.jsxs)(o.Z,{children:[(0,e.jsx)(ie.Z,{data:j}),(0,e.jsx)(be.Z,{style:{marginLeft:20},onClick:function(){N(D.filter(function(A){return A.id!==j.id}))}})]},j.id)})})]}),(0,e.jsx)(a.Z,{style:{marginTop:20},labelCol:{span:4},wrapperCol:{span:18},form:W,onFinish:function(){var j=g()(l()().mark(function F(A){var m,T;return l()().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(m=A.uid,m){b.next=4;break}return G.ZP.error("uid\u4E0D\u80FD\u4E3A\u7A7A"),b.abrupt("return");case 4:if(!(p.data.id&&m)){b.next=15;break}if(!(D.filter(function(V){return V.id===m}).length>0)){b.next=8;break}return G.ZP.error("\u8BE5\u8D26\u53F7\u5DF2\u6DFB\u52A0"),b.abrupt("return");case 8:if(!(_.filter(function(V){return V.id===m}).length>0)){b.next=11;break}return G.ZP.error("\u8BE5\u8D26\u53F7\u5DF2\u6DFB\u52A0"),b.abrupt("return");case 11:return b.next=13,(0,ge.fn)({adminId:p.data.id,userId:m});case 13:T=b.sent,T.data?N([].concat(ee()(D),[T.data])):G.ZP.error("uid\u975E\u6CD5");case 15:case"end":return b.stop()}},F)}));return function(F){return j.