Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

2 řádky
14 KiB

  1. (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);E<L.length;E++){var G=L[E],M=(0,y.Z)(G,2),$=M[0],s=M[1];s.name==h&&delete R[$]}},onPreview:function(t){},defaultFileList:u.values.imageUrl?u.values.imageUrl:null};return(0,e.jsx)(fe.Z,{title:u.values.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:700,visible:u.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){u.onCancel()},destroyOnClose:!0,maskClosable:!1,children:(0,e.jsxs)(d.Z,{form:I,layout:"Horizontal",preserve:!1,initialValues:u.values,onFinish:u.onFinish,children:[(0,e.jsx)(d.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(O.Z,{})}),(0,e.jsx)(d.Z.Item,{name:"storeId",label:"\u9009\u62E9\u5E97\u94FA",rules:[{required:!1}],children:(0,e.jsx)(g.Z,{disabled:!!u.values.id,onChange:ae,children:u.storeArray.map(function(c,t){return(0,e.jsx)(g.Z.Option,{index:t,value:c.id,children:c.text},c.id)})})}),(0,e.jsx)(d.Z.Item,{name:"title",label:"\u5E7F\u544A\u6807\u9898",rules:[{required:!1,max:20,whitespace:!0}],children:(0,e.jsx)(O.Z,{placeholder:"\u5E7F\u544A\u6807\u9898"})}),(0,e.jsx)(d.Z.Item,{name:"planDate",label:"\u9009\u62E9\u65F6\u95F4",rules:[{required:!1}],children:(0,e.jsx)(W,{showTime:!0,format:"YYYY-MM-DD HH:mm:ss",style:{width:550}})}),(0,e.jsx)(d.Z.Item,{name:"type",label:"\u5E7F\u544A\u7C7B\u578B",children:(0,e.jsx)(g.Z,{children:(0,e.jsxs)(r,{children:[(0,e.jsx)(g.Z.Option,{value:0,children:"\u56FE\u7247"}),(0,e.jsx)(g.Z.Option,{value:1,children:"\u89C6\u9891"})]})})}),(0,e.jsx)(d.Z.Item,{noStyle:!0,shouldUpdate:function(t,h){return t.type!==h.type},children:function(t){var h=t.getFieldValue;return h("type")=="1"?(0,e.jsx)(d.Z.Item,{hidden:!0}):(0,e.jsx)(d.Z.Item,{style:{height:32},children:(0,e.jsx)(d.Z.Item,{label:"\u8F6E\u64AD\u95F4\u9694",name:"step",rules:[{required:!1,message:"\u56FE\u7247\u8F6E\u64AD\u65F6\u95F4\u95F4\u9694"}],children:(0,e.jsx)(ve.Z,{min:1,max:10,style:{width:250}})})})}}),(0,e.jsx)(d.Z.Item,{name:"uploadType",label:"\u4E0A\u4F20\u65B9\u5F0F",children:(0,e.jsx)(g.Z,{children:(0,e.jsxs)(r,{children:[(0,e.jsx)(g.Z.Option,{value:0,children:"\u81EA\u5B9A\u4E49\u4E0A\u4F20"}),(0,e.jsx)(g.Z.Option,{value:1,children:"\u7F51\u7EDC\u8DEF\u5F84"})]})})}),(0,e.jsx)(d.Z.Item,{noStyle:!0,shouldUpdate:function(t,h){return t.uploadType!==h.uploadType},children:function(t){var h=t.getFieldValue;return h("uploadType")=="1"?(0,e.jsx)(d.Z.Item,{name:"netWorkUrl",label:"\u7F51\u7EDC\u8DEF\u5F84",children:(0,e.jsx)(O.Z,{placeholder:"\u7F51\u7EDC\u8DEF\u5F84"})}):(0,e.jsx)(d.Z.Item,{style:{height:100},children:(0,e.jsx)(C.Z,(0,ue.Z)((0,ue.Z)({},re),{},{children:(0,e.jsx)(z.Z,{icon:(0,e.jsx)(xe.Z,{}),children:"\u4E0A\u4F20"})}))})}}),(0,e.jsx)(d.Z.Item,{children:(0,e.jsx)("span",{style:{color:"#FF0000",marginLeft:70},children:"\u6CE8: \u7F51\u7EDC\u8DEF\u5F84\u4E0A\u4F20\u56FE\u7247\u65F6\uFF0C\u591A\u5F20\u56FE\u7247\u89C4\u5219\u8BF7\u7528 \xA0|\xA0 \u9694\u5F00\u3002 \xA0\xA0 \u5982\uFF1A1.xxxxxx.jpg|2.xxxxxx.jpg"})}),(0,e.jsx)(d.Z.Item,{name:"imageUrl",label:"\u56FE\u7247\u5730\u5740",hidden:!0,children:(0,e.jsx)(O.Z,{placeholder:"\u56FE\u7247\u5730\u5740"})}),(0,e.jsx)(d.Z.Item,{name:"videoUrl",label:"\u89C6\u9891\u5730\u5740",hidden:!0,children:(0,e.jsx)(O.Z,{placeholder:"\u89C6\u9891\u5730\u5740"})}),(0,e.jsx)(d.Z.Item,{children:(0,e.jsx)(z.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})})]})})},Ze=ye,ge=a(30381),N=a.n(ge);function Fe(l){return b.apply(this,arguments)}function b(){return b=(0,S.Z)((0,o.Z)().mark(function l(u){return(0,o.Z)().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 Se(l){return k.apply(this,arguments)}function k(){return k=(0,S.Z)((0,o.Z)().mark(function l(u){return(0,o.Z)().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 je(l){return J.apply(this,arguments)}function J(){return J=(0,S.Z)((0,o.Z)().mark(function l(u){return(0,o.Z)().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 Ie(l){return K.apply(this,arguments)}function K(){return K=(0,S.Z)((0,o.Z)().mark(function l(u){return(0,o.Z)().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 Ee(l){return Q.apply(this,arguments)}function Q(){return Q=(0,S.Z)((0,o.Z)().mark(function l(u){return(0,o.Z)().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 Te(l){return X.apply(this,arguments)}function X(){return X=(0,S.Z)((0,o.Z)().mark(function l(u){return(0,o.Z)().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 Ce=function(){var u=(0,Z.useState)(!1),F=(0,y.Z)(u,2),r=F[0],P=F[1],_=(0,Z.useState)(!1),I=(0,y.Z)(_,2),ee=I[0],w=I[1],x=(0,Z.useRef)(),te=(0,Z.useState)(),H=(0,y.Z)(te,2),f=H[0],Y=H[1],se=(0,Z.useState)([]),W=(0,y.Z)(se,2),D=W[0],B=W[1],ae=(0,Z.useState)(),V=(0,y.Z)(ae,2),R=V[0],re=V[1],c=(0,Z.useState)([]),t=(0,y.Z)(c,2),h=t[0],E=t[1];(0,Z.useEffect)(function(){var s=function(n){var p=Ee({current:1,pageSize:1e3}).then(function(T){var v={},j=[];T.data.data.forEach(function(U){j.push({text:U.store_Name,id:U.id}),v[U.id]={text:U.store_Name}}),E(j),re(v),console.log(j)})};s()},[]);function L(s){try{return Se(JSON.stringify(s)),m.default.success("\u6DFB\u52A0\u6210\u529F"),x.current.reload(),!0}catch(i){return m.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}function G(s){try{return je(JSON.stringify(s)).then(function(i){i.data?(m.default.success("\u4FEE\u6539\u6210\u529F"),x.current.reload()):m.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")}),!0}catch(i){return m.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),!1}}function M(){try{return Ie(D.map(function(s,i){return s.id})).then(function(s){s.data?m.default.success("\u5220\u9664\u6210\u529F\uFF0C\u5373\u5C06\u5237\u65B0"):m.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")}),x.current.reload(),!0}catch(s){m.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5")}}var $=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0,render:function(i,n){return(0,e.jsx)("a",{onClick:function(){Y(n),w(!0)},children:i})}},{title:"\u5E97\u94FA",dataIndex:"storeId",valueEnum:R},{title:"\u5E7F\u544A\u7C7B\u578B",dataIndex:"type",valueEnum:{0:{text:"\u56FE\u7247"},1:{text:"\u89C6\u9891"}},hideInSearch:!0},{title:"\u4E0A\u4F20\u65B9\u5F0F",dataIndex:"uploadType",valueEnum:{0:{text:"\u81EA\u5B9A\u4E49\u4E0A\u4F20"},1:{text:"\u7F51\u7EDC\u8DEF\u5F84"}},hideInSearch:!0},{title:"\u5E7F\u544A\u6807\u9898",dataIndex:"title",valueType:"textarea"},{title:"\u8F6E\u64AD\u95F4\u9694\uFF08\u79D2\uFF09",dataIndex:"step",valueType:"textarea",hideInSearch:!0},{title:"\u5F00\u59CB\u65F6\u95F4",hideInSearch:!0,dataIndex:"startTime",valueType:"dateTime"},{title:"\u7ED3\u675F\u65F6\u95F4",hideInSearch:!0,dataIndex:"endTime",valueType:"dateTime"},{title:"\u72B6\u6001",dataIndex:"status",hideInForm:!0,hideInSearch:!0,valueEnum:{0:{text:"\u6B63\u5E38",status:"Processing"},1:{text:"\u505C\u7528",status:"Success"}}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",valueType:"textarea",hideInSearch:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(i,n){return[(0,e.jsx)("a",{onClick:function(){P(!0),Y(function(){return n.startTime!=null&&(n.startTime=N()(n.startTime),n.endTime=N()(n.endTime)),n})},children:"\u66F4\u65B0"},"config"),(0,e.jsxs)("a",{onClick:function(){n.status=n.status==0?1:0,Te(n).then(function(T){T.data&&x.current.reload()})},children:[" ",n.status==0?"\u505C\u7528":"\u542F\u7528"]},"primary")]}}];return(0,e.jsxs)(oe.ZP,{children:[(0,e.jsx)(me.ZP,{headerTitle:"\u5E7F\u544A\u5217\u8868",actionRef:x,rowKey:"id",search:{labelWidth:120},columns:$,toolBarRender:function(){return[(0,e.jsxs)(z.Z,{type:"primary",onClick:function(){P(!0),Y({})},children:[(0,e.jsx)(de.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var s=(0,S.Z)((0,o.Z)().mark(function i(n){var p,T;return(0,o.Z)().wrap(function(j){for(;;)switch(j.prev=j.next){case 0:return p=[],T=0,j.next=4,Fe(n).then(function(U){p=U.data.data,T=U.data.total});case 4:return j.abrupt("return",{data:p,success:!0,total:T});case 5:case"end":return j.stop()}},i)}));return function(i){return s.apply(this,arguments)}}(),rowSelection:{onChange:function(i,n){B(n)}}}),(D==null?void 0:D.length)>0&&(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}}]);