(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[4141],{59215:function(Re,ne,a){"use strict";a.r(ne),a.d(ne,{default:function(){return De}});var Ue=a(57338),le=a(25084),Oe=a(62350),ie=a(75443),S=a(3182),Pe=a(57663),z=a(71577),Ye=a(34792),m=a(48086),y=a(2824),de=a(94043),o=a.n(de),oe=a(49101),g=a(67294),ce=a(78009),me=a(85224),he=a(16894),fe=a(12826),Be=a(71194),ve=a(50146),ue=a(11849),Le=a(77883),pe=a(85482),Me=a(43185),C=a(93009),$e=a(47673),O=a(4107),Ve=a(14965),xe=a(91774),we=a(9715),d=a(86835),Ge=a(43358),F=a(34041),ye=a(84391),A=a(48971);function ge(l){return b.apply(this,arguments)}function b(){return b=(0,S.Z)(o().mark(function l(u){return o().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,A.WY)("/kitchen/api/store-advertisement/advertisement-page",{method:"Post",data:u}));case 1:case"end":return r.stop()}},l)})),b.apply(this,arguments)}function Fe(l){return k.apply(this,arguments)}function k(){return k=(0,S.Z)(o().mark(function l(u){return o().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,A.WY)("/kitchen/api/store-advertisement/advertisement",{method:"POST",data:u}));case 1:case"end":return r.stop()}},l)})),k.apply(this,arguments)}function Ze(l){return J.apply(this,arguments)}function J(){return J=(0,S.Z)(o().mark(function l(u){return o().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,A.WY)("/kitchen/api/store-advertisement/advertisement",{method:"PUT",data:u}));case 1:case"end":return r.stop()}},l)})),J.apply(this,arguments)}function Se(l){return K.apply(this,arguments)}function K(){return K=(0,S.Z)(o().mark(function l(u){return o().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,A.WY)("/kitchen/api/store-advertisement/advertisement",{method:"DELETE",data:u}));case 1:case"end":return r.stop()}},l)})),K.apply(this,arguments)}function je(l){return Q.apply(this,arguments)}function Q(){return Q=(0,S.Z)(o().mark(function l(u){return o().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,A.WY)("\u200B/kitchen/api\u200B/store-info\u200B/store-info-page",{method:"POST",data:u}));case 1:case"end":return r.stop()}},l)})),Q.apply(this,arguments)}function Ie(l){return X.apply(this,arguments)}function X(){return X=(0,S.Z)(o().mark(function l(u){return o().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,A.WY)("/kitchen/api/store-advertisement/advertisement-status",{method:"PUT",data:u}));case 1:case"end":return r.stop()}},l)})),X.apply(this,arguments)}function Ne(l){return q.apply(this,arguments)}function q(){return q=_asyncToGenerator(_regeneratorRuntime.mark(function l(u){return _regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",request("/kitchen/api/store-advertisement/open-html/",{method:"POST",data:u}));case 1:case"end":return r.stop()}},l)})),q.apply(this,arguments)}var He=a(92409),e=a(85893),Ee=function(u){var Z=F.Z.Option,r=F.Z.OptGroup,P=d.Z.useForm(),_=(0,y.Z)(P,1),I=_[0],ee=(0,g.useState)(),V=(0,y.Z)(ee,2),x=V[0],te=V[1],H=(0,g.useState)(),f=(0,y.Z)(H,2),Y=f[0],se=f[1],W=xe.Z.RangePicker,D=O.Z.TextArea,B=[];u.values&&(B.push(u.values.startTime),B.push(u.values.endTime)),u.values.planDate=B;function ae(c){te(c)}function w(c){var t=(0,A.WY)("/kitchen/api/Upload/DeleteFile?fileUrl=".concat(c),{method:"post"})}var R=[];u.values.imageUrl&&(R=u.values.imageUrl);var re={beforeUpload:function(t){var h=I.getFieldValue("storeId");if(typeof h=="undefined")return m.default.error("\u8BF7\u9009\u62E9\u5E97\u94FA!"),C.Z.LIST_IGNORE;var E=I.getFieldValue("type");if(E==0){var L=t.type==="image/jpeg"||t.type==="image/png"||t.type==="image/jpg";if(!L)return m.default.error("\u8BF7\u4E0A\u4F20\u56FE\u7247\u683C\u5F0F\u6587\u4EF6!"),C.Z.LIST_IGNORE;var G=t.size/1024/1024<4;return G?!0:(m.default.error("\u56FE\u7247\u4E0D\u80FD\u5927\u4E8E4MB!"),C.Z.LIST_IGNORE)}else if(E==1){var M=t.type==="video/mp4"||t.type==="video/rmvb"||t.type==="video/avi"||t.type==="video/m4v";if(!M)return m.default.error("\u8BF7\u4E0A\u4F20\u89C6\u9891\u683C\u5F0F\u6587\u4EF6!"),C.Z.LIST_IGNORE;var $=t.size/1024/1024<100;return $?!0:(m.default.error("\u89C6\u9891\u4E0D\u80FD\u5927\u4E8E100MB!"),C.Z.LIST_IGNORE)}else return m.default.error("\u8BF7\u9009\u62E9\u5E7F\u544A\u7C7B\u578B!"),C.Z.LIST_IGNORE},name:"file",action:"/kitchen/api/Upload/FormImg?storeId=".concat(typeof x=="undefined"?u.values.storeId:x),headers:{authorization:"authorization-text"},showUploadList:{showPreviewIcon:!1},listType:"picture-card",multiple:!0,maxCount:10,onChange:function(t){t.file.status!=="uploading"&&console.log(t.file,t.fileList),t.file.status==="done"?t.file.response.isSuccess?(t.file.response.msg==="mv"?I.setFieldsValue({videoUrl:t.file.response.data[0]}):(R.push({name:t.file.response.data[0]}),I.setFieldsValue({imageUrl:R})),m.default.success("".concat(t.file.name," \u4E0A\u4F20\u6210\u529F"))):m.default.error(t.file.response.msg):t.file.status==="error"&&m.default.error("".concat(t.file.name," \u4E0A\u4F20\u5931\u8D25"))},onRemove:function(t){var h="";typeof t.response=="undefined"?(w(t.name),h=t.name):(w(t.response.data[0]),h=t.response.data[0]);for(var E=0,L=Object.entries(R);E0&&(0,e.jsx)(me.Z,{extra:(0,e.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,e.jsx)("a",{style:{fontWeight:600},children:D.length})," ","\u9879 \xA0\xA0"]}),children:(0,e.jsx)(ie.Z,{type:"primary",title:"\u786E\u8BA4\u662F\u5426\u5220\u9664\u9009\u4E2D\u9879\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){var i,n;M(D),B([]),(i=x.current)===null||i===void 0||(n=i.reloadAndRest)===null||n===void 0||n.call(i)},onCancel:function(){},children:(0,e.jsx)("a",{href:"#",children:"\u6279\u91CF\u5220\u9664"})},"primary")}),(0,e.jsx)(Te,{storeArray:h,onFinish:function(){var s=(0,S.Z)(o().mark(function i(n){var p;return o().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(p=!1,n.startTime=N()(n.planDate[0]).format("YYYY-MM-DD HH:mm:ss"),n.endTime=N()(n.planDate[1]).format("YYYY-MM-DD HH:mm:ss"),!n.id){v.next=9;break}return v.next=6,G(n);case 6:p=v.sent,v.next=12;break;case 9:return v.next=11,L(n);case 11:p=v.sent;case 12:p&&(P(!1),x.current&&x.current.reload());case 13:case"end":return v.stop()}},i)}));return function(i){return s.apply(this,arguments)}}(),onCancel:function(){Y(void 0),P(!1)},createModalVisible:r,values:f||{}}),(0,e.jsx)(le.Z,{width:600,visible:ee,onClose:function(){Y(void 0),V(!1)},closable:!1,children:(f==null?void 0:f.name)&&(0,e.jsx)(fe.ZP,{column:2,title:f==null?void 0:f.name,request:(0,S.Z)(o().mark(function s(){return o().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",{data:f||{}});case 1:case"end":return n.stop()}},s)})),params:{id:f==null?void 0:f.name},columns:$})})]})},De=Ae}}]);