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

1 line
15 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[87922],{90921:function(e,n,t){var s=t(82242),r=t.n(s),c=(t(59301),t(93314)),o=t(3113),i=t(37712);n.Z=function(e){var n=e.img,t=e.buttonProps,s=void 0===t?{}:t,a=e.styles,l=void 0===a?{}:a,u=e.customText,d=e.ButtonText,p=e.ButtonClick,m=e.Buttonclass,x=e.ButtonTwo,h=e.imgStyles,f=e.loading,_=void 0!==f&&f;return(0,i.jsxs)("section",{className:"tc animated fadeIn",style:r()(r()({},{color:"#999",margin:"100px auto",visibility:_?"hidden":"visible"}),l),children:[(0,i.jsx)("img",{src:n||c,style:r()(r()({},h),{},{pointerEvents:"none",userSelect:"none"})}),(0,i.jsx)("p",{className:"mt20 font14",children:u||"暂时还没有相关数据哦!"}),d&&(0,i.jsx)(o.ZP,r()(r()({className:m,onClick:p},s),{},{children:d})),x&&x]})}},90233:function(e,n,t){t.r(n),t.d(n,{default:function(){return G}});var s=t(7557),r=t.n(s),c=t(41498),o=t.n(c),i=t(82242),a=t.n(i),l=t(79800),u=t.n(l),d=t(59301),p=t(99232),m=t.n(p),x=t(56102),h=t(65233),f=t(43418),_=t(98135),g=t(8591),v=t(20834),j=t(38854),y=t(95237),w=t(43604),b=t(14491),k=t(53864),I=t(22596),Z=t(27786),N=t(43501),C=t(26795),S=t(90921),T=t(33287),P={flex_box_center:"flex_box_center___oNuKm",flex_space_between:"flex_space_between___U1Zic",flex_box_vertical_center:"flex_box_vertical_center___r26GC",flex_box_center_end:"flex_box_center_end___Zlv2y",flex_box_column:"flex_box_column___Ml9Kt",bg:"bg___WNwKr",containerTitle:"containerTitle___U8kcU",containerDesc:"containerDesc___UxxtF",listItem:"listItem___fnQZO",title:"title___USjS0",titleLeft:"titleLeft___PVbk6",titleRight:"titleRight___xjHF8",acitons:"acitons___l0Pb3",memberManager:"memberManager___ZFyEi",headWrap:"headWrap___G2Uc9",checkbox:"checkbox___SnMlz",delete:"delete___rAzmG"},F=t(71202),R=t(563),B=t(25914),L=t(37712);m().locale("zh-cn");var G=(0,h.connect)((function(e){var n=e.classroomList,t=e.loading;return{classroomList:n,globalSetting:e.globalSetting,loading:t,user:e.user}}))((function(e){e.classroomList,e.globalSetting;var n,t,s,c,i,l=e.user,p=(e.loading,e.dispatch),m=(0,d.useState)(a()(a()({},(0,h.useParams)()),{page:1,limit:20})),G=u()(m,2),D=G[0],O=G[1],z=(0,d.useState)([]),U=u()(z,2),J=U[0],M=U[1],q=(0,d.useState)({}),E=u()(q,2),K=E[0],W=E[1],H=(0,d.useRef)(),Y=(0,d.useState)(!1),V=u()(Y,2),A=V[0],Q=V[1],$=(0,d.useState)([]),X=u()($,2),ee=X[0],ne=X[1],te=(0,d.useState)(!1),se=u()(te,2),re=(se[0],se[1]),ce=(0,d.useState)([]),oe=u()(ce,2),ie=(oe[0],oe[1]);(0,d.useEffect)((function(){D.order=1,D.sort="asc",D.page=1,D.limit=20,D.course_group_id=D.categoryId,O(D),le(D),ae()}),[D.categoryId]);var ae=function(){var e=o()(r()().mark((function e(){var n,t,s;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,F.c_)({coursesId:D.coursesId});case 2:s=e.sent,M((null==s||null===(n=s.course_groups)||void 0===n?void 0:n.map((function(e){return a()(a()({},e),{show:!0})})))||[]),ie(null==s||null===(t=s.course_groups)||void 0===t?void 0:t.filter((function(e){return e.in_current_course_group})));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),le=function(){var e=o()(r()().mark((function e(n){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Q(!0),e.next=3,(0,F.Rk)(n);case 3:t=e.sent,Q(!1),W(t||{});case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),ue=function(){var e=o()(r()().mark((function e(n){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==(null==ee?void 0:ee.length)){e.next=3;break}return g.ZP.info("请选择学生"),e.abrupt("return");case 3:return e.next=5,(0,F.wR)({coursesId:D.coursesId,course_group_id:n,students:ee.map((function(e){return{course_member_id:e}}))});case 5:0===(null==(t=e.sent)?void 0:t.status)&&g.ZP.success("操作成功"),D.page=1,ne([]),O(D),le(D);case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),de=function(){var e=o()(r()().mark((function e(n,t){var s;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,F.wR)({coursesId:D.coursesId,course_group_id:n,students:[{course_member_id:t}]});case 2:0===(null==(s=e.sent)?void 0:s.status)&&g.ZP.success("操作成功"),D.page=1,ne([]),O(D),le(D);case 8:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),pe=[{name:"课堂信息",url:(0,C.NY)({url:"/api/courses/".concat(D.coursesId,"/export_couser_info.xlsx&export=true"),query:a()(a()({},D),{group_id:D.course_group_id,search:D.search?null===(n=D.search)||void 0===n?void 0:n.trim():null})})},{name:"活跃度",url:(0,C.NY)({url:"/api/courses/".concat(D.coursesId,"/export_member_act_score.xlsx&export=true"),query:a()(a()({},D),{group_id:D.course_group_id,search:D.search?null===(t=D.search)||void 0===t?void 0:t.trim():null})})},{name:"总成绩",url:(0,C.NY)({url:"/api/courses/".concat(D.coursesId,"/export_member_scores_excel.xlsx&export=true"),query:a()(a()({},D),{group_id:D.course_group_id,search:D.search?null===(s=D.search)||void 0===s?void 0:s.trim():null})})}],me=(0,L.jsxs)(v.Z,{style:{maxHeight:400,width:200,overflow:"auto",padding:10},children:[(0,L.jsx)("input",{placeholder:"搜索",className:"ant-input",onChange:function(e){var n=e.target.value;M(J.map((function(e){var t;return null!==(t=e.name)&&void 0!==t&&t.includes(n)?a()(a()({},e),{show:!0}):a()(a()({},e),{show:!1})})))},style:{width:180}}),(0,L.jsx)(v.Z.Item,{onClick:function(){return ue(0)},className:"multi-llipsis1e",children:(0,L.jsx)("span",{children:"未分班"})}),null==J||null===(c=J.filter((function(e){return e.show})))||void 0===c?void 0:c.map((function(e,n){return(0,L.jsx)(v.Z.Item,{onClick:function(){return ue(e.id)},className:"multi-llipsis1e",children:(0,L.jsx)("span",{children:e.name})})}))]}),xe=(v.Z,pe.map((function(e,n){return(0,L.jsx)(v.Z.Item,{children:(0,L.jsx)("a",{onClick:o()(r()().mark((function n(){var t;return r()().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,Z.ZP)(e.url,{method:"get"});case 2:(t=n.sent)&&-1!==(null==t?void 0:t.status)&&-2!==(null==t?void 0:t.status)&&(0,C.xg)(e.url);case 4:case"end":return n.stop()}}),n)}))),children:e.name})},e.url)})),[{title:"序号",render:function(e,n,t){return(0,L.jsx)("span",{style:{color:"#232B40"},children:D.limit*(D.page-1)+t+1})},ellipsis:!0,width:40},{title:"姓名",dataIndex:"name",width:80,ellipsis:!0,render:function(e,n){return(0,L.jsx)("a",{className:"c-blank",onClick:function(){return(0,C.xg)("/users/".concat(n.login))},children:e})}},{title:"学号",dataIndex:"student_id",width:80,ellipsis:!0,sorter:!0,showSorterTooltip:!1,render:function(e){return(0,L.jsx)("span",{style:{color:"#232B40"},children:e})}},{title:"手机号",dataIndex:"user_phone",width:80,ellipsis:!0,render:function(e){return(0,L.jsx)("span",{style:{color:"#232B40"},children:e})}},{title:"邮箱",dataIndex:"user_mail",width:80,ellipsis:!0,render:function(e){return(0,L.jsx)("span",{style:{color:"#232B40"},children:e})}},(0,T.Gg)()&&{title:"操作",align:"right",dataIndex:"name",width:((0,T.d8)()||(0,T.IR)())&&null!==(i=l.userInfo)&&void 0!==i&&i.professional_certification||(0,T.Ny)()?180:140,render:function(e,n){var t,s;return(0,L.jsxs)("div",{children:[(((0,T.d8)()||(0,T.IR)())&&(null===(t=l.userInfo)||void 0===t?void 0:t.professional_certification)&&(null===(s=l.userInfo)||void 0===s?void 0:s.school_name)===(null==n?void 0:n.school_name)||(0,T.Ny)())&&(0,L.jsx)("a",{style:{color:"#165DFF"},onClick:function(){var e;f.Z.confirm({centered:!0,width:515,icon:null,okText:"确定",cancelText:"取消",title:"提示",content:(0,L.jsxs)("div",{children:[(0,L.jsxs)("div",{style:{marginBottom:"10px"},children:["重置密码后,初始密码将设置为:",(0,L.jsx)("span",{style:{color:"#DF8323"},children:"12345678"})]}),(0,L.jsx)("div",{children:"并且该学生将会收到密码重置的消息通知,请提醒学生尽快修改密码!"})]}),onOk:(e=o()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,Z.ZP)("/api/courses/".concat(D.coursesId,"/reset_student_password.json"),{method:"post",body:{user_id:n.user_id}});case 2:0===e.sent.status&&g.ZP.success("操作成功");case 4:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},children:"重置密码"}),(0,L.jsx)(j.Z,{dropdownRender:function(){var e;return(0,L.jsxs)(v.Z,{style:{maxHeight:400,width:200,overflow:"auto",padding:10},children:[(0,L.jsx)("input",{placeholder:"搜索",className:"ant-input",onChange:function(e){var n=e.target.value;M(J.map((function(e){var t;return null!==(t=e.name)&&void 0!==t&&t.includes(n)?a()(a()({},e),{show:!0}):a()(a()({},e),{show:!1})})))},style:{width:180}}),(0,L.jsx)(v.Z.Item,{onClick:function(){return de(0,n.course_member_id)},className:"multi-llipsis1e",children:(0,L.jsx)("span",{children:"未分班"})}),null==J||null===(e=J.filter((function(e){return e.show})))||void 0===e?void 0:e.map((function(e,t){return(0,L.jsx)(v.Z.Item,{onClick:function(){return de(e.id,n.course_member_id)},className:"multi-llipsis1e",children:(0,L.jsx)("span",{children:e.name})})}))]})},className:"ml20",placement:"bottomRight",children:(0,L.jsx)("span",{className:"font14 current",style:{color:"#165DFF"},children:"移动分班"})}),(0,L.jsx)("span",{className:"".concat(P.delete," current"),style:{color:"#165DFF",marginLeft:20},onClick:function(){var e;f.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"是否确认删除",content:"是否确认将学生从课堂内删除?",onOk:(e=o()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,R.l3)({coursesId:D.coursesId,students:[{course_member_id:n.course_member_id}]});case 2:0===e.sent.status&&(g.ZP.success("删除成功"),D.page=1,ne([]),O(D),le(D),p({type:"classroomList/getClassroomTopBanner",payload:{id:D.coursesId}}));case 4:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},children:"删除"})]})}}].filter((function(e){return!!e})));return(0,L.jsxs)("section",{children:[(0,L.jsxs)("aside",{className:P.bg,children:[(0,L.jsxs)(y.Z,{className:P.headWrap,align:"middle",children:[(0,L.jsxs)(w.Z,{flex:"1",style:{display:"flex",alignItems:"center"},children:[(0,L.jsx)("span",{children:(0,L.jsx)(I.Z,{className:"font16 c-black",onClick:function(){return h.history.push("/classrooms/".concat(D.coursesId,"/course_group"))}})}),(0,L.jsx)("span",{title:K.course_group_name,className:"".concat(P.title," ml10"),children:K.course_group_name}),(0,T.GJ)()&&K.invite_code&&(0,L.jsxs)("span",{className:"ml10",children:[(0,L.jsx)("span",{className:"c-grey-999 font16",children:"邀请码:"}),(0,L.jsx)("span",{className:"c-orange font16",children:K.invite_code}),(0,L.jsx)("span",{children:(0,L.jsx)(x.CopyToClipboard,{text:K.invite_code,className:"current",onCopy:function(){return g.ZP.success("复制成功")},children:(0,L.jsx)("span",{children:(0,L.jsx)("i",{className:"iconfont icon-fuzhi font14 ml10 c-orange"})})})})]})]}),(0,L.jsx)(w.Z,{children:(0,L.jsxs)("div",{children:[(0,T.GJ)()&&0!=D.categoryId&&(0,L.jsx)("span",{className:[P.add,"font16","c-blue","ml20","current"].join(" "),onClick:function(){var e;f.Z.confirm({width:530,title:"提示",okText:"确定",cancelText:"取消",centered:!0,content:(0,L.jsxs)("div",{className:"tc font16",children:["该分班的学生将被移动到“未分班”",(0,L.jsx)("br",{}),"是否确认删除?"]}),onOk:(e=o()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,F.pv)({categoryId:D.categoryId});case 2:0===(null==(n=e.sent)?void 0:n.status)&&(g.ZP.success("删除成功"),p({type:"classroomList/getClassroomLeftMenus",payload:{id:D.coursesId}}),h.history.push("/classrooms/".concat(D.coursesId,"/course_group")));case 4:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},children:"删除分班"}),(0,T.GJ)()&&0!=D.categoryId&&(0,L.jsx)("span",{className:[P.add,"font16","c-blue","ml20","current"].join(" "),onClick:function(){var e;H.current=K.course_group_name,f.Z.confirm({width:530,title:"提示",okText:"确定",cancelText:"取消",centered:!0,content:(0,L.jsx)("div",{className:"tc font16",children:(0,L.jsx)(_.Z,{defaultValue:H.current,onChange:function(e){return H.current=e.target.value}})}),onOk:(e=o()(r()().mark((function e(){var n;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,F.$T)({categoryId:D.categoryId,name:H.current});case 2:0===(null==(n=e.sent)?void 0:n.status)&&(g.ZP.success("更新成功"),le(D));case 4:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})})},children:"分班重命名"})]})})]}),(0,L.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"0px 30px 15px"},children:[(0,L.jsxs)("div",{children:["共",(0,L.jsxs)("span",{style:{color:"#165DFF"},children:[" ",K.students_count," "]}),"个学生"]}),(0,L.jsx)("div",{children:(0,L.jsx)(B.t7,{style:{width:220},placeholder:"请输入姓名/学号搜索",value:D.search,onChange:function(e){D.search=e,D.page=1,O(D),le(D)}})})]})]}),0===K.students_count&&(0,L.jsx)(S.Z,{}),K.students_count>0&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)("aside",{className:"plr30 ".concat(P.bg," pb20"),children:[(0,T.GJ)()&&ee.length>0&&(0,L.jsxs)(y.Z,{justify:"space-between",className:P.checkbox,children:[(0,L.jsx)(w.Z,{children:(0,L.jsxs)("span",{className:"font14",children:["已选 ",(0,L.jsx)("span",{style:{color:"#165DFF"},children:ee.length})," 个"]})}),(0,L.jsxs)("div",{style:{marginLeft:"auto",cursor:"pointer",color:"#E30000"},onClick:function(){var e;0!==(null==ee?void 0:ee.length)?f.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"是否确认删除",content:"是否确认将学生从课堂内删除?",onOk:(e=o()(r()().mark((function e(){return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,R.l3)({coursesId:D.coursesId,students:ee.map((function(e){return{course_member_id:e}}))});case 2:0===e.sent.status&&(g.ZP.success("删除成功"),D.page=1,ne([]),O(D),le(D),p({type:"classroomList/getClassroomTopBanner",payload:{id:D.coursesId}}));case 4:case"end":return e.stop()}}),e)}))),function(){return e.apply(this,arguments)})}):g.ZP.info("请选择学生")},children:[(0,L.jsx)("i",{className:"iconfont icon-qingchu font14",style:{color:"#F65160",marginRight:"6px"}}),(0,L.jsx)("span",{children:"批量删除"})]}),(0,L.jsx)(w.Z,{children:(0,L.jsx)(j.Z,{dropdownRender:function(){return me},className:"ml20",placement:"bottomRight",children:(0,L.jsxs)("span",{className:"font14 current",style:{color:"#3061d0"},children:["移动到",(0,L.jsx)(N.Z,{className:"ml5"})]})})})]}),(0,L.jsx)(b.Z,{columns:xe,rowSelection:(0,T.GJ)()&&{type:"checkbox",onChange:function(e,n){ne(e)}},rowKey:function(e){return e.course_member_id},dataSource:K.students,loading:A,pagination:!1,onChange:function(e,n,t){console.log("c: ",t),"ascend"===t.order&&(D.sort="asc"),"descend"===t.order&&(D.sort="desc"),t.order||delete D.sort,O(D),le(D)}})]}),(0,L.jsx)("aside",{className:"tc mb50 mt30",children:(0,L.jsx)(k.Z,{hideOnSinglePage:!0,showSizeChanger:!1,onChange:function(e,n){D.page=e,re(!1),ne([]),O(D),le(D)},defaultCurrent:1,defaultPageSize:20,current:D.page||1,total:K.students_count})})]})]})}))}}]);