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__activity__activityInfo.3c36e395.async.js 29 KiB

1 jaar geleden
1
  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[5768],{50902:function(Ut,De,i){"use strict";i.r(De),i.d(De,{default:function(){return Ct}});var bt=i(57663),q=i(71577),Pt=i(71194),je=i(50146),Gt=i(62350),Ye=i(24565),v=i(11849),Kt=i(47673),W=i(4107),ue=i(93224),Lt=i(77576),Ve=i(12028),h=i(39428),kt=i(34792),f=i(48086),U=i(3182),Yt=i(9715),r=i(71257),S=i(2824),x=i(67294),$e=i(78009),Me=i(16894),Ne=i(30381),ve=i.n(Ne),$t=i(14965),Re=i(91774),Mt=i(49111),he=i(19650),Nt=i(77883),Fe=i(85986),Wt=i(43185),We=i(93009),Se=i(86582),zt=i(43358),R=i(34041),ze=i(84391),Ce=i(59465),Ie=i(49101),G=i(48971);function Je(y){return(0,G.WY)("/kitchen/api/activity-info/activity-info",{method:"post",data:y})}function He(y){return(0,G.WY)("/kitchen/api/activity-info",{method:"post",data:y})}function Qe(y){return Te.apply(this,arguments)}function Te(){return Te=(0,U.Z)((0,h.Z)().mark(function y(o){return(0,h.Z)().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return w.abrupt("return",(0,G.WY)("/kitchen/api/systemconfig/GetCosRequestSignURL",{method:"POST",data:o}));case 1:case"end":return w.stop()}},y)})),Te.apply(this,arguments)}function Xe(y){return(0,G.WY)("/kitchen/api/activity-info",{method:"put",data:y})}function qe(y){return(0,G.WY)("/kitchen/api/activity-info/batch-del-activity-info",{method:"post",data:y})}function _e(y){return(0,G.WY)("/kitchen/api/activity-info/activity-configuration/".concat(y),{method:"get"})}function et(y){return(0,G.WY)("/kitchen/api/activity-info/addactivity-configuration",{method:"Post",data:y})}function tt(y){return(0,G.WY)("/kitchen/api/activity-info/activity-all-state",{method:"put",data:y})}function at(y){return(0,G.WY)("/kitchen/api/coupon-helper/coupon-can-use-count-and-limit",{method:"get"})}function nt(y){return(0,G.WY)("/kitchen/api/activity-info/activity-reward-list/".concat(y),{method:"get"})}function it(){return(0,G.WY)("/kitchen/api/activity-info/goods-info",{method:"get"})}function rt(y){return Ee.apply(this,arguments)}function Ee(){return Ee=(0,U.Z)((0,h.Z)().mark(function y(o){return(0,h.Z)().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return w.abrupt("return",(0,G.WY)("/kitchen/api/goods-type/goods-types",{method:"POST",data:o}));case 1:case"end":return w.stop()}},y)})),Ee.apply(this,arguments)}function ut(y){return we.apply(this,arguments)}function we(){return we=(0,U.Z)((0,h.Z)().mark(function y(o){return(0,h.Z)().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return w.abrupt("return",(0,G.WY)("/kitchen/api/printer/store-infos",{method:"Post",data:o}));case 1:case"end":return w.stop()}},y)})),we.apply(this,arguments)}var lt=i(9669),st=i.n(lt),e=i(85893),ot=["key","name","fieldKey"],ct=["key","name","fieldKey"],dt=["key","name","fieldKey"],ft=function(o){for(var C=R.Z.Option,w=R.Z.OptGroup,$=(0,x.useState)(),z=(0,S.Z)($,2),ye=z[0],le=z[1],J=x.useState(0),se=(0,S.Z)(J,2),me=se[0],pe=se[1],H=(0,x.useState)(),te=(0,S.Z)(H,2),oe=te[0],Ze=te[1],_=(0,x.useState)(),ae=(0,S.Z)(_,2),ce=ae[0],Ae=ae[1],de=(0,x.useState)(!0),ne=(0,S.Z)(de,2),ie=ne[0],Q=ne[1],b=(0,x.useState)([]),T=(0,S.Z)(b,2),B=T[0],Z=T[1],I=(0,x.useState)([]),A=(0,S.Z)(I,2),u=A[0],c=A[1],n=(0,x.useState)(!1),d=(0,S.Z)(n,2),t=d[0],a=d[1],O=(0,x.useState)(!1),fe=(0,S.Z)(O,2),Xt=fe[0],qt=fe[1],It=(0,x.useState)([]),be=(0,S.Z)(It,2),X=be[0],Tt=be[1],Et=(0,x.useState)(o.values.activityImg?o.values.activityImg:null),Pe=(0,S.Z)(Et,2),Ge=Pe[0],Ke=Pe[1],wt=(0,x.useState)([]),Le=(0,S.Z)(wt,2),xe=Le[0],Bt=Le[1],At=[],re=10;re<36;re++)At.push((0,e.jsx)(C,{children:re.toString(36)+re},re.toString(36)+re));var Ot={wrapperCol:{sm:{span:500,offset:1}}};(0,x.useEffect)(function(){return function(){o.createModalVisible||Ke(null)}}),(0,x.useEffect)(function(){var M=function(){var l=(0,U.Z)((0,h.Z)().mark(function j(E){var m;return(0,h.Z)().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,at();case 2:m=F.sent.data,m!=null&&Z(m);case 4:case"end":return F.stop()}},j)}));return function(E){return l.apply(this,arguments)}}(),s=function(){var l=(0,U.Z)((0,h.Z)().mark(function j(E){var m;return(0,h.Z)().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,it();case 2:m=F.sent.data,m&&c(m);case 4:case"end":return F.stop()}},j)}));return function(E){return l.apply(this,arguments)}}();M(),s()},[]);var ge=function(s,l,j){var E=0;if(l){if(j==3){if(xe[s])return xe[s].price;var m=[(0,Se.Z)(xe)];return u.filter(function(p){var D;p.id==((D=l[s])===null||D===void 0?void 0:D.rewardValue)&&(m[s]=p)}),m[s]&&m[s].price?m[s].price:0}else{var P=l[s],F=0;B.filter(function(p){P&&p.couponId==(P==null?void 0:P.rewardValue)&&(j==1?F=p.canUseCount:F=p.limit)})}j==1?E=parseInt(X[s]?JSON.stringify(X[s].canUseCount):F):E=parseInt(X[s]?JSON.stringify(X[s].limit):F)}else X[s]&&(j==1?E=X[s].canUseCount:E=X[s].limit);return E},Dt={name:"file",showUploadList:!1,multiple:!1,accept:".png, .jpg, .jpeg, .gif",headers:{"Content-Type":"application/octet-stream"},customRequest:function(s){var l=s.action,j=s.file,E=s.headers,m=s.onError,P=s.onProgress,F=s.onSuccess,p=s.withCredentials,D=j.name.lastIndexOf("."),L=j.name.substr(D+1),N=null;Qe({directory:"activity",fileExtension:L,method:"PUT"}).then(function(k){l=k.allUrl;var g=j.name.lastIndexOf("."),V=j.name.substr(g+1),Y=new FileReader;if(["png","jpg","jpeg","bmp","gif","webp","psd","svg","tiff"].indexOf(V)==-1){f.default.error("".concat(j.name," \u4E0D\u662F\u56FE\u7247\u6587\u4EF6"));return}Y.readAsArrayBuffer(j),Y.onload=function(ee){N=ee.target.result,st().put(l,N,{withCredentials:p,headers:E,onUploadProgress:function(ke){var Vt=ke.total,Rt=ke.loaded;P({percent:Math.round(Rt/Vt*100).toFixed(2)},j)}}).then(function(Oe){o.form.setFieldsValue({activityImg:k.seeUrl}),(Oe.status==200||Oe.statusText=="OK")&&Ke(k.seeUrl)}).catch(m)}})}};return(0,e.jsx)(je.Z,{title:o.values.id?"\u7F16\u8F91\u4F18\u6D3B\u52A8":"\u65B0\u5EFA\u6D3B\u52A8",width:700,visible:o.createModalVisible,footer:null,onCancel:function(){o.onCancel()},destroyOnClose:!0,children:(0,e.jsx)(r.Z,{preserve:!1,form:o.form,labelCol:{span:4},layout:"Horizontal",onFinish:o.onFinish,children:(0,e.jsxs)("span",{style:{display:ie?"block":"none"},children:[(0,e.jsx)(r.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(W.Z,{})}),(0,e.jsx)(r.Z.Item,{name:"activityName",label:"\u6D3B\u52A8\u540D\u79F0",rules:[{required:!0,max:64}],children:(0,e.jsx)(W.Z,{placeholder:"\u8BF7\u8F93\u5165\u6D3B\u52A8\u540D\u79F0"})}),(0,e.jsx)(r.Z.Item,{name:"activityImg1",label:"\u8BF7\u8F93\u5165\u6D3B\u52A8\u56FE\u7247",rules:[{required:!0}],children:(0,e.jsx)(We.Z,(0,v.Z)((0,v.Z)({},Dt),{},{children:Ge?(0,e.jsx)("img",{src:Ge,alt:"avatar",style:{width:"30px",height:"40px"}}):(0,e.jsx)(q.Z,{icon:(0,e.jsx)(ze.Z,{}),children:"\u4E0A\u4F20"})}))}),(0,e.jsx)(r.Z.Item,{name:"activityImg",label:"\u8BF7\u8F93\u5165\u6D3B\u52A8\u56FE\u7247",hidden:!0,children:(0,e.jsx)(W.Z,{placeholder:"\u8BF7\u8F93\u5165\u6D3B\u52A8\u56FE\u7247"})}),(0,e.jsx)(r.Z.Item,{name:"activityType",label:"\u6D3B\u52A8\u7C7B\u578B",defaultValue:o.values.activityType,rules:[{required:!0}],children:(0,e.jsxs)(R.Z,{showSearch:!0,optionFilterProp:"children",filterOption:function(s,l){return l.children.toLowerCase().indexOf(s.toLowerCase())>=0},placeholder:"\u8BF7\u9009\u62E9\u6D3B\u52A8\u7C7B\u578B",children:[(0,e.jsx)(C,{value:1,children:"\u9001\u5238"},1),(0,e.jsx)(C,{value:2,children:"\u4E70\u6EE1\u51CF\u73B0"},2),(0,e.jsx)(C,{value:3,children:"\u7279\u4EF7\u5546\u54C1"},3),(0,e.jsx)(C,{value:4,children:"\u4E70\u6EE1\u8D60\u9001(\u4F18\u60E0\u5238)"},4),(0,e.jsx)(C,{value:5,children:"\u4E70\u6EE1\u8D60\u9001(\u5546\u54C1)"},5),(0,e.jsx)(C,{value:6,children:"\u7D2F\u8BA1\u6D88\u8D39\u6362\u8D2D(\u9636\u68AF)"},6),(0,e.jsx)(C,{value:7,children:"\u7D2F\u8BA1\u6D88\u8D39\u6362\u8D2D(\u5FAA\u73AF)"},7),(0,e.jsx)(C,{value:8,children:"\u52A0\u4EF7\u6362\u8D2D"},8)]})}),(0,e.jsx)(r.Z.Item,{noStyle:!0,shouldUpdate:function(s,l){return s.activityType!==l.activityType},children:function(s){var l=s.getFieldValue;return l("activityType")=="6"||l("activityType")=="7"?(0,e.jsxs)(r.Z.Item,{children:[(0,e.jsx)(r.Z.Item,{name:"isGiftGoodsParticipate",label:"\u8D60\u9001\u5546\u54C1\u662F\u5426\u53C2\u4E0E\u6D3B\u52A8",rules:[{required:!0}],children:(0,e.jsxs)(R.Z,{showSearch:!0,optionFilterProp:"children",filterOption:function(E,m){return m.children.toLowerCase().indexOf(E.toLowerCase())>=0},placeholder:"\u8BF7\u9009\u6D3B\u52A8\u6D88\u8D39\u7C7B\u578B",children:[(0,e.jsx)(C,{value:1,children:"\u662F"},1),(0,e.jsx)(C,{value:0,children:"\u5426"},0)]})}),(0,e.jsx)(r.Z.Item,{name:"consumptionType",label:"\u6D3B\u52A8\u6D88\u8D39\u7C7B\u578B",rules:[{required:!0}],children:(0,e.jsxs)(R.Z,{showSearch:!0,optionFilterProp:"children",filterOption:function(E,m){return m.children.toLowerCase().indexOf(E.toLowerCase())>=0},placeholder:"\u8BF7\u9009\u6D3B\u52A8\u6D88\u8D39\u7C7B\u578B",children:[(0,e.jsx)(C,{value:1,children:"\u94B1\uFF08\u5143\uFF09"},1),(0,e.jsx)(C,{value:2,children:"\u6570\u91CF\uFF08\u676F/\u7897/\u76D2/\u4E2A/.....\uFF09"},2)]})})]}):null}}),(0,e.jsx)(r.Z.Item,{noStyle:!0,shouldUpdate:function(s,l){return s.activityType!==l.activityType},children:function(s){var l=s.getFieldValue;return l("activityType")=="2"||l("activityType")=="4"||l("activityType")=="5"||l("activityType")=="6"||l("activityType")=="8"||l("activityType")=="7"?(0,e.jsx)(r.Z.Item,{label:l("activityType")=="6"||l("activityType")=="7"?"\u6D88\u8D39\u6B21\u6570":l("activityType")=="8"?"\u52A0\u8D2D\u4EF7\u683C":"\u6D88\u8D39\u91D1\u989D",children:(0,e.jsx)(r.Z.List,{name:"activityRewards",children:function(E,m){var P=m.add,F=m.remove;return(0,e.jsxs)(e.Fragment,{children:[E.map(function(p){var D=p.key,L=p.name,N=p.fieldKey,k=(0,ue.Z)(p,ot);return(0,e.jsxs)(he.Z,{style:{display:"flex",marginBottom:8},align:"baseline",children:[(0,e.jsx)(r.Z.Item,(0,v.Z)((0,v.Z)({},k),{},{name:[L,"rewardValue"],fieldKey:[N,"rewardValue"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6D88\u8D39\u91D1\u989D"}],children:(0,e.jsx)(Fe.Z,{})})),"\xA0\xA0",(0,e.jsx)(r.Z.Item,(0,v.Z)((0,v.Z)({},k),{},{label:l("activityType")=="6"||l("activityType")=="7"||l("activityType")=="4"?"\u8D60\u9001\u4F18\u60E0\u5238":l("activityType")=="5"||l("activityType")=="8"?"\u8D60\u9001\u5546\u54C1":"\u8D60\u9001\u91D1\u989D",name:[L,"value"],fieldKey:[N,"value"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9"}],children:[4,6,7].includes(l("activityType"))?(0,e.jsx)(R.Z,{style:{width:200},showSearch:!0,optionFilterProp:"children",filterOption:function(V,Y){return Y.children.toLowerCase().indexOf(V.toLowerCase())>=0},children:B.map(function(g,V){return(0,e.jsx)(C,{index:V,value:g.couponId,children:g.couponName},g.couponId)})}):l("activityType")=="5"||l("activityType")=="8"?(0,e.jsx)(R.Z,{style:{width:200},showSearch:!0,optionFilterProp:"children",filterOption:function(V,Y){return Y.children.toLowerCase().indexOf(V.toLowerCase())>=0},children:u.map(function(g,V){return(0,e.jsx)(C,{index:V,value:g.id,children:g.name},g.id)})}):(0,e.jsx)(Fe.Z,{})})),(0,e.jsx)(Ce.Z,{onClick:function(){return F(L)}})]},D)}),(0,e.jsx)(r.Z.Item,{children:(0,e.jsx)(q.Z,{type:"dashed",onClick:function(){return P()},block:!0,icon:(0,e.jsx)(Ie.Z,{}),children:"\u6DFB\u52A0"})})]})}})}):l("activityType")=="3"?(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(r.Z.Item,{label:"\u5546\u54C1\u4FE1\u606F",children:(0,e.jsx)(r.Z.List,{name:"activityRewards",children:function(E,m){var P=m.add,F=m.remove;return(0,e.jsxs)(e.Fragment,{children:[E.map(function(p){var D=p.key,L=p.name,N=p.fieldKey,k=(0,ue.Z)(p,ct);return(0,e.jsxs)(he.Z,{style:{display:"flex",marginBottom:8},align:"baseline",children:[(0,e.jsx)(r.Z.Item,(0,v.Z)((0,v.Z)({},k),{},{name:[L,"rewardValue"],fieldKey:[N,"rewardValue"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5546\u54C1"}],children:(0,e.jsx)(R.Z,{style:{width:200},onChange:function(V){var Y=(0,Se.Z)(xe);u.filter(function(ee){ee.id==V&&(Y[D]=ee)}),Bt(Y)},children:u.map(function(g,V){return(0,e.jsx)(R.Z.Option,{index:V,value:g.id,children:g.name},g.id)})})})),"\u539F\u4EF7:".concat(ge(D,o.values.activityRewards,3)),"\xA0\xA0",(0,e.jsx)(r.Z.Item,(0,v.Z)((0,v.Z)({},k),{},{label:"\u4FC3\u9500\u4EF7",name:[L,"value"],fieldKey:[N,"value"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4FC3\u9500\u4EF7"}],children:(0,e.jsx)(R.Z,{mode:"tags",style:{width:"160px"},placeholder:"\u8BF7\u8F93\u5165\u4FC3\u9500\u4EF7",maxTagCount:"responsive",children:[]})})),(0,e.jsx)(Ce.Z,{onClick:function(){return F(L)}})]},D)}),(0,e.jsx)(r.Z.Item,{children:(0,e.jsx)(q.Z,{type:"dashed",onClick:function(){return P()},block:!0,icon:(0,e.jsx)(Ie.Z,{}),children:"\u6DFB\u52A0"})})]})}})})}):(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(r.Z.Item,{label:"\u4F18\u60E0\u5238",children:(0,e.jsx)(r.Z.List,{name:"activityRewards",children:function(E,m){var P=m.add,F=m.remove;return(0,e.jsxs)(e.Fragment,{children:[E.map(function(p){var D=p.key,L=p.name,N=p.fieldKey,k=(0,ue.Z)(p,dt);return(0,e.jsxs)(he.Z,{style:{display:"flex",marginBottom:8},align:"baseline",children:[(0,e.jsx)(r.Z.Item,(0,v.Z)((0,v.Z)({},k),{},{name:[L,"rewardValue"],fieldKey:[N,"rewardValue"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u4F18\u60E0\u5238"}],children:(0,e.jsx)(R.Z,{style:{width:200},onChange:function(V){var Y=(0,Se.Z)(X);B.filter(function(ee){ee.couponId==V&&(Y[D]=ee)}),Tt(Y)},children:B.map(function(g,V){return(0,e.jsx)(R.Z.Option,{index:V,value:g.couponId,children:g.couponName},g.couponId)})})})),"\u53EF\u7528\u6570\u91CF:".concat(ge(D,o.values.activityRewards,1)),"\xA0\xA0",(0,e.jsx)(r.Z.Item,(0,v.Z)((0,v.Z)({},k),{},{label:l("activityType")==4?"\u5151\u6362\u503C":"\u6BCF\u6B21\u9886\u53D6\u6570\u91CF",name:[L,"value"],fieldKey:[N,"value"],rules:[{required:!0,message:l("activityType")==4?"\u8BF7\u8F93\u5165\u5151\u6362\u503C":"\u8BF7\u8F93\u5165\u53D1\u9001\u6570\u91CF"},{type:"number",min:0,max:parseInt(l("activityType")==4?999999999:ge(D,o.values.activityRewards,1)),message:"\u8D85\u51FA\u9886\u53D6\u9650\u5236"}],children:(0,e.jsx)(Fe.Z,{min:0,max:l("activityType")==4?999999999:ge(D,o.values.activityRewards,1),placeholder:l("activityType")==4?"\u5151\u6362\u503C":"\u6BCF\u6B21\u9886\u53D6\u6570\u91CF"})})),(0,e.jsx)(Ce.Z,{onClick:function(){return F(L)}})]},D)}),(0,e.jsx)(r.Z.Item,{children:(0,e.jsx)(q.Z,{type:"dashed",onClick:function(){return P()},block:!0,icon:(0,e.jsx)(Ie.Z,{}),children:"\u6DFB\u52A0"})})]})}})})})}}),(0,e.jsx)(r.Z.Item,{noStyle:!0,children:(0,e.jsxs)(r.Z.Item,(0,v.Z)((0,v.Z)({},Ot),{},{style:{height:32},children:[(0,e.jsx)(r.Z.Item,{name:"activityStartTime",label:"\u5F00\u59CB\u65F6\u95F4",style:{float:"left"},rules:[{required:!0}],children:(0,e.jsx)(Re.Z,{placeholder:"\u5F00\u59CB\u65F6\u95F4",disabledDate:function(s){return s&&s>o.form.getFieldValue("activityEndTime")}})}),(0,e.jsx)(r.Z.Item,{name:"activityEndTime",label:"\u7ED3\u675F\u65F6\u95F4",style:{float:"left",marginLeft:20},rules:[{required:!0}],children:(0,e.jsx)(Re.Z,{placeholder:"\u7ED3\u675F\u65F6\u95F4",disabledDate:function(s){return s&&s<o.form.getFieldValue("activityStartTime")}})})]}))}),(0,e.jsx)(r.Z.Item,{name:"remark",label:"\u5907\u6CE8",rules:[{required:!0,max:200}],children:(0,e.jsx)(W.Z,{placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"})}),(0,e.jsx)(r.Z.Item,{name:"activityRule",label:"\u89C4\u5219\u8BF4\u660E",rules:[{required:!0,max:500}],children:(0,e.jsx)(W.Z,{placeholder:"\u8BF7\u8F93\u5165\u89C4\u5219\u8BF4\u660E"})}),(0,e.jsx)(r.Z.Item,{children:(0,e.jsx)(q.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})})]})})})},vt=ft,ht=i(32059),Jt=i(13062),yt=i(71230),Ht=i(89032),mt=i(15746),Qt=i(63185),Ue=i(9676),pt=["key","name","fieldKey"],Be="message",Zt=function(o){var C=r.Z.useForm(),w=(0,S.Z)(C,1),$=w[0],z=R.Z.Option,ye=R.Z.OptGroup,le=(0,x.useState)(!0),J=(0,S.Z)(le,2),se=J[0],me=J[1],pe=(0,x.useState)([]),H=(0,S.Z)(pe,2),te=H[0],oe=H[1],Ze=(0,x.useState)([]),_=(0,S.Z)(Ze,2),ae=_[0],ce=_[1];(0,x.useEffect)(function(){var Q=function(){var T=(0,U.Z)((0,h.Z)().mark(function B(Z){var I;return(0,h.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,rt({current:1,pageSize:100});case 2:I=u.sent,I!=null&&oe(I.data);case 4:case"end":return u.stop()}},B)}));return function(Z){return T.apply(this,arguments)}}(),b=function(){var T=(0,U.Z)((0,h.Z)().mark(function B(Z){var I;return(0,h.Z)().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,ut({current:1,pageSize:100});case 2:I=u.sent,I&&ce(I.data);case 4:case"end":return u.stop()}},B)}));return function(Z){return T.apply(this,arguments)}}();Q(),b()},[]);var Ae={wrapperCol:{sm:{span:500,offset:1}}},de=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],ne=function(b){var T=[];if(b.configurationName=="\u661F\u671F\u9650\u5236")for(var B=0;B<7;B++)T.push({label:"\u661F\u671F".concat(B==0?"\u65E5":de[B]),value:B.toString()});return b.configurationName=="\u5546\u54C1\u79CD\u7C7B\u9650\u5236"&&te.data.forEach(function(Z){T.push({label:Z.goodsType_Name,value:Z.id})}),b.configurationName=="\u95E8\u5E97\u9650\u5236"&&ae.data.forEach(function(Z){T.push({label:Z.storeName,value:Z.storeId})}),T},ie=function(){var Q=(0,U.Z)((0,h.Z)().mark(function b(T){return(0,h.Z)().wrap(function(Z){for(;;)switch(Z.prev=Z.next){case 0:return f.default.loading("\u6B63\u5728\u6DFB\u52A0...",Be),Z.prev=1,T.users&&T.users.forEach(function(I){I.activity_Id=o.activityId}),Z.next=5,et(JSON.stringify(T.users)).then(function(I){f.default.destroy(Be),I.data?(o.onCancel(),f.default.success("\u6DFB\u52A0\u6210\u529F")):f.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 5:return Z.abrupt("return",!0);case 8:return Z.prev=8,Z.t0=Z.catch(1),f.default.destroy(Be),f.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),Z.abrupt("return",!1);case 13:case"end":return Z.stop()}},b,null,[[1,8]])}));return function(T){return Q.apply(this,arguments)}}();return(0,e.jsx)(je.Z,{title:"\u6D3B\u52A8\u914D\u7F6E",width:700,visible:o.createModalVisible,footer:null,onCancel:function(){o.onCancel()},destroyOnClose:!0,children:(0,e.jsxs)(r.Z,{name:"dynamic_form_nest_item",autoComplete:"off",onFinish:ie,initialValues:{users:o.config},children:[(0,e.jsx)(r.Z.List,{name:"users",children:function(b,T){var B=T.add,Z=T.remove;return(0,e.jsx)(e.Fragment,{children:b.map(function(I){var A=I.key,u=I.name,c=I.fieldKey,n=(0,ue.Z)(I,pt);return(0,e.jsxs)(he.Z,{style:{display:"flex",marginBottom:8},align:"baseline",children:[(0,e.jsx)(r.Z.Item,(0,v.Z)((0,v.Z)({},n),{},{name:[u,"valueType"],fieldKey:[c,"valueType"],hidden:!0,children:(0,e.jsx)(W.Z,{style:{width:80},size:"Small"})})),(0,e.jsx)(r.Z.Item,(0,v.Z)((0,v.Z)({},n),{},{name:[u,"configId"],fieldKey:[c,"configId"],children:(0,e.jsx)(Ue.Z.Group,{children:(0,e.jsx)(yt.Z,{children:(0,e.jsx)(mt.Z,{span:32,children:(0,e.jsx)(Ue.Z,{value:o.config[A].configuration_Id,style:{lineHeight:"32px"},children:o.config[A].configurationName})})})})})),(0,e.jsxs)("span",{children:["\u6761\u4EF6\uFF1A",o.config[A].configurationRule]}),(0,e.jsx)(r.Z.Item,{noStyle:!0,shouldUpdate:function(t,a){return t.activityType!==a.activityType},children:function(t){var a=t.getFieldValue;return o.config[A].configurationValueCount!=0?(0,e.jsx)(r.Z.Item,(0,v.Z)((0,v.Z)({},n),{},{name:[u,"operator"],fieldKey:[c,"operator"],children:(0,e.jsxs)(R.Z,{style:{width:80},size:"Small",children:[(0,e.jsx)(z,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(z,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(z,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(z,{value:">=and<=",children:"\u5305\u542B"})]})})):(0,e.jsx)("span",{})}}),(0,e.jsx)(r.Z.Item,{noStyle:!0,shouldUpdate:function(t,a){return t.activityType!==a.activityType},children:function(t){var a=t.getFieldValue;return o.config[A].configurationValueCount==1?(0,e.jsx)(r.Z.Item,(0,v.Z)((0,v.Z)({},n),{},{name:[u,"value1"],fieldKey:[c,"value1"],children:o.config[A].valueType==1?(0,e.jsx)(W.Z,{style:{width:80},size:"Small"}):(0,e.jsx)(R.Z,(0,v.Z)({showSearch:!0},(0,ht.Z)({mode:"multiple",optionFilterProp:"label",style:{width:"250px"},options:ne(o.config[A]),placeholder:"Select Item...",maxTagCount:"responsive"},"mode","multiple")))})):(0,e.jsx)("span",{})}}),(0,e.jsx)(r.Z.Item,{noStyle:!0,shouldUpdate:function(t,a){return t.activityType!==a.activityType},children:function(t){var a=t.getFieldValue;return o.config[A].configurationValueCount==2?(0,e.jsx)(r.Z.Item,(0,v.Z)((0,v.Z)({},n),{},{name:[u,"value1"],fieldKey:[c,"value1"],children:(0,e.jsx)(W.Z,{style:{width:80},size:"Small"})})):(0,e.jsx)("span",{})}}),(0,e.jsx)(r.Z.Item,{noStyle:!0,shouldUpdate:function(t,a){return t.activityType!==a.activityType},children:function(t){var a=t.getFieldValue;return o.config[A].configurationValueCount==2?(0,e.jsx)(r.Z.Item,(0,v.Z)((0,v.Z)({},n),{},{name:[u,"value2"],fieldKey:[c,"value2"],children:(0,e.jsx)(W.Z,{style:{width:80},size:"Small"})})):(0,e.jsx)("span",{})}})]},A)})})}}),(0,e.jsx)(r.Z.Item,{children:(0,e.jsx)(q.Z,{type:"primary",htmlType:"submit",children:"\u4FDD\u5B58"})})]})})},xt=Zt,gt=i(79361),jt=i.n(gt),Ft=["defaultRender"],K="message",St=function(){var o=r.Z.useForm(),C=(0,S.Z)(o,1),w=C[0],$=(0,x.useRef)(),z=(0,x.useState)(),ye=(0,S.Z)(z,2),le=ye[0],J=ye[1],se=(0,x.useState)(!1),me=(0,S.Z)(se,2),pe=me[0],H=me[1],te=(0,x.useState)(!1),oe=(0,S.Z)(te,2),Ze=oe[0],_=oe[1],ae=(0,x.useState)([]),ce=(0,S.Z)(ae,2),Ae=ce[0],de=ce[1],ne=(0,x.useState)([]),ie=(0,S.Z)(ne,2),Q=ie[0],b=ie[1],T=function(){var u=(0,U.Z)((0,h.Z)().mark(function c(n){return(0,h.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return f.default.loading("\u6B63\u5728\u6DFB\u52A0...",K),t.prev=1,n.activityType==3&&n.activityRewards.forEach(function(a){a.value="[".concat(a.value.join(),"]")}),t.next=5,He(JSON.stringify(n)).then(function(a){f.default.destroy(K),a.data?f.default.success("\u6DFB\u52A0\u6210\u529F"):f.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 5:return $.current.reload(),t.abrupt("return",!0);case 9:return t.prev=9,t.t0=t.catch(1),f.default.destroy(K),f.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),t.abrupt("return",!1);case 14:case"end":return t.stop()}},c,null,[[1,9]])}));return function(n){return u.apply(this,arguments)}}(),B=function(){var u=(0,U.Z)((0,h.Z)().mark(function c(n){var d;return(0,h.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return f.default.loading("\u6B63\u5728\u5220\u9664...",K),a.prev=1,d=[],n.forEach(function(O){d.push(O.id)}),a.next=6,qe(JSON.stringify(d)).then(function(O){f.default.destroy(K),O.data?(f.default.destroy(K),f.default.success("\u5220\u9664\u6210\u529F")):f.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 6:return $.current.reload(),a.abrupt("return",!0);case 10:return a.prev=10,a.t0=a.catch(1),f.default.destroy(K),f.default.error("\u5220\u9664\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),a.abrupt("return",!1);case 15:case"end":return a.stop()}},c,null,[[1,10]])}));return function(n){return u.apply(this,arguments)}}(),Z=function(){var u=(0,U.Z)((0,h.Z)().mark(function c(n){return(0,h.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return f.default.loading("\u6B63\u5728\u4FEE\u6539...",K),t.prev=1,n.activityType==3&&n.activityRewards.forEach(function(a){a.value="[".concat(a.value.join(),"]")}),t.next=5,Xe(JSON.stringify(n)).then(function(a){f.default.destroy(K),a.data?f.default.success("\u4FEE\u6539\u6210\u529F"):f.default.error(a.errors)});case 5:return $.current.reload(),t.abrupt("return",!0);case 9:return t.prev=9,t.t0=t.catch(1),f.default.destroy(K),f.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),t.abrupt("return",!1);case 14:case"end":return t.stop()}},c,null,[[1,9]])}));return function(n){return u.apply(this,arguments)}}(),I=function(){var u=(0,U.Z)((0,h.Z)().mark(function c(n){return(0,h.Z)().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return f.default.loading("\u6B63\u5728\u4FEE\u6539...",K),t.prev=1,t.next=4,tt(JSON.stringify(n)).then(function(a){f.default.destroy(K),a.data?f.default.success("\u4FEE\u6539\u6210\u529F"):f.default.error(a.errors)});case 4:return $.current.reload(),t.abrupt("return",!0);case 8:return t.prev=8,t.t0=t.catch(1),f.default.destroy(K),f.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),t.abrupt("return",!1);case 13:case"end":return t.stop()}},c,null,[[1,8]])}));return function(n){return u.apply(this,arguments)}}(),A=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u56FE\u7247",dataIndex:"activityImg",valueType:"textarea",hideInSearch:!0,render:function(c,n){return(0,e.jsx)("img",{src:n.activityImg,style:{width:"45px",height:"45px"}})}},{title:"\u6D3B\u52A8\u540D\u79F0",dataIndex:"activityName",valueType:"textarea"},{title:"\u6D3B\u52A8\u7C7B\u578B",dataIndex:"activityType",valueEnum:{1:{text:"\u9001\u5238",status:"Processing"},2:{text:"\u4E70\u6EE1\u51CF\u73B0",status:"Success"},3:{text:"\u5546\u54C1\u4FC3\u9500",status:"Success"},4:{text:"\u4E70\u6EE1\u8D60\u9001(\u4F18\u60E0\u5238)",status:"Success"},5:{text:"\u4E70\u6EE1\u8D60\u9001(\u5546\u54C1)",status:"Success"},6:{text:"\u7D2F\u8BA1\u6D88\u8D39\u6362\u8D2D(\u9636\u68AF)",status:"Success"},7:{text:"\u7D2F\u8BA1\u6D88\u8D39\u6362\u8D2D(\u5FAA\u73AF)",status:"Success"},8:{text:"\u52A0\u4EF7\u6362\u8D2D",status:"Success"}}},{title:"\u72B6\u6001",dataIndex:"status",valueEnum:{0:{text:"\u542F\u7528",status:"Processing"},1:{text:"\u7981\u7528",status:"Error"}}},{title:"\u662F\u5426\u663E\u793A",dataIndex:"isShow",valueEnum:{0:{text:"\u4E0D\u663E\u793A",status:"Processing"},1:{text:"\u663E\u793A",status:"Error"}},render:function(c,n){return(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(Ve.Z,{checkedChildren:"\u663E\u793A",unCheckedChildren:"\u4E0D\u663E\u793A",checked:n.isShow==1,onChange:function(t){var a={activityId:n.id,type:2,value:n.isShow};a.value=t?1:0,I(a)}})})}},{title:"\u662F\u5426\u540E\u53F0\u8BA1\u7B97",dataIndex:"isAutoSend",valueEnum:{0:{text:"\u70B9\u51FB\u53C2\u4E0E",status:"Processing"},1:{text:"\u540E\u53F0\u8BA1\u7B97",status:"Error"}},render:function(c,n){return(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(Ve.Z,{checkedChildren:"\u70B9\u51FB\u53C2\u4E0E",unCheckedChildren:"\u540E\u53F0\u8BA1\u7B97",checked:n.isAutoSend==1,onChange:function(t){var a={activityId:n.id,type:3,value:n.isAutoSend};a.value=t?1:0,I(a)}})})}},{title:"\u6D3B\u52A8\u65F6\u95F4",hideInSearch:!0,render:function(c,n,d){return(0,e.jsx)("span",{children:(0,e.jsxs)("div",{children:[ve()(n.activityStartTime).format("YYYY-MM-DD"),"\u81F3",ve()(n.activityEndTime).format("YYYY-MM-DD")]})})}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",valueType:"date",renderFormItem:function(c,n,d){var t=n.defaultRender,a=(0,ue.Z)(n,Ft),O=d.getFieldValue("status");return"".concat(O)==="0"?!1:"".concat(O)==="3"?(0,e.jsx)(W.Z,(0,v.Z)((0,v.Z)({},a),{},{placeholder:"\u8BF7\u8F93\u5165\u5F02\u5E38\u539F\u56E0\uFF01"})):t(c)}},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(c,n){var d=[(0,e.jsx)("a",{type:"primary",onClick:function(){nt(n.id).then(function(a){a.data&&(H(!0),J(function(){return n.activityStartTime=ve()(n.activityStartTime),n.activityEndTime=ve()(n.activityEndTime),n.activityRewards=a.data,n.activityType==3&&n.activityRewards.forEach(function(O){O.value=JSON.parse(O.value)}),w.setFieldsValue(n),n}))})},children:"\u66F4\u65B0"},"update"),(0,e.jsx)("a",{type:"primary",onClick:function(){var a={activityId:n.id,type:1,value:n.status};a.value=n.status==0?1:0,I(a)},children:n.status==0?"\u7981\u7528":"\u542F\u7528"},"jy"),(0,e.jsx)("a",{type:"primary",onClick:function(){_e(n.id).then(function(a){a.data&&(b(n.id),de(a.data),_(!0))})},children:"\u914D\u7F6E"},"pz"),(0,e.jsx)(Ye.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){B([n])},onCancel:function(){},children:(0,e.jsx)("a",{href:"#",children:"\u5220\u9664"})},"del"),(0,e.jsxs)("a",{onClick:function(){var a={title:"\u4E8C\u7EF4\u7801",content:(0,e.jsx)(jt(),{id:"qrCode",value:"https://black-pa.com:5443/lead?activityId=".concat(n.id),size:200,fgColor:"#000000",style:{margin:"auto"}})};je.Z.info(a)},children:[" ","\u4E8C\u7EF4\u7801"]},"primary")];return d}}];return(0,e.jsxs)($e.ZP,{children:[(0,e.jsx)(Me.ZP,{headerTitle:"\u6D3B\u52A8\u4FE1\u606F",actionRef:$,rowKey:"id",search:{labelWidth:120},request:function(){var u=(0,U.Z)((0,h.Z)().mark(function c(n){var d,t;return(0,h.Z)().wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return d=[],t=0,O.next=4,Je(n).then(function(fe){d=fe.data.data,t=fe.data.total});case 4:return O.abrupt("return",{data:d,success:!0,total:t});case 5:case"end":return O.stop()}},c)}));return function(c){return u.apply(this,arguments)}}(),toolBarRender:function(){return[(0,e.jsx)(q.Z,{type:"primary",onClick:function(){H(!0)},children:"\u65B0\u5EFA"},"primary")]},columns:A}),(0,e.jsx)(vt,{onFinish:function(){var u=(0,U.Z)((0,h.Z)().mark(function c(n){var d;return(0,h.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(d=!1,!n.id){a.next=7;break}return a.next=4,Z(n);case 4:d=a.sent,a.next=10;break;case 7:return a.next=9,T(n);case 9:d=a.sent;case 10:d&&(H(!1),J(void 0),$.current&&$.current.reload()),$.current.reload();case 12:case"end":return a.stop()}},c)}));return function(c){return u.apply(this,arguments)}}(),onCancel:function(){J(void 0),H(!1)},createModalVisible:pe,values:le||{},form:w}),(0,e.jsx)(xt,{onCancel:function(){J(void 0),_(!1)},activityId:Q,config:Ae,createModalVisible:Ze,values:le||{}})]})},Ct=St}}]);