You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__History__index.async.js

1 line
17 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[9768],{3196:function(e,n,t){t.d(n,{Z:function(){return b}});var i=t(7557),s=t.n(i),l=t(41498),a=t.n(l),r=t(82242),o=t.n(r),c=t(79800),u=t.n(c),d=t(39647),m=t.n(d),h=t(59301),p=t(8591),v=t(54580),x=t(95237),f=t(17631),_=t(19248),j=t(46906),y="tip___bHEXo",g=t(37712),Z=["ButtonText","ButtonOptions","uploadProps","showTip","showText","showListening","imgWidth"],b=function(e){var n,t,i,l=e.ButtonText,r=e.ButtonOptions,c=e.uploadProps,d=e.showTip,b=e.showText,S=e.showListening,N=e.imgWidth,w=m()(e,Z),C=(0,h.useState)(null),k=u()(C,2),B=k[0],I=k[1],T=o()(o()({maxCount:1,accept:"image/*",withCredentials:!0,beforeUpload:function(e){if(!("image/jpeg"===e.type||"image/png"===e.type||"image/jpg"===e.type))return p.ZP.error("您上传的不是JPEG/PNG/JPG类型文件"),v.Z.LIST_IGNORE;var n=e.size/1024/1024;return 0==n?(p.ZP.error("".concat(e.name," 图片无法上传。").concat(0==n?"文件内容不能为空":"超过图片大小限制(2MB)")),v.Z.LIST_IGNORE):!(n>2)||(p.ZP.error("".concat(e.name," 图片无法上传。超过图片大小限制(2MB)")),v.Z.LIST_IGNORE)},onChange:function(e){var n;(["uploading","done","removed"].includes(e.file.status)&&I(e.file),"done"==e.file.status)&&(null==w||w.onChange(null===(n=e.file)||void 0===n||null===(n=n.response)||void 0===n?void 0:n.id))},action:"".concat(f.Z.API_SERVER,"/api/attachments.json")},c||{}),{},{onRemove:(t=a()(s()().mark((function e(n){return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:P(),(null==c?void 0:c.onRemove)&&(null==c||c.onRemove(n));case 2:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})}),P=function(){I(null),null==w||w.onChange()};return(0,h.useEffect)((function(){(null==w?void 0:w.value)&&I({response:{id:null==w?void 0:w.value}})}),[null==w?void 0:w.value]),(0,g.jsx)("div",{id:(null==w?void 0:w.scrollId)||"",children:null!=B&&null!==(n=B.response)&&void 0!==n&&n.id?(0,g.jsxs)(x.Z,{align:"middle",justify:"center",style:{position:"relative",width:N||400,backgroundColor:"#f4f3f4"},children:[(0,g.jsx)("img",{src:f.Z.API_SERVER+"/api/attachments/"+(null==B||null===(i=B.response)||void 0===i?void 0:i.id),alt:"avatar",style:{width:"100%",height:N?"177px":"auto"}}),(0,g.jsx)("div",{style:{position:"absolute",right:"-6px",top:"-6px",cursor:"pointer",width:16,height:16,borderRadius:"50%",backgroundColor:"#fff"},children:(0,g.jsx)(_.Z,{onClick:a()(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,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(v.Z,o()(o()({},T),{},{children:(0,g.jsx)(j.op,o()(o()({style:o()({borderRadius:"2px"},null==r?void 0:r.style)},r),{},{children:l}))})),d&&(0,g.jsx)("span",{className:y,children:"建议上传尺寸为472*266的图片"}),b&&(0,g.jsx)("span",{className:y,style:{width:"4rem"},children:"需上传尺寸为200*268的图片大小不超过2MB"}),S&&(0,g.jsx)("span",{className:y,style:{width:"4rem"},children:"限制上传2MB内的图片建议上传尺寸为283*177的图片"})]})})}},64791:function(e,n,t){t.r(n),t.d(n,{default:function(){return I}});var i=t(37205),s=t.n(i),l=t(7557),a=t.n(l),r=t(41498),o=t.n(r),c=t(79800),u=t.n(c),d=t(59301),m=t(13032),h=t(6848),p=t(95237),v=t(43604),x=t(58421),f=t(43418),_=t(8591),j=t(3113),y={BannerStyle:"BannerStyle___XBzmQ",BannerStyleContent:"BannerStyleContent___TO_Pi",Onerow:"Onerow___JrVhJ",coreSty:"coreSty___QzTzE",paramsStyle:"paramsStyle___O9ZTj",type:"type___mSYrp",typeName:"typeName___Q91zp",type_item_active:"type_item_active___mS0M9",type_item:"type_item___SiCVO",itemBox:"itemBox___sqRkb",itemWrap:"itemWrap___nNJMu",itemTop:"itemTop___ACVhe",itemBottom:"itemBottom___SSXgM",title:"title___ZOk9v",subTitle:"subTitle___FqUXF",contWrap:"contWrap___VJHqV",left:"left___ixU3R",right:"right___YnpMt",actionWrap:"actionWrap___muwRR",actionBtn:"actionBtn___K9ZIC",labSty:"labSty___RNlhx",contSty:"contSty___Jn8PK",linkBtn:"linkBtn___nF2XL"},g=t(20731),Z=t(17631),b=t(46906),S=t(58181),N=t(72226),w=t(61186),C=t.n(w),k=t(78660),B=t(37712),I=(0,m.connect)((function(e){var n=e.user,t=e.loading,i=e.globalSetting,s=e.coreCurriculum;return{user:n,loading:t.effects,globalSetting:i,coreCurriculum:s}}))((function(e){e.coreCurriculum,e.dispatch,e.loading,e.user;var n,t,i,l,r=e.globalSetting,c=(0,d.useState)(!0),m=u()(c,2),w=(m[0],m[1]),I=(0,d.useState)(""),T=u()(I,2),P=T[0],Y=T[1],R=(0,d.useState)([]),M=u()(R,2),E=M[0],O=M[1],W=(0,d.useState)("全部"),L=u()(W,2),F=L[0],H=L[1],D=(0,d.useState)([{id:"-1",name:"全部"},{id:"0",name:"未开始"},{id:"1",name:"进行中"},{id:"2",name:"已结束"}]),V=u()(D,2),q=V[0],z=(V[1],(0,d.useState)("-1")),J=u()(z,2),G=J[0],U=J[1],X=(0,d.useState)([]),A=u()(X,2),Q=A[0],K=A[1],$=(0,d.useState)(!1),ee=u()($,2),ne=ee[0],te=ee[1],ie=(0,d.useState)({}),se=u()(ie,2),le=se[0],ae=se[1],re=(0,d.useState)(!1),oe=u()(re,2),ce=oe[0],ue=oe[1],de=(0,d.useState)(1),me=u()(de,2),he=me[0],pe=me[1],ve=(0,d.useState)(0),xe=u()(ve,2),fe=xe[0],_e=xe[1];(0,d.useEffect)((function(){je(),ye("全部","-1",P,he)}),[]);var je=function(){var e=o()(a()().mark((function e(n,t){var i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w(!0),e.next=3,(0,S.ZP)("/api/listening_activities/core_subject_tag.json",{method:"get",params:{message:n,status:t}});case 3:0==(null==(i=e.sent)?void 0:i.status)&&O(null==i?void 0:i.data),w(!1);case 6:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),ye=function(){var e=o()(a()().mark((function e(n,t,i,s){var l,r,o;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return w(!0),e.next=3,(0,S.ZP)("/api/listening_activities.json",{method:"get",params:{keyword:i||P,history:!0,page:"全部"==n?void 0:s||he,core_subject:encodeURIComponent(n),status:"-1"==t?void 0:t}});case 3:0===(l=e.sent).status&&(K(null==l||null===(r=l.data)||void 0===r?void 0:r.list),_e(null==l||null===(o=l.data)||void 0===o?void 0:o.size)),w(!1);case 6:case"end":return e.stop()}}),e)})));return function(n,t,i,s){return e.apply(this,arguments)}}();return(0,B.jsxs)("section",{children:[(0,B.jsx)("div",{className:y.BannerStyle,style:{backgroundImage:"url(".concat(Z.Z.IMG_SERVER,"/").concat(null==r||null===(n=r.setting)||void 0===n?void 0:n.news_banner_url,")")},children:(0,B.jsxs)("div",{className:y.BannerStyleContent,children:[(0,B.jsx)("div",{style:{color:"#fff",fontSize:".34rem",letterSpacing:".05rem",fontWeight:600},children:"历史听课活动"}),(0,B.jsx)("div",{children:(0,B.jsx)(b.t7,{placeholder:"请输入关键字进行搜索",className:y.CustomInputStyle,value:P,onChange:function(e){Y(e),ye(F,G,e)}})})]})}),(0,B.jsxs)("div",{className:y.coreSty,children:[(0,B.jsxs)("div",{className:y.paramsStyle,children:[(0,B.jsxs)("div",{className:y.type,style:{borderBottom:"1px dashed #37AD83"},children:[(0,B.jsx)("div",{className:y.typeName,children:"核心课程"}),(0,B.jsx)("div",{style:{display:"flex",flexWrap:"wrap",flex:1},children:null===(t=["全部"].concat(s()(E)))||void 0===t?void 0:t.map((function(e,n){return(0,B.jsx)("div",{className:F===e?y.type_item_active:y.type_item,onClick:function(){H(e),ye(e,G)},children:e},n)}))})]}),(0,B.jsxs)("div",{className:y.type,children:[(0,B.jsx)("div",{className:y.typeName,children:"状态"}),(0,B.jsx)("div",{style:{display:"flex",flexWrap:"wrap",flex:1},children:null==q?void 0:q.map((function(e,n){return(0,B.jsx)("div",{className:G==(null==e?void 0:e.id)?y.type_item_active:y.type_item,onClick:function(){U(null==e?void 0:e.id),ye(F,null==e?void 0:e.id)},children:null==e?void 0:e.name},n)}))})]})]}),(0,B.jsx)("div",{className:y.itemBox,children:null!=Q&&Q.length?null==Q?void 0:Q.map((function(e,n){var t;return(0,B.jsxs)("div",{className:y.itemWrap,children:[(0,B.jsx)("div",{className:y.itemTop,children:(0,B.jsx)("img",{src:null==e||null===(t=e.cover)||void 0===t?void 0:t.url})}),(0,B.jsxs)("div",{className:y.itemBottom,onClick:function(){ae(e),te(!0)},children:[(0,B.jsx)(h.Z,{title:null==e?void 0:e.name,children:(0,B.jsx)("div",{className:y.title,children:null==e?void 0:e.name})}),(0,B.jsx)(h.Z,{title:null==e?void 0:e.school_name,children:(0,B.jsx)("div",{className:y.subTitle,children:null==e?void 0:e.school_name})})]})]},null==e?void 0:e.id)})):(0,B.jsx)(N.Z,{})}),!!fe&&(0,B.jsxs)(p.Z,{wrap:!1,align:"middle",justify:"space-between",style:{width:"12rem",margin:".2rem auto 0.3rem"},children:[(0,B.jsxs)(v.Z,{children:["共 ",(0,B.jsx)("span",{style:{color:"#165DFF"},children:fe||0})," 条数据"]}),(0,B.jsx)(v.Z,{children:(0,B.jsx)(x.Z,{showSizeChanger:!1,showQuickJumper:!1,current:he,onChange:function(e,n){pe(e)},total:fe||0})})]})]}),(0,B.jsx)(k.Z,{visible:ce,isEdit:!0,item:le,handleCancel:function(){return ue(!1)},onOk:function(){ye(F,G,P,he)}}),(0,B.jsx)(f.Z,{title:"听课活动详情",visible:ne,centered:!0,onCancel:function(){te(!1)},width:1e3,maskClosable:!1,footer:null,children:(0,B.jsxs)("div",{className:y.contWrap,children:[(0,B.jsx)("div",{className:y.left,children:(0,B.jsx)("img",{src:null==le||null===(i=le.cover)||void 0===i?void 0:i.url})}),(0,B.jsxs)("div",{className:y.right,children:[(0,B.jsxs)("div",{className:y.actionWrap,children:[(0,B.jsx)("i",{className:"iconfont icon-bianji-moren current ".concat(y.actionBtn),onClick:function(){ue(!0),te(!1)}}),(0,B.jsx)("i",{className:"iconfont icon-shanchutimu ml20 current ".concat(y.actionBtn),onClick:function(){var e;f.Z.confirm({title:"删除课堂听课",content:"确认要删除课堂听课吗?",okText:"确认",icon:null,centered:!0,cancelText:"取消",onOk:(e=o()(a()().mark((function e(){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)("/api/listening_activities/".concat(null==le?void 0:le.id,".json"),{method:"delete"});case 2:0===e.sent.status&&(_.ZP.success("删除成功!"),te(!1),ye());case 4:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})}})]}),(0,B.jsxs)(p.Z,{className:"mb20",children:[(0,B.jsx)(v.Z,{className:y.labSty,children:"活动名称"}),(0,B.jsx)(v.Z,{className:y.contSty,children:null==le?void 0:le.name})]}),(0,B.jsxs)(p.Z,{className:"mb20",children:[(0,B.jsx)(v.Z,{className:y.labSty,children:"核心课程"}),(0,B.jsx)(v.Z,{className:y.contSty,children:null==le?void 0:le.core_subject})]}),(0,B.jsxs)(p.Z,{className:"mb20",children:[(0,B.jsx)(v.Z,{className:y.labSty,children:"主讲教师"}),(0,B.jsx)(v.Z,{className:y.contSty,children:null==le?void 0:le.teacher_name})]}),(0,B.jsxs)(p.Z,{className:"mb20",children:[(0,B.jsx)(v.Z,{className:y.labSty,children:"所属院校"}),(0,B.jsx)(v.Z,{className:y.contSty,children:null==le?void 0:le.school_name})]}),(0,B.jsxs)(p.Z,{className:"mb20",children:[(0,B.jsx)(v.Z,{className:y.labSty,children:"日期"}),(0,B.jsx)(v.Z,{children:null==le||null===(l=le.times)||void 0===l?void 0:l.map((function(e,n){var t,i;return(0,B.jsxs)(p.Z,{className:y.contSty,children:[null===(t=C()(null==e?void 0:e.start_time))||void 0===t?void 0:t.format("YYYY-MM-DD HH:mm")," ~ ",null===(i=C()(null==e?void 0:e.end_time))||void 0===i?void 0:i.format("YYYY-MM-DD HH:mm")]},n)}))})]}),(0,B.jsxs)(p.Z,{className:"mb20",children:[(0,B.jsx)(v.Z,{className:y.labSty,children:"地点"}),(0,B.jsx)(v.Z,{className:y.contSty,children:null==le?void 0:le.address})]}),(0,B.jsxs)(p.Z,{className:"mb20",children:[(0,B.jsx)(v.Z,{className:y.labSty,children:"链接"}),(0,B.jsx)(v.Z,{className:y.contSty,style:{cursor:"pointer"},children:null==le?void 0:le.link})]}),(0,B.jsx)(j.ZP,{className:y.linkBtn,onClick:function(){(0,g.xg)(null==le?void 0:le.link)},children:"前往链接"})]})]})})]})}))},78660:function(e,n,t){t.d(n,{Z:function(){return M}});var i=t(7557),s=t.n(i),l=t(41498),a=t.n(l),r=t(85573),o=t.n(r),c=t(82242),u=t.n(c),d=t(79800),m=t.n(d),h=t(59301),p=t(78241),v=t(8591),x=t(43418),f=t(10249),_=t(88522),j=t(95237),y=t(43604),g=t(5083),Z=t(6848),b=t(13032),S=t(58181),N="formSty___e1WFc",w="actionWrapper___Cr7h9",C="addIcon___Vdgtz",k="deleteIcon___I7ilg",B=t(3196),I=t(32134),T=t(12893),P=t(61186),Y=t.n(P),R=t(37712),M=(0,b.connect)((function(e){return{dispatch:e.dispatch,coreCurriculum:e.coreCurriculum}}))((function(e){var n=e.visible,t=(e.bookList,e.onOk),i=e.handleCancel,l=e.isEdit,r=void 0!==l&&l,c=e.item,d=void 0===c?{}:c,b=(e.dispatch,p.Z.useForm()),P=m()(b,1)[0],M=(0,h.useState)(!1),E=m()(M,2),O=E[0],W=E[1],L=(0,h.useState)(),F=m()(L,2),H=F[0],D=F[1];(0,h.useEffect)((function(){var e;n&&(V(),r&&P.setFieldsValue(u()(u()({},d),{},{times:null==d||null===(e=d.times)||void 0===e?void 0:e.map((function(e,n){return o()({},n,[Y()(null==e?void 0:e.start_time),Y()(null==e?void 0:e.end_time)])}))})))}),[n,r]);var V=function(){var e=a()(s()().mark((function e(){var n;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,S.ZP)("/api/listening_activities/core_subject_tag.json",{method:"get"});case 2:0===(null==(n=e.sent)?void 0:n.status)&&D(null==n?void 0:n.data);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),q=function(){var e=a()(s()().mark((function e(n){var l,a,o;return s()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(W(!0),a=null==n||null===(l=n.times)||void 0===l?void 0:l.map((function(e,n){var t=m()(e[n],2),i=t[0],s=t[1];return{start_time:Y()(i).format("YYYY-MM-DD HH:mm"),end_time:Y()(s).format("YYYY-MM-DD HH:mm")}})),!r){e.next=8;break}return e.next=5,(0,S.ZP)("/api/listening_activities/".concat(null==d?void 0:d.id,".json"),{method:"put",body:u()(u()({},n),{},{times:a})});case 5:e.t0=e.sent,e.next=11;break;case 8:return e.next=10,(0,S.ZP)("/api/listening_activities.json",{method:"post",body:u()(u()({},n),{},{times:a})});case 10:e.t0=e.sent;case 11:0===(null==(o=e.t0)?void 0:o.status)&&(v.ZP.success("保存成功!"),i(),t()),W(!1);case 14:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();return(0,R.jsx)(x.Z,{title:r?"编辑听课活动":"新建听课活动",visible:n,onOk:function(){P.submit()},centered:!0,onCancel:i,confirmLoading:O,width:690,afterClose:function(){W(!1),P.resetFields()},okText:"确认",cancelText:"取消",maskClosable:!1,children:(0,R.jsxs)(p.Z,{form:P,colon:!1,onFinish:q,className:N,scrollToFirstError:!0,size:"large",initialValues:{times:[{0:""},{1:""}]},children:[(0,R.jsx)(p.Z.Item,{label:"活动名称",name:"name",rules:[{required:!0,message:"请输入名称"}],children:(0,R.jsx)(f.Z,{maxLength:40,showCount:!0,placeholder:"请输入名称"})}),(0,R.jsx)(p.Z.Item,{label:"核心课程",name:"core_subject",rules:[{required:!0,message:"请选择核心课程"}],children:(0,R.jsx)(_.Z,{placeholder:"请选择核心课程",options:null==H?void 0:H.map((function(e){return{value:e,label:e}})),filterOption:function(e,n){var t;return-1!==(null==n||null===(t=n.label)||void 0===t||null===(t=t.toUpperCase())||void 0===t?void 0:t.indexOf(null==e?void 0:e.toUpperCase()))},onSearch:function(e){e.length>40&&P.setFieldValue("core_subject",e.substring(0,40))},onBlur:function(){V()}})}),(0,R.jsx)(p.Z.Item,{label:"主讲教师",name:"teacher_name",rules:[{required:!0,message:"请输入主讲教师名称"}],children:(0,R.jsx)(f.Z,{maxLength:20,showCount:!0,placeholder:"请输入主讲教师名称"})}),(0,R.jsx)(p.Z.Item,{label:"所属院校",name:"school_name",rules:[{required:!0,message:"请输入所属院校名称"}],children:(0,R.jsx)(f.Z,{maxLength:50,showCount:!0,placeholder:"请输入所属院校名称"})}),(0,R.jsx)(p.Z.List,{name:"times",children:function(e,n){var t=n.add,i=n.remove;return(0,R.jsx)(R.Fragment,{children:e.map((function(e,n){return(0,R.jsxs)(j.Z,{wrap:!1,children:[(0,R.jsx)(y.Z,{style:{marginLeft:0==n?"0px":"80px"},children:(0,R.jsx)(p.Z.Item,u()(u()({},e),{},{label:0===n?"日期时间":"",name:[e.name,n],rules:[{required:!0,message:"请选择日期时间"}],children:(0,R.jsx)(g.default.RangePicker,{style:{width:"460px"},placeholder:["请选择开始时间","请选择结束时间"],showTime:{format:"HH:mm"},format:"YYYY-MM-DD HH:mm"})}))}),(0,R.jsxs)(y.Z,{className:w,children:[(0,R.jsx)(Z.Z,{title:"新增日期时间",children:(0,R.jsx)(I.Z,{className:C,onClick:function(){t()},style:{visibility:n<6?"visible":"hidden"}})}),(0,R.jsx)(Z.Z,{title:"删除",children:(0,R.jsx)(T.Z,{className:k,onClick:function(){i(e.name)},style:{visibility:n>=1?"visible":"hidden"}})})]})]})}))})}}),(0,R.jsx)(p.Z.Item,{label:"地点",name:"address",rules:[{required:!0,message:"请输入地点"}],children:(0,R.jsx)(f.Z,{maxLength:50,showCount:!0,placeholder:"请输入地点"})}),(0,R.jsx)(p.Z.Item,{label:"链接",name:"link",rules:[{required:!0,message:"请输入报名链接"}],children:(0,R.jsx)(f.Z,{maxLength:50,showCount:!0,placeholder:"请输入报名链接"})}),(0,R.jsx)(p.Z.Item,{label:"封面图片",name:"cover_id",rules:[{required:!0,message:"请输入报名链接"}],children:(0,R.jsx)(B.Z,{ButtonText:"上传图片"})})]})})}))}}]);