|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[28859],{40822:function(e,n,t){t.d(n,{Z:function(){return y}});var l=t(7557),i=t.n(l),r=t(41498),s=t.n(r),a=t(82242),o=t.n(a),u=t(79800),d=t.n(u),c=t(39647),m=t.n(c),p=t(59301),h=t(8591),f=t(53326),x=t(95237),v=t(84666),g=t(21884),j=t(11249),b="tip___bHEXo",_=t(37712),C=["ButtonText","ButtonOptions","uploadProps","showTip"],y=function(e){var n,t,l,r=e.ButtonText,a=e.ButtonOptions,u=e.uploadProps,c=e.showTip,y=m()(e,C),Z=(0,p.useState)(null),w=d()(Z,2),k=w[0],I=w[1],Y=o()(o()({maxCount:1,accept:"image/*",withCredentials:!0,beforeUpload:function(e){var n=e.size/1024/1024;return 0!=n||(h.ZP.error("".concat(e.name," 图片无法上传。").concat(0==n?"文件内容不能为空":"超过图片大小限制(2MB)")),f.Z.LIST_IGNORE)},onChange:function(e){var n;(["uploading","done","removed"].includes(e.file.status)&&I(e.file),"done"==e.file.status)&&(null==y||y.onChange(null===(n=e.file)||void 0===n||null===(n=n.response)||void 0===n?void 0:n.id))},action:"".concat(v.Z.API_SERVER,"/api/attachments.json")},u||{}),{},{onRemove:(t=s()(i()().mark((function e(n){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:E(),(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)})}),E=function(){I(null),null==y||y.onChange()};return(0,p.useEffect)((function(){(null==y?void 0:y.value)&&I({response:{id:null==y?void 0:y.value}})}),[null==y?void 0:y.value]),(0,_.jsx)("div",{id:(null==y?void 0:y.scrollId)||"",children:null!=k&&null!==(n=k.response)&&void 0!==n&&n.id?(0,_.jsxs)(x.Z,{align:"middle",justify:"center",style:{position:"relative",width:400,backgroundColor:"#f4f3f4"},children:[(0,_.jsx)("img",{src:v.Z.API_SERVER+"/api/attachments/"+(null==k||null===(l=k.response)||void 0===l?void 0:l.id),alt:"avatar",style:{width:"100%"}}),(0,_.jsx)("div",{style:{position:"absolute",right:"-6px",top:"-6px",cursor:"pointer",width:16,height:16,borderRadius:"50%",backgroundColor:"#fff"},children:(0,_.jsx)(g.Z,{onClick:s()(i()().mark((function e(){return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:E();case 1:case"end":return e.stop()}}),e)}))),style:{fontSize:"16px",color:"red"}})})]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(f.Z,o()(o()({},Y),{},{children:(0,_.jsx)(j.op,o()(o()({style:o()({borderRadius:"2px"},null==a?void 0:a.style)},a),{},{children:r}))})),c&&(0,_.jsx)("span",{className:b,children:"(建议上传尺寸为472*266的图片)"})]})})}},59517:function(e,n,t){t.d(n,{Z:function(){return v}});var l=t(82242),i=t.n(l),r=t(7557),s=t.n(r),a=t(41498),o=t.n(a),u=t(79800),d=t.n(u),c=t(59301),m=t(84686),p=t(67444),h=t(33936),f=(t(95275),{editor_css:"editor_css___cm3Z8"}),x=t(37712),v=(0,h.connect)((function(e){return{user:e.user}}))((function(e){var n=e.defaultvalue,t=e.onChange,l=e.style,r=e.user,a=e.placeholder,u=2097152,h=(0,c.useRef)(null),v=(0,c.useState)(null),g=d()(v,2),j=g[0],b=g[1],_=(0,c.useState)(""),C=d()(_,2),y=C[0],Z=C[1];(0,c.useEffect)((function(){Z(n)}),[n]),(0,c.useEffect)((function(){t(y)}),[y]);var w={placeholder:a||"请输入内容...",MENU_CONF:{}};w.MENU_CONF.uploadImage={customUpload:function(e,n){return o()(s()().mark((function t(){var l,i;return s()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(l=new FormData).append("file",e),t.next=4,(0,p.ZP)("/api/attachments.json",{method:"post",body:l},!0);case 4:i=t.sent,n(null==i?void 0:i.url,"","");case 6:case"end":return t.stop()}}),t)})))()}},w.MENU_CONF.uploadVideo={customUpload:function(e,n){return o()(s()().mark((function t(){var l,i,a,o,d,c,m,f,x,v,g,j,b,_;return s()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l=e.size,i=Math.ceil(l/u),t.prev=2,t.next=5,(0,p.ZP)("/api/attachments/multipart_upload_start",{method:"POST",body:{fileName:e.name,chunkCount:i,user_id:null==r||null===(a=r.userInfo)||void 0===a?void 0:a.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,h.current=new AbortController,m=[],0,f=s()().mark((function n(){var t,i,r,a;return s()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:t=x*u,i=Math.min(t+u,l),r=e.slice(t,i),(a=new FormData).append("chunk",r),a.append("fileName",e.name),a.append("chunkIndex",(x+1).toString()),a.append("uploadId",c),m.push((function(){return(0,p.ZP)("/api/attachments/multipart_upload",{method:"POST",body:a,signal:h.current.signal},!0).then((function(e){}))}));case 9:case"end":return n.stop()}}),n)})),x=0;case 14:if(!(x<i)){t.next=19;break}return t.delegateYield(f(),"t0",16);case 16:x++,t.next=14;break;case 19:v=0,g=4,console.log(m,"promises");case 22:if(!(v<m.length)){t.next=31;break}if(!((b=null===(j=m.slice(v,v+g))||void 0===j?void 0:j.map((function(e){return e()}))).length>0)){t.next=29;break}return t.next=27,Promise.all(b);case 27:t.sent,v+=g;case 29:t.next=22;break;case 31:return t.next=33,(0,p.ZP)("/api/attachments/multipart_upload_end",{method:"POST",body:{fileName:e.name,chunkCount:i,uploadId:c,user_id:null==r||null===(o=r.userInfo)||void 0===o?void 0:o.user_id}});case 33:_=t.sent,n(null==_?void 0:_.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]])})))()}};return(0,c.useEffect)((function(){return function(){null!=j&&(j.destroy(),b(null))}}),[j]),(0,x.jsx)(x.Fragment,{children:(0,x.jsxs)("div",{className:null==f?void 0:f.editor_css,style:{border:"1px solid #ccc",zIndex:100},children:[(0,x.jsx)(m.o,{editor:j,defaultConfig:{},mode:"default",style:{borderBottom:"1px solid #ccc"}}),(0,x.jsx)(m.M,{defaultConfig:w,value:y,onCreated:b,onChange:function(e){var n;!function(e){return""==e||new RegExp("^[ ]+$").test(e)}((n=e.getHtml(),n.replace(/<[^<p>]+>/g,"").replace(/<[</p>$]+>/g,"").replace(/ /gi,"").replace(/<[^<br/>]+>/g,"")))?Z(e.getHtml()):Z("")},mode:"default",style:i()({height:"500px",overflowY:"hidden"},l)})]})})}))},28859:function(e,n,t){t.d(n,{Z:function(){return M}});var l=t(82242),i=t.n(l),r=t(79800),s=t.n(r),a=t(39647),o=t.n(a),u=t(59301),d=t(30518),c=t(8591),m=t(43418),p=t(78241),h=t(24650),f=t(53326),x=t(81327),v=t(40822),g="form___Ca7CG",j=t(33936),b=t(59517),_=t(84666),C=t(11249),y=t(97810),Z=t(65547),w=t(61186),k=t.n(w),I=t(37712),Y=["handleFinish","form","content","dispatch","user","coreCurriculum","isRequest"],E=["key","name"],F=d.default.RangePicker,M=(0,j.connect)((function(e){return{dispatch:e.dispatch,coreCurriculum:e.coreCurriculum,user:e.user}}))((function(e){var n=e.handleFinish,t=e.form,l=e.content,r=e.dispatch,a=(e.user,e.coreCurriculum),d=e.isRequest,j=o()(e,Y),w=(a.CoreSubjects,(0,u.useState)("")),M=s()(w,2),R=(M[0],M[1]);(0,u.useEffect)((function(){r({type:"coreCurriculum/getCoreSubjects",payload:{page:1,limit:12}})}),[]),(0,u.useEffect)((function(){var e;if(null!==(e=j.visible)&&void 0!==e&&e.id){var n,l,r,s,a,o,u,d,c,m,p=[null!==(n=j.visible)&&void 0!==n&&n.enroll_start_time?k()(null===(l=j.visible)||void 0===l?void 0:l.enroll_start_time,"YYYY-MM-DD HH:mm"):null,null!==(r=j.visible)&&void 0!==r&&r.enroll_end_time?k()(null===(s=j.visible)||void 0===s?void 0:s.enroll_end_time,"YYYY-MM-DD HH:mm"):null],h=[null!==(a=j.visible)&&void 0!==a&&a.meeting_start_time?k()(null===(o=j.visible)||void 0===o?void 0:o.meeting_start_time,"YYYY-MM-DD HH:mm"):null,null!==(u=j.visible)&&void 0!==u&&u.meeting_end_time?k()(null===(d=j.visible)||void 0===d?void 0:d.meeting_end_time,"YYYY-MM-DD HH:mm"):null];t.setFieldValue("enroll_time",p),t.setFieldValue("meeting_time",h),t.setFieldValue("invitation_id",null===(c=[i()({},null===(m=j.visible)||void 0===m?void 0:m.invitation)])||void 0===c?void 0:c.map((function(e){return{uid:e.id,name:e.title,status:"down",response:{id:e.id}}})))}}),[j.visible]);var H={beforeUpload:function(e){var n=e.size/1024/1024;return 0==n?(c.ZP.error("".concat(e.name," 无法上传。").concat(0==n?"文件内容不能为空":"超过图片大小限制(2MB)")),Promise.reject()):Promise.resolve()},action:"".concat(_.Z.API_SERVER,"/api/attachments.json")};return(0,I.jsx)(m.Z,i()(i()({},j),{},{destroyOnClose:!0,centered:!0,width:1200,okText:"确认",afterClose:function(){return R("")},children:(0,I.jsxs)(p.Z,{form:t,size:"large",initialValues:{},layout:"horizontal",labelCol:{span:2},className:g,onValuesChange:function(e){console.log(e)},colon:!1,onFinish:n,children:[(0,I.jsx)(p.Z.Item,{htmlFor:null,name:"name",label:"名称",rules:[{required:!0,message:"请输入名称"}],children:(0,I.jsx)(h.Z,{placeholder:"请输入名称",maxLength:80,showCount:!0})}),(0,I.jsxs)("div",{style:{display:"flex",justifyContent:"space-around",marginLeft:"-9px"},children:[(0,I.jsx)(p.Z.Item,{label:"会议地点",name:"location",labelCol:{span:4},rules:[{required:!0,message:"请输入会议地点"},{whitespace:!0,message:"请输入会议地点"}],children:(0,I.jsx)(h.Z,{maxLength:20,placeholder:"请输入会议地点",style:{width:475},showCount:!0})}),(0,I.jsx)(p.Z.Item,{label:"会议规模",name:"scale",labelCol:{span:4},rules:[{required:!0,message:"请输入会议规模"}],children:(0,I.jsx)(h.Z,{maxLength:20,placeholder:"请输入会议规模",style:{width:475},showCount:!0})})]}),(0,I.jsxs)("div",{style:{display:"flex",justifyContent:"space-around",marginLeft:"-9px"},children:[(0,I.jsx)(p.Z.Item,{label:"报名时间",name:"enroll_time",labelCol:{span:4},rules:[{required:!0,message:"请选择报名时间"}],children:(0,I.jsx)(F,{style:{width:475},format:"YYYY-MM-DD HH:mm",placeholder:["请选择开始时间","请选择结束时间"],showTime:{format:"HH:mm"}})}),(0,I.jsx)(p.Z.Item,{label:"会议时间",name:"meeting_time",labelCol:{span:4},rules:[{required:!0,message:"请选择会议时间"}],children:(0,I.jsx)(F,{style:{width:475},format:"YYYY-MM-DD HH:mm",placeholder:["请选择开始时间","请选择结束时间"],showTime:{format:"HH:mm"}})})]}),(0,I.jsx)(p.Z.Item,{label:"报名链接",name:"enroll_url",rules:[{message:"请输入报名链接"}],children:(0,I.jsx)(h.Z,{maxLength:500,placeholder:"请输入报名链接",showCount:!0})}),(0,I.jsx)("div",{style:{position:"relative"},children:(0,I.jsx)(p.Z.Item,{name:"cover_id",label:"封面图片",rules:[{required:!0,message:"请上传封面图片"}],style:{position:"relative"},children:(0,I.jsx)(v.Z,{ButtonText:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("i",{className:"iconfont icon-shangchuanfujian r5 font14"}),(0,I.jsx)("span",{className:"ml5",children:"上传图片"})]}),showTip:!0})})}),(0,I.jsx)(p.Z.Item,{name:"invitation_id",label:"会议邀请函",valuePropName:"fileList",normalize:function(e){return null!=e&&e.at(-1)?[null==e?void 0:e.at(-1)]:[]},getValueFromEvent:function(e){return Array.isArray(e)?e:null==e?void 0:e.fileList},children:(0,I.jsx)(f.Z,i()(i()({},H),{},{children:(0,I.jsx)(C.op,{style:{borderRadius:"2px"},icon:(0,I.jsx)("i",{className:"iconfont icon-shangchuanfujian"}),children:"上传文件"})}))}),(0,I.jsx)(p.Z.Item,{label:"会议通知",name:"notice",rules:[{required:!0,message:"请输入会议通知"}],labelCol:{span:2},children:(0,I.jsx)(b.Z,{defaultvalue:l,style:{height:"160px"}})}),(0,I.jsx)(p.Z.Item,{label:"会议费用信息",name:"publisher",rules:[{required:!1,message:"请填写会议费用信息"}],children:(0,I.jsx)(p.Z.List,{name:"fee_infos",children:function(e,n){var t=n.add,l=n.remove;return(0,I.jsxs)(I.Fragment,{children:[e.map((function(e){var n=e.key,r=e.name,s=o()(e,E);return(0,I.jsxs)(x.Z,{style:{display:"flex",marginBottom:8,background:"#F6F9F9",borderRadius:"2px",padding:20,paddingBottom:"0px"},align:"baseline",children:[(0,I.jsx)(p.Z.Item,i()(i()({},s),{},{name:[r,"name"],label:"费用名称",rules:[{required:!0,message:"请输入费用名称"}],children:(0,I.jsx)(h.Z,{placeholder:"请输入费用名称",style:{width:520},maxLength:50,showCount:!0})})),(0,I.jsx)(p.Z.Item,i()(i()({},s),{},{name:[r,"fee"],label:"费用",rules:[{required:!0,message:"请输入费用"}],className:"ml40",children:(0,I.jsx)(h.Z,{placeholder:"请输入费用",style:{width:220},maxLength:20,showCount:!0})})),(0,I.jsx)(y.Z,{onClick:function(){return l(r)},style:{color:"#E30000",marginLeft:20}}),(0,I.jsx)(Z.Z,{onClick:function(){return t()},style:{color:"#00B187",marginLeft:20}})]},n)})),(0,I.jsx)(p.Z.Item,{children:(0,I.jsx)(C.op,{style:{borderRadius:"2px",marginLeft:0,marginTop:3},onClick:function(){return t()},children:"添加"})})]})}})}),d&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("div",{style:{border:"1px dashed #D0DEDC",marginBottom:30}}),(0,I.jsxs)("div",{style:{display:"flex",justifyContent:"space-around",marginLeft:"-9px"},children:[(0,I.jsx)(p.Z.Item,{label:"会议联系人",name:"meeting_contact",labelCol:{span:4},rules:[{required:!0,message:"请输入会议联系人"}],children:(0,I.jsx)(h.Z,{placeholder:"请输入会议联系人",maxLength:20,showCount:!0,style:{width:470}})}),(0,I.jsx)(p.Z.Item,{label:"联系方式",name:"meeting_contact_phone",labelCol:{span:4},rules:[{required:!0,message:"请输入联系方式"}],children:(0,I.jsx)(h.Z,{placeholder:"请输入联系方式",style:{width:470}})})]}),(0,I.jsx)(p.Z.Item,{label:"举办单位",name:"meeting_sponsor",rules:[{required:!0,message:"请输入会议举办单位"}],children:(0,I.jsx)(h.Z,{placeholder:"请输入会议举办单位",style:{width:470}})})]})]})}))}))}}]); |