(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[9976],{29425:function(Ce,te,r){"use strict";r.r(te),r.d(te,{default:function(){return Te}});var De=r(57338),le=r(83107),Re=r(57663),re=r(71577),Ue=r(62350),N=r(24565),i=r(39428),g=r(3182),Oe=r(34792),f=r(48086),Pe=r(9715),c=r(55843),S=r(2824),ie=r(49101),j=r(67294),de=r(28790),oe=r(85224),ce=r(16894),me=r(12826),$e=r(71194),fe=r(50146),ae=r(11849),Ye=r(77883),he=r(21888),we=r(43185),T=r(93349),Be=r(47673),U=r(4107),Le=r(14965),ve=r(34895),Ge=r(43358),F=r(34041),pe=r(84391),C=r(48971),Me=r(65754),e=r(85893),xe=function(a){var x=F.Z.Option,u=F.Z.OptGroup,q=(0,j.useState)(),w=(0,S.Z)(q,2),V=w[0],O=w[1],_=(0,j.useState)(),B=(0,S.Z)(_,2),ne=B[0],ee=B[1],y=ve.Z.RangePicker,ue=U.Z.TextArea,P=[];a.values&&(P.push(a.values.startTime),P.push(a.values.endTime)),a.values.planDate=P;function Z(l){O(l)}function I(l){var t=(0,C.WY)("/kitchen/api/Upload/DeleteFile?fileUrl=".concat(l),{method:"post"})}var D=[];a.values.imageUrl&&(D=a.values.imageUrl);var H={beforeUpload:function(t){var v=a.form.getFieldValue("storeId");if(typeof v=="undefined")return f.default.error("\u8BF7\u9009\u62E9\u5E97\u94FA!"),T.Z.LIST_IGNORE;var A=a.form.getFieldValue("type");if(A==0){var R=t.type==="image/jpeg"||t.type==="image/png"||t.type==="image/jpg";if(!R)return f.default.error("\u8BF7\u4E0A\u4F20\u56FE\u7247\u683C\u5F0F\u6587\u4EF6!"),T.Z.LIST_IGNORE;var L=t.size/1024/1024<4;return L?!0:(f.default.error("\u56FE\u7247\u4E0D\u80FD\u5927\u4E8E4MB!"),T.Z.LIST_IGNORE)}else if(A==1){var $=t.type==="video/mp4"||t.type==="video/rmvb"||t.type==="video/avi"||t.type==="video/m4v";if(!$)return f.default.error("\u8BF7\u4E0A\u4F20\u89C6\u9891\u683C\u5F0F\u6587\u4EF6!"),T.Z.LIST_IGNORE;var G=t.size/1024/1024<100;return G?!0:(f.default.error("\u89C6\u9891\u4E0D\u80FD\u5927\u4E8E100MB!"),T.Z.LIST_IGNORE)}else return f.default.error("\u8BF7\u9009\u62E9\u5E7F\u544A\u7C7B\u578B!"),T.Z.LIST_IGNORE},name:"file",action:"/storemanage/api/Upload/FormImg?storeId=".concat(typeof V=="undefined"?a.values.storeId:V),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"?a.form.setFieldsValue({videoUrl:t.file.response.data[0]}):(D.push({name:t.file.response.data[0]}),a.form.setFieldsValue({imageUrl:D})),f.default.success("".concat(t.file.name," \u4E0A\u4F20\u6210\u529F"))):f.default.error(t.file.response.msg):t.file.status==="error"&&f.default.error("".concat(t.file.name," \u4E0A\u4F20\u5931\u8D25"))},onRemove:function(t){var v="";typeof t.response=="undefined"?(I(t.name),v=t.name):(I(t.response.data[0]),v=t.response.data[0]);for(var A=0,R=Object.entries(D);A0&&(0,e.jsx)(oe.Z,{extra:(0,e.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,e.jsx)("a",{style:{fontWeight:600},children:l.length})," ","\u9879 \xA0\xA0"]}),children:(0,e.jsx)(N.Z,{type:"primary",title:"\u786E\u8BA4\u662F\u5426\u5220\u9664\u9009\u4E2D\u9879\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){var s,n;W(l),t([]),(s=y.current)===null||s===void 0||(n=s.reloadAndRest)===null||n===void 0||n.call(s)},onCancel:function(){},children:(0,e.jsx)("a",{href:"#",children:"\u6279\u91CF\u5220\u9664"})},"primary")}),(0,e.jsx)(Ze,{form:u,storeArray:R,onFinish:function(){var o=(0,g.Z)((0,i.Z)().mark(function s(n){var h;return(0,i.Z)().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(h=!1,n.startTime=M()(n.planDate[0]).format("YYYY-MM-DD HH:mm:ss"),n.endTime=M()(n.planDate[1]).format("YYYY-MM-DD HH:mm:ss"),!n.id){m.next=9;break}return m.next=6,G(n);case 6:h=m.sent,m.next=12;break;case 9:return m.next=11,$(n);case 11:h=m.sent;case 12:h&&(O(!1),y.current&&y.current.reload());case 13:case"end":return m.stop()}},s)}));return function(s){return o.apply(this,arguments)}}(),onCancel:function(){I(void 0),O(!1)},createModalVisible:V,values:Z||{}}),(0,e.jsx)(le.Z,{width:600,visible:ne,onClose:function(){I(void 0),ee(!1)},closable:!1,children:(Z==null?void 0:Z.name)&&(0,e.jsx)(me.ZP,{column:2,title:Z==null?void 0:Z.name,request:(0,g.Z)((0,i.Z)().mark(function o(){return(0,i.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",{data:Z||{}});case 1:case"end":return n.stop()}},o)})),params:{id:Z==null?void 0:Z.name},columns:se})})]})},Te=Ee}}]);