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