|
- "use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[472],{88058:function(ue,b,a){a.r(b),a.d(b,{default:function(){return M}});var k=a(15009),m=a.n(k),$=a(99289),_=a.n($),G=a(5574),p=a.n(G),v=a(67294),d=a(12029),w=a(42075),E=a(86738),o=a(45360),j=a(71577),I=a(5914),F=a(12096),f=a(34041),g=a(3579),V=a(51042),L=a(15513),U={tab_navbar_card:"tab_navbar_card___TM3Di",tab_navbar_active:"tab_navbar_active___PLvNu",tab_navbar_item:"tab_navbar_item___FaQZn",log_head_card:"log_head_card___e4OFg",log_head_card_text:"log_head_card_text____MQ82",log_card_data:"log_card_data___Uhh4q",log_data_pos:"log_data_pos___M3M6A",log_data_number:"log_data_number___Fh2Z2",log_data_text:"log_data_text___ApoMe",log_list_title:"log_list_title___l0YtY",log_detail_row:"log_detail_row___B6WKE",log_detail_item:"log_detail_item___JgTlO",log_detail_half:"log_detail_half___bh7yF",log_detail_item_last:"log_detail_item_last___w0ouH",log_detail_title:"log_detail_title____90Pu",log_detail_content:"log_detail_content___nhonA",tab_navbar_btn:"tab_navbar_btn___yQEXt",person_list:"person_list___ZO8Fs",person_list_item:"person_list_item___HkHZR",person_list_btn:"person_list_btn___ZGGz9",item_content:"item_content___btVdX"},e=a(85893),z=function(){var N=(0,v.useState)(!1),P=p()(N,2),B=P[0],Z=P[1],H=(0,v.useState)(!1),A=p()(H,2),J=A[0],y=A[1],Q=(0,v.useState)({status:1,roleId:"",gender:1,id:"",sort:1,name:"",isAccount:!1}),D=p()(Q,2),K=D[0],S=D[1],X=d.Z.useForm(),Y=p()(X,1),C=Y[0],W=d.Z.useForm(),q=p()(W,1),h=q[0],x=(0,v.useRef)(),ee=(0,v.useState)([]),R=p()(ee,2),O=R[0],ne=R[1],re=[{title:"\u59D3\u540D",dataIndex:"name",key:"name"},{title:"\u767B\u5F55\u8D26\u53F7",dataIndex:"account",key:"account",hideInSearch:!0},{title:"\u6027\u522B",dataIndex:"gender",key:"gender",valueType:"select",hideInSearch:!1,valueEnum:{0:{text:"\u7537"},1:{text:"\u5973"}},render:function(u,n){return(0,e.jsx)(e.Fragment,{children:n.gender===0?(0,e.jsx)("div",{style:{color:"green"},children:"\u7537"}):(0,e.jsx)("div",{style:{color:"green"},children:"\u5973"})})}},{title:"\u89D2\u8272",search:!1,hideInSearch:!0,dataIndex:"roleId",key:"roleId",render:function(u,n){return(0,e.jsx)(e.Fragment,{children:function(){var t=O.find(function(r){return r.id===n.roleId});return t?(0,e.jsx)("div",{children:t.name}):(0,e.jsx)("div",{children:"\u672A\u77E5\u89D2\u8272"})}()})}},{title:"\u72B6\u6001",dataIndex:"status",key:"status",valueType:"select",hideInSearch:!1,valueEnum:{0:{text:"\u5728\u804C"},1:{text:"\u51FA\u5DEE"},2:{text:"\u79BB\u804C"}},render:function(u,n){return(0,e.jsx)(e.Fragment,{children:n.status===0?(0,e.jsx)("div",{style:{color:"green"},children:"\u5728\u804C"}):n.status===1?(0,e.jsx)("div",{style:{color:"Orange"},children:"\u51FA\u5DEE"}):(0,e.jsx)("div",{style:{color:"red"},children:"\u79BB\u804C"})})}},{title:"\u64CD\u4F5C",search:!1,key:"action",render:function(u,n){return(0,e.jsxs)(w.Z,{size:"middle",children:[(0,e.jsx)("a",{onClick:function(){y(!0),h.setFieldValue("tB_Employee_Id",n.id),h.setFieldValue("account",n.account)},children:"\u8BBE\u7F6E\u767B\u5F55\u8D26\u53F7"}),(0,e.jsx)(E.Z,{title:"\u786E\u5B9A\u8981\u91CD\u7F6E\u5BC6\u7801\u5417\uFF1F",onConfirm:_()(m()().mark(function t(){var r;return m()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,g.BG.RestoreAccount(n.id);case 2:r=c.sent,r.data===!0?o.ZP.success("\u6210\u529F!"):o.ZP.error(r.msg||"\u91CD\u7F6E\u5931\u8D25");case 4:case"end":return c.stop()}},t)})),onCancel:function(){o.ZP.info("\u5DF2\u53D6\u6D88")},okText:"\u786E\u8BA4",cancelText:"\u5173\u95ED",children:(0,e.jsx)("a",{children:"\u91CD\u7F6E\u5BC6\u7801"})},"del"),(0,e.jsx)("a",{onClick:function(){Z(!0),S(n);var r=JSON.parse(JSON.stringify(n));C.setFieldsValue(r)},children:"\u7F16\u8F91"}),(0,e.jsx)(E.Z,{title:"\u786E\u5B9A\u8981\u5220\u9664\u6B64\u6761\u6570\u636E\u5417\uFF1F",onConfirm:_()(m()().mark(function t(){var r,l;return m()().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,g.BG.RemoveUser(n.id);case 2:r=i.sent,r.data===!0?(o.ZP.success("\u5220\u9664\u6210\u529F!"),(l=x.current)===null||l===void 0||l.reload()):o.ZP.error(r.msg||"\u5220\u9664\u5931\u8D25");case 4:case"end":return i.stop()}},t)})),onCancel:function(){o.ZP.info("\u5DF2\u53D6\u6D88\u5220\u9664")},okText:"\u786E\u8BA4",cancelText:"\u5173\u95ED",children:(0,e.jsx)(j.ZP,{type:"primary",danger:!0,ghost:!0,children:"\u5220\u9664\u5458\u5DE5"})},"del")]})}}],te=function(){S({status:1,roleId:"",gender:1,id:"",sort:1,name:""}),C.resetFields(),Z(!0)},T=function(){var s=_()(m()().mark(function u(){var n;return m()().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,g.ar.GetRoleList();case 2:n=r.sent,n.statusCode===200?ne(n.data):o.ZP.error(n.msg||"\u83B7\u53D6\u89D2\u8272\u5217\u8868\u5931\u8D25");case 4:case"end":return r.stop()}},u)}));return function(){return s.apply(this,arguments)}}();(0,v.useEffect)(function(){B&&T()},[B]);var ae=function(){var s=_()(m()().mark(function u(n){var t,r,l;return m()().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(!n.id){i.next=7;break}return i.next=3,g.BG.ModifyUser(n);case 3:r=i.sent,r.data===!0?(o.ZP.success("\u66F4\u65B0\u7528\u6237\u4FE1\u606F\u6210\u529F!"),Z(!1)):o.ZP.error(r.msg||"\u66F4\u65B0\u7528\u6237\u4FE1\u606F\u5931\u8D25"),i.next=11;break;case 7:return i.next=9,g.BG.CreateUser(n);case 9:l=i.sent,l.statusCode===200?(o.ZP.success("\u521B\u5EFA\u6210\u529F!"),Z(!1)):o.ZP.error(l.msg||"\u521B\u5EFA\u5931\u8D25");case 11:(t=x.current)===null||t===void 0||t.reload();case 12:case"end":return i.stop()}},u)}));return function(n){return s.apply(this,arguments)}}(),se=function(){var s=_()(m()().mark(function u(n){var t,r;return m()().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,g.BG.BindAccount(n);case 2:t=c.sent,t.data===!0?(o.ZP.success("\u7ED1\u5B9A\u6210\u529F!"),x==null||(r=x.current)===null||r===void 0||r.reload(),y(!1)):o.ZP.error(t.msg||"\u7ED1\u5B9A\u5931\u8D25");case 4:case"end":return c.stop()}},u)}));return function(n){return s.apply(this,arguments)}}();return(0,v.useEffect)(function(){T()},[]),(0,e.jsxs)("div",{className:U.log_container,children:[(0,e.jsx)(L.Z,{columns:re,actionRef:x,cardBordered:!0,request:_()(m()().mark(function s(){var u,n,t=arguments;return m()().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return u=t.length>0&&t[0]!==void 0?t[0]:{},l.next=3,g.BG.GetUserPagedList({name:u.name,status:u.status,pageIndex:u.current||1,pageSize:u.pageSize||10,gender:u.gender});case 3:if(n=l.sent,n.statusCode!==200){l.next=8;break}return l.abrupt("return",{data:n.data.items,success:!0,total:n.data.total});case 8:return o.ZP.error("\u83B7\u53D6\u7528\u6237\u5217\u8868\u51FA\u9519"),l.abrupt("return",{data:[],success:!1,total:0});case 10:case"end":return l.stop()}},s)})),rowKey:"id",pagination:{pageSize:10,showSizeChanger:!1},dateFormatter:"string",headerTitle:"\u5458\u5DE5\u5217\u8868",toolBarRender:function(){return[(0,e.jsx)(j.ZP,{icon:(0,e.jsx)(V.Z,{}),type:"primary",onClick:function(){return te()},children:"\u6DFB\u52A0"},"button")]}}),(0,e.jsx)(I.Z,{maskClosable:!1,footer:null,width:500,title:K.id===""?"\u65B0\u589E\u4EBA\u5458":"\u7F16\u8F91\u4EBA\u5458",open:B,onOk:function(){return Z(!1)},onCancel:function(){return Z(!1)},children:(0,e.jsxs)(d.Z,{form:C,name:"basic",onFinish:ae,children:[(0,e.jsx)(d.Z.Item,{label:"id",name:"id",hidden:!0,children:(0,e.jsx)(F.Z,{})}),(0,e.jsx)(d.Z.Item,{label:"\u59D3\u540D",name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5458\u5DE5\u540D\u79F0\uFF01"}],children:(0,e.jsx)(F.Z,{})}),(0,e.jsx)(d.Z.Item,{label:"\u6027\u522B",name:"gender",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u6027\u522B\uFF01"}],children:(0,e.jsxs)(f.Z,{style:{width:"100%"},children:[(0,e.jsx)(f.Z.Option,{value:0,children:"\u7537"}),(0,e.jsx)(f.Z.Option,{value:1,children:"\u5973"})]})}),(0,e.jsx)(d.Z.Item,{label:"\u89D2\u8272",name:"roleId",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u89D2\u8272\uFF01"}],children:(0,e.jsx)(f.Z,{style:{width:"100%"},children:O.map(function(s){return(0,e.jsx)(f.Z.Option,{value:s.id,children:s.name},s.id)})})}),(0,e.jsx)(d.Z.Item,{label:"\u72B6\u6001",name:"status",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001\uFF01"}],children:(0,e.jsxs)(f.Z,{style:{width:"100%"},children:[(0,e.jsx)(f.Z.Option,{value:0,children:"\u5728\u804C"}),(0,e.jsx)(f.Z.Option,{value:1,children:"\u51FA\u5DEE"}),(0,e.jsx)(f.Z.Option,{value:2,children:"\u79BB\u804C"})]})}),(0,e.jsx)(d.Z.Item,{children:(0,e.jsx)(j.ZP,{type:"primary",htmlType:"submit",children:"\u786E\u5B9A"})})]})}),(0,e.jsx)(I.Z,{maskClosable:!1,footer:null,width:500,title:"\u7528\u6237\u8D26\u6237",open:J,onOk:function(){h==null||h.resetFields(),y(!1)},onCancel:function(){h==null||h.resetFields(),y(!1)},children:(0,e.jsxs)(d.Z,{form:h,name:"basic",onFinish:se,children:[(0,e.jsx)(d.Z.Item,{label:"\u5458\u5DE5Id",name:"tB_Employee_Id",hidden:!0,children:(0,e.jsx)(F.Z,{})}),(0,e.jsx)(d.Z.Item,{label:"\u8D26\u6237\u540D",name:"account",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8D26\u6237\uFF01"}],children:(0,e.jsx)(F.Z,{placeholder:"\u8BF7\u8F93\u5165\u81EA\u5B9A\u4E49\u8D26\u53F7\u540D"})}),(0,e.jsx)(d.Z.Item,{children:(0,e.jsx)(j.ZP,{type:"primary",htmlType:"submit",children:"\u786E\u5B9A"})})]})})]})},M=z}}]);
|