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
1 lines
9.5 KiB
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[816],{32708:function(He,ee,r){r.r(ee),r.d(ee,{default:function(){return De}});var ce=r(15009),T=r.n(ce),de=r(99289),X=r.n(de),ue=r(5574),Z=r.n(ue),ve=r(35312),b=r(8232),i=r(67294),fe=r(62208),ge=r(93967),ne=r.n(ge),re=r(98787),me=r(69760),he=r(45353),te=r(53124),ae=r(54548),pe=r(10274),Ce=r(14747),be=r(45503),G=r(91945);const ye=e=>{const{paddingXXS:l,lineWidth:o,tagPaddingHorizontal:n,componentCls:t,calc:p}=e,u=p(n).sub(o).equal(),y=p(l).sub(o).equal();return{[t]:Object.assign(Object.assign({},(0,Ce.Wf)(e)),{display:"inline-block",height:"auto",marginInlineEnd:e.marginXS,paddingInline:u,fontSize:e.tagFontSize,lineHeight:e.tagLineHeight,whiteSpace:"nowrap",background:e.defaultBg,border:`${(0,ae.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:y,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:u}}),[`${t}-borderless`]:{borderColor:"transparent",background:e.tagBorderlessBg}}},w=e=>{const{lineWidth:l,fontSizeIcon:o,calc:n}=e,t=e.fontSizeSM;return(0,be.TS)(e,{tagFontSize:t,tagLineHeight:(0,ae.bf)(n(e.lineHeightSM).mul(t).equal()),tagIconSize:n(o).sub(n(l).mul(2)).equal(),tagPaddingHorizontal:8,tagBorderlessBg:e.defaultBg})},Q=e=>({defaultBg:new pe.C(e.colorFillQuaternary).onBackground(e.colorBgContainer).toHexString(),defaultColor:e.colorText});var le=(0,G.I$)("Tag",e=>{const l=w(e);return ye(l)},Q),Se=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 t=0,n=Object.getOwnPropertySymbols(e);t<n.length;t++)l.indexOf(n[t])<0&&Object.prototype.propertyIsEnumerable.call(e,n[t])&&(o[n[t]]=e[n[t]]);return o},xe=i.forwardRef((e,l)=>{const{prefixCls:o,style:n,className:t,checked:p,onChange:u,onClick:y}=e,g=Se(e,["prefixCls","style","className","checked","onChange","onClick"]),{getPrefixCls:$,tag:m}=i.useContext(te.E_),I=A=>{u==null||u(!p),y==null||y(A)},S=$("tag",o),[x,B,F]=le(S),f=ne()(S,`${S}-checkable`,{[`${S}-checkable-checked`]:p},m==null?void 0:m.className,t,B,F);return x(i.createElement("span",Object.assign({},g,{ref:l,style:Object.assign(Object.assign({},n),m==null?void 0:m.style),className:f,onClick:I})))}),je=r(98719);const $e=e=>(0,je.Z)(e,(l,o)=>{let{textColor:n,lightBorderColor:t,lightColor:p,darkColor:u}=o;return{[`${e.componentCls}${e.componentCls}-${l}`]:{color:n,background:p,borderColor:t,"&-inverse":{color:e.colorTextLightSolid,background:u,borderColor:u},[`&${e.componentCls}-borderless`]:{borderColor:"transparent"}}}});var Ie=(0,G.bk)(["Tag","preset"],e=>{const l=w(e);return $e(l)},Q);function Oe(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.slice(1)}const z=(e,l,o)=>{const n=Oe(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 Te=(0,G.bk)(["Tag","status"],e=>{const l=w(e);return[z(l,"success","Success"),z(l,"processing","Info"),z(l,"error","Error"),z(l,"warning","Warning")]},Q),Ze=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 t=0,n=Object.getOwnPropertySymbols(e);t<n.length;t++)l.indexOf(n[t])<0&&Object.prototype.propertyIsEnumerable.call(e,n[t])&&(o[n[t]]=e[n[t]]);return o};const Ee=(e,l)=>{const{prefixCls:o,className:n,rootClassName:t,style:p,children:u,icon:y,color:g,onClose:$,closeIcon:m,closable:I,bordered:S=!0}=e,x=Ze(e,["prefixCls","className","rootClassName","style","children","icon","color","onClose","closeIcon","closable","bordered"]),{getPrefixCls:B,direction:F,tag:f}=i.useContext(te.E_),[A,D]=i.useState(!0);i.useEffect(()=>{"visible"in x&&D(x.visible)},[x.visible]);const O=(0,re.o2)(g),M=(0,re.yT)(g),P=O||M,H=Object.assign(Object.assign({backgroundColor:g&&!P?g:void 0},f==null?void 0:f.style),p),h=B("tag",o),[Y,N,C]=le(h),k=ne()(h,f==null?void 0:f.className,{[`${h}-${g}`]:P,[`${h}-has-color`]:g&&!P,[`${h}-hidden`]:!A,[`${h}-rtl`]:F==="rtl",[`${h}-borderless`]:!S},n,t,N,C),R=j=>{j.stopPropagation(),$==null||$(j),!j.defaultPrevented&&D(!1)},[,q]=(0,me.Z)({closable:I,closeIcon:m!=null?m:f==null?void 0:f.closeIcon,customCloseIconRender:j=>j===null?i.createElement(fe.Z,{className:`${h}-close-icon`,onClick:R}):i.createElement("span",{className:`${h}-close-icon`,onClick:R},j),defaultCloseIcon:null,defaultClosable:!1}),_=typeof x.onClick=="function"||u&&u.type==="a",V=y||null,W=V?i.createElement(i.Fragment,null,V,u&&i.createElement("span",null,u)):u,L=i.createElement("span",Object.assign({},x,{ref:l,className:k,style:H}),W,q,O&&i.createElement(Ie,{key:"preset",prefixCls:h}),M&&i.createElement(Te,{key:"status",prefixCls:h}));return Y(_?i.createElement(he.Z,{component:"Tag"},L):L)},oe=i.forwardRef(Ee);oe.CheckableTag=xe;var Be=oe,Pe=r(14726),Fe=r(72051),Ae=r(17788),J=r(96365),E=r(34041),Ne=r(71230),se=r(15746),ie=r(8925),K=r(48357),a=r(85893),ze=function(){var l=(0,i.useState)([]),o=Z()(l,2),n=o[0],t=o[1],p=(0,i.useState)(!1),u=Z()(p,2),y=u[0],g=u[1],$=(0,i.useState)(!1),m=Z()($,2),I=m[0],S=m[1],x=(0,i.useState)(0),B=Z()(x,2),F=B[0],f=B[1],A=b.Z.useForm(),D=Z()(A,1),O=D[0],M=(0,i.useState)([]),P=Z()(M,2),H=P[0],h=P[1],Y=(0,ve.useModel)("@@initialState"),N=Y.initialState,C=N==null?void 0:N.currentUser,k=function(c){var s=H.find(function(U){return U.id===c});return s?s.name:""},R=function(c){O.setFieldsValue(c),g(!0),S(!0),f(c.role?c.role:0)},q=[{title:"\u59D3\u540D",dataIndex:"name"},{title:"\u5E94\u7528IDs",dataIndex:"appIds",render:function(c){return(0,a.jsx)("div",{children:c==null?void 0:c.map(function(s){return(0,a.jsx)(Be,{color:"blue",children:k(s)},s)})})}},{title:"\u89D2\u8272",dataIndex:"role",render:function(c){var s="";switch(c){case 1:s="\u8D85\u7EA7\u7BA1\u7406\u5458";break;case 2:s="\u7BA1\u7406\u5458";break;case 3:s="\u666E\u901A\u8D26\u53F7";break;case 4:s="\u53E3\u5B50";break;default:s=""}return s}},{title:"\u64CD\u4F5C",render:function(c){return[(0,a.jsx)("a",{onClick:function(){return R(c)},children:"\u7F16\u8F91"},"edit")]}}],_=function(){O.submit()},V=function(){g(!1)},W=function(){var v=X()(T()().mark(function c(){var s;return T()().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,(0,K.N0)();case 2:s=d.sent,s.data&&t(s.data);case 4:case"end":return d.stop()}},c)}));return function(){return v.apply(this,arguments)}}(),L=function(){var v=X()(T()().mark(function c(){var s;return T()().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,(0,K.ln)();case 2:s=d.sent,s.data&&h(s.data);case 4:case"end":return d.stop()}},c)}));return function(){return v.apply(this,arguments)}}();(0,i.useEffect)(function(){W(),L()},[]);var j=function(){O.resetFields(),g(!0),S(!1),f(0)},Me=function(){var v=X()(T()().mark(function c(s){return T()().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.prev=0,d.next=3,(0,K.P7)(s);case 3:d.next=8;break;case 5:return d.prev=5,d.t0=d.catch(0),d.abrupt("return");case 8:g(!1),W();case 10:case"end":return d.stop()}},c,null,[[0,5]])}));return function(s){return v.apply(this,arguments)}}();return(0,a.jsxs)("div",{children:[(0,a.jsx)(Pe.ZP,{onClick:j,children:"\u65B0\u5EFA\u8D26\u53F7"}),(0,a.jsx)(Fe.Z,{columns:q,dataSource:n}),(0,a.jsx)(Ae.Z,{title:"\u7F16\u8F91",visible:y,onOk:_,onCancel:V,children:(0,a.jsxs)(b.Z,{form:O,onFinish:Me,children:[(0,a.jsx)(b.Z.Item,{name:"id",style:{display:"none"},children:(0,a.jsx)(J.Z,{type:"hidden"})}),(0,a.jsx)(b.Z.Item,{label:"\u7528\u6237\u540D",name:"name",children:(0,a.jsx)(J.Z,{disabled:I})}),(0,a.jsx)(b.Z.Item,{label:"\u5BC6\u7801",name:"password",children:(0,a.jsx)(J.Z.Password,{disabled:I})}),(0,a.jsx)(b.Z.Item,{label:"\u5E94\u7528",name:"appIds",children:(0,a.jsx)(E.Z,{mode:"multiple",children:H.map(function(v){return(0,a.jsx)(E.Z.Option,{value:v.id,children:v.name},v.id)})})}),(0,a.jsx)(b.Z.Item,{label:"\u89D2\u8272",name:"role",children:(0,a.jsxs)(E.Z,{disabled:I,onSelect:f,children:[(0,a.jsx)(E.Z.Option,{disabled:(C==null?void 0:C.role)&&C.role>1,value:2,children:"\u7BA1\u7406\u5458"}),(0,a.jsx)(E.Z.Option,{disabled:(C==null?void 0:C.role)&&C.role>2,value:3,children:"\u666E\u901A\u8D26\u53F7"}),(0,a.jsx)(E.Z.Option,{value:4,children:"\u53E3\u5B50"})]})}),F>3&&(0,a.jsxs)(Ne.Z,{children:[(0,a.jsx)(se.Z,{span:12,children:(0,a.jsx)(b.Z.Item,{label:"\u6536\u5165\u6BD4\u4F8B",name:"incomeRate",children:(0,a.jsx)(ie.Z,{placeholder:"1-100\u6574\u6570",style:{width:"80%"}})})}),(0,a.jsx)(se.Z,{span:12,children:(0,a.jsx)(b.Z.Item,{label:"\u8BBE\u5907\u6570",name:"deviceCnt",children:(0,a.jsx)(ie.Z,{style:{width:"80%"}})})})]})]})})]})},De=ze}}]);
|
|
|