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