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.
 
 
 

1 lines
3.6 KiB

"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[39],{40110:function(y,c,e){var E=e(1413),s=e(67294),P=e(509),m=e(91146),h=function(D,O){return s.createElement(m.Z,(0,E.Z)((0,E.Z)({},D),{},{ref:O,icon:P.Z}))},u=s.forwardRef(h);c.Z=u},84702:function(y,c,e){e.r(c);var E=e(15009),s=e.n(E),P=e(99289),m=e.n(P),h=e(5574),u=e.n(h),A=e(90930),D=e(25335),O=e(35312),i=e(8232),o=e(55102),Z=e(42075),M=e(14726),L=e(71230),I=e(10397),W=e(55241),g=e(17788),p=e(67294),x=e(48357),F=e(40110),n=e(85893),S=function(){var b=(0,p.useState)(!1),U=u()(b,2),V=U[0],v=U[1],$=i.Z.useForm(),z=u()($,1),f=z[0],G=(0,p.useState)([]),T=u()(G,2),N=T[0],J=T[1],X=(0,O.useModel)("@@initialState"),j=X.initialState,d=j==null?void 0:j.currentUser,H=d&&d.role&&d.role<2,Q=function(r){f.setFieldsValue(r),v(!0)},B=[{title:"\u6E38\u620F",dataIndex:"name",filterDropdown:function(r){var a=r.setSelectedKeys,l=r.selectedKeys,t=r.confirm,ne=r.clearFilters;return(0,n.jsxs)("div",{style:{padding:8},children:[(0,n.jsx)(o.Z,{placeholder:"\u641C\u7D22\u8D26\u53F7",value:l[0],onChange:function(R){return a(R.target.value?[R.target.value]:[])},onPressEnter:function(){return t()},style:{marginBottom:8,display:"block"}}),(0,n.jsxs)(Z.Z,{children:[(0,n.jsx)(M.ZP,{onClick:function(){return t()},type:"primary",children:"\u641C\u7D22"}),(0,n.jsx)(M.ZP,{onClick:function(){return ne()},type:"link",children:"\u6E05\u9664"})]})]})},onFilter:function(r,a){var l;return a==null||(l=a.name)===null||l===void 0?void 0:l.includes(r)},filterIcon:function(r){return(0,n.jsx)(F.Z,{style:{color:r?"#1890ff":void 0},onPointerEnterCapture:void 0,onPointerLeaveCapture:void 0})}},{title:"\u4E0B\u8F7D\u5730\u5740",dataIndex:"url",renderText:function(r){return r&&(0,n.jsxs)(L.Z,{align:"middle",children:[(0,n.jsx)(I.Z,{size:80,value:r||"",bordered:!1}),(0,n.jsx)(W.Z,{overlayInnerStyle:{padding:0},content:(0,n.jsx)(I.Z,{size:300,value:r||"",bordered:!1}),children:(0,n.jsx)("a",{children:"\u67E5\u770B\u5927\u56FE"})})]})}}],Y=[].concat(B,[{title:"secret",dataIndex:"secret",ellipsis:!0,copyable:!0},{title:"\u64CD\u4F5C",width:80,renderText:function(r){return(0,n.jsx)("a",{onClick:function(){return Q(r)},children:"\u7F16\u8F91"},"edit")}}]),k=function(){f.submit()},w=function(){v(!1)},K=function(){var _=m()(s()().mark(function r(){var a;return s()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,x.ln)();case 2:a=t.sent,a.data&&J(a.data);case 4:case"end":return t.stop()}},r)}));return function(){return _.apply(this,arguments)}}();(0,p.useEffect)(function(){K()},[]);var q=function(){f.resetFields(),v(!0)},ee=function(){var _=m()(s()().mark(function r(a){return s()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,(0,x.XJ)(a);case 3:t.next=8;break;case 5:return t.prev=5,t.t0=t.catch(0),t.abrupt("return");case 8:v(!1),K();case 10:case"end":return t.stop()}},r,null,[[0,5]])}));return function(a){return _.apply(this,arguments)}}();return(0,n.jsxs)(A._z,{children:[d&&d.role&&d.role<2&&(0,n.jsx)(M.ZP,{style:{marginBottom:"20px"},onClick:q,children:"\u65B0\u5EFA\u5E94\u7528"}),(0,n.jsx)(D.Z,{search:!1,columns:H?Y:B,dataSource:N}),(0,n.jsx)(g.Z,{title:"\u7F16\u8F91",visible:V,onOk:k,onCancel:w,children:(0,n.jsxs)(i.Z,{form:f,onFinish:ee,children:[(0,n.jsx)(i.Z.Item,{name:"id",style:{display:"none"},children:(0,n.jsx)(o.Z,{type:"hidden"})}),(0,n.jsx)(i.Z.Item,{name:"code",style:{display:"none"},children:(0,n.jsx)(o.Z,{type:"hidden"})}),(0,n.jsx)(i.Z.Item,{label:"\u5E94\u7528\u540D",name:"name",children:(0,n.jsx)(o.Z,{})}),(0,n.jsx)(i.Z.Item,{label:"\u4E0B\u8F7D\u5730\u5740",name:"url",children:(0,n.jsx)(o.Z,{})})]})})]})};c.default=S}}]);