|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[7129],{91232:function(He){He.exports={activity_start_container:"activity_start_container___3mSaY",head_row:"head_row___Z6Yf6",head_row_prev:"head_row_prev___11f8a",activity_form_container:"activity_form_container___1x0GR",common_form_row:"common_form_row___3woxL"}},44403:function(He,Xe,j){"use strict";j.r(Xe),j.d(Xe,{default:function(){return bu}});var Gu=j(58024),ou=j(91894),Uu=j(57106),su=j(6129),Yu=j(57663),K=j(71577),Q=j(2824),zu=j(9715),t=j(55843),Lu=j(43358),u=j(34041),D=j(67294),du=j(78009),cu=j(91232),ne=j.n(cu),Vu=j(71194),Le=j(50146),Pu=j(13062),we=j(71230),Mu=j(89032),Ne=j(15746),qu=j(63185),pe=j(9676),Hu=j(43185),Te=j(93009),Xu=j(14965),ye=j(91774),Wu=j(77883),q=j(85986),ke=j(93224),$u=j(47673),Z=j(4107),x=j(11849),_u=j(34792),w=j(48086),A=j(39428),k=j(3182),Ve=j(1977),Re=j(59465),be=j(49101),Je=j(84391),Qe=j(48971),S={GetCosRequestURL:function(N){return(0,Qe.WY)("/kitchen/api/systemconfig/GetCosRequestSignURL",{method:"POST",data:N})},GetCouponCanUseCountAndLimit:function(N){return(0,Qe.WY)("/kitchen/api/coupon-helper/coupon-can-use-count-and-limit",{method:"get"})},GetCouponStatusOrType:function(N){return(0,Qe.WY)("/kitchen/api/coupon/getCouponStatusOrType",{method:"POST",data:N})},Addcoupon:function(N){return(0,Qe.WY)("/kitchen/api/activity-info/fast-coupon",{method:"POST",data:N})},GetStores:function(N){return(0,Qe.WY)("/kitchen/api/sysOrg/listbytype",{method:"get",data:N})},GetGoodsType:function(N){return(0,Qe.WY)("/kitchen/api/select/goodstype",{method:"get"})},GetGoodsById:function(N){return(0,Qe.WY)("/kitchen/api/select/goods/".concat(N),{method:"get"})},GetSelectedConfig:function(N){return(0,Qe.WY)("/kitchen/api/select/selectedconfig/".concat(N),{method:"get"})},FastAddActivity:function(N){return(0,Qe.WY)("/kitchen/api/activity-info/fast-activity",{method:"POST",data:N})}},Au=j(9669),Ke=j.n(Au),hu=j(30381),Ee=j.n(hu),e=j(85893),pu=["key","name","fieldKey"],Pe="coupon",We=[{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"3718AB6C-F4ED-4FAD-8462-6608FF87799C",configurationName:"\u65B0\u4EBA\u6CE8\u518C",configurationRule:"\u6CA1\u6709\u9886\u53D6\u8FC7\u4F18\u60E0\u5238",valueType:1,configurationValueCount:0},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"58cbe72f-5022-48bd-8ed0-7ebb091e884a",configurationName:"\u9650\u5236\u9886\u5238",configurationRule:"\u4E0D\u5B58\u5728\u6B64\u4F18\u60E0\u5238",valueType:1,configurationValueCount:0},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"E432268C-7140-4519-B29F-892764486232",configurationName:"\u6BCF\u65E5\u9886\u5238",configurationRule:"\u6BCF\u65E5\u53EA\u53EF\u9886\u53D6\u4E00\u6B21",valueType:1,configurationValueCount:0}],Eu=function(N){var de=t.Z.useForm(),W=(0,Q.Z)(de,1),R=W[0],re=(0,D.useState)([]),z=(0,Q.Z)(re,2),$=z[0],H=z[1],V=t.Z.useForm(),ee=(0,Q.Z)(V,1),ue=ee[0],ce=(0,D.useState)(null),ae=(0,Q.Z)(ce,2),me=ae[0],_=ae[1],Ze=(0,D.useState)([]),te=(0,Q.Z)(Ze,2),ge=te[0],le=te[1],oe=(0,D.useState)(!1),T=(0,Q.Z)(oe,2),f=T[0],i=T[1],C=(0,D.useState)([]),b=(0,Q.Z)(C,2),g=b[0],d=b[1],n=(0,D.useState)([]),m=(0,Q.Z)(n,2),v=m[0],y=m[1],O=(0,D.useState)([]),s=(0,Q.Z)(O,2),L=s[0],P=s[1],X=(0,D.useState)([]),M=(0,Q.Z)(X,2),G=M[0],se=M[1],fe=function(){var h=(0,k.Z)((0,A.Z)().mark(function a(){var E;return(0,A.Z)().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return B.next=2,S.GetCouponCanUseCountAndLimit();case 2:E=B.sent,E.succeeded&&H(E.data);case 4:case"end":return B.stop()}},a)}));return function(){return h.apply(this,arguments)}}(),Ae={name:"file",showUploadList:!1,multiple:!1,accept:".png, .jpg, .jpeg, .gif",headers:{"Content-Type":"application/octet-stream"},customRequest:function(a){var E=a.action,I=a.file,B=a.headers,U=a.onError,J=a.onProgress,Y=a.onSuccess,he=a.withCredentials,je=I.name.lastIndexOf("."),Se=I.name.substr(je+1),Fe=null;S.GetCosRequestURL({directory:"activity",fileExtension:Se,method:"PUT"}).then(function(Be){E=Be.allUrl;var ve=I.name.lastIndexOf("."),De=I.name.substr(ve+1),Ue=new FileReader;if(["png","jpg","jpeg","bmp","gif","webp","psd","svg","tiff"].indexOf(De)==-1){w.default.error("".concat(I.name," \u4E0D\u662F\u56FE\u7247\u6587\u4EF6"));return}Ue.readAsArrayBuffer(I),Ue.onload=function(ze){Fe=ze.target.result,Ke().put(E,Fe,{withCredentials:he,headers:B,onUploadProgress:function(lu){var Ju=lu.total,Ku=lu.loaded;J({percent:Math.round(Ku/Ju*100).toFixed(2)},I)}}).then(function(Ye){ue.setFieldsValue({activityImg:Be.seeUrl}),(Ye.status==200||Ye.statusText=="OK")&&_(Be.seeUrl)}).catch(U)}})}},Ie={labelCol:{sm:{span:4}},wrapperCol:{}},xe={wrapperCol:{sm:{span:500,offset:1}}},Ce=function(){var h=(0,k.Z)((0,A.Z)().mark(function a(){return(0,A.Z)().wrap(function(I){for(;;)switch(I.prev=I.next){case 0:return I.next=2,S.GetCouponStatusOrType(2).then(function(B){B.succeeded&&d(B.data)});case 2:case"end":return I.stop()}},a)}));return function(){return h.apply(this,arguments)}}(),o=function(){var h=(0,k.Z)((0,A.Z)().mark(function a(){var E;return(0,A.Z)().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return B.next=2,S.GetStores();case 2:E=B.sent,E.statusCode===200&&y(E.data);case 4:case"end":return B.stop()}},a)}));return function(){return h.apply(this,arguments)}}(),l=function(){var h=(0,k.Z)((0,A.Z)().mark(function a(){var E,I;return(0,A.Z)().wrap(function(U){for(;;)switch(U.prev=U.next){case 0:return U.next=2,S.GetGoodsType();case 2:E=U.sent,E.statusCode===200&&(I=[],Object.keys(E.data).forEach(function(J){I.push({id:J,name:E.data[J]})}),P(I));case 4:case"end":return U.stop()}},a)}));return function(){return h.apply(this,arguments)}}(),r=function(){var h=(0,k.Z)((0,A.Z)().mark(function a(){var E,I,B,U=arguments;return(0,A.Z)().wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return E=U.length>0&&U[0]!==void 0?U[0]:-1,Y.next=3,S.GetGoodsById(E);case 3:I=Y.sent,I.statusCode===200&&(B=[],Object.keys(I.data).forEach(function(he){B.push({id:he,name:I.data[he]})}),se(B));case 5:case"end":return Y.stop()}},a)}));return function(){return h.apply(this,arguments)}}(),p=function(){var h=(0,k.Z)((0,A.Z)().mark(function a(E){return(0,A.Z)().wrap(function(B){for(;;)switch(B.prev=B.next){case 0:return E.RangeType=1,w.default.loading("\u6B63\u5728\u6DFB\u52A0...",Pe),B.prev=2,E.validEndTime<E.validStartTime&&w.default.error("\u5F00\u59CB\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u7ED3\u675F\u65F6\u95F4"),B.next=6,S.Addcoupon(JSON.stringify(E)).then(function(U){w.default.destroy(Pe),U.data?(w.default.success("\u6DFB\u52A0\u6210\u529F"),fe(),i(!1)):w.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 6:B.next=12;break;case 8:B.prev=8,B.t0=B.catch(2),w.default.destroy(Pe),w.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01");case 12:case"end":return B.stop()}},a,null,[[2,8]])}));return function(E){return h.apply(this,arguments)}}(),c=function(){var h=(0,k.Z)((0,A.Z)().mark(function a(E){var I,B,U;return(0,A.Z)().wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return Y.next=2,S.GetSelectedConfig(E);case 2:I=Y.sent.data,B=[];for(U in I)B.push({id:U.toString(),name:I[U.toString()]});y(data),R.setFieldsValue({Relation:[]});case 7:case"end":return Y.stop()}},a)}));return function(E){return h.apply(this,arguments)}}(),F=function(){var h=(0,k.Z)((0,A.Z)().mark(function a(E){var I,B;return(0,A.Z)().wrap(function(J){for(;;)switch(J.prev=J.next){case 0:if(E.activityRewards){J.next=3;break}return w.default.error("\u8BF7\u81F3\u5C11\u6DFB\u52A0\u4E00\u79CD\u4F18\u60E0\u5238"),J.abrupt("return");case 3:return E.activityType=1,E.activityRewards.forEach(function(Y){Y.id="",Y.activityInfo_Id=""}),E.activityStartTime=Ee()(E.activityStartAndEndTime[0]).format("YYYY-MM-DD"),E.activityEndTime=Ee()(E.activityStartAndEndTime[1]).format("YYYY-MM-DD"),E.status=0,E.isShow=1,E.isDeleted=0,E.consumptionType=0,E.isGiftGoodsParticipate=0,I=[],E.activityConfig.forEach(function(Y){var he=We.find(function(je){return je.configuration_Id===Y});he&&I.push((0,x.Z)((0,x.Z)({},he),{},{configId:[Y]}))}),delete E.activityConfig,delete E.activityStartAndEndTime,E.activityConfiguration=I,J.next=19,S.FastAddActivity(E);case 19:B=J.sent,B.statusCode===200?(w.default.success("\u65B0\u5EFA\u6D3B\u52A8\u6210\u529F\uFF01"),ue.resetFields(),N.onSuccessCreate&&N.onSuccessCreate()):w.default.error(B.errors||"\u521B\u5EFA\u5931\u8D25 \u8BF7\u91CD\u8BD5\uFF01");case 21:case"end":return J.stop()}},a)}));return function(E){return h.apply(this,arguments)}}();return(0,D.useEffect)(function(){fe(),Ce(),o(),l(),r()},[]),(0,e.jsxs)("div",{className:ne().activity_form_container,children:[(0,e.jsxs)(t.Z,{form:ue,name:"basic",labelCol:{span:3},initialValues:{remember:!0},onFinish:function(a){F(a)},layout:"vertical",autoComplete:"off",children:[(0,e.jsx)(t.Z.Item,{label:"\u6D3B\u52A8\u540D\u79F0",name:"activityName",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6D3B\u52A8\u540D\u79F0\uFF01"}],children:(0,e.jsx)(Z.Z,{style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u6D3B\u52A8\u540D\u79F0"})}),(0,e.jsx)(t.Z.Item,{label:"\u4F18\u60E0\u5238",children:(0,e.jsx)(t.Z.List,{name:"activityRewards",children:function(a,E,I){var B=E.add,U=E.remove,J=I.errors;return(0,e.jsxs)(e.Fragment,{children:[a.map(function(Y){var he,je=Y.key,Se=Y.name,Fe=Y.fieldKey,Be=(0,ke.Z)(Y,pu);return(0,e.jsxs)("div",{className:ne().common_form_row,children:[(0,e.jsx)(t.Z.Item,(0,x.Z)((0,x.Z)({},Be),{},{name:[Se,"rewardValue"],fieldKey:[Fe,"rewardValue"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u4F18\u60E0\u5238"}],children:(0,e.jsx)(u.Z,{placeholder:"\u8BF7\u9009\u62E9\u4F18\u60E0\u5238",style:{width:"200px"},onChange:function(De){var Ue=$.find(function(Ye){return Ye.couponId===De});if(Ue){var ze=JSON.parse(JSON.stringify(ge));ze[je]=Ue,le(ze)}},children:$.map(function(ve,De){return(0,e.jsx)(u.Z.Option,{index:De,value:ve.couponId,children:ve.couponName},ve.couponId)})})})),(0,e.jsx)(Ve.Z,{onClick:function(){return i(!0)},style:{margin:"0 10px",flexShrink:0,marginBottom:"24px",fontSize:"25px",color:"#F84352"}}),(0,e.jsxs)("div",{style:{margin:"0 20px",flexShrink:0,marginBottom:"24px",fontSize:"16px",width:"120px"},children:["\u53EF\u9886\u53D6\u6570\u91CF: ",(he=ge[je])===null||he===void 0?void 0:he.canUseCount]}),(0,e.jsx)(t.Z.Item,(0,x.Z)((0,x.Z)({},Be),{},{name:[Se,"value"],fieldKey:[Fe,"value"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u9886\u53D6\u6570\u91CF\uFF01"}],children:(0,e.jsx)(q.Z,{placeholder:"\u6BCF\u65E5\u9886\u53D6\u6570\u91CF",style:{width:"130px"},min:0,max:999})})),(0,e.jsx)(Re.Z,{style:{fontSize:"25px",marginLeft:"20px",marginBottom:"24px"},onClick:function(){return U(Se)}})]})}),(0,e.jsxs)(t.Z.Item,{children:[(0,e.jsx)(K.Z,{type:"dashed",onClick:function(){return B()},style:{width:"100%"},icon:(0,e.jsx)(be.Z,{}),children:"\u9009\u62E9\u4F18\u60E0\u5238"}),(0,e.jsx)(t.Z.ErrorList,{errors:J})]})]})}})}),(0,e.jsx)(t.Z.Item,{name:"activityStartAndEndTime",label:"\u8D77\u6B62\u65F6\u95F4",rules:[{required:!0}],children:(0,e.jsx)(ye.Z.RangePicker,{style:{width:"100%"}})}),(0,e.jsx)(t.Z.Item,{name:"remark",label:"\u5907\u6CE8",rules:[{required:!0,max:200}],children:(0,e.jsx)(Z.Z.TextArea,{rows:4,placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"})}),(0,e.jsx)(t.Z.Item,{name:"activityRule",label:"\u89C4\u5219\u8BF4\u660E",rules:[{required:!0,max:500}],children:(0,e.jsx)(Z.Z.TextArea,{rows:4,placeholder:"\u8BF7\u8F93\u5165\u89C4\u5219\u8BF4\u660E"})}),(0,e.jsx)(t.Z.Item,{name:"activityImg",label:"\u6D3B\u52A8\u56FE\u7247",rules:[{required:!0}],children:(0,e.jsx)(Te.Z,(0,x.Z)((0,x.Z)({},Ae),{},{children:me?(0,e.jsx)("img",{src:me,alt:"avatar",style:{width:"30px",height:"40px"}}):(0,e.jsx)(K.Z,{icon:(0,e.jsx)(Je.Z,{}),children:"\u4E0A\u4F20"})}))}),(0,e.jsx)(t.Z.Item,{name:"isAutoSend",label:"\u53C2\u4E0E\u65B9\u5F0F",rules:[{required:!0}],children:(0,e.jsxs)(u.Z,{placeholder:"\u8BF7\u9009\u62E9\u53C2\u4E0E\u65B9\u5F0F",children:[(0,e.jsx)(u.Z.Option,{value:0,children:"\u70B9\u51FB\u53C2\u4E0E\uFF08\u9700\u8981\u7528\u6237\u4E3B\u52A8\u70B9\u51FB\uFF09"}),(0,e.jsx)(u.Z.Option,{value:1,children:"\u81EA\u52A8\u53C2\u4E0E\uFF08\u6EE1\u8DB3\u7279\u5B9A\u6761\u4EF6\u81EA\u52A8\u53C2\u4E0E\uFF09"})]})}),(0,e.jsx)(t.Z.Item,{name:"activityConfig",label:"\u6D3B\u52A8\u914D\u7F6E",rules:[{required:!0,message:"\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6D3B\u52A8\u914D\u7F6E\uFF01"}],children:(0,e.jsx)(pe.Z.Group,{style:{width:"100%"},children:(0,e.jsx)(we.Z,{children:We.map(function(h,a){return(0,e.jsx)(Ne.Z,{span:24,style:{marginBottom:"10px"},children:(0,e.jsxs)(pe.Z,{value:h.configuration_Id,children:[h.configurationName,"\uFF1A",h.configurationRule,"\uFF01"]})},a)})})})}),(0,e.jsxs)(t.Z.Item,{children:[(0,e.jsx)(K.Z,{type:"primary",htmlType:"submit",children:"\u63D0\u4EA4"}),(0,e.jsx)(K.Z,{style:{marginLeft:"20px"},onClick:function(){ue.resetFields(),_(null)},children:"\u91CD\u7F6E"})]})]}),(0,e.jsx)(Le.Z,{maskClosable:!1,title:"\u65B0\u5EFA\u4F18\u60E0\u5377",width:700,visible:f,footer:null,onCancel:function(){i(!1)},destroyOnClose:!0,children:(0,e.jsxs)(t.Z,(0,x.Z)((0,x.Z)({form:R},Ie),{},{layout:"Horizontal",preserve:!1,onFinish:function(a){p(a)},children:[(0,e.jsx)(t.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(Z.Z,{})}),(0,e.jsx)(t.Z.Item,{name:"couponTitle",label:"\u4F18\u60E0\u5377\u6807\u9898",rules:[{required:!0,max:200}],children:(0,e.jsx)(Z.Z,{placeholder:"\u8BF7\u8F93\u5165\u4F18\u60E0\u5377\u6807\u9898"})}),(0,e.jsx)(t.Z.Item,{name:"couponType",label:"\u4F18\u60E0\u5377\u7C7B\u578B",rules:[{required:!0}],children:(0,e.jsx)(u.Z,{placeholder:"\u8BF7\u9009\u62E9\u4F18\u60E0\u5377\u7C7B\u578B",children:g.map(function(h){return(0,e.jsx)(u.Z.Option,{value:h.key,children:h.value},h.key)})})}),(0,e.jsxs)(t.Z.Item,(0,x.Z)((0,x.Z)({},xe),{},{style:{height:32},children:[(0,e.jsx)(t.Z.Item,{label:"\u4F18\u60E0\u91D1\u989D",style:{float:"left"},rules:[{required:!0}],children:(0,e.jsx)(t.Z.Item,{name:"couponValue",noStyle:!0,children:(0,e.jsx)(q.Z,{placeholder:"\u91D1\u989D",min:0,precision:2})})}),(0,e.jsx)(t.Z.Item,{label:"\u4F7F\u7528\u6761\u4EF6",style:{float:"left",marginLeft:10},rules:[{required:!0}],children:(0,e.jsx)(t.Z.Item,{name:"condition",noStyle:!0,children:(0,e.jsx)(q.Z,{placeholder:"\u4F7F\u7528\u6761\u4EF6",min:0,precision:2})})}),(0,e.jsxs)(t.Z.Item,{label:"\u6BCF\u4EBA\u53EF\u9886\u6570\u91CF",style:{float:"left",marginLeft:10},rules:[{required:!0}],children:[(0,e.jsx)(t.Z.Item,{name:"getLimit",noStyle:!0,children:(0,e.jsx)(q.Z,{placeholder:"\u53EF\u9886\u6570\u91CF",min:0,precision:0})}),(0,e.jsx)("span",{style:{color:"#FFCC52"},children:" 0 \u4E3A\u4E0D\u9650\u5236"})]})]})),(0,e.jsx)(t.Z.Item,{name:"timeType",label:"\u65F6\u95F4\u7C7B\u578B",rules:[{required:!0}],children:(0,e.jsxs)(u.Z,{children:[(0,e.jsx)(u.Z.Option,{value:1,children:"\u65F6\u95F4\u6BB5"}),(0,e.jsx)(u.Z.Option,{value:2,children:"\u56FA\u5B9A\u671F\u9650"})]})}),(0,e.jsx)(t.Z.Item,{noStyle:!0,shouldUpdate:function(a,E){return a.timeType!==E.timeType},children:function(a){var E=a.getFieldValue;return E("timeType")=="2"?(0,e.jsx)(t.Z.Item,{label:"\u56FA\u5B9A\u65F6\u95F4",rules:[{required:!0}],children:(0,e.jsx)(t.Z.Item,{name:"validFixedTerm",noStyle:!0,children:(0,e.jsx)(q.Z,{placeholder:"",precision:0,min:0})})}):(0,e.jsxs)(t.Z.Item,(0,x.Z)((0,x.Z)({},xe),{},{style:{height:32},children:[(0,e.jsx)(t.Z.Item,{name:"validStartTime",label:"\u5F00\u59CB\u65F6\u95F4",style:{float:"left"},rules:[{required:!0}],children:(0,e.jsx)(ye.Z,{placeholder:"\u5F00\u59CB\u65F6\u95F4"})}),(0,e.jsx)(t.Z.Item,{name:"validEndTime",label:"\u7ED3\u675F\u65F6\u95F4",style:{float:"left",marginLeft:20},rules:[{required:!0}],children:(0,e.jsx)(ye.Z,{placeholder:"\u7ED3\u675F\u65F6\u95F4"})})]}))}}),(0,e.jsx)(t.Z.Item,{name:"validStatus",label:"\u72B6\u6001",rules:[{required:!0}],children:(0,e.jsxs)(u.Z,{placeholder:"\u72B6\u6001",children:[(0,e.jsx)(Option,{value:1,children:"\u751F\u6548"}),(0,e.jsx)(Option,{value:2,children:"\u5931\u6548"}),(0,e.jsx)(Option,{value:3,children:"\u4F5C\u5E9F"})]})}),(0,e.jsxs)(t.Z.Item,{noStyle:!0,children:[(0,e.jsx)(t.Z.Item,{name:"remarks",label:"\u5907\u6CE8",rules:[{max:500}],children:(0,e.jsx)(Z.Z,{placeholder:"\u5907\u6CE8"})}),(0,e.jsx)("span",{style:{color:"#FFCC52",marginLeft:70},children:"\u6CE8: \u591A\u6761\u89C4\u5219\u8BF7\u7528 \xA0;\xA0 \u9694\u5F00\u3002 \xA0\xA0 \u5982\uFF1A1.xxxxxx\uFF1B 2.xxxxxx"})]}),(0,e.jsx)(t.Z.Item,{name:"Coupon_Id",hidden:!0,children:(0,e.jsx)(Z.Z,{})}),(0,e.jsx)(t.Z.Item,{name:"SendNum",label:"\u53D1\u653E\u6570\u91CF",rules:[{required:!0}],children:(0,e.jsx)(q.Z,{placeholder:"\u53D1\u653E\u6570\u91CF",min:0,style:{width:"510px"}})}),(0,e.jsx)(t.Z.Item,{name:"RangeType",label:"\u9002\u7528\u8303\u56F4\u7C7B\u578B",hidden:!0,defaultValue:1,children:(0,e.jsxs)(u.Z,{placeholder:"\u53D1\u653E\u8303\u56F4",onSelect:c,defaultValue:1,children:[(0,e.jsx)(u.Z.Option,{value:"1",children:"\u5E97\u94FA"}),(0,e.jsx)(u.Z.Option,{value:"3",children:"\u533A\u57DF"})]})}),(0,e.jsx)(t.Z.Item,{name:"Relation",label:"\u9002\u7528\u8303\u56F4",rules:[{required:!0}],defaultValue:"1",children:(0,e.jsx)(u.Z,{placeholder:"\u9002\u7528\u8303\u56F4",filterOption:!1,mode:"multiple",children:v.map(function(h){return(0,e.jsx)(u.Z.Option,{value:h.id,children:h.name},h.id)})})}),(0,e.jsx)(t.Z.Item,{name:"applyGoodType",label:"\u9002\u7528\u5546\u54C1\u7C7B\u578B",children:(0,e.jsx)(u.Z,{placeholder:"\u9002\u7528\u5546\u54C1\u7C7B\u578B",filterOption:!1,onChange:function(a){r(a)},children:L.map(function(h){return(0,e.jsx)(u.Z.Option,{value:h.id,children:h.name},h.id)})})}),(0,e.jsx)(t.Z.Item,{name:"goodsRelation",label:"\u9002\u7528\u5546\u54C1\u8303\u56F4",children:(0,e.jsx)(u.Z,{placeholder:"\u9002\u7528\u5546\u54C1\u8303\u56F4",filterOption:!1,mode:"multiple",children:G.map(function(h){return(0,e.jsx)(u.Z.Option,{value:h.id,children:h.name},h.id)})})}),(0,e.jsx)(t.Z.Item,{name:"Status",label:"\u72B6\u6001",rules:[{required:!0}],defaultValue:"1",children:(0,e.jsxs)(u.Z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",children:[(0,e.jsx)(u.Z.Option,{value:"1",children:"\u542F\u7528"}),(0,e.jsx)(u.Z.Option,{value:"0",children:"\u7981\u7528"})]})}),(0,e.jsx)(t.Z.Item,{name:"Remark",label:"\u5907\u6CE8",children:(0,e.jsx)(Z.Z,{placeholder:"\u5907\u6CE8"})}),(0,e.jsx)(t.Z.Item,{children:(0,e.jsx)(K.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})})]}))})]})},mu=Eu,et=j(12968),Ge=j(6122),gu=["key","name","fieldKey"],$e=[{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"2B0F88D6-EDA0-4AAC-BB0B-DD34F3245C17",configurationName:"\u65E5\u53C2\u4E0E\u6B21\u6570\u9650\u5236",configurationRule:"\u6BCF\u65E5\u53C2\u4E0E\u6B21\u6570",valueType:1,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"8AC2A2BA-BB6E-4566-B147-ACF798146BBD",configurationName:"\u661F\u671F\u9650\u5236",configurationRule:"\u5305\u542B\u7684\u661F\u671F",valueType:2,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"9620CCF9-679E-44B1-B8FF-9B6F511208FA",configurationName:"\u6D88\u8D39\u91D1\u989D",configurationRule:"\u5355\u7B14\u8BA2\u5355\u6D88\u8D39\u91D1\u989D",valueType:1,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"AF62B336-15A6-453B-AD4A-61EB7D43B99B",configurationName:"\u5546\u54C1\u79CD\u7C7B\u9650\u5236",configurationRule:"\u5305\u542B\u7684\u5546\u54C1\u79CD\u7C7B",valueType:2,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"ECBACC1C-6BA8-498E-BDE4-6A012881E0E7",configurationName:"\u95E8\u5E97\u9650\u5236",configurationRule:"\u5305\u542B\u7684\u95E8\u5E97",valueType:2,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"F06DEAD8-DDB8-4B27-94E9-389DE9AC155D",configurationName:"\u603B\u53C2\u4E0E\u6B21\u6570\u9650\u5236",configurationRule:"\u603B\u53C2\u4E0E\u6B21\u6570",valueType:1,configurationValueCount:1}],fu=function(N){var de=t.Z.useForm(),W=(0,Q.Z)(de,1),R=W[0],re=(0,D.useState)(null),z=(0,Q.Z)(re,2),$=z[0],H=z[1],V=(0,D.useState)([]),ee=(0,Q.Z)(V,2),ue=ee[0],ce=ee[1],ae=function(){var T=(0,k.Z)((0,A.Z)().mark(function f(){var i,C;return(0,A.Z)().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return g.next=2,S.GetGoodsType();case 2:i=g.sent,i.statusCode===200&&(C=[],Object.keys(i.data).forEach(function(d){C.push({id:d,name:i.data[d]})}),ce(C));case 4:case"end":return g.stop()}},f)}));return function(){return T.apply(this,arguments)}}(),me=(0,D.useState)([]),_=(0,Q.Z)(me,2),Ze=_[0],te=_[1],ge=function(){var T=(0,k.Z)((0,A.Z)().mark(function f(){var i;return(0,A.Z)().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.next=2,S.GetStores();case 2:i=b.sent,i.statusCode===200&&te(i.data);case 4:case"end":return b.stop()}},f)}));return function(){return T.apply(this,arguments)}}(),le={name:"file",showUploadList:!1,multiple:!1,accept:".png, .jpg, .jpeg, .gif",headers:{"Content-Type":"application/octet-stream"},customRequest:function(f){var i=f.action,C=f.file,b=f.headers,g=f.onError,d=f.onProgress,n=f.onSuccess,m=f.withCredentials,v=C.name.lastIndexOf("."),y=C.name.substr(v+1),O=null;S.GetCosRequestURL({directory:"activity",fileExtension:y,method:"PUT"}).then(function(s){i=s.allUrl;var L=C.name.lastIndexOf("."),P=C.name.substr(L+1),X=new FileReader;if(["png","jpg","jpeg","bmp","gif","webp","psd","svg","tiff"].indexOf(P)==-1){w.default.error("".concat(C.name," \u4E0D\u662F\u56FE\u7247\u6587\u4EF6"));return}X.readAsArrayBuffer(C),X.onload=function(M){O=M.target.result,Ke().put(i,O,{withCredentials:m,headers:b,onUploadProgress:function(se){var fe=se.total,Ae=se.loaded;d({percent:Math.round(Ae/fe*100).toFixed(2)},C)}}).then(function(G){R.setFieldsValue({activityImg:s.seeUrl}),(G.status==200||G.statusText=="OK")&&H(s.seeUrl)}).catch(g)}})}},oe=function(){var T=(0,k.Z)((0,A.Z)().mark(function f(i){var C;return(0,A.Z)().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return i.activityType=2,i.activityRewards.forEach(function(d){d.id="",d.activityInfo_Id=""}),i.activityStartTime=Ee()(i.activityStartAndEndTime[0]).format("YYYY-MM-DD"),i.activityEndTime=Ee()(i.activityStartAndEndTime[1]).format("YYYY-MM-DD"),i.status=0,i.isShow=1,i.isDeleted=0,i.consumptionType=0,i.isGiftGoodsParticipate=0,i.activityConfiguration=[],i.activityConfig.forEach(function(d){var n=$e.find(function(m){return m.configuration_Id===d});n&&(n.configId=[n.configuration_Id],n.configurationName==="\u65E5\u53C2\u4E0E\u6B21\u6570\u9650\u5236"?(n.operator=i.dayOperator,n.value1=i.dayValue):n.configurationName==="\u661F\u671F\u9650\u5236"?(n.operator=i.weekOperator,n.value1=i.weekValue):n.configurationName==="\u6D88\u8D39\u91D1\u989D"?(n.operator=i.amountOperator,n.value1=i.amountValue):n.configurationName==="\u5546\u54C1\u79CD\u7C7B\u9650\u5236"?(n.operator=i.goodsTypeOperator,n.value1=i.goodsTypeValue):n.configurationName==="\u95E8\u5E97\u9650\u5236"?(n.operator=i.storeOperator,n.value1=i.storeValue):n.configurationName==="\u603B\u53C2\u4E0E\u6B21\u6570\u9650\u5236"&&(n.operator=i.totalOperator,n.value1=i.totalValue),i.activityConfiguration.push(n))}),delete i.activityConfig,delete i.activityStartAndEndTime,delete i.amountOperator,delete i.amountValue,delete i.dayOperator,delete i.dayValue,delete i.goodsTypeOperator,delete i.goodsTypeValue,delete i.storeOperator,delete i.storeValue,delete i.totalOperator,delete i.totalValue,delete i.weekOperator,delete i.weekValue,g.next=27,S.FastAddActivity(i);case 27:C=g.sent,C.statusCode===200?(w.default.success("\u65B0\u5EFA\u6D3B\u52A8\u6210\u529F\uFF01"),R.resetFields(),N.onSuccessCreate&&N.onSuccessCreate()):w.default.error(C.errors||"\u521B\u5EFA\u5931\u8D25 \u8BF7\u91CD\u8BD5\uFF01");case 29:case"end":return g.stop()}},f)}));return function(i){return T.apply(this,arguments)}}();return(0,D.useEffect)(function(){ae(),ge()},[]),(0,e.jsx)("div",{className:ne().activity_form_container,children:(0,e.jsxs)(t.Z,{form:R,name:"basic",labelCol:{span:3},initialValues:{remember:!0},onFinish:function(f){oe(f)},layout:"vertical",autoComplete:"off",children:[(0,e.jsx)(t.Z.Item,{label:"\u6D3B\u52A8\u540D\u79F0",name:"activityName",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6D3B\u52A8\u540D\u79F0\uFF01"}],children:(0,e.jsx)(Z.Z,{style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u6D3B\u52A8\u540D\u79F0"})}),(0,e.jsx)(t.Z.Item,{label:"\u6D88\u8D39\u91D1\u989D",children:(0,e.jsx)(t.Z.List,{name:"activityRewards",children:function(f,i,C){var b=i.add,g=i.remove,d=C.errors;return(0,e.jsxs)(e.Fragment,{children:[f.map(function(n){var m=n.key,v=n.name,y=n.fieldKey,O=(0,ke.Z)(n,gu);return(0,e.jsxs)("div",{className:ne().common_form_row,children:[(0,e.jsx)(t.Z.Item,(0,x.Z)((0,x.Z)({},O),{},{name:[v,"rewardValue"],fieldKey:[y,"rewardValue"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6D88\u8D39\u91D1\u989D"}],children:(0,e.jsx)(q.Z,{style:{width:"200px"},placeholder:"\u8BF7\u8F93\u5165\u6D88\u8D39\u91D1\u989D"})})),(0,e.jsx)("div",{style:{margin:"0 10px 24px 20px"},children:"\u8D60\u9001\u91D1\u989D\uFF1A"}),(0,e.jsx)(t.Z.Item,(0,x.Z)((0,x.Z)({},O),{},{name:[v,"value"],fieldKey:[y,"value"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u8D60\u9001\u91D1\u989D\uFF01"}],children:(0,e.jsx)(q.Z,{placeholder:"\u8BF7\u8F93\u5165\u8D60\u9001\u91D1\u989D\uFF01",style:{width:"200px"},min:0,max:999})})),(0,e.jsx)(Re.Z,{style:{fontSize:"25px",marginLeft:"20px",marginBottom:"24px"},onClick:function(){return g(v)}})]})}),(0,e.jsxs)(t.Z.Item,{children:[(0,e.jsx)(K.Z,{type:"dashed",onClick:function(){return b()},style:{width:"100%"},icon:(0,e.jsx)(be.Z,{}),children:"\u6DFB\u52A0"}),(0,e.jsx)(t.Z.ErrorList,{errors:d})]})]})}})}),(0,e.jsx)(t.Z.Item,{name:"activityStartAndEndTime",label:"\u8D77\u6B62\u65F6\u95F4",rules:[{required:!0}],children:(0,e.jsx)(ye.Z.RangePicker,{style:{width:"100%"}})}),(0,e.jsx)(t.Z.Item,{name:"remark",label:"\u5907\u6CE8",rules:[{required:!0,max:200}],children:(0,e.jsx)(Z.Z.TextArea,{rows:4,placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"})}),(0,e.jsx)(t.Z.Item,{name:"activityRule",label:"\u89C4\u5219\u8BF4\u660E",rules:[{required:!0,max:500}],children:(0,e.jsx)(Z.Z.TextArea,{rows:4,placeholder:"\u8BF7\u8F93\u5165\u89C4\u5219\u8BF4\u660E"})}),(0,e.jsx)(t.Z.Item,{name:"activityImg",label:"\u6D3B\u52A8\u56FE\u7247",rules:[{required:!0}],children:(0,e.jsx)(Te.Z,(0,x.Z)((0,x.Z)({},le),{},{children:$?(0,e.jsx)(Ge.Z,{width:200,height:200,src:$,fallback:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACy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6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="}):(0,e.jsx)(K.Z,{icon:(0,e.jsx)(Je.Z,{}),children:"\u4E0A\u4F20"})}))}),(0,e.jsx)(t.Z.Item,{name:"isAutoSend",label:"\u53C2\u4E0E\u65B9\u5F0F",rules:[{required:!0}],children:(0,e.jsxs)(u.Z,{placeholder:"\u8BF7\u9009\u62E9\u53C2\u4E0E\u65B9\u5F0F",children:[(0,e.jsx)(u.Z.Option,{value:0,children:"\u70B9\u51FB\u53C2\u4E0E\uFF08\u9700\u8981\u7528\u6237\u4E3B\u52A8\u70B9\u51FB\uFF09"}),(0,e.jsx)(u.Z.Option,{value:1,children:"\u81EA\u52A8\u53C2\u4E0E\uFF08\u6EE1\u8DB3\u7279\u5B9A\u6761\u4EF6\u81EA\u52A8\u53C2\u4E0E\uFF09"})]})}),(0,e.jsx)(t.Z.Item,{name:"activityConfig",label:"\u6D3B\u52A8\u914D\u7F6E",rules:[{required:!0,message:"\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6D3B\u52A8\u914D\u7F6E\uFF01"}],children:(0,e.jsx)(pe.Z.Group,{style:{width:"100%"},children:(0,e.jsx)(we.Z,{children:$e.map(function(T,f){return(0,e.jsxs)(Ne.Z,{span:24,style:{marginBottom:"10px",display:"flex",alignItems:"center"},children:[(0,e.jsxs)(pe.Z,{style:{minWidth:"230px"},value:T.configuration_Id,children:[T.configurationName,"\uFF1A",T.configurationRule]}),f===0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"dayOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"dayValue",noStyle:!0,children:(0,e.jsx)(Z.Z,{style:{width:280},placeholder:"\u6BCF\u65E5\u53C2\u4E0E\u6B21\u6570"})})]}),f===1&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"weekOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"weekValue",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:280},size:"Small",mode:"multiple",placeholder:"\u661F\u671F",children:[(0,e.jsx)(u.Z.Option,{value:"1",children:"\u661F\u671F\u4E00"}),(0,e.jsx)(u.Z.Option,{value:"2",children:"\u661F\u671F\u4E8C"}),(0,e.jsx)(u.Z.Option,{value:"3",children:"\u661F\u671F\u4E09"}),(0,e.jsx)(u.Z.Option,{value:"4",children:"\u661F\u671F\u56DB"}),(0,e.jsx)(u.Z.Option,{value:"5",children:"\u661F\u671F\u4E94"}),(0,e.jsx)(u.Z.Option,{value:"6",children:"\u661F\u671F\u516D"}),(0,e.jsx)(u.Z.Option,{value:"0",children:"\u661F\u671F\u65E5"})]})})]}),f===2&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"amountOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"amountValue",noStyle:!0,children:(0,e.jsx)(Z.Z,{style:{width:280},placeholder:"\u6D88\u8D39\u91D1\u989D"})})]}),f===3&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"goodsTypeOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"goodsTypeValue",noStyle:!0,children:(0,e.jsx)(u.Z,{style:{width:280},size:"Small",placeholder:"\u5546\u54C1\u79CD\u7C7B",mode:"multiple",children:ue.map(function(i){return(0,e.jsx)(u.Z.Option,{value:i.id,children:i.name},i.id)})})})]}),f===4&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"storeOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"storeValue",noStyle:!0,children:(0,e.jsx)(u.Z,{style:{width:280},size:"Small",mode:"multiple",placeholder:"\u95E8\u5E97",children:Ze.map(function(i){return(0,e.jsx)(u.Z.Option,{value:i.id,children:i.name},i.id)})})})]}),f===5&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"totalOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"totalValue",noStyle:!0,children:(0,e.jsx)(Z.Z,{style:{width:280},placeholder:"\u603B\u6B21\u6570"})})]})]},f)})})})}),(0,e.jsxs)(t.Z.Item,{children:[(0,e.jsx)(K.Z,{type:"primary",htmlType:"submit",children:"\u63D0\u4EA4"}),(0,e.jsx)(K.Z,{style:{marginLeft:"20px"},onClick:function(){R.resetFields(),H(null)},children:"\u91CD\u7F6E"})]})]})})},xu=fu,yu=["key","name","fieldKey"],_e=[{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"8AC2A2BA-BB6E-4566-B147-ACF798146BBD",configurationName:"\u661F\u671F\u9650\u5236",configurationRule:"\u5305\u542B\u7684\u661F\u671F",valueType:2,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"ECBACC1C-6BA8-498E-BDE4-6A012881E0E7",configurationName:"\u95E8\u5E97\u9650\u5236",configurationRule:"\u5305\u542B\u7684\u95E8\u5E97",valueType:2,configurationValueCount:1}],Zu=function(N){var de=t.Z.useForm(),W=(0,Q.Z)(de,1),R=W[0],re=(0,D.useState)(null),z=(0,Q.Z)(re,2),$=z[0],H=z[1],V=(0,D.useState)([]),ee=(0,Q.Z)(V,2),ue=ee[0],ce=ee[1],ae=function(){var T=(0,k.Z)((0,A.Z)().mark(function f(){var i;return(0,A.Z)().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.next=2,S.GetStores();case 2:i=b.sent,i.statusCode===200&&ce(i.data);case 4:case"end":return b.stop()}},f)}));return function(){return T.apply(this,arguments)}}(),me=(0,D.useState)([]),_=(0,Q.Z)(me,2),Ze=_[0],te=_[1],ge=function(){var T=(0,k.Z)((0,A.Z)().mark(function f(){var i,C,b,g=arguments;return(0,A.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return i=g.length>0&&g[0]!==void 0?g[0]:-1,n.next=3,S.GetGoodsById(i);case 3:C=n.sent,C.statusCode===200&&(b=[],Object.keys(C.data).forEach(function(m){b.push({id:m,name:C.data[m]})}),te(b));case 5:case"end":return n.stop()}},f)}));return function(){return T.apply(this,arguments)}}(),le=function(){var T=(0,k.Z)((0,A.Z)().mark(function f(i){var C;return(0,A.Z)().wrap(function(g){for(;;)switch(g.prev=g.next){case 0:return i.activityType=3,i.activityRewards.forEach(function(d){d.id="",d.activityInfo_Id=""}),i.activityStartTime=Ee()(i.activityStartAndEndTime[0]).format("YYYY-MM-DD"),i.activityEndTime=Ee()(i.activityStartAndEndTime[1]).format("YYYY-MM-DD"),i.status=0,i.isShow=1,i.isDeleted=0,i.consumptionType=0,i.isGiftGoodsParticipate=0,i.activityConfiguration=[],i.activityConfig.forEach(function(d){var n=_e.find(function(m){return m.configuration_Id===d});n&&(n.configId=[n.configuration_Id],n.configurationName==="\u661F\u671F\u9650\u5236"?(n.operator=i.weekOperator,n.value1=i.weekValue):n.configurationName==="\u95E8\u5E97\u9650\u5236"&&(n.operator=i.storeOperator,n.value1=i.storeValue),i.activityConfiguration.push(n))}),delete i.storeOperator,delete i.storeValue,delete i.weekOperator,delete i.weekValue,g.next=17,S.FastAddActivity(i);case 17:C=g.sent,C.statusCode===200?(w.default.success("\u65B0\u5EFA\u6D3B\u52A8\u6210\u529F\uFF01"),R.resetFields(),N.onSuccessCreate&&N.onSuccessCreate()):w.default.error(C.errors||"\u521B\u5EFA\u5931\u8D25 \u8BF7\u91CD\u8BD5\uFF01");case 19:case"end":return g.stop()}},f)}));return function(i){return T.apply(this,arguments)}}();(0,D.useEffect)(function(){ae(),ge()},[]);var oe={name:"file",showUploadList:!1,multiple:!1,accept:".png, .jpg, .jpeg, .gif",headers:{"Content-Type":"application/octet-stream"},customRequest:function(f){var i=f.action,C=f.file,b=f.headers,g=f.onError,d=f.onProgress,n=f.onSuccess,m=f.withCredentials,v=C.name.lastIndexOf("."),y=C.name.substr(v+1),O=null;S.GetCosRequestURL({directory:"activity",fileExtension:y,method:"PUT"}).then(function(s){i=s.allUrl;var L=C.name.lastIndexOf("."),P=C.name.substr(L+1),X=new FileReader;if(["png","jpg","jpeg","bmp","gif","webp","psd","svg","tiff"].indexOf(P)==-1){w.default.error("".concat(C.name," \u4E0D\u662F\u56FE\u7247\u6587\u4EF6"));return}X.readAsArrayBuffer(C),X.onload=function(M){O=M.target.result,Ke().put(i,O,{withCredentials:m,headers:b,onUploadProgress:function(se){var fe=se.total,Ae=se.loaded;d({percent:Math.round(Ae/fe*100).toFixed(2)},C)}}).then(function(G){R.setFieldsValue({activityImg:s.seeUrl}),(G.status==200||G.statusText=="OK")&&H(s.seeUrl)}).catch(g)}})}};return(0,e.jsx)("div",{className:ne().activity_form_container,children:(0,e.jsxs)(t.Z,{form:R,name:"basic",labelCol:{span:3},initialValues:{remember:!0},onFinish:function(f){le(f)},layout:"vertical",autoComplete:"off",children:[(0,e.jsx)(t.Z.Item,{label:"\u6D3B\u52A8\u540D\u79F0",name:"activityName",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6D3B\u52A8\u540D\u79F0\uFF01"}],children:(0,e.jsx)(Z.Z,{style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u6D3B\u52A8\u540D\u79F0"})}),(0,e.jsx)(t.Z.Item,{label:"\u5546\u54C1\u4FE1\u606F",children:(0,e.jsx)(t.Z.List,{name:"activityRewards",children:function(f,i,C){var b=i.add,g=i.remove,d=C.errors;return(0,e.jsxs)(e.Fragment,{children:[f.map(function(n){var m=n.key,v=n.name,y=n.fieldKey,O=(0,ke.Z)(n,yu);return(0,e.jsxs)("div",{className:ne().common_form_row,children:[(0,e.jsx)(t.Z.Item,(0,x.Z)((0,x.Z)({},O),{},{name:[v,"rewardValue"],fieldKey:[y,"rewardValue"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5546\u54C1"}],children:(0,e.jsx)(u.Z,{style:{width:"200px"},children:Ze.map(function(s){return(0,e.jsx)(u.Z.Option,{value:s.id,children:s.name},s.id)})})})),(0,e.jsx)("div",{style:{margin:"0 10px 24px 10px"},children:"\u4FC3\u9500\u4EF7\uFF1A"}),(0,e.jsx)(t.Z.Item,(0,x.Z)((0,x.Z)({},O),{},{name:[v,"value"],fieldKey:[y,"value"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4FC3\u9500\u4EF7"}],children:(0,e.jsx)(Z.Z,{style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u4FC3\u9500\u4EF7"})})),(0,e.jsx)(Re.Z,{style:{fontSize:"25px",marginLeft:"20px",marginBottom:"24px"},onClick:function(){return g(v)}})]})}),(0,e.jsxs)(t.Z.Item,{children:[(0,e.jsx)(K.Z,{type:"dashed",onClick:function(){return b()},style:{width:"100%"},icon:(0,e.jsx)(be.Z,{}),children:"\u6DFB\u52A0"}),(0,e.jsx)(t.Z.ErrorList,{errors:d})]})]})}})}),(0,e.jsx)(t.Z.Item,{name:"activityStartAndEndTime",label:"\u8D77\u6B62\u65F6\u95F4",rules:[{required:!0}],children:(0,e.jsx)(ye.Z.RangePicker,{style:{width:"100%"}})}),(0,e.jsx)(t.Z.Item,{name:"remark",label:"\u5907\u6CE8",rules:[{required:!0,max:200}],children:(0,e.jsx)(Z.Z.TextArea,{rows:4,placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"})}),(0,e.jsx)(t.Z.Item,{name:"activityRule",label:"\u89C4\u5219\u8BF4\u660E",rules:[{required:!0,max:500}],children:(0,e.jsx)(Z.Z.TextArea,{rows:4,placeholder:"\u8BF7\u8F93\u5165\u89C4\u5219\u8BF4\u660E"})}),(0,e.jsx)(t.Z.Item,{name:"activityImg",label:"\u6D3B\u52A8\u56FE\u7247",rules:[{required:!0}],children:(0,e.jsx)(Te.Z,(0,x.Z)((0,x.Z)({},oe),{},{children:$?(0,e.jsx)(Ge.Z,{width:200,height:200,src:$,fallback:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyM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LAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="}):(0,e.jsx)(K.Z,{icon:(0,e.jsx)(Je.Z,{}),children:"\u4E0A\u4F20"})}))}),(0,e.jsx)(t.Z.Item,{name:"isAutoSend",label:"\u53C2\u4E0E\u65B9\u5F0F",rules:[{required:!0}],children:(0,e.jsxs)(u.Z,{placeholder:"\u8BF7\u9009\u62E9\u53C2\u4E0E\u65B9\u5F0F",children:[(0,e.jsx)(u.Z.Option,{value:0,children:"\u70B9\u51FB\u53C2\u4E0E\uFF08\u9700\u8981\u7528\u6237\u4E3B\u52A8\u70B9\u51FB\uFF09"}),(0,e.jsx)(u.Z.Option,{value:1,children:"\u81EA\u52A8\u53C2\u4E0E\uFF08\u6EE1\u8DB3\u7279\u5B9A\u6761\u4EF6\u81EA\u52A8\u53C2\u4E0E\uFF09"})]})}),(0,e.jsx)(t.Z.Item,{name:"activityConfig",label:"\u6D3B\u52A8\u914D\u7F6E",rules:[{required:!0,message:"\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6D3B\u52A8\u914D\u7F6E\uFF01"}],children:(0,e.jsx)(pe.Z.Group,{style:{width:"100%"},children:(0,e.jsx)(we.Z,{children:_e.map(function(T,f){return(0,e.jsxs)(Ne.Z,{span:24,style:{marginBottom:"10px",display:"flex",alignItems:"center"},children:[(0,e.jsxs)(pe.Z,{style:{minWidth:"230px"},value:T.configuration_Id,children:[T.configurationName,"\uFF1A",T.configurationRule]}),f===0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"weekOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"weekValue",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:280},size:"Small",mode:"multiple",placeholder:"\u661F\u671F",children:[(0,e.jsx)(u.Z.Option,{value:"1",children:"\u661F\u671F\u4E00"}),(0,e.jsx)(u.Z.Option,{value:"2",children:"\u661F\u671F\u4E8C"}),(0,e.jsx)(u.Z.Option,{value:"3",children:"\u661F\u671F\u4E09"}),(0,e.jsx)(u.Z.Option,{value:"4",children:"\u661F\u671F\u56DB"}),(0,e.jsx)(u.Z.Option,{value:"5",children:"\u661F\u671F\u4E94"}),(0,e.jsx)(u.Z.Option,{value:"6",children:"\u661F\u671F\u516D"}),(0,e.jsx)(u.Z.Option,{value:"0",children:"\u661F\u671F\u65E5"})]})})]}),f===1&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"storeOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"storeValue",noStyle:!0,children:(0,e.jsx)(u.Z,{style:{width:280},size:"Small",mode:"multiple",placeholder:"\u95E8\u5E97",children:ue.map(function(i){return(0,e.jsx)(u.Z.Option,{value:i.id,children:i.name},i.id)})})})]})]},f)})})})}),(0,e.jsxs)(t.Z.Item,{children:[(0,e.jsx)(K.Z,{type:"primary",htmlType:"submit",children:"\u63D0\u4EA4"}),(0,e.jsx)(K.Z,{style:{marginLeft:"20px"},onClick:function(){R.resetFields(),H(null)},children:"\u91CD\u7F6E"})]})]})})},Fu=Zu,ju=["key","name","fieldKey"],Me="coupon",eu=[{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"2B0F88D6-EDA0-4AAC-BB0B-DD34F3245C17",configurationName:"\u65E5\u53C2\u4E0E\u6B21\u6570\u9650\u5236",configurationRule:"\u6BCF\u65E5\u53C2\u4E0E\u6B21\u6570",valueType:1,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"8AC2A2BA-BB6E-4566-B147-ACF798146BBD",configurationName:"\u661F\u671F\u9650\u5236",configurationRule:"\u5305\u542B\u7684\u661F\u671F",valueType:2,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"9620CCF9-679E-44B1-B8FF-9B6F511208FA",configurationName:"\u6D88\u8D39\u91D1\u989D",configurationRule:"\u5355\u7B14\u8BA2\u5355\u6D88\u8D39\u91D1\u989D",valueType:1,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"AF62B336-15A6-453B-AD4A-61EB7D43B99B",configurationName:"\u5546\u54C1\u79CD\u7C7B\u9650\u5236",configurationRule:"\u5305\u542B\u7684\u5546\u54C1\u79CD\u7C7B",valueType:2,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"ECBACC1C-6BA8-498E-BDE4-6A012881E0E7",configurationName:"\u95E8\u5E97\u9650\u5236",configurationRule:"\u5305\u542B\u7684\u95E8\u5E97",valueType:2,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"F06DEAD8-DDB8-4B27-94E9-389DE9AC155D",configurationName:"\u603B\u53C2\u4E0E\u6B21\u6570\u9650\u5236",configurationRule:"\u603B\u53C2\u4E0E\u6B21\u6570",valueType:1,configurationValueCount:1}],Bu={labelCol:{sm:{span:4}},wrapperCol:{}},uu={wrapperCol:{sm:{span:500,offset:1}}},vu=function(N){var de=(0,D.useState)([]),W=(0,Q.Z)(de,2),R=W[0],re=W[1],z=function(){var o=(0,k.Z)((0,A.Z)().mark(function l(){var r;return(0,A.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,S.GetCouponCanUseCountAndLimit();case 2:r=c.sent,r.succeeded&&re(r.data);case 4:case"end":return c.stop()}},l)}));return function(){return o.apply(this,arguments)}}(),$=t.Z.useForm(),H=(0,Q.Z)($,1),V=H[0],ee=(0,D.useState)(null),ue=(0,Q.Z)(ee,2),ce=ue[0],ae=ue[1],me=(0,D.useState)(!1),_=(0,Q.Z)(me,2),Ze=_[0],te=_[1],ge=t.Z.useForm(),le=(0,Q.Z)(ge,1),oe=le[0],T=(0,D.useState)([]),f=(0,Q.Z)(T,2),i=f[0],C=f[1],b=function(){var o=(0,k.Z)((0,A.Z)().mark(function l(){return(0,A.Z)().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,S.GetCouponStatusOrType(2).then(function(c){c.succeeded&&C(c.data)});case 2:case"end":return p.stop()}},l)}));return function(){return o.apply(this,arguments)}}(),g=(0,D.useState)([]),d=(0,Q.Z)(g,2),n=d[0],m=d[1],v=(0,D.useState)([]),y=(0,Q.Z)(v,2),O=y[0],s=y[1],L=(0,D.useState)([]),P=(0,Q.Z)(L,2),X=P[0],M=P[1],G=function(){var o=(0,k.Z)((0,A.Z)().mark(function l(){var r,p;return(0,A.Z)().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,S.GetGoodsType();case 2:r=F.sent,r.statusCode===200&&(p=[],Object.keys(r.data).forEach(function(h){p.push({id:h,name:r.data[h]})}),s(p));case 4:case"end":return F.stop()}},l)}));return function(){return o.apply(this,arguments)}}(),se=function(){var o=(0,k.Z)((0,A.Z)().mark(function l(){var r,p,c,F=arguments;return(0,A.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return r=F.length>0&&F[0]!==void 0?F[0]:-1,a.next=3,S.GetGoodsById(r);case 3:p=a.sent,p.statusCode===200&&(c=[],Object.keys(p.data).forEach(function(E){c.push({id:E,name:p.data[E]})}),M(c));case 5:case"end":return a.stop()}},l)}));return function(){return o.apply(this,arguments)}}(),fe={name:"file",showUploadList:!1,multiple:!1,accept:".png, .jpg, .jpeg, .gif",headers:{"Content-Type":"application/octet-stream"},customRequest:function(l){var r=l.action,p=l.file,c=l.headers,F=l.onError,h=l.onProgress,a=l.onSuccess,E=l.withCredentials,I=p.name.lastIndexOf("."),B=p.name.substr(I+1),U=null;S.GetCosRequestURL({directory:"activity",fileExtension:B,method:"PUT"}).then(function(J){r=J.allUrl;var Y=p.name.lastIndexOf("."),he=p.name.substr(Y+1),je=new FileReader;if(["png","jpg","jpeg","bmp","gif","webp","psd","svg","tiff"].indexOf(he)==-1){w.default.error("".concat(p.name," \u4E0D\u662F\u56FE\u7247\u6587\u4EF6"));return}je.readAsArrayBuffer(p),je.onload=function(Se){U=Se.target.result,Ke().put(r,U,{withCredentials:E,headers:c,onUploadProgress:function(Be){var ve=Be.total,De=Be.loaded;h({percent:Math.round(De/ve*100).toFixed(2)},p)}}).then(function(Fe){V.setFieldsValue({activityImg:J.seeUrl}),(Fe.status==200||Fe.statusText=="OK")&&ae(J.seeUrl)}).catch(F)}})}},Ae=function(){var o=(0,k.Z)((0,A.Z)().mark(function l(){var r;return(0,A.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,S.GetStores();case 2:r=c.sent,r.statusCode===200&&m(r.data);case 4:case"end":return c.stop()}},l)}));return function(){return o.apply(this,arguments)}}(),Ie=function(){var o=(0,k.Z)((0,A.Z)().mark(function l(r){return(0,A.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return r.RangeType=1,w.default.loading("\u6B63\u5728\u6DFB\u52A0...",Me),c.prev=2,r.validEndTime<r.validStartTime&&w.default.error("\u5F00\u59CB\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u7ED3\u675F\u65F6\u95F4"),c.next=6,S.Addcoupon(JSON.stringify(r)).then(function(F){w.default.destroy(Me),F.data?(w.default.success("\u6DFB\u52A0\u6210\u529F"),z(),te(!1)):w.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 6:c.next=12;break;case 8:c.prev=8,c.t0=c.catch(2),w.default.destroy(Me),w.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01");case 12:case"end":return c.stop()}},l,null,[[2,8]])}));return function(r){return o.apply(this,arguments)}}(),xe=function(){var o=(0,k.Z)((0,A.Z)().mark(function l(r){var p,c,F;return(0,A.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,S.GetSelectedConfig(r);case 2:p=a.sent.data,c=[];for(F in p)c.push({id:F.toString(),name:p[F.toString()]});m(data),oe.setFieldsValue({Relation:[]});case 7:case"end":return a.stop()}},l)}));return function(r){return o.apply(this,arguments)}}(),Ce=function(){var o=(0,k.Z)((0,A.Z)().mark(function l(r){var p;return(0,A.Z)().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return r.activityType=4,r.activityRewards.forEach(function(h){h.id="",h.activityInfo_Id=""}),r.activityStartTime=Ee()(r.activityStartAndEndTime[0]).format("YYYY-MM-DD"),r.activityEndTime=Ee()(r.activityStartAndEndTime[1]).format("YYYY-MM-DD"),r.status=0,r.isShow=1,r.isDeleted=0,r.consumptionType=0,r.isGiftGoodsParticipate=0,r.activityConfiguration=[],r.activityConfig.forEach(function(h){var a=eu.find(function(E){return E.configuration_Id===h});a&&(a.configId=[a.configuration_Id],a.configurationName==="\u65E5\u53C2\u4E0E\u6B21\u6570\u9650\u5236"?(a.operator=r.dayOperator,a.value1=r.dayValue):a.configurationName==="\u661F\u671F\u9650\u5236"?(a.operator=r.weekOperator,a.value1=r.weekValue):a.configurationName==="\u6D88\u8D39\u91D1\u989D"?(a.operator=r.amountOperator,a.value1=r.amountValue):a.configurationName==="\u5546\u54C1\u79CD\u7C7B\u9650\u5236"?(a.operator=r.goodsTypeOperator,a.value1=r.goodsTypeValue):a.configurationName==="\u95E8\u5E97\u9650\u5236"?(a.operator=r.storeOperator,a.value1=r.storeValue):a.configurationName==="\u603B\u53C2\u4E0E\u6B21\u6570\u9650\u5236"&&(a.operator=r.totalOperator,a.value1=r.totalValue),r.activityConfiguration.push(a))}),delete r.activityConfig,delete r.activityStartAndEndTime,delete r.amountOperator,delete r.amountValue,delete r.dayOperator,delete r.dayValue,delete r.goodsTypeOperator,delete r.goodsTypeValue,delete r.storeOperator,delete r.storeValue,delete r.totalOperator,delete r.totalValue,delete r.weekOperator,delete r.weekValue,F.next=27,S.FastAddActivity(r);case 27:p=F.sent,p.statusCode===200?(w.default.success("\u65B0\u5EFA\u6D3B\u52A8\u6210\u529F\uFF01"),V.resetFields(),N.onSuccessCreate&&N.onSuccessCreate()):w.default.error(p.errors||"\u521B\u5EFA\u5931\u8D25 \u8BF7\u91CD\u8BD5\uFF01");case 29:case"end":return F.stop()}},l)}));return function(r){return o.apply(this,arguments)}}();return(0,D.useEffect)(function(){Ae(),z(),b(),G(),se()},[]),(0,e.jsxs)("div",{className:ne().activity_form_container,children:[(0,e.jsxs)(t.Z,{form:V,name:"basic",labelCol:{span:3},initialValues:{remember:!0},onFinish:function(l){Ce(l)},layout:"vertical",autoComplete:"off",children:[(0,e.jsx)(t.Z.Item,{label:"\u6D3B\u52A8\u540D\u79F0",name:"activityName",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6D3B\u52A8\u540D\u79F0\uFF01"}],children:(0,e.jsx)(Z.Z,{style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u6D3B\u52A8\u540D\u79F0"})}),(0,e.jsx)(t.Z.Item,{label:"\u6D88\u8D39\u91D1\u989D",children:(0,e.jsx)(t.Z.List,{name:"activityRewards",children:function(l,r,p){var c=r.add,F=r.remove,h=p.errors;return(0,e.jsxs)(e.Fragment,{children:[l.map(function(a){var E=a.key,I=a.name,B=a.fieldKey,U=(0,ke.Z)(a,ju);return(0,e.jsxs)("div",{className:ne().common_form_row,children:[(0,e.jsx)(t.Z.Item,(0,x.Z)((0,x.Z)({},U),{},{name:[I,"rewardValue"],fieldKey:[B,"rewardValue"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6D88\u8D39\u91D1\u989D"}],children:(0,e.jsx)(q.Z,{style:{width:"150px"},placeholder:"\u8BF7\u8F93\u5165\u6D88\u8D39\u91D1\u989D"})})),(0,e.jsx)("div",{style:{margin:"0 10px 24px 10px"},children:"\u8D60\u9001\u4F18\u60E0\u5238\uFF1A"}),(0,e.jsx)(t.Z.Item,(0,x.Z)((0,x.Z)({},U),{},{name:[I,"value"],fieldKey:[B,"value"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u4F18\u60E0\u5238"}],children:(0,e.jsx)(u.Z,{placeholder:"\u8BF7\u9009\u62E9\u4F18\u60E0\u5238",style:{width:"250px"},children:R.map(function(J,Y){return(0,e.jsx)(u.Z.Option,{index:Y,value:J.couponId,children:J.couponName},J.couponId)})})})),(0,e.jsx)(Ve.Z,{onClick:function(){return te(!0)},style:{margin:"0 10px 24px 10px",flexShrink:0,fontSize:"25px",color:"#F84352"}}),(0,e.jsx)(Re.Z,{style:{fontSize:"25px",marginLeft:"20px",marginBottom:"24px"},onClick:function(){return F(I)}})]})}),(0,e.jsxs)(t.Z.Item,{children:[(0,e.jsx)(K.Z,{type:"dashed",onClick:function(){return c()},style:{width:"100%"},icon:(0,e.jsx)(be.Z,{}),children:"\u6DFB\u52A0"}),(0,e.jsx)(t.Z.ErrorList,{errors:h})]})]})}})}),(0,e.jsx)(t.Z.Item,{name:"activityStartAndEndTime",label:"\u8D77\u6B62\u65F6\u95F4",rules:[{required:!0}],children:(0,e.jsx)(ye.Z.RangePicker,{style:{width:"100%"}})}),(0,e.jsx)(t.Z.Item,{name:"remark",label:"\u5907\u6CE8",rules:[{required:!0,max:200}],children:(0,e.jsx)(Z.Z.TextArea,{rows:4,placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"})}),(0,e.jsx)(t.Z.Item,{name:"activityRule",label:"\u89C4\u5219\u8BF4\u660E",rules:[{required:!0,max:500}],children:(0,e.jsx)(Z.Z.TextArea,{rows:4,placeholder:"\u8BF7\u8F93\u5165\u89C4\u5219\u8BF4\u660E"})}),(0,e.jsx)(t.Z.Item,{name:"activityImg",label:"\u6D3B\u52A8\u56FE\u7247",rules:[{required:!0}],children:(0,e.jsx)(Te.Z,(0,x.Z)((0,x.Z)({},fe),{},{children:ce?(0,e.jsx)(Ge.Z,{width:200,height:200,src:ce,fallback:"data:image/png;base64,iVBORw0KGgoAAA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F",rules:[{required:!0}],children:(0,e.jsxs)(u.Z,{placeholder:"\u8BF7\u9009\u62E9\u53C2\u4E0E\u65B9\u5F0F",children:[(0,e.jsx)(u.Z.Option,{value:0,children:"\u70B9\u51FB\u53C2\u4E0E\uFF08\u9700\u8981\u7528\u6237\u4E3B\u52A8\u70B9\u51FB\uFF09"}),(0,e.jsx)(u.Z.Option,{value:1,children:"\u81EA\u52A8\u53C2\u4E0E\uFF08\u6EE1\u8DB3\u7279\u5B9A\u6761\u4EF6\u81EA\u52A8\u53C2\u4E0E\uFF09"})]})}),(0,e.jsx)(t.Z.Item,{name:"activityConfig",label:"\u6D3B\u52A8\u914D\u7F6E",rules:[{required:!0,message:"\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6D3B\u52A8\u914D\u7F6E\uFF01"}],children:(0,e.jsx)(pe.Z.Group,{style:{width:"100%"},children:(0,e.jsx)(we.Z,{children:eu.map(function(o,l){return(0,e.jsxs)(Ne.Z,{span:24,style:{marginBottom:"10px",display:"flex",alignItems:"center"},children:[(0,e.jsxs)(pe.Z,{style:{minWidth:"230px"},value:o.configuration_Id,children:[o.configurationName,"\uFF1A",o.configurationRule]}),l===0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"dayOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"dayValue",noStyle:!0,children:(0,e.jsx)(Z.Z,{style:{width:280},placeholder:"\u6BCF\u65E5\u53C2\u4E0E\u6B21\u6570"})})]}),l===1&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"weekOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"weekValue",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:280},size:"Small",mode:"multiple",placeholder:"\u661F\u671F",children:[(0,e.jsx)(u.Z.Option,{value:"1",children:"\u661F\u671F\u4E00"}),(0,e.jsx)(u.Z.Option,{value:"2",children:"\u661F\u671F\u4E8C"}),(0,e.jsx)(u.Z.Option,{value:"3",children:"\u661F\u671F\u4E09"}),(0,e.jsx)(u.Z.Option,{value:"4",children:"\u661F\u671F\u56DB"}),(0,e.jsx)(u.Z.Option,{value:"5",children:"\u661F\u671F\u4E94"}),(0,e.jsx)(u.Z.Option,{value:"6",children:"\u661F\u671F\u516D"}),(0,e.jsx)(u.Z.Option,{value:"0",children:"\u661F\u671F\u65E5"})]})})]}),l===2&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"amountOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"amountValue",noStyle:!0,children:(0,e.jsx)(Z.Z,{style:{width:280},placeholder:"\u6D88\u8D39\u91D1\u989D"})})]}),l===3&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"goodsTypeOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"goodsTypeValue",noStyle:!0,children:(0,e.jsx)(u.Z,{style:{width:280},size:"Small",placeholder:"\u5546\u54C1\u79CD\u7C7B",mode:"multiple",children:O.map(function(r){return(0,e.jsx)(u.Z.Option,{value:r.id,children:r.name},r.id)})})})]}),l===4&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"storeOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"storeValue",noStyle:!0,children:(0,e.jsx)(u.Z,{style:{width:280},size:"Small",mode:"multiple",placeholder:"\u95E8\u5E97",children:n.map(function(r){return(0,e.jsx)(u.Z.Option,{value:r.id,children:r.name},r.id)})})})]}),l===5&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"totalOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"totalValue",noStyle:!0,children:(0,e.jsx)(Z.Z,{style:{width:280},placeholder:"\u603B\u6B21\u6570"})})]})]},l)})})})}),(0,e.jsxs)(t.Z.Item,{children:[(0,e.jsx)(K.Z,{type:"primary",htmlType:"submit",children:"\u63D0\u4EA4"}),(0,e.jsx)(K.Z,{style:{marginLeft:"20px"},onClick:function(){V.resetFields(),ae(null)},children:"\u91CD\u7F6E"})]})]}),(0,e.jsx)(Le.Z,{maskClosable:!1,title:"\u65B0\u5EFA\u4F18\u60E0\u5377",width:700,visible:Ze,footer:null,onCancel:function(){te(!1)},destroyOnClose:!0,children:(0,e.jsxs)(t.Z,(0,x.Z)((0,x.Z)({form:oe},Bu),{},{layout:"Horizontal",preserve:!1,onFinish:function(l){Ie(l)},children:[(0,e.jsx)(t.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(Z.Z,{})}),(0,e.jsx)(t.Z.Item,{name:"couponTitle",label:"\u4F18\u60E0\u5377\u6807\u9898",rules:[{required:!0,max:200}],children:(0,e.jsx)(Z.Z,{placeholder:"\u8BF7\u8F93\u5165\u4F18\u60E0\u5377\u6807\u9898"})}),(0,e.jsx)(t.Z.Item,{name:"couponType",label:"\u4F18\u60E0\u5377\u7C7B\u578B",rules:[{required:!0}],children:(0,e.jsx)(u.Z,{placeholder:"\u8BF7\u9009\u62E9\u4F18\u60E0\u5377\u7C7B\u578B",children:i.map(function(o){return(0,e.jsx)(u.Z.Option,{value:o.key,children:o.value},o.key)})})}),(0,e.jsxs)(t.Z.Item,(0,x.Z)((0,x.Z)({},uu),{},{style:{height:32},children:[(0,e.jsx)(t.Z.Item,{label:"\u4F18\u60E0\u91D1\u989D",style:{float:"left"},rules:[{required:!0}],children:(0,e.jsx)(t.Z.Item,{name:"couponValue",noStyle:!0,children:(0,e.jsx)(q.Z,{placeholder:"\u91D1\u989D",min:0,precision:2})})}),(0,e.jsx)(t.Z.Item,{label:"\u4F7F\u7528\u6761\u4EF6",style:{float:"left",marginLeft:10},rules:[{required:!0}],children:(0,e.jsx)(t.Z.Item,{name:"condition",noStyle:!0,children:(0,e.jsx)(q.Z,{placeholder:"\u4F7F\u7528\u6761\u4EF6",min:0,precision:2})})}),(0,e.jsxs)(t.Z.Item,{label:"\u6BCF\u4EBA\u53EF\u9886\u6570\u91CF",style:{float:"left",marginLeft:10},rules:[{required:!0}],children:[(0,e.jsx)(t.Z.Item,{name:"getLimit",noStyle:!0,children:(0,e.jsx)(q.Z,{placeholder:"\u53EF\u9886\u6570\u91CF",min:0,precision:0})}),(0,e.jsx)("span",{style:{color:"#FFCC52"},children:" 0 \u4E3A\u4E0D\u9650\u5236"})]})]})),(0,e.jsx)(t.Z.Item,{name:"timeType",label:"\u65F6\u95F4\u7C7B\u578B",rules:[{required:!0}],children:(0,e.jsxs)(u.Z,{children:[(0,e.jsx)(u.Z.Option,{value:1,children:"\u65F6\u95F4\u6BB5"}),(0,e.jsx)(u.Z.Option,{value:2,children:"\u56FA\u5B9A\u671F\u9650"})]})}),(0,e.jsx)(t.Z.Item,{noStyle:!0,shouldUpdate:function(l,r){return l.timeType!==r.timeType},children:function(l){var r=l.getFieldValue;return r("timeType")=="2"?(0,e.jsx)(t.Z.Item,{label:"\u56FA\u5B9A\u65F6\u95F4",rules:[{required:!0}],children:(0,e.jsx)(t.Z.Item,{name:"validFixedTerm",noStyle:!0,children:(0,e.jsx)(q.Z,{placeholder:"",precision:0,min:0})})}):(0,e.jsxs)(t.Z.Item,(0,x.Z)((0,x.Z)({},uu),{},{style:{height:32},children:[(0,e.jsx)(t.Z.Item,{name:"validStartTime",label:"\u5F00\u59CB\u65F6\u95F4",style:{float:"left"},rules:[{required:!0}],children:(0,e.jsx)(ye.Z,{placeholder:"\u5F00\u59CB\u65F6\u95F4"})}),(0,e.jsx)(t.Z.Item,{name:"validEndTime",label:"\u7ED3\u675F\u65F6\u95F4",style:{float:"left",marginLeft:20},rules:[{required:!0}],children:(0,e.jsx)(ye.Z,{placeholder:"\u7ED3\u675F\u65F6\u95F4"})})]}))}}),(0,e.jsx)(t.Z.Item,{name:"validStatus",label:"\u72B6\u6001",rules:[{required:!0}],children:(0,e.jsxs)(u.Z,{placeholder:"\u72B6\u6001",children:[(0,e.jsx)(Option,{value:1,children:"\u751F\u6548"}),(0,e.jsx)(Option,{value:2,children:"\u5931\u6548"}),(0,e.jsx)(Option,{value:3,children:"\u4F5C\u5E9F"})]})}),(0,e.jsxs)(t.Z.Item,{noStyle:!0,children:[(0,e.jsx)(t.Z.Item,{name:"remarks",label:"\u5907\u6CE8",rules:[{max:500}],children:(0,e.jsx)(Z.Z,{placeholder:"\u5907\u6CE8"})}),(0,e.jsx)("span",{style:{color:"#FFCC52",marginLeft:70},children:"\u6CE8: \u591A\u6761\u89C4\u5219\u8BF7\u7528 \xA0;\xA0 \u9694\u5F00\u3002 \xA0\xA0 \u5982\uFF1A1.xxxxxx\uFF1B 2.xxxxxx"})]}),(0,e.jsx)(t.Z.Item,{name:"Coupon_Id",hidden:!0,children:(0,e.jsx)(Z.Z,{})}),(0,e.jsx)(t.Z.Item,{name:"SendNum",label:"\u53D1\u653E\u6570\u91CF",rules:[{required:!0}],children:(0,e.jsx)(q.Z,{placeholder:"\u53D1\u653E\u6570\u91CF",min:0,style:{width:"510px"}})}),(0,e.jsx)(t.Z.Item,{name:"RangeType",label:"\u9002\u7528\u8303\u56F4\u7C7B\u578B",hidden:!0,defaultValue:1,children:(0,e.jsxs)(u.Z,{placeholder:"\u53D1\u653E\u8303\u56F4",onSelect:xe,defaultValue:1,children:[(0,e.jsx)(u.Z.Option,{value:"1",children:"\u5E97\u94FA"}),(0,e.jsx)(u.Z.Option,{value:"3",children:"\u533A\u57DF"})]})}),(0,e.jsx)(t.Z.Item,{name:"Relation",label:"\u9002\u7528\u8303\u56F4",rules:[{required:!0}],defaultValue:"1",children:(0,e.jsx)(u.Z,{placeholder:"\u9002\u7528\u8303\u56F4",filterOption:!1,mode:"multiple",children:n.map(function(o){return(0,e.jsx)(u.Z.Option,{value:o.id,children:o.name},o.id)})})}),(0,e.jsx)(t.Z.Item,{name:"applyGoodType",label:"\u9002\u7528\u5546\u54C1\u7C7B\u578B",children:(0,e.jsx)(u.Z,{placeholder:"\u9002\u7528\u5546\u54C1\u7C7B\u578B",filterOption:!1,onChange:function(l){se(l)},children:O.map(function(o){return(0,e.jsx)(u.Z.Option,{value:o.id,children:o.name},o.id)})})}),(0,e.jsx)(t.Z.Item,{name:"goodsRelation",label:"\u9002\u7528\u5546\u54C1\u8303\u56F4",children:(0,e.jsx)(u.Z,{placeholder:"\u9002\u7528\u5546\u54C1\u8303\u56F4",filterOption:!1,mode:"multiple",children:X.map(function(o){return(0,e.jsx)(u.Z.Option,{value:o.id,children:o.name},o.id)})})}),(0,e.jsx)(t.Z.Item,{name:"Status",label:"\u72B6\u6001",rules:[{required:!0}],defaultValue:"1",children:(0,e.jsxs)(u.Z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",children:[(0,e.jsx)(u.Z.Option,{value:"1",children:"\u542F\u7528"}),(0,e.jsx)(u.Z.Option,{value:"0",children:"\u7981\u7528"})]})}),(0,e.jsx)(t.Z.Item,{name:"Remark",label:"\u5907\u6CE8",children:(0,e.jsx)(Z.Z,{placeholder:"\u5907\u6CE8"})}),(0,e.jsx)(t.Z.Item,{children:(0,e.jsx)(K.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})})]}))})]})},Cu=vu,Qu=["key","name","fieldKey"],tu=[{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"2B0F88D6-EDA0-4AAC-BB0B-DD34F3245C17",configurationName:"\u65E5\u53C2\u4E0E\u6B21\u6570\u9650\u5236",configurationRule:"\u6BCF\u65E5\u53C2\u4E0E\u6B21\u6570",valueType:1,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"8AC2A2BA-BB6E-4566-B147-ACF798146BBD",configurationName:"\u661F\u671F\u9650\u5236",configurationRule:"\u5305\u542B\u7684\u661F\u671F",valueType:2,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"9620CCF9-679E-44B1-B8FF-9B6F511208FA",configurationName:"\u6D88\u8D39\u91D1\u989D",configurationRule:"\u5355\u7B14\u8BA2\u5355\u6D88\u8D39\u91D1\u989D",valueType:1,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"AF62B336-15A6-453B-AD4A-61EB7D43B99B",configurationName:"\u5546\u54C1\u79CD\u7C7B\u9650\u5236",configurationRule:"\u5305\u542B\u7684\u5546\u54C1\u79CD\u7C7B",valueType:2,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"ECBACC1C-6BA8-498E-BDE4-6A012881E0E7",configurationName:"\u95E8\u5E97\u9650\u5236",configurationRule:"\u5305\u542B\u7684\u95E8\u5E97",valueType:2,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"F06DEAD8-DDB8-4B27-94E9-389DE9AC155D",configurationName:"\u603B\u53C2\u4E0E\u6B21\u6570\u9650\u5236",configurationRule:"\u603B\u53C2\u4E0E\u6B21\u6570",valueType:1,configurationValueCount:1}],Iu=function(N){var de=(0,D.useState)([]),W=(0,Q.Z)(de,2),R=W[0],re=W[1],z=function(){var g=(0,k.Z)((0,A.Z)().mark(function d(){var n,m,v,y=arguments;return(0,A.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return n=y.length>0&&y[0]!==void 0?y[0]:-1,s.next=3,S.GetGoodsById(n);case 3:m=s.sent,m.statusCode===200&&(v=[],Object.keys(m.data).forEach(function(L){v.push({id:L,name:m.data[L]})}),re(v));case 5:case"end":return s.stop()}},d)}));return function(){return g.apply(this,arguments)}}(),$=(0,D.useState)([]),H=(0,Q.Z)($,2),V=H[0],ee=H[1],ue=function(){var g=(0,k.Z)((0,A.Z)().mark(function d(){var n,m;return(0,A.Z)().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,S.GetGoodsType();case 2:n=y.sent,n.statusCode===200&&(m=[],Object.keys(n.data).forEach(function(O){m.push({id:O,name:n.data[O]})}),ee(m));case 4:case"end":return y.stop()}},d)}));return function(){return g.apply(this,arguments)}}(),ce=(0,D.useState)([]),ae=(0,Q.Z)(ce,2),me=ae[0],_=ae[1],Ze=function(){var g=(0,k.Z)((0,A.Z)().mark(function d(){var n;return(0,A.Z)().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,S.GetStores();case 2:n=v.sent,n.statusCode===200&&_(n.data);case 4:case"end":return v.stop()}},d)}));return function(){return g.apply(this,arguments)}}(),te=t.Z.useForm(),ge=(0,Q.Z)(te,1),le=ge[0],oe=(0,D.useState)(null),T=(0,Q.Z)(oe,2),f=T[0],i=T[1],C={name:"file",showUploadList:!1,multiple:!1,accept:".png, .jpg, .jpeg, .gif",headers:{"Content-Type":"application/octet-stream"},customRequest:function(d){var n=d.action,m=d.file,v=d.headers,y=d.onError,O=d.onProgress,s=d.onSuccess,L=d.withCredentials,P=m.name.lastIndexOf("."),X=m.name.substr(P+1),M=null;S.GetCosRequestURL({directory:"activity",fileExtension:X,method:"PUT"}).then(function(G){n=G.allUrl;var se=m.name.lastIndexOf("."),fe=m.name.substr(se+1),Ae=new FileReader;if(["png","jpg","jpeg","bmp","gif","webp","psd","svg","tiff"].indexOf(fe)==-1){w.default.error("".concat(m.name," \u4E0D\u662F\u56FE\u7247\u6587\u4EF6"));return}Ae.readAsArrayBuffer(m),Ae.onload=function(Ie){M=Ie.target.result,Ke().put(n,M,{withCredentials:L,headers:v,onUploadProgress:function(Ce){var o=Ce.total,l=Ce.loaded;O({percent:Math.round(l/o*100).toFixed(2)},m)}}).then(function(xe){le.setFieldsValue({activityImg:G.seeUrl}),(xe.status==200||xe.statusText=="OK")&&i(G.seeUrl)}).catch(y)}})}},b=function(){var g=(0,k.Z)((0,A.Z)().mark(function d(n){var m;return(0,A.Z)().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return n.activityType=5,n.activityRewards.forEach(function(O){O.id="",O.activityInfo_Id=""}),n.activityStartTime=Ee()(n.activityStartAndEndTime[0]).format("YYYY-MM-DD"),n.activityEndTime=Ee()(n.activityStartAndEndTime[1]).format("YYYY-MM-DD"),n.status=0,n.isShow=1,n.isDeleted=0,n.consumptionType=0,n.isGiftGoodsParticipate=0,n.activityConfiguration=[],n.activityConfig.forEach(function(O){var s=tu.find(function(L){return L.configuration_Id===O});s&&(s.configId=[s.configuration_Id],s.configurationName==="\u65E5\u53C2\u4E0E\u6B21\u6570\u9650\u5236"?(s.operator=n.dayOperator,s.value1=n.dayValue):s.configurationName==="\u661F\u671F\u9650\u5236"?(s.operator=n.weekOperator,s.value1=n.weekValue):s.configurationName==="\u6D88\u8D39\u91D1\u989D"?(s.operator=n.amountOperator,s.value1=n.amountValue):s.configurationName==="\u5546\u54C1\u79CD\u7C7B\u9650\u5236"?(s.operator=n.goodsTypeOperator,s.value1=n.goodsTypeValue):s.configurationName==="\u95E8\u5E97\u9650\u5236"?(s.operator=n.storeOperator,s.value1=n.storeValue):s.configurationName==="\u603B\u53C2\u4E0E\u6B21\u6570\u9650\u5236"&&(s.operator=n.totalOperator,s.value1=n.totalValue),n.activityConfiguration.push(s))}),delete n.activityConfig,delete n.activityStartAndEndTime,delete n.amountOperator,delete n.amountValue,delete n.dayOperator,delete n.dayValue,delete n.goodsTypeOperator,delete n.goodsTypeValue,delete n.storeOperator,delete n.storeValue,delete n.totalOperator,delete n.totalValue,delete n.weekOperator,delete n.weekValue,y.next=27,S.FastAddActivity(n);case 27:m=y.sent,m.statusCode===200?(w.default.success("\u65B0\u5EFA\u6D3B\u52A8\u6210\u529F\uFF01"),le.resetFields(),N.onSuccessCreate&&N.onSuccessCreate()):w.default.error(m.errors||"\u521B\u5EFA\u5931\u8D25 \u8BF7\u91CD\u8BD5\uFF01");case 29:case"end":return y.stop()}},d)}));return function(n){return g.apply(this,arguments)}}();return(0,D.useEffect)(function(){z(),ue(),Ze()},[]),(0,e.jsx)("div",{className:ne().activity_form_container,children:(0,e.jsxs)(t.Z,{form:le,name:"basic",labelCol:{span:3},initialValues:{remember:!0},onFinish:function(d){b(d)},layout:"vertical",autoComplete:"off",children:[(0,e.jsx)(t.Z.Item,{label:"\u6D3B\u52A8\u540D\u79F0",name:"activityName",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6D3B\u52A8\u540D\u79F0\uFF01"}],children:(0,e.jsx)(Z.Z,{style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u6D3B\u52A8\u540D\u79F0"})}),(0,e.jsx)(t.Z.Item,{label:"\u6D88\u8D39\u91D1\u989D",children:(0,e.jsx)(t.Z.List,{name:"activityRewards",children:function(d,n,m){var v=n.add,y=n.remove,O=m.errors;return(0,e.jsxs)(e.Fragment,{children:[d.map(function(s){var L=s.key,P=s.name,X=s.fieldKey,M=(0,ke.Z)(s,Qu);return(0,e.jsxs)("div",{className:ne().common_form_row,children:[(0,e.jsx)(t.Z.Item,(0,x.Z)((0,x.Z)({},M),{},{name:[P,"rewardValue"],fieldKey:[X,"rewardValue"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6D88\u8D39\u91D1\u989D"}],children:(0,e.jsx)(q.Z,{style:{width:"200px"},placeholder:"\u8BF7\u8F93\u5165\u6D88\u8D39\u91D1\u989D"})})),(0,e.jsx)("div",{style:{margin:"0 10px 24px 10px"},children:"\u8D60\u9001\u5546\u54C1\uFF1A"}),(0,e.jsx)(t.Z.Item,(0,x.Z)((0,x.Z)({},M),{},{name:[P,"value"],fieldKey:[X,"value"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5546\u54C1"}],children:(0,e.jsx)(u.Z,{placeholder:"\u8BF7\u9009\u62E9\u5546\u54C1",style:{width:"250px"},children:R.map(function(G){return(0,e.jsx)(u.Z.Option,{value:G.id,children:G.name},G.id)})})})),(0,e.jsx)(Re.Z,{style:{fontSize:"25px",marginLeft:"20px",marginBottom:"24px"},onClick:function(){return y(P)}})]})}),(0,e.jsxs)(t.Z.Item,{children:[(0,e.jsx)(K.Z,{type:"dashed",onClick:function(){return v()},style:{width:"100%"},icon:(0,e.jsx)(be.Z,{}),children:"\u6DFB\u52A0"}),(0,e.jsx)(t.Z.ErrorList,{errors:O})]})]})}})}),(0,e.jsx)(t.Z.Item,{name:"activityStartAndEndTime",label:"\u8D77\u6B62\u65F6\u95F4",rules:[{required:!0}],children:(0,e.jsx)(ye.Z.RangePicker,{style:{width:"100%"}})}),(0,e.jsx)(t.Z.Item,{name:"remark",label:"\u5907\u6CE8",rules:[{required:!0,max:200}],children:(0,e.jsx)(Z.Z.TextArea,{rows:4,placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"})}),(0,e.jsx)(t.Z.Item,{name:"activityRule",label:"\u89C4\u5219\u8BF4\u660E",rules:[{required:!0,max:500}],children:(0,e.jsx)(Z.Z.TextArea,{rows:4,placeholder:"\u8BF7\u8F93\u5165\u89C4\u5219\u8BF4\u660E"})}),(0,e.jsx)(t.Z.Item,{name:"activityImg",label:"\u6D3B\u52A8\u56FE\u7247",rules:[{required:!0}],children:(0,e.jsx)(Te.Z,(0,x.Z)((0,x.Z)({},C),{},{children:f?(0,e.jsx)(Ge.Z,{width:200,height:200,src:f,fallback:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMI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Ax1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="}):(0,e.jsx)(K.Z,{icon:(0,e.jsx)(Je.Z,{}),children:"\u4E0A\u4F20"})}))}),(0,e.jsx)(t.Z.Item,{name:"isAutoSend",label:"\u53C2\u4E0E\u65B9\u5F0F",rules:[{required:!0}],children:(0,e.jsxs)(u.Z,{placeholder:"\u8BF7\u9009\u62E9\u53C2\u4E0E\u65B9\u5F0F",children:[(0,e.jsx)(u.Z.Option,{value:0,children:"\u70B9\u51FB\u53C2\u4E0E\uFF08\u9700\u8981\u7528\u6237\u4E3B\u52A8\u70B9\u51FB\uFF09"}),(0,e.jsx)(u.Z.Option,{value:1,children:"\u81EA\u52A8\u53C2\u4E0E\uFF08\u6EE1\u8DB3\u7279\u5B9A\u6761\u4EF6\u81EA\u52A8\u53C2\u4E0E\uFF09"})]})}),(0,e.jsx)(t.Z.Item,{name:"activityConfig",label:"\u6D3B\u52A8\u914D\u7F6E",rules:[{required:!0,message:"\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6D3B\u52A8\u914D\u7F6E\uFF01"}],children:(0,e.jsx)(pe.Z.Group,{style:{width:"100%"},children:(0,e.jsx)(we.Z,{children:tu.map(function(g,d){return(0,e.jsxs)(Ne.Z,{span:24,style:{marginBottom:"10px",display:"flex",alignItems:"center"},children:[(0,e.jsxs)(pe.Z,{style:{minWidth:"230px"},value:g.configuration_Id,children:[g.configurationName,"\uFF1A",g.configurationRule]}),d===0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"dayOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"dayValue",noStyle:!0,children:(0,e.jsx)(Z.Z,{style:{width:280},placeholder:"\u6BCF\u65E5\u53C2\u4E0E\u6B21\u6570"})})]}),d===1&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"weekOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"weekValue",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:280},size:"Small",mode:"multiple",placeholder:"\u661F\u671F",children:[(0,e.jsx)(u.Z.Option,{value:"1",children:"\u661F\u671F\u4E00"}),(0,e.jsx)(u.Z.Option,{value:"2",children:"\u661F\u671F\u4E8C"}),(0,e.jsx)(u.Z.Option,{value:"3",children:"\u661F\u671F\u4E09"}),(0,e.jsx)(u.Z.Option,{value:"4",children:"\u661F\u671F\u56DB"}),(0,e.jsx)(u.Z.Option,{value:"5",children:"\u661F\u671F\u4E94"}),(0,e.jsx)(u.Z.Option,{value:"6",children:"\u661F\u671F\u516D"}),(0,e.jsx)(u.Z.Option,{value:"0",children:"\u661F\u671F\u65E5"})]})})]}),d===2&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"amountOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"amountValue",noStyle:!0,children:(0,e.jsx)(Z.Z,{style:{width:280},placeholder:"\u6D88\u8D39\u91D1\u989D"})})]}),d===3&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"goodsTypeOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"goodsTypeValue",noStyle:!0,children:(0,e.jsx)(u.Z,{style:{width:280},size:"Small",placeholder:"\u5546\u54C1\u79CD\u7C7B",mode:"multiple",children:V.map(function(n){return(0,e.jsx)(u.Z.Option,{value:n.id,children:n.name},n.id)})})})]}),d===4&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"storeOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"storeValue",noStyle:!0,children:(0,e.jsx)(u.Z,{style:{width:280},size:"Small",mode:"multiple",placeholder:"\u95E8\u5E97",children:me.map(function(n){return(0,e.jsx)(u.Z.Option,{value:n.id,children:n.name},n.id)})})})]}),d===5&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"totalOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"totalValue",noStyle:!0,children:(0,e.jsx)(Z.Z,{style:{width:280},placeholder:"\u603B\u6B21\u6570"})})]})]},d)})})})}),(0,e.jsxs)(t.Z.Item,{children:[(0,e.jsx)(K.Z,{type:"primary",htmlType:"submit",children:"\u63D0\u4EA4"}),(0,e.jsx)(K.Z,{style:{marginLeft:"20px"},onClick:function(){le.resetFields(),i(null)},children:"\u91CD\u7F6E"})]})]})})},Su=Iu,Du=["key","name","fieldKey"],qe="coupon",nu=[{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"2B0F88D6-EDA0-4AAC-BB0B-DD34F3245C17",configurationName:"\u65E5\u53C2\u4E0E\u6B21\u6570\u9650\u5236",configurationRule:"\u6BCF\u65E5\u53C2\u4E0E\u6B21\u6570",valueType:1,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"8AC2A2BA-BB6E-4566-B147-ACF798146BBD",configurationName:"\u661F\u671F\u9650\u5236",configurationRule:"\u5305\u542B\u7684\u661F\u671F",valueType:2,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"9620CCF9-679E-44B1-B8FF-9B6F511208FA",configurationName:"\u6D88\u8D39\u91D1\u989D",configurationRule:"\u5355\u7B14\u8BA2\u5355\u6D88\u8D39\u91D1\u989D",valueType:1,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"AF62B336-15A6-453B-AD4A-61EB7D43B99B",configurationName:"\u5546\u54C1\u79CD\u7C7B\u9650\u5236",configurationRule:"\u5305\u542B\u7684\u5546\u54C1\u79CD\u7C7B",valueType:2,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"ECBACC1C-6BA8-498E-BDE4-6A012881E0E7",configurationName:"\u95E8\u5E97\u9650\u5236",configurationRule:"\u5305\u542B\u7684\u95E8\u5E97",valueType:2,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"F06DEAD8-DDB8-4B27-94E9-389DE9AC155D",configurationName:"\u603B\u53C2\u4E0E\u6B21\u6570\u9650\u5236",configurationRule:"\u603B\u53C2\u4E0E\u6B21\u6570",valueType:1,configurationValueCount:1}],Ou={labelCol:{sm:{span:4}},wrapperCol:{}},ru={wrapperCol:{sm:{span:500,offset:1}}},wu=function(N){var de=(0,D.useState)([]),W=(0,Q.Z)(de,2),R=W[0],re=W[1],z=function(){var o=(0,k.Z)((0,A.Z)().mark(function l(){var r;return(0,A.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,S.GetCouponCanUseCountAndLimit();case 2:r=c.sent,r.succeeded&&re(r.data);case 4:case"end":return c.stop()}},l)}));return function(){return o.apply(this,arguments)}}(),$=t.Z.useForm(),H=(0,Q.Z)($,1),V=H[0],ee=(0,D.useState)(null),ue=(0,Q.Z)(ee,2),ce=ue[0],ae=ue[1],me=(0,D.useState)(!1),_=(0,Q.Z)(me,2),Ze=_[0],te=_[1],ge=t.Z.useForm(),le=(0,Q.Z)(ge,1),oe=le[0],T=(0,D.useState)([]),f=(0,Q.Z)(T,2),i=f[0],C=f[1],b=(0,D.useState)([]),g=(0,Q.Z)(b,2),d=g[0],n=g[1],m=function(){var o=(0,k.Z)((0,A.Z)().mark(function l(){var r,p,c,F=arguments;return(0,A.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return r=F.length>0&&F[0]!==void 0?F[0]:-1,a.next=3,S.GetGoodsById(r);case 3:p=a.sent,p.statusCode===200&&(c=[],Object.keys(p.data).forEach(function(E){c.push({id:E,name:p.data[E]})}),n(c));case 5:case"end":return a.stop()}},l)}));return function(){return o.apply(this,arguments)}}(),v=function(){var o=(0,k.Z)((0,A.Z)().mark(function l(){var r;return(0,A.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,S.GetStores();case 2:r=c.sent,r.statusCode===200&&P(r.data);case 4:case"end":return c.stop()}},l)}));return function(){return o.apply(this,arguments)}}(),y=function(){var o=(0,k.Z)((0,A.Z)().mark(function l(){return(0,A.Z)().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return p.next=2,S.GetCouponStatusOrType(2).then(function(c){c.succeeded&&C(c.data)});case 2:case"end":return p.stop()}},l)}));return function(){return o.apply(this,arguments)}}(),O=(0,D.useState)([]),s=(0,Q.Z)(O,2),L=s[0],P=s[1],X=(0,D.useState)([]),M=(0,Q.Z)(X,2),G=M[0],se=M[1],fe=function(){var o=(0,k.Z)((0,A.Z)().mark(function l(){var r,p;return(0,A.Z)().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,S.GetGoodsType();case 2:r=F.sent,r.statusCode===200&&(p=[],Object.keys(r.data).forEach(function(h){p.push({id:h,name:r.data[h]})}),se(p));case 4:case"end":return F.stop()}},l)}));return function(){return o.apply(this,arguments)}}(),Ae={name:"file",showUploadList:!1,multiple:!1,accept:".png, .jpg, .jpeg, .gif",headers:{"Content-Type":"application/octet-stream"},customRequest:function(l){var r=l.action,p=l.file,c=l.headers,F=l.onError,h=l.onProgress,a=l.onSuccess,E=l.withCredentials,I=p.name.lastIndexOf("."),B=p.name.substr(I+1),U=null;S.GetCosRequestURL({directory:"activity",fileExtension:B,method:"PUT"}).then(function(J){r=J.allUrl;var Y=p.name.lastIndexOf("."),he=p.name.substr(Y+1),je=new FileReader;if(["png","jpg","jpeg","bmp","gif","webp","psd","svg","tiff"].indexOf(he)==-1){w.default.error("".concat(p.name," \u4E0D\u662F\u56FE\u7247\u6587\u4EF6"));return}je.readAsArrayBuffer(p),je.onload=function(Se){U=Se.target.result,Ke().put(r,U,{withCredentials:E,headers:c,onUploadProgress:function(Be){var ve=Be.total,De=Be.loaded;h({percent:Math.round(De/ve*100).toFixed(2)},p)}}).then(function(Fe){V.setFieldsValue({activityImg:J.seeUrl}),(Fe.status==200||Fe.statusText=="OK")&&ae(J.seeUrl)}).catch(F)}})}},Ie=function(){var o=(0,k.Z)((0,A.Z)().mark(function l(r){return(0,A.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return r.RangeType=1,w.default.loading("\u6B63\u5728\u6DFB\u52A0...",qe),c.prev=2,r.validEndTime<r.validStartTime&&w.default.error("\u5F00\u59CB\u65F6\u95F4\u4E0D\u80FD\u5927\u4E8E\u7ED3\u675F\u65F6\u95F4"),c.next=6,S.Addcoupon(JSON.stringify(r)).then(function(F){w.default.destroy(qe),F.data?(w.default.success("\u6DFB\u52A0\u6210\u529F"),z(),te(!1)):w.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 6:c.next=12;break;case 8:c.prev=8,c.t0=c.catch(2),w.default.destroy(qe),w.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01");case 12:case"end":return c.stop()}},l,null,[[2,8]])}));return function(r){return o.apply(this,arguments)}}(),xe=function(){var o=(0,k.Z)((0,A.Z)().mark(function l(r){var p,c,F;return(0,A.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,S.GetSelectedConfig(r);case 2:p=a.sent.data,c=[];for(F in p)c.push({id:F.toString(),name:p[F.toString()]});P(data),oe.setFieldsValue({Relation:[]});case 7:case"end":return a.stop()}},l)}));return function(r){return o.apply(this,arguments)}}(),Ce=function(){var o=(0,k.Z)((0,A.Z)().mark(function l(r){var p;return(0,A.Z)().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return r.activityType=N.currentActivityType,r.activityRewards.forEach(function(h){h.id="",h.activityInfo_Id=""}),r.activityStartTime=Ee()(r.activityStartAndEndTime[0]).format("YYYY-MM-DD"),r.activityEndTime=Ee()(r.activityStartAndEndTime[1]).format("YYYY-MM-DD"),r.status=0,r.isShow=1,r.isDeleted=0,r.activityConfiguration=[],r.activityConfig.forEach(function(h){var a=nu.find(function(E){return E.configuration_Id===h});a&&(a.configId=[a.configuration_Id],a.configurationName==="\u65E5\u53C2\u4E0E\u6B21\u6570\u9650\u5236"?(a.operator=r.dayOperator,a.value1=r.dayValue):a.configurationName==="\u661F\u671F\u9650\u5236"?(a.operator=r.weekOperator,a.value1=r.weekValue):a.configurationName==="\u6D88\u8D39\u91D1\u989D"?(a.operator=r.amountOperator,a.value1=r.amountValue):a.configurationName==="\u5546\u54C1\u79CD\u7C7B\u9650\u5236"?(a.operator=r.goodsTypeOperator,a.value1=r.goodsTypeValue):a.configurationName==="\u95E8\u5E97\u9650\u5236"?(a.operator=r.storeOperator,a.value1=r.storeValue):a.configurationName==="\u603B\u53C2\u4E0E\u6B21\u6570\u9650\u5236"&&(a.operator=r.totalOperator,a.value1=r.totalValue),r.activityConfiguration.push(a))}),delete r.activityConfig,delete r.activityStartAndEndTime,delete r.amountOperator,delete r.amountValue,delete r.dayOperator,delete r.dayValue,delete r.goodsTypeOperator,delete r.goodsTypeValue,delete r.storeOperator,delete r.storeValue,delete r.totalOperator,delete r.totalValue,delete r.weekOperator,delete r.weekValue,F.next=25,S.FastAddActivity(r);case 25:p=F.sent,p.statusCode===200?(w.default.success("\u65B0\u5EFA\u6D3B\u52A8\u6210\u529F\uFF01"),V.resetFields(),N.onSuccessCreate&&N.onSuccessCreate()):w.default.error(p.errors||"\u521B\u5EFA\u5931\u8D25 \u8BF7\u91CD\u8BD5\uFF01");case 27:case"end":return F.stop()}},l)}));return function(r){return o.apply(this,arguments)}}();return(0,D.useEffect)(function(){y(),z(),fe(),v(),m()},[]),(0,e.jsxs)("div",{className:ne().activity_form_container,children:[(0,e.jsxs)(t.Z,{form:V,name:"basic",labelCol:{span:3},initialValues:{remember:!0},onFinish:function(l){Ce(l)},layout:"vertical",autoComplete:"off",children:[(0,e.jsx)(t.Z.Item,{label:"\u6D3B\u52A8\u540D\u79F0",name:"activityName",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6D3B\u52A8\u540D\u79F0\uFF01"}],children:(0,e.jsx)(Z.Z,{style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u6D3B\u52A8\u540D\u79F0"})}),(0,e.jsxs)(t.Z.Item,{children:[(0,e.jsx)(t.Z.Item,{name:"isGiftGoodsParticipate",label:"\u8D60\u9001\u5546\u54C1\u662F\u5426\u53C2\u4E0E\u6D3B\u52A8",rules:[{required:!0}],children:(0,e.jsxs)(u.Z,{showSearch:!0,optionFilterProp:"children",filterOption:function(l,r){return r.children.toLowerCase().indexOf(l.toLowerCase())>=0},placeholder:"\u8BF7\u9009\u6D3B\u52A8\u6D88\u8D39\u7C7B\u578B",children:[(0,e.jsx)(Option,{value:1,children:"\u662F"},1),(0,e.jsx)(Option,{value:0,children:"\u5426"},0)]})}),(0,e.jsx)(t.Z.Item,{name:"consumptionType",label:"\u6D3B\u52A8\u6D88\u8D39\u7C7B\u578B",rules:[{required:!0}],children:(0,e.jsxs)(u.Z,{showSearch:!0,optionFilterProp:"children",filterOption:function(l,r){return r.children.toLowerCase().indexOf(l.toLowerCase())>=0},placeholder:"\u8BF7\u9009\u6D3B\u52A8\u6D88\u8D39\u7C7B\u578B",children:[(0,e.jsx)(u.Z.Option,{value:1,children:"\u94B1\uFF08\u5143\uFF09"},1),(0,e.jsx)(u.Z.Option,{value:2,children:"\u6570\u91CF\uFF08\u676F/\u7897/\u76D2/\u4E2A/.....\uFF09"},2)]})})]}),(0,e.jsx)(t.Z.Item,{label:"\u6D88\u8D39\u6B21\u6570",children:(0,e.jsx)(t.Z.List,{name:"activityRewards",children:function(l,r,p){var c=r.add,F=r.remove,h=p.errors;return(0,e.jsxs)(e.Fragment,{children:[l.map(function(a){var E=a.key,I=a.name,B=a.fieldKey,U=(0,ke.Z)(a,Du);return(0,e.jsxs)("div",{className:ne().common_form_row,children:[(0,e.jsx)(t.Z.Item,(0,x.Z)((0,x.Z)({},U),{},{name:[I,"rewardValue"],fieldKey:[B,"rewardValue"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6D88\u8D39\u6B21\u6570"}],children:(0,e.jsx)(q.Z,{style:{width:"150px"},placeholder:"\u8BF7\u8F93\u5165\u6D88\u8D39\u6B21\u6570"})})),(0,e.jsx)("div",{style:{margin:"0 10px 24px 20px"},children:"\u8D60\u9001\u4F18\u60E0\u5238\uFF1A"}),(0,e.jsx)(t.Z.Item,(0,x.Z)((0,x.Z)({},U),{},{name:[I,"value"],fieldKey:[B,"value"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u4F18\u60E0\u5238"}],children:(0,e.jsx)(u.Z,{placeholder:"\u8BF7\u9009\u62E9\u4F18\u60E0\u5238",style:{width:"230px"},children:R.map(function(J,Y){return(0,e.jsx)(u.Z.Option,{index:Y,value:J.couponId,children:J.couponName},J.couponId)})})})),(0,e.jsx)(Ve.Z,{onClick:function(){return te(!0)},style:{margin:"0 10px",flexShrink:0,marginBottom:"24px",fontSize:"25px",color:"#F84352"}}),(0,e.jsx)(Re.Z,{style:{fontSize:"25px",marginLeft:"20px",marginBottom:"24px"},onClick:function(){return F(I)}})]})}),(0,e.jsxs)(t.Z.Item,{children:[(0,e.jsx)(K.Z,{type:"dashed",onClick:function(){N.currentActivityType===7&&l.length>0||c()},style:{width:"100%"},icon:(0,e.jsx)(be.Z,{}),children:"\u6DFB\u52A0"}),(0,e.jsx)(t.Z.ErrorList,{errors:h})]})]})}})}),(0,e.jsx)(t.Z.Item,{name:"activityStartAndEndTime",label:"\u8D77\u6B62\u65F6\u95F4",rules:[{required:!0}],children:(0,e.jsx)(ye.Z.RangePicker,{style:{width:"100%"}})}),(0,e.jsx)(t.Z.Item,{name:"remark",label:"\u5907\u6CE8",rules:[{required:!0,max:200}],children:(0,e.jsx)(Z.Z.TextArea,{rows:4,placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"})}),(0,e.jsx)(t.Z.Item,{name:"activityRule",label:"\u89C4\u5219\u8BF4\u660E",rules:[{required:!0,max:500}],children:(0,e.jsx)(Z.Z.TextArea,{rows:4,placeholder:"\u8BF7\u8F93\u5165\u89C4\u5219\u8BF4\u660E"})}),(0,e.jsx)(t.Z.Item,{name:"activityImg",label:"\u6D3B\u52A8\u56FE\u7247",rules:[{required:!0}],children:(0,e.jsx)(Te.Z,(0,x.Z)((0,x.Z)({},Ae),{},{children:ce?(0,e.jsx)(Ge.Z,{width:200,height:200,src:ce,fallback:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBEl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Q80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg=="}):(0,e.jsx)(K.Z,{icon:(0,e.jsx)(Je.Z,{}),children:"\u4E0A\u4F20"})}))}),(0,e.jsx)(t.Z.Item,{name:"isAutoSend",label:"\u53C2\u4E0E\u65B9\u5F0F",rules:[{required:!0}],children:(0,e.jsxs)(u.Z,{placeholder:"\u8BF7\u9009\u62E9\u53C2\u4E0E\u65B9\u5F0F",children:[(0,e.jsx)(u.Z.Option,{value:0,children:"\u70B9\u51FB\u53C2\u4E0E\uFF08\u9700\u8981\u7528\u6237\u4E3B\u52A8\u70B9\u51FB\uFF09"}),(0,e.jsx)(u.Z.Option,{value:1,children:"\u81EA\u52A8\u53C2\u4E0E\uFF08\u6EE1\u8DB3\u7279\u5B9A\u6761\u4EF6\u81EA\u52A8\u53C2\u4E0E\uFF09"})]})}),(0,e.jsx)(t.Z.Item,{name:"activityConfig",label:"\u6D3B\u52A8\u914D\u7F6E",rules:[{required:!0,message:"\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6D3B\u52A8\u914D\u7F6E\uFF01"}],children:(0,e.jsx)(pe.Z.Group,{style:{width:"100%"},children:(0,e.jsx)(we.Z,{children:nu.map(function(o,l){return(0,e.jsxs)(Ne.Z,{span:24,style:{marginBottom:"10px",display:"flex",alignItems:"center"},children:[(0,e.jsxs)(pe.Z,{style:{minWidth:"230px"},value:o.configuration_Id,children:[o.configurationName,"\uFF1A",o.configurationRule]}),l===0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"dayOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"dayValue",noStyle:!0,children:(0,e.jsx)(Z.Z,{style:{width:280},placeholder:"\u6BCF\u65E5\u53C2\u4E0E\u6B21\u6570"})})]}),l===1&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"weekOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"weekValue",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:280},size:"Small",mode:"multiple",placeholder:"\u661F\u671F",children:[(0,e.jsx)(u.Z.Option,{value:"1",children:"\u661F\u671F\u4E00"}),(0,e.jsx)(u.Z.Option,{value:"2",children:"\u661F\u671F\u4E8C"}),(0,e.jsx)(u.Z.Option,{value:"3",children:"\u661F\u671F\u4E09"}),(0,e.jsx)(u.Z.Option,{value:"4",children:"\u661F\u671F\u56DB"}),(0,e.jsx)(u.Z.Option,{value:"5",children:"\u661F\u671F\u4E94"}),(0,e.jsx)(u.Z.Option,{value:"6",children:"\u661F\u671F\u516D"}),(0,e.jsx)(u.Z.Option,{value:"0",children:"\u661F\u671F\u65E5"})]})})]}),l===2&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"amountOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"amountValue",noStyle:!0,children:(0,e.jsx)(Z.Z,{style:{width:280},placeholder:"\u6D88\u8D39\u91D1\u989D"})})]}),l===3&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"goodsTypeOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"goodsTypeValue",noStyle:!0,children:(0,e.jsx)(u.Z,{style:{width:280},size:"Small",placeholder:"\u5546\u54C1\u79CD\u7C7B",mode:"multiple",children:G.map(function(r){return(0,e.jsx)(u.Z.Option,{value:r.id,children:r.name},r.id)})})})]}),l===4&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"storeOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"storeValue",noStyle:!0,children:(0,e.jsx)(u.Z,{style:{width:280},size:"Small",mode:"multiple",placeholder:"\u95E8\u5E97",children:L.map(function(r){return(0,e.jsx)(u.Z.Option,{value:r.id,children:r.name},r.id)})})})]}),l===5&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"totalOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"totalValue",noStyle:!0,children:(0,e.jsx)(Z.Z,{style:{width:280},placeholder:"\u603B\u6B21\u6570"})})]})]},l)})})})}),(0,e.jsxs)(t.Z.Item,{children:[(0,e.jsx)(K.Z,{type:"primary",htmlType:"submit",children:"\u63D0\u4EA4"}),(0,e.jsx)(K.Z,{style:{marginLeft:"20px"},onClick:function(){V.resetFields(),ae(null)},children:"\u91CD\u7F6E"})]})]}),(0,e.jsx)(Le.Z,{maskClosable:!1,title:"\u65B0\u5EFA\u4F18\u60E0\u5377",width:700,visible:Ze,footer:null,onCancel:function(){te(!1)},destroyOnClose:!0,children:(0,e.jsxs)(t.Z,(0,x.Z)((0,x.Z)({form:oe},Ou),{},{layout:"Horizontal",preserve:!1,onFinish:function(l){Ie(l)},children:[(0,e.jsx)(t.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(Z.Z,{})}),(0,e.jsx)(t.Z.Item,{name:"couponTitle",label:"\u4F18\u60E0\u5377\u6807\u9898",rules:[{required:!0,max:200}],children:(0,e.jsx)(Z.Z,{placeholder:"\u8BF7\u8F93\u5165\u4F18\u60E0\u5377\u6807\u9898"})}),(0,e.jsx)(t.Z.Item,{name:"couponType",label:"\u4F18\u60E0\u5377\u7C7B\u578B",rules:[{required:!0}],children:(0,e.jsx)(u.Z,{placeholder:"\u8BF7\u9009\u62E9\u4F18\u60E0\u5377\u7C7B\u578B",children:i.map(function(o){return(0,e.jsx)(u.Z.Option,{value:o.key,children:o.value},o.key)})})}),(0,e.jsxs)(t.Z.Item,(0,x.Z)((0,x.Z)({},ru),{},{style:{height:32},children:[(0,e.jsx)(t.Z.Item,{label:"\u4F18\u60E0\u91D1\u989D",style:{float:"left"},rules:[{required:!0}],children:(0,e.jsx)(t.Z.Item,{name:"couponValue",noStyle:!0,children:(0,e.jsx)(q.Z,{placeholder:"\u91D1\u989D",min:0,precision:2})})}),(0,e.jsx)(t.Z.Item,{label:"\u4F7F\u7528\u6761\u4EF6",style:{float:"left",marginLeft:10},rules:[{required:!0}],children:(0,e.jsx)(t.Z.Item,{name:"condition",noStyle:!0,children:(0,e.jsx)(q.Z,{placeholder:"\u4F7F\u7528\u6761\u4EF6",min:0,precision:2})})}),(0,e.jsxs)(t.Z.Item,{label:"\u6BCF\u4EBA\u53EF\u9886\u6570\u91CF",style:{float:"left",marginLeft:10},rules:[{required:!0}],children:[(0,e.jsx)(t.Z.Item,{name:"getLimit",noStyle:!0,children:(0,e.jsx)(q.Z,{placeholder:"\u53EF\u9886\u6570\u91CF",min:0,precision:0})}),(0,e.jsx)("span",{style:{color:"#FFCC52"},children:" 0 \u4E3A\u4E0D\u9650\u5236"})]})]})),(0,e.jsx)(t.Z.Item,{name:"timeType",label:"\u65F6\u95F4\u7C7B\u578B",rules:[{required:!0}],children:(0,e.jsxs)(u.Z,{children:[(0,e.jsx)(u.Z.Option,{value:1,children:"\u65F6\u95F4\u6BB5"}),(0,e.jsx)(u.Z.Option,{value:2,children:"\u56FA\u5B9A\u671F\u9650"})]})}),(0,e.jsx)(t.Z.Item,{noStyle:!0,shouldUpdate:function(l,r){return l.timeType!==r.timeType},children:function(l){var r=l.getFieldValue;return r("timeType")=="2"?(0,e.jsx)(t.Z.Item,{label:"\u56FA\u5B9A\u65F6\u95F4",rules:[{required:!0}],children:(0,e.jsx)(t.Z.Item,{name:"validFixedTerm",noStyle:!0,children:(0,e.jsx)(q.Z,{placeholder:"",precision:0,min:0})})}):(0,e.jsxs)(t.Z.Item,(0,x.Z)((0,x.Z)({},ru),{},{style:{height:32},children:[(0,e.jsx)(t.Z.Item,{name:"validStartTime",label:"\u5F00\u59CB\u65F6\u95F4",style:{float:"left"},rules:[{required:!0}],children:(0,e.jsx)(ye.Z,{placeholder:"\u5F00\u59CB\u65F6\u95F4"})}),(0,e.jsx)(t.Z.Item,{name:"validEndTime",label:"\u7ED3\u675F\u65F6\u95F4",style:{float:"left",marginLeft:20},rules:[{required:!0}],children:(0,e.jsx)(ye.Z,{placeholder:"\u7ED3\u675F\u65F6\u95F4"})})]}))}}),(0,e.jsx)(t.Z.Item,{name:"validStatus",label:"\u72B6\u6001",rules:[{required:!0}],children:(0,e.jsxs)(u.Z,{placeholder:"\u72B6\u6001",children:[(0,e.jsx)(Option,{value:1,children:"\u751F\u6548"}),(0,e.jsx)(Option,{value:2,children:"\u5931\u6548"}),(0,e.jsx)(Option,{value:3,children:"\u4F5C\u5E9F"})]})}),(0,e.jsxs)(t.Z.Item,{noStyle:!0,children:[(0,e.jsx)(t.Z.Item,{name:"remarks",label:"\u5907\u6CE8",rules:[{max:500}],children:(0,e.jsx)(Z.Z,{placeholder:"\u5907\u6CE8"})}),(0,e.jsx)("span",{style:{color:"#FFCC52",marginLeft:70},children:"\u6CE8: \u591A\u6761\u89C4\u5219\u8BF7\u7528 \xA0;\xA0 \u9694\u5F00\u3002 \xA0\xA0 \u5982\uFF1A1.xxxxxx\uFF1B 2.xxxxxx"})]}),(0,e.jsx)(t.Z.Item,{name:"Coupon_Id",hidden:!0,children:(0,e.jsx)(Z.Z,{})}),(0,e.jsx)(t.Z.Item,{name:"SendNum",label:"\u53D1\u653E\u6570\u91CF",rules:[{required:!0}],children:(0,e.jsx)(q.Z,{placeholder:"\u53D1\u653E\u6570\u91CF",min:0,style:{width:"510px"}})}),(0,e.jsx)(t.Z.Item,{name:"RangeType",label:"\u9002\u7528\u8303\u56F4\u7C7B\u578B",hidden:!0,defaultValue:1,children:(0,e.jsxs)(u.Z,{placeholder:"\u53D1\u653E\u8303\u56F4",onSelect:xe,defaultValue:1,children:[(0,e.jsx)(u.Z.Option,{value:"1",children:"\u5E97\u94FA"}),(0,e.jsx)(u.Z.Option,{value:"3",children:"\u533A\u57DF"})]})}),(0,e.jsx)(t.Z.Item,{name:"Relation",label:"\u9002\u7528\u8303\u56F4",rules:[{required:!0}],defaultValue:"1",children:(0,e.jsx)(u.Z,{placeholder:"\u9002\u7528\u8303\u56F4",filterOption:!1,mode:"multiple",children:L.map(function(o){return(0,e.jsx)(u.Z.Option,{value:o.id,children:o.name},o.id)})})}),(0,e.jsx)(t.Z.Item,{name:"applyGoodType",label:"\u9002\u7528\u5546\u54C1\u7C7B\u578B",children:(0,e.jsx)(u.Z,{placeholder:"\u9002\u7528\u5546\u54C1\u7C7B\u578B",filterOption:!1,onChange:function(l){m(l)},children:G.map(function(o){return(0,e.jsx)(u.Z.Option,{value:o.id,children:o.name},o.id)})})}),(0,e.jsx)(t.Z.Item,{name:"goodsRelation",label:"\u9002\u7528\u5546\u54C1\u8303\u56F4",children:(0,e.jsx)(u.Z,{placeholder:"\u9002\u7528\u5546\u54C1\u8303\u56F4",filterOption:!1,mode:"multiple",children:d.map(function(o){return(0,e.jsx)(u.Z.Option,{value:o.id,children:o.name},o.id)})})}),(0,e.jsx)(t.Z.Item,{name:"Status",label:"\u72B6\u6001",rules:[{required:!0}],defaultValue:"1",children:(0,e.jsxs)(u.Z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",children:[(0,e.jsx)(u.Z.Option,{value:"1",children:"\u542F\u7528"}),(0,e.jsx)(u.Z.Option,{value:"0",children:"\u7981\u7528"})]})}),(0,e.jsx)(t.Z.Item,{name:"Remark",label:"\u5907\u6CE8",children:(0,e.jsx)(Z.Z,{placeholder:"\u5907\u6CE8"})}),(0,e.jsx)(t.Z.Item,{children:(0,e.jsx)(K.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})})]}))})]})},au=wu,Nu=["key","name","fieldKey"],iu=[{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"2B0F88D6-EDA0-4AAC-BB0B-DD34F3245C17",configurationName:"\u65E5\u53C2\u4E0E\u6B21\u6570\u9650\u5236",configurationRule:"\u6BCF\u65E5\u53C2\u4E0E\u6B21\u6570",valueType:1,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"8AC2A2BA-BB6E-4566-B147-ACF798146BBD",configurationName:"\u661F\u671F\u9650\u5236",configurationRule:"\u5305\u542B\u7684\u661F\u671F",valueType:2,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"9620CCF9-679E-44B1-B8FF-9B6F511208FA",configurationName:"\u6D88\u8D39\u91D1\u989D",configurationRule:"\u5355\u7B14\u8BA2\u5355\u6D88\u8D39\u91D1\u989D",valueType:1,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"AF62B336-15A6-453B-AD4A-61EB7D43B99B",configurationName:"\u5546\u54C1\u79CD\u7C7B\u9650\u5236",configurationRule:"\u5305\u542B\u7684\u5546\u54C1\u79CD\u7C7B",valueType:2,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"ECBACC1C-6BA8-498E-BDE4-6A012881E0E7",configurationName:"\u95E8\u5E97\u9650\u5236",configurationRule:"\u5305\u542B\u7684\u95E8\u5E97",valueType:2,configurationValueCount:1},{configId:null,operator:null,value1:[],value2:null,activity_Id:null,configuration_Id:"F06DEAD8-DDB8-4B27-94E9-389DE9AC155D",configurationName:"\u603B\u53C2\u4E0E\u6B21\u6570\u9650\u5236",configurationRule:"\u603B\u53C2\u4E0E\u6B21\u6570",valueType:1,configurationValueCount:1}],Tu=function(N){var de=t.Z.useForm(),W=(0,Q.Z)(de,1),R=W[0],re=(0,D.useState)(null),z=(0,Q.Z)(re,2),$=z[0],H=z[1],V=(0,D.useState)([]),ee=(0,Q.Z)(V,2),ue=ee[0],ce=ee[1],ae=function(){var g=(0,k.Z)((0,A.Z)().mark(function d(){var n,m;return(0,A.Z)().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,S.GetGoodsType();case 2:n=y.sent,n.statusCode===200&&(m=[],Object.keys(n.data).forEach(function(O){m.push({id:O,name:n.data[O]})}),ce(m));case 4:case"end":return y.stop()}},d)}));return function(){return g.apply(this,arguments)}}(),me=(0,D.useState)([]),_=(0,Q.Z)(me,2),Ze=_[0],te=_[1],ge=function(){var g=(0,k.Z)((0,A.Z)().mark(function d(){var n;return(0,A.Z)().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,S.GetStores();case 2:n=v.sent,n.statusCode===200&&te(n.data);case 4:case"end":return v.stop()}},d)}));return function(){return g.apply(this,arguments)}}(),le=(0,D.useState)([]),oe=(0,Q.Z)(le,2),T=oe[0],f=oe[1],i=function(){var g=(0,k.Z)((0,A.Z)().mark(function d(){var n,m,v,y=arguments;return(0,A.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return n=y.length>0&&y[0]!==void 0?y[0]:-1,s.next=3,S.GetGoodsById(n);case 3:m=s.sent,m.statusCode===200&&(v=[],Object.keys(m.data).forEach(function(L){v.push({id:L,name:m.data[L]})}),f(v));case 5:case"end":return s.stop()}},d)}));return function(){return g.apply(this,arguments)}}(),C={name:"file",showUploadList:!1,multiple:!1,accept:".png, .jpg, .jpeg, .gif",headers:{"Content-Type":"application/octet-stream"},customRequest:function(d){var n=d.action,m=d.file,v=d.headers,y=d.onError,O=d.onProgress,s=d.onSuccess,L=d.withCredentials,P=m.name.lastIndexOf("."),X=m.name.substr(P+1),M=null;S.GetCosRequestURL({directory:"activity",fileExtension:X,method:"PUT"}).then(function(G){n=G.allUrl;var se=m.name.lastIndexOf("."),fe=m.name.substr(se+1),Ae=new FileReader;if(["png","jpg","jpeg","bmp","gif","webp","psd","svg","tiff"].indexOf(fe)==-1){w.default.error("".concat(m.name," \u4E0D\u662F\u56FE\u7247\u6587\u4EF6"));return}Ae.readAsArrayBuffer(m),Ae.onload=function(Ie){M=Ie.target.result,Ke().put(n,M,{withCredentials:L,headers:v,onUploadProgress:function(Ce){var o=Ce.total,l=Ce.loaded;O({percent:Math.round(l/o*100).toFixed(2)},m)}}).then(function(xe){R.setFieldsValue({activityImg:G.seeUrl}),(xe.status==200||xe.statusText=="OK")&&H(G.seeUrl)}).catch(y)}})}},b=function(){var g=(0,k.Z)((0,A.Z)().mark(function d(n){var m;return(0,A.Z)().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return n.activityType=8,n.activityRewards.forEach(function(O){O.id="",O.activityInfo_Id=""}),n.activityStartTime=Ee()(n.activityStartAndEndTime[0]).format("YYYY-MM-DD"),n.activityEndTime=Ee()(n.activityStartAndEndTime[1]).format("YYYY-MM-DD"),n.status=0,n.isShow=1,n.isDeleted=0,n.consumptionType=0,n.isGiftGoodsParticipate=0,n.activityConfiguration=[],n.activityConfig.forEach(function(O){var s=iu.find(function(L){return L.configuration_Id===O});s&&(s.configId=[s.configuration_Id],s.configurationName==="\u65E5\u53C2\u4E0E\u6B21\u6570\u9650\u5236"?(s.operator=n.dayOperator,s.value1=n.dayValue):s.configurationName==="\u661F\u671F\u9650\u5236"?(s.operator=n.weekOperator,s.value1=n.weekValue):s.configurationName==="\u6D88\u8D39\u91D1\u989D"?(s.operator=n.amountOperator,s.value1=n.amountValue):s.configurationName==="\u5546\u54C1\u79CD\u7C7B\u9650\u5236"?(s.operator=n.goodsTypeOperator,s.value1=n.goodsTypeValue):s.configurationName==="\u95E8\u5E97\u9650\u5236"?(s.operator=n.storeOperator,s.value1=n.storeValue):s.configurationName==="\u603B\u53C2\u4E0E\u6B21\u6570\u9650\u5236"&&(s.operator=n.totalOperator,s.value1=n.totalValue),n.activityConfiguration.push(s))}),delete n.activityConfig,delete n.activityStartAndEndTime,delete n.amountOperator,delete n.amountValue,delete n.dayOperator,delete n.dayValue,delete n.goodsTypeOperator,delete n.goodsTypeValue,delete n.storeOperator,delete n.storeValue,delete n.totalOperator,delete n.totalValue,delete n.weekOperator,delete n.weekValue,y.next=27,S.FastAddActivity(n);case 27:m=y.sent,m.statusCode===200?(w.default.success("\u65B0\u5EFA\u6D3B\u52A8\u6210\u529F\uFF01"),R.resetFields(),N.onSuccessCreate&&N.onSuccessCreate()):w.default.error(m.errors||"\u521B\u5EFA\u5931\u8D25 \u8BF7\u91CD\u8BD5\uFF01");case 29:case"end":return y.stop()}},d)}));return function(n){return g.apply(this,arguments)}}();return(0,D.useEffect)(function(){ae(),ge(),i()},[]),(0,e.jsx)("div",{className:ne().activity_form_container,children:(0,e.jsxs)(t.Z,{form:R,name:"basic",labelCol:{span:3},initialValues:{remember:!0},onFinish:function(d){b(d)},layout:"vertical",autoComplete:"off",children:[(0,e.jsx)(t.Z.Item,{label:"\u6D3B\u52A8\u540D\u79F0",name:"activityName",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u6D3B\u52A8\u540D\u79F0\uFF01"}],children:(0,e.jsx)(Z.Z,{style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u6D3B\u52A8\u540D\u79F0"})}),(0,e.jsx)(t.Z.Item,{label:"\u52A0\u8D2D\u4EF7\u683C",children:(0,e.jsx)(t.Z.List,{name:"activityRewards",children:function(d,n,m){var v=n.add,y=n.remove,O=m.errors;return(0,e.jsxs)(e.Fragment,{children:[d.map(function(s){var L=s.key,P=s.name,X=s.fieldKey,M=(0,ke.Z)(s,Nu);return(0,e.jsxs)("div",{className:ne().common_form_row,children:[(0,e.jsx)(t.Z.Item,(0,x.Z)((0,x.Z)({},M),{},{name:[P,"rewardValue"],fieldKey:[X,"rewardValue"],rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u52A0\u8D2D\u4EF7\u683C"}],children:(0,e.jsx)(Z.Z,{style:{width:"100%"},placeholder:"\u8BF7\u8F93\u5165\u52A0\u8D2D\u4EF7\u683C"})})),(0,e.jsx)("div",{style:{margin:"0 10px 24px 10px"},children:"\u8D60\u9001\u5546\u54C1\uFF1A"}),(0,e.jsx)(t.Z.Item,(0,x.Z)((0,x.Z)({},M),{},{name:[P,"value"],fieldKey:[X,"value"],rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u5546\u54C1"}],children:(0,e.jsx)(u.Z,{style:{width:"200px"},children:T.map(function(G){return(0,e.jsx)(u.Z.Option,{value:G.id,children:G.name},G.id)})})})),(0,e.jsx)(Re.Z,{style:{fontSize:"25px",marginLeft:"20px",marginBottom:"24px"},onClick:function(){return y(P)}})]})}),(0,e.jsxs)(t.Z.Item,{children:[(0,e.jsx)(K.Z,{type:"dashed",onClick:function(){return v()},style:{width:"100%"},icon:(0,e.jsx)(be.Z,{}),children:"\u6DFB\u52A0"}),(0,e.jsx)(t.Z.ErrorList,{errors:O})]})]})}})}),(0,e.jsx)(t.Z.Item,{name:"activityStartAndEndTime",label:"\u8D77\u6B62\u65F6\u95F4",rules:[{required:!0}],children:(0,e.jsx)(ye.Z.RangePicker,{style:{width:"100%"}})}),(0,e.jsx)(t.Z.Item,{name:"remark",label:"\u5907\u6CE8",rules:[{required:!0,max:200}],children:(0,e.jsx)(Z.Z.TextArea,{rows:4,placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"})}),(0,e.jsx)(t.Z.Item,{name:"activityRule",label:"\u89C4\u5219\u8BF4\u660E",rules:[{required:!0,max:500}],children:(0,e.jsx)(Z.Z.TextArea,{rows:4,placeholder:"\u8BF7\u8F93\u5165\u89C4\u5219\u8BF4\u660E"})}),(0,e.jsx)(t.Z.Item,{name:"activityImg",label:"\u6D3B\u52A8\u56FE\u7247",rules:[{required:!0}],children:(0,e.jsx)(Te.Z,(0,x.Z)((0,x.Z)({},C),{},{children:$?(0,e.jsx)(Ge.Z,{width:200,height:200,src:$,fallback:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAo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)(t.Z.Item,{name:"isAutoSend",label:"\u53C2\u4E0E\u65B9\u5F0F",rules:[{required:!0}],children:(0,e.jsxs)(u.Z,{placeholder:"\u8BF7\u9009\u62E9\u53C2\u4E0E\u65B9\u5F0F",children:[(0,e.jsx)(u.Z.Option,{value:0,children:"\u70B9\u51FB\u53C2\u4E0E\uFF08\u9700\u8981\u7528\u6237\u4E3B\u52A8\u70B9\u51FB\uFF09"}),(0,e.jsx)(u.Z.Option,{value:1,children:"\u81EA\u52A8\u53C2\u4E0E\uFF08\u6EE1\u8DB3\u7279\u5B9A\u6761\u4EF6\u81EA\u52A8\u53C2\u4E0E\uFF09"})]})}),(0,e.jsx)(t.Z.Item,{name:"activityConfig",label:"\u6D3B\u52A8\u914D\u7F6E",rules:[{required:!0,message:"\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u4E2A\u6D3B\u52A8\u914D\u7F6E\uFF01"}],children:(0,e.jsx)(pe.Z.Group,{style:{width:"100%"},children:(0,e.jsx)(we.Z,{children:iu.map(function(g,d){return(0,e.jsxs)(Ne.Z,{span:24,style:{marginBottom:"10px",display:"flex",alignItems:"center"},children:[(0,e.jsxs)(pe.Z,{style:{minWidth:"230px"},value:g.configuration_Id,children:[g.configurationName,"\uFF1A",g.configurationRule]}),d===0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"dayOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"dayValue",noStyle:!0,children:(0,e.jsx)(Z.Z,{style:{width:280},placeholder:"\u6BCF\u65E5\u53C2\u4E0E\u6B21\u6570"})})]}),d===1&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"weekOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"weekValue",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:280},size:"Small",mode:"multiple",placeholder:"\u661F\u671F",children:[(0,e.jsx)(u.Z.Option,{value:"1",children:"\u661F\u671F\u4E00"}),(0,e.jsx)(u.Z.Option,{value:"2",children:"\u661F\u671F\u4E8C"}),(0,e.jsx)(u.Z.Option,{value:"3",children:"\u661F\u671F\u4E09"}),(0,e.jsx)(u.Z.Option,{value:"4",children:"\u661F\u671F\u56DB"}),(0,e.jsx)(u.Z.Option,{value:"5",children:"\u661F\u671F\u4E94"}),(0,e.jsx)(u.Z.Option,{value:"6",children:"\u661F\u671F\u516D"}),(0,e.jsx)(u.Z.Option,{value:"0",children:"\u661F\u671F\u65E5"})]})})]}),d===2&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"amountOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"amountValue",noStyle:!0,children:(0,e.jsx)(Z.Z,{style:{width:280},placeholder:"\u6D88\u8D39\u91D1\u989D"})})]}),d===3&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"goodsTypeOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"goodsTypeValue",noStyle:!0,children:(0,e.jsx)(u.Z,{style:{width:280},size:"Small",placeholder:"\u5546\u54C1\u79CD\u7C7B",mode:"multiple",children:ue.map(function(n){return(0,e.jsx)(u.Z.Option,{value:n.id,children:n.name},n.id)})})})]}),d===4&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"storeOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"storeValue",noStyle:!0,children:(0,e.jsx)(u.Z,{style:{width:280},size:"Small",mode:"multiple",placeholder:"\u95E8\u5E97",children:Ze.map(function(n){return(0,e.jsx)(u.Z.Option,{value:n.id,children:n.name},n.id)})})})]}),d===5&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(t.Z.Item,{name:"totalOperator",noStyle:!0,children:(0,e.jsxs)(u.Z,{style:{width:80,margin:"0 20px"},size:"Small",placeholder:"\u6761\u4EF6",children:[(0,e.jsx)(u.Z.Option,{value:">",children:"\u5927\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"<",children:"\u5C0F\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:"==",children:"\u7B49\u4E8E"}),(0,e.jsx)(u.Z.Option,{value:">=and<=",children:"\u5305\u542B"})]})}),(0,e.jsx)(t.Z.Item,{name:"totalValue",noStyle:!0,children:(0,e.jsx)(Z.Z,{style:{width:280},placeholder:"\u603B\u6B21\u6570"})})]})]},d)})})})}),(0,e.jsxs)(t.Z.Item,{children:[(0,e.jsx)(K.Z,{type:"primary",htmlType:"submit",children:"\u63D0\u4EA4"}),(0,e.jsx)(K.Z,{style:{marginLeft:"20px"},onClick:function(){R.resetFields(),H(null)},children:"\u91CD\u7F6E"})]})]})})},ku=Tu,Oe=u.Z.Option,Ru=function(){var N=t.Z.useForm(),de=(0,D.useState)(1),W=(0,Q.Z)(de,2),R=W[0],re=W[1],z=function(){re(0)},$=function(){return(0,e.jsx)(su.ZP,{status:"success",title:"\u521B\u5EFA\u6210\u529F\uFF01",subTitle:"\u6D3B\u52A8\u521B\u5EFA\u6210\u529F\uFF01",extra:[(0,e.jsx)(K.Z,{type:"primary",onClick:function(){return re(1)},children:"\u518D\u6B21\u521B\u5EFA"},"console")]})};return(0,e.jsx)(du.ZP,{children:(0,e.jsxs)(ou.Z,{className:ne().activity_start_container,children:[R>0&&(0,e.jsxs)("div",{className:ne().head_row,children:[(0,e.jsx)("div",{className:ne().head_row_prev,children:"\u6D3B\u52A8\u7C7B\u578B\uFF1A"}),(0,e.jsxs)(u.Z,{showSearch:!0,optionFilterProp:"children",filterOption:function(V,ee){return ee.children.toLowerCase().indexOf(V.toLowerCase())>=0},placeholder:"\u8BF7\u9009\u62E9\u6D3B\u52A8\u7C7B\u578B",style:{width:"600px"},onChange:function(V){re(V)},value:R,children:[(0,e.jsx)(Oe,{value:1,children:"\u9001\u5238"},1),(0,e.jsx)(Oe,{value:2,children:"\u4E70\u6EE1\u51CF\u73B0"},2),(0,e.jsx)(Oe,{value:3,children:"\u7279\u4EF7\u5546\u54C1"},3),(0,e.jsx)(Oe,{value:4,children:"\u4E70\u6EE1\u8D60\u9001(\u4F18\u60E0\u5238)"},4),(0,e.jsx)(Oe,{value:5,children:"\u4E70\u6EE1\u8D60\u9001(\u5546\u54C1)"},5),(0,e.jsx)(Oe,{value:6,children:"\u7D2F\u8BA1\u6D88\u8D39\u6362\u8D2D(\u9636\u68AF)"},6),(0,e.jsx)(Oe,{value:7,children:"\u7D2F\u8BA1\u6D88\u8D39\u6362\u8D2D(\u5FAA\u73AF)"},7),(0,e.jsx)(Oe,{value:8,children:"\u52A0\u4EF7\u6362\u8D2D"},8)]})]}),R===1&&(0,e.jsx)(mu,{onSuccessCreate:z}),R===2&&(0,e.jsx)(xu,{onSuccessCreate:z}),R===3&&(0,e.jsx)(Fu,{onSuccessCreate:z}),R===4&&(0,e.jsx)(Cu,{onSuccessCreate:z}),R===5&&(0,e.jsx)(Su,{onSuccessCreate:z}),R===6&&(0,e.jsx)(au,{onSuccessCreate:z,currentActivityType:R}),R===7&&(0,e.jsx)(au,{onSuccessCreate:z,currentActivityType:R}),R===8&&(0,e.jsx)(ku,{onSuccessCreate:z}),R===0&&(0,e.jsx)($,{})]})})},bu=Ru}}]);
|