Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

2 righe
15 KiB

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