Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

p__sys__company.fe8172e2.async.js 13 KiB

před 1 rokem
1
  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[9035],{76432:function(Ee,z,t){"use strict";t.r(z),t.d(z,{default:function(){return Fe}});var Ae=t(57338),ae=t(273),be=t(57663),W=t(71577),Re=t(62350),K=t(24565),Z=t(2824),o=t(39428),Me=t(34792),f=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),y=t(55843),ke=t(47673),S=t(4107),Pe=t(43358),U=t(34041),a=t(85893),ie=function(n){var d=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 1px 48px"},footer:null,onCancel:function(){n.onCancel()},destroyOnClose:!0,maskClosable:!1,children:(0,a.jsxs)(y.Z,{layout:"horizontal",labelCol:{span:4},preserve:!1,initialValues:n.values,onFinish:n.onFinish,children:[(0,a.jsx)(y.Z.Item,{name:"id",hidden:!0,children:(0,a.jsx)(S.Z,{})}),(0,a.jsx)(y.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)(y.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)(y.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)(y.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)(y.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)(y.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)(y.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)(y.Z.Item,{name:"wechatAppId",label:"\u5C0F\u7A0B\u5E8Fid",rules:[{max:100}],children:(0,a.jsx)(S.Z,{placeholder:"\u5C0F\u7A0B\u5E8Fid"})}),(0,a.jsx)(y.Z.Item,{name:"remark",label:"\u5907\u6CE8",rules:[{max:100}],children:(0,a.jsx)(S.Z,{placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"})}),(0,a.jsxs)(y.Z.Item,{children:[(0,a.jsx)(W.Z,{htmlType:"button",style:{float:"right",left:10},onClick:n.onCancel,children:"\u53D6\u6D88"}),(0,a.jsx)(W.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})]})]})})},oe=ie,Ge=t(13062),de=t(71230),Oe=t(89032),N=t(15746),Ve=t(32157),ce=t(7573),We=t(71153),fe=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),me=function(n){var d=(0,v.useState)(),g=(0,Z.Z)(d,2),e=g[0],m=g[1],T=(0,v.useState)(),$=(0,Z.Z)(T,2),k=$[0],H=$[1],P=(0,v.useState)(),A=(0,Z.Z)(P,2),D=A[0],G=A[1];(0,v.useEffect)((0,j.Z)((0,o.Z)().mark(function E(){var s,b,M;return(0,o.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:b=I.sent,M=w.Z.from(b.data).toArray(),m(M);case 8:case"end":return I.stop()}},E)})),[n.modalVisible]);var O=function(){var s=[];return w.Z.from(n.values).forEach(function(b){s.push((0,a.jsx)(fe.Z,{style:{width:100,margin:"Center"},color:"processing",children:b.name}))}),s},Y=(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)(de.Z,{children:[(0,a.jsx)(N.Z,{span:8,children:(0,a.jsx)(ce.Z,{treeData:e,onCheck:function(s,b){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 Y},he=me,ve=function(){var l=(0,j.Z)((0,o.Z)().mark(function n(d){return(0,o.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,C.addCompany(d).then(function(m){if(!m.succeeded)return f.default.error(m.errors),!1;m.data?f.default.success("\u6DFB\u52A0\u6210\u529F"):f.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),f.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(d){return l.apply(this,arguments)}}(),pe=function(){var l=(0,j.Z)((0,o.Z)().mark(function n(d){return(0,o.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,C.updateCompany(d).then(function(m){if(!m.succeeded)return f.default.error(m.errors),!1;m.data?f.default.success("\u914D\u7F6E\u6210\u529F"):f.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),f.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(d){return l.apply(this,arguments)}}(),ye=function(){var l=(0,j.Z)((0,o.Z)().mark(function n(d){return(0,o.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(d){e.next=2;break}return e.abrupt("return",!0);case 2:return e.prev=2,e.next=5,C.removeCompany(d.map(function(m){return m.id})).then(function(m){if(m)return f.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),!0;f.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),f.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(d){return l.apply(this,arguments)}}(),Ze=function(){var l=(0,j.Z)((0,o.Z)().mark(function n(d){return(0,o.Z)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,C.addRoleMenu(d).then(function(m){m.data?f.default.success("\u6388\u6743\u6210\u529F"):f.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),f.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(d){return l.apply(this,arguments)}}(),Ce=function(){var n=(0,v.useState)(),d=(0,Z.Z)(n,2),g=d[0],e=d[1],m=(0,v.useState)(),T=(0,Z.Z)(m,2),$=T[0],k=T[1],H=(0,v.useState)({}),P=(0,Z.Z)(H,2),A=P[0],D=P[1],G=(0,v.useState)(),O=(0,Z.Z)(G,2),Y=O[0],E=O[1],s=(0,v.useRef)(),b=(0,v.useState)(),M=(0,Z.Z)(b,2),F=M[0],I=M[1],V=(0,v.useState)(),J=(0,Z.Z)(V,2),B=J[0],Q=J[1],xe=(0,v.useState)(),X=(0,Z.Z)(xe,2),je=X[0],Se=X[1],ge=(0,v.useState)(),q=(0,Z.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(R){De(R.data),k(!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(R){f.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(R){f.default.success("\u542F\u7528\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"),s.current.reload()}):C.Disable(r.id).then(function(R){f.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)(W.Z,{type:"primary",onClick:function(){e(!0)},children:[(0,a.jsx)(ne.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var c=(0,j.Z)((0,o.Z)().mark(function i(r){var p,h;return(0,o.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;ye(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)(oe,{onFinish:function(){var c=(0,j.Z)((0,o.Z)().mark(function i(r){var p,h;return(0,o.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,o.Z)().mark(function i(r){var p,h;return(0,o.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return p={sysRoleId:A.sysRoleId,sysMenuId:r},u.next=3,Ze(p);case 3:h=u.sent,h&&(k(!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(){k(!1),D({})},modalVisible:$,values:Ie||{}}):null,(0,a.jsx)(ae.Z,{width:600,visible:Y,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,o.Z)().mark(function c(){return(0,o.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}}]);