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