(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[4141],{59215:function(De,ne,a){"use strict";a.r(ne),a.d(ne,{default:function(){return Ae}});var Re=a(57338),le=a(273),Ue=a(62350),ie=a(24565),o=a(39428),S=a(3182),Oe=a(57663),z=a(71577),Pe=a(34792),m=a(48086),y=a(2824),de=a(49101),Z=a(67294),oe=a(78009),ce=a(85224),me=a(16894),he=a(12826),Ye=a(71194),fe=a(50146),ue=a(11849),Be=a(77883),ve=a(85986),Le=a(43185),C=a(93009),Me=a(47673),O=a(4107),$e=a(14965),pe=a(91774),we=a(9715),d=a(71257),Ve=a(43358),g=a(34041),xe=a(84391),A=a(48971),Ge=a(65754),e=a(85893),ye=function(u){var F=g.Z.Option,r=g.Z.OptGroup,P=d.Z.useForm(),_=(0,y.Z)(P,1),I=_[0],ee=(0,Z.useState)(),w=(0,y.Z)(ee,2),x=w[0],te=w[1],H=(0,Z.useState)(),f=(0,y.Z)(H,2),Y=f[0],se=f[1],W=pe.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 V(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"?(V(t.name),h=t.name):(V(t.response.data[0]),h=t.response.data[0]);for(var E=0,L=Object.entries(R);E0&&(0,e.jsx)(ce.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)(Ze,{storeArray:h,onFinish:function(){var s=(0,S.Z)((0,o.Z)().mark(function i(n){var p;return(0,o.Z)().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),w(!1)},closable:!1,children:(f==null?void 0:f.name)&&(0,e.jsx)(he.ZP,{column:2,title:f==null?void 0:f.name,request:(0,S.Z)((0,o.Z)().mark(function s(){return(0,o.Z)().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:$})})]})},Ae=Ce}}]);