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

2 lines
15 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[7922],{6629:function(ae,k,s){var m=s(59301),W=s(93314),J=s(3113),H=Object.defineProperty,N=Object.defineProperties,_=Object.getOwnPropertyDescriptors,M=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,R=(f,o,i)=>o in f?H(f,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):f[o]=i,P=(f,o)=>{for(var i in o||(o={}))E.call(o,i)&&R(f,i,o[i]);if(M)for(var i of M(o))y.call(o,i)&&R(f,i,o[i]);return f},b=(f,o)=>N(f,_(o));const V=({img:f,buttonProps:o={},styles:i={},customText:Y,ButtonText:B,ButtonClick:Q,Buttonclass:d,ButtonTwo:g,imgStyles:D,loading:j=!1})=>m.createElement("section",{className:"tc animated fadeIn",style:P(P({},{color:"#999",margin:"100px auto",visibility:j?"hidden":"visible"}),i)},m.createElement("img",{src:f||W,style:b(P({},D),{pointerEvents:"none",userSelect:"none"})}),m.createElement("p",{className:"mt20 font14"},Y||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),B&&m.createElement(J.ZP,P({className:d,onClick:Q},o),B),g&&g);k.Z=V},49019:function(ae,k,s){s.r(k),s.d(k,{default:function(){return Ee}});var m=s(59301),W=s(99232),J=s.n(W),H=s(56102),N=s(63144),_=s(43418),M=s(98135),E=s(8591),y=s(20834),R=s(38854),P=s(95237),b=s(43604),V=s(14491),f=s(53864),o=s(22596),i=s(76265),Y=s(43501),B=s(15826),Q=s(6629),d=s(35099),g={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"},D=s(43785),j=s(91444),oe=s(73304),e=s(59301),ce=Object.defineProperty,ee=Object.getOwnPropertySymbols,ie=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable,te=(v,c,r)=>c in v?ce(v,c,{enumerable:!0,configurable:!0,writable:!0,value:r}):v[c]=r,a=(v,c)=>{for(var r in c||(c={}))ie.call(c,r)&&te(v,r,c[r]);if(ee)for(var r of ee(c))de.call(c,r)&&te(v,r,c[r]);return v},p=(v,c,r)=>new Promise((G,w)=>{var $=C=>{try{O(r.next(C))}catch(Z){w(Z)}},z=C=>{try{O(r.throw(C))}catch(Z){w(Z)}},O=C=>C.done?G(C.value):Promise.resolve(C.value).then($,z);O((r=r.apply(v,c)).next())});J().locale("zh-cn");const me=({classroomList:v,globalSetting:c,user:r,loading:G,dispatch:w})=>{var $,z,O,C,Z;const[t,I]=(0,m.useState)(a(a({},(0,N.useParams)()),{page:1,limit:20})),[S,X]=(0,m.useState)([]),[h,fe]=(0,m.useState)({}),U=(0,m.useRef)(),[pe,ue]=(0,m.useState)(!1),[A,T]=(0,m.useState)([]),[Ie,ve]=(0,m.useState)(!1),[Ae,ge]=(0,m.useState)([]);(0,m.useEffect)(()=>{t.order=1,t.sort="asc",t.page=1,t.limit=20,t.course_group_id=t.categoryId,I(t),F(t),he()},[t.categoryId]);const he=()=>p(void 0,null,function*(){var u,n;const l=yield(0,D.c_)({coursesId:t.coursesId});X(((u=l==null?void 0:l.course_groups)==null?void 0:u.map(x=>a(a({},x),{show:!0})))||[]),ge((n=l==null?void 0:l.course_groups)==null?void 0:n.filter(x=>x.in_current_course_group))}),F=u=>p(void 0,null,function*(){ue(!0);const n=yield(0,D.Rk)(u);ue(!1),fe(n||{})}),Fe=(u,n)=>{t.page=u,ve(!1),T([]),I(t),F(t)},_e=()=>{U.current=h.course_group_name,_.default.confirm({width:530,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",centered:!0,content:e.createElement("div",{className:"tc font16"},e.createElement(M.default,{defaultValue:U.current,onChange:u=>U.current=u.target.value})),onOk:()=>p(void 0,null,function*(){const u=yield(0,D.$T)({categoryId:t.categoryId,name:U.current});(u==null?void 0:u.status)===0&&(E.ZP.success("\u66F4\u65B0\u6210\u529F"),F(t))})})},Pe=()=>{var u,n;if(((n=(u=r.userInfo)==null?void 0:u.course)==null?void 0:n.course_group_id)!=0&&(0,d.dE)()){_.default.warning({title:"\u63D0\u793A",content:"\u5DF2\u52A0\u5165\u5206\u73ED\u540E\uFF0C\u65E0\u6CD5\u8C03\u6574\u5206\u73ED\uFF0C\u82E5\u9700\u8981\u66F4\u6362\u73ED\u7EA7\uFF0C\u8BF7\u8054\u7CFB\u8BFE\u5802\u8001\u5E08"});return}_.default.confirm({width:530,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",centered:!0,content:e.createElement("div",{className:"tc font16"},"\u52A0\u5165\u5206\u73ED\u540E\uFF0C\u9700\u8054\u7CFB\u8001\u5E08\u6216\u52A9\u6559\u624D\u80FD\u8C03\u6574\u5206\u73ED"),onOk:()=>p(void 0,null,function*(){const l=yield(0,D.i6)({coursesId:t.coursesId,course_group_id:t.categoryId});(l==null?void 0:l.status)===0&&(E.ZP.success("\u52A0\u5165\u6210\u529F"),F(t))})})},ye=()=>{_.default.confirm({width:530,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",centered:!0,content:e.createElement("div",{className:"tc font16"},"\u8BE5\u5206\u73ED\u7684\u5B66\u751F\u5C06\u88AB\u79FB\u52A8\u5230\u201C\u672A\u5206\u73ED\u201D",e.createElement("br",null),"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:()=>p(void 0,null,function*(){const u=yield(0,D.pv)({categoryId:t.categoryId});(u==null?void 0:u.status)===0&&(E.ZP.success("\u5220\u9664\u6210\u529F"),w({type:"classroomList/getClassroomLeftMenus",payload:{id:t.coursesId}}),N.history.push(`/classrooms/${t.coursesId}/course_group`))})})},ne=u=>p(void 0,null,function*(){if((A==null?void 0:A.length)===0){E.ZP.info("\u8BF7\u9009\u62E9\u5B66\u751F");return}const n=yield(0,D.wR)({coursesId:t.coursesId,course_group_id:u,students:A.map(l=>({course_member_id:l}))});(n==null?void 0:n.status)===0&&E.ZP.success("\u64CD\u4F5C\u6210\u529F"),t.page=1,T([]),I(t),F(t)}),le=(u,n)=>p(void 0,null,function*(){const l=yield(0,D.wR)({coursesId:t.coursesId,course_group_id:u,students:[{course_member_id:n}]});(l==null?void 0:l.status)===0&&E.ZP.success("\u64CD\u4F5C\u6210\u529F"),t.page=1,T([]),I(t),F(t)}),De=()=>{if((A==null?void 0:A.length)===0){E.ZP.info("\u8BF7\u9009\u62E9\u5B66\u751F");return}_.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u662F\u5426\u786E\u8BA4\u5220\u9664",content:"\u662F\u5426\u786E\u8BA4\u5C06\u5B66\u751F\u4ECE\u8BFE\u5802\u5185\u5220\u9664\uFF1F",onOk:()=>p(void 0,null,function*(){(yield(0,j.l3)({coursesId:t.coursesId,students:A.map(n=>({course_member_id:n}))})).status===0&&(E.ZP.success("\u5220\u9664\u6210\u529F"),t.page=1,T([]),I(t),F(t),w({type:"classroomList/getClassroomTopBanner",payload:{id:t.coursesId}}))})})},Ne=u=>{_.default.confirm({width:530,title:"\u63D0\u793A",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",centered:!0,content:e.createElement("div",{className:"tc font16"},"\u662F\u5426\u786E\u8BA4\u5220\u9664?"),onOk:()=>p(void 0,null,function*(){const n=yield(0,D.MA)({coursesId:t.coursesId,students:[{course_member_id:u}]});(n==null?void 0:n.status)===0&&(E.ZP.success("\u5220\u9664\u6210\u529F"),t.page=1,F(t))})})},Ce=[{name:"\u8BFE\u5802\u4FE1\u606F",url:(0,B.NY)({url:`/api/courses/${t.coursesId}/export_couser_info.xlsx&export=true`,query:a(a({},t),{group_id:t.course_group_id,search:t.search?($=t.search)==null?void 0:$.trim():null})})},{name:"\u6D3B\u8DC3\u5EA6",url:(0,B.NY)({url:`/api/courses/${t.coursesId}/export_member_act_score.xlsx&export=true`,query:a(a({},t),{group_id:t.course_group_id,search:t.search?(z=t.search)==null?void 0:z.trim():null})})},{name:"\u603B\u6210\u7EE9",url:(0,B.NY)({url:`/api/courses/${t.coursesId}/export_member_scores_excel.xlsx&export=true`,query:a(a({},t),{group_id:t.course_group_id,search:t.search?(O=t.search)==null?void 0:O.trim():null})})}],xe=e.createElement(y.default,{style:{maxHeight:400,width:200,overflow:"auto",padding:10}},e.createElement("input",{placeholder:"\u641C\u7D22",className:"ant-input",onChange:u=>{const n=u.target.value;X(S.map(l=>{var x;return(x=l.name)!=null&&x.includes(n)?a(a({},l),{show:!0}):a(a({},l),{show:!1})}))},style:{width:180}}),e.createElement(y.default.Item,{onClick:()=>ne(0),className:"multi-llipsis1e"},e.createElement("span",null,"\u672A\u5206\u73ED")),(C=S==null?void 0:S.filter(u=>u.show))==null?void 0:C.map(function(u,n){return e.createElement(y.default.Item,{onClick:()=>ne(u.id),className:"multi-llipsis1e"},e.createElement("span",null,u.name))})),be=e.createElement(y.default,{style:{maxHeight:400,width:240,overflow:"auto"}},Ce.map(function(u,n){return e.createElement(y.default.Item,{key:u.url},e.createElement("a",{onClick:()=>p(this,null,function*(){const l=yield(0,i.ZP)(u.url,{method:"get"});l&&(l==null?void 0:l.status)!==-1&&(l==null?void 0:l.status)!==-2&&(0,B.xg)(u.url)})},u.name))})),Be=[{title:"\u5E8F\u53F7",render:(u,n,l)=>e.createElement("span",{style:{color:"#232B40"}},t.limit*(t.page-1)+l+1),ellipsis:!0,width:40},{title:"\u59D3\u540D",dataIndex:"name",width:80,ellipsis:!0,render:(u,n)=>e.createElement("a",{className:"c-blank",onClick:()=>(0,B.xg)(`/users/${n.login}`)},u)},{title:"\u5B66\u53F7",dataIndex:"student_id",width:80,ellipsis:!0,sorter:!0,showSorterTooltip:!1,render:u=>e.createElement("span",{style:{color:"#232B40"}},u)},{title:"\u624B\u673A\u53F7",dataIndex:"user_phone",width:80,ellipsis:!0,render:u=>e.createElement("span",{style:{color:"#232B40"}},u)},{title:"\u90AE\u7BB1",dataIndex:"user_mail",width:80,ellipsis:!0,render:u=>e.createElement("span",{style:{color:"#232B40"}},u)},(0,d.Gg)()&&{title:"\u64CD\u4F5C",align:"right",dataIndex:"name",width:((0,d.d8)()||(0,d.IR)())&&((Z=r.userInfo)!=null&&Z.professional_certification)||(0,d.Ny)()?180:140,render:(u,n)=>{var l,x;return e.createElement("div",null,(((0,d.d8)()||(0,d.IR)())&&((l=r.userInfo)==null?void 0:l.professional_certification)&&((x=r.userInfo)==null?void 0:x.school_name)===(n==null?void 0:n.school_name)||(0,d.Ny)())&&e.createElement("a",{style:{color:"#165DFF"},onClick:()=>{_.default.confirm({centered:!0,width:515,icon:null,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:e.createElement("div",null,e.createElement("div",{style:{marginBottom:"10px"}},"\u91CD\u7F6E\u5BC6\u7801\u540E\uFF0C\u521D\u59CB\u5BC6\u7801\u5C06\u8BBE\u7F6E\u4E3A\uFF1A",e.createElement("span",{style:{color:"#DF8323"}},"12345678")),e.createElement("div",null,"\u5E76\u4E14\u8BE5\u5B66\u751F\u5C06\u4F1A\u6536\u5230\u5BC6\u7801\u91CD\u7F6E\u7684\u6D88\u606F\u901A\u77E5\uFF0C\u8BF7\u63D0\u9192\u5B66\u751F\u5C3D\u5FEB\u4FEE\u6539\u5BC6\u7801!")),onOk:()=>p(void 0,null,function*(){(yield(0,i.ZP)(`/api/courses/${t.coursesId}/reset_student_password.json`,{method:"post",body:{user_id:n.user_id}})).status===0&&E.ZP.success("\u64CD\u4F5C\u6210\u529F")})})}},"\u91CD\u7F6E\u5BC6\u7801"),e.createElement(R.Z,{dropdownRender:()=>{var K;return e.createElement(y.default,{style:{maxHeight:400,width:200,overflow:"auto",padding:10}},e.createElement("input",{placeholder:"\u641C\u7D22",className:"ant-input",onChange:L=>{const se=L.target.value;X(S.map(q=>{var re;return(re=q.name)!=null&&re.includes(se)?a(a({},q),{show:!0}):a(a({},q),{show:!1})}))},style:{width:180}}),e.createElement(y.default.Item,{onClick:()=>le(0,n.course_member_id),className:"multi-llipsis1e"},e.createElement("span",null,"\u672A\u5206\u73ED")),(K=S==null?void 0:S.filter(L=>L.show))==null?void 0:K.map(function(L,se){return e.createElement(y.default.Item,{onClick:()=>le(L.id,n.course_member_id),className:"multi-llipsis1e"},e.createElement("span",null,L.name))}))},className:"ml20",placement:"bottomRight"},e.createElement("span",{className:"font14 current",style:{color:"#165DFF"}},"\u79FB\u52A8\u5206\u73ED")),e.createElement("span",{className:`${g.delete} current`,style:{color:"#165DFF",marginLeft:20},onClick:()=>{_.default.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u662F\u5426\u786E\u8BA4\u5220\u9664",content:"\u662F\u5426\u786E\u8BA4\u5C06\u5B66\u751F\u4ECE\u8BFE\u5802\u5185\u5220\u9664\uFF1F",onOk:()=>p(void 0,null,function*(){(yield(0,j.l3)({coursesId:t.coursesId,students:[{course_member_id:n.course_member_id}]})).status===0&&(E.ZP.success("\u5220\u9664\u6210\u529F"),t.page=1,T([]),I(t),F(t),w({type:"classroomList/getClassroomTopBanner",payload:{id:t.coursesId}}))})})}},"\u5220\u9664"))}}].filter(u=>!!u),we=["\u5BFC\u5165\u521B\u5EFA\u5206\u73ED","\u65B0\u5EFA\u5206\u73ED"];return e.createElement("section",null,e.createElement("aside",{className:g.bg},e.createElement(P.Z,{className:g.headWrap,align:"middle"},e.createElement(b.Z,{flex:"1",style:{display:"flex",alignItems:"center"}},e.createElement("span",null,e.createElement(o.Z,{className:"font16 c-black",onClick:()=>N.history.push(`/classrooms/${t.coursesId}/course_group`)})),e.createElement("span",{title:h.course_group_name,className:`${g.title} ml10`},h.course_group_name),(0,d.GJ)()&&h.invite_code&&e.createElement("span",{className:"ml10"},e.createElement("span",{className:"c-grey-999 font16"},"\u9080\u8BF7\u7801\uFF1A"),e.createElement("span",{className:"c-orange font16"},h.invite_code),e.createElement("span",null,e.createElement(H.CopyToClipboard,{text:h.invite_code,className:"current",onCopy:()=>E.ZP.success("\u590D\u5236\u6210\u529F")},e.createElement("span",null,e.createElement("i",{className:"iconfont icon-fuzhi font14 ml10 c-orange"})))))),e.createElement(b.Z,null,e.createElement("div",null,(0,d.GJ)()&&t.categoryId!=0&&e.createElement("span",{className:[g.add,"font16","c-blue","ml20","current"].join(" "),onClick:ye},"\u5220\u9664\u5206\u73ED"),(0,d.GJ)()&&t.categoryId!=0&&e.createElement("span",{className:[g.add,"font16","c-blue","ml20","current"].join(" "),onClick:_e},"\u5206\u73ED\u91CD\u547D\u540D")))),e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"0px 30px 15px"}},e.createElement("div",null,"\u5171",e.createElement("span",{style:{color:"#165DFF"}},"\xA0",h.students_count,"\xA0"),"\u4E2A\u5B66\u751F"),e.createElement("div",null,e.createElement(oe.t7,{style:{width:220},placeholder:"\u8BF7\u8F93\u5165\u59D3\u540D/\u5B66\u53F7\u641C\u7D22",value:t.search,onChange:u=>{t.search=u,t.page=1,I(t),F(t)}})))),h.students_count===0&&e.createElement(Q.Z,null),h.students_count>0&&e.createElement(e.Fragment,null,e.createElement("aside",{className:`plr30 ${g.bg} pb20`},(0,d.GJ)()&&A.length>0&&e.createElement(P.Z,{justify:"space-between",className:g.checkbox},e.createElement(b.Z,null,e.createElement("span",{className:"font14"},"\u5DF2\u9009 ",e.createElement("span",{style:{color:"#165DFF"}},A.length)," \u4E2A")),e.createElement("div",{style:{marginLeft:"auto",cursor:"pointer",color:"#E30000"},onClick:()=>{De()}},e.createElement("i",{className:"iconfont icon-qingchu font14",style:{color:"#F65160",marginRight:"6px"}}),e.createElement("span",null,"\u6279\u91CF\u5220\u9664")),e.createElement(b.Z,null,e.createElement(R.Z,{dropdownRender:()=>xe,className:"ml20",placement:"bottomRight"},e.createElement("span",{className:"font14 current",style:{color:"#3061d0"}},"\u79FB\u52A8\u5230",e.createElement(Y.Z,{className:"ml5"}))))),e.createElement(V.default,{columns:Be,rowSelection:(0,d.GJ)()&&{type:"checkbox",onChange:(u,n)=>{T(u)}},rowKey:u=>u.course_member_id,dataSource:h.students,loading:pe,pagination:!1,onChange:(u,n,l)=>{console.log("c: ",l),l.order==="ascend"&&(t.sort="asc"),l.order==="descend"&&(t.sort="desc"),l.order||delete t.sort,I(t),F(t)}})),e.createElement("aside",{className:"tc mb50 mt30"},e.createElement(f.Z,{hideOnSinglePage:!0,showSizeChanger:!1,onChange:Fe,defaultCurrent:1,defaultPageSize:20,current:t.page||1,total:h.students_count}))))};var Ee=(0,N.connect)(({classroomList:v,loading:c,globalSetting:r,user:G})=>({classroomList:v,globalSetting:r,loading:c,user:G}))(me)}}]);