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