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

"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(de,K,r){r.d(K,{Z:function(){return J}});var c=r(67294),P=r(62208),w=r(93967),$=r.n(w),N=r(98787),y=r(69760),k=r(45353),z=r(53124),H=r(54548),C=r(10274),q=r(14747),ee=r(45503),T=r(91945);const ne=e=>{const{paddingXXS:o,lineWidth:l,tagPaddingHorizontal:n,componentCls:t,calc:v}=e,d=v(n).sub(l).equal(),x=v(o).sub(l).equal();return{[t]:Object.assign(Object.assign({},(0,q.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:d,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${(0,H.bf)(e.lineWidth)} ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusSM,opacity:1,transition:`all ${e.motionDurationMid}`,textAlign:"start",position:"relative",[`&${t}-rtl`]:{direction:"rtl"},"&, a, a:hover":{color:e.defaultColor},[`${t}-close-icon`]:{marginInlineStart:x,fontSize:e.tagIconSize,color:e.colorTextDescription,cursor:"pointer",transition:`all ${e.motionDurationMid}`,"&:hover":{color:e.colorTextHeading}},[`&${t}-has-color`]:{borderColor:"transparent",[`&, a, a:hover, ${e.iconCls}-close, ${e.iconCls}-close:hover`]:{color:e.colorTextLightSolid}},["&-checkable"]:{backgroundColor:"transparent",borderColor:"transparent",cursor:"pointer",[`&:not(${t}-checkable-checked):hover`]:{color:e.colorPrimary,backgroundColor:e.colorFillSecondary},"&:active, &-checked":{color:e.colorTextLightSolid},"&-checked":{backgroundColor:e.colorPrimary,"&:hover":{backgroundColor:e.colorPrimaryHover}},"&:active":{backgroundColor:e.colorPrimaryActive}},["&-hidden"]:{display:"none"},[`> ${e.iconCls} + span, > span + ${e.iconCls}`]:{marginInlineStart:d}}),[`${t}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}},b=e=>{const{lineWidth:o,fontSizeIcon:l,calc:n}=e,t=e.fontSizeSM;return(0,ee.TS)(e,{tagFontSize:t,tagLineHeight:(0,H.bf)(n(e.lineHeightSM).mul(t).equal()),tagIconSize:n(l).sub(n(o).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},B=e=>({defaultBg:new C.C(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText});var O=(0,T.I$)("Tag",e=>{const o=b(e);return ne(o)},B),j=function(e,o){var l={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(l[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,n=Object.getOwnPropertySymbols(e);t<n.length;t++)o.indexOf(n[t])<0&&Object.prototype.propertyIsEnumerable.call(e,n[t])&&(l[n[t]]=e[n[t]]);return l},a=c.forwardRef((e,o)=>{const{prefixCls:l,style:n,className:t,checked:v,onChange:d,onClick:x}=e,_=j(e,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:S,tag:m}=c.useContext(z.E_),R=F=>{d==null||d(!v),x==null||x(F)},E=S("tag",l),[f,Z,U]=O(E),h=$()(E,`${E}-checkable`,{[`${E}-checkable-checked`]:v},m==null?void 0:m.className,t,Z,U);return f(c.createElement("span",Object.assign({},_,{ref:o,style:Object.assign(Object.assign({},n),m==null?void 0:m.style),className:h,onClick:R})))}),te=r(98719);const se=e=>(0,te.Z)(e,(o,l)=>{let{textColor:n,lightBorderColor:t,lightColor:v,darkColor:d}=l;return{[`${e.componentCls}${e.componentCls}-${o}`]:{color:n,background:v,borderColor:t,"&-inverse":{color:e.colorTextLightSolid,background:d,borderColor:d},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}});var ae=(0,T.bk)(["Tag","preset"],e=>{const o=b(e);return se(o)},B);function V(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}const M=(e,o,l)=>{const n=V(l);return{[`${e.componentCls}${e.componentCls}-${o}`]:{color:e[`color${l}`],background:e[`color${n}Bg`],borderColor:e[`color${n}Border`],[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}};var D=(0,T.bk)(["Tag","status"],e=>{const o=b(e);return[M(o,"success","Success"),M(o,"processing","Info"),M(o,"error","Error"),M(o,"warning","Warning")]},B),oe=function(e,o){var l={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(l[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var t=0,n=Object.getOwnPropertySymbols(e);t<n.length;t++)o.indexOf(n[t])<0&&Object.prototype.propertyIsEnumerable.call(e,n[t])&&(l[n[t]]=e[n[t]]);return l};const X=(e,o)=>{const{prefixCls:l,className:n,rootClassName:t,style:v,children:d,icon:x,color:_,onClose:S,closeIcon:m,closable:R,bordered:E=!0}=e,f=oe(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:Z,direction:U,tag:h}=c.useContext(z.E_),[F,Q]=c.useState(!0);c.useEffect(()=>{"visible"in f&&Q(f.visible)},[f.visible]);const Y=(0,N.o2)(_),W=(0,N.yT)(_),L=Y||W,le=Object.assign(Object.assign({backgroundColor:_&&!L?_:void 0},h==null?void 0:h.style),v),g=Z("tag",l),[u,i,p]=O(g),I=$()(g,h==null?void 0:h.className,{[`${g}-${_}`]:L,[`${g}-has-color`]:_&&!L,[`${g}-hidden`]:!F,[`${g}-rtl`]:U==="rtl",[`${g}-borderless`]:!E},n,t,i,p),s=A=>{A.stopPropagation(),S==null||S(A),!A.defaultPrevented&&Q(!1)},[,ue]=(0,y.Z)({closable:R,closeIcon:m!=null?m:h==null?void 0:h.closeIcon,customCloseIconRender:A=>A===null?c.createElement(P.Z,{className:`${g}-close-icon`,onClick:s}):c.createElement("span",{className:`${g}-close-icon`,onClick:s},A),defaultCloseIcon:null,defaultClosable:!1}),me=typeof f.onClick=="function"||d&&d.type==="a",ie=x||null,fe=ie?c.createElement(c.Fragment,null,ie,d&&c.createElement("span",null,d)):d,ce=c.createElement("span",Object.assign({},f,{ref:o,className:I,style:le}),fe,ue,Y&&c.createElement(ae,{key:"preset",prefixCls:g}),W&&c.createElement(D,{key:"status",prefixCls:g}));return u(me?c.createElement(k.Z,{component:"Tag"},ce):ce)},G=c.forwardRef(X);G.CheckableTag=a;var J=G}}]);