From a783e66b48da5a11ca64ab51d1529755bbf86de0 Mon Sep 17 00:00:00 2001 From: eduauto Date: Fri, 17 May 2024 10:39:44 +0800 Subject: [PATCH] autoUpdataFile --- p__News__Edit__index.async.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p__News__Edit__index.async.js b/p__News__Edit__index.async.js index d0c257ea8e..c86841ce7a 100644 --- a/p__News__Edit__index.async.js +++ b/p__News__Edit__index.async.js @@ -1 +1 @@ -"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[28477],{15263:function(e,n,t){var i=t(7557),l=t.n(i),a=t(41498),s=t.n(a),o=t(82242),r=t.n(o),u=t(79800),d=t.n(u),c=t(39647),p=t.n(c),h=t(59301),f=t(8591),m=t(46651),v=t(95237),x=t(57357),g=t(97650),j=t(1967),b=t(37712),y=["ButtonText","ButtonOptions","uploadProps"];n.Z=function(e){var n,t,i,a=e.ButtonText,o=e.ButtonOptions,u=e.uploadProps,c=p()(e,y),_=(0,h.useState)(null),Z=d()(_,2),w=Z[0],k=Z[1],C=r()(r()({maxCount:1,accept:"image/*",withCredentials:!0,beforeUpload:function(e){var n=e.size/1024/1024;return 0!=n||(f.ZP.error("".concat(e.name," 图片无法上传。").concat(0==n?"文件内容不能为空":"超过图片大小限制(2MB)")),m.Z.LIST_IGNORE)},onChange:function(e){var n;(["uploading","done","removed"].includes(e.file.status)&&k(e.file),"done"==e.file.status)&&(null==c||c.onChange(null===(n=e.file)||void 0===n||null===(n=n.response)||void 0===n?void 0:n.id))},action:"".concat(x.Z.API_SERVER,"/api/attachments.json")},u||{}),{},{onRemove:(t=s()(l()().mark((function e(n){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:P(),(null==u?void 0:u.onRemove)&&(null==u||u.onRemove(n));case 2:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}),P=function(){k(null),null==c||c.onChange()};return(0,h.useEffect)((function(){(null==c?void 0:c.value)&&k({response:{id:null==c?void 0:c.value}})}),[null==c?void 0:c.value]),(0,b.jsx)("div",{id:(null==c?void 0:c.scrollId)||"",children:null!=w&&null!==(n=w.response)&&void 0!==n&&n.id?(0,b.jsxs)(v.Z,{align:"middle",justify:"center",style:{position:"relative",width:400,backgroundColor:"#f4f3f4"},children:[(0,b.jsx)("img",{src:x.Z.API_SERVER+"/api/attachments/"+(null==w||null===(i=w.response)||void 0===i?void 0:i.id),alt:"avatar",style:{width:"100%"}}),(0,b.jsx)("div",{style:{position:"absolute",right:"-6px",top:"-6px",cursor:"pointer",width:16,height:16,borderRadius:"50%",backgroundColor:"#fff"},children:(0,b.jsx)(g.Z,{onClick:s()(l()().mark((function e(){return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:P();case 1:case"end":return e.stop()}}),e)}))),style:{fontSize:"16px",color:"red"}})})]}):(0,b.jsx)(m.Z,r()(r()({},C),{},{children:(0,b.jsx)(j.op,r()(r()({style:r()({borderRadius:"2px"},null==o?void 0:o.style)},o),{},{children:a}))}))})}},77984:function(e,n,t){var i=t(82242),l=t.n(i),a=(t(59301),t(19779)),s=t(3113),o=t(37712);n.Z=function(e){var n=e.img,t=e.buttonProps,i=void 0===t?{}:t,r=e.styles,u=void 0===r?{}:r,d=e.customText,c=e.ButtonText,p=e.ButtonClick,h=e.Buttonclass,f=e.ButtonTwo,m=e.imgStyles,v=e.loading,x=void 0!==v&&v;return(0,o.jsxs)("section",{className:"tc animated fadeIn",style:l()(l()({},{color:"#999",margin:"100px auto",visibility:x?"hidden":"visible"}),u),children:[(0,o.jsx)("img",{src:n||a,style:l()({width:288,height:200},m)}),(0,o.jsx)("p",{className:"mt20 font14",children:d||"暂时还没有相关数据哦!"}),c&&(0,o.jsx)(s.ZP,l()(l()({className:h,onClick:p},i),{},{children:c})),f&&f]})}},58645:function(e,n,t){t.d(n,{Z:function(){return x}});var i=t(82242),l=t.n(i),a=t(7557),s=t.n(a),o=t(41498),r=t.n(o),u=t(79800),d=t.n(u),c=t(59301),p=t(84686),h=t(90694),f=t(51882),m=(t(14331),{editor_css:"editor_css___cm3Z8"}),v=t(37712),x=(0,f.connect)((function(e){return{user:e.user}}))((function(e){var n=e.defaultvalue,t=e.onChange,i=e.style,a=e.user,o=e.placeholder,u=2097152,f=(0,c.useRef)(null),x=(0,c.useState)(null),g=d()(x,2),j=g[0],b=g[1],y=(0,c.useState)(""),_=d()(y,2),Z=_[0],w=_[1];(0,c.useEffect)((function(){w(n)}),[n]),(0,c.useEffect)((function(){t(Z)}),[Z]);var k={placeholder:o||"请输入内容...",MENU_CONF:{}};return k.MENU_CONF.uploadImage={customUpload:function(e,n){return r()(s()().mark((function t(){var i,l;return s()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(i=new FormData).append("file",e),t.next=4,(0,h.ZP)("/api/attachments.json",{method:"post",body:i},!0);case 4:l=t.sent,n(null==l?void 0:l.url,"","");case 6:case"end":return t.stop()}}),t)})))()}},k.MENU_CONF.uploadVideo={customUpload:function(e,n){return r()(s()().mark((function t(){var i,l,o,r,d,c,p,m,v,x,g,j,b,y;return s()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.size,l=Math.ceil(i/u),t.prev=2,t.next=5,(0,h.ZP)("/api/attachments/multipart_upload_start",{method:"POST",body:{fileName:e.name,chunkCount:l,user_id:null==a||null===(o=a.userInfo)||void 0===o?void 0:o.user_id}});case 5:if(0===(null==(d=t.sent)?void 0:d.status)){t.next=8;break}throw new Error;case 8:c=d.upload_id,f.current=new AbortController,p=[],0,m=s()().mark((function n(){var t,l,a,o;return s()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t=v*u,l=Math.min(t+u,i),a=e.slice(t,l),(o=new FormData).append("chunk",a),o.append("fileName",e.name),o.append("chunkIndex",(v+1).toString()),o.append("uploadId",c),p.push((function(){return(0,h.ZP)("/api/attachments/multipart_upload",{method:"POST",body:o,signal:f.current.signal},!0).then((function(e){}))}));case 9:case"end":return n.stop()}}),n)})),v=0;case 14:if(!(v0)){t.next=29;break}return t.next=27,Promise.all(b);case 27:t.sent,x+=g;case 29:t.next=22;break;case 31:return t.next=33,(0,h.ZP)("/api/attachments/multipart_upload_end",{method:"POST",body:{fileName:e.name,chunkCount:l,uploadId:c,user_id:null==a||null===(r=a.userInfo)||void 0===r?void 0:r.user_id}});case 33:y=t.sent,n(null==y?void 0:y.object,""),t.next=39;break;case 37:t.prev=37,t.t1=t.catch(2);case 39:case"end":return t.stop()}}),t,null,[[2,37]])})))()}},(0,c.useEffect)((function(){return function(){null!=j&&(j.destroy(),b(null))}}),[j]),(0,v.jsx)(v.Fragment,{children:(0,v.jsxs)("div",{className:null==m?void 0:m.editor_css,style:{border:"1px solid #ccc",zIndex:100},children:[(0,v.jsx)(p.o,{editor:j,defaultConfig:{},mode:"default",style:{borderBottom:"1px solid #ccc"}}),(0,v.jsx)(p.M,{defaultConfig:k,value:Z,onCreated:b,onChange:function(e){return w(e.getHtml())},mode:"default",style:l()({height:"500px",overflowY:"hidden"},i)})]})})}))},74319:function(e,n,t){t.r(n),t.d(n,{default:function(){return A}});var i=t(37205),l=t.n(i),a=t(7557),s=t.n(a),o=t(41498),r=t.n(o),u=t(82242),d=t.n(u),c=t(79800),p=t.n(c),h=t(59301),f=t(78241),m=t(8591),v=t(98135),x=t(95237),g=t(43604),j=t(84291),b=t(78673),y=t(46651),_=t(3113),Z=t(81407),w=t(51882),k="ContentWarp____NGO4",C="footst___JOtkR",P="tags___d8Fj9",I="hidden___Uq9ip",F=t(58645),S=(t(32927),t(90694)),N=t(57357),E=t(99232),R=t.n(E),T=t(1967),B=t(15263),O=t(37712),A=(0,w.connect)((function(e){var n=e.homePage,t=e.loading,i=e.globalSetting,l=e.user;return{homePage:n,globalSetting:i,loading:t.models.homePage,user:l}}))((function(e){e.homePage,e.globalSetting,e.user,e.loading;var n=e.dispatch,t=(0,h.useState)(),i=p()(t,2),a=i[0],o=i[1],u=f.Z.useForm(),c=p()(u,1)[0],E=(0,h.useState)([]),A=p()(E,2),z=A[0],L=A[1],U=(0,h.useState)(d()({page:1,limit:10},(0,w.useParams)())),M=p()(U,2),V=M[0];M[1];(0,h.useEffect)((function(){return n({type:"globalSetting/headerFooterToggle",payload:!1}),function(){n({type:"globalSetting/headerFooterToggle",payload:!0})}}),[]);function q(){return(q=r()(s()().mark((function e(){var n,t,i,l,a,r,u,d,p;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)("/api/news_events/".concat(V.id,".json"),{method:"get"});case 2:0===(null==(n=e.sent)?void 0:n.status)&&(o(null==n?void 0:n.data),L(null==n||null===(t=n.data)||void 0===t?void 0:t.news_event_tags),c.setFieldsValue({title:null==n||null===(i=n.data)||void 0===i?void 0:i.title,publisher:null==n||null===(l=n.data)||void 0===l?void 0:l.publisher,url:null==n||null===(a=n.data)||void 0===a?void 0:a.url,content:null==n||null===(r=n.data)||void 0===r?void 0:r.content,is_top:null==n||null===(u=n.data)||void 0===u?void 0:u.is_top,publish_time:R()(null==n||null===(d=n.data)||void 0===d?void 0:d.publish_time),attachment_ids:null==n||null===(p=n.data)||void 0===p||null===(p=p.attachments)||void 0===p?void 0:p.map((function(e){return{uid:e.id,name:e.title,status:"down",response:{id:e.id}}}))}));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,h.useEffect)((function(){!function(){q.apply(this,arguments)}()}),[]),(0,O.jsxs)("section",{style:{background:"#fff",paddingBottom:60},children:[(0,O.jsxs)("div",{style:{width:1200,margin:"0px auto"},children:[(0,O.jsxs)("div",{style:{paddingTop:40,display:"flex",alignItems:"center"},children:[(0,O.jsx)("div",{style:{background:"#666666",height:14,width:4,marginRight:8}}),(0,O.jsx)("span",{style:{color:"#232B40",fontWeight:500},children:"新闻动态"})]}),(0,O.jsx)("div",{className:k,children:(0,O.jsxs)(f.Z,{size:"large",colon:!1,form:c,onFinish:function(){var e=r()(s()().mark((function e(n){var t,i;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)("/api/news_events/".concat(V.id,".json"),{method:"PUT",body:d()(d()({},n),{},{attachment_ids:null==n||null===(t=n.attachment_ids)||void 0===t?void 0:t.map((function(e){var n;return null==e||null===(n=e.response)||void 0===n?void 0:n.id})),news_event_tags:z})});case 2:0===(null==(i=e.sent)?void 0:i.status)&&(m.ZP.info("保存成功"),history.back());case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,O.jsx)(f.Z.Item,{label:"标题",name:"title",labelCol:{span:2},rules:[{required:!0,message:"标题不能为空"}],children:(0,O.jsx)(v.Z,{maxLength:200,showCount:!0})}),(0,O.jsx)(f.Z.Item,{label:"标签",name:"tags",labelCol:{span:2},children:(0,O.jsx)(v.Z,{onPressEnter:function(e){5!==(null==z?void 0:z.length)?(z.push({id:null,name:e.target.value}),L(l()(z)),c.setFieldsValue({tags:""})):m.ZP.info("最多新增5个标签")},maxLength:10,addonAfter:"回车添加标签"})}),(0,O.jsxs)(x.Z,{children:[(0,O.jsx)(g.Z,{span:2}),null==z?void 0:z.map((function(e,n){return(0,O.jsxs)("div",{className:P,style:{position:"relative"},children:[(0,O.jsx)("span",{style:{display:"inline-flex",justifyContent:"center",padding:"0px 14px",background:"#F6F7F9",borderRadius:16,height:32,lineHeight:"32px",color:"#AC651A",marginRight:20,marginBottom:16},children:null==e?void 0:e.name}),(0,O.jsx)("span",{onClick:function(){z.splice(n,1),L(l()(z))},className:I,style:{position:"absolute",right:15,top:-5,width:14,height:14,background:"#E30000",color:"#FFFFFF",alignItems:"center",justifyContent:"center",borderRadius:"50%",fontSize:10,cursor:"pointer"},children:"x"})]})}))]}),(0,O.jsxs)(x.Z,{children:[(0,O.jsx)(g.Z,{span:12,children:(0,O.jsx)(f.Z.Item,{label:"发布人",labelCol:{span:4},rules:[{required:!0,message:"发布人不能为空"}],name:"publisher",children:(0,O.jsx)(v.Z,{maxLength:10})})}),(0,O.jsx)(g.Z,{span:11,style:{marginLeft:46},children:(0,O.jsx)(f.Z.Item,{label:"发布时间",rules:[{required:!0,message:"发布时间不能为空"}],name:"publish_time",children:(0,O.jsx)(j.default,{style:{width:"100%"},showTime:!0})})})]}),(0,O.jsx)(f.Z.Item,{label:"链接",name:"url",labelCol:{span:2},children:(0,O.jsx)(v.Z,{})}),(0,O.jsx)(f.Z.Item,{label:"内容",name:"content",rules:[{required:!0,message:"请输入内容"}],labelCol:{span:2},children:(0,O.jsx)(F.Z,{defaultvalue:null==a?void 0:a.content})}),(0,O.jsx)(f.Z.Item,{label:"置顶",name:"is_top",valuePropName:"checked",labelCol:{span:2},children:(0,O.jsx)(b.Z,{})}),(0,O.jsxs)(x.Z,{wrap:!1,gutter:20,children:[(0,O.jsx)(g.Z,{flex:1,children:(0,O.jsx)(f.Z.Item,{name:"attachment_ids",label:(0,O.jsx)("div",{style:{textAlign:"right",width:82},children:"附件"}),valuePropName:"fileList",getValueFromEvent:function(e){return Array.isArray(e)?e:null==e?void 0:e.fileList},children:(0,O.jsx)(y.Z,{onRemove:function(){var e=r()(s()().mark((function e(n){var t;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)("/api/attachments/".concat(null==n||null===(t=n.response)||void 0===t?void 0:t.id,".json"),{method:"delete"});case 2:e.sent;case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),action:"".concat(N.Z.API_SERVER,"/api/attachments.json"),withCredentials:!0,listType:"picture",children:(0,O.jsx)(T.op,{style:{borderRadius:"2px"},icon:(0,O.jsx)(Z.Z,{}),children:"上传文件"})})})}),(0,O.jsx)(g.Z,{flex:1,children:(0,O.jsx)(f.Z.Item,{name:"cover_id",label:"封面图",children:(0,O.jsx)(B.Z,{uploadProps:{accept:".jpg, .png",beforeUpload:function(e){return!(e.size/1024/1024>10)||(m.ZP.error("封面图仅支持上传文件大小10MB以下的文件。"),y.Z.LIST_IGNORE)},data:{is_upload_cover:!0}},ButtonText:"上传图片",ButtonOptions:{icon:(0,O.jsx)(Z.Z,{})}})})})]})]})})]}),(0,O.jsx)("div",{className:C,children:(0,O.jsxs)("div",{style:{width:1200,margin:"0px auto",display:"flex",alignItems:"center",justifyContent:"space-between",height:"100%"},children:[(0,O.jsx)(_.ZP,{onClick:function(){history.back()},size:"large",children:"返回"}),(0,O.jsx)(_.ZP,{onClick:function(){c.submit()},style:{marginLeft:10},type:"primary",size:"large",children:"确认保存"})]})})]})}))}}]); \ No newline at end of file +"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[28477],{15263:function(e,n,t){var i=t(7557),s=t.n(i),a=t(41498),l=t.n(a),o=t(82242),r=t.n(o),u=t(79800),c=t.n(u),d=t(39647),p=t.n(d),h=t(59301),f=t(8591),m=t(46651),v=t(95237),x=t(57357),g=t(97650),j=t(1967),b=t(37712),y=["ButtonText","ButtonOptions","uploadProps"];n.Z=function(e){var n,t,i,a=e.ButtonText,o=e.ButtonOptions,u=e.uploadProps,d=p()(e,y),Z=(0,h.useState)(null),_=c()(Z,2),w=_[0],k=_[1],C=r()(r()({maxCount:1,accept:"image/*",withCredentials:!0,beforeUpload:function(e){var n=e.size/1024/1024;return 0!=n||(f.ZP.error("".concat(e.name," 图片无法上传。").concat(0==n?"文件内容不能为空":"超过图片大小限制(2MB)")),m.Z.LIST_IGNORE)},onChange:function(e){var n;(["uploading","done","removed"].includes(e.file.status)&&k(e.file),"done"==e.file.status)&&(null==d||d.onChange(null===(n=e.file)||void 0===n||null===(n=n.response)||void 0===n?void 0:n.id))},action:"".concat(x.Z.API_SERVER,"/api/attachments.json")},u||{}),{},{onRemove:(t=l()(s()().mark((function e(n){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:P(),(null==u?void 0:u.onRemove)&&(null==u||u.onRemove(n));case 2:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}),P=function(){k(null),null==d||d.onChange()};return(0,h.useEffect)((function(){(null==d?void 0:d.value)&&k({response:{id:null==d?void 0:d.value}})}),[null==d?void 0:d.value]),(0,b.jsx)("div",{id:(null==d?void 0:d.scrollId)||"",children:null!=w&&null!==(n=w.response)&&void 0!==n&&n.id?(0,b.jsxs)(v.Z,{align:"middle",justify:"center",style:{position:"relative",width:400,backgroundColor:"#f4f3f4"},children:[(0,b.jsx)("img",{src:x.Z.API_SERVER+"/api/attachments/"+(null==w||null===(i=w.response)||void 0===i?void 0:i.id),alt:"avatar",style:{width:"100%"}}),(0,b.jsx)("div",{style:{position:"absolute",right:"-6px",top:"-6px",cursor:"pointer",width:16,height:16,borderRadius:"50%",backgroundColor:"#fff"},children:(0,b.jsx)(g.Z,{onClick:l()(s()().mark((function e(){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:P();case 1:case"end":return e.stop()}}),e)}))),style:{fontSize:"16px",color:"red"}})})]}):(0,b.jsx)(m.Z,r()(r()({},C),{},{children:(0,b.jsx)(j.op,r()(r()({style:r()({borderRadius:"2px"},null==o?void 0:o.style)},o),{},{children:a}))}))})}},77984:function(e,n,t){var i=t(82242),s=t.n(i),a=(t(59301),t(19779)),l=t(3113),o=t(37712);n.Z=function(e){var n=e.img,t=e.buttonProps,i=void 0===t?{}:t,r=e.styles,u=void 0===r?{}:r,c=e.customText,d=e.ButtonText,p=e.ButtonClick,h=e.Buttonclass,f=e.ButtonTwo,m=e.imgStyles,v=e.loading,x=void 0!==v&&v;return(0,o.jsxs)("section",{className:"tc animated fadeIn",style:s()(s()({},{color:"#999",margin:"100px auto",visibility:x?"hidden":"visible"}),u),children:[(0,o.jsx)("img",{src:n||a,style:s()({width:288,height:200},m)}),(0,o.jsx)("p",{className:"mt20 font14",children:c||"暂时还没有相关数据哦!"}),d&&(0,o.jsx)(l.ZP,s()(s()({className:h,onClick:p},i),{},{children:d})),f&&f]})}},58645:function(e,n,t){t.d(n,{Z:function(){return x}});var i=t(82242),s=t.n(i),a=t(7557),l=t.n(a),o=t(41498),r=t.n(o),u=t(79800),c=t.n(u),d=t(59301),p=t(84686),h=t(90694),f=t(51882),m=(t(14331),{editor_css:"editor_css___cm3Z8"}),v=t(37712),x=(0,f.connect)((function(e){return{user:e.user}}))((function(e){var n=e.defaultvalue,t=e.onChange,i=e.style,a=e.user,o=e.placeholder,u=2097152,f=(0,d.useRef)(null),x=(0,d.useState)(null),g=c()(x,2),j=g[0],b=g[1],y=(0,d.useState)(""),Z=c()(y,2),_=Z[0],w=Z[1];(0,d.useEffect)((function(){w(n)}),[n]),(0,d.useEffect)((function(){t(_)}),[_]);var k={placeholder:o||"请输入内容...",MENU_CONF:{}};return k.MENU_CONF.uploadImage={customUpload:function(e,n){return r()(l()().mark((function t(){var i,s;return l()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(i=new FormData).append("file",e),t.next=4,(0,h.ZP)("/api/attachments.json",{method:"post",body:i},!0);case 4:s=t.sent,n(null==s?void 0:s.url,"","");case 6:case"end":return t.stop()}}),t)})))()}},k.MENU_CONF.uploadVideo={customUpload:function(e,n){return r()(l()().mark((function t(){var i,s,o,r,c,d,p,m,v,x,g,j,b,y;return l()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.size,s=Math.ceil(i/u),t.prev=2,t.next=5,(0,h.ZP)("/api/attachments/multipart_upload_start",{method:"POST",body:{fileName:e.name,chunkCount:s,user_id:null==a||null===(o=a.userInfo)||void 0===o?void 0:o.user_id}});case 5:if(0===(null==(c=t.sent)?void 0:c.status)){t.next=8;break}throw new Error;case 8:d=c.upload_id,f.current=new AbortController,p=[],0,m=l()().mark((function n(){var t,s,a,o;return l()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t=v*u,s=Math.min(t+u,i),a=e.slice(t,s),(o=new FormData).append("chunk",a),o.append("fileName",e.name),o.append("chunkIndex",(v+1).toString()),o.append("uploadId",d),p.push((function(){return(0,h.ZP)("/api/attachments/multipart_upload",{method:"POST",body:o,signal:f.current.signal},!0).then((function(e){}))}));case 9:case"end":return n.stop()}}),n)})),v=0;case 14:if(!(v0)){t.next=29;break}return t.next=27,Promise.all(b);case 27:t.sent,x+=g;case 29:t.next=22;break;case 31:return t.next=33,(0,h.ZP)("/api/attachments/multipart_upload_end",{method:"POST",body:{fileName:e.name,chunkCount:s,uploadId:d,user_id:null==a||null===(r=a.userInfo)||void 0===r?void 0:r.user_id}});case 33:y=t.sent,n(null==y?void 0:y.object,""),t.next=39;break;case 37:t.prev=37,t.t1=t.catch(2);case 39:case"end":return t.stop()}}),t,null,[[2,37]])})))()}},(0,d.useEffect)((function(){return function(){null!=j&&(j.destroy(),b(null))}}),[j]),(0,v.jsx)(v.Fragment,{children:(0,v.jsxs)("div",{className:null==m?void 0:m.editor_css,style:{border:"1px solid #ccc",zIndex:100},children:[(0,v.jsx)(p.o,{editor:j,defaultConfig:{},mode:"default",style:{borderBottom:"1px solid #ccc"}}),(0,v.jsx)(p.M,{defaultConfig:k,value:_,onCreated:b,onChange:function(e){return w(e.getHtml())},mode:"default",style:s()({height:"500px",overflowY:"hidden"},i)})]})})}))},74319:function(e,n,t){t.r(n),t.d(n,{default:function(){return A}});var i=t(37205),s=t.n(i),a=t(7557),l=t.n(a),o=t(41498),r=t.n(o),u=t(82242),c=t.n(u),d=t(79800),p=t.n(d),h=t(59301),f=t(78241),m=t(8591),v=t(98135),x=t(95237),g=t(43604),j=t(84291),b=t(78673),y=t(46651),Z=t(3113),_=t(81407),w=t(51882),k="ContentWarp____NGO4",C="footst___JOtkR",P="tags___d8Fj9",I="hidden___Uq9ip",F=t(58645),S=(t(32927),t(90694)),N=t(57357),E=t(99232),R=t.n(E),T=t(1967),B=t(15263),O=t(37712),A=(0,w.connect)((function(e){var n=e.homePage,t=e.loading,i=e.globalSetting,s=e.user;return{homePage:n,globalSetting:i,loading:t.models.homePage,user:s}}))((function(e){e.homePage,e.globalSetting,e.user,e.loading;var n=e.dispatch,t=(0,h.useState)(),i=p()(t,2),a=i[0],o=i[1],u=f.Z.useForm(),d=p()(u,1)[0],E=(0,h.useState)([]),A=p()(E,2),z=A[0],L=A[1],U=(0,h.useState)(c()({page:1,limit:10},(0,w.useParams)())),M=p()(U,2),V=M[0];M[1];(0,h.useEffect)((function(){return n({type:"globalSetting/headerFooterToggle",payload:!1}),function(){n({type:"globalSetting/headerFooterToggle",payload:!0})}}),[]);function q(){return(q=r()(l()().mark((function e(){var n,t,i,s;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)("/api/news_events/".concat(V.id,".json"),{method:"get"});case 2:0===(null==(n=e.sent)?void 0:n.status)&&(o(null==n?void 0:n.data),L(null==n||null===(t=n.data)||void 0===t?void 0:t.news_event_tags),d.setFieldsValue(c()(c()({},null==n?void 0:n.data),{},{publish_time:R()(null==n||null===(i=n.data)||void 0===i?void 0:i.publish_time),attachment_ids:null==n||null===(s=n.data)||void 0===s||null===(s=s.attachments)||void 0===s?void 0:s.map((function(e){return{uid:e.id,name:e.title,status:"down",response:{id:e.id}}}))})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,h.useEffect)((function(){!function(){q.apply(this,arguments)}()}),[]),(0,O.jsxs)("section",{style:{background:"#fff",paddingBottom:60},children:[(0,O.jsxs)("div",{style:{width:1200,margin:"0px auto"},children:[(0,O.jsxs)("div",{style:{paddingTop:40,display:"flex",alignItems:"center"},children:[(0,O.jsx)("div",{style:{background:"#666666",height:14,width:4,marginRight:8}}),(0,O.jsx)("span",{style:{color:"#232B40",fontWeight:500},children:"新闻动态"})]}),(0,O.jsx)("div",{className:k,children:(0,O.jsxs)(f.Z,{size:"large",colon:!1,form:d,onFinish:function(){var e=r()(l()().mark((function e(n){var t,i;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)("/api/news_events/".concat(V.id,".json"),{method:"PUT",body:c()(c()({},n),{},{attachment_ids:null==n||null===(t=n.attachment_ids)||void 0===t?void 0:t.map((function(e){var n;return null==e||null===(n=e.response)||void 0===n?void 0:n.id})),news_event_tags:z})});case 2:0===(null==(i=e.sent)?void 0:i.status)&&(m.ZP.info("保存成功"),history.back());case 4:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),children:[(0,O.jsx)(f.Z.Item,{label:"标题",name:"title",labelCol:{span:2},rules:[{required:!0,message:"标题不能为空"}],children:(0,O.jsx)(v.Z,{maxLength:200,showCount:!0})}),(0,O.jsx)(f.Z.Item,{label:"标签",name:"tags",labelCol:{span:2},children:(0,O.jsx)(v.Z,{onPressEnter:function(e){5!==(null==z?void 0:z.length)?(z.push({id:null,name:e.target.value}),L(s()(z)),d.setFieldsValue({tags:""})):m.ZP.info("最多新增5个标签")},maxLength:10,addonAfter:"回车添加标签"})}),(0,O.jsxs)(x.Z,{children:[(0,O.jsx)(g.Z,{span:2}),null==z?void 0:z.map((function(e,n){return(0,O.jsxs)("div",{className:P,style:{position:"relative"},children:[(0,O.jsx)("span",{style:{display:"inline-flex",justifyContent:"center",padding:"0px 14px",background:"#F6F7F9",borderRadius:16,height:32,lineHeight:"32px",color:"#AC651A",marginRight:20,marginBottom:16},children:null==e?void 0:e.name}),(0,O.jsx)("span",{onClick:function(){z.splice(n,1),L(s()(z))},className:I,style:{position:"absolute",right:15,top:-5,width:14,height:14,background:"#E30000",color:"#FFFFFF",alignItems:"center",justifyContent:"center",borderRadius:"50%",fontSize:10,cursor:"pointer"},children:"x"})]})}))]}),(0,O.jsxs)(x.Z,{children:[(0,O.jsx)(g.Z,{span:12,children:(0,O.jsx)(f.Z.Item,{label:"发布人",labelCol:{span:4},rules:[{required:!0,message:"发布人不能为空"}],name:"publisher",children:(0,O.jsx)(v.Z,{maxLength:10})})}),(0,O.jsx)(g.Z,{span:11,style:{marginLeft:46},children:(0,O.jsx)(f.Z.Item,{label:"发布时间",rules:[{required:!0,message:"发布时间不能为空"}],name:"publish_time",children:(0,O.jsx)(j.default,{style:{width:"100%"},showTime:!0})})})]}),(0,O.jsx)(f.Z.Item,{label:"链接",name:"url",labelCol:{span:2},children:(0,O.jsx)(v.Z,{})}),(0,O.jsx)(f.Z.Item,{label:"内容",name:"content",rules:[{required:!0,message:"请输入内容"}],labelCol:{span:2},children:(0,O.jsx)(F.Z,{defaultvalue:null==a?void 0:a.content})}),(0,O.jsx)(f.Z.Item,{label:"置顶",name:"is_top",valuePropName:"checked",labelCol:{span:2},children:(0,O.jsx)(b.Z,{})}),(0,O.jsxs)(x.Z,{wrap:!1,gutter:20,children:[(0,O.jsx)(g.Z,{flex:1,children:(0,O.jsx)(f.Z.Item,{name:"attachment_ids",label:(0,O.jsx)("div",{style:{textAlign:"right",width:82},children:"附件"}),valuePropName:"fileList",getValueFromEvent:function(e){return Array.isArray(e)?e:null==e?void 0:e.fileList},children:(0,O.jsx)(y.Z,{onRemove:function(){var e=r()(l()().mark((function e(n){var t;return l()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)("/api/attachments/".concat(null==n||null===(t=n.response)||void 0===t?void 0:t.id,".json"),{method:"delete"});case 2:e.sent;case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),action:"".concat(N.Z.API_SERVER,"/api/attachments.json"),withCredentials:!0,listType:"picture",children:(0,O.jsx)(T.op,{style:{borderRadius:"2px"},icon:(0,O.jsx)(_.Z,{}),children:"上传文件"})})})}),(0,O.jsx)(g.Z,{flex:1,children:(0,O.jsx)(f.Z.Item,{name:"cover_id",label:"封面图",children:(0,O.jsx)(B.Z,{uploadProps:{accept:".jpg, .png",beforeUpload:function(e){return!(e.size/1024/1024>10)||(m.ZP.error("封面图仅支持上传文件大小10MB以下的文件。"),y.Z.LIST_IGNORE)},data:{is_upload_cover:!0}},ButtonText:"上传图片",ButtonOptions:{icon:(0,O.jsx)(_.Z,{})}})})})]})]})})]}),(0,O.jsx)("div",{className:C,children:(0,O.jsxs)("div",{style:{width:1200,margin:"0px auto",display:"flex",alignItems:"center",justifyContent:"space-between",height:"100%"},children:[(0,O.jsx)(Z.ZP,{onClick:function(){history.back()},size:"large",children:"返回"}),(0,O.jsx)(Z.ZP,{onClick:function(){d.submit()},style:{marginLeft:10},type:"primary",size:"large",children:"确认保存"})]})})]})}))}}]); \ No newline at end of file