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.
2 lines
9.5 KiB
2 lines
9.5 KiB
8 months ago
|
"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}}
|