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 rivejä
6.8 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[5815,1322],{73937:function(V,w,e){"use strict";e.r(w),e.d(w,{default:function(){return X}});var v=e(57663),g=e(71577),p=e(2824),l=e(39428),D=e(34792),a=e(48086),f=e(3182),L=e(49101),m=e(67294),$=e(78009),P=e(85224),i=e(16894),S=e(71194),R=e(50146),t=e(9715),E=e(55843),te=e(47673),b=e(4107),ne=e(43358),x=e(34041),n=e(85893),N=function(s){var c=x.Z.Option,A=x.Z.OptGroup;return(0,n.jsx)(R.Z,{title:s.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:s.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){s.onCancel()},destroyOnClose:!0,children:(0,n.jsxs)(E.Z,{layout:"vertical",preserve:!1,initialValues:s.values,onFinish:s.onFinish,children:[(0,n.jsx)(E.Z.Item,{name:"id",hidden:!0,children:(0,n.jsx)(b.Z,{})}),(0,n.jsx)(E.Z.Item,{label:"\u7B49\u7EA7",name:"storeLevel_Name",rules:[{required:!0}],children:(0,n.jsx)(b.Z,{})}),(0,n.jsx)(E.Z.Item,{children:(0,n.jsx)(g.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},Y=N,I=e(94595),B="message",J=function(){var C=(0,f.Z)((0,l.Z)().mark(function s(c){return(0,l.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,a.default.loading("\u6B63\u5728\u6DFB\u52A0",B),r.next=4,(0,I.ef)(JSON.stringify(c)).then(function(u){return a.default.destroy(B),u.data?(a.default.success("\u6DFB\u52A0\u6210\u529F"),!0):(a.default.error("\u6DFB\u52A0\u5931\u8D25"),!1)});case 4:r.next=10;break;case 6:return r.prev=6,r.t0=r.catch(0),a.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),r.abrupt("return",!1);case 10:case"end":return r.stop()}},s,null,[[0,6]])}));return function(c){return C.apply(this,arguments)}}(),Q=function(){var C=(0,f.Z)((0,l.Z)().mark(function s(c){return(0,l.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,a.default.loading("\u6B63\u5728\u4FEE\u6539",B),a.default.destroy(B),r.next=5,(0,I.EQ)(JSON.stringify(c)).then(function(u){return a.default.destroy(B),u.data?(a.default.success("\u4FEE\u6539\u6210\u529F"),!0):(a.default.success("\u4FEE\u6539\u5931\u8D25"),!1)});case 5:r.next=11;break;case 7:return r.prev=7,r.t0=r.catch(0),a.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),r.abrupt("return",!1);case 11:case"end":return r.stop()}},s,null,[[0,7]])}));return function(c){return C.apply(this,arguments)}}(),z=function(){var C=(0,f.Z)((0,l.Z)().mark(function s(c){var A;return(0,l.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,a.default.loading("\u6B63\u5728\u5220\u9664"),A=[],c.forEach(function(j){A.push(j.id)}),u.next=6,(0,I.mv)(A).then(function(j){return j.data?(a.default.success("\u5220\u9664\u6210\u529F"),!0):(a.default.success("\u5220\u9664\u5931\u8D25"),!1)});case 6:u.next=12;break;case 8:return u.prev=8,u.t0=u.catch(0),a.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),u.abrupt("return",!1);case 12:case"end":return u.stop()}},s,null,[[0,8]])}));return function(c){return C.apply(this,arguments)}}(),H=function(){var s=(0,m.useState)(!1),c=(0,p.Z)(s,2),A=c[0],r=c[1],u=(0,m.useState)(!1),j=(0,p.Z)(u,2),ae=j[0],se=j[1],M=(0,m.useRef)(),q=(0,m.useState)(),G=(0,p.Z)(q,2),_=G[0],W=G[1],ee=(0,m.useState)([]),U=(0,p.Z)(ee,2),O=U[0],K=U[1],re=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u7B49\u7EA7",dataIndex:"storeLevel_Name",valueType:"textarea",ellipsis:!0},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",hideInForm:!0,search:!1},{title:"\u4FEE\u6539\u65F6\u95F4",dataIndex:"updateAt",hideInForm:!0,search:!1},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(d,o){return[(0,n.jsx)("a",{onClick:function(){r(!0),W(o)},children:" \u66F4\u65B0"},"config")]}}];return(0,n.jsxs)($.ZP,{children:[(0,n.jsx)(i.ZP,{headerTitle:"\u5E97\u94FA\u7C7B\u578B",actionRef:M,rowKey:"id",search:{labelWidth:120},toolBarRender:function(){return[(0,n.jsxs)(g.Z,{type:"primary",onClick:function(){r(!0)},children:[(0,n.jsx)(L.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var y=(0,f.Z)((0,l.Z)().mark(function d(o){var h,Z;return(0,l.Z)().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return h=[],Z=0,T.next=4,(0,I.k3)(o).then(function(k){h=k.data.data,Z=k.data.total});case 4:return T.abrupt("return",{data:h,success:!0,total:Z});case 5:case"end":return T.stop()}},d)}));return function(d){return y.apply(this,arguments)}}(),columns:re,rowSelection:{onChange:function(d,o){K(o)}}}),(O==null?void 0:O.length)>0&&(0,n.jsx)(P.Z,{extra:(0,n.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,n.jsx)("a",{style:{fontWeight:600},children:O.length})," ","\u9879 \xA0\xA0"]}),children:(0,n.jsx)(g.Z,{onClick:(0,f.Z)((0,l.Z)().mark(function y(){var d,o;return(0,l.Z)().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return Z.next=2,z(O);case 2:K([]),(d=M.current)===null||d===void 0||(o=d.reloadAndRest)===null||o===void 0||o.call(d);case 4:case"end":return Z.stop()}},y)})),children:"\u5220\u9664"})}),(0,n.jsx)(Y,{onFinish:function(){var y=(0,f.Z)((0,l.Z)().mark(function d(o){var h;return(0,l.Z)().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:h=!1,o.id?h=Q(o):h=J(o),h&&(r(!1),W(void 0),M.current.reload());case 3:case"end":return F.stop()}},d)}));return function(d){return y.apply(this,arguments)}}(),onCancel:function(){r(!1),W(void 0)},createModalVisible:A,values:_||{}})]})},X=H},94595:function(V,w,e){"use strict";e.d(w,{k3:function(){return l},ef:function(){return a},EQ:function(){return L},mv:function(){return $}});var v=e(39428),g=e(3182),p=e(48971);function l(i){return D.apply(this,arguments)}function D(){return D=(0,g.Z)((0,v.Z)().mark(function i(S){return(0,v.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,p.WY)("/kitchen/api/store/store-level-page",{method:"POST",data:S}));case 1:case"end":return t.stop()}},i)})),D.apply(this,arguments)}function a(i){return f.apply(this,arguments)}function f(){return f=(0,g.Z)((0,v.Z)().mark(function i(S){return(0,v.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,p.WY)("/kitchen/api\u200B/store\u200B/store-level",{method:"POST",data:S}));case 1:case"end":return t.stop()}},i)})),f.apply(this,arguments)}function L(i){return m.apply(this,arguments)}function m(){return m=(0,g.Z)((0,v.Z)().mark(function i(S){return(0,v.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,p.WY)("/kitchen/api/store/store-level",{method:"put",data:S}));case 1:case"end":return t.stop()}},i)})),m.apply(this,arguments)}function $(i){return P.apply(this,arguments)}function P(){return P=(0,g.Z)((0,v.Z)().mark(function i(S){return(0,v.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",(0,p.WY)("/kitchen/api\u200B/store\u200B/del-store-level",{method:"POST",data:S}));case 1:case"end":return t.stop()}},i)})),P.apply(this,arguments)}}}]);