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

"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[816],{85099:function(ve,L,r){r.r(L),r.d(L,{default:function(){return ye}});var Q=r(15009),s=r.n(Q),z=r(99289),p=r.n(z),J=r(5574),h=r.n(J),E=r(48357),X=r(35312),o=r(8232),R=r(66309),x=r(71230),S=r(15746),D=r(14726),F=r(13169),j=r(72051),P=r(17788),M=r(55102),u=r(34041),Y=r(37804),V=r(16250),C=r(67294),je=r(72269),e=r(85893),pe=function(m){var U=function(){m.onSubmit()},y=[{title:"\u59D3\u540D",dataIndex:"name",ellipsis:!0},{title:"\u89D2\u8272",dataIndex:"role",render:function(I){var Z="";switch(I){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(I){return(0,e.jsx)(je.Z,{defaultValue:I.hide!==0,onClick:function(w){I.id&&(0,E.tQ)({adminId:I.id,hide:w?1:0})}},I.id)}}];return(0,e.jsx)(P.Z,{title:"\u6279\u91CF\u7F16\u8F91",visible:!0,footer:[],onCancel:U,children:(0,e.jsx)(j.Z,{columns:y,dataSource:m.data})})},xe=pe,Ze=r(19632),q=r.n(Ze),be=r(81072),Ce=r(3089),ge=r(55241),ae=r(86250),G=r(2453),ue=r(42767),Ee=function(m){var U=(0,C.useState)([]),y=h()(U,2),O=y[0],I=y[1],Z=(0,C.useState)([]),w=h()(Z,2),g=w[0],_=w[1],K=o.Z.useForm(),W=h()(K,1),k=W[0],ee=function(){var c=p()(s()().mark(function b(A){var l;return s()().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return B.next=2,(0,E.yC)({adminId:A});case 2:l=B.sent,I(l.data||[]);case 4:case"end":return B.stop()}},b)}));return function(A){return c.apply(this,arguments)}}();return(0,C.useEffect)(function(){m.data.id&&ee(m.data.id)},[m.data.id]),(0,e.jsxs)(P.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)(ge.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,E.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)(S.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)(ue.Z,{data:c})},c.id)})})]}),g.length>0&&(0,e.jsxs)(x.Z,{gutter:6,style:{marginTop:20},children:[(0,e.jsx)(S.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)(ue.Z,{data:c}),(0,e.jsx)(Ce.Z,{style:{marginLeft:20},onClick:function(){_(g.filter(function(A){return A.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(A){var l,T;return s()().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(l=A.uid,l){v.next=4;break}return G.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 G.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 G.ZP.error("\u8BE5\u8D26\u53F7\u5DF2\u6DFB\u52A0"),v.abrupt("return");case 11:return v.next=13,(0,be.fn)({adminId:m.data.id,userId:l});case 13:T=v.sent,T.data?_([].concat(q()(g),[T.data])):G.ZP.error("uid\u975E\u6CD5");case 15:case"end":return v.stop()}},b)}));return function(b){return c.app