|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[560],{83341:function(he,$,n){"use strict";n.d($,{O:function(){return ue}});function ue(x){x=x||32;for(var G="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz",U=G.length,v="012345678",u=v.length,j="",z=0;z<x;z++)j+=G.charAt(Math.floor(Math.random()*U));for(var h=0;h<x;h++)j+=v.charAt(Math.floor(Math.random()*u));return j.toUpperCase()}},92363:function(he,$,n){"use strict";n.r($),n.d($,{default:function(){return Le}});var ue=n(57663),x=n(71577),G=n(62350),U=n(24565),v=n(2824),u=n(39428),j=n(11849),z=n(34792),h=n(48086),p=n(3182),Z=n(67294),fe=n(49101),pe=n(28790),me=n(16894),K=n(62255),aa=n(71194),L=n(50146),ra=n(77883),ve=n(85986),ta=n(13062),H=n(71230),na=n(89032),V=n(15746),ua=n(9715),F=n(55843),sa=n(47673),k=n(4107),a=n(85893),Ze=function(r){return(0,a.jsx)(L.Z,{title:r.values.id?"\u7F16\u8F91\u89D2\u8272":"\u65B0\u5EFA\u89D2\u8272",width:1e3,visible:r.modalVisible,bodyStyle:{padding:"32px 40px 1px 48px"},footer:null,onCancel:function(){r.onCancel()},destroyOnClose:!0,children:(0,a.jsxs)(F.Z,{layout:"horizontal",preserve:!1,labelCol:{span:4},initialValues:r.values,onFinish:r.onFinish,children:[(0,a.jsx)(F.Z.Item,{name:"id",hidden:!0,children:(0,a.jsx)(k.Z,{})}),(0,a.jsxs)(H.Z,{children:[(0,a.jsx)(V.Z,{span:12,children:(0,a.jsx)(F.Z.Item,{name:"code",label:"\u89D2\u8272\u7F16\u7801",rules:[{required:!0,max:20}],children:(0,a.jsx)(k.Z,{disabled:!!r.values.id,placeholder:"\u8BF7\u8F93\u5165\u89D2\u8272\u7F16\u7801"})})}),(0,a.jsx)(V.Z,{span:12,children:(0,a.jsx)(F.Z.Item,{name:"name",label:"\u89D2\u8272\u540D\u79F0",rules:[{required:!0,max:64}],children:(0,a.jsx)(k.Z,{placeholder:"\u8BF7\u8F93\u5165\u89D2\u8272\u540D\u79F0"})})})]}),(0,a.jsxs)(H.Z,{children:[(0,a.jsx)(V.Z,{span:12,children:(0,a.jsx)(F.Z.Item,{name:"remark",label:"\u5907\u6CE8",rules:[{max:500}],children:(0,a.jsx)(k.Z.TextArea,{placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"})})}),(0,a.jsx)(V.Z,{span:12,children:(0,a.jsx)(F.Z.Item,{name:"sort",label:"\u6392\u5E8F",children:(0,a.jsx)(ve.Z,{min:1,decimalSeparator:"0"})})})]}),(0,a.jsxs)(F.Z.Item,{children:[(0,a.jsx)(x.Z,{htmlType:"button",style:{float:"right",left:10},onClick:r.onCancel,children:"\u53D6\u6D88"}),(0,a.jsx)(x.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})]})]})})},ge=Ze,b=n(48971);function ye(t){return J.apply(this,arguments)}function J(){return J=(0,p.Z)((0,u.Z)().mark(function t(r){return(0,u.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/saasbase/api/roles/page",{method:"post",data:(0,j.Z)({},r)}));case 1:case"end":return e.stop()}},t)})),J.apply(this,arguments)}function Se(t){return N.apply(this,arguments)}function N(){return N=(0,p.Z)((0,u.Z)().mark(function t(r){return(0,u.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/saasbase/api/roles/enable/?Id=".concat(r)));case 1:case"end":return e.stop()}},t)})),N.apply(this,arguments)}function Ce(t){return Q.apply(this,arguments)}function Q(){return Q=(0,p.Z)((0,u.Z)().mark(function t(r){return(0,u.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/saasbase/api/roles/disable/?Id=".concat(r)));case 1:case"end":return e.stop()}},t)})),Q.apply(this,arguments)}function be(t){return X.apply(this,arguments)}function X(){return X=(0,p.Z)((0,u.Z)().mark(function t(r){return(0,u.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/saasbase/api/roles/add",{method:"POST",data:(0,j.Z)({},r)}));case 1:case"end":return e.stop()}},t)})),X.apply(this,arguments)}function je(t){return q.apply(this,arguments)}function q(){return q=(0,p.Z)((0,u.Z)().mark(function t(r){return(0,u.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/saasbase/api\u200B/roles/update",{method:"POST",data:(0,j.Z)({},r)}));case 1:case"end":return e.stop()}},t)})),q.apply(this,arguments)}function Ee(t){return _.apply(this,arguments)}function _(){return _=(0,p.Z)((0,u.Z)().mark(function t(r){return(0,u.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/saasbase/api\u200B/roles/delete",{method:"POST",data:r}));case 1:case"end":return e.stop()}},t)})),_.apply(this,arguments)}function Fe(t){return ee.apply(this,arguments)}function ee(){return ee=(0,p.Z)((0,u.Z)().mark(function t(r){return(0,u.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("\u200B/kitchen/api/roles/addorupdatemenurole",{method:"post",data:r}));case 1:case"end":return e.stop()}},t)})),ee.apply(this,arguments)}function we(t){return ae.apply(this,arguments)}function ae(){return ae=(0,p.Z)((0,u.Z)().mark(function t(r){return(0,u.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/saasbase/api/roles/getmenurole/?RoleId=".concat(r)));case 1:case"end":return e.stop()}},t)})),ae.apply(this,arguments)}function xe(t){return re.apply(this,arguments)}function re(){return re=(0,p.Z)((0,u.Z)().mark(function t(r){return(0,u.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,b.WY)("/saasbase/api/roles/setandalterdatascope",{method:"post",data:r}));case 1:case"end":return e.stop()}},t)})),re.apply(this,arguments)}var la=n(32157),De=n(7573),ia=n(71153),Oe=n(60331);function Ie(t){return(0,b.WY)("/saasbase/api\u200B/menu/getmenutreepage",{method:"post",data:t})}function Me(){return(0,b.WY)("\u200B/saasbase/api/menu/menutrees/?getType=user")}function Te(t){return(0,b.WY)("/saasbase/api/menu/getorglist")}function Re(t){return(0,b.WY)("\u200B/saasbase/api\u200B/organize/tree",{data:(0,j.Z)({},t)})}var se={menutreepage:Ie,SelectTree:Me,GetOrg:Te,gettree:Re},Ae=function(r){var i=(0,Z.useState)(),e=(0,v.Z)(i,2),C=e[0],s=e[1],m=(0,Z.useState)(),w=(0,v.Z)(m,2),A=w[0],W=w[1],B=(0,Z.useState)(),M=(0,v.Z)(B,2),D=M[0],Y=M[1];(0,Z.useEffect)((0,p.Z)((0,u.Z)().mark(function E(){var O,T,P;return(0,u.Z)().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return O=[],K.Z.from(r.values).forEach(function(ne){O.push(ne.id)}),Y(O),g.next=5,se.SelectTree();case 5:T=g.sent,P=K.Z.from(T.data).toArray(),s(P);case 8:case"end":return g.stop()}},E)})),[r.modalVisible]);var te=function(){var O=[];return K.Z.from(r.values).forEach(function(T){O.push((0,a.jsx)(Oe.Z,{style:{width:68,margin:"Center"},color:"processing",children:T.name}))}),O},I=(0,a.jsx)(L.Z,{width:700,bodyStyle:{padding:"32px 40px 48px"},destroyOnClose:!0,title:"\u83DC\u5355\u5206\u914D",okText:"\u4FDD\u5B58",cancelText:"\u53D6\u6D88",visible:r.modalVisible,onOk:function(){return r.onSubmit(D)},onCancel:function(){return r.onCancel()},maskClosable:!1,children:(0,a.jsx)(H.Z,{children:(0,a.jsx)(V.Z,{span:12,children:(0,a.jsx)(De.Z,{treeData:C,onCheck:function(O,T){Y(O)},defaultExpandAll:!0,checkedKeys:D,checkable:!0})})})});return I},Be=Ae,oa=n(62999),Ve=n(54680),ca=n(43358),R=n(34041),$e=function(r){var i=(0,Z.useState)([]),e=(0,v.Z)(i,2),C=e[0],s=e[1],m=(0,Z.useState)(0),w=(0,v.Z)(m,2),A=w[0],W=w[1];(0,Z.useEffect)(function(){function M(){se.gettree().then(function(D){s(D.data)})}M()},[r.values]);var B=function(D){W(D),console.log(D)};return(0,a.jsx)(L.Z,{width:640,bodyStyle:{padding:"32px 40px 1px 48px"},destroyOnClose:!0,title:"\u7ED9 ".concat(r.values.name," \u6388\u6743\u6570\u636E"),visible:r.updateModalVisible,footer:null,onCancel:function(){return r.onCancel()},children:(0,a.jsxs)(F.Z,{preserve:!1,layout:"horizontal",labelCol:{span:4},onFinish:r.onFinish,initialValues:r.values,children:[(0,a.jsx)(F.Z.Item,{name:"dataScopeType",label:"\u6388\u6743\u8303\u56F4",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u6388\u6743\u8303\u56F4"}],children:(0,a.jsxs)(R.Z,{allowClear:!0,placeholder:"\u8BF7\u9009\u62E9\u6388\u6743\u8303\u56F4",onChange:B,children:[(0,a.jsx)(R.Z.Option,{value:1,children:"\u5168\u90E8\u6570\u636E"}),(0,a.jsx)(R.Z.Option,{value:2,children:"\u672C\u90E8\u95E8\u53CA\u4EE5\u4E0B\u6570\u636E"}),(0,a.jsx)(R.Z.Option,{value:3,children:"\u672C\u90E8\u95E8\u6570\u636E"}),(0,a.jsx)(R.Z.Option,{value:4,children:"\u4EC5\u672C\u4EBA\u6570\u636E"}),(0,a.jsx)(R.Z.Option,{value:5,children:"\u81EA\u5B9A\u4E49\u6570\u636E"})]})}),A!=5?null:(0,a.jsx)(F.Z.Item,{name:"sysOrgId",label:"\u9009\u62E9\u673A\u6784",rules:[{required:!0,message:"\u9009\u62E9\u673A\u6784"}],children:(0,a.jsx)(Ve.Z,{style:{width:"100%"},dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:C,multiple:!0,placeholder:"\u9009\u62E9\u673A\u6784",treeDefaultExpandAll:!0})}),(0,a.jsxs)(F.Z.Item,{children:[(0,a.jsx)(x.Z,{htmlType:"button",style:{float:"right",left:10},onClick:r.onCancel,children:"\u53D6\u6D88"}),(0,a.jsx)(x.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})]})]})})},ke=$e,We=n(83341),Ye=function(){var t=(0,p.Z)((0,u.Z)().mark(function r(i){var e,C;return(0,u.Z)().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return e=h.default.loading("\u6B63\u5728\u6DFB\u52A0"),m.prev=1,C=be((0,j.Z)({},i)).then(function(w){return w.data?h.default.success("\u6DFB\u52A0\u6210\u529F"):h.default.error("\u6DFB\u52A0\u5931\u8D25,"+w.errors),w.data}),e(),m.abrupt("return",C);case 7:return m.prev=7,m.t0=m.catch(1),console.log(m.t0),e(),h.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),m.abrupt("return",!1);case 13:case"end":return m.stop()}},r,null,[[1,7]])}));return function(i){return t.apply(this,arguments)}}(),Pe=function(){var t=(0,p.Z)((0,u.Z)().mark(function r(i){var e;return(0,u.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return e=h.default.loading("\u6B63\u5728\u66F4\u65B0"),s.prev=1,s.next=4,je((0,j.Z)({},i));case 4:return e(),h.default.success("\u66F4\u65B0\u6210\u529F"),s.abrupt("return",!0);case 9:return s.prev=9,s.t0=s.catch(1),e(),h.default.error("\u66F4\u65B0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),s.abrupt("return",!1);case 14:case"end":return s.stop()}},r,null,[[1,9]])}));return function(i){return t.apply(this,arguments)}}(),Ge=function(r){},Ue=function(){var t=(0,p.Z)((0,u.Z)().mark(function r(i){var e;return(0,u.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return e=h.default.loading("\u6B63\u5728\u5206\u914D\u83DC\u5355"),s.prev=1,s.next=4,Fe((0,j.Z)({},i));case 4:return e(),h.default.success("\u5206\u914D\u83DC\u5355\u6210\u529F"),s.abrupt("return",!0);case 9:return s.prev=9,s.t0=s.catch(1),e(),h.default.error("\u5206\u914D\u83DC\u5355\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),s.abrupt("return",!1);case 14:case"end":return s.stop()}},r,null,[[1,9]])}));return function(i){return t.apply(this,arguments)}}(),ze=function(){var t=(0,p.Z)((0,u.Z)().mark(function r(i){var e;return(0,u.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return e=h.default.loading("\u6B63\u5728\u5206\u914D\u6570\u636E\u6743\u9650"),s.prev=1,s.next=4,xe((0,j.Z)({},i));case 4:return e(),h.default.success("\u5206\u914D\u6570\u636E\u6743\u9650\u6210\u529F"),s.abrupt("return",!0);case 9:return s.prev=9,s.t0=s.catch(1),e(),h.default.error("\u5206\u914D\u6570\u636E\u6743\u9650\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),s.abrupt("return",!1);case 14:case"end":return s.stop()}},r,null,[[1,9]])}));return function(i){return t.apply(this,arguments)}}(),da="Role",Ke=function(){var r=(0,Z.useState)(),i=(0,v.Z)(r,2),e=i[0],C=i[1],s=(0,Z.useState)(),m=(0,v.Z)(s,2),w=m[0],A=m[1],W=(0,Z.useState)(),B=(0,v.Z)(W,2),M=B[0],D=B[1],Y=(0,Z.useState)({}),te=(0,v.Z)(Y,2),I=te[0],E=te[1],O=(0,Z.useState)({}),T=(0,v.Z)(O,2),P=T[0],le=T[1],g=(0,Z.useRef)(),ne=(0,Z.useState)(),ie=(0,v.Z)(ne,2),He=ie[0],Je=ie[1],Ne=(0,Z.useState)(),oe=(0,v.Z)(Ne,2),ha=oe[0],Qe=oe[1],Xe=(0,Z.useState)([]),ce=(0,v.Z)(Xe,2),fa=ce[0],pa=ce[1],qe=function(){var y=(0,p.Z)((0,u.Z)().mark(function l(o){var d;return(0,u.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(d=h.default.loading("\u6B63\u5728\u5220\u9664"),o){c.next=3;break}return c.abrupt("return",!0);case 3:return c.prev=3,c.next=6,Ee([o.id]).then(function(f){f.succeeded?(h.default.success("\u5220\u9664\u6210\u529F"),g.current.reload()):h.default.error(f.data)});case 6:return d(),c.abrupt("return",!0);case 10:return c.prev=10,c.t0=c.catch(3),d(),h.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),c.abrupt("return",!1);case 15:case"end":return c.stop()}},l,null,[[3,10]])}));return function(o){return y.apply(this,arguments)}}(),_e=function(l){var o=[];return o.push((0,a.jsx)("a",{disabled:l.code=="sys_manager_role",style:{pointerEvents:l.code=="sys_manager_role"?"none":"auto"},onClick:function(){C(!0),le(l)},children:"\u66F4\u65B0"})),l.status==1&&o.push((0,a.jsx)("a",{disabled:l.code=="sys_manager_role",style:{pointerEvents:l.code=="sys_manager_role"?"none":"auto"},onClick:function(){Se(l.id).then(function(S){g.current.reload()})},children:"\u542F\u7528"})),l.status==0&&o.push((0,a.jsx)("a",{disabled:l.code=="sys_manager_role",style:{pointerEvents:l.code=="sys_manager_role"?"none":"auto"},onClick:function(){Ce(l.id).then(function(S){g.current.reload()})},children:"\u7981\u7528"})),o.push((0,a.jsx)(U.Z,{title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",onConfirm:function(){qe(l)},onCancel:Ge,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",children:(0,a.jsx)("a",{disabled:l.code=="sys_manager_role",style:{pointerEvents:l.code=="sys_manager_role"?"none":"auto"},children:"\u5220\u9664"})})),o.push((0,a.jsx)("a",{disabled:l.code=="sys_manager_role",style:{pointerEvents:l.code=="sys_manager_role"?"none":"auto"},onClick:function(){we(l.id).then(function(S){Je(S.data),A(!0)}),E(l)},children:"\u6388\u6743\u83DC\u5355"})),o},ea=[{title:"id",dataIndex:"id",hideInTable:!0,hideInSearch:!0},{title:"\u89D2\u8272\u7F16\u7801",dataIndex:"code"},{title:"\u89D2\u8272\u540D\u79F0",dataIndex:"name"},{title:"\u5907\u6CE8",dataIndex:"remark",hideInSearch:!0},{title:"\u72B6\u6001",dataIndex:"status",hideInSearch:!0,valueEnum:{0:{text:"\u542F\u7528",status:"Success"},1:{text:"\u7981\u7528",status:"Warning"}}},{title:"\u521B\u5EFA\u65F6\u95F4",search:!1,dataIndex:"createAt",sorter:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",fixed:"right",width:350,render:function(l,o){return _e(o)}}];return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(pe.ZP,{host:!0,header:{title:"",breadcrumb:{}},children:[(0,a.jsx)(me.ZP,{headerTitle:"\u89D2\u8272\u5217\u8868",actionRef:g,rowKey:"id",pagination:{defaultPageSize:10},search:{labelWidth:120},toolBarRender:function(){return(0,a.jsxs)(x.Z,{type:"primary",onClick:function(){var o={code:(0,We.O)(4)};C(!0)},children:[(0,a.jsx)(fe.Z,{})," \u65B0\u5EFA"]},"create")},request:function(){var y=(0,p.Z)((0,u.Z)().mark(function l(o){var d,S;return(0,u.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return d=[],S=0,f.next=4,ye(o).then(function(de){d=de.data.data,S=de.data.total});case 4:return f.abrupt("return",{data:d,success:!0,total:S});case 5:case"end":return f.stop()}},l)}));return function(l){return y.apply(this,arguments)}}(),columns:ea,rowSelection:{onChange:function(l,o){return Qe(o)}}}),(0,a.jsx)(ge,{onFinish:function(){var y=(0,p.Z)((0,u.Z)().mark(function l(o){var d;return(0,u.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(d=!1,!o.id){c.next=7;break}return c.next=4,Pe(o);case 4:d=c.sent,c.next=10;break;case 7:return c.next=9,Ye(o);case 9:d=c.sent;case 10:console.log("success"),console.log(d),d&&(C(!1),g.current&&g.current.reload());case 13:case"end":return c.stop()}},l)}));return function(l){return y.apply(this,arguments)}}(),onCancel:function(){C(!1),E({})},modalVisible:e,values:P||{}}),I&&Object.keys(I).length?(0,a.jsx)(Be,{onSubmit:function(){var y=(0,p.Z)((0,u.Z)().mark(function l(o){var d,S;return(0,u.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return d={sysRoleId:I.id,sysMenuId:o},f.next=3,Ue(d);case 3:S=f.sent,S&&(A(!1),E({}),g.current&&g.current.reload());case 5:case"end":return f.stop()}},l)}));return function(l){return y.apply(this,arguments)}}(),onCancel:function(){A(!1),E({})},modalVisible:w,values:He||{}}):null,I&&Object.keys(I).length?(0,a.jsx)(ke,{onFinish:function(){var y=(0,p.Z)((0,u.Z)().mark(function l(o){var d,S;return(0,u.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return d={sysRoleId:I.id,dataScopeType:o.dataScopeType,sysOrgId:o.sysOrgId},f.next=3,ze(d);case 3:S=f.sent,S&&(D(!1),E({}),g.current&&g.current.reload());case 5:case"end":return f.stop()}},l)}));return function(l){return y.apply(this,arguments)}}(),onCancel:function(){D(!1),E({})},updateModalVisible:M,values:I}):null]})})},Le=Ke}}]);
|