You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2 regels
12 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[7025,1322],{77287:function(se,W,t){"use strict";t.r(W),t.d(W,{default:function(){return ge}});var S=t(71194),x=t(50146),T=t(9715),f=t(55843),z=t(47673),C=t(4107),Q=t(57663),E=t(71577),P=t(2824),n=t(39428),X=t(34792),d=t(48086),y=t(3182),D=t(49101),b=t(67294),A=t(78009),G=t(85224),R=t(16894),c=t(79361),g=t(62999),I=t(54680),a=t(43358),O=t(34041),e=t(85893),ue=function(u){var m=O.Z.Option,r=O.Z.OptGroup;return(0,e.jsx)(x.Z,{title:u.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:u.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){u.onCancel()},destroyOnClose:!0,children:(0,e.jsxs)(f.Z,{preserve:!1,initialValues:u.values,onFinish:u.onFinish,children:[(0,e.jsx)(f.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(C.Z,{})}),(0,e.jsx)(f.Z.Item,{label:"\u540D\u79F0",name:"name",rules:[{required:!0}],children:(0,e.jsx)(C.Z,{})}),(0,e.jsx)(f.Z.Item,{label:"\u7535\u8BDD",name:"phone",rules:[{required:!0}],children:(0,e.jsx)(C.Z,{})}),(0,e.jsx)(f.Z.Item,{label:"\u5DE5\u53F7",name:"number",rules:[{required:!0}],children:(0,e.jsx)(C.Z,{})}),(0,e.jsx)(f.Z.Item,{name:"shopId",label:"\u95E8\u5E97",rules:[{required:!0}],children:(0,e.jsx)(I.Z,{style:{width:"100%"},dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:u.OrgData,placeholder:"\u95E8\u5E97",treeDefaultExpandAll:!0})}),(0,e.jsx)(f.Z.Item,{name:"status",label:"\u72B6\u6001",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001"}],children:(0,e.jsx)(O.Z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",children:(0,e.jsxs)(r,{children:[(0,e.jsx)(O.Z.Option,{value:0,children:"\u6B63\u5E38"}),(0,e.jsx)(O.Z.Option,{value:1,children:"\u505C\u7528"}),(0,e.jsx)(O.Z.Option,{value:2,children:"\u5220\u9664"})]})})}),(0,e.jsx)(f.Z.Item,{children:(0,e.jsx)(E.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},le=ue,$=t(48971);function ie(i){return U.apply(this,arguments)}function U(){return U=(0,y.Z)((0,n.Z)().mark(function i(u){return(0,n.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,$.WY)("/kitchen/api/store-staff/store-staff-page",{method:"POST",data:u}));case 1:case"end":return r.stop()}},i)})),U.apply(this,arguments)}function de(i){return Y.apply(this,arguments)}function Y(){return Y=(0,y.Z)((0,n.Z)().mark(function i(u){return(0,n.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,$.WY)("/kitchen/api/store-staff/store-staff",{method:"POST",data:u}));case 1:case"end":return r.stop()}},i)})),Y.apply(this,arguments)}function ce(i){return L.apply(this,arguments)}function L(){return L=(0,y.Z)((0,n.Z)().mark(function i(u){return(0,n.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,$.WY)("/kitchen\u200B/api/store-staff/store-staff",{method:"put",data:u}));case 1:case"end":return r.stop()}},i)})),L.apply(this,arguments)}function oe(i){return K.apply(this,arguments)}function K(){return K=(0,y.Z)((0,n.Z)().mark(function i(u){return(0,n.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,$.WY)("\u200B/kitchen/api/store-staff/del-store-staff",{method:"POST",data:u}));case 1:case"end":return r.stop()}},i)})),K.apply(this,arguments)}function fe(i){return V.apply(this,arguments)}function V(){return V=(0,y.Z)((0,n.Z)().mark(function i(u){return(0,n.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,$.WY)("/kitchen\u200B//api/cashierplatformapplication/storestaffpwd",{method:"put",data:u}));case 1:case"end":return r.stop()}},i)})),V.apply(this,arguments)}var pe=t(3408),F="message",he=function(){var i=(0,y.Z)((0,n.Z)().mark(function u(m){return(0,n.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,d.default.loading("\u6B63\u5728\u6DFB\u52A0",F),s.next=4,de(JSON.stringify(m)).then(function(Z){return d.default.destroy(F),Z.data?(d.default.success("\u6DFB\u52A0\u6210\u529F"),!0):(d.default.error("\u6DFB\u52A0\u5931\u8D25"),!1)});case 4:s.next=10;break;case 6:return s.prev=6,s.t0=s.catch(0),d.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),s.abrupt("return",!1);case 10:case"end":return s.stop()}},u,null,[[0,6]])}));return function(m){return i.apply(this,arguments)}}(),me=function(){var i=(0,y.Z)((0,n.Z)().mark(function u(m){return(0,n.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,d.default.loading("\u6B63\u5728\u4FEE\u6539",F),d.default.destroy(F),s.next=5,ce(JSON.stringify(m)).then(function(Z){return d.default.destroy(F),Z.data?(d.default.success("\u4FEE\u6539\u6210\u529F"),!0):(d.default.error("\u4FEE\u6539\u5931\u8D25"),!1)});case 5:s.next=11;break;case 7:return s.prev=7,s.t0=s.catch(0),d.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),s.abrupt("return",!1);case 11:case"end":return s.stop()}},u,null,[[0,7]])}));return function(m){return i.apply(this,arguments)}}(),ve=function(){var i=(0,y.Z)((0,n.Z)().mark(function u(m){var r;return(0,n.Z)().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.prev=0,d.default.loading("\u6B63\u5728\u5220\u9664"),r=[],m.forEach(function(B){r.push(B.id)}),Z.next=6,oe(r).then(function(B){return B.data?(d.default.success("\u5220\u9664\u6210\u529F"),!0):(d.default.error("\u5220\u9664\u5931\u8D25"),!1)});case 6:Z.next=12;break;case 8:return Z.prev=8,Z.t0=Z.catch(0),d.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),Z.abrupt("return",!1);case 12:case"end":return Z.stop()}},u,null,[[0,8]])}));return function(m){return i.apply(this,arguments)}}(),Ze=function(){var u=(0,b.useState)(!1),m=(0,P.Z)(u,2),r=m[0],s=m[1],Z=(0,b.useState)(!1),B=(0,P.Z)(Z,2),ye=B[0],J=B[1],je=(0,b.useState)(!1),q=(0,P.Z)(je,2),Te=q[0],Be=q[1],N=(0,b.useRef)(),we=(0,b.useState)(),_=(0,P.Z)(we,2),H=_[0],k=_[1],Se=(0,b.useState)([]),ee=(0,P.Z)(Se,2),M=ee[0],te=ee[1],Oe=(0,b.useState)([]),re=(0,P.Z)(Oe,2),Ce=re[0],be=re[1],xe=(0,b.useState)([]),ae=(0,P.Z)(xe,2),Ee=ae[0],Pe=ae[1];(0,b.useEffect)(function(){function j(){(0,pe.FM)().then(function(p){l(p.data);function l(o){for(var h in o)o[h].type==2||o[h].type==3?o[h].disabled=!1:o[h].disabled=!0,o[h].children&&l(o[h].children)}be(p.data);var v={};w(p.data);function w(o){for(var h in o)v[o[h].disabled]=!0,v[o[h].value]={text:o[h].title},o[h].children&&w(o[h].children)}Pe(v)})}j()},[]);var Ie=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u540D\u79F0",dataIndex:"name",valueType:"textarea",search:!1},{title:"\u7535\u8BDD",dataIndex:"phone",valueType:"textarea",search:!1},{title:"\u804C\u5DE5\u7F16\u53F7",dataIndex:"number",valueType:"textarea",search:!1},{title:"\u5F52\u5C5E\u95E8\u5E97",dataIndex:"shopId",search:!1,valueEnum:Ee},{title:"\u72B6\u6001",dataIndex:"status",hideInForm:!0,search:!1,valueEnum:{0:{text:"\u6B63\u5E38",status:"Processing"},1:{text:"\u505C\u7528",status:"Success"},2:{text:"\u5220\u9664",status:"Error"}}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",hideInForm:!0,search:!1},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(p,l){return[(0,e.jsx)("a",{onClick:function(){s(!0),k(l)},children:" \u66F4\u65B0"},"config"),(0,e.jsx)("a",{onClick:function(){J(!0),l.pwd="",k(l)},children:" \u4FEE\u6539\u5BC6\u7801"},"config")]}}];return(0,e.jsxs)(A.ZP,{children:[(0,e.jsx)(R.ZP,{headerTitle:"\u5E97\u94FA\u7C7B\u578B",actionRef:N,rowKey:"id",search:{labelWidth:120},toolBarRender:function(){return[(0,e.jsxs)(E.Z,{type:"primary",onClick:function(){s(!0)},children:[(0,e.jsx)(D.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var j=(0,y.Z)((0,n.Z)().mark(function p(l){var v,w;return(0,n.Z)().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return v=[],w=0,h.next=4,ie(l).then(function(ne){v=ne.data.data,w=ne.data.total});case 4:return h.abrupt("return",{data:v,success:!0,total:w});case 5:case"end":return h.stop()}},p)}));return function(p){return j.apply(this,arguments)}}(),columns:Ie,rowSelection:{onChange:function(p,l){te(l)}}}),(M==null?void 0:M.length)>0&&(0,e.jsx)(G.Z,{extra:(0,e.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,e.jsx)("a",{style:{fontWeight:600},children:M.length})," ","\u9879 \xA0\xA0"]}),children:(0,e.jsx)(E.Z,{onClick:(0,y.Z)((0,n.Z)().mark(function j(){var p,l;return(0,n.Z)().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return w.next=2,ve(M);case 2:te([]),(p=N.current)===null||p===void 0||(l=p.reloadAndRest)===null||l===void 0||l.call(p);case 4:case"end":return w.stop()}},j)})),children:"\u5220\u9664"})}),(0,e.jsx)(le,{onFinish:function(){var j=(0,y.Z)((0,n.Z)().mark(function p(l){var v;return(0,n.Z)().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:v=!1,l.id?v=me(l):v=he(l),v&&(s(!1),k(void 0),N.current.reload());case 3:case"end":return o.stop()}},p)}));return function(p){return j.apply(this,arguments)}}(),onCancel:function(){s(!1),k(void 0)},createModalVisible:r,OrgData:Ce,values:H||{}}),(0,e.jsx)(x.Z,{title:"\u4FEE\u6539\u5BC6\u7801",open:ye,footer:null,onCancel:function(){J(!1)},children:(0,e.jsxs)(f.Z,{preserve:!1,onFinish:(0,y.Z)((0,n.Z)().mark(function j(){return(0,n.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.next=2,fe(JSON.stringify(H)).then(function(v){v.data?(d.default.success("\u4FEE\u6539\u6210\u529F"),J(!1)):d.default.error("\u4FEE\u6539\u5931\u8D25")});case 2:case"end":return l.stop()}},j)})),initialValues:H,children:[(0,e.jsx)(f.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(C.Z,{})}),(0,e.jsx)(f.Z.Item,{label:"\u5BC6\u7801",name:"pwd",rules:[{required:!0}],children:(0,e.jsx)(C.Z,{})}),(0,e.jsx)(f.Z.Item,{children:(0,e.jsx)(E.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})]})},ge=Ze},3408:function(se,W,t){"use strict";t.d(W,{lM:function(){return z},IH:function(){return Q},mm:function(){return X},eP:function(){return y},FM:function(){return G}});var S=t(39428),x=t(11849),T=t(3182),f=t(48971);function z(c,g){return C.apply(this,arguments)}function C(){return C=(0,T.Z)((0,S.Z)().mark(function c(g,I){return(0,S.Z)().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return O.abrupt("return",(0,f.WY)("/kitchen/api/sysOrg\u200B/page",{method:"GET",params:(0,x.Z)({},g)}));case 1:case"end":return O.stop()}},c)})),C.apply(this,arguments)}function Q(c){return E.apply(this,arguments)}function E(){return E=(0,T.Z)((0,S.Z)().mark(function c(g){return(0,S.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,f.WY)("/kitchen/api/sysOrg/add",{method:"POST",data:(0,x.Z)({},g)}));case 1:case"end":return a.stop()}},c)})),E.apply(this,arguments)}function P(c){return n.apply(this,arguments)}function n(){return n=_asyncToGenerator(_regeneratorRuntime().mark(function c(g){return _regeneratorRuntime().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",request("\u200B/kitchen/api\u200B/sysOrg\u200B/list",{method:"POST",data:_objectSpread({},g)}));case 1:case"end":return a.stop()}},c)})),n.apply(this,arguments)}function X(c){return d.apply(this,arguments)}function d(){return d=(0,T.Z)((0,S.Z)().mark(function c(g){return(0,S.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,f.WY)("\u200B/kitchen/api\u200B/sysOrg\u200B/delete",{method:"POST",data:(0,x.Z)({},g)}));case 1:case"end":return a.stop()}},c)})),d.apply(this,arguments)}function y(c){return D.apply(this,arguments)}function D(){return D=(0,T.Z)((0,S.Z)().mark(function c(g){return(0,S.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,f.WY)("\u200B/kitchen/api\u200B/sysOrg\u200B/edit",{method:"POST",data:(0,x.Z)({},g)}));case 1:case"end":return a.stop()}},c)})),D.apply(this,arguments)}function b(c){return A.apply(this,arguments)}function A(){return A=_asyncToGenerator(_regeneratorRuntime().mark(function c(g){return _regeneratorRuntime().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",request("/kitchen\u200B/api\u200B/sysOrg\u200B/detail",{method:"POST",data:_objectSpread({},g)}));case 1:case"end":return a.stop()}},c)})),A.apply(this,arguments)}function G(c){return R.apply(this,arguments)}function R(){return R=(0,T.Z)((0,S.Z)().mark(function c(g){return(0,S.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,f.WY)("\u200B/kitchen/api\u200B/sysOrg\u200B/tree",{data:(0,x.Z)({},g)}));case 1:case"end":return a.stop()}},c)})),R.apply(this,arguments)}}}]);