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__store__storeStaff.380c2523.async.js 11 KiB

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