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