Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 

2 рядки
14 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[4802,7975,1322],{10392:function(Me,V,s){"use strict";s.r(V),s.d(V,{default:function(){return be}});var Le=s(57663),R=s(71577),S=s(2824),O=s(11849),v=s(39428),ze=s(34792),c=s(48086),D=s(3182),H=s(49101),x=s(67294),K=s(78009),J=s(85224),N=s(16894),He=s(71194),E=s(50146),Ke=s(9715),d=s(71257),Je=s(47673),F=s(4107),Ne=s(43358),B=s(34041),f=s(48971);function Q(n){return(0,f.WY)("/kitchen/api/select/getorglist")}function X(n){return(0,f.WY)("\u200B/kitchen/api\u200B/sysOrg\u200B/tree",{data:(0,O.Z)({},n)})}var A={GetOrg:Q,gettree:X},e=s(85893),q=function(a){var o=(0,x.useState)(),h=(0,S.Z)(o,2),r=h[0],l=h[1];return(0,x.useEffect)(function(){A.GetOrg().then(function(b){var g=[];for(var C in b.data)g.push((0,e.jsx)(B.Z.Option,{value:C,children:b.data[C]}));l(g)})},[a.values]),(0,e.jsx)(E.Z,{title:a.values.id?"\u7F16\u8F91\u7528\u6237":"\u65B0\u5EFA\u7528\u6237",width:640,visible:a.modalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){a.onCancel()},destroyOnClose:!0,children:(0,e.jsxs)(d.Z,{preserve:!1,layout:"horizontal",labelCol:{span:4},initialValues:a.values,onFinish:a.onFinish,children:[(0,e.jsx)(d.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(F.Z,{})}),(0,e.jsx)(d.Z.Item,{name:"account",label:"\u767B\u5F55\u8D26\u6237",rules:[{required:!0,max:255}],children:(0,e.jsx)(F.Z,{placeholder:"\u8BF7\u8F93\u5165\u767B\u5F55\u8D26\u6237",disabled:!!a.values.id})}),(0,e.jsx)(d.Z.Item,{name:"name",label:"\u7528\u6237\u59D3\u540D",rules:[{required:!0,max:255}],children:(0,e.jsx)(F.Z,{placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u59D3\u540D"})}),(0,e.jsx)(d.Z.Item,{name:"phone",label:"\u7528\u6237\u624B\u673A",rules:[{required:!0,max:20,pattern:/0?(13|14|15|18|17)[0-9]{9}$/,message:"\u624B\u673A\u53F7\u683C\u5F0F\u4E0D\u6B63\u786E"}],children:(0,e.jsx)(F.Z,{placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u624B\u673A"})}),(0,e.jsx)(d.Z.Item,{name:"sysOrgId",label:"\u6240\u5C5E\u7EC4\u7EC7",rules:[{required:!0}],children:(0,e.jsx)(B.Z,{placeholder:"\u8BF7\u9009\u62E9\u6240\u5C5E\u7EC4\u7EC7",children:r})}),(0,e.jsx)(d.Z.Item,{children:(0,e.jsx)(R.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})})]})})},_=q,ee=function(a){return(0,e.jsx)(E.Z,{title:"\u53D8\u66F4\u5BC6\u7801",width:640,visible:a.pwdVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){a.onCancel()},destroyOnClose:!0,children:(0,e.jsxs)(d.Z,{layout:"vertical",preserve:!1,labelCol:{span:4},onFinish:a.onFinish,children:[(0,e.jsx)(d.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(F.Z,{})}),(0,e.jsx)(d.Z.Item,{name:"account",label:"\u7528\u6237\u8D26\u6237",rules:[{required:!0}],children:(0,e.jsx)(F.Z,{placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u8D26\u6237"})}),(0,e.jsx)(d.Z.Item,{name:"oPwd",label:"\u65E7\u5BC6\u7801",rules:[{required:!0}],children:(0,e.jsx)(F.Z.Password,{placeholder:"\u8BF7\u8F93\u5165\u65E7\u5BC6\u7801"})}),(0,e.jsx)(d.Z.Item,{name:"nPwd",label:"\u65B0\u5BC6\u7801",rules:[{required:!0}],children:(0,e.jsx)(F.Z.Password,{placeholder:"\u8BF7\u8F93\u5165\u65B0\u5BC6\u7801"})}),(0,e.jsx)(d.Z.Item,{children:(0,e.jsx)(R.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})})]})})},te=ee,ne=function(a){return(0,e.jsx)(E.Z,{title:"\u89D2\u8272\u6388\u6743",width:640,visible:a.roleVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){a.onCancel()},destroyOnClose:!0,children:(0,e.jsxs)(d.Z,{layout:"vertical",preserve:!1,labelCol:{span:4},initialValues:a.values,onFinish:a.onFinish,children:[(0,e.jsx)(d.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(F.Z,{})}),(0,e.jsx)(d.Z.Item,{name:"sysUserId",hidden:!0,children:(0,e.jsx)(F.Z,{})}),(0,e.jsx)(d.Z.Item,{name:"sysRoleId",rules:[{required:!0}],label:"\u89D2\u8272\u6388\u6743",children:(0,e.jsx)(B.Z,{mode:"multiple",style:{width:"100%"},placeholder:"\u8BF7\u9009\u62E9\u89D2\u8272",children:a.selectData})}),(0,e.jsx)(d.Z.Item,{children:(0,e.jsx)(R.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})})]})})},ae=ne,Qe=s(62999),re=s(54680),ue=function(a){var o=(0,x.useState)([]),h=(0,S.Z)(o,2),r=h[0],l=h[1];return(0,x.useEffect)(function(){function b(){A.gettree().then(function(g){l(g.data)})}b()},[a.values]),(0,e.jsx)(E.Z,{width:640,bodyStyle:{padding:"32px 40px 48px"},destroyOnClose:!0,title:"\u7ED9 ".concat(a.values.name," \u6388\u6743\u6570\u636E"),visible:a.updateModalVisible,footer:null,onCancel:function(){return a.onCancel()},children:(0,e.jsxs)(d.Z,{preserve:!1,labelCol:{span:4},onFinish:a.onFinish,initialValues:a.values,children:[(0,e.jsx)(d.Z.Item,{name:"orgId",label:"\u9009\u62E9\u673A\u6784",rules:[{required:!0,message:"\u9009\u62E9\u673A\u6784"}],children:(0,e.jsx)(re.Z,{style:{width:"100%"},dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:r,multiple:!0,placeholder:"\u9009\u62E9\u673A\u6784",treeDefaultExpandAll:!0})}),(0,e.jsx)(d.Z.Item,{children:(0,e.jsx)(R.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})})]})})},se=ue;function le(n){return(0,f.WY)("/kitchen/api/user/userpage",{method:"post",data:n})}function ie(n){return(0,f.WY)("/kitchen/api/user/enable/?Id=".concat(n))}function de(n){return(0,f.WY)("/kitchen/api/user/disable/?Id=".concat(n))}function oe(n){return(0,f.WY)("/kitchen/api\u200B/user/delete",{method:"POST",data:n})}function ce(n){return(0,f.WY)("/kitchen/api\u200B/user/add",{method:"POST",data:n})}function he(n){return(0,f.WY)("/kitchen/api\u200B/user/update",{method:"POST",data:n})}function fe(n){return(0,f.WY)("/kitchen/api/user/resetuserpwd/?Id=".concat(n))}function pe(n){return(0,f.WY)("/kitchen/api/user/updatepwd",{method:"POST",data:n})}function me(){return(0,f.WY)("/kitchen/api/select/getrole")}function ve(n){return(0,f.WY)("/kitchen/api/user/getuserrole/?UserId=".concat(n))}function xe(n){return(0,f.WY)("/kitchen/api/user/adduserrole",{method:"POST",data:n})}function ye(n){return(0,f.WY)("/kitchen/api/user/updateuserrole",{method:"POST",data:n})}function Ze(n){return P.apply(this,arguments)}function P(){return P=(0,D.Z)((0,v.Z)().mark(function n(a){return(0,v.Z)().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.abrupt("return",(0,f.WY)("/kitchen/api/user/setandalteruserscope",{method:"post",data:a}));case 1:case"end":return h.stop()}},n)})),P.apply(this,arguments)}function ge(n){return(0,f.WY)("\u200B/kitchen/api\u200B/sysOrg\u200B/tree",{data:(0,O.Z)({},n)})}var y={Page:le,Enable:ie,Disable:de,RemoveUser:oe,Update:he,Add:ce,ResetPwd:fe,UpdatePwd:pe,GetRoleDic:me,GetUserRole:ve,AddUserRole:xe,UpdateUserRole:ye,SetDataRole:Ze,gettree:ge},Xe=s(62255),Ce=function(){var n=(0,D.Z)((0,v.Z)().mark(function a(o){return(0,v.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,y.Add(o).then(function(l){l.data?c.default.success("\u6DFB\u52A0\u6210\u529F"):c.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 3:return r.abrupt("return",!0);case 6:return r.prev=6,r.t0=r.catch(0),c.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),r.abrupt("return",!1);case 10:case"end":return r.stop()}},a,null,[[0,6]])}));return function(o){return n.apply(this,arguments)}}(),je=function(){var n=(0,D.Z)((0,v.Z)().mark(function a(o){var h;return(0,v.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return h=c.default.loading("\u6B63\u5728\u5206\u914D\u6570\u636E\u6743\u9650"),l.prev=1,l.next=4,y.SetDataRole((0,O.Z)({},o));case 4:return h(),c.default.success("\u5206\u914D\u6570\u636E\u6743\u9650\u6210\u529F"),l.abrupt("return",!0);case 9:return l.prev=9,l.t0=l.catch(1),h(),c.default.error("\u5206\u914D\u6570\u636E\u6743\u9650\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),l.abrupt("return",!1);case 14:case"end":return l.stop()}},a,null,[[1,9]])}));return function(o){return n.apply(this,arguments)}}(),Se=function(){var n=(0,D.Z)((0,v.Z)().mark(function a(o){return(0,v.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,y.Update(o).then(function(l){l.data?c.default.success("\u4FEE\u6539\u6210\u529F"):c.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 3:return r.abrupt("return",!0);case 6:return r.prev=6,r.t0=r.catch(0),c.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5!"),r.abrupt("return",!1);case 10:case"end":return r.stop()}},a,null,[[0,6]])}));return function(o){return n.apply(this,arguments)}}(),qe=null,_e="User",Fe=function(){var a=(0,x.useState)(),o=(0,S.Z)(a,2),h=o[0],r=o[1],l=(0,x.useState)({}),b=(0,S.Z)(l,2),g=b[0],C=b[1],Ie=(0,x.useState)(),W=(0,S.Z)(Ie,2),De=W[0],T=W[1],I=(0,x.useRef)(),Re=(0,x.useState)(),Y=(0,S.Z)(Re,2),w=Y[0],Ee=Y[1],we=(0,x.useState)(!1),G=(0,S.Z)(we,2),Ue=G[0],k=G[1],Oe=(0,x.useState)(!1),$=(0,S.Z)(Oe,2),Be=$[0],U=$[1],Pe=(0,x.useState)(),M=(0,S.Z)(Pe,2),Te=M[0],ke=M[1],Ve=(0,x.useState)(),L=(0,S.Z)(Ve,2),Ae=L[0],We=L[1],Ye=function(t){We(t),y.GetRoleDic().then(function(u){var i=[];for(var m in u.data)i.push((0,e.jsx)(Option,{value:m,children:u.data[m]}));ke(i),y.GetUserRole(t).then(function(Z){C(Z.data),U(!0)})})},Ge=function(t){var u=[];return u.push((0,e.jsx)("a",{disabled:t.adminType==2,style:{pointerEvents:t.adminType==2?"none":"auto"},onClick:function(){r(!0),C(t)},children:"\u4FEE\u6539"})),t.status==1&&u.push((0,e.jsx)("a",{disabled:t.adminType==2,style:{pointerEvents:t.adminType==2?"none":"auto"},onClick:function(){y.Enable(t.id).then(function(m){I.current.reload()})},children:"\u542F\u7528"})),t.status==0&&u.push((0,e.jsx)("a",{disabled:t.adminType==2,style:{pointerEvents:t.adminType==2?"none":"auto"},onClick:function(){y.Disable(t.id).then(function(m){I.current.reload()})},children:"\u7981\u7528"})),u.push((0,e.jsx)("a",{disabled:t.adminType==2,style:{pointerEvents:t.adminType==2?"none":"auto"},onClick:function(){y.RemoveUser([t.id]).then(function(m){m.data?c.default.success("\u5220\u9664\u6210\u529F"):c.default.error("\u5220\u9664\u5931\u8D25"),I.current.reload()})},children:"\u5220\u9664"})),u.push((0,e.jsx)("a",{onClick:function(){y.ResetPwd(t.id).then(function(m){m.data?c.default.success("\u91CD\u7F6E\u6210\u529F"):c.default.error("\u91CD\u7F6E\u5931\u8D25")})},children:"\u91CD\u7F6E\u5BC6\u7801"})),u.push((0,e.jsx)("a",{onClick:function(){k(!0)},children:"\u4FEE\u6539\u5BC6\u7801"})),u.push((0,e.jsx)("a",{disabled:t.adminType==2,style:{pointerEvents:t.adminType==2?"none":"auto"},onClick:function(){Ye(t.id)},children:"\u89D2\u8272\u6388\u6743"})),u.push((0,e.jsx)("a",{disabled:t.adminType==2,style:{pointerEvents:t.adminType==2?"none":"auto"},onClick:function(){T(!0),C(t)},children:"\u6570\u636E\u6388\u6743"})),u},$e=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"key",hideInSearch:!0,hideInTable:!0},{title:"\u7528\u6237\u59D3\u540D",dataIndex:"name"},{title:"\u767B\u5F55\u8D26\u6237",dataIndex:"account"},{title:"\u72B6\u6001",dataIndex:"status",hideInSearch:!0,valueEnum:{0:{text:"\u542F\u7528",status:"Processing"},1:{text:"\u7981\u7528",status:"Success"}}},{title:"\u662F\u5426\u5220\u9664",dataIndex:"isDeleted",hideInSearch:!0,valueEnum:{0:{text:"\u6B63\u5E38",status:"Processing"},1:{text:"\u5220\u9664",status:"Success"}}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",hideInSearch:!0,sorter:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(t,u){return Ge(u)}}];return(0,e.jsxs)(K.ZP,{children:[(0,e.jsx)(N.ZP,{headerTitle:"\u7528\u6237\u4FE1\u606F",actionRef:I,rowKey:"id",search:{labelWidth:120},toolBarRender:function(){return(0,e.jsxs)(R.Z,{type:"primary",onClick:function(){r(!0)},children:[(0,e.jsx)(H.Z,{})," \u65B0\u5EFA"]},"create")},request:function(){var p=(0,D.Z)((0,v.Z)().mark(function t(u){var i,m;return(0,v.Z)().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return i=[],m=0,j.next=4,y.Page(u).then(function(z){i=z.data.data,m=z.data.total});case 4:return j.abrupt("return",{data:i,success:!0,total:m});case 5:case"end":return j.stop()}},t)}));return function(t){return p.apply(this,arguments)}}(),columns:$e,rowSelection:{onChange:function(t,u){Ee(u)}}}),(w==null?void 0:w.length)>0&&(0,e.jsx)(J.Z,{extra:(0,e.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,e.jsx)("a",{style:{fontWeight:600},children:w.length})," ","\u9879 \xA0\xA0"]})}),(0,e.jsx)(_,{onFinish:function(){var p=(0,D.Z)((0,v.Z)().mark(function t(u){var i;return(0,v.Z)().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:if(i=!1,!u.id){Z.next=7;break}return Z.next=4,Se(u);case 4:i=Z.sent,Z.next=10;break;case 7:return Z.next=9,Ce(u);case 9:i=Z.sent;case 10:i&&(r(!1),C({}),I.current&&I.current.reload()),I.current.reload();case 12:case"end":return Z.stop()}},t)}));return function(t){return p.apply(this,arguments)}}(),onCancel:function(){r(!1),C({})},modalVisible:h,values:g||{}}),(0,e.jsx)(te,{onFinish:function(t){y.UpdatePwd(t).then(function(u){u.data?c.default.success("\u4FEE\u6539\u6210\u529F"):c.default.error("\u4FEE\u6539\u5931\u8D25"),k(!1)})},onCancel:function(){k(!1)},pwdVisible:Ue}),(0,e.jsx)(ae,{onFinish:function(t){t.id?y.UpdateUserRole(t).then(function(u){u.data?c.default.success("\u4FEE\u6539\u6210\u529F"):c.default.error("\u4FEE\u6539\u5931\u8D25"),U(!1)}):(t.sysUserId=Ae,y.AddUserRole(t).then(function(u){u.data?c.default.success("\u6DFB\u52A0\u6210\u529F"):c.default.error("\u6DFB\u52A0\u5931\u8D25"),U(!1)}))},selectData:Te,values:g,onCancel:function(){C({}),U(!1)},roleVisible:Be}),g&&Object.keys(g).length?(0,e.jsx)(se,{onFinish:function(){var p=(0,D.Z)((0,v.Z)().mark(function t(u){var i,m;return(0,v.Z)().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return i={sysUserId:g.id,sysOrgId:u.orgId},j.next=3,je(i);case 3:m=j.sent,m&&(T(!1),C({}),I.current&&I.current.reload());case 5:case"end":return j.stop()}},t)}));return function(t){return p.apply(this,arguments)}}(),onCancel:function(){T(!1),C({})},updateModalVisible:De,values:g}):null]})},be=Fe}}]);