Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

2 строки
13 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[9035],{76432:function(Ee,Y,t){"use strict";t.r(Y),t.d(Y,{default:function(){return Fe}});var Ae=t(57338),ae=t(273),Re=t(57663),z=t(71577),be=t(62350),K=t(24565),y=t(2824),d=t(39428),Me=t(34792),m=t(48086),j=t(3182),ne=t(49101),v=t(67294),te=t(78009),re=t(85224),ue=t(16894),le=t(12826),Be=t(71194),L=t(50146),Te=t(77883),se=t(85986),$e=t(9715),Z=t(55843),Pe=t(47673),S=t(4107),ke=t(43358),U=t(34041),a=t(85893),ie=function(n){var o=U.Z.Option,g=U.Z.OptGroup;return(0,a.jsx)(L.Z,{title:n.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:n.modalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){n.onCancel()},destroyOnClose:!0,maskClosable:!1,children:(0,a.jsxs)(Z.Z,{layout:"horizontal",labelCol:{span:4},preserve:!1,initialValues:n.values,onFinish:n.onFinish,children:[(0,a.jsx)(Z.Z.Item,{name:"id",hidden:!0,children:(0,a.jsx)(S.Z,{})}),(0,a.jsx)(Z.Z.Item,{name:"name",label:"\u4F01\u4E1A\u540D\u79F0",rules:[{required:!0,max:30}],children:(0,a.jsx)(S.Z,{placeholder:"\u8BF7\u8F93\u5165\u4F01\u4E1A\u540D\u79F0"})}),(0,a.jsx)(Z.Z.Item,{name:"code",label:"\u4F01\u4E1A\u7F16\u7801",rules:[{required:!0,max:30}],children:(0,a.jsx)(S.Z,{placeholder:"\u8BF7\u8F93\u5165\u4F01\u4E1A\u7F16\u7801"})}),(0,a.jsx)(Z.Z.Item,{name:"adminName",label:"\u7BA1\u7406\u5458\u59D3\u540D",rules:[{required:!0,max:20}],children:(0,a.jsx)(S.Z,{placeholder:"\u8BF7\u8F93\u5165\u7BA1\u7406\u5458\u59D3\u540D"})}),(0,a.jsx)(Z.Z.Item,{name:"settlementCycles",label:"\u7ED3\u7B97\u5468\u671F",rules:[{required:!0}],children:(0,a.jsx)(se.Z,{step:1,min:1,max:100,precision:0})}),(0,a.jsx)(Z.Z.Item,{name:"email",label:"\u7535\u5B50\u90AE\u4EF6",rules:[{required:!0,max:50,message:"\u8BF7\u8F93\u5165\u7535\u5B50\u90AE\u4EF6"},{pattern:/^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/,message:"\u90AE\u7BB1\u683C\u5F0F\u4E0D\u6B63\u786E"}],children:(0,a.jsx)(S.Z,{placeholder:"\u7535\u5B50\u90AE\u4EF6\u662F\u767B\u5F55\u8D26\u6237",disabled:!!n.values.id})}),(0,a.jsx)(Z.Z.Item,{name:"phone",label:"\u7535\u8BDD",rules:[{max:20,pattern:/0?(13|14|15|18|17)[0-9]{9}$/,message:"\u624B\u673A\u53F7\u683C\u5F0F\u4E0D\u6B63\u786E"}],children:(0,a.jsx)(S.Z,{placeholder:"\u8BF7\u8F93\u5165\u7535\u8BDD"})}),(0,a.jsx)(Z.Z.Item,{name:"host",label:"\u57DF\u540D",rules:[{max:100}],children:(0,a.jsx)(S.Z,{placeholder:"\u8BF7\u8F93\u5165\u57DF\u540D"})}),(0,a.jsx)(Z.Z.Item,{name:"wechatAppId",label:"\u5C0F\u7A0B\u5E8Fid",rules:[{max:100}],children:(0,a.jsx)(S.Z,{placeholder:"\u5C0F\u7A0B\u5E8Fid"})}),(0,a.jsx)(Z.Z.Item,{name:"remark",label:"\u5907\u6CE8",rules:[{max:100}],children:(0,a.jsx)(S.Z,{placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"})}),(0,a.jsx)(Z.Z.Item,{children:(0,a.jsx)(z.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},de=ie,Ge=t(13062),oe=t(71230),Oe=t(89032),N=t(15746),Ve=t(32157),ce=t(7573),We=t(71153),me=t(60331),x=t(48971),C={companyPage:function(n){return(0,x.WY)("/kitchen/api/company/companypage",{method:"POST",data:n})},addCompany:function(n){return(0,x.WY)("/kitchen/api/company/add",{method:"POST",data:n})},updateCompany:function(n){return(0,x.WY)("/kitchen/api/company/update",{method:"PUT",data:n})},removeCompany:function(n){return(0,x.WY)("/kitchen/api/company/delete",{method:"DELETE",data:n})},Enable:function(n){return(0,x.WY)("/kitchen/api/company/enable/?Id=".concat(n),{method:"Get"})},Disable:function(n){return(0,x.WY)("/kitchen/api/company/disable/?Id=".concat(n),{method:"Get"})},addRoleMenu:function(n){return(0,x.WY)("/kitchen/api/role/addorupdatemenurole",{method:"POST",data:n})},GetMenu:function(n){return(0,x.WY)("\u200B/kitchen/api/select/menutree/?GetType=".concat(n))},GetRoleMenu:function(n){return(0,x.WY)("/kitchen/api/role/getmenurole/?RoleId=".concat(n))},menutreepage:function(n){return(0,x.WY)("/kitchen/api\u200B/menu/getmenutreepage",{method:"post",data:n})}},W=t(62255),fe=function(n){var o=(0,v.useState)(),g=(0,y.Z)(o,2),e=g[0],f=g[1],T=(0,v.useState)(),$=(0,y.Z)(T,2),P=$[0],H=$[1],k=(0,v.useState)(),A=(0,y.Z)(k,2),D=A[0],G=A[1];(0,v.useEffect)((0,j.Z)((0,d.Z)().mark(function E(){var s,R,M;return(0,d.Z)().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return s=[],W.Z.from(n.values).forEach(function(V){V.isParentMenu||s.push(V.id)}),G(s),I.next=5,C.GetMenu("ALL");case 5:R=I.sent,M=W.Z.from(R.data).toArray(),f(M);case 8:case"end":return I.stop()}},E)})),[n.modalVisible]);var O=function(){var s=[];return W.Z.from(n.values).forEach(function(R){s.push((0,a.jsx)(me.Z,{style:{width:100,margin:"Center"},color:"processing",children:R.name}))}),s},w=(0,a.jsx)(L.Z,{width:700,bodyStyle:{padding:"32px 40px 48px"},destroyOnClose:!0,title:"\u83DC\u5355\u5206\u914D",visible:n.modalVisible,onOk:function(){return n.onSubmit(D)},onCancel:function(){return n.onCancel()},maskClosable:!1,children:(0,a.jsxs)(oe.Z,{children:[(0,a.jsx)(N.Z,{span:8,children:(0,a.jsx)(ce.Z,{treeData:e,onCheck:function(s,R){G(s)},defaultExpandAll:!0,checkedKeys:D,checkable:!0})}),(0,a.jsxs)(N.Z,{span:16,children:[(0,a.jsx)("div",{children:"\u5DF2\u9009\u83DC\u5355"}),n.values==null?"":O()]})]})});return w},he=fe,ve=function(){var l=(0,j.Z)((0,d.Z)().mark(function n(o){return(0,d.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,C.addCompany(o).then(function(f){if(!f.succeeded)return m.default.error(f.errors),!1;f.data?m.default.success("\u6DFB\u52A0\u6210\u529F"):m.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 3:return e.abrupt("return",!0);case 6:return e.prev=6,e.t0=e.catch(0),m.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 10:case"end":return e.stop()}},n,null,[[0,6]])}));return function(o){return l.apply(this,arguments)}}(),pe=function(){var l=(0,j.Z)((0,d.Z)().mark(function n(o){return(0,d.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,C.updateCompany(o).then(function(f){if(!f.succeeded)return m.default.error(f.errors),!1;f.data?m.default.success("\u914D\u7F6E\u6210\u529F"):m.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 3:return e.abrupt("return",!0);case 6:return e.prev=6,e.t0=e.catch(0),m.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 10:case"end":return e.stop()}},n,null,[[0,6]])}));return function(o){return l.apply(this,arguments)}}(),Ze=function(){var l=(0,j.Z)((0,d.Z)().mark(function n(o){return(0,d.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o){e.next=2;break}return e.abrupt("return",!0);case 2:return e.prev=2,e.next=5,C.removeCompany(o.map(function(f){return f.id})).then(function(f){if(f)return m.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),!0;m.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")});case 5:return e.abrupt("return",!0);case 8:return e.prev=8,e.t0=e.catch(2),m.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5"),e.abrupt("return",!1);case 12:case"end":return e.stop()}},n,null,[[2,8]])}));return function(o){return l.apply(this,arguments)}}(),ye=function(){var l=(0,j.Z)((0,d.Z)().mark(function n(o){return(0,d.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,C.addRoleMenu(o).then(function(f){f.data?m.default.success("\u6388\u6743\u6210\u529F"):m.default.error("\u6388\u6743\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 3:return e.abrupt("return",!0);case 6:return e.prev=6,e.t0=e.catch(0),m.default.error("\u6388\u6743\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 10:case"end":return e.stop()}},n,null,[[0,6]])}));return function(o){return l.apply(this,arguments)}}(),Ce=function(){var n=(0,v.useState)(),o=(0,y.Z)(n,2),g=o[0],e=o[1],f=(0,v.useState)(),T=(0,y.Z)(f,2),$=T[0],P=T[1],H=(0,v.useState)({}),k=(0,y.Z)(H,2),A=k[0],D=k[1],G=(0,v.useState)(),O=(0,y.Z)(G,2),w=O[0],E=O[1],s=(0,v.useRef)(),R=(0,v.useState)(),M=(0,y.Z)(R,2),F=M[0],I=M[1],V=(0,v.useState)(),J=(0,y.Z)(V,2),B=J[0],Q=J[1],xe=(0,v.useState)(),X=(0,y.Z)(xe,2),je=X[0],Se=X[1],ge=(0,v.useState)(),q=(0,y.Z)(ge,2),Ie=q[0],De=q[1];(0,v.useEffect)(function(){C.GetMenu().then(function(c){Se(c.data.data)})},[]);var _=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"key",hideInSearch:!0,hideInTable:!0,render:function(i,r){return(0,a.jsx)("a",{onClick:function(){I(r),E(!0)},children:i})}},{title:"\u4F01\u4E1A\u540D\u79F0",dataIndex:"name"},{title:"\u7BA1\u7406\u5458\u59D3\u540D",dataIndex:"adminName"},{title:"\u7535\u5B50\u90AE\u4EF6",dataIndex:"email"},{title:"\u7ED3\u7B97\u5468\u671F",dataIndex:"settlementCycles",hideInSearch:!0},{title:"\u7535\u8BDD",dataIndex:"phone"},{title:"\u5C0F\u7A0B\u5E8Fid",dataIndex:"wechatAppId",hideInSearch:!0},{title:"\u5907\u6CE8",dataIndex:"remark",hideInSearch:!0},{title:"\u72B6\u6001",dataIndex:"status",hideInForm:!0,valueEnum:{0:{text:"\u542F\u7528",status:"Processing"},1:{text:"\u7981\u7528",status:"Success"}}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",valueType:"date",hideInForm:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(i,r){var p=[(0,a.jsxs)("a",{onClick:function(){e(!0),D(r)},children:[" ","\u66F4\u65B0"]}),(0,a.jsxs)("a",{onClick:function(){C.GetRoleMenu(r.sysRoleId).then(function(b){De(b.data),P(!0)}),D(r)},children:[" ","\u4F01\u4E1A\u83DC\u5355\u6388\u6743"]}),(0,a.jsx)(K.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){C.removeCompany([r.id]).then(function(b){m.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),s.current.reload()})},onCancel:function(){},children:(0,a.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")];return p.push((0,a.jsxs)("a",{onClick:function(){r.status==1?C.Enable(r.id).then(function(b){m.default.success("\u542F\u7528\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),s.current.reload()}):C.Disable(r.id).then(function(b){m.default.success("\u7981\u7528\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),s.current.reload()})},children:[" ",r.status==0?"\u7981\u7528":"\u542F\u7528"]},"primary")),p}}];return(0,a.jsxs)(te.ZP,{children:[(0,a.jsx)(ue.ZP,{headerTitle:"\u4F01\u4E1A\u4FE1\u606F\u5217\u8868",actionRef:s,rowKey:"id",search:{labelWidth:120},toolBarRender:function(){return[(0,a.jsxs)(z.Z,{type:"primary",onClick:function(){e(!0)},children:[(0,a.jsx)(ne.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var c=(0,j.Z)((0,d.Z)().mark(function i(r){var p,h;return(0,d.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return p=[],h=0,u.next=4,C.companyPage(r).then(function(ee){p=ee.data.data,h=ee.data.total});case 4:return u.abrupt("return",{data:p,success:!0,total:h});case 5:case"end":return u.stop()}},i)}));return function(i){return c.apply(this,arguments)}}(),columns:_,rowSelection:{onChange:function(i,r){Q(r)}}}),(B==null?void 0:B.length)>0&&(0,a.jsx)(re.Z,{extra:(0,a.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,a.jsx)("a",{style:{fontWeight:600},children:B.length})," ","\u9879 \xA0\xA0"]}),children:(0,a.jsx)(K.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){var i,r;Ze(B),Q([]),(i=s.current)===null||i===void 0||(r=i.reloadAndRest)===null||r===void 0||r.call(i)},onCancel:function(){},children:(0,a.jsx)("a",{href:"#",children:"\u6279\u91CF\u5220\u9664"})},"primary")}),(0,a.jsx)(de,{onFinish:function(){var c=(0,j.Z)((0,d.Z)().mark(function i(r){var p,h;return(0,d.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(h=!1,!r.id){u.next=7;break}return u.next=4,pe(r);case 4:h=u.sent,u.next=10;break;case 7:return u.next=9,ve(r);case 9:h=u.sent;case 10:h&&(e(!1),I(void 0),s.current&&s.current.reload()),(p=s.current)===null||p===void 0||p.reload();case 12:case"end":return u.stop()}},i)}));return function(i){return c.apply(this,arguments)}}(),onCancel:function(){e(!1),D({})},modalVisible:g,values:A||{}}),A&&Object.keys(A).length?(0,a.jsx)(he,{treeData:je,onSubmit:function(){var c=(0,j.Z)((0,d.Z)().mark(function i(r){var p,h;return(0,d.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return p={sysRoleId:A.sysRoleId,sysMenuId:r},u.next=3,ye(p);case 3:h=u.sent,h&&(P(!1),D({}),s.current&&s.current.reload());case 5:case"end":return u.stop()}},i)}));return function(i){return c.apply(this,arguments)}}(),onCancel:function(){P(!1),D({})},modalVisible:$,values:Ie||{}}):null,(0,a.jsx)(ae.Z,{width:600,visible:w,onClose:function(){I(void 0),E(!1)},closable:!1,children:(F==null?void 0:F.name)&&(0,a.jsx)(le.ZP,{column:2,title:F==null?void 0:F.name,request:(0,j.Z)((0,d.Z)().mark(function c(){return(0,d.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",{data:F||{}});case 1:case"end":return r.stop()}},c)})),params:{id:F==null?void 0:F.name},columns:_})})]})},Fe=Ce}}]);