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