|
|
(self.webpackChunk=self.webpackChunk||[]).push([[6788],{90269:function(e,t,n){"use strict";n.d(t,{z:function(){return Z},Z:function(){return L}});var s=n(7557),o=n.n(s),r=n(41498),a=n.n(r),i=n(82242),l=n.n(i),c=n(37205),u=n.n(c),d=n(79800),m=n.n(d),p=n(59301),h=n(14566),f=n(6767),v=n(62957),x=n(99571),y=n(91689),g=n(59120),_=n(37712),j=" ";function b(e){if(0==e)return"0 Byte";var t=parseInt(""+Math.floor(Math.log(e)/Math.log(1024)),10);return(e/Math.pow(1024,t)).toFixed(1)+" "+["Bytes","KB","MB","GB","TB"][t]}var k=n(61481),w=n(89392);Object.defineProperty,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var C=h.Z.Dragger;function Z(e){var t=[];return e&&e.length>0&&(t=e.map((function(e){return{uid:e.id,id:e.id,name:e.title+j+e.filesize,url:e.url,filesize:e.filesize,status:"done",response:{id:e.id}}}))),t}var L=function(e){var t=e.value,n=e.onChange,s=e.action,r=e.data,i=e.className,c=e.maxSize,d=void 0===c?150:c,Z=e.title,L=void 0===Z?"上传附件":Z,T=e.showRemoveModal,S=void 0!==T&&T,N=e.accept,P=void 0===N?"":N,A=e.additionalText,I=e.isDragger,D=e.number,M=void 0===D?1e3:D,H=e.aloneClear,O=void 0!==H&&H,R=e.realTimeRemove,E=void 0===R||R,G=e.uploadText,B=e.setFileProgress,Y=e.showFileProgress,J=(0,p.useState)(!1),F=m()(J,2),W=F[0],z=F[1],V=(0,p.useState)(t||[]),U=m()(V,2),q=U[0],K=U[1],Q=(0,p.useState)(1),X=m()(Q,2),$=X[0],ee=X[1];(0,p.useEffect)((function(){t&&(1===$&&K(u()(t)),ee(2),M===(null==t?void 0:t.length)&&z(!0))}),[t]);var te=function(){setTimeout((function(){q.pop(),K(u()(q))}),500)};Y&&B(q.some((function(e){return"uploading"===e.status})));var ne,se={multiple:!0,disabled:W,accept:P,withCredentials:!0,fileList:q,beforeUpload:function(e,t){var n=e.size/1024/1024;return q.concat(t).length>M?(q.pop(),K(u()(q)),f.ZP.error("最多只能上传".concat(M,"个文件")),O?Promise.reject():(te(),!1)):n<d||(f.ZP.error("该文件无法上传。超过文件大小限制(".concat(d,"MB).")),O?Promise.reject():(te(),!1))},data:r,action:s||"".concat(y.Z.API_SERVER,"/api/attachments.json"),onChange:function(e){var t,s;(q="removed"===e.file.status?e.fileList:(0,w.uniqBy)([].concat(u()(e.fileList),u()(q)),"uid"),"done"!==e.file.status||-1!==(null===(t=e.file)||void 0===t||null===(t=t.response)||void 0===t?void 0:t.status))?(q.length>=M?z(!0):z(!1),K(u()(q)),q=q.map((function(e){var t,n;null!=e&&null!==(t=e.response)&&void 0!==t&&t.id&&(e.url=null==e||null===(n=e.response)||void 0===n?void 0:n.url);return-1===e.name.indexOf(j)&&(e.name="".concat(e.name).concat(j).concat(b(e.size))),l()({},e)})),console.log("info:",e,q),n(q)):f.ZP.error(null===(s=e.file)||void 0===s||null===(s=s.response)||void 0===s?void 0:s.message)},onRemove:(ne=a()(o()().mark((function e(t){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(E){e.next=2;break}return e.abrupt("return",!0);case 2:if(n=function(){var e=a()(o()().mark((function e(){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.response?t.response.id:t.id)){e.next=8;break}return e.next=4,(0,g.JZ)(t.response?t.response.id:t.uid);case 4:return n=e.sent,e.abrupt("return",Promise.resolve(n));case 8:return e.abrupt("return",!0);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),!S){e.next=7;break}return e.abrupt("return",new Promise((function(e,t){var s;v.Z.confirm({centered:!0,width:530,okText:"确定",cancelText:"取消",title:"提示",content:(0,_.jsx)("div",{className:"tc font16",children:"是否确认删除?"}),onOk:(s=a()(o()().mark((function t(){return o()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n();case 2:t.sent,f.ZP.success("删除成功"),e(!0);case 5:case"end":return t.stop()}}),t)}))),function(){return s.apply(this,arguments)}),onCancel:function(){return e(!1)}})})));case 7:return e.next=9,n();case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e)}))),function(e){return ne.apply(this,arguments)})};return(0,_.jsxs)("div",{className:"multi-upload ".concat(i||""),children:[I&&(0,_.jsxs)(C,l()(l()({},se),{},{children:[(0,_.jsx)("p",{className:"ant-upload-drag-icon",children:(0,_.jsx)(k.Z,{})}),(0,_.jsxs)("p",{className:"ant-upload-text",children:["点击上传图标,选择要上传的文件或将文件拖拽到此",(0,_.jsx)("br",{}),"(单个文件最大限制为",d,"MB)"," "]}),A]})),!I&&(0,_.jsxs)(h.Z,l()(l()({},se),{},{children:[(0,_.jsxs)(x.ZP,{disabled:W,className:"upload_button",children:[(0,_.jsx)("img",{className:"aBtn_img",src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTQiIGhlaWdodD0iMTQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEwLjM1NCAzLjVoLTIuNzd2OC4xNjdINi40MTZWMy41SDMuNjQ2TDcgMGwzLjM1NCAzLjVaTTE0IDdoLTEuMTY3djUuODMzSDEuMTY3VjdIMHY3aDE0VjdaIiBmaWxsPSIjMzA2MUQwIiBmaWxsLXJ1bGU9Im5vbnplcm8iLz48L3N2Zz4="}),L]}),(0,_.jsx)("span",{onClick:function(e){e.preventDefault(),e.stopPropagation()},className:"upload_text",children:G||"(单个文件最大".concat(d,"MB)")})]}))]})}},83574:function(e,t,n){"use strict";var s=n(7557),o=n.n(s),r=n(85573),a=n.n(r),i=n(41498),l=n.n(i),c=n(82242),u=n.n(c),d=n(37205),m=n.n(d),p=n(79800),h=n.n(p),f=n(39647),v=n.n(f),x=n(59301),y=n(28284),g=n(6767),_=n(62957),j=n(77019),b=n(47889),k=n(71051),w=n(5269),C=n(16326),Z=n(62673),L=n(56656),T=n.n(L),S=n(94171),N=n(7338),P=n(83287),A=n(53260),I=n(54724),D=n(44933),M=n(36931),H=n(37712),O=["classroomList","dispatch","courseEndTime","onWindowBack"];t.Z=(0,A.connect)((function(e){return{classroomList:e.classroomList}}))((function(e){var t,n,s,r,i,c,d,p,f,L,R,E=e.classroomList,G=e.dispatch,B=e.courseEndTime,Y=e.onWindowBack,J=v()(e,O),F=(0,A.useParams)(),W=y.Z.useForm(),z=h()(W,1)[0],V=(0,x.useState)(1),U=h()(V,2),q=U[0],K=U[1],Q=(0,x.useState)([]),X=h()(Q,2),$=X[0],ee=X[1],te=(0,x.useState)(0),ne=h()(te,2),se=(ne[0],ne[1]),oe=(0,x.useState)(2e3),re=h()(oe,2),ae=(re[0],re[1],(0,x.useState)(!0)),ie=h()(ae,2),le=(ie[0],ie[1]),ce=(0,x.useState)(!1),ue=h()(ce,2),de=ue[0],me=(ue[1],(0,x.useState)(!1)),pe=h()(me,2),he=pe[0],fe=(pe[1],(0,x.useState)([])),ve=h()(fe,2),xe=ve[0],ye=ve[1],ge=(0,x.useState)(!0),_e=h()(ge,2),je=_e[0],be=_e[1],ke=(0,x.useState)(!(null!==(t=E.actionTabs)&&void 0!==t&&null!==(t=t.selectArrsAll)&&void 0!==t&&null!==(t=t[0])&&void 0!==t&&t.send_type)),we=h()(ke,2),Ce=we[0],Ze=we[1],Le=(0,x.useState)([0,0,0]),Te=h()(Le,2),Se=Te[0],Ne=Te[1];(0,x.useEffect)((function(){if("立即发布"===E.actionTabs.key){var e,t,n,s;if(De(),null!==(e=E.actionTabs)&&void 0!==e&&null!==(e=e.selectArrsAll)&&void 0!==e&&null!==(e=e[0])&&void 0!==e&&e.can_publish)Ne(m()(null===(n=E.actionTabs)||void 0===n||null===(n=n.selectArrsAll)||void 0===n||null===(n=n[0])||void 0===n?void 0:n.difficult_count));else Ne(m()(null===(s=E.actionTabs)||void 0===s||null===(s=s.selectArrsAll)||void 0===s||null===(s=s[0])||void 0===s?void 0:s.difficult_settings));if(Ze(!(null!==(t=E.actionTabs)&&void 0!==t&&null!==(t=t.selectArrsAll)&&void 0!==t&&null!==(t=t[0])&&void 0!==t&&t.send_type)),Pe(),2===E.actionTabs.type){var o,r=null===(o=E.actionTabs.selectArrsAll)||void 0===o?void 0:o[0];be(r.unified_setting)}else be(!1)}}),[E.actionTabs]),(0,x.useEffect)((function(){if(de){if(he)return;G({type:"classroomList/setActionTabs",payload:{}}),(0,N.GJ)()?(G({type:"classroomList/getClassroomTeacherCommonList",payload:u()(u()({},E.actionTabs.params),{},{type:1})}),G({type:"shixunHomeworks/getWorkList",payload:u()({},F)})):G({type:"classroomList/getClassroomCommonList",payload:u()({},E.actionTabs.params)})}}),[de]);var Pe=function(){var e=l()(o()().mark((function e(t){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return le(!0),e.next=3,(0,D.c_)(u()(u()({},F),{},{page:t||q,limit:2e4,homework_id:1===E.actionTabs.type?"":E.actionTabs.selectArrs[0]}));case 3:null==(n=e.sent)||n.course_groups.map((function(e,t){e.key=e.id,e.title=e.name,e.disabled=e.is_published})),n&&(ee(m()(null==n?void 0:n.course_groups)),se(null==n?void 0:n.course_groups_count),le(!1),t||z.setFieldsValue(a()(a()({},"publish_time",T()(T()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),"end_time",T()(T()(new Date).add(7,"days").format("YYYY-MM-DD HH:mm")))));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Ae=function(){(0,N.GJ)()?E.actionTabs.detail?(G({type:"shixunHomeworks/setActionTabs",payload:{}}),G({type:"shixunHomeworks/getWorkList",payload:u()({},F)}),G({type:"shixunHomeworks/getWorkSetting",payload:u()({},F)})):G({type:"classroomList/getClassroomTeacherCommonList",payload:u()(u()({},E.actionTabs.params),{},{type:5,category:E.actionTabs.params.categoryId})}):G({type:"classroomList/getClassroomCommonList",payload:u()({},E.actionTabs.params)})},Ie=function(){var e=l()(o()().mark((function e(){var t,n,s,r;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(0,N.Rm)()||null!==(t=E.AssistantObject.hack)&&void 0!==t&&t.can_publish){e.next=4;break}return g.ZP.warning("您未获取此权限,需向课堂管理员申请权限才能使用此功能"),Re(!1),e.abrupt("return");case 4:if(!((s=u()({},z.getFieldsValue())).end_time<=s.publish_time)){e.next=9;break}return g.ZP.info("截止时间不能大于或等于发布时间"),Re(!1),e.abrupt("return");case 9:if(!((null==xe?void 0:xe.length)<=0&&!je&&$.length>0)){e.next=13;break}return g.ZP.info("发布班级不能为空"),Re(!1),e.abrupt("return");case 13:if(0!==Se.reduce((function(e,t){return e+t}),0)||Ce){e.next=17;break}return g.ZP.info("简单适中困难题数相加不能为0"),Re(!1),e.abrupt("return");case 17:return r={homework_ids:m()(E.actionTabs.selectArrs),group_ids:xe.length>0?xe.map((function(e){return e.id})):null===(n=E.detailCommonHomeworksList)||void 0===n?void 0:n.course_groups,end_time:T()(s.end_time).format("YYYY-MM-DD HH:mm"),publish_time:T()(s.publish_time).format("YYYY-MM-DD HH:mm"),difficult_settings:null==Se?void 0:Se.map((function(e){return e})),send_type:Ce?"0":"1",unified_setting:!xe.length},Re(!0),e.next=21,(0,S.ZP)("/api/courses/".concat(F.coursesId,"/homework_commons/publish_with_homework_list_position.json"),{method:"post",body:u()({},r)});case 21:if(0!==e.sent.status){e.next=35;break}if(Re(!1),(0,P.L9)(["教学课堂","图文作业","立即发布"]),g.ZP.success("发布成功"),G({type:"classroomList/setActionTabs",payload:{key:"清除选择数据"}}),!Y){e.next=30;break}return Y(),e.abrupt("return");case 30:J.onCallback&&J.onCallback(),Ae(),"0"===localStorage.getItem("Noviceguide")||G({type:"shixunHomeworks/setActionTabs",payload:{key:"底部弹窗",type:13,text:(0,H.jsx)("div",{children:"最后,咱们给教学课堂添加一名学生~点击“添加学生”,在弹窗页面中输入并搜索学生姓名,点击“确定”就可以为您的课堂添加第一位学生啦~"})}}),e.next=36;break;case 35:Re(!1);case 36:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),De=function(){K(1),ee([]),ye([])},Me=(0,x.useState)(!1),He=h()(Me,2),Oe=He[0],Re=He[1];return(0,H.jsxs)(_.Z,{width:600,confirmLoading:Oe,centered:!0,title:"发布作业",open:"立即发布"===E.actionTabs.key,okText:"发布作业",cancelText:"暂不发布",onOk:Ie,onCancel:function(){De(),G({type:"classroomList/setActionTabs",payload:{}}),Y?Y():Ae()},children:[(0,H.jsxs)("p",{className:"tc",children:["学生将立即收到作业",(0,H.jsx)("br",{}),'本操作只对"未发布"的作业有效']}),$&&(0,H.jsxs)(y.Z,{form:z,children:[(0,H.jsxs)("div",{style:{paddingLeft:0},children:[2===E.actionTabs.type&&(0,H.jsxs)(j.Z,{style:{marginBottom:"10px"},children:[(0,H.jsx)("span",{className:"mr5",children:"试题发送:"}),(0,H.jsxs)(b.ZP.Group,{value:Ce,disabled:!(null!==(n=E.actionTabs)&&void 0!==n&&null!==(n=n.selectArrsAll)&&void 0!==n&&null!==(n=n[0])&&void 0!==n&&n.can_publish),onChange:function(e){Ze(e.target.value)},children:[(0,H.jsx)(b.ZP,{value:!0,children:"全部固定试题"}),(0,H.jsx)(b.ZP,{className:"ml20",value:!1,children:"随机抽取"})]})]}),!Ce&&(0,H.jsxs)(j.Z,{style:{marginBottom:"10px"},children:[(0,H.jsx)("span",{style:{marginRight:65}}),(0,H.jsxs)("span",{children:["简单题数 ",(0,H.jsx)(k.Z,{value:Se[0],onChange:function(e){Se[0]=e,Ne(m()(Se))},min:0,disabled:!(null!==(s=E.actionTabs)&&void 0!==s&&null!==(s=s.selectArrsAll)&&void 0!==s&&null!==(s=s[0])&&void 0!==s&&s.can_publish),placeholder:"最大".concat(null===(r=E.actionTabs)||void 0===r||null===(r=r.selectArrsAll)||void 0===r||null===(r=r[0])||void 0===r||null===(r=r.difficult_count)||void 0===r?void 0:r[0]),max:null===(i=E.actionTabs)||void 0===i||null===(i=i.selectArrsAll)||void 0===i||null===(i=i[0])||void 0===i||null===(i=i.difficult_count)||void 0===i?void 0:i[0],style:{width:60}})]}),(0,H.jsxs)("span",{style:{margin:"0px 40px"},children:["适中题数 ",(0,H.jsx)(k.Z,{value:Se[1],onChange:function(e){Se[1]=e,Ne(m()(Se))},min:0,disabled:!(null!==(c=E.actionTabs)&&void 0!==c&&null!==(c=c.selectArrsAll)&&void 0!==c&&null!==(c=c[0])&&void 0!==c&&c.can_publish),max:null===(d=E.actionTabs)||void 0===d||null===(d=d.selectArrsAll)||void 0===d||null===(d=d[0])||void 0===d||null===(d=d.difficult_count)||void 0===d?void 0:d[1],placeholder:"最大".concat(null===(p=E.actionTabs)||void 0===p||null===(p=p.selectArrsAll)||void 0===p||null===(p=p[0])||void 0===p||null===(p=p.difficult_count)||void 0===p?void 0:p[1]),style:{width:60}})]}),(0,H.jsxs)("span",{children:["困难题数 ",(0,H.jsx)(k.Z,{value:Se[2],onChange:function(e){Se[2]=e,Ne(m()(Se))},min:0,disabled:!(null!==(f=E.actionTabs)&&void 0!==f&&null!==(f=f.selectArrsAll)&&void 0!==f&&null!==(f=f[0])&&void 0!==f&&f.can_publish),placeholder:"最大".concat(null===(L=E.actionTabs)||void 0===L||null===(L=L.selectArrsAll)||void 0===L||null===(L=L[0])||void 0===L||null===(L=L.difficult_count)||void 0===L?void 0:L[2]),max:null===(R=E.actionTabs)||void 0===R||null===(R=R.selectArrsAll)||void 0===R||null===(R=R[0])||void 0===R||null===(R=R.difficult_count)||void 0===R?void 0:R[2],style:{width:60}})]})]}),(0,H.jsxs)(j.Z,{className:"mt30",align:"middle",children:[(0,H.jsx)(w.Z,{children:(0,H.jsx)(y.Z.Item,{name:"publish_time",label:"发布时间",children:(0,H.jsx)(C.default,{style:{width:170,marginRight:"25px"},disabledDate:function(e){return(0,M.Q8)(e,B)},disabledTime:function(e){return(0,M.d0)(e)},placeholder:"请选择发布时间",showTime:{format:"HH:mm",defaultValue:T()((0,P.U6)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1})})}),(0,H.jsx)(w.Z,{className:"ml20",children:(0,H.jsx)(y.Z.Item,{name:"end_time",label:"截止时间",children:(0,H.jsx)(C.default,{style:{width:170},placeholder:"请选择截止时间",showTime:{format:"HH:mm",defaultValue:T()((0,P.U6)(),"HH:mm")},disabledDate:function(e){return(0,M.Q8)(e,B,z.getFieldValue("publish_time"))},disabledTime:function(e){return(0,M.d0)(e,z.getFieldValue("publish_time"))},format:"YYYY-MM-DD HH:mm",allowClear:!1})})})]}),2===E.actionTabs.type&&(0,H.jsxs)(j.Z,{style:{marginBottom:"10px"},children:[(0,H.jsx)("span",{className:"mr5",children:"发布设置:"}),(0,H.jsxs)(b.ZP.Group,{value:je,onChange:function(e){be(e.target.value),ye([])},children:[(0,H.jsx)(b.ZP,{value:!0,disabled:!E.actionTabs.manage_all_group,children:"统一发布"}),(0,H.jsx)(b.ZP,{className:"ml20",disabled:$.length<=0,value:!1,children:"分班发布"})]})]}),$.length<=0&&2===E.actionTabs.type&&(0,H.jsx)("span",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"},children:'课堂无分班,仅支持选择“统一发布"'})]}),(1===E.actionTabs.type||!je)&&$.length>0&&(0,H.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"10px"},children:[(0,H.jsxs)("span",{style:{flex:1},children:[(0,H.jsx)(Z.Z,{checked:xe.length===$.length,onChange:function(e){xe.length===$.length?ye([]):ye($.filter((function(e){return!e.is_published})))},children:"全选"})," "]}),(0,H.jsx)("span",{style:{width:16}}),(0,H.jsxs)("span",{style:{flex:1},children:["已选择",xe.length||0,"个分班"]})]}),(1===E.actionTabs.type||!je)&&$.length>0&&(0,H.jsx)(I.Z,{data:$,selectedRowKeys:xe,setSelectedRowKeys:ye})]})]})}))},71719:function(e,t,n){"use strict";n.r(t),n.d(t,{CommonHomeworkContext:function(){return ot},default:function(){return rt}});var s=n(7557),o=n.n(s),r=n(41498),a=n.n(r),i=n(82242),l=n.n(i),c=n(79800),u=n.n(c),d=n(59301),m=n(53260),p=n(6767),h=n(13747),f=n(48608),v=n(83287),x=n(7338),y=n(37205),g=n.n(y),_=n(39647),j=n.n(_),b=n(62957),k=n(94171),w=n(16585),C=n(37712),Z=["classroomList","dispatch","match","location","user","onCallback"],L=(0,m.connect)((function(e){return{classroomList:e.classroomList,user:e.user}}))((function(e){var t,n,s=e.classroomList,r=e.dispatch,i=(e.match,e.location,e.user),c=e.onCallback,h=(j()(e,Z),(0,m.useParams)()),f=(0,d.useState)(!1),y=u()(f,2),_=y[0],L=y[1],T=(0,d.useState)(!1),S=u()(T,2),N=S[0],P=S[1],A=(0,d.useRef)(null);(0,d.useEffect)((function(){if("删除"===s.actionTabs.key){if((0,x.j5)())return void P(!0);var e={hasNum:0,noHasNum:0};s.actionTabs.selectArrsAll.map((function(t){var n;t.author_login===(null===(n=i.userInfo)||void 0===n?void 0:n.login)?++e.hasNum:++e.noHasNum})),e.noHasNum>0?b.Z.info({title:"权限提示",className:"custom-modal-divider ",icon:null,content:(0,C.jsxs)("div",{children:["当前选中资源中:",(0,C.jsx)("span",{className:"c-blue",children:e.hasNum}),"个由您本人发布,",(0,C.jsx)("span",{className:"c-red",children:e.noHasNum})," ","个由其他老师发布。",(0,C.jsx)("br",{}),"课堂内只能删除本人发布的资源,请取消选中其他老师发布的资源。"]}),onOk:function(){I()}}):P(!0)}else P(!1)}),[s.actionTabs.key]);var I=function(){r({type:"classroomList/setActionTabs",payload:{}})};return(0,C.jsx)(b.Z,{centered:!0,title:"提示",open:N,okText:"确定",cancelText:"取消",confirmLoading:_,destroyOnClose:!0,onOk:a()(o()().mark((function e(){var t,n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(t=A.current)||void 0===t||!t.onVerify()){e.next=2;break}return e.abrupt("return");case 2:return L(!0),e.next=5,(0,k.ZP)("/api/courses/".concat(h.coursesId,"/homework_commons/multi_destroy.json"),{method:"post",body:{homework_ids:g()(s.actionTabs.selectArrs)}});case 5:n=e.sent,L(!1),0===n.status&&((0,v.L9)(["教学课堂","图文作业","删除"]),p.ZP.success("删除成功"),r({type:"classroomList/setActionTabs",payload:{key:"清除选择数据"}}),c&&c(),(0,x.GJ)()?r({type:"classroomList/getClassroomTeacherCommonList",payload:l()(l()({},s.actionTabs.params),{},{type:5})}):r({type:"classroomList/getClassroomCommonList",payload:l()({},s.actionTabs.params)}),r({type:"classroomList/getClassroomLeftMenus",payload:{id:h.coursesId}}));case 8:case"end":return e.stop()}}),e)}))),onCancel:function(){I()},children:null!=s&&null!==(t=s.actionTabs)&&void 0!==t&&t.status&&["未发布"].includes(null==s||null===(n=s.actionTabs)||void 0===n?void 0:n.status)?(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("p",{children:"提交作品将全部被删除,不可恢复"}),(0,C.jsx)("p",{children:"是否确认删除?"})]}):(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("p",{style:{color:"#DD0000"},children:"删除作业则会清除学生所有的答题数据,且数据不可恢复,如确定删除,请输入下方验证码"}),(0,C.jsx)(w.Z,{ref:function(e){return A.current=e}})]})})})),T=n(83574),S=n(24087),N=(0,m.connect)((function(e){return{classroomList:e.classroomList}}))((function(e){var t=e.classroomList,n=e.dispatch,s=(0,m.useParams)();return(0,C.jsx)(b.Z,{centered:!0,title:"提示",open:"设为公开"===t.actionTabs.key,okText:"确定",cancelText:"取消",onOk:a()(o()().mark((function e(){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,k.ZP)("/api/courses/".concat(s.coursesId,"/homework_commons/set_public.json"),{method:"post",body:{homework_ids:g()(t.actionTabs.selectArrs)}});case 2:0===e.sent.status&&((0,v.L9)(["教学课堂","图文作业","设为公开"]),p.ZP.success("操作成功"),n({type:"classroomList/setActionTabs",payload:{key:"清除选择数据"}}),(0,x.GJ)()?n({type:"classroomList/getClassroomTeacherCommonList",payload:l()(l()({},t.actionTabs.params),{},{type:5})}):n({type:"classroomList/getClassroomCommonList",payload:l()({},t.actionTabs.params)}));case 4:case"end":return e.stop()}}),e)}))),onCancel:function(){n({type:"classroomList/setActionTabs",payload:{}})},children:(0,C.jsxs)("p",{children:["设为公开后,非课堂成员也可以访问查看",(0,C.jsx)("br",{}),"是否确认设为公开?"]})})})),P=["classroomList","dispatch","onCallback"],A=(0,m.connect)((function(e){return{classroomList:e.classroomList}}))((function(e){var t=e.classroomList,n=e.dispatch,s=e.onCallback,r=(j()(e,P),(0,m.useParams)());return r.id=r.coursesId,(0,C.jsx)(b.Z,{centered:!0,title:"提示",open:"收藏"===t.actionTabs.key,okText:"确定",cancelText:"取消",onOk:a()(o()().mark((function e(){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,k.ZP)("/api/courses/".concat(r.id,"/homework_commons/add_to_homework_bank.json"),{method:"post",body:{all_check:0,homework_ids:g()(t.actionTabs.selectArrs)}});case 2:0===e.sent.status&&((0,v.L9)(["教学课堂","图文作业","收藏"]),p.ZP.success("收藏成功,请前往【个人主页/课堂资源】查看"),n({type:"classroomList/setActionTabs",payload:{}}),s&&s(),(0,x.GJ)()?n({type:"classroomList/getClassroomTeacherCommonList",payload:l()(l()({},t.actionTabs.params),{},{type:5})}):n({type:"classroomList/getClassroomCommonList",payload:l()({},t.actionTabs.params)}),n({type:"classroomList/setActionTabs",payload:{}}));case 4:case"end":return e.stop()}}),e)}))),onCancel:function(){n({type:"classroomList/setActionTabs",payload:{}})},children:"确认收藏?"})})),I=n(85573),D=n.n(I),M=n(28284),H=n(77019),O=n(5269),R=n(37568),E=n(56656),G=n.n(E),B=(0,m.connect)((function(e){return{classroomList:e.classroomList,loading:e.loading}}))((function(e){var t,n,s=e.classroomList,r=(e.loading,e.dispatch),i=e.onCallback,c=(0,m.useParams)(),d=(0,m.useLocation)(),h=s.actionTabs,f=M.Z.useForm(),v=u()(f,1)[0];return(0,C.jsxs)(b.Z,{centered:!0,title:"新建目录",open:"新建目录"===s.actionTabs.key,okText:"确定",cancelText:"取消",bodyStyle:{minHeight:200},onOk:a()(o()().mark((function e(){var t,n,a,u,h,f,x,y;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=v.getFieldValue(),n="/api/course_modules/".concat(s.detailCommonHomeworksList.main_category_id,"/add_second_category.json"),e.next=4,(0,k.ZP)(n,{method:"post",body:l()({},t)});case 4:0===(a=e.sent).status&&(p.ZP.success("添加成功"),i&&i(),r({type:"classroomList/setActionTabs",payload:{}}),r({type:"classroomList/getClassroomLeftMenus",payload:{id:c.coursesId}}),h=s.actionTabs.selectArrs.type,f=(null==a?void 0:a.category_id)||0,(x=null===(u=d.pathname)||void 0===u?void 0:u.split("/"))[4]=f,x[3]=h||x[3],y=null==x?void 0:x.join("/"),m.history.push(y));case 6:case"end":return e.stop()}}),e)}))),onCancel:function(){r({type:"classroomList/setActionTabs",payload:{}})},children:[(0,C.jsx)("p",{className:"tc",children:(0,C.jsx)("br",{})}),s.courseGroups.course_groups&&(0,C.jsx)(M.Z,{form:v,initialValues:D()({},"name",""),children:(0,C.jsx)(M.Z.Item,{name:"name",children:(0,C.jsxs)(H.Z,{className:"mt30",children:[(0,C.jsx)(O.Z,{children:"目录名称:"}),(0,C.jsx)(O.Z,{flex:"1",children:(0,C.jsx)(R.Z,{defaultValue:(null===(t=h.selectArrs)||void 0===t?void 0:t.category_name)||(null===(n=h.selectArrs)||void 0===n?void 0:n.name)})})]})})})]})})),Y=n(20554),J=n(99571),F=n(62673),W=n(26724),z=n.n(W),V=n(530),U=n(37285),q=n(77736),K=n(36133),Q={shixunItemWrapper:"shixunItemWrapper___ClCET",checkboxWrapper:"checkboxWrapper___bZ8gF",contentWrapper:"contentWrapper____pt8D",title:"title___tfmFW",desc:"desc___NDuDd",info:"info___mahF7"},X=V.Z.Paragraph,$=function(e,t){var n=e.createShixunParams,s=(0,d.useState)("0"),r=u()(s,2),i=r[0],c=r[1],m=(0,d.useState)("hot"),p=u()(m,2),h=p[0],f=p[1],v=(0,d.useState)([]),x=u()(v,2),y=x[0],g=x[1],_=(0,d.useRef)({page:1,order:"hot",keyword:"",shixun_type:"jupyter",diff:"0",limit:10}),j=function(){var e=a()(o()().mark((function e(t,n){var s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,K.he)(t);case 2:if((s=e.sent).status){e.next=8;break}if(0!==s.shixuns.length||!n){e.next=7;break}return N(!1),e.abrupt("return");case 7:g(s.shixuns);case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();(0,d.useImperativeHandle)(t,(function(){return{search:function(e){return j(l()(l()({},_.current),{},{keyword:e}))},changeKeyWord:function(e){return _.current.keyword=e}}})),(0,d.useEffect)((function(){j(_.current)}),[]);var b=(0,d.useState)([]),k=u()(b,2),w=k[0],Z=k[1],L=(0,d.useState)(!0),T=u()(L,2),S=T[0],N=T[1];return(0,C.jsxs)("div",{style:{marginTop:20,maxHeight:200,overflowY:"auto",overflowX:"hidden"},children:[(0,C.jsxs)(H.Z,{justify:"space-between",style:{marginBottom:8},children:[(0,C.jsx)(O.Z,{children:[{name:"全部",id:"0"},{name:"初级",id:"1"},{name:"中级",id:"2"},{name:"中高级",id:"3"},{name:"高级",id:"4"}].map((function(e,t){return(0,C.jsx)(J.ZP,{type:i===e.id?"primary":"default",onClick:function(){c(e.id),_.current.diff=e.id,j(_.current)},children:e.name},t)}))}),(0,C.jsx)(O.Z,{children:[{name:"最热",id:"hot"},{name:"最新",id:"new"}].map((function(e,t){return(0,C.jsx)(J.ZP,{className:"mr20",type:h===e.id?"primary":"default",onClick:function(){f(e.id),_.current.order=e.id,j(_.current)},children:e.name},t)}))})]}),(0,C.jsx)(z(),{initialLoad:!1,pageStart:1,threshold:700,loadMore:function(e){j(l()(l()({},_.current),{},{page:e}),!0)},hasMore:S,useWindow:!1,children:(0,C.jsx)(F.Z.Group,{onChange:function(e){Z(e),n.current.shixun_ids=e},value:w,children:y.map((function(e){var t=e||{},n=t.name,s=t.id,o=t.description,r=t.challenge_names,a=t.author_name,i=t.author_school_name,l=t.level,c=t.total_stu_num;return(0,C.jsxs)("div",{className:Q.shixunItemWrapper,children:[(0,C.jsxs)(H.Z,{align:"middle",className:Q.checkboxWrapper,gutter:14,children:[(0,C.jsx)(F.Z,{value:s}),(0,C.jsx)("div",{className:Q.title,children:n})]}),(0,C.jsxs)("div",{className:Q.contentWrapper,children:[(0,C.jsx)(X,{ellipsis:{rows:2},className:Q.desc,style:{color:"#8e8888"},children:o}),(0,C.jsx)(H.Z,{children:r.map((function(e,t){return(0,C.jsxs)("span",{className:Q.mission,children:["第",t+1,"关",e]},t)}))}),(0,C.jsx)(U.Z,{dashed:!0,style:{margin:"8px 0"}}),(0,C.jsx)(H.Z,{className:Q.info,children:(0,C.jsxs)(q.Z,{children:[(0,C.jsx)("span",{children:a}),(0,C.jsx)("span",{children:"|"}),(0,C.jsx)("span",{children:i}),(0,C.jsx)("span",{children:"|"}),(0,C.jsxs)("span",{children:["难度系数 ",l]}),(0,C.jsx)("span",{children:"|"}),(0,C.jsxs)("span",{children:["学习人数 ",c]})]})})]})]},s)}))})})]})},ee=(0,d.forwardRef)($),te={flex_box_center:"flex_box_center___Cx3ju",flex_space_between:"flex_space_between___rc8Mm",flex_box_vertical_center:"flex_box_vertical_center___6BCc9",flex_box_center_end:"flex_box_center_end___sN3Ig",flex_box_column:"flex_box_column___wjzgd",line1:"line1___cHCBY",form:"form___IMCYE"},ne=n(13767),se=n(44933),oe=(Y.Z.TabPane,(0,m.connect)((function(e){return{shixunHomeworks:e.shixunHomeworks,loading:e.loading}}))((function(e){var t,n=e.shixunHomeworks,s=(e.loading,e.dispatch),r=e.refreshList,i=(0,m.useParams)(),c=((0,m.useLocation)(),M.Z.useForm()),p=u()(c,1)[0],h=(n.brankList,(0,d.useState)(!1)),f=u()(h,2),y=(f[0],f[1]),_=(0,d.useState)(!0),j=u()(_,2),k=j[0],w=j[1],Z=(0,d.useState)(!1),L=u()(Z,2),T=L[0],S=L[1],N=(0,d.useState)("myself"),P=u()(N,2),A=P[0],I=P[1],E=(0,d.useState)([]),G=u()(E,2),B=G[0],Y=G[1],W=(0,d.useState)(),V=u()(W,2),U=V[0],q=V[1],K=(0,d.useState)({page:0,limit:20,object_type:"normal",search:"",filter:"myself"}),Q=u()(K,2),X=Q[0];Q[1];(0,d.useEffect)((function(){"题库选用"===n.actionTabs.key&&oe()}),[n.actionTabs.key]);var $=[],oe=function(){var e=a()(o()().mark((function e(){var t,n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!k){e.next=11;break}return y(!1),++X.page,e.next=5,s({type:"shixunHomeworks/getBrankList",payload:l()({},X)});case 5:n=e.sent,B=g()(B.concat(n.object_list)),q(n.is_teacher),(null===(t=n.object_list)||void 0===t?void 0:t.length)<X.limit?w(!1):w(!0),Y(g()(B)),""==n.object_list&&1===X.page&&y(!0);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),re=(0,d.useRef)({identifier:i.coursesId,shixun_ids:[],type:"normal",coursesId:i.coursesId}),ae=function(){var e=a()(o()().mark((function e(t){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return S(!0),e.next=3,(0,se.aQ)(t);case 3:n=e.sent,S(!1),n.status||(r(),s({type:"shixunHomeworks/setActionTabs",payload:{}}));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ie=(0,d.useRef)();return(0,C.jsxs)(b.Z,{centered:!0,title:"选用课堂资源",destroyOnClose:!0,open:"题库选用"===n.actionTabs.key,okText:"确定",cancelText:"取消",width:800,bodyStyle:{minHeight:200},okButtonProps:{loading:T},onOk:a()(o()().mark((function e(){var t,r,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("jupyter"!==A){e.next=3;break}return ae(re.current),e.abrupt("return");case 3:return S(!0),t=p.getFieldValue(),e.next=7,s({type:"shixunHomeworks/saveBanks",payload:{course_id:i.coursesId,object_type:"normal",category:i.categoryId,bank_id:t.group_ids}});case 7:0===(null==(r=e.sent)?void 0:r.status)&&((0,v.L9)(["教学课堂","图文作业","选用课堂资源"]),s({type:"classroomList/getClassroomLeftMenus",payload:{id:i.coursesId}}),s({type:"shixunHomeworks/setActionTabs",payload:{}}),s({type:"classroomList/setActionTabs",payload:{key:"立即发布",selectArrs:r.object_ids,params:null===(a=n.actionTabs)||void 0===a?void 0:a.params}})),S(!1);case 10:case"end":return e.stop()}}),e)}))),onCancel:function(){s({type:"shixunHomeworks/setActionTabs",payload:{}})},children:[(0,C.jsxs)(H.Z,{children:[(0,C.jsx)(O.Z,{span:12,children:[{name:"我的资源",id:"myself"},{name:"公共资源",id:"public"},{name:"jupyter实训",id:"jupyter"}].map((function(e,t){return(0,C.jsx)(J.ZP,{shape:"round",type:A===e.id?"primary":"default",className:"mr10",onClick:function(){var t=a()(o()().mark((function t(n){return o()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("jupyter"!==e.id){t.next=3;break}return I(e.id),t.abrupt("return");case 3:B=[],k=!0,X.page=0,X.search="",X.filter=e.id,oe(),I(e.id);case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),children:e.name},t)}))}),(0,C.jsx)(O.Z,{span:12,className:"tr",children:(0,C.jsx)(R.Z.Search,{placeholder:"输入标题、适用课程进行搜索",onChange:function(e){var t;"jupyter"===A&&(null===(t=ie.current)||void 0===t||t.changeKeyWord(e.target.value))},onSearch:function(e){var t;"jupyter"!==A?(k=!0,X.search=e,X.page=0,B=[],oe()):null===(t=ie.current)||void 0===t||t.search(e)},style:{width:260}})})]}),"myself"===A&&(0,C.jsxs)("p",{className:"tc mt10",children:["选用对象:你在课堂图文作业列表中已",(0,C.jsx)("span",{className:"c-orange",children:"收藏"}),"的图文作业"]}),"public"===A&&(0,C.jsx)("p",{className:"tc mt10",children:"选用对象:题库中已设置成公共属性的所有图文作业"}),"jupyter"===A?(0,C.jsx)(ee,{createShixunParams:re,ref:ie}):(0,C.jsxs)("div",{style:{background:"#F4FAFF",maxHeight:200,overflow:"auto",padding:"20px 10px"},children:[!U&&"public"===A&&(0,C.jsxs)("div",{style:{display:"flex",flexDirection:"column",paddingTop:"30px",alignItems:"center",justifyContent:"center"},children:[(0,C.jsx)("span",{children:"通过职业认证的教师才能访问公共课程资源库"}),(0,C.jsx)("p",{style:{cursor:"pointer",background:"#ff6800",height:"30px",textAlign:"center",marginTop:"5px",padding:"5px 0px",color:"#fff",width:"80px"},onClick:function(){window.open("/account/certification")},children:"立即认证"})]}),(0,C.jsx)(z(),{initialLoad:!1,pageStart:0,threshold:700,loadMore:function(){w(!1),oe()},hasMore:k,useWindow:!1,children:(0,C.jsxs)(M.Z,{form:p,initialValues:D()({},"group_ids",$),className:te.form,onChange:function(e){var t=p.getFieldValue();$=t},children:[""==B&&(0,C.jsx)(ne.Z,{styles:{margin:"10px auto"}}),(0,C.jsx)(M.Z.Item,{name:"group_ids",children:(0,C.jsx)(F.Z.Group,{style:{width:"100%"},className:"font14",children:null===(t=B)||void 0===t?void 0:t.map((function(e,t){return(0,C.jsxs)(H.Z,{children:[(0,C.jsx)(O.Z,{flex:"2",children:(0,C.jsx)(F.Z,{onChange:function(e){},value:String(e.id),defaultChecked:!0,children:(0,C.jsx)("span",{className:["c-black",te.line1].join(" "),children:e.name})},t)}),(0,C.jsx)(O.Z,{flex:"1",className:"c-black",children:(0,C.jsx)("span",{className:te.line1,children:null==e?void 0:e.course_list_name})}),(0,C.jsx)(O.Z,{flex:"50px",className:"c-black",children:"public"===A&&(0,x.Ny)()||"myself"===A?(0,C.jsx)("span",{className:"c-blue current",onClick:function(){window.open("/users/innov/topics/".concat(e.id,"/personal/normal/edit"))},children:"编辑"}):null==e?void 0:e.username})]},t)}))})})]})})]})]})}))),re=n(76794),ae=n(90269),ie=(0,m.connect)((function(e){return{classroomList:e.classroomList,loading:e.loading}}))((function(e){var t=e.classroomList,n=(e.loading,e.dispatch),s=((0,m.useParams)(),M.Z.useForm()),r=u()(s,1)[0];return(0,C.jsx)(b.Z,{centered:!0,title:"补交附件",open:"补交附件"===t.actionTabs.key,bodyStyle:{minHeight:200},onOk:a()(o()().mark((function e(){var s,a,i;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.validateFields();case 2:return a=l()({},r.getFieldValue()),i=t.actionTabs.selectArrs,a.attachment_ids=null===(s=a.attachment_ids)||void 0===s?void 0:s.map((function(e){return e.response.id})),e.next=7,(0,re.mz)(l()(l()({},a),{},{homeworkId:i.work_id}));case 7:0===e.sent.status&&(r.resetFields(),n({type:"classroomList/setActionTabs",payload:{}}));case 9:case"end":return e.stop()}}),e)}))),onCancel:function(){r.resetFields(),n({type:"classroomList/setActionTabs",payload:{}})},children:(0,C.jsxs)(M.Z,{form:r,initialValues:{},children:[(0,C.jsx)(M.Z.Item,{name:"attachment_ids",rules:[{required:!0,message:"请上传附件"}],children:(0,C.jsx)(ae.Z,{})}),(0,C.jsx)(M.Z.Item,{name:"description",children:(0,C.jsx)(R.Z.TextArea,{placeholder:"请在此输入补交附件的原因,最大限制100个字符",rows:7})})]})})})),le=n(93041),ce=n(75727),ue=n(25399),de="tabMenuContainer___Sxna3",me="control___ka76r",pe="iconH___GpOCh",he="selectBtn___KJw1e",fe="selectBtn1___kta6F",ve=function(e){var t,n,s,o=e.isLoading,r=e.addText,a=e.tabDataSource,i=e.isAdmin,l=e.dispatch,c=e.type,u=e.TooltipTitle,d=e.categoryId,h=e.dropdownMenu,f=e.classroomList,y=e.isShowRightControl,g=e.defaultSelectedKeys,_=e.user,j=e.onTabMenuClick,b=e.onTooltipTitleClick,k=e.onDropdownMenuClick,w=(0,m.useParams)();return(0,C.jsx)("div",{className:de,children:(0,C.jsxs)(H.Z,{children:[(0,C.jsx)(O.Z,{flex:"1",children:(0,C.jsx)(le.Z,{mode:"horizontal",selectedKeys:g,children:a.map((function(e){return(0,C.jsxs)(le.Z.Item,{onClick:function(){return o?{}:j(e)},children:[(0,C.jsx)("span",{className:"c-grey-666 ".concat(i?"mr20":""),children:e.name}),void 0!==e.total&&(0,C.jsx)("span",{className:"c-grey-999",children:e.total||0})]},e.id)}))})}),(0,C.jsxs)(O.Z,{className:"gutter-row",style:{display:"flex",alignItems:"center",color:"#0152d9",paddingBottom:3},children:[i&&(0,C.jsx)(ce.Z,{className:"mr10",placement:"bottom",arrow:!0,dropdownRender:function(){return(0,C.jsxs)(le.Z,{children:[(0,C.jsx)(le.Z.Item,{onClick:function(){var e;(0,v.Ye)(l)||(!(0,x.Rm)()||null!==(e=f.AssistantObject.hack)&&void 0!==e&&e.can_download?l({type:"classroomList/setActionTabs",payload:{key:"导出成绩",type:c,exportType:"hack",category_id:w.categoryId}}):p.ZP.warning("您未获取此权限,需向课堂管理员申请权限才能使用此功能"))},children:"学生成绩"},1),(0,C.jsx)(le.Z.Item,{onClick:function(){var e;(0,v.Ye)(l)||(!(0,x.Rm)()||null!==(e=f.AssistantObject.hack)&&void 0!==e&&e.can_download?m.history.push("/classrooms/".concat(null==w?void 0:w.coursesId,"/exportlist/hack_work_list")):p.ZP.warning("您未获取此权限,需向课堂管理员申请权限才能使用此功能"))},children:"历史导出"},3)]})},children:(0,C.jsx)("span",{style:{color:"#666666",cursor:"pointer"},children:(0,C.jsx)("i",{className:"iconfont icon-xiazai6"})})}),(0,C.jsxs)("span",{style:{marginLeft:8,cursor:"pointer"},onClick:function(){m.history.push("/classrooms/".concat(w.coursesId,"/program_homework/ranking"))},children:[(0,C.jsx)(ue.Z,{title:"排行榜",children:(0,C.jsx)("i",{className:"iconfont icon-paihang mr5",style:{color:"#666666"}})})," "]}),i&&y&&(0,C.jsxs)("div",{className:me,children:[(0,C.jsx)("div",{className:"c-blue font16 current",style:{marginLeft:20,marginRight:20},onClick:b,children:(0,C.jsx)(ue.Z,{title:u,children:(0,C.jsx)("span",{className:"".concat(pe,d?" iconfont icon-zhongmingmingmulu":" iconfont icon-xinjianmulu1")})})}),(0,C.jsx)(ce.Z,{disabled:2===(null==_||null===(t=_.userInfo)||void 0===t?void 0:t.user_status),className:"ml10",dropdownRender:function(){return(0,C.jsx)(le.Z,{onClick:function(e){var t=e.key;return k(t)},children:h.map((function(e){return(0,C.jsx)(le.Z.Item,{children:e.name},e.id)}))})},children:(0,C.jsxs)("span",{onClick:function(){},className:2===(null==_||null===(n=_.userInfo)||void 0===n?void 0:n.user_status)?fe:he,children:[(0,C.jsx)("span",{children:(0,C.jsx)("i",{className:"iconfont icon-tianjiadaohang"})}),(0,C.jsx)(ue.Z,{title:2===(null==_||null===(s=_.userInfo)||void 0===s?void 0:s.user_status)&&"教学课堂试用期已结束,平台已暂停提供编程作业创建功能",children:(0,C.jsx)("span",{children:r||"新建作业"})})]})})]})]})]})})},xe="searchSortControllerContainer___tQmMS",ye="btn___ECfiD",ge="btnSort___Y5Oja",_e="tips___fhrLg",je=function(e){var t=e.isAdmin,n=(e.dataSource,e.batchStatus,e.SortMenuName),s=e.setSortMenuName,o=e.onSearch,r=e.onSort,a=(e.onBatch,t?[{name:"默认排序",type:"position",direction:"desc"},{name:"创建时间升序",type:"created_at",direction:"asc"},{name:"创建时间降序",type:"created_at",direction:"desc"},{name:"更新时间升序",type:"updated_at",direction:"asc"},{name:"更新时间降序",type:"updated_at",direction:"desc"},{name:"作业名称升序",type:"name_pinyin",direction:"asc"},{name:"作业名称降序",type:"name_pinyin",direction:"desc"}]:[{name:"默认排序",type:"position",direction:"desc"},{name:"按发布时间升序",type:"created_at",direction:"asc"},{name:"按发布时间降序",type:"created_at",direction:"desc"},{name:"按截止时间升序",type:"updated_at",direction:"asc"},{name:"按截止时间降序",type:"updated_at",direction:"desc"},{name:"作业名称升序",type:"name_pinyin",direction:"asc"},{name:"作业名称降序",type:"name_pinyin",direction:"desc"}]),i="默认排序"===n;return(0,C.jsxs)("div",{className:xe,children:[(0,C.jsx)("div",{children:(0,C.jsx)(ce.Z,{dropdownRender:function(){return(0,C.jsx)(le.Z,{selectedKeys:[n],children:a.map((function(e){return(0,C.jsx)(le.Z.Item,{onClick:function(){return s((t=e).name),void r(t);var t},children:e.name},e.name)}))})},children:(0,C.jsx)("div",{children:(0,C.jsxs)("span",{className:"".concat(ye," ").concat(i?ge:""),children:[(0,C.jsx)("i",{className:"iconfont icon-paixu font14 mr5"}),n]})})})}),i&&(0,C.jsx)(ue.Z,{title:"优先按照调整排序结果展示,未设置排序时,按照创建时间降序排列",children:(0,C.jsx)("span",{className:_e,children:(0,C.jsx)("i",{className:"iconfont icon-a-wenhaobeifen2"})})}),(0,C.jsx)(R.Z.Search,{allowClear:!0,placeholder:"请输入名称进行搜索",onSearch:o,style:{width:220,marginLeft:"auto"}})]})},be="bottomControlContainer___kLlgA",ke="moveCategory___lgwfd",we=n(84105),Ce=function(e){var t,n=e.buttonDataSource,s=e.onClick,r=(0,d.useContext)(ot),i=r.allSelect,l=r.setAllSelect,c=r.setSelectArrs,m=r.dataSource,h=r.selectArrs,f=r.useBatchStatus,v=r.dispatch,y=r.params,_=r.getData,j=r.detailLeftMenus,b=r.main_category_id,w=r.setSelectArrsAll,Z=(0,d.useState)(!1),L=u()(Z,2),T=(L[0],L[1]),S=(0,d.useState)(""),N=u()(S,2),P=N[0],A=N[1];j.course_modules&&(t=j.course_modules.filter((function(e){return"program_homework"===e.type}))[0]);var I=(0,C.jsx)("div",{className:ke,onMouseLeave:function(e){return T(!1)},children:(0,C.jsxs)(le.Z,{onClick:function(){var e=a()(o()().mark((function e(t){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.item,n=t.key,t.keyPath,t.domEvent,""!=h){e.next=4;break}return p.ZP.error("请选择你要操作的任务"),e.abrupt("return",null);case 4:return e.next=6,(0,k.ZP)("/api/courses/".concat(y.id,"/homework_commons/move_to_category.json"),{method:"post",body:{homework_ids:h,new_category_id:n}});case 6:0===e.sent.status&&(p.ZP.success("操作成功"),f(!1),_(),v({type:"classroomList/getClassroomLeftMenus",payload:{id:y.coursesId}}));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),style:{maxHeight:300,width:240,overflow:"auto"},children:[(0,C.jsx)("li",{className:"ant-menu-item multi-llipsis1e ant-menu-item-only-child",children:(0,C.jsx)(R.Z,{onChange:function(e){A(e.target.value)}})}),t&&t.second_category.filter((function(e){return"未分配目录"!==e.category_name})).map((function(e,t){var n;if(!(""!==P&&e.category_name.indexOf(P)<0))return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(le.Z.Item,{className:"multi-llipsis1e",children:e.category_name},e.category_id),null==e||null===(n=e.third_category)||void 0===n?void 0:n.map((function(e){return(0,C.jsx)(le.Z.Item,{style:{marginLeft:20},className:"multi-llipsis1e",children:e.category_name},e.category_id)}))]})})),(0,C.jsx)("li",{className:"ant-menu-item multi-llipsis1e ant-menu-item-only-child",onClick:function(e){e.preventDefault(),v({type:"classroomList/setActionTabs",payload:{key:"添加目录",params:y,selectArrs:{category_id:b,type:"program_homework"}}})},children:"新建子目录..."})]})});return(0,C.jsx)("div",{className:be,children:(0,C.jsxs)(H.Z,{wrap:!1,align:"middle",justify:"space-between",style:{height:"100%"},children:[(0,C.jsx)(O.Z,{flex:1,children:(0,C.jsxs)(H.Z,{wrap:!1,align:"middle",gutter:8,children:[(0,C.jsx)(O.Z,{children:(0,C.jsxs)(F.Z,{checked:i,onChange:function(e){l(e.target.checked),c(e.target.checked?m.map((function(e){return e.homework_id})):[]),e.target.checked?w(g()(m)):w([])},children:["全选本页(",h.length,")"]})}),(0,x.GJ)()&&(0,C.jsx)(O.Z,{children:(0,C.jsx)(ce.Z,{placement:"top",menu:{items:n,onClick:function(e){var t=e.key;s({key:t})}},children:(0,C.jsx)(J.ZP,{type:"primary",icon:(0,C.jsx)("i",{className:"iconfont icon-piliangcaozuo3"}),children:"批量操作"})})}),(0,C.jsx)(O.Z,{children:(0,C.jsx)(J.ZP,{type:"primary",onClick:function(){var e={courseId:y.id,container_type:"program_homework"};y.categoryId&&(e.category_id=y.categoryId),v({type:"classroomList/getAllTaskList",payload:e}),v({type:"classroomList/setActionTabs",payload:{key:"调整排序"}})},icon:(0,C.jsx)("i",{className:"iconfont icon-tiaozhengpaixu2"}),children:"调整排序"})}),(0,x.GJ)()&&(0,C.jsx)(O.Z,{children:(0,C.jsx)(ce.Z,{placement:"topLeft",dropdownRender:function(){return I},getPopupContainer:function(e){return e.parentNode},children:(0,C.jsxs)(J.ZP,{type:"primary",icon:(0,C.jsx)("i",{className:"iconfont icon-yidongmulu"}),children:["移动到目录 ",(0,C.jsx)(we.Z,{})]})})})]})}),(0,C.jsx)(O.Z,{children:(0,C.jsx)(J.ZP,{type:"primary",ghost:!0,onClick:function(){c([]),f(!1)},children:"取消操作"})})]})})},Ze=n(54172),Le={listContainer:"listContainer___vU05G",info:"info___fXyuU",title:"title___fItHS",left:"left___MFkuv",right:"right___JT8Xj",flexBox:"flexBox___n8e_m",detail:"detail___HXdq0",iconV:"iconV___CwPu5",shixunTag:"shixunTag___oYTPp"},Te=n(51101),Se=n(67554),Ne=function(e){var t,n,s,r,i,c,h,f,y,_,j,w,Z,L,T=e.dataSource,S=e.params,N=e.classroomList,P=e.manageAllGroup,A=e.user,I=e.getData,D=(0,d.useContext)(ot),M=(D.batchStatus,D.selectArrs),H=D.setSelectArrs,O=D.selectArrsAll,E=D.setSelectArrsAll,G=D.dispatch,B=(0,m.useParams)(),Y=(0,d.useState)(!1),J=u()(Y,2),W=J[0],z=J[1],V=(0,d.useRef)(),U=(0,d.useState)([]),q=u()(U,2),K=q[0],Q=q[1];B=l()(l()(l()({},S),B),{},{category:null===(t=B)||void 0===t?void 0:t.categoryId}),(0,d.useEffect)((function(){Q([]),z(!1)}),[]);var X=[{title:"班级",dataIndex:"course_group_name",key:"course_group_name"},{title:"状态",dataIndex:"status",key:"status",width:80,filters:[{text:"未开始",value:"未开始"},{text:"提交中",value:"提交中"},{text:"补交中",value:"补交中"},{text:"已截止",value:"已截止"},{text:"未发布",value:"未发布"}],onFilter:function(e,t){return 0===t.status.indexOf(e)}},{title:"提交情况",dataIndex:"statistics",key:"statistics",width:80,render:function(e){var t,n;return"--"===e?e:(0,C.jsxs)("span",{children:[(0,C.jsx)("span",{children:null==e||null===(t=e.split("/"))||void 0===t?void 0:t[0]})," / ",(0,C.jsx)("span",{children:null==e||null===(n=e.split("/"))||void 0===n?void 0:n[1]})]})}},{title:"发布时间",dataIndex:"publish_time",key:"publish_time",sorter:!0,showSorterTooltip:!1,sortOrder:"publish_time"===B.sort_by?"desc"===B.sort_direction?"descend":"ascend":null},{title:"截止时间",dataIndex:"end_time",key:"end_time",sorter:!0,showSorterTooltip:!1,sortOrder:"end_time"===B.sort_by?"desc"===B.sort_direction?"descend":"ascend":null},{title:"补交时间",dataIndex:"late_time",key:"late_time",sorter:!0,showSorterTooltip:!1,sortOrder:"late_time"===B.sort_by?"desc"===B.sort_direction?"descend":"ascend":null},{title:"分班老师",dataIndex:"teachers",key:"teachers",width:150,ellipsis:{showTitle:!1},render:function(e){return"--"!==e&&e?(0,C.jsx)("span",{title:e,children:e}):"--"}}];function $(){return ee.apply(this,arguments)}function ee(){return(ee=a()(o()().mark((function e(){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,k.ZP)("/api/homework_commons/".concat(T.homework_id,"/group_settings_statistics.json"),{method:"get",params:l()({},B)});case 2:t=e.sent,Q(t.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}return(0,C.jsxs)("div",{className:Le.listContainer,onClick:function(e){e.stopPropagation(),(!(0,x.GJ)()||(0,x.GJ)()&&V.current&&!V.current.contains(e.target))&&((0,x.dE)()?(0,v.xg)("/classrooms/".concat(B.coursesId,"/program_homework/").concat(T.homework_id,"/detail?tabs=1")):(0,v.xg)("/classrooms/".concat(B.coursesId,"/program_homework/").concat(T.homework_id,"/detail")))},children:[(0,x.GJ)()&&(0,C.jsx)("span",{ref:V,children:(0,C.jsx)(F.Z,{onClick:function(e){e.stopPropagation()},style:{padding:"10px"},checked:M.includes(T.homework_id),onChange:function(){return e=T.homework_id,void(M.includes(e)?(H(M.filter((function(t){return t!==e}))),E(O.filter((function(t){return t.homework_id!==e})))):(H([].concat(g()(M),[e])),E([].concat(g()(O),[T]))));var e}})}),(0,C.jsxs)("div",{className:Le.info,children:[(0,C.jsxs)("div",{className:Le.title,children:[(0,C.jsxs)("div",{className:Le.left,style:(0,x.dE)()?{paddingRight:(null==T?void 0:T.challenge_count)-(null==T?void 0:T.finished_challenge_count)?60:140}:{},children:[(0,x.GJ)()&&(0,C.jsx)(Te.Z,{value:null===(n=T.status)||void 0===n?void 0:n[0],children:(0,C.jsx)(v.VV,{temporary:!0,style:{margin:"0px 10px 0px 0px"},status:T.status})}),(0,x.dE)()&&(0,C.jsx)(v.VV,{temporary:!0,style:{margin:"0px 10px 0px 0px"},status:T.status}),(0,C.jsx)("span",{onClick:function(e){return e.stopPropagation()},children:(0,C.jsx)(m.Link,{target:"_blank",to:"/classrooms/".concat(B.coursesId,"/program_homework/").concat(T.homework_id,"/detail").concat((0,x.dE)()?"?tabs=1":""),children:T.name})})]}),(0,C.jsxs)("div",{className:Le.right,children:[(0,x.GJ)()&&"未发布"===(null==T||null===(s=T.status)||void 0===s?void 0:s[0])&&(0,C.jsx)(m.Link,{target:"_blank",to:"/",onClick:function(){var e=a()(o()().mark((function e(t){var n,s,r,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.stopPropagation(),t.preventDefault(),2!==(null==A||null===(n=A.userInfo)||void 0===n?void 0:n.user_status)){e.next=5;break}return(0,Se.Rd)(),e.abrupt("return");case 5:if(!(0,x.Rm)()||null!==(s=N.AssistantObject)&&void 0!==s&&null!==(s=s.hack)&&void 0!==s&&s.can_publish){e.next=8;break}return p.ZP.warning("您未获取此权限,需向课堂管理员申请权限才能使用此功能"),e.abrupt("return");case 8:(a=v.cX.getItem("".concat(null==A||null===(r=A.userInfo)||void 0===r?void 0:r.login).concat((0,x.GJ)()?"Teacher":"Student"),"ProgramHomework"))&&(B.sort_by=null==a?void 0:a.type,B.sort_direction=null==a?void 0:a.direction),G({type:"classroomList/setActionTabs",payload:{key:"立即发布",selectArrs:[null==T?void 0:T.homework_id],selectArrsAll:[T],params:l()({},B),type:2,manage_all_group:P}});case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),children:(0,C.jsxs)("aside",{className:Le.flexBox,style:{marginRight:"16px"},children:[(0,C.jsx)("i",{className:"iconfont icon-yishezhifabushijian1"}),(0,C.jsx)("div",{children:"发布"})]})}),(0,x.dE)()&&(0,C.jsxs)("div",{className:Le.actionIcon,children:[(null==T?void 0:T.challenge_count)-(null==T?void 0:T.finished_challenge_count)==0&&(0,C.jsx)("i",{className:"iconfont icon-yiwancheng1"}),!(null!==(r=T.status)&&void 0!==r&&r.includes("已截止"))&&!T.status.includes("导入")&&(0,C.jsxs)("aside",{onClick:function(){var e=a()(o()().mark((function e(t){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.stopPropagation(),e.next=3,(0,k.ZP)("/api/problems/".concat(null==T?void 0:T.start_identifier,"/start.json"),{method:"get"});case 3:(n=e.sent)&&(window.open("/myproblems/".concat(null==n?void 0:n.identifier,"?type=1")),localStorage.setItem("program_homework",[B.coursesId,T.homework_id]));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),className:Le.flexBox,style:{marginRight:16},children:[(0,C.jsx)("i",{className:"iconfont icon-kaishixuexi font14"}),(0,C.jsx)("div",{children:"开始学习"})]}),((null===(i=T.status)||void 0===i?void 0:i.includes("已截止"))||(null===(c=T.status)||void 0===c?void 0:c.includes("导入")))&&(0,C.jsxs)("aside",{className:Le.flexBox,style:{marginRight:16},children:[(0,C.jsx)("i",{className:"iconfont icon-chakanzuoye font14"}),(0,C.jsx)("div",{children:"查看作业"})]})]}),(0,x.GJ)()&&(0,C.jsx)(ce.Z,{placement:"bottomCenter",overlayClassName:Le.dro,dropdownRender:function(){return(0,C.jsxs)(le.Z,{children:[!T.status.includes("导入")&&(0,C.jsx)(le.Z.Item,{style:{textAlign:"center"},children:(0,C.jsx)(m.Link,{target:"_blank",to:"/",onClick:function(){var e=a()(o()().mark((function e(t){var n,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.stopPropagation(),t.preventDefault(),2!==(null==A||null===(n=A.userInfo)||void 0===n?void 0:n.user_status)){e.next=5;break}return(0,Se.Rd)(),e.abrupt("return");case 5:if(!(0,x.Rm)()||null!==(s=N.AssistantObject)&&void 0!==s&&null!==(s=s.hack)&&void 0!==s&&s.can_publish){e.next=8;break}return p.ZP.warning("您未获取此权限,需向课堂管理员申请权限才能使用此功能"),e.abrupt("return");case 8:console.log("params--",B),G({type:"classroomList/setActionTabs",payload:{key:"立即发布",selectArrs:[null==T?void 0:T.homework_id],selectArrsAll:[T],params:l()({},B),type:2,manage_all_group:P}});case 10:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),children:"立即发布"})},1),!T.status.includes("导入")&&(0,C.jsx)(le.Z.Item,{style:{textAlign:"center"},children:(0,C.jsx)(m.Link,{target:"_blank",to:"/",onClick:function(){var e=a()(o()().mark((function e(t){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.stopPropagation(),t.preventDefault(),!(0,x.Rm)()||null!==(n=N.AssistantObject)&&void 0!==n&&null!==(n=n.hack)&&void 0!==n&&n.can_stop){e.next=5;break}return p.ZP.warning("您未获取此权限,需向课堂管理员申请权限才能使用此功能"),e.abrupt("return");case 5:G({type:"classroomList/setActionTabs",payload:{key:"立即截止",selectArrs:[null==T?void 0:T.homework_id],selectArrsAll:[T],params:l()({},B),type:2}});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),children:"立即截止"})},2),(0,C.jsx)(le.Z.Item,{style:{textAlign:"center"},children:(0,C.jsx)(m.Link,{target:"_blank",to:"/",onClick:function(){var e=a()(o()().mark((function e(t){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.stopPropagation(),t.preventDefault(),n=null==T?void 0:T.name,b.Z.confirm({centered:!0,icon:null,okText:"确定",cancelText:"取消",title:"重命名",content:(0,C.jsx)("div",{children:(0,C.jsx)(R.Z,{defaultValue:n,maxLength:60,showCount:!0,onChange:function(e){return n=e.target.value}})}),onOk:function(){var e=a()(o()().mark((function e(){var t;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,k.ZP)("/api/homework_commons/".concat(null==T?void 0:T.homework_id,"/alter_name.json"),{method:"post",body:{name:n}});case 2:0===(null==(t=e.sent)?void 0:t.status)&&(p.ZP.success("操作成功"),I());case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),children:"重新命名"})},30),T.status.includes("导入")&&(0,C.jsx)(le.Z.Item,{style:{textAlign:"center"},children:(0,C.jsx)(m.Link,{target:"_blank",to:"/",onClick:function(){var e=a()(o()().mark((function e(t){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.stopPropagation(),t.preventDefault(),G({type:"classroomList/setActionTabs",payload:{key:"补充成绩",name:null==T?void 0:T.name,id:null==T?void 0:T.homework_id,type:"hack"}});case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),children:"补充成绩"})},23),(0,C.jsx)(le.Z.Item,{style:{textAlign:"center"},children:(0,C.jsx)(m.Link,{target:"_blank",to:"/",onClick:function(){var e=a()(o()().mark((function e(t){var n,s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.stopPropagation(),t.preventDefault(),!(0,x.Rm)()||null!==(n=N.AssistantObject)&&void 0!==n&&null!==(n=n.hack)&&void 0!==n&&n.can_delete){e.next=5;break}return p.ZP.warning("您未获取此权限,需向课堂管理员申请权限才能使用此功能"),e.abrupt("return");case 5:G({type:"classroomList/setActionTabs",payload:{key:"删除",selectArrs:[null==T?void 0:T.homework_id],selectArrsAll:O,params:B,status:null==T||null===(s=T.status)||void 0===s?void 0:s[0]}});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),children:"立即删除"})},22),!T.status.includes("导入")&&(0,C.jsx)(le.Z.Item,{style:{textAlign:"center"},children:(0,C.jsx)(m.Link,{target:"_blank",onClick:function(e){e.stopPropagation()},to:"/classrooms/".concat(B.coursesId,"/program_homework/").concat(T.homework_id,"/detail?tabs=3"),children:"高级设置"})},6)]})},children:(0,C.jsxs)("aside",{onClick:function(e){return e.stopPropagation()},className:Le.flexBox,style:{cursor:"default"},children:[(0,C.jsx)("i",{className:"iconfont icon-gengduo4"}),(0,C.jsx)("div",{children:"更多"})]})})]})]}),(0,C.jsx)("div",{className:Le.detail,children:(0,x.GJ)()&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("span",{className:"c-grey-333 mr20",children:T.author}),["未开始","进行中","已截止","提交中","补交中","已结束","匿评中","申诉中"].includes(null==T||null===(h=T.status)||void 0===h?void 0:h[0])&&!!T.uncommit_count&&(0,C.jsxs)("span",{className:"c-grey-999 mr10",children:[(0,C.jsx)("span",{className:"mr5",children:"未做题"}),T.uncommit_count,"人"]}),["未开始","进行中","已截止","提交中","补交中","已结束","匿评中","申诉中"].includes(null==T||null===(f=T.status)||void 0===f?void 0:f[0])&&!!T.commit_count&&(0,C.jsxs)("span",{className:"c-grey-999 mr10",children:[(0,C.jsx)("span",{className:"mr5",children:"已做题"}),T.commit_count,"人"]}),["未开始","进行中","已截止","提交中","补交中","已结束","匿评中","申诉中"].includes(null==T||null===(y=T.status)||void 0===y?void 0:y[0])&&!!T.compelete_count&&(0,C.jsxs)("span",{className:"c-grey-999 mr10",children:[(0,C.jsx)("span",{className:"mr5",children:"已完成"}),T.compelete_count,"人"]}),["未开始","进行中","已截止","提交中","补交中","匿评中","申诉中"].includes(null==T||null===(_=T.status)||void 0===_?void 0:_[0])&&(0,C.jsxs)("span",{className:"c-grey-999 mr10",children:[(0,C.jsx)("span",{className:"mr5",children:"发布时间"}),T.publish_time]}),["未开始","进行中","已截止","提交中","补交中","匿评中","申诉中"].includes(null==T||null===(j=T.status)||void 0===j?void 0:j[0])&&(0,C.jsxs)("span",{className:"c-grey-999 mr10",children:[(0,C.jsx)("span",{className:"mr5",children:"截止时间"}),T.end_time]}),["已结束"].includes(null==T||null===(w=T.status)||void 0===w?void 0:w[0])&&(0,C.jsxs)("span",{className:"c-grey-999 mr10",children:[(0,C.jsx)("span",{className:"mr5",children:"结束时间"}),T.status_time]}),!(null==T||!T.late_time)&&"--"!==(null==T?void 0:T.late_time)&&(0,C.jsxs)("span",{className:"c-grey-999",children:[(0,C.jsx)("span",{className:"mr5",children:"补交截止时间"}),null==T?void 0:T.late_time]}),["未开始","进行中","已截止","提交中","补交中","匿评中","申诉中"].includes(null==T||null===(Z=T.status)||void 0===Z?void 0:Z[0])&&(0,C.jsxs)("span",{className:Le.iconV,onClick:function(){var e=a()(o()().mark((function e(t){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.stopPropagation(),t.preventDefault(),W||$(),z(!W);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),children:[(0,C.jsx)("i",{className:"iconfont icon-".concat(W?"shouqi":"xiala2")})," "]})]})}),(0,C.jsxs)("div",{className:Le.content,children:[(0,x.dE)()&&(0,C.jsxs)("span",{className:Le.infoStuIcon,children:[(0,C.jsx)("span",{className:"c-grey-333",children:T.author}),"已截止"===(null==T||null===(L=T.status)||void 0===L?void 0:L[0])&&!(null==T||!T.status_time)&&(0,C.jsxs)("span",{className:"c-grey-999 ml20",children:[(0,C.jsx)("i",{className:"iconfont icon-shengyushijian font12 mr5"})," ",null==T?void 0:T.status_time]}),(0,C.jsxs)("span",{className:"ml20 c-grey-999",children:[(0,C.jsx)("i",{className:"iconfont icon-wanchengjindu font12 mr5"}),null==T?void 0:T.commit_count,"/",null==T?void 0:T.all_count]}),(0,C.jsxs)("span",{className:"ml20 c-grey-999",children:[(0,C.jsx)("i",{className:"iconfont icon-shijian1 font12 mr5"}),null==T?void 0:T.publish_time," 至 ",null==T?void 0:T.end_time]})]}),(0,x.GJ)()&&"未发布"!==T.status&&W&&K.length>5&&(0,C.jsx)(Ze.Z,{scroll:{y:240},onRow:function(e){return{onClick:function(e){e.stopPropagation(),e.preventDefault()}}},onHeaderRow:function(e,t){return{onClick:function(e){e.stopPropagation(),e.preventDefault()}}},pagination:!1,dataSource:K,style:{marginTop:14,marginRight:6,cursor:"default"},onChange:function(e,t,n){n.field&&(B.sort_by=n.field),n.order||(B.sort_direction="asc"),"ascend"===n.order&&(B.sort_direction="asc"),"descend"===n.order&&(B.sort_direction="desc"),n.order||(B.sort_direction="asc"),$()},columns:X}),(0,x.GJ)()&&"未发布"!==T.status&&W&&K.length<6&&K.length>0&&(0,C.jsx)(Ze.Z,{onRow:function(e){return{onClick:function(e){e.stopPropagation(),e.preventDefault()}}},onHeaderRow:function(e,t){return{onClick:function(e){e.stopPropagation(),e.preventDefault()}}},pagination:!1,dataSource:K,style:{marginTop:14,marginRight:6,cursor:"default"},onChange:function(e,t,n){n.field&&(B.sort_by=n.field),n.order||(B.sort_direction="asc"),"ascend"===n.order&&(B.sort_direction="asc"),"descend"===n.order&&(B.sort_direction="desc"),n.order||(B.sort_direction="asc"),$()},columns:X})]})]})]})},Pe="bg___KWyBO",Ae="otherHomeworkWrap___WlvHv",Ie="otherHomeworkContainer___Qfj2O",De="flex___q8ATC",Me="search___xedy7",He="content___VSdQb",Oe="listItem___u6wwP",Re="info___vvX3a",Ee="title___FtVL7",Ge="describe___g43sA",Be="footer___TNGYY",Ye=function(e){var t=e.courseId,n=e.type,s=e.onCancel,r=(0,m.useParams)(),i=(0,d.useState)({targerData:[],originData:[]}),c=u()(i,2),h=c[0],f=c[1],x=(0,d.useState)([]),y=u()(x,2),_=y[0],j=y[1],b=(0,d.useState)(!1),w=u()(b,2),Z=w[0],L=w[1],T=function(){var e=a()(o()().mark((function e(){var s;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(!0),e.next=3,(0,k.ZP)("/api/courses/".concat(t,"/homework_commons/impersonal_list.json"),{method:"get",params:{type:n}});case 3:s=e.sent,L(!1),f({targerData:s.homeworks,originData:s.homeworks});case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();(0,d.useEffect)((function(){T()}),[]);var S=function(){var e=a()(o()().mark((function e(){var t,n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(!0),t={homework_common_ids:_},r.categoryId&&(t=l()(l()({},t),{},{category_id:r.categoryId})),e.next=5,(0,k.ZP)("/api/courses/".concat(r.coursesId,"/homework_commons/create_collaborators.json"),{method:"POST",body:t});case 5:(n=e.sent)&&n.homework_ids.length>0&&(p.ZP.success("提交成功"),s()),L(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,C.jsx)("div",{className:"animated fadeInUp fast ".concat(Ae),children:(0,C.jsxs)("div",{className:Ie,children:[(0,C.jsx)("div",{className:Me,children:(0,C.jsx)(R.Z.Search,{size:"middle",enterButton:"搜索",onSearch:function(e){var t=h.originData.filter((function(t){return t.name.indexOf(e)>-1}));f(l()(l()({},h),{},{targerData:t}))},placeholder:"请输入图文作业名称进行查询"})}),(0,C.jsx)("div",{className:He,children:h.targerData.map((function(e){return(0,C.jsxs)("div",{className:"".concat(Oe," mb10"),children:[(0,C.jsx)(F.Z,{checked:_.includes(e.id),onChange:function(t){return function(e,t){e.target.checked?j([].concat(g()(_),[t])):j(_.filter((function(e){return e!==t})))}(t,e.id)}}),(0,C.jsxs)("div",{className:Re,children:[(0,C.jsxs)("div",{className:"".concat(De," mb10"),style:{justifyContent:"space-between"},children:[(0,C.jsx)("div",{className:Ee,children:e.name}),(0,C.jsx)("div",{children:(0,C.jsx)(J.ZP,{type:"primary",ghost:!0,onClick:function(){return(0,v.xg)("/classrooms/".concat(r.coursesId,"/common_homework/").concat(e.id,"/detail"))},children:"查看作业"})})]}),(0,C.jsx)("div",{className:"mb20 font14 c-grey-999 ".concat(Ge),children:e.description}),(0,C.jsxs)("div",{className:"font12",children:[(0,C.jsx)("span",{className:"c-grey-333 mr20",children:e.user.name}),(0,C.jsxs)("span",{className:"c-grey-999",children:["创建时间:",e.created_at]})]})]})]},e.id)}))}),(0,C.jsxs)("div",{className:Be,children:[(0,C.jsx)(J.ZP,{type:"primary",ghost:!0,onClick:s,children:"取消"}),(0,C.jsx)(J.ZP,{type:"primary",disabled:0===_.length||Z,onClick:function(){S()},children:"确定"})]})]})})},Je=n(49603),Fe=n(68443),We=n(1350),ze=n(82326),Ve=n(16326),Ue=n(29787),qe=n(48228),Ke=n.n(qe),Qe=n(87665),Xe=["classroomList","dispatch","user","getData"];G().extend(Ke());var $e=function(e){var t,n,s,o,r=e.data,a=e.value,i=e.onChange,c=(0,d.useState)({leftSearch:"",rigthSearch:""}),m=u()(c,2),p=m[0],h=m[1],f=(0,d.useState)([]),v=u()(f,2),x=v[0],y=v[1];return(0,d.useEffect)((function(){y((null==a?void 0:a.length)>0?null==r?void 0:r.filter((function(e){return null==a?void 0:a.includes(null==e?void 0:e.id)})):[])}),[a]),(0,C.jsxs)("div",{style:{display:"flex",flexWrap:"nowrap",gap:"20px",height:"400px"},children:[(0,C.jsxs)("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"15px"},children:[(0,C.jsx)(F.Z,{indeterminate:(null==x?void 0:x.length)>0&&(null==x?void 0:x.length)<(null==r?void 0:r.length),checked:(null==x?void 0:x.length)==(null==r?void 0:r.length),onChange:function(e){i(e.target.checked?null==r?void 0:r.map((function(e){return null==e?void 0:e.id})):[])},children:"全选"}),(0,C.jsxs)("div",{style:{borderRadius:4,border:"1px solid #DCDCDC",display:"flex",flexDirection:"column",flex:"1",overflow:"hidden"},children:[(0,C.jsx)(R.Z.Search,{className:"p20",style:{paddingBottom:0},placeholder:"可输入班级名称查询",value:p.leftSearch,onChange:function(e){h(l()(l()({},p),{},{leftSearch:e.target.value}))}}),(0,C.jsx)("div",{className:"mt20 ml20 mb20",style:{overflow:"auto"},children:0!==(null===(t=p.leftSearch?null==r?void 0:r.filter((function(e){var t;return null==e||null===(t=e.name)||void 0===t?void 0:t.includes(p.leftSearch)})):r)||void 0===t?void 0:t.length)?(0,C.jsx)(F.Z.Group,{value:a,onChange:function(e){i(e)},children:(0,C.jsx)(q.Z,{direction:"vertical",children:null===(n=p.leftSearch?null==r?void 0:r.filter((function(e){var t;return null==e||null===(t=e.name)||void 0===t?void 0:t.includes(p.leftSearch)})):r)||void 0===n?void 0:n.map((function(e,t){return(0,C.jsx)(F.Z,{value:e.id,children:null==e?void 0:e.name},t)}))})}):(0,C.jsx)(ne.Z,{styles:{margin:"0 auto"}})})]})]}),(0,C.jsxs)("div",{style:{flex:"1",display:"flex",flexDirection:"column",gap:"15px"},children:[(0,C.jsxs)("div",{children:["已选择",(null==x?void 0:x.length)||0,"个分班"]}),(0,C.jsxs)("div",{style:{borderRadius:4,border:"1px solid #DCDCDC",display:"flex",flexDirection:"column",flex:"1",overflow:"hidden"},children:[(0,C.jsx)(R.Z.Search,{className:"p20",style:{paddingBottom:0},placeholder:"可输入班级名称查询",value:p.rigthSearch,onChange:function(e){h(l()(l()({},p),{},{rigthSearch:e.target.value}))}}),(0,C.jsx)("div",{className:"mt20 ml20 mb20 pr20",style:{display:"flex",flexDirection:"column",gap:"10px",overflow:"auto"},children:0!==(null===(s=p.rigthSearch?null==x?void 0:x.filter((function(e){var t;return null==e||null===(t=e.name)||void 0===t?void 0:t.includes(p.rigthSearch)})):x)||void 0===s?void 0:s.length)?null===(o=p.rigthSearch?null==x?void 0:x.filter((function(e){var t;return null==e||null===(t=e.name)||void 0===t?void 0:t.includes(p.rigthSearch)})):x)||void 0===o?void 0:o.map((function(e,t){return(0,C.jsxs)(H.Z,{wrap:!1,align:"middle",justify:"space-between",children:[(0,C.jsx)(O.Z,{children:null==e?void 0:e.name}),(0,C.jsx)(O.Z,{children:(0,C.jsx)("i",{className:"iconfont icon-piliangshanchu2 font16 current",style:{color:"#3061D0"},onClick:function(){i(null==a?void 0:a.filter((function(t){return t!==(null==e?void 0:e.id)})))}})})]},t)})):(0,C.jsx)(ne.Z,{styles:{margin:"0 auto"}})})]})]})]})},et=(0,m.connect)((function(e){return{classroomList:e.classroomList,user:e.user}}))((function(e){var t,n,s,r,i,c,h=e.classroomList,f=e.dispatch,x=(e.user,e.getData),y=(j()(e,Xe),(0,m.useParams)()),g=M.Z.useForm(),_=u()(g,1)[0],k=M.Z.useWatch("penalty_type",_),w="批量补交"===(null==h||null===(t=h.actionTabs)||void 0===t?void 0:t.key),Z=(0,Qe.U)(se.c_,l()(l()({},y),null==h||null===(n=h.actionTabs)||void 0===n?void 0:n.params)),L=u()(Z,4),T=L[1],S=L[2],N=L[3],P=(0,Qe.U)(se.nP,{course_id:null==y?void 0:y.coursesId,homework_ids:null==h||null===(s=h.actionTabs)||void 0===s?void 0:s.selectArrs}),A=u()(P,4),I=A[2],D=A[3],E=(0,Qe.U)(se.sm,{course_id:null==y?void 0:y.coursesId,homework_ids:null==h||null===(r=h.actionTabs)||void 0===r?void 0:r.selectArrs}),B=u()(E,3),Y=B[1],J=B[2],F=function(){var e=a()(o()().mark((function e(){var t=arguments;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.length>0&&void 0!==t[0]?t[0]:{},I({}),e.next=4,S({page:1,limit:2e4,homework_id:1===h.actionTabs.type?"":h.actionTabs.selectArrs[0]});case 4:e.sent;case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,d.useEffect)((function(){w&&F()}),[w]),(0,C.jsxs)(b.Z,{centered:!0,title:null==h||null===(i=h.actionTabs)||void 0===i?void 0:i.key,width:800,open:w,cancelText:"暂不补交",okText:"开启补交",onCancel:function(){f({type:"classroomList/setActionTabs",payload:{}})},destroyOnClose:!0,confirmLoading:Y,onOk:a()(o()().mark((function e(){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:_.submit();case 1:case"end":return e.stop()}}),e)}))),children:[(0,C.jsx)("div",{className:"p10 pl20 pr20 c-orange-ff7 mb20",style:{background:"#F6F7F9"},children:"规则说明:补交截止时间必须晚于作业截止时间;当班级阶段进入“补交中”则不可变更作业截止时间、不可关闭补交;当作业状态为未发布或者作业已开启统一补交时,新批量补交规则不生效。"}),(0,C.jsxs)(M.Z,{form:_,colon:!1,size:"large",initialValues:{unified_late:!1,penalty_type:2,late_minus_score:20},onFinish:function(){var e=a()(o()().mark((function e(t){var n,s,r,a;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,J((null==N||null===(n=N.course_groups)||void 0===n?void 0:n.length)>0?{unified_late:(null==N||null===(s=N.course_groups)||void 0===s?void 0:s.length)<=0,allow_late_settings:[l()({},t)]}:l()({unified_late:(null==N||null===(r=N.course_groups)||void 0===r?void 0:r.length)<=0},t));case 2:0==(null==(a=e.sent)?void 0:a.status)&&(p.ZP.success("补交设置成功"),f({type:"classroomList/setActionTabs",payload:{}}),x&&x());case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),children:[(0,C.jsxs)(H.Z,{wrap:!1,gutter:20,children:[(0,C.jsx)(O.Z,{flex:1,children:(0,C.jsx)(M.Z.Item,{label:"补交扣分",name:"late_minus_score",rules:[{required:!0,validator:function(e,t,n){return 2===k&&t>100?Promise.reject((0,C.jsx)("span",{style:{marginLeft:100},children:"请重新输入,范围0-100"})):Promise.resolve()}},{required:!0,message:(0,C.jsx)("span",{style:{marginLeft:100},children:"请输入补交扣分"})}],children:(0,C.jsx)(R.Z,{placeholder:"请输入补交扣分",min:0,type:"number",suffix:1==k?"分":"%",max:1===k?Number.MAX_SAFE_INTEGER:100,addonBefore:(0,C.jsx)(M.Z.Item,{name:"penalty_type",noStyle:!0,normalize:function(e){return _.setFieldsValue({late_minus_score:2==e?20:5}),e},children:(0,C.jsx)(ze.default,{style:{width:100},options:[{value:2,label:"百分比"},{value:1,label:"分值"}]})})})})}),(0,C.jsx)(O.Z,{flex:"390px",children:(0,C.jsx)(M.Z.Item,{label:"补交截止时间",name:"late_time",rules:[{required:!0,validator:function(e,t,n){return t&&G()(t).startOf("minute")<=G()().startOf("minute")?Promise.reject("作业补交截止时间必须晚于此刻"):t&&G()(t).startOf("minute")<=G()(null==D?void 0:D.max_late_time).startOf("minute")?(p.ZP.warning("补交截止时间不能小于选中作业中最晚作业截止时间:".concat(null==D?void 0:D.max_late_time)),Promise.reject("")):Promise.resolve()}},{required:!0,message:"请先设置补交截止时间"}],children:(0,C.jsx)(Ve.default,{placeholder:"请选择截止时间",style:{width:"100%"},disabledDate:function(e){return(0,v.BO)(e,{startTime:null==D?void 0:D.max_late_time})},disabledTime:function(e){return(0,v.hv)(e,{compared:null==D?void 0:D.max_late_time})},format:"YYYY-MM-DD HH:mm",showTime:{showSecond:!1,defaultValue:G()("00:00:00","HH:mm:ss")}})})})]}),(null==N||null===(c=N.course_groups)||void 0===c?void 0:c.length)>0&&(0,C.jsx)(Ue.Z,{spinning:T,children:(0,C.jsx)(M.Z.Item,{name:"group_id",rules:[{required:!0,message:"请先选择班级"}],children:(0,C.jsx)($e,{data:(null==N?void 0:N.course_groups)||[],onChange:function(e){I({group_ids:e})}})})})]})]})})),tt=n(47889),nt=n(40989),st=function(e){var t,n=e.styles,s=void 0===n?{}:n,o=e.onSelect,r=e.params,a=e.onClick,i=e.user,c=(0,d.useState)(!1),p=u()(c,2),h=p[0],f=p[1],v=(0,d.useState)(""),x=u()(v,2),y=x[0],g=x[1];(0,d.useEffect)((function(){f(!1),g("")}),[]);return(0,C.jsxs)("section",{className:"tc animated fadeIn",style:l()(l()({},{color:"#999",margin:"200px auto"}),s),children:[(0,C.jsx)("img",{src:nt.z3}),(0,C.jsxs)("p",{className:"mt20 font14",children:["编程作业是由多个编程试题组成,可用于ACM模式竞赛,也可作为平常练习",(0,C.jsx)("br",{}),"点击下方按钮,开始新建编程作业"]}),(0,C.jsx)("div",{style:{marginTop:"30px"},children:(0,C.jsx)(J.ZP,{disabled:2===(null==i||null===(t=i.userInfo)||void 0===t?void 0:t.user_status),onClick:a,type:"primary",style:{width:"128px",height:"40px",marginRight:"20px",borderRadius:"4px"},children:"新建作业"})}),h&&(0,C.jsx)(b.Z,{open:!0,centered:!0,title:"新建作业",onCancel:function(){return f(!1)},onOk:function(){"1"===y&&m.history.push("/classrooms/".concat(r.coursesId,"/common_homework/").concat(r.categoryId,"/add")),"2"===y&&(o(),f(!1),g(""))},children:(0,C.jsxs)("div",{children:[(0,C.jsx)("div",{children:(0,C.jsx)(tt.ZP,{value:"1",style:{marginTop:"15px"},checked:"1"===y,onClick:function(){return g("1")},children:"新建图文作业"})}),(0,C.jsx)("div",{children:(0,C.jsx)(tt.ZP,{value:"2",style:{marginTop:"15px"},checked:"2"===y,onClick:function(){return g("2")},children:"选用资源"})})]})})]})},ot=(0,d.createContext)({selectArrs:[]}),rt=(0,m.connect)((function(e){var t=e.classroomList,n=e.loading,s=e.user;return{classroomList:t,globalSetting:e.globalSetting,user:s,loading:n.effects}}))((function(e){var t,n,s,r,i=e.classroomList,c=e.loading,y=e.dispatch,g=e.user,_=(0,m.useLocation)(),j=(0,m.useParams)(),b=(0,d.useState)((function(){return l()(l()({},j),{},{id:j.coursesId,limit:20})})),k=u()(b,2),w=k[0],Z=k[1],P=(0,m.useSearchParams)(),I=u()(P,1)[0],D=(0,d.useState)([]),M=u()(D,2),H=M[0],O=M[1],R=(0,d.useState)(!1),E=u()(R,2),G=E[0],Y=E[1],J=(0,d.useState)(!1),F=u()(J,2),W=F[0],z=F[1],V=(0,d.useState)([]),U=u()(V,2),q=U[0],K=U[1],Q=(0,d.useState)(!1),X=u()(Q,2),$=X[0],ee=X[1],te=(0,d.useState)("默认排序"),se=u()(te,2),re=se[0],ae=se[1],le=g.userInfo,ce=i.detailCommonHomeworksList,ue=i.detailLeftMenus,de=(i.detailTopBanner,i.taskList);w.type=1,w.categoryId?w.category=w.categoryId:delete w.category,(0,d.useEffect)((function(){var e=I.get("tabs");e&&void 0!==e&&((0,x.GJ)()?w.status=e:w.order=e)}),[_.search]),(0,d.useEffect)((function(){"0"===I.get("tabs")&&(w.status="0",w.page=1),w.status=I.get("tabs")}),[I.get("tabs")]),(0,d.useEffect)((function(){Z(l()(l()({},w),j))}),[null==j?void 0:j.categoryId]),(0,d.useEffect)((function(){var e,t;if(j.categoryId?(w.categoryId=j.categoryId,w.category=j.categoryId):delete w.category,null!=g&&null!==(e=g.userInfo)&&void 0!==e&&e.login){var n;y({type:"classroomList/getAssistantPermissions",payload:{course_id:w.id}});var s=v.cX.getItem("".concat(null==g||null===(n=g.userInfo)||void 0===n?void 0:n.login).concat((0,x.GJ)()?"Teacher":"Student"),"ProgramHomework");s&&(w.sort_by=null==s?void 0:s.type,w.sort_direction=null==s?void 0:s.direction,ae(null==s?void 0:s.name));var o=I.get("tabs");o&&void 0!==o&&((0,x.GJ)()?w.status=o:w.order=o),me({})}else if(null!=g&&null!==(t=g.userInfo)&&void 0!==t&&t.username){var r=I.get("tabs");r&&void 0!==r&&((0,x.GJ)()?w.status=r:w.order=r),me({})}}),[null==g||null===(t=g.userInfo)||void 0===t?void 0:t.login,null==_?void 0:_.pathname]),(0,d.useEffect)((function(){"清除选择数据"===i.actionTabs.key&&(O([]),K([])),"目录重命名成功"===i.actionTabs.key&&me()}),[i.actionTabs.key]),(0,d.useEffect)((function(){O([])}),[ce]),(0,d.useEffect)((function(){z(!1)}),[w.categoryId]),(0,d.useEffect)((function(){ce&&ce.homeworks&&(H.length===ce.homeworks.length&&H.length>0?Y(!0):H.length!==ce.homeworks.length&&Y(!1))}),[H]);var me=function(){O([]),K([]),y({type:"classroomList/getClassroomTeacherCommonList",payload:l()(l()({},w),{},{type:5})})};ue.course_modules&&i.detailLeftMenus.course_modules.filter((function(e){return"common_homework"===e.type}))[0];["删除","立即发布","立即截止","收藏"].filter((function(e){return null!=le&&le.main_site?e:"收藏"!==e})).filter((function(e){return!!(0,x.GJ)()||"删除"!==e}));var pe=function(){y({type:"shixunHomeworks/setActionTabs",payload:{key:"题库选用",params:w}})},he=null===(n=[{key:"publish",label:"批量发布",icon:(0,C.jsx)("i",{className:"iconfont icon-fabu5"}),isShow:!0},{key:"deadline",label:"批量截止",icon:(0,C.jsx)("i",{className:"iconfont icon-piliangjiezhi2"}),isShow:!0},{key:"batchpay",label:"批量补交",icon:(0,C.jsx)("i",{className:"iconfont icon-buka"}),isShow:!0},{key:"delete",label:"批量删除",icon:(0,C.jsx)("i",{className:"iconfont icon-piliangshanchu2"}),isShow:(0,x.GJ)()||(0,x.Rm)()}].filter((function(e){return null==e?void 0:e.isShow})))||void 0===n?void 0:n.map((function(e){return delete e.isShow,e})),fe=function(){var e=a()(o()().mark((function e(t){return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,y({type:"classroomList/updateTaskPosition",payload:{category_id:w.categoryId,courseId:w.id,task_ids:t,container_type:"program_homework"}});case 2:me();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),xe=(0,d.useMemo)((function(){var e=[];return de.length>0&&(e=de.map((function(e){var t;return{user_name:e.user_name,task_name:e.task_name,task_id:e.task_id,category:e.category,status:null==e||null===(t=e.status)||void 0===t?void 0:t[0]}}))),e}),[de]);return(0,C.jsx)(ot.Provider,{value:{params:w,batchStatus:W,selectArrs:H,setSelectArrs:O,allSelect:G,dataSource:ce.homeworks||[],detailLeftMenus:ue,main_category_id:ce.main_category_id||"",selectArrsAll:q,setAllSelect:Y,useBatchStatus:z,dispatch:y,getData:me,setSelectArrsAll:K},children:(0,C.jsxs)("section",{children:[(0,C.jsxs)("aside",{className:Pe,children:[(0,C.jsx)(ve,{isLoading:c["classroomList/getClassroomTeacherCommonList"],tabDataSource:(0,x.GJ)()?[{name:"全部",id:0,total:ce.all_count||0},{name:"未发布",id:1,total:ce.unpublished_count||0},{name:"未开始",id:4,total:ce.not_start_count||0},{name:"进行中",id:2,total:ce.in_progress_count||0},{name:"已截止",id:3,total:ce.overed_count||0}]:[{name:"全部",id:0},{name:"提交中",id:2},{name:"补交中",id:10},{name:"已截止",id:3}],classroomList:i,isAdmin:(0,x.GJ)(),dispatch:y,type:null==ce?void 0:ce.main_category_name,TooltipTitle:w.categoryId?"目录重命名":"新建子目录",categoryId:w.categoryId,user:g,dropdownMenu:[{name:"新建编程作业",id:"1"},{name:"导入外部成绩",id:"3"}],isShowRightControl:"未分配目录"!==(0,v.Oo)(null==ue?void 0:ue.course_modules,w.categoryId),onTabMenuClick:function(e){void 0!==e.id&&((0,x.GJ)(),w.status=e.id),z(!1),w.page=1,m.history.replace("".concat(_.pathname,"?tabs=").concat(e.id)),me(w)},defaultSelectedKeys:[I.get("tabs")?I.get("tabs"):"0"],onTooltipTitleClick:function(){y({type:"classroomList/setActionTabs",payload:{key:w.categoryId?"目录重命名":"添加目录",params:w,selectArrs:{category_name:null==ce?void 0:ce.category_name,category_id:(null==ce?void 0:ce.category_id)||(null==ce?void 0:ce.main_category_id)},cb:function(){me()}}})},onDropdownMenuClick:function(e){var t;if(!(0,x.Rm)()||null!==(t=i.AssistantObject.hack)&&void 0!==t&&t.can_create){if("1"===e)m.history.push("/classrooms/".concat(w.coursesId,"/program_homework/").concat(w.categoryId,"/add"));else if("2"===e)pe();else if("3"===e){if((0,v.Ye)(y))return;y({type:"classroomList/setActionTabs",payload:{key:"导入外部成绩",type:"hack"}})}}else p.ZP.warning("您未获取此权限,需向课堂管理员申请权限才能使用此功能")}}),(0,C.jsx)(je,{dataSource:ce.homeworks||[],isAdmin:(0,x.GJ)(),batchStatus:W,SortMenuName:re,setSortMenuName:ae,onSearch:function(e){w.search=e.trim(),w.page=1,me()},onSort:function(e){var t;w.sort_by=e.type,w.sort_direction=e.direction,w.page=1,v.cX.setItem("".concat(null==g||null===(t=g.userInfo)||void 0===t?void 0:t.login).concat((0,x.GJ)()?"Teacher":"Student"),e,"ProgramHomework"),me(w)},onBatch:function(e){return z(e)}})]}),0===(null==ce?void 0:ce.all_count)&&(0,x.GJ)()?!c[(0,x.GJ)()?"classroomList/getClassroomTeacherCommonList":"classroomList/getClassroomCommonList"]&&(0,C.jsx)(st,{user:g,params:w,dispatch:y,onClick:function(){return m.history.push("/classrooms/".concat(w.coursesId,"/program_homework/").concat(w.categoryId,"/add"))},onSelect:pe}):(null==ce?void 0:ce.homeworks)&&0===ce.homeworks.length&&!c[(0,x.GJ)()?"classroomList/getClassroomTeacherCommonList":"classroomList/getClassroomCommonList"]&&(0,C.jsx)(ne.Z,{}),(0,C.jsx)("aside",{className:"minH500 skt-loading relative pb40 mb30",children:!c[(0,x.GJ)()?"classroomList/getClassroomTeacherCommonList":"classroomList/getClassroomCommonList"]&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)("aside",{className:"animated fadeIn",children:[null==ce||null===(s=ce.homeworks)||void 0===s?void 0:s.map((function(e,t){return(0,C.jsx)(Ne,{user:g,dataSource:e,params:w,classroomList:i,manageAllGroup:null==ce?void 0:ce.manage_all_group,getData:me},t)})),!c[(0,x.GJ)()?"classroomList/getClassroomTeacherCommonList":"classroomList/getClassroomCommonList"]&&(0,C.jsx)("aside",{className:"tc mb50 mt30",children:(null==ce?void 0:ce.query_total_count)>10&&(0,C.jsx)(h.Z,{hideOnSinglePage:!0,showSizeChanger:!1,onChange:function(e,t){w.page=e,me()},defaultPageSize:20,defaultCurrent:1,current:w.page||1,total:(0,x.GJ)()?ce.query_total_count:ce.student_all_count})})]}),H.length>0&&(0,x.GJ)()&&(0,C.jsx)(f.Z,{offsetBottom:0,children:(0,C.jsx)(Ce,{buttonDataSource:he,onClick:function(e){var t,n,s,o;if(0===H.length)return p.ZP.error("请选择你要操作的任务"),!1;if(2!==(null==g||null===(t=g.userInfo)||void 0===t?void 0:t.user_status)||"publish"!==(null==e?void 0:e.key)){var r=e.label||"",a={key:r,selectArrs:H,selectArrsAll:q,type:["publish","deadline"].includes(e.key)?1:"",params:w};switch(e.key){case"publish":if(r="立即发布",(0,x.Rm)()&&(null===(n=i.AssistantObject)||void 0===n||null===(n=n.hack)||void 0===n||!n.can_publish))return void p.ZP.warning("您未获取此权限,需向课堂管理员申请权限才能使用此功能");break;case"deadline":if(r="立即截止",(0,x.Rm)()&&(null===(s=i.AssistantObject)||void 0===s||null===(s=s.hack)||void 0===s||!s.can_stop))return void p.ZP.warning("您未获取此权限,需向课堂管理员申请权限才能使用此功能");break;case"batchpay":r="批量补交";break;case"delete":if(r="删除",(0,x.Rm)()&&(null===(o=i.AssistantObject)||void 0===o||null===(o=o.hack)||void 0===o||!o.can_delete))return void p.ZP.warning("您未获取此权限,需向课堂管理员申请权限才能使用此功能");break;case"collection":r="收藏"}y({type:"classroomList/setActionTabs",payload:l()(l()({},a),{},{key:r})})}else(0,Se.Rd)()}})})]})}),"批量补交"===(null==i||null===(r=i.actionTabs)||void 0===r?void 0:r.key)&&(0,C.jsx)(et,{getData:me}),(0,C.jsx)(L,{onCallback:function(){return z(!1)}}),(0,C.jsx)(Je.Z,{onOk:function(){me()}}),(0,C.jsx)(Fe.Z,{onOk:function(){}}),(0,C.jsx)(T.Z,{onCallback:function(){return z(!1)},courseEndTime:null==ce?void 0:ce.course_end_time}),(0,C.jsx)(S.Z,{courseEndTime:null==ce?void 0:ce.course_end_time,courseId:j.coursesId,visible:"立即截止"===i.actionTabs.key,isBatch:2!==i.actionTabs.type,homeworkIds:i.actionTabs.selectArrs,successCallback:function(){z(!1),me()}}),(0,C.jsx)(N,{}),(0,C.jsx)(A,{onCallback:function(){return z(!1)}}),(0,C.jsx)(B,{onCallback:function(){return z(!1)}}),(0,C.jsx)(oe,{refreshList:me}),(0,C.jsx)(ie,{}),(0,C.jsx)(We.Z,{visible:"调整排序"===i.actionTabs.key,callback:fe,data:xe,onCancel:function(){y({type:"classroomList/setActionTabs",payload:{key:""}})}}),$&&(0,C.jsx)(Ye,{courseId:w.coursesId,type:"1",onCancel:function(){return ee(!1)}})]})})}))},59120:function(e,t,n){"use strict";n.d(t,{$J:function(){return l},JZ:function(){return u},bN:function(){return p},jP:function(){return m},rO:function(){return c}});var s=n(7557),o=n.n(s),r=n(41498),a=n.n(r),i=n(94171);function l(e){return(0,i.U2)("libraries/".concat(e,".json"))}function c(){return(0,i.U2)("library_tags.json")}function u(e){return d.apply(this,arguments)}function d(){return(d=a()(o()().mark((function e(t){var n;return o()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,i.IV)("attachments/".concat(t,".json"));case 2:return n=e.sent,e.abrupt("return",0===n.status);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function m(e){return(0,i.v_)("libraries.json",e)}function p(e,t){return(0,i.gz)("libraries/".concat(e,".json"),t)}},51581:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(t,n,s){return n&&e(t.prototype,n),s&&e(t,s),t}}(),o=n(59301),r=i(o),a=i(n(12708));function i(e){return e&&e.__esModule?e:{default:e}}var l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.scrollListener=n.scrollListener.bind(n),n.eventListenerOptions=n.eventListenerOptions.bind(n),n.mousewheelListener=n.mousewheelListener.bind(n),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),s(t,[{key:"componentDidMount",value:function(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}},{key:"componentDidUpdate",value:function(){if(this.props.isReverse&&this.loadMore){var e=this.getParentElement(this.scrollComponent);e.scrollTop=e.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}},{key:"componentWillUnmount",value:function(){this.detachScrollListener(),this.detachMousewheelListener()}},{key:"isPassiveSupported",value:function(){var e=!1,t={get passive(){e=!0}};try{document.addEventListener("test",null,t),document.removeEventListener("test",null,t)}catch(e){}return e}},{key:"eventListenerOptions",value:function(){var e=this.props.useCapture;return this.isPassiveSupported()&&(e={useCapture:this.props.useCapture,passive:!0}),e}},{key:"setDefaultLoader",value:function(e){this.defaultLoader=e}},{key:"detachMousewheelListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.scrollComponent.parentNode),e.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}},{key:"detachScrollListener",value:function(){var e=window;!1===this.props.useWindow&&(e=this.getParentElement(this.scrollComponent)),e.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),e.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}},{key:"getParentElement",value:function(e){var t=this.props.getScrollParent&&this.props.getScrollParent();return null!=t?t:e&&e.parentNode}},{key:"filterProps",value:function(e){return e}},{key:"attachScrollListener",value:function(){var e=this.getParentElement(this.scrollComponent);if(this.props.hasMore&&e){var t=window;!1===this.props.useWindow&&(t=e),t.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),t.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}}},{key:"mousewheelListener",value:function(e){1!==e.deltaY||this.isPassiveSupported()||e.preventDefault()}},{key:"scrollListener",value:function(){var e=this.scrollComponent,t=window,n=this.getParentElement(e),s=void 0;if(this.props.useWindow){var o=document.documentElement||document.body.parentNode||document.body,r=void 0!==t.pageYOffset?t.pageYOffset:o.scrollTop;s=this.props.isReverse?r:this.calculateOffset(e,r)}else s=this.props.isReverse?n.scrollTop:e.scrollHeight-n.scrollTop-n.clientHeight;s<Number(this.props.threshold)&&e&&null!==e.offsetParent&&(this.detachScrollListener(),this.beforeScrollHeight=n.scrollHeight,this.beforeScrollTop=n.scrollTop,"function"==typeof this.props.loadMore&&(this.props.loadMore(this.pageLoaded+=1),this.loadMore=!0))}},{key:"calculateOffset",value:function(e,t){return e?this.calculateTopPosition(e)+(e.offsetHeight-t-window.innerHeight):0}},{key:"calculateTopPosition",value:function(e){return e?e.offsetTop+this.calculateTopPosition(e.offsetParent):0}},{key:"render",value:function(){var e=this,t=this.filterProps(this.props),n=t.children,s=t.element,o=t.hasMore,a=(t.initialLoad,t.isReverse),i=t.loader,l=(t.loadMore,t.pageStart,t.ref),c=(t.threshold,t.useCapture,t.useWindow,t.getScrollParent,function(e,t){var n={};for(var s in e)t.indexOf(s)>=0||Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s]);return n}(t,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]));c.ref=function(t){e.scrollComponent=t,l&&l(t)};var u=[n];return o&&(i?a?u.unshift(i):u.push(i):this.defaultLoader&&(a?u.unshift(this.defaultLoader):u.push(this.defaultLoader))),r.default.createElement(s,c,u)}}]),t}(o.Component);l.propTypes={children:a.default.node.isRequired,element:a.default.node,hasMore:a.default.bool,initialLoad:a.default.bool,isReverse:a.default.bool,loader:a.default.node,loadMore:a.default.func.isRequired,pageStart:a.default.number,ref:a.default.func,getScrollParent:a.default.func,threshold:a.default.number,useCapture:a.default.bool,useWindow:a.default.bool},l.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},t.default=l,e.exports=t.default},26724:function(e,t,n){e.exports=n(51581)}}]); |