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.

p__store__storeStaff.7b0c26b3.async.js 11 KiB

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