|
|
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[54572],{58512:function(e,n,t){t.r(n),t.d(n,{default:function(){return T}});var i=t(7557),r=t.n(i),o=t(41498),a=t.n(o),s=t(82242),c=t.n(s),l=t(79800),d=t.n(l),u=t(59301),p=t(53084),f=t(8785),m=t(43418),x=t(92911),h="modal___VXplb",_=t(37712),v=(0,f.connect)((function(e){return{classroomList:e.classroomList}}))((function(e){var n=e.onOk,t=e.dispatch,i=e.classroomList,o=(0,u.useState)(!1),s=d()(o,2),c=s[0],l=s[1],p=function(){var e=a()(r()().mark((function e(){var o;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return l(!0),e.next=3,(0,x.ZP)("/api/homework_commons/".concat(null===(o=i.actionTabs)||void 0===o||null===(o=o.params)||void 0===o?void 0:o.categoryId,"/export_workspace_files.json"),{method:"post",body:{is_repeat_export:1}});case 3:0===e.sent.status&&(n(),t({type:"classroomList/setActionTabs",payload:{}})),l(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,_.jsx)(m.Z,{title:"温馨提示",zIndex:9999,className:h,confirmLoading:c,open:"重复导出提醒"===i.actionTabs.key,onCancel:function(){t({type:"classroomList/setActionTabs",payload:{}})},onOk:p,children:(0,_.jsx)("div",{className:"mb20",children:" 您在当前栏目中已存在导出记录,是否重新导出?"})})})),g=t(61186),k=t.n(g),w=t(6848),y=t(61998),b=t(27092),j=t(25203);k().locale("zh-cn");var S=[{id:"exercise_score",name:"试卷成绩"},{id:"shixun_work_list",name:"课堂实验成绩"},{id:"normal_work_list",name:"图文作业成绩"},{id:"group_work_list",name:"分组作业成绩"},{id:"course_total_score",name:"课堂总成绩"},{id:"course_total_homework",name:"课堂作业成绩"},{id:"course_total_exercise_and_other",name:"课堂试卷成绩"},{id:"course_member_act_score",name:"课堂活跃度"},{id:"mooc_records",name:"第三方慕课"},{id:"hack_work_list",name:"编程作业成绩"},{id:"workspace_files",name:"实验文件"},{id:"messages_statistics",name:"课堂互动统计"}],Z=[{id:"failed",name:"失败"},{id:"running",name:"执行中"},{id:"finished",name:"完成"}],T=(0,f.connect)((function(e){var n=e.loading;return{globalSetting:e.globalSetting,loading:n}}))((function(e){e.globalSetting,e.loading,e.dispatch;var n,t=(0,u.useState)(c()({},(0,f.useParams)())),i=d()(t,2),o=i[0],s=(i[1],(0,u.useState)()),l=d()(s,2),h=l[0],g=l[1],T=(0,u.useState)(!0),I=d()(T,2),C=I[0],L=I[1],z=(0,u.useState)(1),O=d()(z,2),P=O[0],D=O[1],M=null==o||null===(n=o.type)||void 0===n?void 0:n.split(",");function Y(){return A.apply(this,arguments)}function A(){return A=a()(r()().mark((function e(){var n,t,i=arguments;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.length>0&&void 0!==i[0]?i[0]:1,L(!0),e.next=4,(0,x.ZP)("/api/courses/".concat(o.coursesId,"/export_records.json"),{method:"get",params:{page:n,per_page:10,export_types:M}});case 4:(t=e.sent)&&g(t),L(!1);case 7:case"end":return e.stop()}}),e)}))),A.apply(this,arguments)}(0,u.useEffect)((function(){Y(P)}),[]);var B=[{title:"文件名",dataIndex:"filename",ellipsis:!0,width:"30%",render:function(e,n,t){return(0,_.jsx)(w.Z,{title:e,children:(0,_.jsx)("span",{children:e||(null==n?void 0:n.preview_filename)})})}},{title:"类型",dataIndex:"export_type",ellipsis:!0,render:function(e){return null==S?void 0:S.map((function(n){if(e===(null==n?void 0:n.id))return(0,_.jsx)(w.Z,{title:n.name,children:(0,_.jsx)("span",{children:n.name})})}))}},{title:"状态",dataIndex:"status",ellipsis:!0,render:function(e){return null==Z?void 0:Z.map((function(n){if(e===(null==n?void 0:n.id))return n.name}))}},{title:"导出人",dataIndex:"user",ellipsis:!0,render:function(e){return null==e?void 0:e.real_name}},{title:"下载次数",dataIndex:"downloads"},{title:"创建时间",dataIndex:"created_at",width:"20%",render:function(e){return k()(e).format("YYYY-MM-DD HH:mm:ss")}},{title:"操作",ellipsis:!0,render:function(e,n,t){return(0,_.jsx)("span",{style:{cursor:"pointer",color:"#0152d9"},onClick:function(){if("workspace_files"===n.export_type){var e=(new Date).getTime(),t=(new Date(n.created_at).getTime()-e)/864e5;return console.log(Math.abs(t),22),void(Math.abs(t)<=30?(m.Z.info({icon:null,title:"温馨提示",content:(0,_.jsx)("div",{children:"导出的实验文件自创建时间起默认保留30天,超过保留期限会被自动清除,请尽快下载!如超过文件的保留期限仍需下载,可重新导出文件并下载。"}),okText:"知道了"}),(0,j._k)({id:null==n?void 0:n.id})):m.Z.confirm({icon:null,title:"温馨提示",content:(0,_.jsx)("div",{children:"该实验文件超过保存期限已被清除,是否重新导出?"}),okText:"确认",onOk:(i=a()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,x.ZP)("/api/homework_commons/".concat(n.exportable_id,"/export_workspace_files.json"),{method:"post",body:{is_repeat_export:1}});case 2:0===e.sent.status&&Y();case 4:case"end":return e.stop()}}),e)}))),function(){return i.apply(this,arguments)}),cancelText:"取消"}))}var i;(0,j._k)({id:null==n?void 0:n.id})},children:"finished"===(null==n?void 0:n.status)?"下载":""})}}].filter((function(e){return!!e}));return(0,_.jsxs)("div",{style:{background:"#fff"},children:[(0,_.jsxs)("span",{style:{fontSize:"16px",height:"40px",display:"flex",background:"#fff",padding:"10px 20px"},children:[(0,_.jsx)(p.Z,{onClick:function(){f.history.back()},style:{marginTop:"4px",cursor:"pointer",marginRight:"5px"}})," ","导出列表"]}),(0,_.jsx)("div",{style:{background:"#fff",marginBottom:14},children:(0,_.jsx)(y.Z,{rowKey:"id",columns:B,dataSource:null==h?void 0:h.export_records,pagination:!1,loading:C})}),(0,_.jsx)(b.Z,{hideOnSinglePage:!0,pageSize:10,showSizeChanger:!1,onChange:function(){var e=a()(r()().mark((function e(n,t){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:D(n),Y(n);case 2:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),style:{textAlign:"center",paddingBottom:20},current:P,total:null==h?void 0:h.total_count}),(0,_.jsx)(v,{onOk:Y})]})}))}}]); |