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__Classrooms__Lists__Stati...

1 line
7.3 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3451],{99170:function(e,t,n){n.r(t),n.d(t,{default:function(){return I}});var r=n(10574),i=n.n(r),o=n(39343),l=n.n(o),a=n(26801),d=n.n(a),u=n(11006),s=n.n(u),c=n(59301),m=n(22211),_=n(20834),f=n(72315),v=n(15830),p={flex_box_center:"flex_box_center___BogAZ",flex_space_between:"flex_space_between___vFRFf",flex_box_vertical_center:"flex_box_vertical_center___AZ2v2",flex_box_center_end:"flex_box_center_end___PznGE",flex_box_column:"flex_box_column___Jbx4l",containerTitle:"containerTitle___Gs2Wj",des:"des___PxCdT",menu:"menu___uCky_"},x=n(85578),g=n(9498),h=n.n(g),y=n(37712),b=[{type:"shixun",sorter:{field:"",order:""},column:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};console.log(e,4455488);var n=t.field,r=void 0===n?"":n,i=t.order,o=void 0===i?"":i;return[{title:"序号",dataIndex:"number",align:"center",width:70,render:function(t,n,r){return e.limit*(e.page-1)+r+1}},{title:"实践项目名称",dataIndex:"shixun_name",ellipsis:!0},{title:"关卡进度",dataIndex:"passed_game_count",sortOrder:"passed_game_count"===r&&o,width:90,sorter:!0,render:function(e,t){return"".concat(e,"/").concat(null==t?void 0:t.games_count)}},{title:"评测次数",dataIndex:"evaluate_count",sortOrder:"evaluate_count"===r&&o,width:90,sorter:!0},{title:"总耗时",dataIndex:"cost_time",sortOrder:"cost_time"===r&&o,sorter:!0,width:130,render:function(e){return e&&(0,x.li)(e)||"-"}},{title:"开始学习时间",dataIndex:"start_at",width:100,render:function(e){return e&&h()(e).format("YYYY-MM-DD")||"-"}},{title:"最后学习时间",dataIndex:"end_at",width:100,render:function(e){return e&&h()(e).format("YYYY-MM-DD")||"-"}},"1"===(null==e?void 0:e.menuKey)&&{title:"操作",width:80,dataIndex:"action",render:function(t,n){return(0,y.jsx)("a",{href:"/classrooms/".concat(null==e?void 0:e.coursesId,"/shixun_homework/").concat(null==n?void 0:n.homework_common_id,"/").concat(null==n?void 0:n.student_work_id,"/comment"),target:"_blank",children:"实训报告"})}}].filter((function(e){return!!e}))}},{type:"video",sorter:{field:"",order:""},column:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.field,r=void 0===n?"":n,i=t.order,o=void 0===i?"":i;return[{title:"序号",dataIndex:"number",align:"center",width:70,render:function(t,n,r){return e.limit*(e.page-1)+r+1}},{title:"视频名称",dataIndex:"file_name",ellipsis:!0},{title:"观看时长",dataIndex:"total_duration",sortOrder:"total_duration"===r&&o,sorter:!0,width:130,render:function(e){return e&&(0,x.li)(e)||"-"}},{title:"学习进度",dataIndex:"rate",sortOrder:"rate"===r&&o,sorter:!0,width:90,render:function(e){return e&&"".concat(e,"%")||0}},{title:"开始学习时间",dataIndex:"start_at",width:170,render:function(e){return e&&h()(e).format("YYYY-MM-DD HH:mm:ss")||"-"}},{title:"最后学习时间",dataIndex:"end_at",width:170,render:function(e){return e&&h()(e).format("YYYY-MM-DD HH:mm:ss")||"-"}}]}},{type:"files",sorter:{field:"",order:""},column:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.field,r=void 0===n?"":n,i=t.order,o=void 0===i?"":i;return[{title:"序号",dataIndex:"number",align:"center",width:70,render:function(t,n,r){return e.limit*(e.page-1)+r+1}},{title:"教学课件名称",dataIndex:"file_name",ellipsis:!0},{title:"下载资源次数",dataIndex:"num",sortOrder:"num"===r&&o,sorter:!0,width:120},{title:"下载时间",dataIndex:"end_at",width:170,render:function(e){return e&&h()(e).format("YYYY-MM-DD HH:mm:ss")||"-"}}]}}],w=n(89392),I=(0,m.connect)((function(e){return{classroomList:e.classroomList,globalSetting:e.globalSetting}}))((function(e){e.classroomList,e.globalSetting,e.dispatch;var t=(0,m.useParams)(),n=(0,c.useState)(d()(d()({},t),{},{page:1,limit:10})),r=s()(n,2),o=r[0],a=r[1],u=(0,c.useState)(!0),x=s()(u,2),g=x[0],h=x[1],I=(0,c.useState)("0"),Y=s()(I,2),S=Y[0],k=Y[1],j=(0,c.useState)([]),D=s()(j,2),M=D[0],N=D[1],z=function(e){return b.find((function(t){return t.type===e}))},C=(0,c.useState)(z(null==t?void 0:t.type).column(o)),K=s()(C,2),O=K[0],H=K[1],P=(0,c.useState)(z(null==t?void 0:t.type).sorter),Z=s()(P,2),T=Z[0],E=Z[1],L=(0,c.useState)(0),A=s()(L,2),F=A[0],G=A[1],J=(0,c.useState)(""),q=s()(J,2),B=q[0],Q=q[1],R={shixun:["数据统计自课程学习菜单下的实践项目(暂不支持查看学生实训报告)。","数据统计自课程实验(支持查看学生实训报告)。","的实践项目学习情况"],video:["数据统计自课程学习菜单下的视频项目。","数据统计自视频直播。","的视频学习情况"],files:["数据统计自课程学习菜单下的教学课件。","数据统计自教学资料","的教学课件学习情况"]},W=function(){var e=l()(i()().mark((function e(t){var n,r;return i()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return h(!0),e.next=3,(0,v.ZP)("/api/courses/".concat(null==t?void 0:t.coursesId,"/").concat(null==t?void 0:t.type,"_statistic_detail.json"),{params:{sort_by:null==t?void 0:t.field,sort_direction:null!=t&&t.order?null==t||null===(n=t.order)||void 0===n?void 0:n.slice(0,-3):"",page:null==t?void 0:t.page,limit:null==t?void 0:t.limit,user_id:null==t?void 0:t.listId,clazz:"0"===(null==t?void 0:t.menuKey)?"liberty":""}});case 3:null!=(r=e.sent)&&r.data&&(N((null==r?void 0:r.data)||[]),G(null==r?void 0:r.count),Q(null==r?void 0:r.user_name),h(!1));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();(0,c.useEffect)((function(){console.log(222);var e=d()(d()({menuKey:S},o),{},{page:1,limit:10},z(null==t?void 0:t.type).sorter);H(z(null==t?void 0:t.type).column(e)),a(d()(d()({},o),{},{page:1,limit:10})),W(e)}),[S]);return console.log(t,"urlParams"),(0,y.jsxs)("section",{className:p.bg,children:[(0,y.jsxs)("div",{className:p.containerTitle,children:[(0,y.jsx)("a",{href:"/classrooms/".concat(null==o?void 0:o.coursesId,"/student_statistics/").concat(null==o?void 0:o.categoryId,"?type=").concat(null==o?void 0:o.type),className:"iconfont icon-fanhui2 c-grey-333 mr10"}),(0,y.jsx)("div",{className:"font16",children:B?B+R[null==t?void 0:t.type][2]:"--"})]}),(0,y.jsx)(_.Z,{className:p.menu,mode:"horizontal",onClick:function(e){k(e.key)},selectedKeys:S,children:[{name:"自由学习",id:"0"},{name:"计划学习",id:"1"}].map((function(e,t){return(0,y.jsx)(_.Z.Item,{className:"font16",style:{padding:"0 0 12px 0 ",margin:"0 30px"},children:e.name},e.id)}))}),(0,y.jsxs)("div",{className:p.des,children:[(0,y.jsx)("i",{className:"iconfont icon-tishi4 font18 mr10 c-light-primary"}),(0,y.jsx)("span",{className:"c-light-black",children:R[null==t?void 0:t.type][String(S)]})]}),(0,y.jsx)(f.Z,{className:"table-layout bg-white mt20 mb20",columns:O,dataSource:M,rowKey:function(e){return e.id},loading:g,onChange:function(e,n,r){var i={field:r.field,order:r.order};if(!1===(null==r?void 0:r.order)&&(i={field:"",order:""}),!(0,w.isEqual)(i,T)){r.order||(i=z(null==t?void 0:t.type).sorter);var l=d()(d()({menuKey:S},o),{},{page:1,limit:10},i);return a(d()(d()({},o),{},{page:1,limit:10})),E(i),W(l),void H(z(null==t?void 0:t.type).column(l,i))}var u=d()(d()({menuKey:S},o),{},{page:e.current,limit:e.pageSize},i);a(d()(d()({},o),{},{page:e.current,limit:e.pageSize})),H(z(null==t?void 0:t.type).column(u,i)),W(u)},pagination:{pageSize:o.limit,total:F,current:o.page,showQuickJumper:!0,hideOnSinglePage:!0,position:["bottomCenter"]}})]})}))}}]);