Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 

2 rindas
16 KiB

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