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

1 line
14 KiB

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[15402],{21167:function(e,n,t){t.r(n),t.d(n,{default:function(){return I}});var s=t(7557),a=t.n(s),c=t(41498),r=t.n(c),i=t(82242),l=t.n(i),o=t(79800),_=t.n(o),u=t(59301),d=t(80608),p=t(66104),x=t(43418),m=t(99313),h=t(27876),f=t(43764),v=t(71681),b=t(4585),j=t(61186),g=t.n(j),k={flex_box_center:"flex_box_center___dn0xX",flex_space_between:"flex_space_between___JlcX8",flex_box_vertical_center:"flex_box_vertical_center___PGWCu",flex_box_center_end:"flex_box_center_end___sRxxV",flex_box_column:"flex_box_column___WPwan",top:"top___arr9I",desc:"desc___tW8Wt",liked:"liked___Bq9NY",likedActive:"likedActive___XzpPk",reply:"reply___12llT",replyList:"replyList___NJsYv",comment:"comment___RWWH5",headpic:"headpic___v_77H"},y=t(37712);g().locale("ZH-cn");var w=(0,d.connect)((function(e){return{userDetail:e.userDetail}}))((function(e){var n,t=e.userDetail,s=(e.dispatch,(0,d.useParams)()),a=(0,d.useLocation)();(0,u.useEffect)((function(){var e;s.type=null===(e=a.pathname)||void 0===e||null===(e=e.split("/"))||void 0===e?void 0:e[6]}),[a.pathname]);var c=t.homeworkBanksDetail;return(0,y.jsx)("section",{className:k.bg,children:(0,y.jsx)("section",{className:"",children:(0,y.jsxs)("aside",{className:[k.desc,"c-black","font14","bg-white"].join(" "),children:["编辑作业"!==t.actionTabs.key&&(0,y.jsx)(b.Z,{value:(null==c?void 0:c.description)||"暂无~"}),null==c||null===(n=c.attachments)||void 0===n?void 0:n.map((function(e,n){return(0,y.jsx)("div",{children:(0,y.jsxs)("a",{href:"".concat(v.Z.API_SERVER).concat(e.url),children:[(0,y.jsx)("span",{className:"iconfont icon-fujian c-green font14"}),(0,y.jsx)("span",{className:"ml10 c-black",children:e.title}),(0,y.jsx)("span",{className:"c-light-black ml20 font12",children:e.filesize})]})})})),"group"===s.type&&(0,y.jsxs)(y.Fragment,{children:[(c.min_num||c.max_num)&&(0,y.jsxs)("div",{className:"mt10",children:[(0,y.jsx)("span",{className:"c-grey-666",children:"分组要求:"}),(0,y.jsxs)("span",{className:"c-black-051",children:[c.min_num,"~ ",c.max_num," 人(学生提交作品时需要关联同组成员,组内成员作品共享)"]})]}),c.base_on_project?(0,y.jsxs)("p",{children:[(0,y.jsx)("span",{className:"c-grey-666",children:"基于项目实施"}),(0,y.jsx)("span",{className:"c-black-051",children:"(学生必须在本平台创建项目,项目管理员可以提交作品)"})]}):(0,y.jsxs)("p",{children:[(0,y.jsx)("span",{className:"c-grey-666",children:"不基于项目"}),(0,y.jsx)("span",{className:"c-black-051",children:"(无需在平台创建项目,任意小组成员均可以提交作品)"})]})]})]})})})})),N=t(6638),D={flex_box_center:"flex_box_center___ukees",flex_space_between:"flex_space_between___PHPo4",flex_box_vertical_center:"flex_box_vertical_center___MgEzw",flex_box_center_end:"flex_box_center_end___owDkz",flex_box_column:"flex_box_column____I7hO",top:"top___DHLWM",desc:"desc___JJR8P",liked:"liked___knpCw",likedActive:"likedActive___KPZCk",reply:"reply___n7kXe",replyList:"replyList___MVu52",comment:"comment___Leq7e",headpic:"headpic___HL9zI"};g().locale("ZH-cn");var Z=(0,d.connect)((function(e){return{userDetail:e.userDetail}}))((function(e){var n,t,s=e.userDetail,a=(e.dispatch,s.homeworkBanksDetail);return(0,y.jsx)("section",{className:D.bg,children:(0,y.jsx)("section",{className:"",children:(0,y.jsx)("aside",{className:[D.desc,"c-black","font14","bg-white"].join(" "),children:null!=a&&a.reference_answer||null!=a&&null!==(n=a.reference_attachments)&&void 0!==n&&n.length?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(b.Z,{value:(null==a?void 0:a.reference_answer)||""}),null==a||null===(t=a.reference_attachments)||void 0===t?void 0:t.map((function(e,n){return(0,y.jsx)("div",{children:(0,y.jsxs)("a",{href:"".concat(v.Z.API_SERVER).concat(e.url),children:[(0,y.jsx)("span",{className:"iconfont icon-fujian c-green font14"}),(0,y.jsx)("span",{className:"ml10 c-black",children:e.title}),(0,y.jsx)("span",{className:"c-light-black ml20 font12",children:e.filesize})]})})}))]}):(0,y.jsx)(N.Z,{})})})})})),C={flex_box_center:"flex_box_center___vHDeL",flex_space_between:"flex_space_between___rLrGx",flex_box_vertical_center:"flex_box_vertical_center___iGSf0",flex_box_center_end:"flex_box_center_end___mqG_2",flex_box_column:"flex_box_column___x9EJv",title:"title___LcvG_",export:"export___M5wlK",bg:"bg___XfKxA",tabs:"tabs___esytV"},S=t(2486),I=(0,d.connect)((function(e){return{userDetail:e.userDetail,loading:e.loading.effects}}))((function(e){var n=e.userDetail,t=e.dispatch,s=e.history,c=(0,d.useSearchParams)(),i=_()(c,1)[0],o=(0,d.useParams)(),v=(0,d.useLocation)(),b=(0,u.useState)(i.get("tabs")||0),j=_()(b,2),g=j[0],k=(j[1],n.homeworkBanksDetail);(0,u.useEffect)((function(){var e;o.type=null===(e=v.pathname)||void 0===e||null===(e=e.split("/"))||void 0===e?void 0:e[6],t({type:"userDetail/getHomeworkBanksDetail",payload:l()({},o)})}),[o.topicId,v.pathname]);var N=[{name:"内容详情",id:0,compontent:(0,y.jsx)("div",{className:"minH500",children:(0,y.jsx)(w,{})})},{name:"参考答案",id:1,compontent:(0,y.jsx)(Z,{})}];return(0,y.jsxs)("section",{className:C.bg,children:[(0,y.jsxs)("div",{className:"edu-container",children:[(0,y.jsxs)("section",{className:"animated fadeIn",children:[(0,y.jsx)("aside",{className:"mt10",children:(0,y.jsxs)(p.Z,{separator:">",children:[(0,y.jsx)(p.Z.Item,{children:(0,y.jsx)(d.Link,{to:"/users/".concat(o.username,"/").concat("personal"===o.topictype?"topics":"topicbank","/").concat(o.topictype),children:"personal"===o.topictype?"我的课堂资源":"公共题库"})}),(0,y.jsx)(p.Z.Item,{children:"详情"})]})}),(0,y.jsxs)("aside",{className:[C.title,"mt20"].join(" "),children:[(0,y.jsx)("strong",{className:"font20 ml5",children:k.name}),k.is_public&&(0,y.jsx)(h.VV,{status:["公开"]})]})]}),(0,y.jsxs)("aside",{className:"mt30 relative bg-white mb20",children:[(0,y.jsxs)("div",{className:C.export,children:[(null==k?void 0:k.authorize)&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("a",{onClick:function(e){var n;e.preventDefault(),x.Z.confirm({centered:!0,okText:"确定",cancelText:"取消",title:"提示",content:"是否确认删除?",onOk:(n=r()(a()().mark((function e(){return a()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,f.Tv)({object_type:"normal",object_id:[o.topicId]});case 2:0===e.sent.status&&s.push("/users/".concat(o.username,"/topics/personal"));case 4:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})})},children:"删除"}),(0,y.jsx)(d.Link,{to:"/users/".concat(o.username,"/topics/").concat(o.topicId,"/").concat(o.topictype,"/").concat(o.type,"/edit"),children:"编辑"})]}),(0,y.jsx)("a",{onClick:function(e){e.preventDefault(),t({type:"userDetail/setActionTabs",payload:{key:"UserDetail-SendToClass",params:{object_id:[o.topicId],object_type:o.type}}})},children:"发送"})]}),(0,y.jsx)(m.Z,{defaultActiveKey:g,className:C.tabs,children:N.map((function(e,n){return(0,y.jsx)(m.Z.TabPane,{tab:e.name,children:e.compontent},e.id)}))})]})]}),(0,y.jsx)(S.Z,{})]})}))},2486:function(e,n,t){t.d(n,{Z:function(){return W}});var s=t(82242),a=t.n(s),c=t(7557),r=t.n(c),i=t(41498),l=t.n(i),o=t(79800),_=t.n(o),u=t(39647),d=t.n(u),p=t(59301),x=t(80608),m=t(8591),h=t(43418),f=t(99313),v=t(66999),b=t(5112),j={title:"title___XAxiE",radioWrap:"radioWrap___k0pOB",radio:"radio___x9kMt",colorFF0000:"colorFF0000___IMgd0",pagination:"pagination___ou2ht",checkboxWrapper:"checkboxWrapper___kF7xI"},g=t(27876),k=t(2753),y=t(37205),w=t.n(y),N=t(71418),D=t(24905),Z=t(43764),C=t(26724),S=t.n(C),I=t(37712),T=function(e){var n=e.username,t=e.setStages,s=e.stages,a=e.hasError,c=e.setHasError,i=(0,p.useState)(""),o=_()(i,2),u=o[0],d=o[1],x=(0,p.useState)(1),m=_()(x,2),h=m[0],f=m[1],v=(0,p.useState)([]),g=_()(v,2),y=g[0],C=g[1],T=(0,p.useState)(!1),P=_()(T,2),L=P[0],E=P[1],W=(0,p.useState)(0),A=_()(W,2),H=A[0],V=A[1];(0,p.useEffect)((function(){F({page:1,search:""},!0)}),[]);var F=function(){var e=l()(r()().mark((function e(t,s){var a;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return E(!0),e.next=3,(0,Z.w3)({username:n,category:"manage",page:t.page,search:t.search});case 3:a=e.sent,E(!1),C((function(e){return s?null==a?void 0:a.subjects:[].concat(w()(e),w()(null==a?void 0:a.subjects))})),V(null==a?void 0:a.count);case 7:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),G=(0,p.useRef)();return(0,I.jsxs)("div",{className:j.wrap,children:[(0,I.jsx)("div",{className:"mb10",children:(0,I.jsx)(k.t7,{placeholder:"请输入实践课程名称的关键字进行搜索",value:u,style:{width:500},onChange:function(e){d(e),f(1),G.current.scrollTo({behavior:"smooth",top:0}),F({page:1,search:e},!0)}})}),(0,I.jsx)(N.Z,{spinning:L,children:(0,I.jsx)("div",{className:j.radioWrap,ref:G,children:(0,I.jsx)(S(),{initialLoad:!1,pageStart:1,threshold:6,loadMore:function(){f(h+1),F({page:h+1,search:u},!1)},hasMore:y.length<H,useWindow:!1,children:(0,I.jsx)(b.ZP.Group,{value:s.subjectId,onChange:function(e){t({subjectId:e.target.value,stage_ids:[]}),c(!1)},children:y.map((function(e){var n=e.stages.map((function(e){return{label:e.name,value:e.id}}));return(0,I.jsxs)("div",{children:[(0,I.jsx)(b.ZP,{className:j.radio,value:e.id,children:e.name}),e.id===s.subjectId&&(0,I.jsxs)("div",{className:j.checkboxWrapper,children:[n.length>0&&(0,I.jsx)(D.Z,{indeterminate:s.stage_ids.length>0&&s.stage_ids.length<n.length,onChange:function(s){t({subjectId:e.id,stage_ids:s.target.checked?n.map((function(e){return e.value})):[]})},checked:s.stage_ids.length===n.length,children:"全选"}),(0,I.jsx)(D.Z.Group,{options:n,value:s.stage_ids,onChange:function(n){return t({subjectId:e.id,stage_ids:n})}})]})]},e.id)}))})})})}),a&&(0,I.jsx)("div",{className:j.colorFF0000,children:"请先选择实践课程及章节"})]})},P=t(11806),L=t(90420),E=["userDetail","globalSetting","loading","user","dispatch"],W=(0,x.connect)((function(e){var n=e.userDetail,t=e.loading,s=e.globalSetting,a=e.user;return{userDetail:n,globalSetting:s,loading:t.effects,user:a}}))((function(e){var n,t,s,c=e.userDetail,i=(e.globalSetting,e.loading),o=e.user,u=e.dispatch,x=(d()(e,E),(0,p.useState)("course")),y=_()(x,2),w=y[0],N=y[1],D=(0,p.useState)(""),Z=_()(D,2),C=Z[0],S=Z[1],W=(0,p.useState)([]),A=_()(W,2),H=A[0],V=A[1],F=(0,p.useState)(),G=_()(F,2),M=G[0],z=G[1],R=(0,p.useState)(!1),B=_()(R,2),O=B[0],X=B[1],q=(0,p.useState)(!1),J=_()(q,2),K=J[0],U=J[1];(0,p.useEffect)((function(){"UserDetail-SendToClass"===c.actionTabs.key&&Y(C)}),[c.actionTabs.key]);var Y=function(){var e=l()(r()().mark((function e(n){var t;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return X(!0),e.next=3,u({type:"userDetail/topicGetCourseList",payload:{search:n}});case 3:(t=e.sent)&&V((null==t?void 0:t.courses)||[]),X(!1);case 6:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),Q=(0,p.useState)({subjectId:"",stage_ids:[]}),$=_()(Q,2),ee=$[0],ne=$[1],te=function(){var e=l()(r()().mark((function e(){var n,t,s,i,l,_;return r()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("course"!==w){e.next=11;break}if(M){e.next=4;break}return U(!0),e.abrupt("return");case 4:return e.next=6,u({type:"userDetail/topicSendToClass",payload:a()({course_id:M},null===(n=c.actionTabs)||void 0===n?void 0:n.params)});case 6:t=e.sent,u({type:"userDetail/setActionTabs",payload:{}}),t&&0===t.status&&(i={normal:"common_homework",group:"group_homework",exercise:"exercise",poll:"poll",videos:"video"},(0,g.xg)("/classrooms/".concat(M,"/").concat(i[null===(s=c.actionTabs)||void 0===s||null===(s=s.params)||void 0===s?void 0:s.object_type]))),e.next=18;break;case 11:if(ee.subjectId&&ee.stage_ids.length){e.next=14;break}return U(!0),e.abrupt("return");case 14:return e.next=16,(0,L.nI)({id:null===(l=c.actionTabs)||void 0===l||null===(l=l.params)||void 0===l?void 0:l.object_id,login:null===(_=o.userInfo)||void 0===_?void 0:_.login},{stage_ids:ee.stage_ids});case 16:0===e.sent.status&&(m.ZP.success("发送成功"),u({type:"userDetail/setActionTabs",payload:{}}),(0,g.xg)("/paths/".concat(ee.subjectId)));case 18:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,I.jsx)(h.Z,{centered:!0,keyboard:!1,closable:!1,destroyOnClose:!0,open:"UserDetail-SendToClass"===c.actionTabs.key,title:"发送",okText:"确定",cancelText:"取消",confirmLoading:i["userDetail/sendToClass"],width:600,afterClose:function(){U(!1),V([]),ne({subjectId:"",stage_ids:[]}),S("")},onOk:te,wrapClassName:P.Z.CustomCss,onCancel:function(){u({type:"userDetail/setActionTabs",payload:{}})},children:(0,I.jsx)(f.Z,{activeKey:w,onChange:function(e){U(!1),N(e)},items:[{label:"课堂",key:"course",children:(0,I.jsxs)("div",{className:j.wrap,children:[(0,I.jsx)("div",{className:"mb10",children:(0,I.jsx)(k.t7,{placeholder:"请输入课堂名称的关键字进行搜索",value:C,style:{width:500},onChange:function(e){S(e),Y(e)}})}),(0,I.jsx)(v.Z,{active:!0,loading:O,children:(0,I.jsx)("div",{className:j.radioWrap,children:(0,I.jsx)(b.ZP.Group,{value:M,onChange:function(e){z(e.target.value),U(!1)},children:H.map((function(e,n){return(0,I.jsx)(b.ZP,{className:j.radio,value:e.course_id,children:e.course_name},e.course_id)}))})})}),"videos"!==(null===(n=c.actionTabs)||void 0===n||null===(n=n.params)||void 0===n?void 0:n.object_type)&&(0,I.jsx)("div",{className:j.title,children:"温馨提示:选择的题将会发送到指定课堂"}),K&&(0,I.jsx)("div",{className:j.colorFF0000,children:"请先选择课堂"})]}),show:!0},{label:"实践课程",key:"subject",children:(0,I.jsx)(T,{username:null===(t=o.userInfo)||void 0===t?void 0:t.login,stages:ee,setStages:ne,hasError:K,setHasError:U}),show:"videos"===(null===(s=c.actionTabs)||void 0===s||null===(s=s.params)||void 0===s?void 0:s.object_type)}].filter((function(e){return e.show}))})})}))},11806:function(e,n){n.Z={flex_box_center:"flex_box_center___vG4eV",flex_space_between:"flex_space_between___qVVxe",flex_box_vertical_center:"flex_box_vertical_center___P8Z8s",flex_box_center_end:"flex_box_center_end___VMme3",flex_box_column:"flex_box_column___VMHwm",dropdownmenus:"dropdownmenus___oVzoj",popupClassNames:"popupClassNames___OcZq7",selectdown:"selectdown___mmcA8"}}}]);