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
2.4 KiB
2 lines
2.4 KiB
9 months ago
|
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[39],{84702:function(H,p,e){e.r(p);var j=e(15009),u=e.n(j),P=e(99289),v=e.n(P),A=e(5574),m=e.n(A),U=e(90930),C=e(85601),T=e(35312),t=e(8232),x=e(10397),I=e(14726),B=e(17788),i=e(96365),E=e(67294),f=e(48357),r=e(85893),b=function(){var R=(0,E.useState)(!1),h=m()(R,2),W=h[0],d=h[1],K=t.Z.useForm(),L=m()(K,1),o=L[0],y=(0,E.useState)([]),M=m()(y,2),F=M[0],Z=M[1],S=(0,T.useModel)("@@initialState"),c=S.initialState,l=c==null?void 0:c.currentUser,g=l&&l.role&&l.role<2,$=function(_){o.setFieldsValue(_),d(!0)},O=[{title:"\u6E38\u620F",dataIndex:"name"},{title:"\u4E0B\u8F7D\u5730\u5740",dataIndex:"url",renderText:function(_){return(0,r.jsx)(x.Z,{size:120,value:_||"",bordered:!1})}}],z=[].concat(O,[{title:"secret",dataIndex:"secret",ellipsis:!0,copyable:!0},{title:"\u64CD\u4F5C",width:80,renderText:function(_){return(0,r.jsx)("a",{onClick:function(){return $(_)},children:"\u7F16\u8F91"},"edit")}}]),G=function(){o.submit()},N=function(){d(!1)},D=function(){var a=v()(u()().mark(function _(){var s;return u()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,f.ln)();case 2:s=n.sent,s.data&&Z(s.data);case 4:case"end":return n.stop()}},_)}));return function(){return a.apply(this,arguments)}}();(0,E.useEffect)(function(){D()},[]);var V=function(){o.resetFields(),d(!0)},J=function(){var a=v()(u()().mark(function _(s){return u()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,(0,f.XJ)(s);case 3:n.next=8;break;case 5:return n.prev=5,n.t0=n.catch(0),n.abrupt("return");case 8:d(!1),D();case 10:case"end":return n.stop()}},_,null,[[0,5]])}));return function(s){return a.apply(this,arguments)}}();return(0,r.jsxs)(U._z,{children:[l&&l.role&&l.role<2&&(0,r.jsx)(I.ZP,{style:{marginBottom:"20px"},onClick:V,children:"\u65B0\u5EFA\u5E94\u7528"}),(0,r.jsx)(C.Z,{search:!1,columns:g?z:O,dataSource:F}),(0,r.jsx)(B.Z,{title:"\u7F16\u8F91",visible:W,onOk:G,onCancel:N,children:(0,r.jsxs)(t.Z,{form:o,onFinish:J,children:[(0,r.jsx)(t.Z.Item,{name:"id",style:{display:"none"},children:(0,r.jsx)(i.Z,{type:"hidden"})}),(0,r.jsx)(t.Z.Item,{name:"code",style:{display:"none"},children:(0,r.jsx)(i.Z,{type:"hidden"})}),(0,r.jsx)(t.Z.Item,{label:"\u5E94\u7528\u540D",name:"name",children:(0,r.jsx)(i.Z,{})}),(0,r.jsx)(t.Z.Item,{label:"\u4E0B\u8F7D\u5730\u5740",name:"url",children:(0,r.jsx)(i.Z,{})})]})})]})};p.default=b}}]);
|