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