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

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