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

"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[39],{84702:function(fe,K,r){r.r(K);var d=r(15009),T=r.n(d),A=r(99289),N=r.n(A),z=r(5574),b=r.n(z),w=r(90930),Y=r(25335),V=r(35312),f=r(8232),k=r(55241),q=r(10397),H=r(66309),$=r(14726),j=r(55102),B=r(17788),C=r(34041),S=r(67294),X=r(48357),t=r(85893),ee=function(){var ne=(0,S.useState)(!1),G=b()(ne,2),re=G[0],x=G[1],te=(0,S.useState)(!1),J=b()(te,2),ce=J[0],Z=J[1],ae=f.Z.useForm(),e=b()(ae,1),a=e[0],i=(0,S.useState)([]),n=b()(i,2),l=n[0],v=n[1],u=(0,S.useState)([]),_=b()(u,2),p=_[0],O=_[1],E=(0,V.useModel)("@@initialState"),y=E.initialState,m=y==null?void 0:y.currentUser,R=m&&m.role&&m.role<2,U=function(s){a.setFieldsValue(s),x(!0),Z(!0)},g=[{title:"\u5E94\u7528\u540D",dataIndex:"name",copyable:!0,hideInSearch:!0},{title:"\u5E94\u7528\u56FE\u7247",dataIndex:"img",hideInSearch:!0,renderText:function(s){return(0,t.jsx)("img",{style:{width:"40px"},src:s})}},{title:"code",dataIndex:"code",copyable:!0,hideInSearch:!0},{title:"\u4E0B\u8F7D\u5730\u5740",dataIndex:"url",width:200,hideInSearch:!0,renderText:function(s){return(0,t.jsx)(k.Z,{overlayInnerStyle:{padding:0},content:(0,t.jsx)(q.Z,{value:s||"",bordered:!1}),children:(0,t.jsx)("a",{style:{wordBreak:"break-word"},children:s})})}}],F=[].concat(g,[{title:"secret",dataIndex:"secret",ellipsis:!0,copyable:!0,hideInSearch:!0},{title:"\u83DC\u5355\u680F\u4E2D",dataIndex:"hide",hideInSearch:!0,renderText:function(s){return s===0?(0,t.jsx)(H.Z,{color:"blue",children:"\u5C55\u793A"}):(0,t.jsx)(H.Z,{color:"purple",children:"\u9690\u85CF"})}},{title:"\u6E20\u9053",dataIndex:"channel",hideInSearch:!0,renderText:function(s){switch(s){case"fanmiyou":return"\u51E1\u7C73\u6E38";case"qiji":return"\u5947\u8FF9"}return s}},{title:"\u64CD\u4F5C",width:80,hideInSearch:!0,renderText:function(s){return(0,t.jsx)("a",{onClick:function(){return U(s)},children:"\u7F16\u8F91"},"edit")}}]),M=function(){a.submit()},le=function(){x(!1)},W=function(){var o=N()(T()().mark(function s(){var h;return T()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,(0,X.ln)();case 2:h=c.sent,h.data&&(v(h.data),O(h.data));case 4:case"end":return c.stop()}},s)}));return function(){return o.apply(this,arguments)}}();(0,S.useEffect)(function(){W()},[]);var Q=function(){a.resetFields(),x(!0),Z(!1)},L=function(){var o=N()(T()().mark(function s(h){return T()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.prev=0,c.next=3,(0,X.XJ)(h);case 3:c.next=8;break;case 5:return c.prev=5,c.t0=c.catch(0),c.abrupt("return");case 8:x(!1),W();case 10:case"end":return c.stop()}},s,null,[[0,5]])}));return function(h){return o.apply(this,arguments)}}(),oe=function(s){var h=l.filter(function(I){var c;return I==null||(c=I.name)===null||c===void 0?void 0:c.includes(s)});O(h)};return(0,t.jsxs)(w._z,{children:[m&&m.role&&m.role<2&&(0,t.jsx)($.ZP,{style:{marginBottom:"20px"},onClick:Q,children:"\u65B0\u5EFA\u5E94\u7528"}),(0,t.jsx)(Y.Z,{search:{defaultCollapsed:!1,optionRender:function(){return[(0,t.jsx)(j.Z,{placeholder:"\u8BF7\u8F93\u5165\u5E94\u7528\u540D",onChange:function(h){return oe(h.target.value)}},"name")]}},onReset:function(){O(l)},columns:R?F:g,dataSource:p}),(0,t.jsx)(B.Z,{title:"\u7F16\u8F91",visible:re,onOk:M,onCancel:le,children:(0,t.jsxs)(f.Z,{form:a,onFinish:L,children:[(0,t.jsx)(f.Z.Item,{name:"id",style:{display:"none"},children:(0,t.jsx)(j.Z,{type:"hidden"})}),(0,t.jsx)(f.Z.Item,{name:"code",style:{display:"none"},children:(0,t.jsx)(j.Z,{type:"hidden"})}),(0,t.jsx)(f.Z.Item,{label:"\u5E94\u7528\u540D",name:"name",children:(0,t.jsx)(j.Z,{})}),(0,t.jsx)(f.Z.Item,{label:"\u5E94\u7528\u56FE\u7247",name:"img",children:(0,t.jsx)(j.Z,{})}),(0,t.jsx)(f.Z.Item,{label:"\u4E0B\u8F7D\u5730\u5740",name:"url",children:(0,t.jsx)(j.Z,{})}),(0,t.jsx)(f.Z.Item,{label:"\u83DC\u5355\u680F\u4E2D",name:"hide",children:(0,t.jsxs)(C.Z,{children:[(0,t.jsx)(C.Z.Option,{value:0,children:"\u5C55\u793A"},"0"),(0,t.jsx)(C.Z.Option,{value:1,children:"\u9690\u85CF"},"1")]})}),(0,t.jsx)(f.Z.Item,{label:"\u6E20\u9053",name:"channel",chil