Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

2 wiersze
8.4 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[3580,1322],{91208:function(ue,M,t){"use strict";t.r(M),t.d(M,{default:function(){return q}});var ie=t(57663),T=t(71577),le=t(62350),W=t(75443),se=t(77576),x=t(12028),ce=t(34792),u=t(48086),j=t(3182),de=t(9715),C=t(86835),A=t(2824),Y=t(94043),c=t.n(Y),F=t(67294),P=t(78009),V=t(16894),oe=t(30381),fe=t(71194),w=t(50146),he=t(77883),B=t(85482),ve=t(62999),J=t(54680),me=t(47673),N=t(4107),U=t(11849),R=t(48971);function b(d){return(0,R.WY)("/kitchen/api/rechargeactivity/getRechargeActivityPgage",{method:"post",data:d})}function L(d){return(0,R.WY)("/kitchen/api/rechargeactivity/addRechargeActivity",{method:"post",data:d})}function G(d){return(0,R.WY)("/kitchen/api/rechargeactivity/updateRechargeActivity",{method:"post",data:d})}function H(d){return(0,R.WY)("/kitchen/api/rechargeactivity/updateRechargeactivityrecommend",{method:"post",data:d})}function z(d){return(0,R.WY)("/kitchen/api/rechargeactivity/deleteRechargeActivity",{method:"post",data:d})}function K(d){return $.apply(this,arguments)}function $(){return $=(0,j.Z)(c().mark(function d(h){return c().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return m.abrupt("return",(0,R.WY)("\u200B/kitchen/api\u200B/sysOrg\u200B/tree",{data:(0,U.Z)({},h)}));case 1:case"end":return m.stop()}},d)})),$.apply(this,arguments)}var a=t(85893),Q=function(h){var S=(0,F.useState)([]),m=(0,A.Z)(S,2),v=m[0],D=m[1];(0,F.useEffect)(function(){I()},[]);function I(){K().then(function(y){o(y.data);function o(p){for(var g in p)p[g].type==2||p[g].type==3?p[g].disabled=!1:p[g].disabled=!0,p[g].children&&o(p[g].children)}D(y.data)})}return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(w.Z,{title:h.values.id?"\u7F16\u8F91\u5145\u503C\u6D3B\u52A8":"\u65B0\u5EFA\u5145\u503C\u6D3B\u52A8",width:500,visible:h.createModalVisible,footer:null,onCancel:function(){h.onCancel()},destroyOnClose:!0,children:(0,a.jsxs)(C.Z,{preserve:!1,initialValues:h.values,labelCol:{span:4},layout:"Horizontal",onFinish:h.onFinish,children:[(0,a.jsx)(C.Z.Item,{name:"id",hidden:!0,children:(0,a.jsx)(N.Z,{})}),(0,a.jsx)(C.Z.Item,{name:"storeId",label:"\u9009\u62E9\u5E97\u94FA",rules:[{required:!0,max:64}],children:(0,a.jsx)(J.Z,{style:{width:"100%"},dropdownStyle:{maxHeight:400,overflow:"auto"},treeData:v,placeholder:"\u5F52\u5C5E\u95E8\u5E97",treeDefaultExpandAll:!0})}),(0,a.jsx)(C.Z.Item,{name:"rechargeMoney",label:"\u5145\u503C\u91D1\u989D",rules:[{required:!0,max:64,type:"money"}],children:(0,a.jsx)(B.Z,{formatter:function(o){return"$ ".concat(o).replace(/\B(?=(\d{3})+(?!\d))/g,",")},parser:function(o){return o.replace(/\$\s?|(,*)/g,"")},value:h.values.rechargeMoney,stringMode:!0,style:{width:"100%"}})}),(0,a.jsx)(C.Z.Item,{name:"giveMoney",label:"\u8D60\u9001\u91D1\u989D",rules:[{required:!0,max:64,type:"money"}],children:(0,a.jsx)(B.Z,{formatter:function(o){return"$ ".concat(o).replace(/\B(?=(\d{3})+(?!\d))/g,",")},parser:function(o){return o.replace(/\$\s?|(,*)/g,"")},style:{width:"100%"},value:h.values.giveMoney,stringMode:!0})}),(0,a.jsx)(C.Z.Item,{name:"recommend",label:"\u662F\u5426\u63A8\u8350",children:(0,a.jsx)(x.Z,{checked:h.values.recommend})}),(0,a.jsx)(C.Z.Item,{children:(0,a.jsx)(T.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})})]})})})},X=Q,ye=t(79361),f="message",k=function(){var h=C.Z.useForm(),S=(0,A.Z)(h,1),m=S[0],v=(0,F.useRef)(),D=(0,F.useState)(),I=(0,A.Z)(D,2),y=I[0],o=I[1],p=(0,F.useState)(!1),g=(0,A.Z)(p,2),_=g[0],E=g[1],ee=function(){var s=(0,j.Z)(c().mark(function i(n){return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u.default.loading("\u6B63\u5728\u6DFB\u52A0...",f),e.prev=1,e.next=4,L(JSON.stringify(n)).then(function(r){u.default.destroy(f),r.data?u.default.success("\u6DFB\u52A0\u6210\u529F"):u.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 4:return v.current.reload(),e.abrupt("return",!0);case 8:return e.prev=8,e.t0=e.catch(1),u.default.destroy(f),u.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 13:case"end":return e.stop()}},i,null,[[1,8]])}));return function(n){return s.apply(this,arguments)}}(),re=function(){var s=(0,j.Z)(c().mark(function i(n){var l;return c().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return u.default.loading("\u6B63\u5728\u5220\u9664...",f),r.prev=1,l=[],n.forEach(function(Z){l.push(Z.id)}),r.next=6,z(JSON.stringify(l)).then(function(Z){u.default.destroy(f),Z.data?(u.default.destroy(f),u.default.success("\u5220\u9664\u6210\u529F")):u.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 6:return v.current.reload(),r.abrupt("return",!0);case 10:return r.prev=10,r.t0=r.catch(1),u.default.destroy(f),u.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),r.abrupt("return",!1);case 15:case"end":return r.stop()}},i,null,[[1,10]])}));return function(n){return s.apply(this,arguments)}}(),te=function(){var s=(0,j.Z)(c().mark(function i(n){return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u.default.loading("\u6B63\u5728\u4FEE\u6539...",f),e.prev=1,n.activityType==3&&n.activityRewards.forEach(function(r){r.value="[".concat(r.value.join(),"]")}),e.next=5,G(JSON.stringify(n)).then(function(r){u.default.destroy(f),r.data?u.default.success("\u4FEE\u6539\u6210\u529F"):u.default.error(r.errors)});case 5:return v.current.reload(),e.abrupt("return",!0);case 9:return e.prev=9,e.t0=e.catch(1),u.default.destroy(f),u.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 14:case"end":return e.stop()}},i,null,[[1,9]])}));return function(n){return s.apply(this,arguments)}}(),ae=function(){var s=(0,j.Z)(c().mark(function i(n){return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u.default.loading("\u6B63\u5728\u4FEE\u6539...",f),e.prev=1,e.next=4,H(JSON.stringify(n)).then(function(r){u.default.destroy(f),console.log(r),r.succeeded?u.default.success("\u4FEE\u6539\u6210\u529F"):u.default.error("\u66F4\u65B0\u5931\u8D25")});case 4:return v.current.reload(),e.abrupt("return",!0);case 8:return e.prev=8,e.t0=e.catch(1),u.default.destroy(f),u.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),e.abrupt("return",!1);case 13:case"end":return e.stop()}},i,null,[[1,8]])}));return function(n){return s.apply(this,arguments)}}(),ne=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u5145\u503C\u91D1\u989D",dataIndex:"rechargeMoney",valueType:"money"},{title:"\u8D60\u9001\u91D1\u989D",dataIndex:"giveMoney",valueType:"money"},{title:"\u662F\u5426\u63A8\u8350",dataIndex:"recommend",hideInSearch:!0,render:function(i,n){return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(x.Z,{checkedChildren:"\u63A8\u8350",unCheckedChildren:"\u4E0D\u63A8\u8350",checked:n.recommend,onChange:function(e){var r={Id:n.id,Recommend:e};ae(r)}})})}},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(i,n){var l=[(0,a.jsx)("a",{type:"primary",onClick:function(){E(!0),o(function(){return n})},children:"\u66F4\u65B0"},"update")];return l.push((0,a.jsx)(W.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){re([n])},onCancel:function(){},children:(0,a.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")),l}}];return(0,a.jsxs)(P.ZP,{children:[(0,a.jsx)(V.ZP,{headerTitle:"\u6D3B\u52A8\u4FE1\u606F",actionRef:v,rowKey:"id",search:{labelWidth:120},request:function(){var s=(0,j.Z)(c().mark(function i(n){var l,e;return c().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return l=[],e=0,Z.next=4,b(n).then(function(O){l=O.data.data,e=O.data.total});case 4:return Z.abrupt("return",{data:l,success:!0,total:e});case 5:case"end":return Z.stop()}},i)}));return function(i){return s.apply(this,arguments)}}(),toolBarRender:function(){return[(0,a.jsx)(T.Z,{type:"primary",onClick:function(){E(!0)},children:"\u65B0\u5EFA"},"primary")]},columns:ne}),(0,a.jsx)(X,{onFinish:function(){var s=(0,j.Z)(c().mark(function i(n){var l;return c().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(l=!1,!n.id){r.next=7;break}return r.next=4,te(n);case 4:l=r.sent,r.next=11;break;case 7:return console.log(n),r.next=10,ee(n);case 10:l=r.sent;case 11:l&&(E(!1),o(void 0),v.current&&v.current.reload()),v.current.reload();case 13:case"end":return r.stop()}},i)}));return function(i){return s.apply(this,arguments)}}(),onCancel:function(){o(void 0),E(!1)},createModalVisible:_,values:y||{},form:m})]})},q=k}}]);