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