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
19 KiB

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