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

5 months ago
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[816],{40110:function(fe,A,n){var u=n(1413),p=n(67294),L=n(509),x=n(91146),M=function(W,f){return p.createElement(x.Z,(0,u.Z)((0,u.Z)({},W),{},{ref:f,icon:L.Z}))};M.displayName="SearchOutlined",A.Z=p.forwardRef(M)},3973:function(fe,A,n){n.r(A);var u=n(15009),p=n.n(u),L=n(99289),x=n.n(L),M=n(5574),j=n.n(M),W=n(35312),f=n(8232),T=n(96365),ne=n(42075),K=n(14726),re=n(66309),F=n(72051),te=n(17788),O=n(34041),N=n(71230),z=n(15746),Q=n(8925),B=n(67294),H=n(48357),ae=n(40110),t=n(85893),le=function(){var Z=(0,B.useState)([]),J=j()(Z,2),oe=J[0],se=J[1],Y=(0,B.useState)(!1),w=j()(Y,2),e=w[0],s=w[1],c=(0,B.useState)(!1),r=j()(c,2),a=r[0],v=r[1],m=(0,B.useState)(0),P=j()(m,2),y=P[0],D=P[1],g=f.Z.useForm(),V=j()(g,1),E=V[0],S=(0,B.useState)([]),$=j()(S,2),R=$[0],_=$[1],X=(0,W.useModel)("@@initialState"),U=X.initialState,b=U==null?void 0:U.currentUser,k=function(l){var o=R.find(function(h){return h.id===l});return o?o.name:""},G=function(l){E.setFieldsValue(l),s(!0),v(!0),D(l.role?l.role:0)},ie=[{title:"\u8D26\u53F7",dataIndex:"name",filterDropdown:function(l){var o=l.setSelectedKeys,h=l.selectedKeys,i=l.confirm,I=l.clearFilters;return(0,t.jsxs)("div",{style:{padding:8},children:[(0,t.jsx)(T.Z,{placeholder:"\u641C\u7D22\u8D26\u53F7",value:h[0],onChange:function(_e){return o(_e.target.value?[_e.target.value]:[])},onPressEnter:function(){return i()},style:{marginBottom:8,display:"block"}}),(0,t.jsxs)(ne.Z,{children:[(0,t.jsx)(K.ZP,{onClick:function(){return i()},type:"primary",children:"\u641C\u7D22"}),(0,t.jsx)(K.ZP,{onClick:function(){return I()},type:"link",children:"\u6E05\u9664"})]})]})},onFilter:function(l,o){var h;return o==null||(h=o.name)===null||h===void 0?void 0:h.includes(l)},filterIcon:function(l){return(0,t.jsx)(ae.Z,{style:{color:l?"#1890ff":void 0},onPointerEnterCapture:void 0,onPointerLeaveCapture:void 0})}},{title:"\u6E38\u620F",dataIndex:"appIds",render:function(l){return(0,t.jsx)("div",{children:l==null?void 0:l.map(function(o){return(0,t.jsx)(re.Z,{color:"blue",children:k(o)},o)})})}},{title:"\u89D2\u8272",dataIndex:"role",render:function(l){var o="";switch(l){case 1:o="\u8D85\u7EA7\u7BA1\u7406\u5458";break;case 2:o="\u7BA1\u7406\u5458";break;case 3:o="\u666E\u901A\u8D26\u53F7";break;case 4:o="\u53E3\u5B50";break;default:o=""}return o}},{title:"\u64CD\u4F5C",render:function(l){return[(0,t.jsx)("a",{onClick:function(){return G(l)},children:"\u7F16\u8F91"},"edit")]}}],C=function(){E.submit()},ce=function(){s(!1)},q=function(){var d=x()(p()().mark(function l(){var o;return p()().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,(0,H.N0)();case 2:o=i.sent,o.data&&se(o.data);case 4:case"end":return i.stop()}},l)}));return function(){return d.apply(this,arguments)}}(),de=function(){var d=x()(p()().mark(function l(){var o;return p()().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,(0,H.ln)();case 2:o=i.sent,o.data&&_(o.data);case 4:case"end":return i.stop()}},l)}));return function(){return d.apply(this,arguments)}}();(0,B.useEffect)(function(){q(),de()},[]);var ue=function(){E.resetFields(),s(!0),v(!1),D(0)},ee=function(){var d=x()(p()().mark(function l(o){return p()().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,(0,H.P7)(o);case 3:i.next=8;break;case 5:return i.prev=5,i.t0=i.catch(0),i.abrupt("return");case 8:s(!1),q();case 10:case"end":return i.stop()}},l,null,[[0,5]])}));return function(o){return d.apply(this,arguments)}}();return(0,t.jsxs)("div",{children:[(0,t.jsx)(K.ZP,{onClick:ue,children:"\u65B0\u5EFA\u8D26\u53F7"}),(0,t.jsx)(F.Z,{columns:ie,dataSource:oe}),(0,t.jsx)(te.Z,{title:"\u7F16\u8F91",visible:e,onOk:C,onCancel:ce,children:(0,t.jsxs)(f.Z,{form:E,onFinish:ee,children:[(0,t.jsx)(f.Z.Item,{name:"id",style:{display:"none"},children:(0,t.jsx)(T.Z,{type:"hidden"})}),(0,t.jsx)(f.Z.Item,{label:"\u8D26\u53F7",name:"name",children:(0,t.jsx)(T.Z,{disabled:a,maxLength:32})}),(0,t.jsx)(f.Z.Item,{label:"\u5BC6\u7801",name:"password",children:(0,t.jsx)(T.Z.Pas