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.
1 line
46 KiB
1 line
46 KiB
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[13355],{6309:function(e,t,n){n.d(t,{Z:function(){return w}});n(7557),n(41498);var s=n(82100),a=n.n(s),o=n(29186),i=n.n(o),l=n(13720),r=n.n(l),c=n(80619),u=n.n(c),d=n(47074),p=n.n(d),m=n(85573),h=n.n(m),f=n(59301),x=n(8591),g=n(98135),_="codeBox___WpkVl",y=n(92310),v=n.n(y),b=n(37712),j=function(e){u()(n,e);var t=p()(n);function n(e){var s;return a()(this,n),s=t.call(this,e),h()(r()(s),"canvas",void 0),h()(r()(s),"randomNum",(function(e,t){return Math.floor(Math.random()*(t-e)+e)})),h()(r()(s),"drawPic",(function(){s.randomCode()})),h()(r()(s),"reloadPic",(function(){s.drawPic()})),h()(r()(s),"changeCode",(function(e){console.log(e.target.value,222),s.setState({value:e.target.value,showError:!1})})),h()(r()(s),"onVerify",(function(){var e;return""!==s.state.value.toLowerCase()&&s.state.value.toLowerCase()!==s.state.code.toLowerCase()?(e=!0,x.ZP.error("请输入正确的验证码"),s.reloadPic()):""===s.state.value.toLowerCase()?(e=!0,x.ZP.error("请输入验证码")):s.state.value.toLowerCase()===s.state.code.toLowerCase()&&(e=!1),s.setState({showError:e}),e})),s.canvas=f.createRef(),s.state={value:"",code:"",codeLength:4,fontSizeMin:20,fontSizeMax:22,backgroundColorMin:240,backgroundColorMax:250,colorMin:10,colorMax:20,lineColorMin:40,lineColorMax:180,contentWidth:96,contentHeight:38,showError:!1},s}return i()(n,[{key:"componentDidMount",value:function(){this.drawPic()}},{key:"randomColor",value:function(e,t){var n=this.randomNum(e,t),s=this.randomNum(e,t),a=this.randomNum(e,t);return"rgb(".concat(n,", ").concat(s,", ").concat(a,")")}},{key:"drawText",value:function(e,t,n){e.fillStyle=this.randomColor(this.state.colorMin,this.state.colorMax);var s=this.randomNum(this.state.fontSizeMin,this.state.fontSizeMax);e.font=s+"px SimHei";var a=(this.state.contentWidth-40)/(this.state.code.length-1),o=10;n>0&&(o=10+n*a);var i=this.randomNum(this.state.fontSizeMax,this.state.contentHeight-5);s>40&&(i=40);var l=this.randomNum(-10,10);e.translate(o,i),e.rotate(l*Math.PI/180),e.fillText(t,0,0),e.rotate(-l*Math.PI/180),e.translate(-o,-i)}},{key:"drawLine",value:function(e){for(var t=0;t<1;t++)e.strokeStyle=this.randomColor(this.state.lineColorMin,this.state.lineColorMax),e.beginPath(),e.moveTo(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight)),e.lineTo(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight)),e.stroke()}},{key:"drawDot",value:function(e){for(var t=0;t<100;t++)e.fillStyle=this.randomColor(0,255),e.beginPath(),e.arc(this.randomNum(0,this.state.contentWidth),this.randomNum(0,this.state.contentHeight),1,0,2*Math.PI),e.fill()}},{key:"randomCode",value:function(){for(var e=this,t="",n=0;n<this.state.codeLength;n++){t+="QWERTYUPLKJHGFDSAZXCVBNMqwertyupkjhgfdsazxcvbnm1234567890"[Math.floor(57*Math.random())]}this.setState({code:t},(function(){var t=e.canvas.current.getContext("2d");t.textBaseline="bottom",t.fillStyle=e.randomColor(e.state.backgroundColorMin,e.state.backgroundColorMax),t.fillRect(0,0,e.state.contentWidth,e.state.contentHeight);for(var n=0;n<e.state.code.length;n++)e.drawText(t,e.state.code[n],n);e.drawLine(t),e.drawDot(t)}))}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.width,s=void 0===n?300:n;return(0,b.jsxs)("div",{className:v()(_,t),style:{width:s},children:[(0,b.jsx)("aside",{children:(0,b.jsx)(g.Z,{value:this.state.value,onChange:this.changeCode,placeholder:"请输入图片中的验证码"})}),(0,b.jsxs)("div",{children:[(0,b.jsx)("canvas",{onClick:this.reloadPic,ref:this.canvas,width:"100",height:"30"}),(0,b.jsx)("div",{className:"current",onClick:this.reloadPic,children:"看不清?换一张"})]})]})}}]),n}(f.Component),w=j},7406:function(e,t,n){var s=n(82242),a=n.n(s),o=(n(59301),n(93314)),i=n(3113),l=n(37712);t.Z=function(e){var t=e.img,n=e.buttonProps,s=void 0===n?{}:n,r=e.styles,c=void 0===r?{}:r,u=e.customText,d=e.ButtonText,p=e.ButtonClick,m=e.Buttonclass,h=e.ButtonTwo,f=e.imgStyles,x=e.loading,g=void 0!==x&&x;return(0,l.jsxs)("section",{className:"tc animated fadeIn",style:a()(a()({},{color:"#999",margin:"100px auto",visibility:g?"hidden":"visible"}),c),children:[(0,l.jsx)("img",{src:t||o,style:a()(a()({},f),{},{pointerEvents:"none",userSelect:"none"})}),(0,l.jsx)("p",{className:"mt20 font14",children:u||"暂时还没有相关数据哦!"}),d&&(0,l.jsx)(i.ZP,a()(a()({className:m,onClick:p},s),{},{children:d})),h&&h]})}},82322:function(e,t,n){n.d(t,{Z:function(){return y}});var s=n(7557),a=n.n(s),o=n(41498),i=n.n(o),l=n(79800),r=n.n(l),c=n(59301),u=n(98135),d=n(24905),p=n(95237),m="leftdiv___iuhY9",h="listClass___o5N53",f="spantitle___KVMSL",x="rightdiv___f2zZr",g=n(7406),_=n(37712),y=function(e){var t=e.data,n=(e.value,e.handleChangePage,e.setSelectedRowKeys),s=e.selectedRowKeys,o=(e.onChange,(0,c.useState)([])),l=r()(o,2),y=l[0],v=l[1],b=(0,c.useState)([]),j=r()(b,2),w=j[0],k=j[1],C=(0,c.useState)([]),A=r()(C,2),S=A[0],Z=A[1],T=(0,c.useState)(1),N=r()(T,2),L=(N[0],N[1],(0,c.useState)()),M=r()(L,2);M[0],M[1];return(0,c.useEffect)((function(){v(t),k([]),Z([])}),[t]),(0,c.useEffect)((function(){n&&(k(s),Z(s))}),[s]),(0,_.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,_.jsxs)("div",{className:m,children:[(0,_.jsx)(u.Z.Search,{size:"middle",onChange:function(){var e=i()(a()().mark((function e(n){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:v(t.filter((function(e){var t;return null==e||null===(t=e.name)||void 0===t?void 0:t.includes(n.target.value)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),placeholder:"可输入班级名称查询"}),0===y.length&&(0,_.jsx)(g.Z,{styles:{margin:"70px auto"},customText:"暂无分班"}),(0,_.jsx)("div",{style:{height:"85%",overflow:"auto",overflowX:"hidden"},children:(0,_.jsx)(d.Z.Group,{value:w.map((function(e){return"".concat(e.course_group_id)})),onChange:function(e){n(y.filter((function(t){return e.includes("".concat(t.course_group_id))})))},style:{marginTop:"10px",flexDirection:"column"},children:y.map((function(e,t){return(0,_.jsx)(p.Z,{style:{marginTop:"10px",lineHeight:"24px",display:"flex",width:200},children:(0,_.jsx)(d.Z,{style:{display:"flex",height:"24px",alignItems:"center"},disabled:e.is_published,value:"".concat(e.course_group_id),children:(0,_.jsxs)("div",{className:h,children:[(0,_.jsx)("span",{className:f,style:{width:e.is_published?"108px":"170px"},children:e.name}),e.is_published&&(0,_.jsx)("span",{style:{width:"52px",height:"24px",background:"#B8B8B8",borderRadius:"13px",color:"white",lineHeight:"24px",textAlign:"center",display:"inline-block"},children:"已发布"})]})})},e.course_group_id)}))})})]}),(0,_.jsxs)("div",{className:x,children:[(0,_.jsx)(u.Z.Search,{onChange:function(e){Z(w.filter((function(t){return t.name.includes(e.target.value)})))},size:"middle",placeholder:"可输入班级名称查询"}),0===S.length&&(0,_.jsx)(g.Z,{styles:{margin:"70px auto"},customText:"暂未选择分班"}),S.length>0&&(0,_.jsx)("div",{style:{marginTop:"10px",height:"85%",overflow:"hidden",position:"relative"},children:(0,_.jsx)("div",{style:{overflowX:"hidden",overflowY:"scroll",position:"absolute",left:0,top:0,right:-17,bottom:0},children:S.map((function(e,t){return(0,_.jsxs)(p.Z,{justify:"space-between",style:{marginTop:"10px"},children:[(0,_.jsx)("div",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:"5px",marginLeft:"5px",width:"75%"},children:e.name}),(0,_.jsx)("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAbVJREFUOE+Nk79rFUEUhb+zE4OFwUD+CyGKKQQbSaMikQQ7C1tBBIsUQaJvl2Fn/cWDpAiIYJsi7YOIaCUWFoKKRhG0sbEzEImFGnev7G6yyXsxeU5159yZb87l3hG9q2WLiBO79FIwXpLp0s6cwITnQCMWrGDM43jdBckZQ0wTMdrong2R2Bxm0/98sZ8ozdcOEm5hjOC41u9Olc9ZQKySclOVkNhljCmCzjeAJM/4FbW5p+8k5tlggTtarfKxLSM6pHq4BTiL0SboaAOIi284jeP1nti+ApMEvdoEvEPMkOpJDZi1IwzwgqDh/wSsYZwk08ca4O0Qua3zW8OV5crmHg6u22EGbQ2nIbx+1IC6rrK+cYJW9gXEVrbxGUEj5bltQGJvgBapHu0LSGwCyEh1vBsQWwd4TNCDPg6uAOcImuoFlL1dJ9WNPg5uYwwRVM3MzhJmKIpjZK6e9bj4jNNpvL4QFx9wuoDXJ1r5IlH0llTtXgcXwa4SolObnYnwKnbFcfEcdJ+gpW6AtzFynuIop/Fn053u4CA5yzjO4FV9tu0Syl2S38WiSWBgD8AfoEPQ7Fb+LwIiyhxWwe2KAAAAAElFTkSuQmCC",style:{cursor:"pointer",height:"16px",marginRight:17},onClick:function(){n(w.filter((function(t){return"".concat(t.course_group_name)!="".concat(e.course_group_name)})))}})]},e.course_group_id)}))})})]})]})}},72734:function(e,t,n){n.r(t),n.d(t,{default:function(){return _e}});var s=n(7557),a=n.n(s),o=n(37205),i=n.n(o),l=n(41498),r=n.n(l),c=n(82242),u=n.n(c),d=n(79800),p=n.n(d),m=n(59301),h=n(7880),f=n(20834),x=n(44e3),g=n(8591),_=n(56511),y=n(53864),v=n(81228),b=n(51136),j=n(6457),w=n(89918),k=n(7406),C=n(85573),A=n.n(C),S=n(99313),Z=n(78241),T=n(43418),N=n(95237),L=n(43604),M=n(3113),P=n(98135),Y=n(24905),H=n(6848),I=n(26724),D=n.n(I),E={flex_box_center:"flex_box_center___xf8nE",flex_space_between:"flex_space_between___qjDg3",flex_box_vertical_center:"flex_box_vertical_center___C1nIS",flex_box_center_end:"flex_box_center_end___YxLae",flex_box_column:"flex_box_column___pkfqV",line1:"line1___UdRSL",form:"form___oBQlS"},B=n(37712),F=(S.Z.TabPane,(0,h.connect)((function(e){return{polls:e.polls,loading:e.loading}}))((function(e){var t,n=e.polls,s=(e.loading,e.dispatch),o=(0,h.useParams)(),l=((0,h.useLocation)(),Z.Z.useForm()),c=p()(l,1)[0],d=(n.brankList,(0,m.useState)(!0)),f=p()(d,2),x=f[0],g=f[1],_=(0,m.useState)("myself"),y=p()(_,2),v=y[0],b=y[1],C=(0,m.useState)([]),S=p()(C,2),I=S[0],F=S[1],O=(0,m.useState)(!1),R=p()(O,2),G=R[0],J=R[1],Q=(0,m.useState)(),W=p()(Q,2),z=W[0],K=W[1],V=(0,m.useState)({page:0,limit:20,object_type:"poll",search:"",filter:"myself"}),U=p()(V,2),X=U[0];U[1];(0,m.useEffect)((function(){"问卷选用"===n.actionTabs.key&&$()}),[n.actionTabs.key]);var q=[],$=function(){var e=r()(a()().mark((function e(){var t,n;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!x){e.next=13;break}return J(!1),++X.page,g(!1),e.next=6,s({type:"polls/getBrankList",payload:u()({},X)});case 6:n=e.sent,I=i()(I.concat(n.object_list)),K(n.is_teacher),(null===(t=n.object_list)||void 0===t?void 0:t.length)<X.limit?g(!1):g(!0),F(i()(I)),""==n.object_list&&1===X.page&&J(!0);case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,B.jsxs)(T.Z,{centered:!0,title:"问卷选用",open:"问卷选用"===n.actionTabs.key,okText:"确定",cancelText:"取消",width:800,bodyStyle:{minHeight:200},onOk:r()(a()().mark((function e(){var t,i;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=c.getFieldValue(),e.next=3,s({type:"polls/saveBanks",payload:{course_id:o.coursesId,object_type:"poll",bank_id:t.group_ids}});case 3:0===(null==(i=e.sent)?void 0:i.status)&&((0,j.L9)(["教学课堂","问卷","问卷选用"]),s({type:"classroomList/getClassroomPollsList",payload:u()({},n.actionTabs.params)}),s({type:"polls/setActionTabs",payload:{key:"问卷发布",selectArrs:i.object_ids}}),s({type:"classroomList/getClassroomLeftMenus",payload:{id:o.coursesId}}));case 5:case"end":return e.stop()}}),e)}))),onCancel:function(){s({type:"polls/setActionTabs",payload:{}})},children:[(0,B.jsxs)(N.Z,{children:[(0,B.jsx)(L.Z,{span:12,children:[{name:"我的资源",id:"myself"},{name:"公共资源",id:"public"}].map((function(e,t){return(0,B.jsx)(M.ZP,{shape:"round",type:v===e.id?"primary":"default",className:"mr10",onClick:function(){var t=r()(a()().mark((function t(n){return a()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:I=[],x=!0,X.page=0,X.search="",X.filter=e.id,$(),b(e.id);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),children:e.name},t)}))}),(0,B.jsx)(L.Z,{span:12,className:"tr",children:(0,B.jsx)(P.Z.Search,{placeholder:"输入标题、适用课程进行搜索",onSearch:function(e){x=!0,X.search=e,X.page=0,I=[],$()},style:{width:260}})})]}),"myself"===v&&(0,B.jsxs)("p",{className:"tc mt10",children:["选用对象:你在课堂问卷列表中已",(0,B.jsx)("span",{className:"c-orange",children:"收藏"}),"的问卷"]}),"public"===v&&(0,B.jsx)("p",{className:"tc mt10",children:"选用对象:题库中已设置成公共属性的所有问卷"}),(0,B.jsxs)("div",{style:{background:"#F4FAFF",maxHeight:200,overflow:"auto",marginTop:20,padding:"20px 10px"},children:[!z&&"public"===v&&(0,B.jsxs)("div",{style:{display:"flex",flexDirection:"column",paddingTop:"30px",alignItems:"center",justifyContent:"center"},children:[(0,B.jsx)("span",{children:"通过职业认证的教师才能访问公共题库"}),(0,B.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,B.jsx)(D(),{initialLoad:!1,pageStart:0,loadMore:function(){$()},hasMore:x,useWindow:!1,children:(0,B.jsxs)(Z.Z,{form:c,initialValues:A()({},"group_ids",q),className:E.form,onChange:function(e){var t=c.getFieldValue();q=t},children:[G&&(0,B.jsx)(k.Z,{styles:{margin:"0px auto"}}),(0,B.jsx)(Z.Z.Item,{name:"group_ids",children:(0,B.jsx)(Y.Z.Group,{style:{width:"100%",display:"block"},children:null===(t=I)||void 0===t?void 0:t.map((function(e,t){return(0,B.jsxs)(N.Z,{children:[(0,B.jsx)(L.Z,{flex:"2",children:(0,B.jsx)(Y.Z,{onChange:function(e){},value:String(null==e?void 0:e.id),defaultChecked:!0,children:(0,B.jsx)(H.Z,{title:null==e?void 0:e.name,children:(0,B.jsx)("span",{className:["c-black",E.line1].join(" "),children:null==e?void 0:e.name})})},t)}),(0,B.jsx)(L.Z,{flex:"1",className:"c-black",children:(0,B.jsx)(H.Z,{title:null==e?void 0:e.course_list_name,children:(0,B.jsx)("span",{className:E.line1,children:null==e?void 0:e.course_list_name})})}),(0,B.jsx)(L.Z,{flex:"50px",className:"c-black",children:"myself"===v?(0,B.jsx)(h.Link,{target:"_blank",to:"/users/".concat(e.username,"/topics/").concat(e.id,"/personal/poll/edit"),className:"c-blue current",children:"编辑"}):(0,w.j5)()?(0,B.jsx)(h.Link,{target:"_blank",to:"/users/".concat(e.username,"/topics/").concat(e.id,"/publicly/poll/edit"),className:"c-blue current",children:"编辑"}):null==e?void 0:e.username})]},t)}))})})]})})]})]})}))),O=n(39647),R=n.n(O),G=n(84291),J=n(5112),Q=n(99232),W=n.n(Q),z=n(15766),K=n(47762),V=n(69363),U=["classroomList","polls","dispatch","courseEndTime"],X=(0,h.connect)((function(e){return{classroomList:e.classroomList,polls:e.polls}}))((function(e){var t=e.classroomList,n=e.polls,s=e.dispatch,o=e.courseEndTime,l=(R()(e,U),(0,h.useParams)()),c=Z.Z.useForm(),d=p()(c,1)[0],f=(0,m.useState)(1),x=p()(f,2),_=x[0],y=x[1],v=(0,m.useState)([]),k=p()(v,2),C=k[0],S=k[1],M=(0,m.useState)(0),P=p()(M,2),H=(P[0],P[1]),I=(0,m.useState)(2e3),D=p()(I,2),E=(D[0],D[1],(0,m.useState)(!0)),F=p()(E,2),O=(F[0],F[1]),Q=(0,m.useState)(!1),X=p()(Q,2),q=X[0],$=(X[1],(0,m.useState)(!1)),ee=p()($,2),te=ee[0],ne=(ee[1],(0,m.useState)([])),se=p()(ne,2),ae=se[0],oe=se[1],ie=(0,m.useState)(!0),le=p()(ie,2),re=le[0],ce=le[1];(0,m.useEffect)((function(){"立即发布"===n.actionTabs.key&&(ue(),pe())}),[n.actionTabs]),(0,m.useEffect)((function(){if(q){if(te)return;s({type:"polls/setActionTabs",payload:{}})}}),[q]);var ue=function(){var e=r()(a()().mark((function e(t){var s,o,r;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return O(!0),e.next=3,(0,V.Cq)(u()(u()({},l),{},{page:t||_,limit:2e4,poll_id:1==(null==n||null===(s=n.actionTabs)||void 0===s||null===(s=s.selectArrs)||void 0===s?void 0:s.length)?null==n||null===(o=n.actionTabs)||void 0===o||null===(o=o.selectArrs)||void 0===o?void 0:o[0]:""}));case 3:null==(r=e.sent)||r.course_groups.map((function(e,t){e.key=e.id,e.title=e.name,e.disabled=e.is_published})),r&&(S(i()(null==r?void 0:r.course_groups)),H(null==r?void 0:r.course_groups_count),O(!1),t||d.setFieldsValue(A()(A()({},"publish_time",W()(W()(new Date).add(0,"days").format("YYYY-MM-DD HH:mm"))),"end_time",W()(W()(new Date((0,j.qd)("/"))).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)}}(),de=function(){var e=r()(a()().mark((function e(){var o,r,c,p,m;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(0,w.Rm)()||null!=t&&null!==(o=t.AssistantObject)&&void 0!==o&&null!==(o=o.group)&&void 0!==o&&o.can_publish){e.next=4;break}return g.ZP.warning("您未获取此权限,需向管理员申请权限才能使用此功能"),xe(!1),e.abrupt("return");case 4:if(!((p=u()({},d.getFieldsValue())).end_time<=p.publish_time)){e.next=9;break}return g.ZP.info("截止时间不能大于或等于发布时间"),xe(!1),e.abrupt("return");case 9:if(!((null==ae?void 0:ae.length)<=0&&!re&&C.length>0)){e.next=13;break}return g.ZP.info("发布班级不能为空"),xe(!1),e.abrupt("return");case 13:return m={check_ids:i()(null===(r=n.actionTabs.selectArrs)||void 0===r?void 0:r.map((function(e){return Number(e)}))),group_ids:ae.length>0?ae.map((function(e){return e.id})):null===(c=t.detailCommonHomeworksList)||void 0===c?void 0:c.course_groups,end_time:W()(p.end_time).format("YYYY-MM-DD HH:mm"),publish_time:W()(p.publish_time).format("YYYY-MM-DD HH:mm")},xe(!0),e.next=17,(0,b.ZP)("/api/courses/".concat(l.coursesId,"/polls/publish.json"),{method:"post",body:u()({},m)});case 17:0===e.sent.status?(xe(!1),(0,j.L9)(["教学课堂","问卷","立即发布"]),pe(),g.ZP.success("发布成功"),s({type:"polls/setActionTabs",payload:{}}),2===n.actionTabs.types?s({type:"polls/getCommonHeader",payload:u()({},n.actionTabs.params)}):s({type:"classroomList/getClassroomPollsList",payload:u()({},n.actionTabs.params)})):xe(!1);case 19:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),pe=function(){y(1),S([]),oe([])},me=(0,m.useState)(!1),he=p()(me,2),fe=he[0],xe=he[1];return(0,B.jsxs)(T.Z,{width:600,confirmLoading:fe,centered:!0,title:"发布问卷",open:"立即发布"===n.actionTabs.key,okText:"发布问卷",cancelText:"暂不发布",onOk:de,onCancel:function(){pe(),s({type:"polls/setActionTabs",payload:{}})},children:[(0,B.jsxs)("p",{className:"tc",children:["学生将立即收到问卷",(0,B.jsx)("br",{}),'本操作只对"未发布"的问卷有效']}),C&&(0,B.jsxs)(Z.Z,{form:d,children:[(0,B.jsxs)("div",{style:{paddingLeft:0},children:[(0,B.jsxs)(N.Z,{className:"mt30",align:"middle",children:[(0,B.jsx)(L.Z,{children:(0,B.jsx)(Z.Z.Item,{name:"publish_time",label:"发布时间",children:(0,B.jsx)(G.default,{style:{width:170,marginRight:"25px"},disabledDate:function(e){return(0,K.Q8)(e,o)},disabledTime:function(e){return(0,K.d0)(e)},placeholder:"请选择发布时间",showTime:{format:"HH:mm",defaultValue:W()((0,j.U6)(),"HH:mm")},format:"YYYY-MM-DD HH:mm",allowClear:!1})})}),(0,B.jsx)(L.Z,{className:"ml20",children:(0,B.jsx)(Z.Z.Item,{name:"end_time",label:"截止时间",children:(0,B.jsx)(G.default,{style:{width:170},placeholder:"请选择结束时间",showTime:{format:"HH:mm",defaultValue:W()((0,j.U6)(),"HH:mm")},disabledDate:function(e){return(0,K.Q8)(e,o,d.getFieldValue("publish_time"))},disabledTime:function(e){return(0,K.d0)(e,d.getFieldValue("publish_time"))},format:"YYYY-MM-DD HH:mm",allowClear:!1})})})]}),(0,B.jsxs)(N.Z,{style:{marginBottom:"10px"},children:[(0,B.jsx)("span",{className:"mr5",children:"发布设置:"}),(0,B.jsxs)(J.ZP.Group,{value:re,onChange:function(e){ce(e.target.value),oe([])},children:[(0,B.jsx)(J.ZP,{value:!0,disabled:!n.actionTabs.manage_all_group,children:"统一发布"}),(0,B.jsx)(J.ZP,{className:"ml20",disabled:C.length<=0,value:!1,children:"分班发布"})]})]}),C.length<=0&&(0,B.jsx)("span",{style:{marginLeft:"65px",color:"rgba(0, 0, 0, 0.25)"},children:'课堂无分班,仅支持选择“统一发布"'})]}),!re&&C.length>0&&(0,B.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"10px"},children:[(0,B.jsx)("span",{style:{flex:1},children:(0,B.jsx)(Y.Z,{checked:ae.length===C.length,onChange:function(e){ae.length===C.length?oe([]):oe(C.filter((function(e){return!e.is_published})))},children:"全选"})}),(0,B.jsx)("span",{style:{width:16}}),(0,B.jsxs)("span",{style:{flex:1},children:["已选择",ae.length||0,"个分班"]})]}),!re&&C.length>0&&(0,B.jsx)(z.Z,{data:C,selectedRowKeys:ae,setSelectedRowKeys:oe})]})]})})),q=n(6309),$=["polls","dispatch","user"],ee=(0,h.connect)((function(e){return{polls:e.polls,user:e.user}}))((function(e){var t=e.polls,n=e.dispatch,s=e.user,o=(R()(e,$),(0,h.useParams)()),l=(0,m.useState)(!1),c=p()(l,2),d=c[0],f=c[1],x=(0,m.useState)(!1),_=p()(x,2),y=_[0],v=_[1],k=(0,m.useRef)(null);(0,m.useEffect)((function(){if("删除"===t.actionTabs.key){if((0,w.j5)())return void f(!0);var e={hasNum:0,noHasNum:0};t.actionTabs.selectArrsAll.map((function(t){var n;t.author_login===(null===(n=s.userInfo)||void 0===n?void 0:n.login)?++e.hasNum:++e.noHasNum})),e.noHasNum>0?T.Z.info({title:"权限提示",className:"custom-modal-divider ",icon:null,content:(0,B.jsxs)("div",{children:["当前选中资源中:",(0,B.jsx)("span",{className:"c-blue",children:e.hasNum}),"个由您本人发布,",(0,B.jsx)("span",{className:"c-red",children:e.noHasNum})," 个由其他老师发布。",(0,B.jsx)("br",{}),"课堂内只能删除本人发布的资源,请取消选中其他老师发布的资源。"]}),onOk:function(){C()}}):f(!0)}else f(!1)}),[t.actionTabs.key]);var C=function(){n({type:"polls/setActionTabs",payload:{}})};return(0,B.jsxs)(T.Z,{centered:!0,title:"提示",open:d,okText:"确定",cancelText:"取消",confirmLoading:y,destroyOnClose:!0,onOk:r()(a()().mark((function e(){var s,l;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===(s=k.current)||void 0===s||!s.onVerify()){e.next=2;break}return e.abrupt("return");case 2:return v(!0),e.next=5,(0,b.ZP)("/api/courses/".concat(o.coursesId,"/polls/destroys.json"),{method:"post",body:{check_ids:i()(t.actionTabs.selectArrs)}});case 5:l=e.sent,v(!1),0===l.status&&((0,j.L9)(["教学课堂","问卷","删除"]),g.ZP.success("删除成功"),n({type:"polls/setActionTabs",payload:{}}),n({type:"classroomList/getClassroomPollsList",payload:u()({},t.actionTabs.params)}),n({type:"classroomList/getClassroomLeftMenus",payload:{id:o.coursesId}}));case 8:case"end":return e.stop()}}),e)}))),onCancel:function(){n({type:"polls/setActionTabs",payload:{}})},children:[(0,B.jsx)("p",{style:{color:"#DD0000"},children:"删除问卷则会清除学生所有的答题数据,且数据不可恢复,如确定删除,请输入下方验证码"}),(0,B.jsx)(q.Z,{ref:function(e){return k.current=e}})]})})),te=n(71418),ne=n(82322);function se(e,t){for(var n=[],s=e;s<t;s++)n.push(s);return n}var ae=function(e){var t=new Date,n=W()(e).format("HH");if(W()(e).isSame(W()(t),"day")){var s=W()(t).format("HH"),a=W()(t).format("mm");return{disabledHours:function(){return se(0,24).splice(1,1*s-1)},disabledMinutes:function(){return W()(e).isSame(W()(t),"hour")&&n<=s?se(0,60).splice(0,a):se(60,60)}}}if(W()(e).isSame(W()(),"day")){var o=W()().format("HH"),i=W()().format("mm");return{disabledHours:function(){return se(0,24).splice(0,o)},disabledMinutes:function(){return n<=o?se(0,i):se(60,60)}}}return!1},oe=(0,h.connect)((function(e){return{exercise:e.exercise,polls:e.polls}}))((function(e){var t=e.exercise,n=e.dispatch,s=e.polls,o=(0,h.useParams)(),l=Z.Z.useForm(),c=p()(l,1)[0],d=(0,m.useState)(1),f=p()(d,2),x=(f[0],f[1]),_=(0,m.useState)([]),y=p()(_,2),v=y[0],w=y[1],k=(0,m.useState)(!1),C=p()(k,2),S=C[0],L=C[1],M=(0,m.useState)([]),P=p()(M,2),H=P[0],I=P[1],D=(0,m.useState)(!0),E=p()(D,2),F=E[0],O=E[1],R=(0,m.useState)(!1),Q=p()(R,2),z=Q[0],K=Q[1];(0,m.useEffect)((function(){"立即截止"===s.actionTabs.key&&V()}),[s.actionTabs]);var V=function(){var e=r()(a()().mark((function e(){var t,l,r;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return L(!0),e.next=3,n({type:"polls/getEndGroups",payload:u()(u()({},o),{},{check_ids:[s.actionTabs.selectArrs]})});case 3:0==(null==(t=e.sent)?void 0:t.status)&&((null==t||null===(l=t.course_info)||void 0===l?void 0:l.length)>0?w(i()(null==t||null===(r=t.course_info)||void 0===r?void 0:r.map((function(e,t){return e.key=e.course_group_id,e.title=e.course_group_name,e.name=e.course_group_name,e})))):w([]),c.setFieldsValue(A()({},"end_time",W()(W()(new Date((0,j.qd)("/"))).add(7,"days").format("YYYY-MM-DD HH:mm"))))),L(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),U=function(){var e=r()(a()().mark((function e(){var i,l,r;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=u()({},c.getFieldsValue()),!((null==H?void 0:H.length)<=0&&v.length>0)||null!==(i=t.actionTabs)&&void 0!==i&&i.unified_setting){e.next=4;break}return g.ZP.info("班级不能为空"),e.abrupt("return");case 4:return K(!0),r={check_ids:s.actionTabs.selectArrs,group_ids:H},F||(r.end_time=W()(l.end_time).format("YYYY-MM-DD HH:mm")),r.group_ids=H.map((function(e){return e.course_group_id})),e.next=10,(0,b.ZP)("/api/courses/".concat(o.coursesId,"/polls/end_poll.json"),{method:"post",body:r});case 10:0===e.sent.status&&(g.ZP.success("操作成功"),(0,j.L9)(["教学课堂","问卷","立即截止"]),n({type:"polls/setActionTabs",payload:{}}),n({type:"classroomList/getClassroomPollsList",payload:u()({},s.actionTabs.params)})),K(!1);case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,B.jsx)(T.Z,{centered:!0,title:"立即截止",open:"立即截止"===s.actionTabs.key,okText:"确认",cancelText:"取消",onOk:U,width:680,confirmLoading:z||S,onCancel:function(){x(1),w([]),I([]),O(!0),n({type:"polls/setActionTabs",payload:{}})},children:(0,B.jsx)(te.Z,{spinning:S,children:v&&(0,B.jsxs)(Z.Z,{form:c,children:[(0,B.jsx)("div",{style:{color:"#333333",display:"flex"},className:"font14 mb10",children:"说明:结束后学生将不能提交问卷。"}),(0,B.jsxs)(N.Z,{className:"mt20",children:[(0,B.jsxs)("span",{className:"mr10",children:[(0,B.jsx)("span",{style:{color:"red",marginRight:3},children:"*"}),"结束时间"]}),(0,B.jsxs)(J.ZP.Group,{value:F,onChange:function(e){O(e.target.value),I([])},children:[(0,B.jsx)(J.ZP,{value:!0,children:"立即结束"}),(0,B.jsx)(J.ZP,{value:!1,children:"定时结束"})]}),(0,B.jsx)(Z.Z.Item,{name:"end_time",style:{marginTop:-3,visibility:F?"hidden":"visible"},children:(0,B.jsx)(G.default,{style:{width:170},placeholder:"请选择结束时间",showTime:{format:"HH:mm",defaultValue:W()((0,j.U6)(),"HH:mm")},disabledDate:function(e){return e&&e<W()().subtract(0,"days")},disabledTime:ae,format:"YYYY-MM-DD HH:mm",allowClear:!1})})]}),v.length>0&&(0,B.jsxs)(N.Z,{style:{marginBottom:"10px"},children:[(0,B.jsxs)("span",{className:"mr10",children:[(0,B.jsx)("span",{style:{color:"red",marginRight:3},children:"*"}),"选择班级:"]}),(0,B.jsxs)("div",{children:[v.length>0&&(0,B.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:"10px"},children:[(0,B.jsxs)("span",{style:{flex:1},children:[(0,B.jsx)(Y.Z,{checked:H.length===v.length,onChange:function(e){H.length===v.length?I([]):I(v)},children:"全选"})," "]}),(0,B.jsx)("span",{style:{width:16}}),(0,B.jsxs)("span",{style:{flex:1},children:["已选择",H.length||0,"个分班"]})]}),(0,B.jsx)(ne.Z,{data:v,selectedRowKeys:H,setSelectedRowKeys:I})]})]})]})})})})),ie=(0,h.connect)((function(e){return{polls:e.polls}}))((function(e){var t=e.polls,n=e.dispatch,s=(0,h.useParams)();return(0,B.jsx)(T.Z,{centered:!0,title:"提示",open:"设为公开"===t.actionTabs.key,okText:"确定",cancelText:"取消",onOk:r()(a()().mark((function e(){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,b.ZP)("/api/courses/".concat(s.coursesId,"/polls/set_public.json"),{method:"post",body:{check_ids:i()(t.actionTabs.selectArrs)}});case 2:0===e.sent.status&&((0,j.L9)(["教学课堂","问卷","设为公开"]),g.ZP.success("操作成功"),n({type:"polls/setActionTabs",payload:{}}),n({type:"polls/getClassroomExercisesList",payload:u()({},t.actionTabs.params)}));case 4:case"end":return e.stop()}}),e)}))),onCancel:function(){n({type:"polls/setActionTabs",payload:{}})},children:(0,B.jsxs)("p",{children:["设为公开后,非课堂成员也可以访问查看",(0,B.jsx)("br",{}),"是否确认设为公开?"]})})})),le=n(38854),re=n(14491),ce={flex_box_center:"flex_box_center___IqnjB",flex_space_between:"flex_space_between___P_Bdb",flex_box_vertical_center:"flex_box_vertical_center___b9Sfl",flex_box_center_end:"flex_box_center_end___P1WX_",flex_box_column:"flex_box_column___w4BO3",bg:"bg___rzWO6",containerTitle:"containerTitle___r01Ub",selectBtn:"selectBtn___xsUwr",containerDesc:"containerDesc___FYZYR",listItem:"listItem___A03gB",info:"info___ghjyN",title:"title___uyjyV",titleLeft:"titleLeft___qc6go",titleRight:"titleRight___SrvQq",acitons:"acitons___cXo_g"},ue=n(53547),de=n(43501),pe=n(90963),me={1:"未发布",2:"提交中",3:"已截止",4:"已结束",5:"未开始"},he=function(e){var t,n=e.v,s=e.k,o=e.selectArrs,i=e.setSelectArrs,l=e.dispatch,c=e.params,d=e.detailPollsList,x=e.user,g=e.etiem,_=e.batchStatus,y=(0,m.useState)([]),v=p()(y,2),k=v[0],C=v[1],A=(0,m.useState)(!1),S=p()(A,2),Z=S[0],T=S[1];function N(){return L.apply(this,arguments)}function L(){return(L=r()(a()().mark((function e(){var t;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,b.ZP)("/api/courses/".concat(null==c?void 0:c.coursesId,"/polls/group_use_list.json"),{method:"get",params:u()(u()({},c),{},{id:n.id})});case 2:t=e.sent,C((null==t?void 0:t.groups)||[]);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var M=[{title:"班级",dataIndex:"name",key:"name"},{title:"问卷状态",dataIndex:"polls_status",key:"polls_status",width:100,filters:[{text:"未发布",value:1},{text:"提交中",value:2},{text:"已截止",value:3},{text:"未开始",value:5}],onFilter:function(e,t){return t.polls_status===e},render:function(e,t){return(0,B.jsxs)("div",{children:[1===e&&(0,B.jsxs)("span",{children:[(0,B.jsx)("i",{className:ce.dot,style:{background:"#C3C3C3"}}),"未发布"]}),2===e&&(0,B.jsxs)("span",{children:[(0,B.jsx)("i",{className:ce.dot,style:{background:"#4EACFF"}}),"提交中"]}),3===e&&(0,B.jsxs)("span",{children:[(0,B.jsx)("i",{className:ce.dot,style:{background:"#FC2D6B"}}),"已截止"]}),4===e&&(0,B.jsxs)("span",{children:[(0,B.jsx)("i",{className:ce.dot,style:{background:"#FC2D6B"}}),"已结束"]}),5===e&&(0,B.jsxs)("span",{children:[(0,B.jsx)("i",{className:ce.dot,style:{background:"#FC2D6B"}}),"未开始"]})]})}},{title:"开始时间",dataIndex:"publish_time",key:"publish_time",sorter:!0,width:170,showSorterTooltip:!1,sortOrder:"publish_time"===c.order_by?"desc"===c.sort_direction?"descend":"ascend":null,render:function(e,t){return W()(e).format("YYYY-MM-DD HH:mm")}},{title:"结束时间",dataIndex:"end_time",key:"end_time",sorter:!0,width:170,showSorterTooltip:!1,sortOrder:"end_time"===c.order_by?"desc"===c.sort_direction?"descend":"ascend":null,render:function(e,t){return W()(e).format("YYYY-MM-DD HH:mm")}},{title:"提交人数",dataIndex:"poll_answer",key:"poll_answer",align:"center",width:80,render:function(e,t){return 1===t.exercise_status?"-":(0,B.jsxs)("span",{children:[e,"/",e+t.poll_unanswer]})}}];return(0,B.jsxs)("div",{className:ce.listItem,onClick:function(){((0,w.dE)()||(0,w.GJ)())&&h.history.push("/classrooms/".concat(c.coursesId,"/poll/").concat(n.id,"/detail?tabs=").concat(1==(null==n?void 0:n.polls_status)?2:0))},children:[(0,w.GJ)()&&_&&(0,B.jsx)(Y.Z,{checked:o.includes(n.id),className:"ml30 mt5",value:n.id,onClick:function(e){return e.stopPropagation()},onChange:function(e){o.indexOf(n.id);o.indexOf(n.id)>-1?i(o.filter((function(e){return e!==n.id}))):i(o.concat(n.id))}}),(0,B.jsxs)("div",{className:ce.info,children:[(0,B.jsxs)("div",{className:ce.title,children:[(0,B.jsxs)("div",{className:ce.titleLeft,children:[(0,B.jsx)(j.VV,{style:{margin:"0px 10px 0px 0px"},status:[me[n.polls_status]]}),(0,B.jsx)(h.Link,{to:"/classrooms/".concat(c.coursesId,"/poll/").concat(n.id,"/detail"),children:(0,B.jsx)("strong",{children:n.polls_name})})]}),(0,B.jsxs)("div",{className:ce.titleRight,children:[(0,w.GJ)()&&(0,B.jsx)(B.Fragment,{children:(0,B.jsxs)(pe.op,{onClick:function(e){var t;e.stopPropagation(),console.log(d),l({type:"polls/setActionTabs",payload:{key:"立即发布",selectArrs:[n.id],selectArrsAll:null===(t=d.polls)||void 0===t?void 0:t.filter((function(e){return[n.id].includes(e.id)})),manage_all_group:null==d?void 0:d.manage_all_group,params:c}})},children:[(0,B.jsx)("i",{className:"iconfont icon-fasong font18 mr5"}),"发布"]})}),(0,w.dE)()&&(0===n.current_status||1===n.current_status||2===n.current_status)&&(0,B.jsx)(B.Fragment,{children:(0,B.jsxs)(pe.op,{onClick:function(e){var t,s;(e.stopPropagation(),1===n.current_status)?h.history.push("/classrooms/".concat(c.coursesId,"/poll/").concat(n.id,"/questionnaireInfo/").concat(null===(t=x.userInfo)||void 0===t?void 0:t.login,"?type=student")):h.history.push("/classrooms/".concat(c.coursesId,"/poll/").concat(n.id,"/users/").concat(null===(s=x.userInfo)||void 0===s?void 0:s.login))},children:[0===n.current_status&&"继续答卷",1===n.current_status&&"查看答卷",2===n.current_status&&"开始答卷"]})})]})]}),(0,B.jsxs)("p",{style:{display:"flex"},children:[(0,B.jsx)("span",{children:n.author}),n.publish_time&&1===n.polls_status&&(0,B.jsxs)("span",{className:"ml20",children:["将发布于",W()(n.publish_time).format("YYYY-MM-DD HH:mm")]}),!n.publish_time&&n.created_at&&1===n.polls_status&&(0,B.jsxs)("span",{className:"ml20",children:["创建时间 ",W()(n.created_at).format("YYYY-MM-DD HH:mm")]}),(2==n.polls_status||3==n.polls_status)&&(0,w.GJ)()&&(0,B.jsxs)("span",{className:"ml20",children:["已答 ",(0,B.jsx)("span",{style:{marginLeft:"5px",color:"#3061D0"},children:n.poll_answer})]}),(0,w.GJ)()&&5==n.polls_status&&(0,B.jsxs)("span",{className:"ml20",children:["开始时间 ",W()(n.publish_time).format("YYYY-MM-DD HH:mm")]}),1!=n.polls_status&&n.publish_time&&n.end_time&&(0,w.GJ)()&&(0,B.jsxs)("span",{className:"ml20",children:["截止时间 ",W()(n.end_time).format("YYYY-MM-DD HH:mm")]}),2==n.polls_status&&!(0,w.GJ)()&&(0,B.jsxs)("span",{className:"ml20",children:["提交剩余时间 ",g]}),3==n.polls_status&&!(0,w.GJ)()&&(0,B.jsxs)("span",{className:"ml20",children:["截止时间 ",W()(n.end_time).format("YYYY-MM-DD HH:mm")]}),(0,w.GJ)()&&(0,B.jsx)(le.Z,{dropdownRender:function(e){return(0,B.jsxs)(f.Z,{children:[(0,B.jsx)(f.Z.Item,{children:(0,B.jsx)("div",{onClick:function(e){e.stopPropagation(),h.history.push("/classrooms/".concat(c.coursesId,"/poll/").concat(n.id,"/detail?tabs=3"))},children:"规则设置"})}),(0,B.jsx)(f.Z.Item,{children:(0,B.jsx)("div",{onClick:function(e){var t;e.stopPropagation(),l({type:"polls/setActionTabs",payload:{key:"删除",selectArrs:[n.id],selectArrsAll:null===(t=d.polls)||void 0===t?void 0:t.filter((function(e){return[n.id].includes(e.id)})),params:c}})},children:"删除问卷"})}),2===n.polls_status&&(0,B.jsx)(f.Z.Item,{children:(0,B.jsx)("div",{onClick:function(e){var t;e.stopPropagation(),l({type:"polls/setActionTabs",payload:{key:"立即截止",selectArrs:[n.id],selectArrsAll:null===(t=d.polls)||void 0===t?void 0:t.filter((function(e){return[n.id].includes(e.id)})),manage_all_group:null==d?void 0:d.manage_all_group,params:c}})},children:"立即截止"})})]})},children:(0,B.jsxs)("div",{style:{color:"#888888",marginLeft:"auto",marginRight:"10px"},children:[(0,B.jsx)("i",{className:"iconfont icon-gengduo4",style:{color:"#888888",marginRight:"5px"}}),"更多"]})}),1!=n.polls_status&&(0,w.GJ)()&&(0,B.jsxs)("span",{style:{paddingRight:"10px",textAlign:"end",color:"#888888"},onClick:function(){var e=r()(a()().mark((function e(t){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.stopPropagation(),t.preventDefault(),Z||N(),T(!Z);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),children:[Z?(0,B.jsx)(ue.Z,{style:{color:"#888888",marginRight:"5px"}}):(0,B.jsx)(de.Z,{style:{color:"#888888",marginRight:"5px"}}),Z?"收起":"展开"]})]}),(0,w.GJ)()&&!(null!=n&&null!==(t=n.exercise_tips)&&void 0!==t&&t.includes("未开始"))&&Z&&k.length>0&&(0,B.jsx)(re.Z,{pagination:!1,dataSource:k,onRow:function(e){return{onClick:function(e){e.stopPropagation(),e.preventDefault()}}},onHeaderRow:function(e,t){return{onClick:function(e){e.stopPropagation(),e.preventDefault()}}},rowKey:"course_group_id",style:{marginTop:"10px"},onChange:function(e,t,n){n.field&&(c.order_by=n.field),n.order||(c.sort_direction="asc"),"ascend"===n.order&&(c.sort_direction="asc"),"descend"===n.order&&(c.sort_direction="desc"),n.order||(c.sort_direction="asc"),N()},columns:M})]})]},s)},fe=n(44427),xe=n(10593),ge=n(11278),_e=(f.Z.SubMenu,x.Z.Content,x.Z.Sider,(0,h.connect)((function(e){var t=e.user,n=e.classroomList,s=e.loading;return{user:t,classroomList:n,globalSetting:e.globalSetting,loading:s.effects}}))((function(e){var t,n,s,o,l,c,d,x=e.user,C=e.classroomList,A=(e.globalSetting,e.loading),S=e.dispatch,Z=(0,h.useParams)(),T=(0,h.useSearchParams)(),N=p()(T,1)[0],L=(0,m.useState)((function(){return u()(u()({},Z),{},{id:Z.coursesId,limit:20,type:N.get("tabs")||""})})),M=p()(L,2),P=M[0],Y=(M[1],C.detailPollsList),H=(C.detailTopBanner,(0,m.useState)([])),I=p()(H,2),D=I[0],E=I[1],O=(0,h.useLocation)(),R=(0,m.useState)(!1),G=p()(R,2),J=G[0],Q=G[1],W=(0,m.useState)(""),z=p()(W,2),K=z[0],V=z[1],U=N.get("tabs")?parseInt(N.get("tabs")):"all",q=(0,m.useState)("默认排序"),$=p()(q,2),te=$[0],ne=$[1],se=w.GJ?[{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"}];(0,m.useEffect)((function(){S({type:"classroomList/getClassroomPollsList",payload:u()({},P)}),S({type:"classroomList/getAssistantPermissions",payload:{course_id:P.id}})}),[P.categoryId]),(0,m.useEffect)((function(){"目录重命名成功"===C.actionTabs.key&&S({type:"classroomList/getClassroomPollsList",payload:u()({},P)})}),[C.actionTabs.key]),(0,m.useEffect)((function(){E([])}),[Y]);var ae=[{name:"全部",id:"all",total:null==Y||null===(t=Y.polls_counts)||void 0===t?void 0:t.polls_total_counts},{name:"未发布",id:1,total:null==Y||null===(n=Y.polls_counts)||void 0===n?void 0:n.polls_unpublish_counts},{name:"未开始",id:5,total:null==Y||null===(s=Y.polls_counts)||void 0===s?void 0:s.polls_unstart_counts},{name:"提交中",id:2,total:null==Y||null===(o=Y.polls_counts)||void 0===o?void 0:o.polls_published_counts},{name:"已截止",id:3,total:null==Y||null===(l=Y.polls_counts)||void 0===l?void 0:l.polls_end_counts}].filter((function(e){return!!(0,w.GJ)()||"未发布"!==e.name&&"未开始"!==e.name})),le=[{name:"批量发布",icon:(0,B.jsx)("i",{className:"iconfont icon-fabu5"})},{name:"批量结束",icon:(0,B.jsx)("i",{className:"iconfont icon-piliangjiezhi2"})},{name:"批量删除",icon:(0,B.jsx)("i",{className:"iconfont icon-piliangshanchu2"})},{name:"设为公开",icon:(0,B.jsx)("i",{className:"iconfont icon-sheweigongkai2"})},{name:"收藏",icon:(0,B.jsx)("i",{className:"iconfont icon-shoucang1"})}].filter((function(e){var t;return(0,w.qz)()?1!==(null==Y||null===(t=Y.course_types)||void 0===t?void 0:t.course_is_public)?"设为公开"!==e.name:e:"收藏"!==e.name})).filter((function(e){return!!(0,w.GJ)()||"删除"!==e.name})),re=function(){var e=r()(a()().mark((function e(t){var n,s,o;return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.name,""!=D){e.next=7;break}s="请选择你要操作的任务","收藏"===n&&(s="请选择要收藏的问卷"),g.ZP.error(s),e.next=14;break;case 7:if("收藏"!==n){e.next=13;break}return e.next=10,(0,b.ZP)("/api/courses/".concat(P.id,"/polls/join_poll_banks.json"),{method:"post",body:{check_ids:i()(D)}});case 10:return 0===e.sent.status&&g.ZP.success("操作成功"),e.abrupt("return",!1);case 13:S({type:"polls/setActionTabs",payload:{key:"批量删除"===n?"删除":"批量结束"===n?"立即截止":"批量发布"===n?"立即发布":n,selectArrs:D,selectArrsAll:null===(o=Y.polls)||void 0===o?void 0:o.filter((function(e){return D.includes(e.id)})),manage_all_group:null==Y?void 0:Y.manage_all_group,params:P}});case 14:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();return(0,B.jsxs)("section",{children:[(0,B.jsx)(fe.Z,{isLoading:A["classroomList/getClassroomPollsList"],tabDataSource:ae,isAdmin:(0,w.GJ)(),addText:"新建问卷",getDropdownMenu:function(){return(0,B.jsxs)(f.Z,{children:[(0,B.jsx)(f.Z.Item,{onClick:function(){V(new Date),S({type:"polls/setActionTabs",payload:{key:"问卷选用",params:P}})},children:"选用问卷"},1),(0,B.jsx)(f.Z.Item,{onClick:function(){h.history.push("/classrooms/".concat(P.coursesId,"/poll/").concat(P.categoryId,"/add"))},children:"新建问卷"},2)]})},onTabMenuClick:function(e){P.type="all"===e.key?"":e.key,P.page=1,h.history.replace("".concat(O.pathname,"?tabs=").concat(P.type)),S({type:"classroomList/getClassroomPollsList",payload:u()(u()({},P),{},{type:P.type})})},defaultSelectedKeys:[U+""]}),(0,B.jsx)(xe.Z,{dataSource:Y.polls||[],isAdmin:(0,w.GJ)(),batchStatus:J,SortMenuName:te,setSortMenuName:ne,SortMenus:se,onSort:function(e){P.sort_by=e.type,P.sort_direction=e.direction,P.page=1,S({type:"classroomList/getClassroomPollsList",payload:u()({},P)})},onSearch:function(e){P.search=e.trim(),P.page=1,S({type:"classroomList/getClassroomPollsList",payload:u()({},P)})},onBatch:function(e){return Q(e)}}),(0,B.jsxs)(_.Z,{loading:A["classroomList/getClassroomPollsList"],active:!0,avatar:{size:40},paragraph:{rows:5},className:"mt30",children:[Y.polls_counts&&0===Y.polls_counts.polls_all_counts&&(0,B.jsx)(k.Z,{}),Y.polls&&Y.polls.map((function(e,t){return(0,B.jsx)(he,{v:e,k:t,batchStatus:!0,selectArrs:D,setSelectArrs:E,dispatch:S,params:P,detailPollsList:Y,user:x,etiem:(0,j.li)((new Date(e.end_time).getTime()-(new Date).getTime())/1e3)},t)})),(0,B.jsx)("aside",{className:"tc mb50 mt30",children:(null===(c=Y.polls_counts)||void 0===c?void 0:c.polls_all_counts)>0&&(0,B.jsx)(y.Z,{showSizeChanger:!0,onChange:function(e,t){P.limit=t,P.page=e,S({type:"classroomList/getClassroomPollsList",payload:u()({},P)})},defaultCurrent:P.page,current:P.page||1,pageSize:P.limit||20,total:Y.polls_counts&&Y.polls_counts.polls_all_counts})})]}),D.length>0&&(0,w.GJ)()&&(0,B.jsx)(v.Z,{offsetBottom:0,children:(0,B.jsx)(ge.Z,{buttonDataSource:le,onButtonClick:re,useBatchStatus:Q,setSeleArr:E,allSelect:!!D.length&&D.length===(null===(d=Y.polls)||void 0===d?void 0:d.length),setAllSelect:function(e){var t;e.target.checked?E(null===(t=Y.polls)||void 0===t?void 0:t.map((function(e){return e.id}))):E([])},selectArrs:D})}),(0,B.jsx)(X,{}),(0,B.jsx)(ee,{}),(0,B.jsx)(ie,{}),(0,B.jsx)(oe,{}),(0,B.jsx)(F,{cb:function(){return E([])}},K)]})})))},15766:function(e,t,n){n.d(t,{Z:function(){return y}});var s=n(7557),a=n.n(s),o=n(41498),i=n.n(o),l=n(79800),r=n.n(l),c=n(59301),u=n(98135),d=n(24905),p=n(95237),m="leftdiv___aBzsX",h="listClass___bxIEW",f="spantitle___v_Vc4",x="rightdiv___xWu4M",g=n(7406),_=n(37712),y=function(e){var t=e.data,n=(e.value,e.handleChangePage,e.setSelectedRowKeys),s=e.selectedRowKeys,o=(e.onChange,(0,c.useState)([])),l=r()(o,2),y=l[0],v=l[1],b=(0,c.useState)([]),j=r()(b,2),w=j[0],k=j[1],C=(0,c.useState)([]),A=r()(C,2),S=A[0],Z=A[1],T=(0,c.useState)(1),N=r()(T,2),L=(N[0],N[1],(0,c.useState)()),M=r()(L,2);M[0],M[1];return(0,c.useEffect)((function(){v(t),k([]),Z([])}),[t]),(0,c.useEffect)((function(){n&&(k(s),Z(s))}),[s]),(0,_.jsxs)("div",{style:{display:"flex",justifyContent:"space-between"},children:[(0,_.jsxs)("div",{className:m,children:[(0,_.jsx)(u.Z.Search,{size:"middle",onChange:function(){var e=i()(a()().mark((function e(n){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:v(t.filter((function(e){var t;return null==e||null===(t=e.name)||void 0===t?void 0:t.includes(n.target.value)})));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),placeholder:"可输入班级名称查询"}),0===y.length&&(0,_.jsx)(g.Z,{styles:{margin:"70px auto"},customText:"暂无分班"}),(0,_.jsx)("div",{style:{height:"85%",overflow:"auto",overflowX:"hidden"},children:(0,_.jsx)(d.Z.Group,{value:w.map((function(e){return"".concat(e.id)})),onChange:function(e){n(y.filter((function(t){return e.includes("".concat(t.id))})))},style:{marginTop:"10px",flexDirection:"column"},children:y.map((function(e,t){return(0,_.jsx)(p.Z,{style:{marginTop:"10px",lineHeight:"24px",display:"flex",width:200},children:(0,_.jsx)(d.Z,{style:{display:"flex",height:"24px",alignItems:"center"},disabled:e.is_published,value:"".concat(e.id),children:(0,_.jsxs)("div",{className:h,children:[(0,_.jsx)("span",{className:f,style:{width:e.is_published?"108px":"170px"},children:e.name}),e.is_published&&(0,_.jsx)("span",{style:{width:"52px",height:"24px",background:"#B8B8B8",borderRadius:"13px",color:"white",lineHeight:"24px",textAlign:"center",display:"inline-block"},children:"已发布"})]})})},e.id)}))})})]}),(0,_.jsxs)("div",{className:x,children:[(0,_.jsx)(u.Z.Search,{onChange:function(e){Z(w.filter((function(t){return t.name.includes(e.target.value)})))},size:"middle",placeholder:"可输入班级名称查询"}),0===S.length&&(0,_.jsx)(g.Z,{styles:{margin:"70px auto"},customText:"暂未选择分班"}),S.length>0&&(0,_.jsx)("div",{style:{marginTop:"10px",height:"85%",overflow:"hidden",position:"relative"},children:(0,_.jsx)("div",{style:{overflowX:"hidden",overflowY:"scroll",position:"absolute",left:0,top:0,right:-17,bottom:0},children:S.map((function(e,t){return(0,_.jsxs)(p.Z,{justify:"space-between",style:{marginTop:"10px"},children:[(0,_.jsx)("div",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",marginRight:"5px",marginLeft:"5px",width:"75%"},children:e.name}),(0,_.jsx)("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAbVJREFUOE+Nk79rFUEUhb+zE4OFwUD+CyGKKQQbSaMikQQ7C1tBBIsUQaJvl2Fn/cWDpAiIYJsi7YOIaCUWFoKKRhG0sbEzEImFGnev7G6yyXsxeU5159yZb87l3hG9q2WLiBO79FIwXpLp0s6cwITnQCMWrGDM43jdBckZQ0wTMdrong2R2Bxm0/98sZ8ozdcOEm5hjOC41u9Olc9ZQKySclOVkNhljCmCzjeAJM/4FbW5p+8k5tlggTtarfKxLSM6pHq4BTiL0SboaAOIi284jeP1nti+ApMEvdoEvEPMkOpJDZi1IwzwgqDh/wSsYZwk08ca4O0Qua3zW8OV5crmHg6u22EGbQ2nIbx+1IC6rrK+cYJW9gXEVrbxGUEj5bltQGJvgBapHu0LSGwCyEh1vBsQWwd4TNCDPg6uAOcImuoFlL1dJ9WNPg5uYwwRVM3MzhJmKIpjZK6e9bj4jNNpvL4QFx9wuoDXJ1r5IlH0llTtXgcXwa4SolObnYnwKnbFcfEcdJ+gpW6AtzFynuIop/Fn053u4CA5yzjO4FV9tu0Syl2S38WiSWBgD8AfoEPQ7Fb+LwIiyhxWwe2KAAAAAElFTkSuQmCC",style:{cursor:"pointer",height:"16px",marginRight:17},onClick:function(){n(w.filter((function(t){return"".concat(t.id)!="".concat(e.id)})))}})]},e.id)}))})})]})]})}}}]); |