dev_aliyun2
harry 5 years ago
parent 593cbfc1b8
commit 9456783685

@ -24,10 +24,6 @@ function locationurl(list) {
} }
} }
// TODO 开发期多个身份切换 // TODO 开发期多个身份切换
let debugType = "" let debugType = ""
if (isDev) { if (isDev) {
@ -47,10 +43,6 @@ if (isDev) {
// 学生 // 学生
//debugType="student"; //debugType="student";
function clearAllCookie() { function clearAllCookie() {
cookie.remove('_educoder_session', { path: '/' }); cookie.remove('_educoder_session', { path: '/' });
cookie.remove('autologin_trustie', { path: '/' }); cookie.remove('autologin_trustie', { path: '/' });

@ -1,40 +0,0 @@
body {
margin: 0;
padding: 0;
font-family: sans-serif;
}
.page--header {
z-index: 101 !important;
}
.ant-popover-buttons {
text-align: center !important;
}
/* ie11兼容性问题 评测通过图片被遮挡*/
.page--body {
z-index: 1;
}
/* 隐藏newMessage提示按钮 */
#shixun_comment_block .buttons > p:last-child {
display: none !important;
}
.ant-message{
z-index: 20000;
}
/*.ant-modal-header{*/
/*border-radius: 10px;*/
/*}*/
.ant-upload-list-item-info .anticon-loading, .ant-upload-list-item-info .anticon-paper-clip{
color: #29bd8b !important;
}
.anticon anticon-paper-clip{
color: #29bd8b !important;
}
.MuiModal-root-15{
z-index: 1000 !important;
}

@ -1,46 +0,0 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import './indexPlus.css';
import App from './App';
// 加之前main.js 18.1MB
// import { message } from 'antd';
import message from 'antd/lib/message';
import 'antd/lib/message/style/css';
import { AppContainer } from 'react-hot-loader';
import registerServiceWorker from './registerServiceWorker';
import { configureUrlQuery } from 'react-url-query';
import history from './history';
// link the history used in our app to url-query so it can update the URL with it.
configureUrlQuery({ history });
// ----------------------------------------------------------------------------------- 请求配置
window.__useKindEditor = false;
const render = (Component) => {
ReactDOM.render(
<AppContainer {...this.props} {...this.state}>
<Component {...this.props} {...this.state}/>
</AppContainer>,
document.getElementById('root')
);
}
// ReactDOM.render(
// ,
// document.getElementById('root'));
// registerServiceWorker();
render(App);
if (module.hot) {
module.hot.accept('./App', () => { render(App) });
}

@ -1,10 +1,9 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { getRandomNumber } from 'educoder'; import { Link } from 'react-router-dom';
import {Link} from 'react-router-dom'; import { Route, Switch } from 'react-router-dom';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import Loadable from 'react-loadable'; import Loadable from 'react-loadable';
import Loading from '../../../Loading'; import Loading from '../../../Loading';
import { WordsBtn, MarkdownToHtml, trigger, queryString, getRandomcode } from 'educoder'; import { WordsBtn, trigger, queryString, getRandomcode } from 'educoder';
import axios from 'axios'; import axios from 'axios';
import CoursesListType from '../coursesPublic/CoursesListType'; import CoursesListType from '../coursesPublic/CoursesListType';
import AccessoryModal from "../coursesPublic/AccessoryModal"; import AccessoryModal from "../coursesPublic/AccessoryModal";
@ -17,81 +16,60 @@ import { Spin } from 'antd'
//引入对应跳转的组件 //引入对应跳转的组件
//新建分组/普通作业
const NewWork = Loadable({
loader: () => import('./NewWork'),
loading:Loading,
})
const CommonWorkSetting = Loadable({ const CommonWorkSetting = Loadable({
loader: () => import('./CommonWorkSetting'), loader: () => import('./CommonWorkSetting'),
loading:Loading, loading: Loading,
}) })
//普通作业列表 //普通作业列表
const CommonWorkList = Loadable({ const CommonWorkList = Loadable({
loader: () => import('./CommonWorkList'), loader: () => import('./CommonWorkList'),
loading:Loading, loading: Loading,
}) })
const CommonWorkQuestion = Loadable({ const CommonWorkQuestion = Loadable({
loader: () => import('./CommonWorkQuestion'), loader: () => import('./CommonWorkQuestion'),
loading:Loading, loading: Loading,
}) })
const CommonWorkAnswer = Loadable({ const CommonWorkAnswer = Loadable({
loader: () => import('./CommonWorkAnswer'), loader: () => import('./CommonWorkAnswer'),
loading:Loading, loading: Loading,
})
const CommonWorkAppraise = Loadable({
loader: () => import('./CommonWorkAppraise'),
loading:Loading,
})
const CommonWorkPost = Loadable({
loader: () => import('./CommonWorkPost'),
loading:Loading,
})
const CommonWork = Loadable({
loader: () => import('./commonWork'),
loading:Loading,
}) })
class CommonWorkDetailIndex extends Component{ class CommonWorkDetailIndex extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.publishModal = React.createRef();
this.endModal = React.createRef();
this.state = { this.state = {
DownloadType:false, DownloadType: false,
DownloadMessageval:undefined, DownloadMessageval: undefined,
donwloading:false, donwloading: false,
} }
} }
initWorkDetailCommonState = (data) => { initWorkDetailCommonState = (data) => {
this.setState({ this.setState({
...data ...data
}) })
} }
goback = () => { goback = () => {
let workId=this.props.match.params.workId; let workId = this.props.match.params.workId;
// //
if ( window.location.pathname.indexOf('appraise') == -1) { if (window.location.pathname.indexOf('appraise') == -1) {
let category_id= this.state.category.category_id; let category_id = this.state.category.category_id;
this.props.toListPage(this.props.match.params, category_id) this.props.toListPage(this.props.match.params, category_id)
} else { } else {
this.props.toWorkListPage(this.props.match.params, workId) this.props.toWorkListPage(this.props.match.params, workId)
} }
// this.props.history.goBack() // this.props.history.goBack()
} }
// 补交附件 // 补交附件
Cancelvisible=()=>{ Cancelvisible = () => {
this.setState({ this.setState({
accessoryVisible:false accessoryVisible: false
}) })
} }
addAccessory=()=>{ addAccessory = () => {
this.setState({ this.setState({
accessoryVisible:true accessoryVisible: true
}) })
} }
setupdate = () => { setupdate = () => {
@ -102,55 +80,41 @@ class CommonWorkDetailIndex extends Component{
} }
/// 确认是否下载 /// 确认是否下载
confirmysl(url){ confirmysl(url) {
axios.get(url+ '&export=true').then((response) => { axios.get(url + '&export=true').then((response) => {
if(response===undefined){ if (response === undefined) {
return return
} }
if(response.data.status&&response.data.status===-1){ if (response.data.status && response.data.status === -1) {
}else if(response.data.status&&response.data.status===-2){ } else if (response.data.status && response.data.status === -2) {
if(response.data.message === "100"){ if (response.data.message === "100") {
// 已超出文件导出的上限数量100 ),建议: // 已超出文件导出的上限数量100 ),建议:
this.setState({ this.setState({
DownloadType:true, DownloadType: true,
DownloadMessageval:100 DownloadMessageval: 100
}) })
}else { } else {
//因附件资料超过500M //因附件资料超过500M
this.setState({ this.setState({
DownloadType:true, DownloadType: true,
DownloadMessageval:500 DownloadMessageval: 500
}) })
} }
}else { } else {
this.props.slowDownload(getRandomcode(url)) this.props.slowDownload(getRandomcode(url))
// this.props.showNotification(`正在下载中`);
// this.setState({ donwloading: true })
// downloadFile({
// url: url,
// successCallback: (url) => {
// this.setState({ donwloading: false })
// console.log('successCallback')
// },
// failCallback: (responseHtml, url) => {
// this.setState({ donwloading: false })
// console.log('failCallback')
// }
// })
// window.open("/api"+url, '_blank');
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
} }
Downloadcal=()=>{ Downloadcal = () => {
this.setState({ this.setState({
DownloadType:false, DownloadType: false,
DownloadMessageval:undefined DownloadMessageval: undefined
}) })
} }
bindRef = ref => { this.child = ref }; bindRef = ref => { this.child = ref };
@ -164,45 +128,42 @@ class CommonWorkDetailIndex extends Component{
} }
cancelConnectionProject = (work) => { cancelConnectionProject = (work) => {
let workId=this.props.match.params.workId;
let courseId=this.props.match.params.coursesId;
const url = `/homework_commons/${work.homework_id}/student_works/cancel_relate_project.json` const url = `/homework_commons/${work.homework_id}/student_works/cancel_relate_project.json`
axios.get(url).then((response)=> { axios.get(url).then((response) => {
if (response.data.status == 0) { if (response.data.status == 0) {
this.child.fetchData && this.child.fetchData() this.child.fetchData && this.child.fetchData()
this.props.showNotification('取消关联成功') this.props.showNotification('取消关联成功')
} }
}).catch((error)=>{ }).catch((error) => {
console.log(error) console.log(error)
}) })
} }
// 关联项目 END // 关联项目 END
render() { render() {
let {course_name, homework_name, homework_status, noTab let { course_name, homework_name, homework_status, noTab
, view_answer, author_name, category, work_id , view_answer, author_name, category, work_id
, end_immediately, publish_immediately, work_statuses, accessoryVisible , end_immediately, publish_immediately, work_statuses, accessoryVisible
} =this.state; } = this.state;
const { current_user } = this.props const { current_user } = this.props
let courseId=this.props.match.params.coursesId; let courseId = this.props.match.params.coursesId;
let category_id= category && category.category_id; let category_id = category && category.category_id;
let category_name= category && category.category_name; let category_name = category && category.category_name;
let workId=this.props.match.params.workId; let workId = this.props.match.params.workId;
const studentWorkId = this.props.match.params.studentWorkId const studentWorkId = this.props.match.params.studentWorkId
const isGroup = this.props.isGroup() const isGroup = this.props.isGroup()
const moduleName = !isGroup? "普通作业":"分组作业";
const moduleEngName = this.props.getModuleName() const moduleEngName = this.props.getModuleName()
const childModuleName = this.state.moduleName const childModuleName = this.state.moduleName
const commonHandler = { const commonHandler = {
initWorkDetailCommonState: this.initWorkDetailCommonState, initWorkDetailCommonState: this.initWorkDetailCommonState,
triggerRef: this.bindRef triggerRef: this.bindRef
} }
const isAdmin = this.props.isAdmin() const isAdmin = this.props.isAdmin()
@ -212,67 +173,64 @@ class CommonWorkDetailIndex extends Component{
// 是列表页 // 是列表页
let params = {} let params = {}
if (isListModule) { if (isListModule) {
// TODO if (this.child && this.child._getRequestParams) {
if(this.child && this.child._getRequestParams) {
params = this.child._getRequestParams() !== undefined ? this.child._getRequestParams() : {}; params = this.child._getRequestParams() !== undefined ? this.child._getRequestParams() : {};
} }
} }
// console.log("普通作业176176176");
// console.log(params);
let exportUrl = `/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}` let exportUrl = `/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}`
let exportResultUrl = `/homework_commons/${workId}/works_list.xlsx?${queryString.stringify(params)}` let exportResultUrl = `/homework_commons/${workId}/works_list.xlsx?${queryString.stringify(params)}`
document.title=course_name === undefined ? "" : course_name; document.title = course_name === undefined ? "" : course_name;
return ( return (
<div> <div>
<PublishRightnow ref={this.publishModal} showActionButton={false} {...this.props} checkBoxValues={[workId]} <PublishRightnow showActionButton={false} {...this.props} checkBoxValues={[workId]}
isPublish={true} doWhenSuccess={this.doWhenSuccess} checkBeforePost={this.saveWorkSetting} isPublish={true} doWhenSuccess={this.doWhenSuccess} checkBeforePost={this.saveWorkSetting}
onToPublishClick={this.onToPublishClick} onToPublishClick={this.onToPublishClick}
></PublishRightnow> ></PublishRightnow>
<DownloadMessageysl <DownloadMessageysl
{...this.props} {...this.props}
value={this.state.DownloadMessageval} value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal} modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType} modalsType={this.state.DownloadType}
/> />
<PublishRightnow ref={this.endModal} showActionButton={false} {...this.props} checkBoxValues={[workId]} <PublishRightnow showActionButton={false} {...this.props} checkBoxValues={[workId]}
isPublish={false} doWhenSuccess={this.doWhenSuccess}></PublishRightnow> isPublish={false} doWhenSuccess={this.doWhenSuccess}></PublishRightnow>
<div className="newMain clearfix worklist1"> <div className="newMain clearfix worklist1">
<div className={"educontent mt20"}> <div className={"educontent mt20"}>
<style>{` <style>{`
.memoContent { .memoContent {
background: #fff; background: #fff;
} }
`}</style> `}</style>
{current_user && <CBreadcrumb items={[ {current_user && <CBreadcrumb items={[
{ to: current_user&&current_user.first_category_url , name: course_name}, { to: current_user && current_user.first_category_url, name: course_name },
{ to: `/courses/${courseId}/${moduleEngName}/${category_id}`, name: category_name }, { to: `/courses/${courseId}/${moduleEngName}/${category_id}`, name: category_name },
window.location.pathname.indexOf('appraise') == -1 ? { } : { to: `/courses/${courseId}/${moduleEngName}/${workId}/list`, name: '作业详情' }, window.location.pathname.indexOf('appraise') == -1 ? {} : { to: `/courses/${courseId}/${moduleEngName}/${workId}/list`, name: '作业详情' },
// 1. 与上一条联动当匿评他人作品时TA人作品的作者真实姓名切换为“匿名” // 1. 与上一条联动当匿评他人作品时TA人作品的作者真实姓名切换为“匿名”
window.location.pathname.indexOf('appraise') == -1 ? { name: '作业详情' } : { name: author_name }, window.location.pathname.indexOf('appraise') == -1 ? { name: '作业详情' } : { name: author_name },
// window.location.pathname.indexOf('appraise') == -1 ? { } : { to: `/courses/${courseId}/${moduleEngName}/${workId}/list`, name: '作品列表' }, // window.location.pathname.indexOf('appraise') == -1 ? { } : { to: `/courses/${courseId}/${moduleEngName}/${workId}/list`, name: '作品列表' },
// { name: childModuleName } // { name: childModuleName }
]}></CBreadcrumb>} ]}></CBreadcrumb>}
<div style={{ width:'100%',height:'52px'}} > <div style={{ width: '100%', height: '52px' }} >
<span className=" fl color-black summaryname" title={`${homework_name && homework_name.length > 36 ? homework_name : ''}`} <span className=" fl color-black summaryname" title={`${homework_name && homework_name.length > 36 ? homework_name : ''}`}
style={{height: 'auto'}} style={{ height: 'auto' }}
> >
{homework_name} {homework_name}
{/* <Link to={"/courses/"+courseId+"/graduation"+"/graduation_tasks/"}>{homework_name}</Link> */} {/* <Link to={"/courses/"+courseId+"/graduation"+"/graduation_tasks/"}>{homework_name}</Link> */}
</span> </span>
<CoursesListType <CoursesListType
typelist={homework_status} typelist={homework_status}
typesylename={"mt12"} typesylename={"mt12"}
/> />
{category && <a className="color-grey-6 fr font-16 ml30 mt5 mr20" onClick={this.goback} style={{ marginRight: '26px'}}>返回</a>} {category && <a className="color-grey-6 fr font-16 ml30 mt5 mr20" onClick={this.goback} style={{ marginRight: '26px' }}>返回</a>}
{this.state.update_atta && {this.state.update_atta &&
<React.Fragment> <React.Fragment>
{this.state.accessoryVisible===true? <AccessoryModal {this.state.accessoryVisible === true ? <AccessoryModal
{...this.props} {...this.props}
modalname={"补交附件"} modalname={"补交附件"}
visible={this.state.accessoryVisible} visible={this.state.accessoryVisible}
@ -282,39 +240,39 @@ class CommonWorkDetailIndex extends Component{
setupdate={this.setupdate} setupdate={this.setupdate}
seeworks={undefined} seeworks={undefined}
reviseAttachmentUrl={`/student_works/${work_id || studentWorkId}/revise_attachment.json`} reviseAttachmentUrl={`/student_works/${work_id || studentWorkId}/revise_attachment.json`}
/>:""} /> : ""}
<a className={"fr color-blue font-16 "} href={"javascript:void(0)"} <a className={"fr color-blue font-16 "} href={"javascript:void(0)"}
onClick={this.addAccessory} style={{ 'marginTop': '-4px' }} onClick={this.addAccessory} style={{ 'marginTop': '-4px' }}
>补交附件</a> >补交附件</a>
</React.Fragment> </React.Fragment>
} }
</div> </div>
{ noTab !== true && <div className="stud-class-set bor-bottom-greyE floatSpinParent"> {noTab !== true && <div className="stud-class-set bor-bottom-greyE floatSpinParent">
<div className="mt10 clearfix edu-back-white poll_list pl5"> <div className="mt10 clearfix edu-back-white poll_list pl5">
<Link <Link
onClick={() => this.setState({moduleName: '作品列表'})} onClick={() => this.setState({ moduleName: '作品列表' })}
className={`${isListModule ? 'active' : '' } `} className={`${isListModule ? 'active' : ''} `}
to={`/courses/${courseId}/${moduleEngName}/${workId}/list`}>作品列表</Link> to={`/courses/${courseId}/${moduleEngName}/${workId}/list`}>作品列表</Link>
<Link <Link
onClick={() => this.setState({moduleName: '作业描述'})} onClick={() => this.setState({ moduleName: '作业描述' })}
className={`${childModuleName == '作业描述' ? 'active' : '' } `} className={`${childModuleName == '作业描述' ? 'active' : ''} `}
to={`/courses/${courseId}/${moduleEngName}/${workId}/question`}>作业描述</Link> to={`/courses/${courseId}/${moduleEngName}/${workId}/question`}>作业描述</Link>
{view_answer == true && <Link {view_answer == true && <Link
onClick={() => this.setState({moduleName: '参考答案'})} onClick={() => this.setState({ moduleName: '参考答案' })}
className={`${childModuleName == '参考答案' ? 'active' : '' } `} className={`${childModuleName == '参考答案' ? 'active' : ''} `}
to={`/courses/${courseId}/${moduleEngName}/${workId}/answer`}>参考答案</Link>} to={`/courses/${courseId}/${moduleEngName}/${workId}/answer`}>参考答案</Link>}
<Link <Link
onClick={() => this.setState({moduleName: '设置'})} onClick={() => this.setState({ moduleName: '设置' })}
className={`${childModuleName == '设置' ? 'active' : '' } `} className={`${childModuleName == '设置' ? 'active' : ''} `}
style={{paddingLeft:this.props.isAdmin()?'38px':'20px'}} style={{ paddingLeft: this.props.isAdmin() ? '38px' : '20px' }}
to={`/courses/${courseId}/${moduleEngName}/${workId}/setting`}>{this.props.isAdmin()?"设置":"得分规则"}</Link> to={`/courses/${courseId}/${moduleEngName}/${workId}/setting`}>{this.props.isAdmin() ? "设置" : "得分规则"}</Link>
{/* { this.props.tabRightComponents } */} {/* { this.props.tabRightComponents } */}
<React.Fragment> <React.Fragment>
<style>{` <style>{`
.drop_down_menu li a { .drop_down_menu li a {
padding: 0px; padding: 0px;
font-size: 14px; font-size: 14px;
@ -335,148 +293,141 @@ class CommonWorkDetailIndex extends Component{
float: right; float: right;
} }
`}</style> `}</style>
{this.props.isAdmin()? <Spin spinning={this.state.donwloading} style={{ }}> {this.props.isAdmin() ? <Spin spinning={this.state.donwloading} >
<li className="li_line drop_down fr color-blue font-16 mt20" style={{"padding":"0 20px"}}> <li className="li_line drop_down fr color-blue font-16 mt20" style={{ "padding": "0 20px" }}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i> 导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}> <ul className="drop_down_menu" style={{ "right": "-34px", "left": "unset", "height": "auto" }}>
<li> <li>
<a href={"javascript:void(0)"} className="color-dark"
onClick={() => this.confirmysl(exportResultUrl)}
>导出成绩</a>
</li>
<li>
<a href={"javascript:void(0)"} className="color-dark"
onClick={() => this.confirmysl(exportUrl)}
>导出作品附件</a>
</li>
</ul>
</li>
</Spin>:""}
{/* {isAdmin && <a className={"fr color-blue font-16"} href={exportUrl}></a>}
{isAdmin && <a className={"fr color-blue font-16"} href={exportResultUrl}>导出成绩</a>} */}
{/*<a className={"fr color-blue font-16"}>导出</a>*/}
{end_immediately && <a className={"fr color-blue font-16"} onClick={() => { this.endModal.current.open() } }>立即截止</a>}
{publish_immediately && <a className={"fr color-blue font-16"} onClick={() => { this.publishModal.current.open() } } >立即发布</a>}
{/*<a className={"fr color-blue font-16"}>项目在线质量检测</a>*/}
{isAdmin && <a className={"fr color-blue font-16"} onClick={() => this.props.toEditPage(this.props.match.params, workId)}>编辑作业</a>}
{ //
work_statuses && work_statuses.indexOf('关联项目') != -1 &&
<React.Fragment>
<ConnectProject ref="connectProject" {...this.props} connectSuccess={this.connectSuccess}></ConnectProject>
<WordsBtn style="blue" className={` font-16 fr`} onClick={() => this.openConnectionProject({ homework_id: workId })}>关联项目</WordsBtn>
<WordsBtn style="blue" className={` font-16 fr`} onClick={() => this.props.toCreateProject()}>创建项目</WordsBtn>
</React.Fragment>
}
{ //
work_statuses && work_statuses.indexOf('取消关联') != -1 &&
<WordsBtn style="blue" className={` font-16 fr`} onClick={() => this.cancelConnectionProject( {homework_id: workId} )}>取消关联</WordsBtn>
}
{work_statuses && work_statuses.indexOf('提交作品') != -1 && <a className={"fr color-blue font-16"} href={"javascript:void(0)"} <a href={"javascript:void(0)"} className="color-dark"
onClick={() => { this.props.toWorkPostPage(this.props.match.params)}} onClick={() => this.confirmysl(exportResultUrl)}
>提交作品</a>} >导出成绩</a>
{ work_statuses && work_statuses.indexOf('补交作品') != -1 &&
<a className={"fr color-blue font-16"} href={"javascript:void(0)"}
onClick={() => { this.props.toWorkPostPage(this.props.match.params)}}>
补交作品</a> }
{work_statuses && work_statuses.indexOf('修改作品') != -1 && <a className={"fr color-blue font-16"} href={"javascript:void(0)"}
onClick={() => { this.props.toWorkPostPage(this.props.match.params, null, true, work_id)}}
>修改作品</a>}
{work_statuses && work_statuses.indexOf('补交附件') != -1 &&
<React.Fragment>
<AccessoryModal
{...this.props}
modalname={"补交附件"}
visible={accessoryVisible}
Cancelname={"取消"}
Savesname={"确认"}
Cancel={this.Cancelvisible}
setupdate={this.setupdate}
reviseAttachmentUrl={`/student_works/${work_id}/revise_attachment.json`}
/>
<a className={"fr color-blue font-16"} href={"javascript:void(0)"}
onClick={this.addAccessory}
>补交附件</a>
</React.Fragment>
} </li>
<li>
<a href={"javascript:void(0)"} className="color-dark"
onClick={() => this.confirmysl(exportUrl)}
>导出作品附件</a>
</li>
</ul>
</li>
</Spin> : ""}
{isAdmin && <a className={"fr color-blue font-16"} onClick={() => this.props.toEditPage(this.props.match.params, workId)}>编辑作业</a>}
{ //
work_statuses && work_statuses.indexOf('关联项目') != -1 &&
<React.Fragment>
<ConnectProject {...this.props} connectSuccess={this.connectSuccess}></ConnectProject>
<WordsBtn style="blue" className={` font-16 fr`} onClick={() => this.openConnectionProject({ homework_id: workId })}>关联项目</WordsBtn>
<WordsBtn style="blue" className={` font-16 fr`} onClick={() => this.props.toCreateProject()}>创建项目</WordsBtn>
</React.Fragment>
}
{ //
work_statuses && work_statuses.indexOf('取消关联') != -1 &&
<WordsBtn style="blue" className={` font-16 fr`} onClick={() => this.cancelConnectionProject({ homework_id: workId })}>取消关联</WordsBtn>
}
{work_statuses && work_statuses.indexOf('提交作品') != -1 && <a className={"fr color-blue font-16"} href={"javascript:void(0)"}
onClick={() => { this.props.toWorkPostPage(this.props.match.params) }}
>提交作品</a>}
{work_statuses && work_statuses.indexOf('补交作品') != -1 &&
<a className={"fr color-blue font-16"} href={"javascript:void(0)"}
onClick={() => { this.props.toWorkPostPage(this.props.match.params) }}>
补交作品</a>}
{work_statuses && work_statuses.indexOf('修改作品') != -1 && <a className={"fr color-blue font-16"} href={"javascript:void(0)"}
onClick={() => { this.props.toWorkPostPage(this.props.match.params, null, true, work_id) }}
>修改作品</a>}
{work_statuses && work_statuses.indexOf('补交附件') != -1 &&
<React.Fragment>
<AccessoryModal
{...this.props}
modalname={"补交附件"}
visible={accessoryVisible}
Cancelname={"取消"}
Savesname={"确认"}
Cancel={this.Cancelvisible}
setupdate={this.setupdate}
reviseAttachmentUrl={`/student_works/${work_id}/revise_attachment.json`}
/>
<a className={"fr color-blue font-16"} href={"javascript:void(0)"}
onClick={this.addAccessory}
>补交附件</a>
</React.Fragment> </React.Fragment>
</div> }
</div> } </React.Fragment>
{/* 内容区 */} </div>
<Switch {...this.props}> </div>}
{/* --------------------------------------------------------------------- */} {/* 内容区 */}
<Switch {...this.props}>
{/* 作业设置 */} {/* --------------------------------------------------------------------- */}
{/* http://localhost:3007/courses/1309/homework/9300/setting */}
<Route exact path="/courses/:coursesId/common_homeworks/:workId/setting"
render={
(props) => (<CommonWorkSetting {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>
{/* 作品列表 */} {/* 作业设置 */}
<Route exact path="/courses/:coursesId/common_homeworks/:workId/list" {/* http://localhost:3007/courses/1309/homework/9300/setting */}
render={ <Route exact path="/courses/:coursesId/common_homeworks/:workId/setting"
(props) => (<CommonWorkList ref="commonWorkList" triggerRef={this.bindRef} {...this.props} {...props} {...this.state} {...commonHandler}/>) render={
} (props) => (<CommonWorkSetting {...this.props} {...props} {...this.state} {...commonHandler} />)
></Route> }
></Route>
{/* 作业问答 */} {/* 作品列表 */}
<Route exact path="/courses/:coursesId/common_homeworks/:workId/question" <Route exact path="/courses/:coursesId/common_homeworks/:workId/list"
render={ render={
(props) => (<CommonWorkQuestion {...this.props} {...props} {...this.state} {...commonHandler}/>) (props) => (<CommonWorkList triggerRef={this.bindRef} {...this.props} {...props} {...this.state} {...commonHandler} />)
} }
></Route> ></Route>
<Route exact path="/courses/:coursesId/common_homeworks/:workId/answer"
render={ {/* 作业问答 */}
(props) => (<CommonWorkAnswer {...this.props} {...props} {...this.state} {...commonHandler}/>) <Route exact path="/courses/:coursesId/common_homeworks/:workId/question"
} render={
></Route> (props) => (<CommonWorkQuestion {...this.props} {...props} {...this.state} {...commonHandler} />)
}
></Route>
<Route exact path="/courses/:coursesId/common_homeworks/:workId/answer"
render={
(props) => (<CommonWorkAnswer {...this.props} {...props} {...this.state} {...commonHandler} />)
}
></Route>
<Route exact path="/courses/:coursesId/group_homeworks/:workId/setting" <Route exact path="/courses/:coursesId/group_homeworks/:workId/setting"
render={ render={
(props) => (<CommonWorkSetting {...this.props} {...props} {...this.state} {...commonHandler}/>) (props) => (<CommonWorkSetting {...this.props} {...props} {...this.state} {...commonHandler} />)
} }
></Route> ></Route>
{/* 作品列表 */} {/* 作品列表 */}
<Route exact path="/courses/:coursesId/group_homeworks/:workId/list" <Route exact path="/courses/:coursesId/group_homeworks/:workId/list"
render={ render={
(props) => (<CommonWorkList triggerRef={this.bindRef} {...this.props} {...props} {...this.state} {...commonHandler}/>) (props) => (<CommonWorkList triggerRef={this.bindRef} {...this.props} {...props} {...this.state} {...commonHandler} />)
} }
></Route> ></Route>
{/* 作业问答 */} {/* 作业问答 */}
<Route exact path="/courses/:coursesId/group_homeworks/:workId/question" <Route exact path="/courses/:coursesId/group_homeworks/:workId/question"
render={ render={
(props) => (<CommonWorkQuestion {...this.props} {...props} {...this.state} {...commonHandler}/>) (props) => (<CommonWorkQuestion {...this.props} {...props} {...this.state} {...commonHandler} />)
} }
></Route> ></Route>
<Route exact path="/courses/:coursesId/group_homeworks/:workId/answer" <Route exact path="/courses/:coursesId/group_homeworks/:workId/answer"
render={ render={
(props) => (<CommonWorkAnswer {...this.props} {...props} {...this.state} {...commonHandler}/>) (props) => (<CommonWorkAnswer {...this.props} {...props} {...this.state} {...commonHandler} />)
} }
></Route> ></Route>
</Switch> </Switch>
</div>
</div> </div>
</div> </div>
</div>
) )
} }
} }
export default ( CommonWorkDetailIndex) ; export default (CommonWorkDetailIndex);

File diff suppressed because it is too large Load Diff

@ -1,97 +1,48 @@
import React,{Component} from "react"; import React, { Component } from "react";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip} from "antd"; import { Form } from "antd";
import {Link} from 'react-router-dom'; import { Link } from 'react-router-dom';
import locale from 'antd/lib/date-picker/locale/zh_CN';
import { WordsBtn } from 'educoder'; import { WordsBtn } from 'educoder';
import axios from 'axios';
import Modals from '../../modals/Modals';
import CoursesListType from '../coursesPublic/CoursesListType'; import CoursesListType from '../coursesPublic/CoursesListType';
import HomeworkModal from "../coursesPublic/HomeworkModal";
import moment from 'moment';
import '../css/Courses.css' import '../css/Courses.css'
const { Option} = Select;
const CheckboxGroup = Checkbox.Group;
const confirm = Modal.confirm;
let GraduationTasksnewtype=true;
const $ = window.$;
const Search = Input.Search;
const RadioGroup = Radio.Group;
function scrollTo(className) {
$("html").animate({ scrollTop: $(`${className}`).offset().top - 400 })
}
function range(start, end) {
const result = [];
for (let i = start; i < end; i++) {
result.push(i);
}
return result;
}
function disabledDateTime() {
return {
// disabledHours: () => range(0, 24).splice(4, 20),
disabledMinutes: () => range(1, 30).concat(range(31, 60)),
// disabledSeconds: () => [55, 56],
};
}
function handleDateString (dateString) {
if (!dateString) return dateString;
const ar = dateString.split(':')
if (ar[1] != '00' && ar[1] != '30') {
return [ar[0], '00'].join(':')
}
return dateString
}
// 类似页面 http://localhost:3007/courses/1309/graduation/graduation_tasks/48/76/setting // 类似页面 http://localhost:3007/courses/1309/graduation/graduation_tasks/48/76/setting
class CommonWorkSetting extends Component{ class CommonWorkSetting extends Component {
constructor(props){ constructor(props) {
super(props) super(props)
this.state={ this.state = {
course_name:"", course_name: "",
homework_name:"", homework_name: "",
} }
} }
render(){ render() {
const { getFieldDecorator } = this.props.form;
const dateFormat = 'YYYY-MM-DD HH:mm';
let {course_name, homework_name
} =this.state;
let courseId=this.props.match.params.coursesId; let { course_name, homework_name } = this.state;
let category_id=this.props.match.params.category_id; let courseId = this.props.match.params.coursesId;
let task_Id=this.props.match.params.task_Id; let category_id = this.props.match.params.category_id;
const radioStyle = { let task_Id = this.props.match.params.task_Id;
display: 'block',
height: '30px',
lineHeight: '30px',
};
return (
return(
<React.Fragment> <React.Fragment>
{ <div> {<div>
<div className="newMain clearfix"> <div className="newMain clearfix">
<div className={"educontent mb20"}> <div className={"educontent mb20"}>
<p className="clearfix mt10"> <p className="clearfix mt10">
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId} className="color-grey-6">{course_name}</Link></WordsBtn> <WordsBtn style="grey" className="fl"> <Link to={"/courses/" + courseId} className="color-grey-6">{course_name}</Link></WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation"} className="color-grey-6">毕设任务</Link></WordsBtn> <WordsBtn style="grey" className="fl"> <Link to={"/courses/" + courseId + "/graduation"} className="color-grey-6">毕设任务</Link></WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span>任务详情</span> <span>任务详情</span>
</p> </p>
<div style={{ width:'100%',height:'75px'}} > <div style={{ width: '100%', height: '75px' }} >
<p className=" fl color-black mt25 summaryname"> <p className=" fl color-black mt25 summaryname">
<Link to={"/courses/"+courseId+"/graduation"+"/graduation_tasks/"}>{homework_name}</Link> <Link to={"/courses/" + courseId + "/graduation" + "/graduation_tasks/"}>{homework_name}</Link>
</p> </p>
<CoursesListType <CoursesListType
typelist={["已开启补交"]} typelist={["已开启补交"]}
@ -103,25 +54,25 @@ class CommonWorkSetting extends Component{
<div className="stud-class-set bor-bottom-greyE"> <div className="stud-class-set bor-bottom-greyE">
<div className="mt10 clearfix edu-back-white poll_list pl20"> <div className="mt10 clearfix edu-back-white poll_list pl20">
<Link <Link
className="active" className="active"
to={"/courses/"+courseId+"/graduation/graduation_tasks/"+category_id+"/"+task_Id+"/list"}>作品列表</Link> to={"/courses/" + courseId + "/graduation/graduation_tasks/" + category_id + "/" + task_Id + "/list"}>作品列表</Link>
<Link to={"/courses/"+courseId+"/graduation/graduation_tasks/"+category_id+"/"+task_Id+"/questions"}>作业描述</Link> <Link to={"/courses/" + courseId + "/graduation/graduation_tasks/" + category_id + "/" + task_Id + "/questions"}>作业描述</Link>
<Link to={"/courses/"+courseId+"/graduation/graduation_tasks/"+category_id+"/"+task_Id+"/questions"}>参考答案</Link> <Link to={"/courses/" + courseId + "/graduation/graduation_tasks/" + category_id + "/" + task_Id + "/questions"}>参考答案</Link>
<Link <Link
style={{paddingLeft:'38px'}} style={{ paddingLeft: '38px' }}
to={"/courses/"+courseId+"/graduation/graduation_tasks/"+category_id+"/"+task_Id+"/setting"}>设置</Link> to={"/courses/" + courseId + "/graduation/graduation_tasks/" + category_id + "/" + task_Id + "/setting"}>设置</Link>
<a className={"fr color-blue font-16"} onClick={() => { this.end()} }>立即截止</a> <a className={"fr color-blue font-16"} onClick={() => { this.end() }}>立即截止</a>
<a className={"fr color-blue font-16"} onClick={() => { this.publish()} }>立即发布</a> <a className={"fr color-blue font-16"} onClick={() => { this.publish() }}>立即发布</a>
<a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation/graduation_tasks/"+task_Id+"/edit"}>编辑作业</a> <a className={"fr color-blue font-16"} href={"/courses/" + courseId + "/graduation/graduation_tasks/" + task_Id + "/edit"}>编辑作业</a>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>} </div>}

@ -1,13 +1,10 @@
import React,{ Component } from "react"; import React, { Component } from "react";
import { Input, InputNumber, Form, Button, Checkbox, Upload, Icon, message, Modal } from "antd"; import { Input, InputNumber, Form, Button, Checkbox, Upload, Icon } from "antd";
import axios from 'axios' import axios from 'axios'
import '../css/busyWork.css' import '../css/busyWork.css'
import '../css/Courses.css' import '../css/Courses.css'
import {getUploadActionUrl, ConditionToolTip, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll } from 'educoder' import { getUploadActionUrl, ConditionToolTip, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll } from 'educoder'
import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor';
import CBreadcrumb from '../common/CBreadcrumb'
const confirm = Modal.confirm;
const $ = window.$ const $ = window.$
const MAX_TITLE_LENGTH = 60; const MAX_TITLE_LENGTH = 60;
@ -15,14 +12,14 @@ const MAX_TITLE_LENGTH = 60;
需要注意的props 需要注意的props
isGroup isGroup
*/ */
class NewWorkForm extends Component{ class NewWorkForm extends Component {
constructor(props){ constructor(props) {
super(props); super(props);
this.contentMdRef = React.createRef(); this.contentMdRef = React.createRef();
this.answerMdRef = React.createRef(); this.answerMdRef = React.createRef();
this.state={ this.state = {
title_value:"", title_value: "",
title_num: 0, title_num: 0,
contentFileList: [], contentFileList: [],
answerFileList: [], answerFileList: [],
@ -34,81 +31,81 @@ class NewWorkForm extends Component{
} }
} }
initValue = (data) => { initValue = (data) => {
if (data.isEdit) { if (data.isEdit) {
const contentFileList = data.attachments.map(item => { const contentFileList = data.attachments.map(item => {
return { return {
id: item.id, id: item.id,
uid: item.id, uid: item.id,
name: appendFileSizeToUploadFile(item), name: appendFileSizeToUploadFile(item),
url: item.url, url: item.url,
filesize: item.filesize, filesize: item.filesize,
status: 'done' status: 'done'
} }
}) })
const answerFileList = data.ref_attachments.map(item => { const answerFileList = data.ref_attachments.map(item => {
return { return {
id: item.id, id: item.id,
uid: item.id, uid: item.id,
name: appendFileSizeToUploadFile(item), name: appendFileSizeToUploadFile(item),
url: item.url, url: item.url,
filesize: item.filesize, filesize: item.filesize,
status: 'done' status: 'done'
} }
}) })
this.setState({
...data,
// course_id: data.course_id,
// course_name: data.course_name,
// category: data.category,
title_num: parseInt(data.name.length),
workLoaded: true,
init_min_num: data.min_num,
init_max_num: data.max_num,
// description: data.description,
reference_answer: data.reference_answer,
contentFileList,
answerFileList,
}, () => {
// setTimeout(() => {
// this._scrollToTop()
// 阻止setValue的滚动
// $(window).scroll( function() {
// $("html").scrollTop(0)
// $(window).unbind("scroll");
// });
/**
setValue会调用到 codemirror的 o.scrollIntoView(i), 会导致滚动条跳动
*/
// $('.editormd').parent().css('position', 'fixed').css('left', '-1000px')
// this.contentMdRef.current.setValue(data.description || '')
// this.answerMdRef.current.setValue(data.reference_answer || '')
// setTimeout(() => {
// $('.editormd').parent().css('position', '').css('left', 'auto')
// }, 100);
// }, 500)
this.props.form.setFieldsValue({
title: data.name,
description: data.description || '',
reference_answer: data.reference_answer || '',
});
})
} else { // new
} this.setState({
...data,
// course_id: data.course_id,
// course_name: data.course_name,
// category: data.category,
title_num: parseInt(data.name.length),
workLoaded: true,
init_min_num: data.min_num,
init_max_num: data.max_num,
// description: data.description,
reference_answer: data.reference_answer,
contentFileList,
answerFileList,
}, () => {
// setTimeout(() => {
// this._scrollToTop()
// 阻止setValue的滚动
// $(window).scroll( function() {
// $("html").scrollTop(0)
// $(window).unbind("scroll");
// });
/**
setValue会调用到 codemirror的 o.scrollIntoView(i), 会导致滚动条跳动
*/
// $('.editormd').parent().css('position', 'fixed').css('left', '-1000px')
// this.contentMdRef.current.setValue(data.description || '')
// this.answerMdRef.current.setValue(data.reference_answer || '')
// setTimeout(() => {
// $('.editormd').parent().css('position', '').css('left', 'auto')
// }, 100);
// }, 500)
this.props.form.setFieldsValue({
title: data.name,
description: data.description || '',
reference_answer: data.reference_answer || '',
});
})
} else { // new
}
// this._scrollToTop() // this._scrollToTop()
} }
_scrollToTop = () => { _scrollToTop = () => {
// setTimeout(() => { // setTimeout(() => {
$("html").scrollTop(0) $("html").scrollTop(0)
// $("html").animate({ scrollTop: 0 }) // $("html").animate({ scrollTop: 0 })
// }, 1000) // }, 1000)
} }
// 输入title // 输入title
changeTitle=(e)=>{ changeTitle = (e) => {
this.setState({ this.setState({
title_num: parseInt(e.target.value.length) title_num: parseInt(e.target.value.length)
@ -117,18 +114,18 @@ class NewWorkForm extends Component{
handleSubmit = () => { handleSubmit = () => {
const courseId = this.state.course_id || this.props.match.params.coursesId ; const courseId = this.state.course_id || this.props.match.params.coursesId;
this.props.form.validateFieldsAndScroll((err, values) => { this.props.form.validateFieldsAndScroll((err, values) => {
if(err && err.personNum) delete err.personNum; if (err && err.personNum) delete err.personNum;
const mdContnet = this.contentMdRef.current.getValue().trim(); const mdContnet = this.contentMdRef.current.getValue().trim();
values.description = mdContnet; values.description = mdContnet;
// return; // return;
{/* max={has_commit ? init_min_num : null } */} {/* max={has_commit ? init_min_num : null } */ }
{/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */} {/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */ }
// 已有提交作品,人数范围只能扩大 // 已有提交作品,人数范围只能扩大
const { has_commit, max_num, init_max_num, min_num, init_min_num } = this.state; const { has_commit, max_num, init_max_num, min_num, init_min_num } = this.state;
const isGroup = this.props.isGroup() const isGroup = this.props.isGroup()
@ -237,7 +234,7 @@ class NewWorkForm extends Component{
} }
onAttachmentRemove = (file, stateName) => { onAttachmentRemove = (file, stateName) => {
if(!file.percent || file.percent == 100){ if (!file.percent || file.percent == 100) {
this.props.confirm({ this.props.confirm({
content: '是否确认删除?', content: '是否确认删除?',
@ -316,18 +313,18 @@ class NewWorkForm extends Component{
this._scrollToTop() this._scrollToTop()
} }
render(){ render() {
let {typeId,coursesId,pageType}=this.props.match.params; let { typeId, coursesId, pageType } = this.props.match.params;
const { getFieldDecorator } = this.props.form; const { getFieldDecorator } = this.props.form;
const isGroup = this.props.isGroup() const isGroup = this.props.isGroup()
let{ let {
title_value, contentFileList, answerFileList, max_num, min_num, base_on_project, title_value, contentFileList, answerFileList, max_num, min_num, base_on_project,
init_max_num, init_min_num, init_max_num, init_min_num,
title_num, course_name, category, has_commit, has_project title_num, course_name, category, has_commit, has_project
}=this.state } = this.state
const { current_user } = this.props const { current_user } = this.props
const courseId = this.state.course_id || this.props.match.params.coursesId ; const courseId = this.state.course_id || this.props.match.params.coursesId;
this.isEdit = this.isEdit || this.props.match.url.indexOf('/edit') != -1 this.isEdit = this.isEdit || this.props.match.url.indexOf('/edit') != -1
if ((this.isEdit) && !this.state.description && this.state.description != '') { if ((this.isEdit) && !this.state.description && this.state.description != '') {
return '' return ''
@ -371,34 +368,34 @@ class NewWorkForm extends Component{
}, },
}; };
return( return (
<React.Fragment> <React.Fragment>
<style> <style>
{ {
` `
.yslnewworkinputaddonAfter .ant-input{ .yslnewworkinputaddonAfter .ant-input{
border-right: none !important; border-right: none !important;
height: 40px !important; height: 40px !important;
} }
` `
} }
</style> </style>
<Form className="courseForm"> <Form className="courseForm">
<Form.Item <Form.Item
label="标题" label="标题"
className="AboutInputForm" className="AboutInputForm"
> >
{getFieldDecorator('title', { {getFieldDecorator('title', {
rules: [{ rules: [{
required: true, message: '请输入标题' required: true, message: '请输入标题'
}], }],
})( })(
<Input placeholder="请输入作业标题最大限制60个字符" onInput={this.changeTitle} className="searchView yslnewworkinputaddonAfter searchViewAfter" style={{"width":"100%"}} maxLength={MAX_TITLE_LENGTH} addonAfter={`${String(title_num)}/${MAX_TITLE_LENGTH}`}/> <Input placeholder="请输入作业标题最大限制60个字符" onInput={this.changeTitle} className="searchView yslnewworkinputaddonAfter searchViewAfter" style={{ "width": "100%" }} maxLength={MAX_TITLE_LENGTH} addonAfter={`${String(title_num)}/${MAX_TITLE_LENGTH}`} />
)} )}
</Form.Item> </Form.Item>
<style>{` <style>{`
.uploadBtn.ant-btn { .uploadBtn.ant-btn {
border: none; border: none;
color: #4CACFF; color: #4CACFF;
@ -445,107 +442,107 @@ class NewWorkForm extends Component{
`}</style> `}</style>
{ <Form.Item {<Form.Item
label="内容" label="内容"
className="AboutInputForm workContent mdInForm" className="AboutInputForm workContent mdInForm"
> >
{getFieldDecorator('description', { {getFieldDecorator('description', {
rules: [{ rules: [{
required: true, message: '请输入作业内容和要求', required: true, message: '请输入作业内容和要求',
},{ }, {
max: 5000 , message:'最大限制5000个字符' max: 5000, message: '最大限制5000个字符'
}], }],
})( })(
<TPMMDEditor ref={this.contentMdRef} placeholder="请在此输入作业内容和要求,最大限制5000个字符" mdID={'courseContentMD'} refreshTimeout={1500} <TPMMDEditor ref={this.contentMdRef} placeholder="请在此输入作业内容和要求,最大限制5000个字符" mdID={'courseContentMD'} refreshTimeout={1500}
initValue={this.state.description} noSetValueOnInit={!!this.isEdit} initValue={this.state.description} noSetValueOnInit={!!this.isEdit}
className="courseMessageMD" ></TPMMDEditor> className="courseMessageMD" ></TPMMDEditor>
)} )}
</Form.Item> } </Form.Item>}
<Upload {...uploadProps} className="upload_1 newWorkUpload"> <Upload {...uploadProps} className="upload_1 newWorkUpload">
<Button className="uploadBtn"> <Button className="uploadBtn">
<Icon type="upload" /> 上传附件 <Icon type="upload" /> 上传附件
</Button> </Button>
(单个文件150M以内) (单个文件150M以内)
</Upload> </Upload>
<span id={"numberofgroups"}></span> <span id={"numberofgroups"}></span>
{ isGroup && {isGroup &&
<Form.Item <Form.Item
label="分组设置" label="分组设置"
className="AboutInputForm groupSetting" className="AboutInputForm groupSetting"
> >
{getFieldDecorator('personNum', { {getFieldDecorator('personNum', {
validateTrigger: 'onNone', validateTrigger: 'onNone',
// rules: [{ // rules: [{
// required: true, // required: true,
// message: '人数不能为空' // message: '人数不能为空'
// validator: this.personNumValidator // validator: this.personNumValidator
// required: true, message: '请输入最小人数和最大人数' // required: true, message: '请输入最小人数和最大人数'
// }], // }],
})( })(
<div > <div >
<p className="clearfix"> <p className="clearfix">
<ConditionToolTip condition={has_commit} title={'已有提交作品,人数范围只能扩大'}> <ConditionToolTip condition={has_commit} title={'已有提交作品,人数范围只能扩大'}>
{/* max={has_commit ? init_min_num : null } */} {/* max={has_commit ? init_min_num : null } */}
<InputNumber placeholder="请填写每组最小人数" min={1} className="winput-240-40" value={min_num} <InputNumber placeholder="请填写每组最小人数" min={1} className="winput-240-40" value={min_num}
onChange={this.min_num_change} style={{width:'180px'}} /> onChange={this.min_num_change} style={{ width: '180px' }} />
</ConditionToolTip> </ConditionToolTip>
<span className="ml15 mr15">~</span> <span className="ml15 mr15">~</span>
{/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */} {/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */}
<ConditionToolTip condition={has_commit} title={'已有提交作品,人数范围只能扩大'}> <ConditionToolTip condition={has_commit} title={'已有提交作品,人数范围只能扩大'}>
<InputNumber className="winput-240-40" placeholder="请填写每组最大人数" value={max_num} max={10} <InputNumber className="winput-240-40" placeholder="请填写每组最大人数" value={max_num} max={10}
onChange={this.max_num_change} style={{width:'180px'}} /> onChange={this.max_num_change} style={{ width: '180px' }} />
</ConditionToolTip> </ConditionToolTip>
<label className="color-grey-9 ml20 font-14">学生提交作品时需要关联同组成员组内成员作品共享</label> <label className="color-grey-9 ml20 font-14">学生提交作品时需要关联同组成员组内成员作品共享</label>
</p> </p>
<p className="mt20"> <p className="mt20">
<ConditionToolTip condition={has_commit || has_project} title={'已有关联项目或作品,不能修改'}> <ConditionToolTip condition={has_commit || has_project} title={'已有关联项目或作品,不能修改'}>
<Checkbox checked={base_on_project} onChange={this.base_on_project_change} <Checkbox checked={base_on_project} onChange={this.base_on_project_change}
disabled={has_project || has_commit} disabled={has_project || has_commit}
>基于项目实施</Checkbox> >基于项目实施</Checkbox>
</ConditionToolTip> </ConditionToolTip>
<label className="color-grey-9 ml12 font-14">选中则必须在本平台创建项目项目管理员可以提交作品不选中无需在平台创建项目任意小组成员均可以提交作品</label> <label className="color-grey-9 ml12 font-14">选中则必须在本平台创建项目项目管理员可以提交作品不选中无需在平台创建项目任意小组成员均可以提交作品</label>
</p> </p>
</div> </div>
)} )}
</Form.Item> </Form.Item>
} }
<div className="edu-back-white"> <div className="edu-back-white">
<Form.Item <Form.Item
label="参考答案" label="参考答案"
className="AboutInputForm clearPaddingBottom pr" className="AboutInputForm clearPaddingBottom pr"
style={{"borderBottom":"none"}} style={{ "borderBottom": "none" }}
> >
{getFieldDecorator('reference_answer', { {getFieldDecorator('reference_answer', {
rules: [{ rules: [{
max: 5000 , message:'最大限制5000个字符' max: 5000, message: '最大限制5000个字符'
}], }],
})( })(
<TPMMDEditor ref={this.answerMdRef} placeholder="请在此输入作业的参考答案,最大限制5000个字符" mdID={'workAnswerMD'} <TPMMDEditor ref={this.answerMdRef} placeholder="请在此输入作业的参考答案,最大限制5000个字符" mdID={'workAnswerMD'}
initValue={this.state.reference_answer || ''} noSetValueOnInit={!!this.isEdit} initValue={this.state.reference_answer || ''} noSetValueOnInit={!!this.isEdit}
className="courseMessageMD" refreshTimeout={1500} ></TPMMDEditor> className="courseMessageMD" refreshTimeout={1500} ></TPMMDEditor>
)} )}
</Form.Item> </Form.Item>
<Upload {...answerUploadProps} className="upload_1 newWorkUpload resetNewWorkUpload"> <Upload {...answerUploadProps} className="upload_1 newWorkUpload resetNewWorkUpload">
<Button className="uploadBtn"> <Button className="uploadBtn">
<Icon type="upload" /> 上传附件 <Icon type="upload" /> 上传附件
</Button> </Button>
(单个文件150M以内) (单个文件150M以内)
</Upload> </Upload>
</div> </div>
<Form.Item> <Form.Item>
<div className="clearfix mt30 mb30"> <div className="clearfix mt30 mb30">
{/* htmlType="submit" */} {/* htmlType="submit" */}
<Button type="primary" onClick={this.handleSubmit} className="defalutSubmitbtn fl mr20">提交</Button> <Button type="primary" onClick={this.handleSubmit} className="defalutSubmitbtn fl mr20">提交</Button>
<a className="defalutCancelbtn fl" onClick={() => this.props.onCancel()}>取消</ a> <a className="defalutCancelbtn fl" onClick={() => this.props.onCancel()}>取消</ a>
</div> </div>
</Form.Item> </Form.Item>
</Form> </Form>
</React.Fragment> </React.Fragment>
) )

@ -1,30 +1,29 @@
import React,{ Component } from "react"; import React, { Component } from "react";
import { Input,Checkbox,Menu,Pagination } from "antd"; import { Input, Checkbox, Menu, Pagination } from "antd";
import HomeworkModal from '../coursesPublic/HomeworkModal'; import HomeworkModal from '../coursesPublic/HomeworkModal';
import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal"; import OneSelfOrderModal from "../coursesPublic/OneSelfOrderModal";
import axios from 'axios' import axios from 'axios'
import moment from 'moment' import moment from 'moment'
import { getNextHalfHourOfMoment } from 'educoder' class PublishRightnow extends Component {
class PublishRightnow extends Component{ constructor(props) {
constructor(props){
super(props); super(props);
this.state={ this.state = {
course_groups: [], course_groups: [],
modalname:undefined, modalname: undefined,
modaltype:undefined, modaltype: undefined,
visible:false, visible: false,
Topval:undefined, Topval: undefined,
Botvalleft:undefined, Botvalleft: undefined,
Botval:undefined, Botval: undefined,
starttime:undefined, starttime: undefined,
endtime:undefined, endtime: undefined,
Cancelname:undefined, Cancelname: undefined,
Savesname:undefined, Savesname: undefined,
Cancel:undefined, Cancel: undefined,
Saves:undefined, Saves: undefined,
Topvalright:undefined Topvalright: undefined
} }
} }
open = (usingCheckBeforePost) => { open = (usingCheckBeforePost) => {
@ -32,13 +31,13 @@ class PublishRightnow extends Component{
this.homeworkstart() this.homeworkstart()
} }
homeworkstart=()=>{ homeworkstart = () => {
const isPublish = this.props.isPublish; const isPublish = this.props.isPublish;
const isPublishtype = this.props.isPublishtype; const isPublishtype = this.props.isPublishtype;
let showdatatypes=isPublish===true||isPublishtype===1; let showdatatypes = isPublish === true || isPublishtype === 1;
if (!this.props.checkBoxValues || this.props.checkBoxValues.length == 0) { if (!this.props.checkBoxValues || this.props.checkBoxValues.length == 0) {
this.props.showNotification(`请先选择要立即${showdatatypes? "发布" : "截止"}的作业`) this.props.showNotification(`请先选择要立即${showdatatypes ? "发布" : "截止"}的作业`)
return; return;
} }
@ -48,55 +47,54 @@ class PublishRightnow extends Component{
} }
showDialog = (course_groups) => { showDialog = (course_groups) => {
const isPublish = this.props.isPublish; const isPublish = this.props.isPublish;
const isPublishtype = this.props.isPublishtype; const isPublishtype = this.props.isPublishtype;
const dateFormat = 'YYYY-MM-DD HH:mm'; const dateFormat = 'YYYY-MM-DD HH:mm';
let showdatatype=isPublish===true&&isPublishtype===undefined; let showdatatype = isPublish === true && isPublishtype === undefined;
let showdatatypes=isPublish===true||isPublishtype===1; let showdatatypes = isPublish === true || isPublishtype === 1;
// getNextHalfHourOfMoment // getNextHalfHourOfMoment
const startMoment = (moment()); const startMoment = (moment());
this.setState({ this.setState({
modalname: showdatatypes ? "立即发布" : "立即截止", modalname: showdatatypes ? "立即发布" : "立即截止",
modaltype:course_groups.length> 0 ? 1 : 2, modaltype: course_groups.length > 0 ? 1 : 2,
visible:showdatatype?false:true, visible: showdatatype ? false : true,
OneSelftype:showdatatype?true:false, OneSelftype: showdatatype ? true : false,
Topval:showdatatypes ? "学生将立即收到作业" : "学生将不能再提交作品", Topval: showdatatypes ? "学生将立即收到作业" : "学生将不能再提交作品",
// Botvalleft: isPublish ? "暂不发布" : "暂不截止", // Botvalleft: isPublish ? "暂不发布" : "暂不截止",
Botval: this.props.fromListPage ? (showdatatypes ? "本操作只对“未发布”的作业有效" : "本操作只对“提交中”的作业有效") : '', Botval: this.props.fromListPage ? (showdatatypes ? "本操作只对“未发布”的作业有效" : "本操作只对“提交中”的作业有效") : '',
starttime: showdatatypes? `发布时间:${startMoment.format(dateFormat)}` : '', starttime: showdatatypes ? `发布时间:${startMoment.format(dateFormat)}` : '',
starttimes:showdatatypes? `${startMoment.format(dateFormat)}` : '', starttimes: showdatatypes ? `${startMoment.format(dateFormat)}` : '',
endtime:showdatatypes ? `截止时间:${startMoment.add(1, 'months').add(1, 'hours').minutes(0).format(dateFormat)}` : '', endtime: showdatatypes ? `截止时间:${startMoment.add(1, 'months').add(1, 'hours').minutes(0).format(dateFormat)}` : '',
Cancelname:showdatatypes ? "暂不发布" : "暂不截止", Cancelname: showdatatypes ? "暂不发布" : "暂不截止",
Savesname:showdatatypes ? "立即发布" : "立即截止", Savesname: showdatatypes ? "立即发布" : "立即截止",
Cancel:this.homeworkhide, Cancel: this.homeworkhide,
Saves:this.homeworkstartend, Saves: this.homeworkstartend,
typs:showdatatypes ? "start" : "end", typs: showdatatypes ? "start" : "end",
}) })
} }
homeworkhide=()=>{ homeworkhide = () => {
this.setState({ this.setState({
modalname:undefined, modalname: undefined,
modaltype:undefined, modaltype: undefined,
visible:false, visible: false,
OneSelftype:false, OneSelftype: false,
Topval:undefined, Topval: undefined,
Topvalright:undefined, Topvalright: undefined,
Botvalleft:undefined, Botvalleft: undefined,
Botval:undefined, Botval: undefined,
starttime:undefined, starttime: undefined,
endtime:undefined, endtime: undefined,
Cancelname:undefined, Cancelname: undefined,
Savesname:undefined, Savesname: undefined,
Cancel:undefined, Cancel: undefined,
Saves:undefined, Saves: undefined,
StudentList_value:undefined, StudentList_value: undefined,
addname:undefined, addname: undefined,
addnametype:false, addnametype: false,
addnametab:undefined addnametab: undefined
}) })
} }
homeworkstartend=(arg_group_ids,endtime)=>{ homeworkstartend = (arg_group_ids, endtime) => {
debugger
if (this.usingCheckBeforePost && this.props.checkBeforePost) { if (this.usingCheckBeforePost && this.props.checkBeforePost) {
const goOn = this.props.checkBeforePost(); const goOn = this.props.checkBeforePost();
if (!goOn) { if (!goOn) {
@ -104,7 +102,6 @@ class PublishRightnow extends Component{
return; return;
} }
} }
debugger
const isPublish = this.props.isPublish; const isPublish = this.props.isPublish;
let group_ids = arg_group_ids let group_ids = arg_group_ids
if (this.usingCheckBeforePost) { if (this.usingCheckBeforePost) {
@ -112,46 +109,45 @@ class PublishRightnow extends Component{
return item.id return item.id
}) })
} }
debugger if (this.state.course_groups.length > 0) {
if(this.state.course_groups.length>0){ if (this.state.course_groups.length && (!group_ids || group_ids && group_ids.length == 0)) {
if (this.state.course_groups.length && (!group_ids || group_ids&&group_ids.length == 0)) {
this.props.showNotification('请至少选择一个分班'); this.props.showNotification('请至少选择一个分班');
return; return;
} }
} }
let data={} let data = {}
if(arg_group_ids&&arg_group_ids.length===0){ if (arg_group_ids && arg_group_ids.length === 0) {
data = { data = {
homework_ids: this.props.checkBoxValues, homework_ids: this.props.checkBoxValues,
end_time: endtime==="Invalid date"?undefined:endtime, end_time: endtime === "Invalid date" ? undefined : endtime,
} }
}else if(this.props.islist===true){ } else if (this.props.islist === true) {
data={ data = {
homework_ids: this.props.checkBoxValues, homework_ids: this.props.checkBoxValues,
group_ids: group_ids, group_ids: group_ids,
end_time:endtime, end_time: endtime,
} }
}else{ } else {
data={ data = {
homework_ids: this.props.checkBoxValues, homework_ids: this.props.checkBoxValues,
group_ids: group_ids, group_ids: group_ids,
group_end_times:endtime, group_end_times: endtime,
detail:true detail: true
} }
} }
const isPublishtype = this.props.isPublishtype; const isPublishtype = this.props.isPublishtype;
let showdatatypes=isPublish===true||isPublishtype===1; let showdatatypes = isPublish === true || isPublishtype === 1;
let coursesId=this.props.match.params.coursesId; let coursesId = this.props.match.params.coursesId;
const url = `/courses/${coursesId}/homework_commons/${showdatatypes ? "publish_homework" : "end_homework"}.json` const url = `/courses/${coursesId}/homework_commons/${showdatatypes ? "publish_homework" : "end_homework"}.json`
axios.post(url, data) axios.post(url, data)
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.status == 0) {
this.homeworkhide() this.homeworkhide()
this.props.showNotification(showdatatypes ? "立即发布成功" : "立即截止成功") this.props.showNotification(showdatatypes ? "立即发布成功" : "立即截止成功")
this.props.doWhenSuccess && this.props.doWhenSuccess() this.props.doWhenSuccess && this.props.doWhenSuccess()
this.setState({ visible : false }) this.setState({ visible: false })
this.props.action && this.props.action() this.props.action && this.props.action()
} }
}) })
.catch(function (error) { .catch(function (error) {
@ -159,34 +155,34 @@ class PublishRightnow extends Component{
}); });
} }
// componentDidUpdate = (prevProps) => { // componentDidUpdate = (prevProps) => {
// if ( prevProps.match.params.boardId != this.props.match.params.boardId ) { // if ( prevProps.match.params.boardId != this.props.match.params.boardId ) {
// this.fetchAll(null, 1) // this.fetchAll(null, 1)
// } // }
// } // }
fetchCourseGroups = () => { fetchCourseGroups = () => {
const isPublish = this.props.isPublish; const isPublish = this.props.isPublish;
const isPublishtype = this.props.isPublishtype; const isPublishtype = this.props.isPublishtype;
let showdatatypes=isPublish===true||isPublishtype===1; let showdatatypes = isPublish === true || isPublishtype === 1;
let coursesId=this.props.match.params.coursesId; let coursesId = this.props.match.params.coursesId;
// TODO 这里要改成单选作业,接口使用这个 https://www.showdoc.cc/127895880302646?page_id=2035541497546668 // TODO 这里要改成单选作业,接口使用这个 https://www.showdoc.cc/127895880302646?page_id=2035541497546668
// /homework_commons/:id/publish_groups.json // /homework_commons/:id/publish_groups.json
let url = `/courses/${coursesId}/all_course_groups.json` let url = `/courses/${coursesId}/all_course_groups.json`
if (this.props.checkBoxValues.length == 1) { if (this.props.checkBoxValues.length == 1) {
const isPublish = this.props.isPublish; const isPublish = this.props.isPublish;
url = `/homework_commons/${this.props.checkBoxValues[0]}/${ showdatatypes ? 'publish_groups' : 'end_groups'}.json` url = `/homework_commons/${this.props.checkBoxValues[0]}/${showdatatypes ? 'publish_groups' : 'end_groups'}.json`
} }
axios.get(url, { axios.get(url, {
}) })
.then((response) => { .then((response) => {
if (!response || response.data.status == -1) { if (!response || response.data.status == -1) {
this.setState({ visible : false }) this.setState({ visible: false })
return; return;
} }
this.showDialog(response.data.course_groups) this.showDialog(response.data.course_groups)
this.setState({ this.setState({
course_groups: response.data.course_groups, course_groups: response.data.course_groups,
starttimesend:response.data.end_time===undefined||response.data.end_time===null||response.data.end_time===""?undefined:response.data.end_time, starttimesend: response.data.end_time === undefined || response.data.end_time === null || response.data.end_time === "" ? undefined : response.data.end_time,
}) })
}) })
.catch(function (error) { .catch(function (error) {
@ -194,12 +190,12 @@ class PublishRightnow extends Component{
}); });
} }
render(){ render() {
const isPublish = this.props.isPublish; const isPublish = this.props.isPublish;
const isPublishtype = this.props.isPublishtype; const isPublishtype = this.props.isPublishtype;
let showdatatypes=isPublish===true||isPublishtype===1; let showdatatypes = isPublish === true || isPublishtype === 1;
let{ let {
Topvalright, Topvalright,
modalname, modalname,
modaltype, modaltype,
@ -208,20 +204,20 @@ class PublishRightnow extends Component{
Botvalleft, Botvalleft,
Botval, Botval,
starttime, starttime,
starttimes, starttimes,
endtime, endtime,
Cancelname, Cancelname,
Savesname, Savesname,
Cancel, Cancel,
Saves, Saves,
course_groups course_groups
}=this.state } = this.state
const { showActionButton } = this.props const { showActionButton } = this.props
return( return (
<div> <div>
{/*立即截止*/} {/*立即截止*/}
{visible===true?<HomeworkModal {visible === true ? <HomeworkModal
modaltype={modaltype} modaltype={modaltype}
modalname={modalname} modalname={modalname}
visible={visible} visible={visible}
@ -230,38 +226,38 @@ class PublishRightnow extends Component{
Botvalleft={Botvalleft} Botvalleft={Botvalleft}
Botval={Botval} Botval={Botval}
starttime={starttime} starttime={starttime}
starttimes={starttimes} starttimes={starttimes}
endtime={endtime} endtime={endtime}
Cancelname={Cancelname} Cancelname={Cancelname}
Savesname={Savesname} Savesname={Savesname}
Cancel={Cancel} Cancel={Cancel}
Saves={Saves} Saves={Saves}
course_groups={course_groups} course_groups={course_groups}
usingCheckBeforePost= {this.usingCheckBeforePost} usingCheckBeforePost={this.usingCheckBeforePost}
onToPublishClick={this.props.onToPublishClick} onToPublishClick={this.props.onToPublishClick}
typs={this.state.typs} typs={this.state.typs}
/>:""} /> : ""}
{/*立即发布*/} {/*立即发布*/}
{this.state.OneSelftype===true?<OneSelfOrderModal {this.state.OneSelftype === true ? <OneSelfOrderModal
modaltype={this.state.modaltype} modaltype={this.state.modaltype}
modalname={this.state.modalname} modalname={this.state.modalname}
OneSelftype={this.state.OneSelftype} OneSelftype={this.state.OneSelftype}
Topval={this.state.Topval} Topval={this.state.Topval}
Topvalright={this.state.Topvalright} Topvalright={this.state.Topvalright}
Botvalleft={this.state.Botvalleft} Botvalleft={this.state.Botvalleft}
Botval={this.state.Botval} Botval={this.state.Botval}
starttime={this.state.starttime} starttime={this.state.starttime}
endtime={this.state.endtime} endtime={this.state.endtime}
Cancelname={this.state.Cancelname} Cancelname={this.state.Cancelname}
Savesname={this.state.Savesname} Savesname={this.state.Savesname}
Cancel={this.state.Cancel} Cancel={this.state.Cancel}
Saves={this.state.Saves} Saves={this.state.Saves}
course_groups={this.state.course_groups} course_groups={this.state.course_groups}
starttimes={this.state.starttimes} starttimes={this.state.starttimes}
starttimesend={this.state.starttimesend} starttimesend={this.state.starttimesend}
typs={this.state.typs} typs={this.state.typs}
/>:""} /> : ""}
{ showActionButton && <a href="javascript:void(0)" className="color-grey-9" onClick={this.homeworkstart}>{ showdatatypes ? "立即发布" : "立即截止" }</a> } {showActionButton && <a href="javascript:void(0)" className="color-grey-9" onClick={this.homeworkstart}>{showdatatypes ? "立即发布" : "立即截止"}</a>}
</div> </div>
) )
} }

@ -1,12 +1,9 @@
import React,{ Component } from "react"; import React, { Component } from "react";
import { Pagination } from "antd";
import update from 'immutability-helper';
import axios from 'axios'; import axios from 'axios';
import moment from 'moment'; import moment from 'moment';
import _ from 'lodash'; import _ from 'lodash';
import {ImageLayerOfCommentHOC} from '../../../page/layers/ImageLayerOfCommentHOC'; import { ImageLayerOfCommentHOC } from '../../../page/layers/ImageLayerOfCommentHOC';
import GraduationTasksappraiseMainEditor from '../../graduation/tasks/GraduationTasksappraiseMainEditor'; import GraduationTasksappraiseMainEditor from '../../graduation/tasks/GraduationTasksappraiseMainEditor';
import CCommentItem from '../../common/comments/CCommentItem'; import CCommentItem from '../../common/comments/CCommentItem';
import '../../../forums/Post.css'; import '../../../forums/Post.css';
@ -17,47 +14,45 @@ import '../../graduation/tasks/GraduationTasksappraiseReply.css';
import './CommonWorkAppraiseReply.css'; import './CommonWorkAppraiseReply.css';
import ModulationModal from "../../coursesPublic/ModulationModal"; import ModulationModal from "../../coursesPublic/ModulationModal";
import Modals from '../../../modals/Modals'; import Modals from '../../../modals/Modals';
const REPLY_PAGE_COUNT = 10
const $ = window.$;
/* /*
*/ */
class CommonWorkAppraiseReply extends Component{ class CommonWorkAppraiseReply extends Component {
constructor(props){ constructor(props) {
super(props); super(props);
this.editorRef = React.createRef(); this.editorRef = React.createRef();
this.state={ this.state = {
total_count: 0, total_count: 0,
comment_scores: [], comment_scores: [],
} }
} }
fetchAllComments = () => { fetchAllComments = () => {
let category_id= this.props.match.params.category_id; let category_id = this.props.match.params.category_id;
// const url = `/graduation_works/${category_id}/comment_list.json` // const url = `/graduation_works/${category_id}/comment_list.json`
const task_id = this.props.task_id const task_id = this.props.task_id
const url = `/student_works/${task_id}/comment_list.json` const url = `/student_works/${task_id}/comment_list.json`
axios.get(url).then((result)=>{ axios.get(url).then((result) => {
if(result.data.comment_scores){ if (result.data.comment_scores) {
const comment_scores = result.data.comment_scores.map(item => { const comment_scores = result.data.comment_scores.map(item => {
return this.transformReply(item) return this.transformReply(item)
}) })
this.setState({ this.setState({
...result.data, ...result.data,
comment_scores comment_scores
}) })
} }
}).catch((error)=>{ }).catch((error) => {
console.log(error) console.log(error)
}) })
} }
replySuccess = () => { replySuccess = () => {
this.fetchAllComments() this.fetchAllComments()
} }
componentDidMount(){ componentDidMount() {
this.fetchAllComments() this.fetchAllComments()
} }
addSuccess = () => { addSuccess = () => {
@ -111,19 +106,20 @@ class CommonWorkAppraiseReply extends Component{
okText: '确定', okText: '确定',
cancelText: '取消', cancelText: '取消',
onOk: () => { onOk: () => {
let category_id= this.props.match.params.category_id; let category_id = this.props.match.params.category_id;
const task_id = this.props.task_id const task_id = this.props.task_id
// 作业是使用 task_id // 作业是使用 task_id
const url = `/student_works/${task_id}/destroy_score.json` const url = `/student_works/${task_id}/destroy_score.json`
axios.delete(url, { data: { axios.delete(url, {
data: {
score_id: item.id score_id: item.id
} }
}).then((result)=>{ }).then((result) => {
if(result.data.status == 0){ if (result.data.status == 0) {
this.props.showNotification('删除成功') this.props.showNotification('删除成功')
this.fetchAllComments() this.fetchAllComments()
} }
}).catch((error)=>{ }).catch((error) => {
console.log(error) console.log(error)
}) })
}, },
@ -134,44 +130,44 @@ class CommonWorkAppraiseReply extends Component{
} }
showModulationtype=(id)=>{ showModulationtype = (id) => {
// console.log(id) // console.log(id)
this.setState({ this.setState({
Modulationtype:true, Modulationtype: true,
operationId:id operationId: id
}) })
} }
cancelmodel=()=>{ cancelmodel = () => {
this.setState({ this.setState({
Modalstype:false, Modalstype: false,
Loadtype:false, Loadtype: false,
visible:false, visible: false,
Modulationtype:false, Modulationtype: false,
Allocationtype:false, Allocationtype: false,
Modalstopval:"", Modalstopval: "",
ModalCancel:"", ModalCancel: "",
ModalSave:"", ModalSave: "",
}) })
} }
saveModulationModal=(value,num)=>{ saveModulationModal = (value, num) => {
console.log(value,num) console.log(value, num)
let {operationId}=this.state; let { operationId } = this.state;
let studentWorkId =this.props.match.params.studentWorkId; let studentWorkId = this.props.match.params.studentWorkId;
// console.log(value,num) // console.log(value,num)
let url ="/student_works/"+studentWorkId+"/adjust_score.json"; let url = "/student_works/" + studentWorkId + "/adjust_score.json";
axios.post(url,{ axios.post(url, {
score:num, score: num,
comment:value comment: value
}).then((result)=>{ }).then((result) => {
// console.log(result) // console.log(result)
if(result.data.status===0){ if (result.data.status === 0) {
// this.setState({ // this.setState({
// Modalstype:true, // Modalstype:true,
// Allocationtype:false, // Allocationtype:false,
@ -185,7 +181,7 @@ class CommonWorkAppraiseReply extends Component{
} }
}).catch((error)=>{ }).catch((error) => {
console.log(error) console.log(error)
}) })
@ -193,18 +189,18 @@ class CommonWorkAppraiseReply extends Component{
onReply = (params) => { onReply = (params) => {
const { task_id } = this.props; const { task_id } = this.props;
const replyUrl = `/student_works/${task_id}/add_score.json` const replyUrl = `/student_works/${task_id}/add_score.json`
axios.post(replyUrl, params).then((response)=>{ axios.post(replyUrl, params).then((response) => {
if(response.data.status == 0) { if (response.data.status == 0) {
this.editorRef.current.clearInputs() this.editorRef.current.clearInputs()
this.fetchAllComments(); this.fetchAllComments();
this.props.onReplySuccess && this.props.onReplySuccess() this.props.onReplySuccess && this.props.onReplySuccess()
} }
}).catch((error)=>{ }).catch((error) => {
console.log(error) console.log(error)
}) })
} }
render(){ render() {
let { total_count, comments, pageCount, comment_scores, allow_score } = this.state let { total_count, comments, pageCount, comment_scores, allow_score } = this.state
const { current_user, memo, homework_status } = this.props const { current_user, memo, homework_status } = this.props
const isAdmin = this.props.isAdmin() const isAdmin = this.props.isAdmin()
@ -217,84 +213,84 @@ class CommonWorkAppraiseReply extends Component{
*/ */
// && isNiPing // && isNiPing
const needNiPingEditor = (allow_score ); const needNiPingEditor = (allow_score);
if (!needNiPingEditor && comment_scores.length == 0) { if (!needNiPingEditor && comment_scores.length == 0) {
return '' return ''
} }
return( return (
<React.Fragment> <React.Fragment>
<div className="edu-back-white padding10-10" style={{marginTop: '16px'}}> <div className="edu-back-white padding10-10" style={{ marginTop: '16px' }}>
<div className={"stud-class-set edu-back-white mb10"} style={{height:"100%"}}> <div className={"stud-class-set edu-back-white mb10"} style={{ height: "100%" }}>
<Modals <Modals
modalsType={this.state.Modalstype} modalsType={this.state.Modalstype}
modalsTopval={this.state.Modalstopval} modalsTopval={this.state.Modalstopval}
modalCancel={this.state.ModalCancel} modalCancel={this.state.ModalCancel}
modalSave={this.state.ModalSave} modalSave={this.state.ModalSave}
closable={false} closable={false}
footer={null} footer={null}
destroyOnClose={true} destroyOnClose={true}
centered={true} centered={true}
/> />
{this.state.Modulationtype===true?<ModulationModal {this.state.Modulationtype === true ? <ModulationModal
modalname={"调分"} modalname={"调分"}
visible={this.state.Modulationtype} visible={this.state.Modulationtype}
Cancelname={"取消"} Cancelname={"取消"}
Savesname={"保存"} Savesname={"保存"}
Cancel={this.cancelmodel} Cancel={this.cancelmodel}
Saves={(value,num)=>this.saveModulationModal(value,num)} Saves={(value, num) => this.saveModulationModal(value, num)}
closable={false} closable={false}
footer={null} footer={null}
destroyOnClose={true} destroyOnClose={true}
centered={true} centered={true}
/>:""} /> : ""}
{/*<div style={{ width:'100%',height:'75px'}} >*/} {/*<div style={{ width:'100%',height:'75px'}} >*/}
{/*<p className=" fl color-black mt25 summaryname">{datalist&&datalist.task_name}</p>*/} {/*<p className=" fl color-black mt25 summaryname">{datalist&&datalist.task_name}</p>*/}
{/*<a className="color-grey-6 fr font-16 mt10 mr20" onClick={this.goback}>返回</a>*/} {/*<a className="color-grey-6 fr font-16 mt10 mr20" onClick={this.goback}>返回</a>*/}
{/*{this.props.isStudent()?<a className={"fr color-blue font-16 mt10 mr20"} onClick={this.addAccessory}>补交附件</a>:""}*/} {/*{this.props.isStudent()?<a className={"fr color-blue font-16 mt10 mr20"} onClick={this.addAccessory}>补交附件</a>:""}*/}
{/*</div>*/} {/*</div>*/}
{/* { {/* {
(!!comment_scores.length && (!!comment_scores.length &&
<div className={"color-grey-6 mb10"}> <div className={"color-grey-6 mb10"}>
<span className="labal">全部评阅</span> <span className="labal">全部评阅</span>
<span className="count">{comment_scores.length}</span> <span className="count">{comment_scores.length}</span>
</div>)} */} </div>)} */}
<div className={`padding20-30 ${comment_scores.length ? 'bor-bottom-greyE' : ''}`}> <div className={`padding20-30 ${comment_scores.length ? 'bor-bottom-greyE' : ''}`}>
{!!comment_scores.length && <div className={"color-grey-6 font-16"}> {!!comment_scores.length && <div className={"color-grey-6 font-16"}>
全部评阅<span className="count">{comment_scores.length===0?"":`(${comment_scores.length})`}</span> 全部评阅<span className="count">{comment_scores.length === 0 ? "" : `(${comment_scores.length})`}</span>
{/* <div style={{ width:'100%',height:'75px'}} ></div> */} {/* <div style={{ width:'100%',height:'75px'}} ></div> */}
{/* true: 老师身份显示“调分”入口false: 不显示调分入口 */} {/* true: 老师身份显示“调分”入口false: 不显示调分入口 */}
{isAdmin && !allow_score && {isAdmin && !allow_score &&
<a className={"fr color-blue font-16"} onClick={()=>this.showModulationtype(this.props.task_id)}>调分</a> <a className={"fr color-blue font-16"} onClick={() => this.showModulationtype(this.props.task_id)}>调分</a>
} }
</div> } </div>}
{needNiPingEditor && <GraduationTasksappraiseMainEditor {...this.props} {needNiPingEditor && <GraduationTasksappraiseMainEditor {...this.props}
title={'评语'} title={'评语'}
showModulationtype={this.showModulationtype} showModulationtype={this.showModulationtype}
addSuccess={this.addSuccess} ref={this.editorRef} totalCount={comment_scores.length} addSuccess={this.addSuccess} ref={this.editorRef} totalCount={comment_scores.length}
onReply={this.onReply} placeholder={"请在此输入对本作品的评语最大限制2000个字符"} onReply={this.onReply} placeholder={"请在此输入对本作品的评语最大限制2000个字符"}
showSameScore={isGroup && isAdmin} showSameScore={isGroup && isAdmin}
></GraduationTasksappraiseMainEditor> } ></GraduationTasksappraiseMainEditor>}
</div> </div>
{/* ${!!comment_scores.length ? 'bor-bottom-greyE' : ''} */} {/* ${!!comment_scores.length ? 'bor-bottom-greyE' : ''} */}
<div className={`padding20 memoReplies commentsDelegateParent course-message`} <div className={`padding20 memoReplies commentsDelegateParent course-message`}
style={{ paddingTop: '0px', paddingBottom: '0px' }} style={{ paddingTop: '0px', paddingBottom: '0px' }}
> >
{/* {/*
.course-message .panel-comment_item { .course-message .panel-comment_item {
margin-top: ${needNiPingEditor ? 56 : 28}px; margin-top: ${needNiPingEditor ? 56 : 28}px;
} }
*/} */}
<style>{` <style>{`
.course-message .panel-comment_item .comment_orig_content { .course-message .panel-comment_item .comment_orig_content {
width: 1040px; width: 1040px;
@ -307,18 +303,18 @@ class CommonWorkAppraiseReply extends Component{
border-bottom: none; border-bottom: none;
} }
`}</style> `}</style>
{!!comment_scores.length && <div className="panel-comment_item"> {!!comment_scores.length && <div className="panel-comment_item">
{ comment_scores.map((item, index) => { {comment_scores.map((item, index) => {
return <CCommentItem item={item} onDelete={this.onDelete} {...this.props} commentIndex={index} replySuccess={this.replySuccess}></CCommentItem> return <CCommentItem item={item} onDelete={this.onDelete} {...this.props} commentIndex={index} replySuccess={this.replySuccess}></CCommentItem>
}) } })}
</div>} </div>}
</div> </div>
</div> </div>
</div> </div>
</React.Fragment> </React.Fragment>
) )
} }
} }
export default ImageLayerOfCommentHOC() (CommonWorkAppraiseReply); export default ImageLayerOfCommentHOC()(CommonWorkAppraiseReply);

@ -1,5 +1,5 @@
import React,{ Component } from "react"; import React, { Component } from "react";
import {Checkbox,Radio, Input} from "antd"; import { Checkbox, Radio, Input } from "antd";
import '../css/members.css' import '../css/members.css'
import '../css/busyWork.css' import '../css/busyWork.css'
@ -12,37 +12,36 @@ import CoursesListType from '../coursesPublic/CoursesListType';
import axios from 'axios'; import axios from 'axios';
const map={1:"单选题",2:"多选题",3:"主观题"} const map = { 1: "单选题", 2: "多选题", 3: "主观题" }
const statudmap={1:"未发布",2:"提交中",3:"已截止"} const statudmap = { 1: "未发布", 2: "提交中", 3: "已截止" }
class PollInfo extends Component{ class PollInfo extends Component {
constructor(props){ constructor(props) {
super(props); super(props);
this.state={ this.state = {
courseName:undefined, courseName: undefined,
poll:undefined, poll: undefined,
question_answered:undefined, question_answered: undefined,
question_types:undefined, question_types: undefined,
questions:undefined, questions: undefined,
inputArray:[], inputArray: [],
modalsType:false, modalsType: false,
modalsTopval:undefined, modalsTopval: undefined,
modalsBottomval:undefined, modalsBottomval: undefined,
loadtype:true, loadtype: true,
modalSave:undefined, modalSave: undefined,
questionPanelFixed:false, questionPanelFixed: false,
pollAnswerList:[] pollAnswerList: []
} }
} }
componentDidUpdate (prevProps) { componentDidUpdate(prevProps) {
// 需要等get_user_info执行完才能getInfo
if (!prevProps.current_user && this.props.current_user) { if (!prevProps.current_user && this.props.current_user) {
this.getInfo() this.getInfo()
} }
} }
componentDidMount(){ componentDidMount() {
if(this.props.current_user){ if (this.props.current_user) {
this.getInfo(); this.getInfo();
} }
@ -50,123 +49,123 @@ class PollInfo extends Component{
} }
// 滚动定位 // 滚动定位
handleScroll=()=>{ handleScroll = () => {
if(parseInt(window.scrollY)>230){ if (parseInt(window.scrollY) > 230) {
this.setState({ this.setState({
questionPanelFixed:true questionPanelFixed: true
}) })
}else{ } else {
this.setState({ this.setState({
questionPanelFixed:false questionPanelFixed: false
}) })
} }
} }
scrollToAnchor=(index)=>{ scrollToAnchor = (index) => {
let name="Anchor_"+index; let name = "Anchor_" + index;
if (index) { if (index) {
let anchorElement = document.getElementById(name); let anchorElement = document.getElementById(name);
if(anchorElement) { anchorElement.scrollIntoView(); } if (anchorElement) { anchorElement.scrollIntoView(); }
} }
} }
getInfo=()=>{ getInfo = () => {
this.setState({ this.setState({
courseName:this.props.current_user.course_name courseName: this.props.current_user.course_name
}) })
let pollId=this.props.match.params.pollId; let pollId = this.props.match.params.pollId;
let user_id=this.props.match.params.login; let user_id = this.props.match.params.login;
let url=`/polls/${pollId}/start_answer.json?login=${user_id}` let url = `/polls/${pollId}/start_answer.json?login=${user_id}`
axios.get(url).then((result)=>{ axios.get(url).then((result) => {
if(result.status==200){ if (result.status == 200) {
this.setState({ this.setState({
poll:result.data.poll, poll: result.data.poll,
question_answered:result.data.question_answered, question_answered: result.data.question_answered,
question_types:result.data.question_types, question_types: result.data.question_types,
questions:result.data.questions questions: result.data.questions
}) })
let list=[]; let list = [];
for(var i=0;i<result.data.questions.length;i++){ for (var i = 0; i < result.data.questions.length; i++) {
list.push({ list.push({
id:result.data.questions[i].question.id, id: result.data.questions[i].question.id,
text:result.data.questions[i].question.poll_vote_texts || "", text: result.data.questions[i].question.poll_vote_texts || "",
is_necessary:result.data.questions[i].question.is_necessary, is_necessary: result.data.questions[i].question.is_necessary,
answers:result.data.questions[i].question.poll_answer_ids, answers: result.data.questions[i].question.poll_answer_ids,
answersList:result.data.questions[i].question.answers answersList: result.data.questions[i].question.answers
}) })
} }
this.setState({ this.setState({
inputArray:list inputArray: list
}) })
} }
}).catch((error)=>{ }).catch((error) => {
console.log(error); console.log(error);
}) })
} }
//选中选择题(单选题)选项保存 //选中选择题(单选题)选项保存
ChangeOptionSingle=(item)=>{ ChangeOptionSingle = (item) => {
let arr=item.target.name let arr = item.target.name
let txt=Object.assign({}, this.state.inputArray[parseInt(arr[1])]); let txt = Object.assign({}, this.state.inputArray[parseInt(arr[1])]);
let ids=item.target.value; let ids = item.target.value;
let list=txt.answersList.filter(element => element.answer_id == ids); let list = txt.answersList.filter(element => element.answer_id == ids);
this.postAnswer(arr[0],ids,list[0].answer_text=="其他"?txt.text:"",arr[1]); this.postAnswer(arr[0], ids, list[0].answer_text == "其他" ? txt.text : "", arr[1]);
} }
//选中选择题(多选题)选项保存 //选中选择题(多选题)选项保存
ChangeOptionMuntil=(a_id,q_id,key)=>{ ChangeOptionMuntil = (a_id, q_id, key) => {
let ind=Object.assign({}, this.state.inputArray[parseInt(key)]); let ind = Object.assign({}, this.state.inputArray[parseInt(key)]);
let count=0; let count = 0;
a_id.forEach(element => { a_id.forEach(element => {
let list=ind.answersList.filter(item=>item.answer_id==element); let list = ind.answersList.filter(item => item.answer_id == element);
if(list[0].answer_text=="其他"){ if (list[0].answer_text == "其他") {
count++; count++;
} }
}); });
this.postAnswer(q_id,a_id,count > 0 ? ind.text : "",key); this.postAnswer(q_id, a_id, count > 0 ? ind.text : "", key);
} }
postAnswer=(q_id,a_id,text,key)=>{ postAnswer = (q_id, a_id, text, key) => {
let url=`/poll_questions/${q_id}/poll_votes.json`; let url = `/poll_questions/${q_id}/poll_votes.json`;
console.log(text); console.log(text);
axios.post(url,{ axios.post(url, {
poll_answer_id:a_id, poll_answer_id: a_id,
vote_text:text vote_text: text
}).then((result)=>{ }).then((result) => {
if(result){ if (result) {
const answer=Object.assign({}, this.state.question_answered[parseInt(key)]); const answer = Object.assign({}, this.state.question_answered[parseInt(key)]);
answer.ques_status=result.data.poll_vote.question_status; answer.ques_status = result.data.poll_vote.question_status;
const question_answered=this.state.question_answered; const question_answered = this.state.question_answered;
question_answered[parseInt(key)]=answer question_answered[parseInt(key)] = answer
const inputs=Object.assign({}, this.state.inputArray[parseInt(key)]); const inputs = Object.assign({}, this.state.inputArray[parseInt(key)]);
inputs.answers=a_id; inputs.answers = a_id;
const inputArray=this.state.inputArray; const inputArray = this.state.inputArray;
inputArray[parseInt(key)]=inputs; inputArray[parseInt(key)] = inputs;
this.setState({ this.setState({
question_answered, question_answered,
inputArray inputArray
}) })
} }
}).catch((error)=>{ }).catch((error) => {
console.log(error); console.log(error);
}) })
} }
//输入其它--内容 //输入其它--内容
blurTxt=(e)=>{ blurTxt = (e) => {
let index=parseInt(e.target.name) let index = parseInt(e.target.name)
const list = Object.assign({}, this.state.inputArray[index]) const list = Object.assign({}, this.state.inputArray[index])
list.text=e.target.value; list.text = e.target.value;
const inputArray=this.state.inputArray; const inputArray = this.state.inputArray;
inputArray[index]=list inputArray[index] = list
this.setState({ this.setState({
inputArray inputArray
@ -175,49 +174,49 @@ class PollInfo extends Component{
//输入其它--内容后重新保存 //输入其它--内容后重新保存
saveInputAndAnswer=(e,a_id,q_id,key,type)=>{ saveInputAndAnswer = (e, a_id, q_id, key, type) => {
const inputs=Object.assign({}, this.state.inputArray[parseInt(key)]); const inputs = Object.assign({}, this.state.inputArray[parseInt(key)]);
let answers=inputs.answers; let answers = inputs.answers;
let flag=true; let flag = true;
if(answers.length){ if (answers.length) {
flag=answers.indexOf(a_id) > -1?true:false; flag = answers.indexOf(a_id) > -1 ? true : false;
answers= type == 1 ? answers[0] : answers; answers = type == 1 ? answers[0] : answers;
}else{ } else {
flag = answers==a_id?true:false; flag = answers == a_id ? true : false;
} }
if(answers && (answers.length>0 || answers !="")){ if (answers && (answers.length > 0 || answers != "")) {
this.postAnswer(q_id,answers,flag ? inputs.text : "",key); this.postAnswer(q_id, answers, flag ? inputs.text : "", key);
} }
} }
//提交主观题 //提交主观题
commitText=(key,q_id)=>{ commitText = (key, q_id) => {
const text = Object.assign({}, this.state.inputArray[key]).text; const text = Object.assign({}, this.state.inputArray[key]).text;
let url='/poll_questions/'+q_id+'/poll_votes.json?'; let url = '/poll_questions/' + q_id + '/poll_votes.json?';
const ans=Object.assign({}, this.state.question_answered[key]); const ans = Object.assign({}, this.state.question_answered[key]);
ans.ques_status=text ? 1 : 0 ; ans.ques_status = text ? 1 : 0;
const questionAnswered=this.state.question_answered; const questionAnswered = this.state.question_answered;
questionAnswered[key]=ans questionAnswered[key] = ans
this.setState({ this.setState({
question_answered:questionAnswered question_answered: questionAnswered
}) })
if(text!=undefined){ if (text != undefined) {
axios.post((url),{ axios.post((url), {
vote_text:text vote_text: text
}).then((result)=>{ }).then((result) => {
if(result.status==200){ if (result.status == 200) {
const answer=Object.assign({}, this.state.question_answered[key]); const answer = Object.assign({}, this.state.question_answered[key]);
answer.ques_status=result.data.poll_vote.question_status; answer.ques_status = result.data.poll_vote.question_status;
const question_answered=this.state.question_answered; const question_answered = this.state.question_answered;
question_answered[key]=answer question_answered[key] = answer
this.setState({ this.setState({
question_answered question_answered
}) })
} }
}).catch((error)=>{ }).catch((error) => {
console.log(error); console.log(error);
}) })
} }
@ -225,71 +224,71 @@ class PollInfo extends Component{
} }
// 提交 // 提交
submitPoll=()=>{ submitPoll = () => {
let {inputArray,question_answered}=this.state; let { inputArray, question_answered } = this.state;
let must=0; let must = 0;
let may=0; let may = 0;
for(var j=0;j<question_answered.length;j++){ for (var j = 0; j < question_answered.length; j++) {
if(question_answered[j].ques_status==0){ if (question_answered[j].ques_status == 0) {
if(inputArray[j].is_necessary==1){ if (inputArray[j].is_necessary == 1) {
must++; must++;
}else{ } else {
may++; may++;
} }
} }
} }
if(must>0){ if (must > 0) {
this.setState({ this.setState({
modalsType:true, modalsType: true,
modalsTopval:"有 "+must+" 题必答题未答,无法提交 ", modalsTopval: "有 " + must + " 题必答题未答,无法提交 ",
modalsBottomval:"请完成全部必答题后再提交", modalsBottomval: "请完成全部必答题后再提交",
loadtype:true, loadtype: true,
modalSave:this.cancelSubmit modalSave: this.cancelSubmit
}) })
return; return;
} }
if(may >= 0){ if (may >= 0) {
this.setState({ this.setState({
modalsType:true, modalsType: true,
modalsTopval: may>0 ? "有 "+may+" 题未答":"", modalsTopval: may > 0 ? "有 " + may + " 题未答" : "",
modalsBottomval:"提交后无法再修改答题,是否确认提交?", modalsBottomval: "提交后无法再修改答题,是否确认提交?",
loadtype:false, loadtype: false,
modalSave:this.sureSubmit modalSave: this.sureSubmit
}) })
} }
} }
cancelSubmit=()=>{ cancelSubmit = () => {
this.setState({ this.setState({
modalsType:false, modalsType: false,
modalsTopval:"", modalsTopval: "",
modalsBottomval:"" modalsBottomval: ""
}) })
} }
sureSubmit=()=>{ sureSubmit = () => {
let pollId=this.props.match.params.pollId; let pollId = this.props.match.params.pollId;
let url=`/polls/${pollId}/commit_poll.json` let url = `/polls/${pollId}/commit_poll.json`
axios.post(url).then((result)=>{ axios.post(url).then((result) => {
if(result.status == 200){ if (result.status == 200) {
this.props.showNotification(result.data.message) this.props.showNotification(result.data.message)
this.setState({ this.setState({
modalsType:false, modalsType: false,
modalsTopval:"", modalsTopval: "",
modalsBottomval:"" modalsBottomval: ""
}) })
window.location.href=`/courses/${this.props.match.params.coursesId}/polls/${pollId}/detail` window.location.href = `/courses/${this.props.match.params.coursesId}/polls/${pollId}/detail`
} }
}).catch((error)=>{ }).catch((error) => {
console.log(error); console.log(error);
}) })
} }
render(){ render() {
let coursesId=this.props.match.params.coursesId; let coursesId = this.props.match.params.coursesId;
let{poll,question_answered,question_types,questions,courseName, let { poll, question_answered, question_types, questions, courseName,
inputArray, inputArray,
modalsType, modalsType,
modalsTopval, modalsTopval,
@ -297,13 +296,13 @@ class PollInfo extends Component{
modalsBottomval, modalsBottomval,
modalSave, modalSave,
questionPanelFixed questionPanelFixed
}=this.state; } = this.state;
const { current_user } = this.props const { current_user } = this.props
let isAdmin=this.props.isAdmin(); let isAdmin = this.props.isAdmin();
let isStudent=this.props.isStudent(); let isStudent = this.props.isStudent();
document.title=courseName&&courseName; document.title = courseName && courseName;
return( return (
<div className="newMain" style={{paddingTop:"0px"}}> <div className="newMain" style={{ paddingTop: "0px" }}>
{/*<p style={{height:"60px"}}></p>*/} {/*<p style={{height:"60px"}}></p>*/}
<Modals <Modals
modalsType={modalsType} modalsType={modalsType}
@ -320,19 +319,19 @@ class PollInfo extends Component{
<WordsBtn style="grey" className="fl" to={`/courses/${this.props.match.params.coursesId}/polls/${poll && poll.left_banner_id}`}>问卷</WordsBtn> <WordsBtn style="grey" className="fl" to={`/courses/${this.props.match.params.coursesId}/polls/${poll && poll.left_banner_id}`}>问卷</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" to={`/courses/${coursesId}/polls/${this.props.match.params.pollId}/detail`} className="fl mr3">问卷详情</WordsBtn>&gt; <WordsBtn style="grey" to={`/courses/${coursesId}/polls/${this.props.match.params.pollId}/detail`} className="fl mr3">问卷详情</WordsBtn>&gt;
<span className="ml3">{question_types&&question_types.user_name}</span> <span className="ml3">{question_types && question_types.user_name}</span>
</p> </p>
<p className="clearfix mb20"> <p className="clearfix mb20">
<span className="color-grey-3 font-24 fl task-hide break-word" style={{maxWidth:"900px",lineHeight:"30px"}}>{poll && poll.polls_name}</span> <span className="color-grey-3 font-24 fl task-hide break-word" style={{ maxWidth: "900px", lineHeight: "30px" }}>{poll && poll.polls_name}</span>
<CoursesListType typelist={[`${statudmap[poll && poll.poll_status]}`]} typesylename={""} /> <CoursesListType typelist={[`${statudmap[poll && poll.poll_status]}`]} typesylename={""} />
{ {
isAdmin || (poll && poll.user_poll_status == 1) ? <WordsBtn className="fr font-16 mt5" style="grey" to={`/courses/${coursesId}/polls/${this.props.match.params.pollId}/detail`}>返回</WordsBtn> :'' isAdmin || (poll && poll.user_poll_status == 1) ? <WordsBtn className="fr font-16 mt5" style="grey" to={`/courses/${coursesId}/polls/${this.props.match.params.pollId}/detail`}>返回</WordsBtn> : ''
} }
</p> </p>
{ {
poll && poll.polls_description && poll && poll.polls_description &&
<p style={{backgroundColor:"#F2F9FF",whiteSpace:"pre-wrap"}} className="color-blue pl30 pr30 pt15 pb15">{poll.polls_description}</p> <p style={{ backgroundColor: "#F2F9FF", whiteSpace: "pre-wrap" }} className="color-blue pl30 pr30 pt15 pb15">{poll.polls_description}</p>
} }
<div className="edu-back-white"> <div className="edu-back-white">
<p className="padding20-30 bor-bottom-greyE"> <p className="padding20-30 bor-bottom-greyE">
@ -346,15 +345,15 @@ class PollInfo extends Component{
} }
{ {
question_types && question_types.q_doubles > 0 && question_types && question_types.q_doubles > 0 &&
<span className="color-grey-9 mr15">多选题{ question_types && question_types.q_doubles }</span> <span className="color-grey-9 mr15">多选题{question_types && question_types.q_doubles}</span>
} }
{ {
question_types && question_types.q_mains > 0 && question_types && question_types.q_mains > 0 &&
<span className="color-grey-9">主观题{question_types &&question_types.q_mains}</span> <span className="color-grey-9">主观题{question_types && question_types.q_mains}</span>
} }
</p> </p>
<div className={ questionPanelFixed==true ? "questionsfixed":"questionsNo"}> <div className={questionPanelFixed == true ? "questionsfixed" : "questionsNo"}>
<p className="clearfix pl20"> <p className="clearfix pl20">
<span className="mr40 answered">已答</span> <span className="mr40 answered">已答</span>
<span className="unanswer">未答</span> <span className="unanswer">未答</span>
@ -362,12 +361,12 @@ class PollInfo extends Component{
</p> </p>
<ul className="clearfix leaderNav"> <ul className="clearfix leaderNav">
{ {
question_answered && question_answered.map((item,key)=>{ question_answered && question_answered.map((item, key) => {
return( return (
<React.Fragment> <React.Fragment>
{ {
<a className={item.ques_status==1? "acted" : ""} onClick={()=>this.scrollToAnchor(`${key}`)}>{item.ques_number}</a> <a className={item.ques_status == 1 ? "acted" : ""} onClick={() => this.scrollToAnchor(`${key}`)}>{item.ques_number}</a>
} }
</React.Fragment> </React.Fragment>
) )
}) })
@ -377,57 +376,57 @@ class PollInfo extends Component{
<div> <div>
{ {
questions && questions.map((item,key)=>{ questions && questions.map((item, key) => {
return( return (
<div className="previewList" id={'Anchor_'+`${key}`}> <div className="previewList" id={'Anchor_' + `${key}`}>
<div className="pl30 pr30 mt30 mb10 clearfix"> <div className="pl30 pr30 mt30 mb10 clearfix">
<span className="color-blue fl font-16">{item.question.question_number}{map[item.question.question_type]}</span> <span className="color-blue fl font-16">{item.question.question_number}{map[item.question.question_type]}</span>
{ item.question.is_necessary==1 ? <span className="mustAnswer fl ml10 mr10 mt5">必答</span>:<span className="mustAnswer fl ml10 mr10 mt5"></span> } {item.question.is_necessary == 1 ? <span className="mustAnswer fl ml10 mr10 mt5">必答</span> : <span className="mustAnswer fl ml10 mr10 mt5"></span>}
{ item.question.question_type == 2 && item.question.min_choices && item.question.max_choices ? {item.question.question_type == 2 && item.question.min_choices && item.question.max_choices ?
<span className="color-grey-9 font-14 fl mt2"> <span className="color-grey-9 font-14 fl mt2">
{ {
item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" : item.question.min_choices == item.question.max_choices ? "可选" + item.question.max_choices + "项" :
"可选"+item.question.min_choices+"-"+item.question.max_choices+"项" "可选" + item.question.min_choices + "-" + item.question.max_choices + "项"
} }
</span>:"" </span> : ""
} }
</div> </div>
<p className="pl30 pr30 mb10 "><span className="font-14 flex1" style={{ <p className="pl30 pr30 mb10 "><span className="font-14 flex1" style={{
"white-space": "pre-wrap", "white-space": "pre-wrap",
"word-break": "break-all", "word-break": "break-all",
"word-wrap": "break-word" "word-wrap": "break-word"
}}>{item.question.question_title}</span></p> }}>{item.question.question_title}</span></p>
{ {
//单选 //单选
item.question.question_type==1 && item.question.question_type == 1 &&
<Radio.Group disabled={isAdmin || (isStudent && poll && poll.user_poll_status == 1)?true:false} className="answerList" defaultValue={item.question.poll_answer_ids[0]} name={[item.question.id,key]} onChange={this.ChangeOptionSingle}> <Radio.Group disabled={isAdmin || (isStudent && poll && poll.user_poll_status == 1) ? true : false} className="answerList" defaultValue={item.question.poll_answer_ids[0]} name={[item.question.id, key]} onChange={this.ChangeOptionSingle}>
{ {
item.question.answers && item.question.answers.map((i,k)=>{ item.question.answers && item.question.answers.map((i, k) => {
return( return (
<li className={i.answer_text=="其他"?"df clearfix":"clearfix"}> <li className={i.answer_text == "其他" ? "df clearfix" : "clearfix"}>
<Radio name={[item.question.id,key]} className="fl" value={i.answer_id} ></Radio> <Radio name={[item.question.id, key]} className="fl" value={i.answer_id} ></Radio>
<span className="break-word fl" style={{maxWidth:"1116px"}}>{i.answer_text}</span> <span className="break-word fl" style={{ maxWidth: "1116px" }}>{i.answer_text}</span>
{ {
i.answer_text=="其他" ? i.answer_text == "其他" ?
<React.Fragment> <React.Fragment>
{ {
inputArray && inputArray.map((j,k)=>{ inputArray && inputArray.map((j, k) => {
return( return (
<React.Fragment> <React.Fragment>
{ {
j.id == item.question.id ? j.id == item.question.id ?
<Input type="text" className="otherTxt" autoComplete="off" value={j.text && j.text} name={key} <Input type="text" className="otherTxt" autoComplete="off" value={j.text && j.text} name={key}
onInput={this.blurTxt} onInput={this.blurTxt}
onBlur={(e)=>this.saveInputAndAnswer(e,i.answer_id,item.question.id,key,item.question.question_type)} onBlur={(e) => this.saveInputAndAnswer(e, i.answer_id, item.question.id, key, item.question.question_type)}
/> />
: "" : ""
} }
</React.Fragment> </React.Fragment>
) )
}) })
} }
</React.Fragment> </React.Fragment>
: "" : ""
} }
</li> </li>
) )
@ -437,40 +436,40 @@ class PollInfo extends Component{
} }
{ {
//多选 //多选
item.question.question_type==2 && item.question.question_type == 2 &&
<Checkbox.Group <Checkbox.Group
onChange={(value)=>this.ChangeOptionMuntil(value,item.question.id,key)} onChange={(value) => this.ChangeOptionMuntil(value, item.question.id, key)}
disabled={isAdmin || (isStudent && poll && poll.user_poll_status == 1)?true:false} disabled={isAdmin || (isStudent && poll && poll.user_poll_status == 1) ? true : false}
defaultValue={item.question.poll_answer_ids} defaultValue={item.question.poll_answer_ids}
className="answerList" className="answerList"
name={key}> name={key}>
{ {
item.question.answers && item.question.answers.map((i,k)=>{ item.question.answers && item.question.answers.map((i, k) => {
return( return (
<li className={i.answer_text=="其他"?"df clearfix":"clearfix"}> <li className={i.answer_text == "其他" ? "df clearfix" : "clearfix"}>
<Checkbox className="fl mr8" value={i.answer_id} key={i.answer_id}></Checkbox> <Checkbox className="fl mr8" value={i.answer_id} key={i.answer_id}></Checkbox>
<span className="break-word fl" style={{maxWidth:"1116px"}}>{i.answer_text}</span> <span className="break-word fl" style={{ maxWidth: "1116px" }}>{i.answer_text}</span>
{ {
i.answer_text=="其他"? i.answer_text == "其他" ?
<React.Fragment> <React.Fragment>
{ {
inputArray && inputArray.map((j,k)=>{ inputArray && inputArray.map((j, k) => {
return( return (
<React.Fragment> <React.Fragment>
{ {
j.id == item.question.id ? j.id == item.question.id ?
<Input type="text" className="otherTxt" autoComplete="off" value={j.text && j.text} name={key} <Input type="text" className="otherTxt" autoComplete="off" value={j.text && j.text} name={key}
onInput={this.blurTxt} onInput={this.blurTxt}
onBlur={(e)=>this.saveInputAndAnswer(e,i.answer_id,item.question.id,key,item.question.question_type)} onBlur={(e) => this.saveInputAndAnswer(e, i.answer_id, item.question.id, key, item.question.question_type)}
/> />
: "" : ""
} }
</React.Fragment> </React.Fragment>
) )
}) })
} }
</React.Fragment> </React.Fragment>
:"" : ""
} }
</li> </li>
) )
@ -480,17 +479,17 @@ class PollInfo extends Component{
} }
{ {
//主观题 //主观题
item.question.question_type==3 && item.question.question_type == 3 &&
<div className="mt10 pl30 pr30 pb20"> <div className="mt10 pl30 pr30 pb20">
{ {
inputArray && inputArray.map((j,k)=>{ inputArray && inputArray.map((j, k) => {
return( return (
<React.Fragment> <React.Fragment>
{ {
j.id == item.question.id ? j.id == item.question.id ?
<textarea placeholder="在此填入答案" disabled={isAdmin || (isStudent && poll && poll.user_poll_status == 1) ? true:false} value={j.text && j.text} className="winput-100-130" name={key} onInput={this.blurTxt} onBlur={()=>this.commitText(key,item.question.id)}></textarea> <textarea placeholder="在此填入答案" disabled={isAdmin || (isStudent && poll && poll.user_poll_status == 1) ? true : false} value={j.text && j.text} className="winput-100-130" name={key} onInput={this.blurTxt} onBlur={() => this.commitText(key, item.question.id)}></textarea>
: "" : ""
} }
</React.Fragment> </React.Fragment>
) )
}) })
@ -506,10 +505,10 @@ class PollInfo extends Component{
</div> </div>
{ {
isStudent && poll && poll.user_poll_status == 0 ? isStudent && poll && poll.user_poll_status == 0 ?
<div className="mt30 mb50"> <div className="mt30 mb50">
<a type="primary" className="defalutSubmitbtn" onClick={this.submitPoll}>提交</a> <a type="primary" className="defalutSubmitbtn" onClick={this.submitPoll}>提交</a>
</div> </div>
:"" : ""
} }
</div> </div>
</div> </div>

@ -134,43 +134,6 @@ class LoginDialog extends Component {
Phonenumberisnotco: undefined, Phonenumberisnotco: undefined,
}) })
} }
// let reg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/;
// let reg1 = /^1\d{10}$/;
// let reg2=/^[a-zA-z]\w{3,14}$/;
// // let reg3=/^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
// let value=this.refs.loginPassText.value;
// let valuenum= value.length;
// if(valuenum>0){
// if(!reg.test(value)&&!reg1.test(value)&&!reg2.test(value)){
// this.setState({regular:1})
// return
// }else{
// // this.setState({loginValue:value});
// this.setState({regular:0});
// var stirngt;
// if(value.length>0){
// var str= value.replace(/\s*/g,"")
// stirngt=str;
// }else{
// stirngt= value;
// }
// this.setState({
// loginValue:stirngt,
// });
// }
// }else{
// this.setState({loginValue:value});
// var stirngt;
// if(value.length>0){
// var str= value.replace(/\s*/g,"")
// stirngt=str;
// }else{
// stirngt= value;
// }
// this.setState({
// loginValue:stirngt,
// });
// }
}; };
//邮箱手机号验证 //邮箱手机号验证
Emailphonenumberverification = (value, id) => { Emailphonenumberverification = (value, id) => {
@ -388,49 +351,9 @@ class LoginDialog extends Component {
} }
return response; return response;
}, (error) => { }, (error) => {
// // if (error.response && error.response.data.error === '401 Unauthorized') {
// // this.back_url = window.location.href;
// // this.setState({
// // isRender: true
// // })
// // // TODO 这里如果样式变了会出现css不加载的情况
// // const $ = window.$;
// // const ilessLoaded = window.getComputedStyle($('.log_nav li.active')[0], null)
// // .getPropertyValue('border-bottom')
// // == "2px solid rgb(69, 155, 229)"
// // if (!ilessLoaded) {
// // const isPort3007 = window.location.port == 3007;
// // let _url_origin = isPort3007 ? 'http://localhost:3000' : ''
// //
// // $('head').append( $('<link rel="stylesheet" type="text/css" />')
// // .attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css`) );
// // $('head').append( $('<link rel="stylesheet" type="text/css" />')
// // .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css`) );
// // }
// // }
// // return Promise.reject(error);
}); });
} }
handleDialogClose = () => { handleDialogClose = () => {
// if(this.props.match.path==='/'){
// this.setState({
// isRender: false
// })
// this.props.Modifyloginvalue();
// }else{
// if(this.props.isloginCancel===undefined){
// window.location.href="/";
// this.props.Modifyloginvalue();
// // this.setState({
// // isRender: false
// // })
// // this.props.Modifyloginvalue();
// }else{
// this.setState({
// isRender: false
// })
// this.props.Modifyloginvalue();
// }
this.setState({ this.setState({
isRender: false isRender: false
@ -438,14 +361,6 @@ class LoginDialog extends Component {
this.props.Modifyloginvalue(); this.props.Modifyloginvalue();
// this.setState({
// isRender: false
// })
// try {
// this.props.Modifyloginvalue();
// }catch (e) {
//
// }
} }
loginEDU = () => { loginEDU = () => {
@ -464,7 +379,6 @@ class LoginDialog extends Component {
autologin: isGoingValue autologin: isGoingValue
} }
).then((response) => { ).then((response) => {
debugger;
if (response === undefined) { if (response === undefined) {
return return
} }

@ -59,8 +59,6 @@ class Trialapplicationysl extends Component {
} }
getipthon = () => { getipthon = () => {
// console.log("Trialapplicationysl");
// console.log("70");
let url = `/users/get_user_info.json` let url = `/users/get_user_info.json`
axios.get(url).then((result) => { axios.get(url).then((result) => {
console.log(result); console.log(result);

@ -1,10 +1,10 @@
import React, {Component} from 'react'; import React, { Component } from 'react';
import { import {
Spin, Spin,
Pagination, Pagination,
} from "antd"; } from "antd";
import axios from 'axios'; import axios from 'axios';
import {getImageUrl, markdownToHTML} from 'educoder'; import { getImageUrl, markdownToHTML } from 'educoder';
import "../css/messagemy.css" import "../css/messagemy.css"
import NoneData from '../../../modules/courses/coursesPublic/NoneData' import NoneData from '../../../modules/courses/coursesPublic/NoneData'
//消息页面 //消息页面
@ -48,7 +48,7 @@ class MessagSub extends Component {
this.setState({ this.setState({
isSpin: true, isSpin: true,
}) })
let {limit} = this.state; let { limit } = this.state;
let url = `/users/tidings.json`; let url = `/users/tidings.json`;
axios.get((url), { axios.get((url), {
params: { params: {
@ -80,7 +80,7 @@ class MessagSub extends Component {
this.setState({ this.setState({
isSpin: true, isSpin: true,
}) })
let {typeysl, page, limit} = this.state; let { typeysl, page, limit } = this.state;
let url = `/users/tidings.json`; let url = `/users/tidings.json`;
axios.get((url), { axios.get((url), {
params: { params: {
@ -118,7 +118,7 @@ class MessagSub extends Component {
gettourl = (item) => { gettourl = (item) => {
switch (item.container_type) { switch (item.container_type) {
case "ApplyUserAuthentication" : case "ApplyUserAuthentication":
if (item.tiding_type === "Apply") { if (item.tiding_type === "Apply") {
if (item.auth_type === 1) { if (item.auth_type === 1) {
//系统管理页面 //系统管理页面
@ -134,13 +134,13 @@ class MessagSub extends Component {
return window.open("/account/certification") return window.open("/account/certification")
} }
return; return;
case "CancelUserAuthentication" : case "CancelUserAuthentication":
// 账号管理页-认证信息 // 账号管理页-认证信息
return window.open("/account/certification") return window.open("/account/certification")
case "CancelUserProCertification" : case "CancelUserProCertification":
// 账号管理页-认证信息 // 账号管理页-认证信息
return window.open("/account/certification") return window.open("/account/certification")
case "ApplyAddDepartment" : case "ApplyAddDepartment":
if (item.tiding_type === "Apply") { if (item.tiding_type === "Apply") {
//部门审批 //部门审批
return window.open("/admins/department_applies") return window.open("/admins/department_applies")
@ -150,7 +150,7 @@ class MessagSub extends Component {
return window.open("/account/profile") return window.open("/account/profile")
} }
return; return;
case "ApplyAddSchools" : case "ApplyAddSchools":
if (item.tiding_type === "Apply") { if (item.tiding_type === "Apply") {
// 单位审批 // 单位审批
return window.open("/admins/unit_applies") return window.open("/admins/unit_applies")
@ -160,9 +160,9 @@ class MessagSub extends Component {
return window.open("/account/profile") return window.open("/account/profile")
} }
return; return;
case "ApplyAction" : case "ApplyAction":
switch (item.parent_container_type) { switch (item.parent_container_type) {
case "ApplyShixun" : case "ApplyShixun":
if (item.tiding_type === "Apply") { if (item.tiding_type === "Apply") {
return window.open("/admins/shixun_authorizations") return window.open("/admins/shixun_authorizations")
} }
@ -170,7 +170,7 @@ class MessagSub extends Component {
// 实训详情页 :identifier = identifier // 实训详情页 :identifier = identifier
return window.open(`/shixuns/${item.identifier}/challenges`) return window.open(`/shixuns/${item.identifier}/challenges`)
} }
case "ApplySubject" : case "ApplySubject":
if (item.tiding_type === "Apply") { if (item.tiding_type === "Apply") {
// 实训课程发布 // 实训课程发布
return window.open("/admins/subject_authorizations") return window.open("/admins/subject_authorizations")
@ -180,7 +180,7 @@ class MessagSub extends Component {
return window.open(`/paths/${item.parent_container_id}`) return window.open(`/paths/${item.parent_container_id}`)
} }
case "TrialAuthorization" : case "TrialAuthorization":
if (item.tiding_type === "Apply") { if (item.tiding_type === "Apply") {
// 试用授权页面 // 试用授权页面
return window.open("/managements/trial_authorization") return window.open("/managements/trial_authorization")
@ -191,7 +191,7 @@ class MessagSub extends Component {
} }
} }
return; return;
case 'JoinCourse' : case 'JoinCourse':
// 课堂详情页 :id = // 课堂详情页 :id =
return window.open(`/courses/${item.belong_container_id}/teachers`) return window.open(`/courses/${item.belong_container_id}/teachers`)
case 'StudentJoinCourse': case 'StudentJoinCourse':
@ -203,34 +203,34 @@ class MessagSub extends Component {
//教学案例详情 :id = container_id //教学案例详情 :id = container_id
return window.open(`/courses/${item.belong_container_id}/students`); return window.open(`/courses/${item.belong_container_id}/students`);
} }
case 'DealCourse': case 'DealCourse':
// 课堂详情页 :id = container_id // 课堂详情页 :id = container_id
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`) return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`)
case 'TeacherJoinCourse': case 'TeacherJoinCourse':
// 课堂详情页 :id = container_id // 课堂详情页 :id = container_id
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`) return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`)
case 'Course' : case 'Course':
// 课堂详情页 :id = container_id // 课堂详情页 :id = container_id
if (item.tiding_type === "Delete") { if (item.tiding_type === "Delete") {
return; return;
} }
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`) return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`)
case 'ArchiveCourse' : case 'ArchiveCourse':
// 课堂详情页 :id = container_id // 课堂详情页 :id = container_id
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`) return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.container_id}`)
case "Shixun" : case "Shixun":
return window.open(`/shixuns/${item.identifier}/challenges`) return window.open(`/shixuns/${item.identifier}/challenges`)
case "Subject" : case "Subject":
// 课程汇总详情页 :id = container_id // 课程汇总详情页 :id = container_id
return window.open(`/paths/${item.container_id}`) return window.open(`/paths/${item.container_id}`)
case "JournalsForMessage" : case "JournalsForMessage":
switch (item.parent_container_type) { switch (item.parent_container_type) {
case "Principal" : case "Principal":
// 反馈页 :id = parent_container_id // 反馈页 :id = parent_container_id
// 不用跳了 // 不用跳了
return ''; return '';
case "HomeworkCommon" : case "HomeworkCommon":
//学生作业页 homework = parent_container_id //学生作业页 homework = parent_container_id
if (item.homework_type === "normal") { if (item.homework_type === "normal") {
//普通作业 //普通作业
@ -245,10 +245,10 @@ class MessagSub extends Component {
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=1`) return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=1`)
} }
return ""; return "";
case "GraduationTopic" : case "GraduationTopic":
// 毕业目标页 parent_container_id // 毕业目标页 parent_container_id
return window.open(`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`) return window.open(`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`)
case "StudentWorksScore" : case "StudentWorksScore":
//学生作业页 //学生作业页
if (item.homework_type === "normal") { if (item.homework_type === "normal") {
//普通作业 //普通作业
@ -264,45 +264,45 @@ class MessagSub extends Component {
} }
return ""; return "";
} }
case "Memo" : case "Memo":
// 交流问答页 :id = parent_container_id // 交流问答页 :id = parent_container_id
return window.open(`/forums/${item.parent_container_id}`); return window.open(`/forums/${item.parent_container_id}`);
case "Message" : case "Message":
// 交流问答页 :id = parent_container_id // 交流问答页 :id = parent_container_id
return window.open(`/forums/`); return window.open(`/forums/`);
case "Watcher" : case "Watcher":
// 用户个人中心页 :id = item.trigger_user.login // 用户个人中心页 :id = item.trigger_user.login
return window.open(`/users/${item.trigger_user.login}/courses`) return window.open(`/users/${item.trigger_user.login}/courses`)
case "PraiseTread" : case "PraiseTread":
// 这块太复杂 不好处理 // 这块太复杂 不好处理
return ''; return '';
case "Grade" : case "Grade":
//个人中心页 :id = item.trigger_user.login //个人中心页 :id = item.trigger_user.login
// return window.open(`/users/${item.trigger_user.login}/courses`; // return window.open(`/users/${item.trigger_user.login}/courses`;
return ""; return "";
case "JoinProject" : case "JoinProject":
//项目详情-申请加入项目审核页 :id = container_id //项目详情-申请加入项目审核页 :id = container_id
return window.open(`/projects/${item.container_id}`) return window.open(`/projects/${item.container_id}`)
case 'ReporterJoinProject': case 'ReporterJoinProject':
//项目详情页 :id = container_id //项目详情页 :id = container_id
return window.open(`/projects/${item.container_id}`) return window.open(`/projects/${item.container_id}`)
case 'DealProject': case 'DealProject':
//项目详情页 :id = container_id //项目详情页 :id = container_id
return window.open(`/projects/${item.container_id}`) return window.open(`/projects/${item.container_id}`)
case 'ManagerJoinProject': case 'ManagerJoinProject':
//项目详情页 :id = container_id //项目详情页 :id = container_id
return window.open(`/projects/${item.container_id}`) return window.open(`/projects/${item.container_id}`)
case "Poll": case "Poll":
switch (item.parent_container_type) { switch (item.parent_container_type) {
case "CommitPoll" : case "CommitPoll":
// 课堂id belong_container_id // 课堂id belong_container_id
//课堂-学生已提交问卷列表 :id = container_id //课堂-学生已提交问卷列表 :id = container_id
return window.open(` /courses/${item.belong_container_id}/polls/${item.container_id}`) return window.open(` /courses/${item.belong_container_id}/polls/${item.container_id}`)
default : default:
// 课堂-问卷列表 :id = container_id // 课堂-问卷列表 :id = container_id
return window.open(` /courses/${item.belong_container_id}/polls/${item.container_id}`) return window.open(` /courses/${item.belong_container_id}/polls/${item.container_id}`)
} }
case "Exercise" : case "Exercise":
switch (item.parent_container_type) { switch (item.parent_container_type) {
case "CommitExercise": case "CommitExercise":
// 课堂-学生试卷详情 :id = container_id :user_id = trigger_user.id // 课堂-学生试卷详情 :id = container_id :user_id = trigger_user.id
@ -312,28 +312,28 @@ class MessagSub extends Component {
// 课堂-学生试卷详情 :id = container_id :user_id = trigger_user.id // 课堂-学生试卷详情 :id = container_id :user_id = trigger_user.id
return window.open(` /courses/${item.belong_container_id}/exercises/${item.container_id}/student_exercise_list?tab=0`); return window.open(` /courses/${item.belong_container_id}/exercises/${item.container_id}/student_exercise_list?tab=0`);
//记得跳评阅页面 //记得跳评阅页面
default : default:
// 课堂-试卷列表详情 :id = container_id // 课堂-试卷列表详情 :id = container_id
return window.open(`/courses/${item.belong_container_id}/exercises/${item.container_id}/student_exercise_list?tab=0`); return window.open(`/courses/${item.belong_container_id}/exercises/${item.container_id}/student_exercise_list?tab=0`);
} }
case 'StudentGraduationTopic' : case 'StudentGraduationTopic':
//课堂-毕业选题详情 :id = parent_container_id //课堂-毕业选题详情 :id = parent_container_id
return window.open(`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`) return window.open(`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`)
case 'DealStudentTopicSelect' : case 'DealStudentTopicSelect':
//课堂-毕业选题详情 :id = parent_container_id //课堂-毕业选题详情 :id = parent_container_id
return window.open(`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`) return window.open(`/courses/${item.belong_container_id}/graduation_topics/${item.parent_container_id}/detail`)
case 'GraduationTask' : case 'GraduationTask':
//课堂-毕业任务页 :id = container_id //课堂-毕业任务页 :id = container_id
return window.open(`/courses/${item.belong_container_id}/graduation_tasks/${item.container_id}`) return window.open(`/courses/${item.belong_container_id}/graduation_tasks/${item.container_id}`)
case "GraduationWork" : case "GraduationWork":
//课堂-毕业xx页 :id = container_id //课堂-毕业xx页 :id = container_id
return window.open(`/courses/${item.belong_container_id}/graduation_tasks/${item.container_id}`) return window.open(`/courses/${item.belong_container_id}/graduation_tasks/${item.container_id}`)
case "GraduationWorkScore" : case "GraduationWorkScore":
// 课堂-毕业xx页 :id = parent_container_id // 课堂-毕业xx页 :id = parent_container_id
return window.open(`/courses/${item.belong_container_id}/graduation_tasks/${item.parent_container_id}`) return window.open(`/courses/${item.belong_container_id}/graduation_tasks/${item.parent_container_id}`)
case "HomeworkCommon" : case "HomeworkCommon":
switch (item.parent_container_type) { switch (item.parent_container_type) {
case "AnonymousCommentFail" : case "AnonymousCommentFail":
// 课堂-作业列表 homework = container_id // 课堂-作业列表 homework = container_id
if (item.homework_type === "normal") { if (item.homework_type === "normal") {
//普通作业 //普通作业
@ -347,7 +347,7 @@ class MessagSub extends Component {
//实训作业 //实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} }
case "HomeworkPublish" : case "HomeworkPublish":
if (item.homework_type === "normal") { if (item.homework_type === "normal") {
//普通作业 //普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`) return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
@ -360,7 +360,7 @@ class MessagSub extends Component {
//实训作业 //实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} }
case "AnonymousAppeal" : case "AnonymousAppeal":
if (item.homework_type === "normal") { if (item.homework_type === "normal") {
//普通作业 //普通作业
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`) return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
@ -373,7 +373,7 @@ class MessagSub extends Component {
//实训作业 //实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} }
default : default:
// 课堂-作业列表 homework = container_id // 课堂-作业列表 homework = container_id
if (item.homework_type === "normal") { if (item.homework_type === "normal") {
//普通作业 //普通作业
@ -388,7 +388,7 @@ class MessagSub extends Component {
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} }
} }
case "StudentWork" : case "StudentWork":
//课堂-作业 :id = container_id //课堂-作业 :id = container_id
if (item.homework_type === "normal") { if (item.homework_type === "normal") {
//普通作业 //普通作业
@ -402,54 +402,29 @@ class MessagSub extends Component {
//实训作业 //实训作业
return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`) return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
} }
case "StudentWorksScore" : case "StudentWorksScore":
//课堂-作业 :id = parent_container_id
// if(item.homework_type==="normal"){
// //普通作业
// return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
// }
// if(item.homework_type==="group"){
// //分组作业
// return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
// }
// if(item.homework_type==="practice"){
// //实训作业
// return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
// }
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.trigger_user.id}/${item.parent_container_id}/appraise`); return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.trigger_user.id}/${item.parent_container_id}/appraise`);
case "StudentWorksScoresAppeal" : case "StudentWorksScoresAppeal":
// if(item.homework_type==="normal"){
// //普通作业
// return window.open(`courses/${item.belong_container_id}/common_homeworks/${item.parent_container_id}/list`)
// }
// if(item.homework_type==="group"){
// //分组作业
// return window.open(`/courses/${item.belong_container_id}/group_homeworks/${item.parent_container_id}/list`)
// }
// if(item.homework_type==="practice"){
// //实训作业
// return window.open(`/courses/${item.belong_container_id}/shixun_homeworks/${item.parent_container_id}/list?tab=0`)
// }
return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.trigger_user.id}/${item.parent_container_id}/appraise`); return window.open(`/courses/${item.belong_container_id}/common_homeworks/${item.trigger_user.id}/${item.parent_container_id}/appraise`);
case "ChallengeWorkScore" : case "ChallengeWorkScore":
return ''; return '';
case "SendMessage" : case "SendMessage":
// /managements/mirror_repository // /managements/mirror_repository
return window.open(`/managements/mirror_repository`) return window.open(`/managements/mirror_repository`)
case "Journal" : case "Journal":
//项目Issue页 :id = parent_container_id //项目Issue页 :id = parent_container_id
return window.open(`/issues/${item.parent_container_id}`); return window.open(`/issues/${item.parent_container_id}`);
case "Issue" : case "Issue":
//项目Issue页 :id = container_id //项目Issue页 :id = container_id
return window.open(`/issues/${item.container_id}`) return window.open(`/issues/${item.container_id}`)
case "PullRequest" : case "PullRequest":
// 项目pull request页 :id = parent_container_id // 项目pull request页 :id = parent_container_id
return window.open(`/projects/${item.parent_container_id}/pull_requests`) return window.open(`/projects/${item.parent_container_id}/pull_requests`)
case "Department" : case "Department":
//账号管理页 //账号管理页
return window.open(`/account/profile`) return window.open(`/account/profile`)
case "Library" : case "Library":
if (item.tiding_type === 'Apply') { if (item.tiding_type === 'Apply') {
// /managements/library_applies // /managements/library_applies
return window.open(`/admins/library_applies`) return window.open(`/admins/library_applies`)
@ -458,7 +433,7 @@ class MessagSub extends Component {
//教学案例详情 :id = container_id //教学案例详情 :id = container_id
return window.open(`/moop_cases/${item.container_id}`) return window.open(`/moop_cases/${item.container_id}`)
} }
case "ProjectPackage" : case "ProjectPackage":
if (item.tiding_type === "Destroyed") { if (item.tiding_type === "Destroyed") {
return; return;
} }
@ -516,14 +491,14 @@ class MessagSub extends Component {
if (item.extra && item.parent_container_type !== 'HackDelete') { if (item.extra && item.parent_container_type !== 'HackDelete') {
return window.open(`/problems/${item.extra}/edit`); return window.open(`/problems/${item.extra}/edit`);
} }
default : default:
return return
} }
} }
render() { render() {
let {page, limit, typeysl, count, isSpin, data} = this.state; let { page, limit, typeysl, count, isSpin, data } = this.state;
// console.log("6868686868"); // console.log("6868686868");
console.log(data); console.log(data);
return ( return (
@ -614,12 +589,12 @@ class MessagSub extends Component {
className={boolps === true ? "ridinglist-sub clearfix df tiding_item" : "ridinglist-subs clearfix df tiding_item"} className={boolps === true ? "ridinglist-sub clearfix df tiding_item" : "ridinglist-subs clearfix df tiding_item"}
onClick={() => this.gettourl(item)}> onClick={() => this.gettourl(item)}>
<img onMouseDown={() => this.myCome(item)} <img onMouseDown={() => this.myCome(item)}
src={getImageUrl("images/" + item.trigger_user.image_url)} src={getImageUrl("images/" + item.trigger_user.image_url)}
className="radius mr10 fl myimgw48 myimgh48"/> className="radius mr10 fl myimgw48 myimgh48" />
<div className="fl flex1"> <div className="fl flex1">
<p> <p>
<a className="mr20 private_message_a" <a className="mr20 private_message_a"
onMouseDown={() => this.myCome(item)}>{item.trigger_user.name}</a> onMouseDown={() => this.myCome(item)}>{item.trigger_user.name}</a>
<span className="color-grey-c">{item.time}</span> <span className="color-grey-c">{item.time}</span>
{item.tiding_type === "Apply" ? ( {item.tiding_type === "Apply" ? (
item.status === 0 ? item.status === 0 ?
@ -639,8 +614,8 @@ class MessagSub extends Component {
` `
} }
</style> </style>
<p className="color-grey-6 yslspansk markdown-body mt10" style={{wordBreak: "break-word"}} <p className="color-grey-6 yslspansk markdown-body mt10" style={{ wordBreak: "break-word" }}
dangerouslySetInnerHTML={{__html: markdownToHTML(item.content).replace(/▁/g, "▁▁▁")}}></p> dangerouslySetInnerHTML={{ __html: markdownToHTML(item.content).replace(/▁/g, "▁▁▁") }}></p>
</div> </div>
<span className={item.new_tiding === true ? "new-point fr mr40 mt22" : ""}></span> <span className={item.new_tiding === true ? "new-point fr mr40 mt22" : ""}></span>
@ -655,13 +630,13 @@ class MessagSub extends Component {
{data === undefined ? "" {data === undefined ? ""
: :
(count > 10 ? (count > 10 ?
<div style={{textAlign: "center"}} className="new_expand mt10"> <div style={{ textAlign: "center" }} className="new_expand mt10">
<div className="edu-txt-center mt30"> <div className="edu-txt-center mt30">
<Pagination showQuickJumper current={page} <Pagination showQuickJumper current={page}
onChange={this.paginationonChanges} pageSize={limit} onChange={this.paginationonChanges} pageSize={limit}
total={count}></Pagination> total={count}></Pagination>
</div> </div>
</div> : "" </div> : ""
) )
} }

File diff suppressed because it is too large Load Diff

@ -1,39 +1,29 @@
import React, { Component } from 'react'; import React from 'react';
import PropTypes from 'prop-types';
import NewHeader from './NewHeader' import NewHeader from './NewHeader'
import NewFooter from './NewFooter' import NewFooter from './NewFooter'
import SiderBar from './SiderBar' import SiderBar from './SiderBar'
import { getUrl, downloadFile } from 'educoder' import { downloadFile } from 'educoder'
import axios from 'axios'; import axios from 'axios';
import { Spin } from 'antd'; import { Spin } from 'antd';
import './TPMIndex.css'; import './TPMIndex.css';
import LoginDialog from '../login/LoginDialog'; import LoginDialog from '../login/LoginDialog';
import AccountProfile from '../user/AccountProfile'; import AccountProfile from '../user/AccountProfile';
import AccountPhoneemail from '../user/AccountPhoneemail'; import AccountPhoneemail from '../user/AccountPhoneemail';
import Trialapplication from "../login/Trialapplication";
// import "antd/dist/antd.css";
// import '../../css/educoder/edu-common.css'
// import '../../css/educoder/edu-all.css'
// import '../../css/educoder/edu-main.css'
const $ = window.$; const $ = window.$;
const versionNum = '0001'; const versionNum = '0001';
// let _url_origin = getUrl()
let _url_origin = ''; let _url_origin = '';
if (window.location.port === "3007") { if (window.location.port === "3007") {
_url_origin = "https://test-newweb.educoder.net"; _url_origin = "https://test-newweb.educoder.net";
} }
// let _url_origin=`https://www.educoder.net`;
if (!window['indexHOCLoaded']) { if (!window['indexHOCLoaded']) {
window.indexHOCLoaded = true; window.indexHOCLoaded = true;
//解决首屏加载问题 //解决首屏加载问题
// $('head').append($('<link rel="stylesheet" type="text/css" />')
// .attr('href', `${_url_origin}/stylesheets/educoder/antd.min.css?1525440977`));
$('head').append($('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-common.css?3`)); .attr('href', `${_url_origin}/stylesheets/css/edu-common.css?3`));
@ -44,25 +34,7 @@ if (!window['indexHOCLoaded']) {
$('head').append($('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?3`)); .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?3`));
// $('head').append($('<link rel="stylesheet" type="text/css" />')
// .attr('href', `${_url_origin}/stylesheets/educoder/css_min_all.css?1525440977`));
// 加timeout 为了覆盖掉antd的样式
// setTimeout(() => {
// $('head').append( $('<link rel="stylesheet" type="text/css" />')
// .attr('href', `${_url_origin}/stylesheets/css/edu-common.css?1525440977`) );
// $('head').append( $('<link rel="stylesheet" type="text/css" />')
// .attr('href', `${_url_origin}/stylesheets/educoder/edu-all.css?1525440977`) );
// $('head').append( $('<link rel="stylesheet" type="text/css" />')
// .attr('href', `${_url_origin}/stylesheets/educoder/edu-main.css?1525440977`) );
// }, 1000);
$("script").append('<script></script>')
.attr('src', `${_url_origin}/javascripts/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js?_t=${versionNum}`);
} }
// `${_url_origin}/javascripts/jquery-1.8.3-ui-1.9.2-ujs-2.0.3.js?_t=${versionNum}`
// TODO css加载完成后再打开页面行为和tpm其他页面一致 // TODO css加载完成后再打开页面行为和tpm其他页面一致
export function TPMIndexHOC(WrappedComponent) { export function TPMIndexHOC(WrappedComponent) {
// 这里如果extends WrappedComponent 会出现 WrappedComponent mount twice的问题 // 这里如果extends WrappedComponent 会出现 WrappedComponent mount twice的问题
@ -90,7 +62,6 @@ export function TPMIndexHOC(WrappedComponent) {
// header里面需要有user // header里面需要有user
initCommonState(user) { initCommonState(user) {
// 更新头像后,需要改变参数,不然会被图片缓存影响到 --> 后台已加 ?t=${new Date().getTime()
const newUser = Object.assign({}, { ...user }, { image_url: `${user.image_url}` }); const newUser = Object.assign({}, { ...user }, { image_url: `${user.image_url}` });
this.setState({ this.setState({
user: newUser, user: newUser,
@ -128,7 +99,6 @@ export function TPMIndexHOC(WrappedComponent) {
.then((response) => { .then((response) => {
const status = response.data.status; const status = response.data.status;
if (status == 1) { if (status == 1) {
const new_author_info = Object.assign({}, creator)
this.setState({ this.setState({
watched: !watched watched: !watched
}) })
@ -148,8 +118,6 @@ export function TPMIndexHOC(WrappedComponent) {
} }
componentDidMount() { componentDidMount() {
// console.log("TPMIndexHOC========");
// console.log(this.props);
window.addEventListener('keyup', this.keyupListener) window.addEventListener('keyup', this.keyupListener)
if (this.props.match.path === "/") { if (this.props.match.path === "/") {
@ -166,28 +134,6 @@ export function TPMIndexHOC(WrappedComponent) {
document.title = "翻转课堂"; document.title = "翻转课堂";
} }
// if(this.props.match.path==="/"){
// document.title="EduCoder-IT实践教学平台_信息技术类精品课程网_大学生MOOC平台";
// }else if(this.props.match.path==="/403"){
// document.title="你没有权限访问";
// }else if(this.props.match.path==="/nopage"){
// document.title="没有找到该页面";
// }else if(this.props.match.path==="/shixuns"){
// document.title="EduCoder-IT实践教学平台_信息技术类精品课程网_大学生MOOC平台";
// }else if(this.props.match.path==="/paths"){
// document.title="实践课程_项目实战开发_web前端开发实训_web后端开发实战_人工智能技术-EduCoder";
// }else if(this.props.match.path==="/courses"){
// document.title="实训项目_php后端开发_app前端开发_java_python实训_C语言入门课程-EduCoder";
// }else if(this.props.match.path==="/competitions"){
// document.title="在线竞赛_计算机应用大赛_编程大赛_大学生设计大赛_全国高校绿色计算大赛-EduCoder";
// }else if(this.props.match.path==="/moop_cases"){
// document.title="教学案例-EduCoder";
// }else if(this.props.match.path==="/forums"){
// document.title="交流问答-EduCoder";
// }else if(this.props.match.path==="/forums"){
// document.title="交流问答-EduCoder";
// }
$.ajaxSetup({ $.ajaxSetup({
cache: true cache: true
}); });
@ -216,7 +162,7 @@ export function TPMIndexHOC(WrappedComponent) {
dataquerys: {}, dataquerys: {},
}) })
} }
this.fetchUsers(dataqueryss); this.fetchUser(dataqueryss);
let url = `/users/get_navigation_info.json`; let url = `/users/get_navigation_info.json`;
axios.get(url, { axios.get(url, {
@ -462,71 +408,6 @@ export function TPMIndexHOC(WrappedComponent) {
console.log(error) console.log(error)
}) })
}; };
fetchUsers = (yslurlobject) => {
let url = `/users/get_user_info.json`
let courseId;
let query = this.props.location.pathname;
const type = query.split('/');
if (type[1] == 'courses' && type[2]) {
courseId = parseInt(type[2])
// url += `?course_id=${courseId}`
}
var datay = {};
if (JSON.stringify(yslurlobject) === "{}") {
datay = {
course_id: isNaN(courseId) ? undefined : courseId,
school: 1
}
} else {
datay = {
course_id: isNaN(courseId) ? undefined : courseId,
school: 1,
chinaoocTimestamp: yslurlobject.chinaoocTimestamp,
websiteName: yslurlobject.websiteName,
chinaoocKey: yslurlobject.chinaoocKey,
}
}
axios.get(url, {
params:
datay
},
{
// withCredentials: true
}
).then((response) => {
/*
{
"username": "黄井泉",
"login": "Hjqreturn",
"user_id": 12,
"image_url": "avatar/User/12",
"admin": true,
"is_teacher": false,
"tidding_count": 0
}
*/
if (response === undefined) {
return
}
if (response.data) {
this.initCommonState(response.data)
this.setState({
tpmLoading: false,
coursedata: {
course_identity: response.data.course_identity >= 0 ? response.data.course_identity : undefined,
course_public: response.data.course_public,
name: response.data.course_name,
userid: response.data.user_id
},
})
}
}).catch((error) => {
console.log(error)
})
};
//截取url 数据的 //截取url 数据的
foo = (url) => { foo = (url) => {
var json = {}; var json = {};
@ -534,12 +415,9 @@ export function TPMIndexHOC(WrappedComponent) {
var arr; var arr;
do { do {
arr = regExp.exec(url); arr = regExp.exec(url);
// console.log(arr); // arr = [完整的字符串, key, 等号或'', value或'']
if (arr) { if (arr) {
var key = arr[1]; var key = arr[1];
var value = arr[3]; var value = arr[3];
// arr[2] === ''时, value = undefined
if (!arr[2]) if (!arr[2])
value = undefined; value = undefined;

@ -1,6 +1,6 @@
import React, {Component} from 'react'; import React, { Component } from 'react';
import {Button,notification} from 'antd'; import { Button, notification } from 'antd';
import {broadcastChannelPostMessage} from 'educoder'; import { broadcastChannelPostMessage } from 'educoder';
import MyEduCoderModal from './MyEduCoderModal'; import MyEduCoderModal from './MyEduCoderModal';
import axios from 'axios'; import axios from 'axios';
import './common.css'; import './common.css';
@ -25,13 +25,13 @@ class InterestpageComponent extends Component {
super(props) super(props)
this.state = { this.state = {
gouxuans: "", gouxuans: "",
gouxuans2:0, gouxuans2: 0,
gouxuans4:[], gouxuans4: [],
namezh:this.props.namezh, namezh: this.props.namezh,
passmm:this.props.passmm, passmm: this.props.passmm,
homedatalist:undefined, homedatalist: undefined,
hometypepvisible: undefined, hometypepvisible: undefined,
MyEduCoderModals:false, MyEduCoderModals: false,
} }
} }
openNotification = (messge) => { openNotification = (messge) => {
@ -44,42 +44,42 @@ class InterestpageComponent extends Component {
}, },
}); });
} }
componentDidMount(){ componentDidMount() {
console.log("min"); console.log("min");
let{gouxuans4} =this.state; let { gouxuans4 } = this.state;
let url=`/repertoires.json`; let url = `/repertoires.json`;
axios.get(url).then((response)=> { axios.get(url).then((response) => {
if(response){ if (response) {
// console.log("53"); // console.log("53");
// console.log(response.data); // console.log(response.data);
for(var i=0;i<response.data.repertoires.length;i++){ for (var i = 0; i < response.data.repertoires.length; i++) {
var qdkfys=""; var qdkfys = "";
if(response.data.repertoires[i].id===1){ if (response.data.repertoires[i].id === 1) {
qdkfys=qdkf; qdkfys = qdkf;
}if(response.data.repertoires[i].id===2){ } if (response.data.repertoires[i].id === 2) {
qdkfys=hdkf; qdkfys = hdkf;
}if(response.data.repertoires[i].id===3){ } if (response.data.repertoires[i].id === 3) {
qdkfys=ydkf; qdkfys = ydkf;
}if(response.data.repertoires[i].id===4){ } if (response.data.repertoires[i].id === 4) {
qdkfys=sjk; qdkfys = sjk;
}if(response.data.repertoires[i].id===5){ } if (response.data.repertoires[i].id === 5) {
qdkfys=ysj; qdkfys = ysj;
}if(response.data.repertoires[i].id===6){ } if (response.data.repertoires[i].id === 6) {
qdkfys=yunwei; qdkfys = yunwei;
}if(response.data.repertoires[i].id===8){ } if (response.data.repertoires[i].id === 8) {
qdkfys=qita; qdkfys = qita;
}if(response.data.repertoires[i].id===9){ } if (response.data.repertoires[i].id === 9) {
qdkfys=rgzn; qdkfys = rgzn;
} }
if(response.data.repertoires[i].id===1) { if (response.data.repertoires[i].id === 1) {
var datas = { var datas = {
id: response.data.repertoires[i].id, id: response.data.repertoires[i].id,
name: response.data.repertoires[i].name, name: response.data.repertoires[i].name,
bool: true, bool: true,
url: qdkfys url: qdkfys
}; };
} else{ } else {
var datas = { var datas = {
id: response.data.repertoires[i].id, id: response.data.repertoires[i].id,
name: response.data.repertoires[i].name, name: response.data.repertoires[i].name,
@ -89,15 +89,15 @@ class InterestpageComponent extends Component {
} }
gouxuans4.push(datas); gouxuans4.push(datas);
this.setState({ this.setState({
gouxuans4:gouxuans4, gouxuans4: gouxuans4,
}) })
} }
// console.log("75"); // console.log("75");
// console.log(gouxuans4); // console.log(gouxuans4);
} }
}).catch((error)=>{ }).catch((error) => {
console.log(error) console.log(error)
}); });
} }
@ -136,77 +136,77 @@ class InterestpageComponent extends Component {
} }
Clickteacher=(e)=>{ Clickteacher = (e) => {
// console.log(e); // console.log(e);
if(e === "teacher"){ if (e === "teacher") {
this.setState({ this.setState({
gouxuans:"teacher", gouxuans: "teacher",
}) })
}else if(e ==="student"){ } else if (e === "student") {
this.setState({ this.setState({
gouxuans:"student", gouxuans: "student",
}) })
}else if(e === "professional"){ } else if (e === "professional") {
this.setState({ this.setState({
gouxuans:"professional", gouxuans: "professional",
}) })
} }
} }
Clickteacher2=(e)=>{ Clickteacher2 = (e) => {
// console.log(e); // console.log(e);
let {gouxuans4} =this.state; let { gouxuans4 } = this.state;
for (var i=0;i<gouxuans4.length;i++){ for (var i = 0; i < gouxuans4.length; i++) {
if(gouxuans4[i].id === e){ if (gouxuans4[i].id === e) {
// console.log("51"); // console.log("51");
// console.log(e); // console.log(e);
if(gouxuans4[i].bool === true){ if (gouxuans4[i].bool === true) {
gouxuans4[i].bool=false; gouxuans4[i].bool = false;
}else{ } else {
gouxuans4[i].bool=true; gouxuans4[i].bool = true;
} }
} }
} }
// console.log(gouxuans4); // console.log(gouxuans4);
this.setState({ this.setState({
gouxuans4:gouxuans4, gouxuans4: gouxuans4,
}) })
} }
setMyEduCoderModals=()=>{ setMyEduCoderModals = () => {
this.setState({ this.setState({
MyEduCoderModals:true MyEduCoderModals: true
}) })
} }
//兴趣页面点击 //兴趣页面点击
Interestcompletionpage(){ Interestcompletionpage() {
if(this.state.gouxuans.length === 0){ if (this.state.gouxuans.length === 0) {
this.openNotification("请选择职业"); this.openNotification("请选择职业");
return return
} }
var ints=[]; var ints = [];
for (var i =0;i<this.state.gouxuans4.length;i++) { for (var i = 0; i < this.state.gouxuans4.length; i++) {
if(this.state.gouxuans4[i].bool === true){ if (this.state.gouxuans4[i].bool === true) {
ints.push(this.state.gouxuans4[i].id); ints.push(this.state.gouxuans4[i].id);
} }
} }
console.log("195195"); console.log("195195");
console.log(ints); console.log(ints);
if(ints.length<1){ if (ints.length < 1) {
this.openNotification("请至少选择一个您感兴趣的内容"); this.openNotification("请至少选择一个您感兴趣的内容");
return return
} }
var url = "/users/interest.json"; var url = "/users/interest.json";
axios.post(url, { axios.post(url, {
identity:this.state.gouxuans, identity: this.state.gouxuans,
interest_ids: ints, interest_ids: ints,
}).then((response) => { }).then((response) => {
if (response !== undefined) { if (response !== undefined) {
// this.Jumptotheinterestpage(); // this.Jumptotheinterestpage();
// window.location.href = "/" // window.location.href = "/"
if(response.data.status===0){ if (response.data.status === 0) {
this.setMyEduCoderModals() this.setMyEduCoderModals()
} }
@ -220,39 +220,10 @@ class InterestpageComponent extends Component {
}) })
} }
// //跳转然后登入 setNotcompleteds = () => {
// Jumptotheinterestpage=()=>{
// console.log(this.state.login);
// console.log(this.state.password);
// var url = "/accounts/login.json";
// axios.post(url, {
// login: this.props.login,
// password: this.props.password,
// }).then((response) => {
// if (response === undefined) {
// return
// }
// if (response.status === 200) {
// // if (response.data.status === 402) {
// // window.location.href = response.data.url;
// // } else {
// // broadcastChannelPostMessage('refreshPage')
// // this.setState({
// // isRender: false
// // })
// window.location.href = "/"
// // }
// }
//
//
// }).catch((error) => {
// console.log(error);
// })
// }
setNotcompleteds=()=>{
this.setState({ this.setState({
Notcompleteds:true, Notcompleteds: true,
MyEduCoderModals:false MyEduCoderModals: false
}) })
} }
@ -264,45 +235,45 @@ class InterestpageComponent extends Component {
console.log(window.screen.width); console.log(window.screen.width);
return ( return (
<div className="ysllogin_register_contents" style={{width:"60%"}}> <div className="ysllogin_register_contents" style={{ width: "60%" }}>
<MyEduCoderModal <MyEduCoderModal
modalsType={this.state.MyEduCoderModals} modalsType={this.state.MyEduCoderModals}
setNotcompleteds={()=>{this.setNotcompleteds()}} setNotcompleteds={() => { this.setNotcompleteds() }}
/> />
<div className="ysllogin_section"> <div className="ysllogin_section">
<div style={{marginTop: "1%"}}><span className="yslspans1">请选择你的职业</span></div> <div style={{ marginTop: "1%" }}><span className="yslspans1">请选择你的职业</span></div>
<div className="ysldivhome1" > <div className="ysldivhome1" >
<div className="ysldivhomediv" style={{marginLeft:"30px"}} > <div className="ysldivhomediv" style={{ marginLeft: "30px" }} >
<div className="ysldivhomedivtxt" onClick={()=>this.Clickteacher("teacher")}>{gouxuans ==="teacher"? <img src={gouxuan} className="gouxuanimg"/>:<img className="gouxuanimg" src={meigouxuan}/>}老师</div> <div className="ysldivhomedivtxt" onClick={() => this.Clickteacher("teacher")}>{gouxuans === "teacher" ? <img src={gouxuan} className="gouxuanimg" /> : <img className="gouxuanimg" src={meigouxuan} />}老师</div>
<div className="ysldivhomedivimgsy" ><img onClick={()=>this.Clickteacher("teacher")} src={skzbdx} className="ysldivhomedivimg"/></div> <div className="ysldivhomedivimgsy" ><img onClick={() => this.Clickteacher("teacher")} src={skzbdx} className="ysldivhomedivimg" /></div>
</div> </div>
<div className="ysldivhomediv" style={{ marginLeft:"101px",marginRight:"101px"}}> <div className="ysldivhomediv" style={{ marginLeft: "101px", marginRight: "101px" }}>
<div className="ysldivhomedivtxt" onClick={()=>this.Clickteacher("student")}>{gouxuans==="student"? <img src={gouxuan} className="gouxuanimg"/>:<img className="gouxuanimg" src={meigouxuan}/>}学生</div> <div className="ysldivhomedivtxt" onClick={() => this.Clickteacher("student")}>{gouxuans === "student" ? <img src={gouxuan} className="gouxuanimg" /> : <img className="gouxuanimg" src={meigouxuan} />}学生</div>
<div className="ysldivhomedivimgsy"><img onClick={()=>this.Clickteacher("student")} src={mytc} className="ysldivhomedivimg"/></div> <div className="ysldivhomedivimgsy"><img onClick={() => this.Clickteacher("student")} src={mytc} className="ysldivhomedivimg" /></div>
</div> </div>
<div className="ysldivhomediv" > <div className="ysldivhomediv" >
<div className="ysldivhomedivtxt" onClick={()=>this.Clickteacher("professional")}>{gouxuans==="professional"?<img src={gouxuan} className="gouxuanimg"/>:<img className="gouxuanimg" src={meigouxuan}/>}专业人士</div> <div className="ysldivhomedivtxt" onClick={() => this.Clickteacher("professional")}>{gouxuans === "professional" ? <img src={gouxuan} className="gouxuanimg" /> : <img className="gouxuanimg" src={meigouxuan} />}专业人士</div>
<div className="ysldivhomedivimgsy"><img onClick={()=>this.Clickteacher("professional")} src={zyrs1} className="ysldivhomedivimg"/></div> <div className="ysldivhomedivimgsy"><img onClick={() => this.Clickteacher("professional")} src={zyrs1} className="ysldivhomedivimg" /></div>
</div> </div>
</div> </div>
<p className="yslspans2">选择你可能感兴趣的内容</p> <p className="yslspans2">选择你可能感兴趣的内容</p>
<p className="yslspans3">基于你关注的内容推荐</p> <p className="yslspans3">基于你关注的内容推荐</p>
<div className="ysldivhome2"> <div className="ysldivhome2">
{gouxuans4&&gouxuans4.map((item,key)=>{ {gouxuans4 && gouxuans4.map((item, key) => {
return( return (
<div className={item.id<5?"ysldivhomediv1":"ysldivhomediv2"} onClick={()=>this.Clickteacher2(item.id)}> <div className={item.id < 5 ? "ysldivhomediv1" : "ysldivhomediv2"} onClick={() => this.Clickteacher2(item.id)}>
{item.bool===true?<img src={gouxuan} className="yslgouxuanimg"/>:<div className="yslgouxuanimg2"></div>} {item.bool === true ? <img src={gouxuan} className="yslgouxuanimg" /> : <div className="yslgouxuanimg2"></div>}
<img className="div1img" src={item.url}/> <img className="div1img" src={item.url} />
<p className="textall">{item.name}</p> <p className="textall">{item.name}</p>
</div> </div>
) )
})} })}
</div> </div>
<Button className="yslbutton" size={"large"} type="primary"onClick={()=>this.Interestcompletionpage()} style={{width:"255px",height: "35px",background: "#4CACFF",marginTop: "2%",marginBottom:" 2%",}}>完成</Button> <Button className="yslbutton" size={"large"} type="primary" onClick={() => this.Interestcompletionpage()} style={{ width: "255px", height: "35px", background: "#4CACFF", marginTop: "2%", marginBottom: " 2%", }}>完成</Button>
</div> </div>
</div> </div>

@ -1,6 +1,6 @@
import React, {Component} from 'react'; import React, { Component } from 'react';
import {Button,notification} from 'antd'; import { Button, notification } from 'antd';
import {broadcastChannelPostMessage} from 'educoder'; import { broadcastChannelPostMessage } from 'educoder';
import MyEduCoderModal from './MyEduCoderModal'; import MyEduCoderModal from './MyEduCoderModal';
// import Notcompleted from '../../common/Notcompleted'; // import Notcompleted from '../../common/Notcompleted';
import axios from 'axios'; import axios from 'axios';
@ -25,13 +25,13 @@ class InterestpageMax extends Component {
super(props) super(props)
this.state = { this.state = {
gouxuans: "", gouxuans: "",
gouxuans2:0, gouxuans2: 0,
gouxuans4:[], gouxuans4: [],
namezh:this.props.namezh, namezh: this.props.namezh,
passmm:this.props.passmm, passmm: this.props.passmm,
homedatalist:undefined, homedatalist: undefined,
hometypepvisible: undefined, hometypepvisible: undefined,
MyEduCoderModals:false MyEduCoderModals: false
} }
} }
openNotification = (messge) => { openNotification = (messge) => {
@ -44,42 +44,42 @@ class InterestpageMax extends Component {
}, },
}); });
} }
componentDidMount(){ componentDidMount() {
console.log("max"); console.log("max");
let{gouxuans4} =this.state; let { gouxuans4 } = this.state;
let url=`/repertoires.json`; let url = `/repertoires.json`;
axios.get(url).then((response)=> { axios.get(url).then((response) => {
if(response){ if (response) {
console.log("53"); console.log("53");
console.log(response.data); console.log(response.data);
for(var i=0;i<response.data.repertoires.length;i++){ for (var i = 0; i < response.data.repertoires.length; i++) {
var qdkfys=""; var qdkfys = "";
if(response.data.repertoires[i].id===1){ if (response.data.repertoires[i].id === 1) {
qdkfys=qdkf; qdkfys = qdkf;
}if(response.data.repertoires[i].id===2){ } if (response.data.repertoires[i].id === 2) {
qdkfys=hdkf; qdkfys = hdkf;
}if(response.data.repertoires[i].id===3){ } if (response.data.repertoires[i].id === 3) {
qdkfys=ydkf; qdkfys = ydkf;
}if(response.data.repertoires[i].id===4){ } if (response.data.repertoires[i].id === 4) {
qdkfys=sjk; qdkfys = sjk;
}if(response.data.repertoires[i].id===5){ } if (response.data.repertoires[i].id === 5) {
qdkfys=ysj; qdkfys = ysj;
}if(response.data.repertoires[i].id===6){ } if (response.data.repertoires[i].id === 6) {
qdkfys=yunwei; qdkfys = yunwei;
}if(response.data.repertoires[i].id===8){ } if (response.data.repertoires[i].id === 8) {
qdkfys=qita; qdkfys = qita;
}if(response.data.repertoires[i].id===9){ } if (response.data.repertoires[i].id === 9) {
qdkfys=rgzn; qdkfys = rgzn;
} }
if(response.data.repertoires[i].id===1) { if (response.data.repertoires[i].id === 1) {
var datas = { var datas = {
id: response.data.repertoires[i].id, id: response.data.repertoires[i].id,
name: response.data.repertoires[i].name, name: response.data.repertoires[i].name,
bool: true, bool: true,
url: qdkfys url: qdkfys
}; };
} else{ } else {
var datas = { var datas = {
id: response.data.repertoires[i].id, id: response.data.repertoires[i].id,
name: response.data.repertoires[i].name, name: response.data.repertoires[i].name,
@ -90,14 +90,14 @@ class InterestpageMax extends Component {
gouxuans4.push(datas); gouxuans4.push(datas);
this.setState({ this.setState({
gouxuans4:gouxuans4, gouxuans4: gouxuans4,
}) })
} }
console.log("75"); console.log("75");
console.log(gouxuans4); console.log(gouxuans4);
} }
}).catch((error)=>{ }).catch((error) => {
console.log(error) console.log(error)
}); });
@ -137,77 +137,77 @@ class InterestpageMax extends Component {
} }
Clickteacher=(e)=>{ Clickteacher = (e) => {
console.log(e); console.log(e);
if(e === "teacher"){ if (e === "teacher") {
this.setState({ this.setState({
gouxuans:"teacher", gouxuans: "teacher",
}) })
}else if(e ==="student"){ } else if (e === "student") {
this.setState({ this.setState({
gouxuans:"student", gouxuans: "student",
}) })
}else if(e === "professional"){ } else if (e === "professional") {
this.setState({ this.setState({
gouxuans:"professional", gouxuans: "professional",
}) })
} }
} }
Clickteacher2=(e)=>{ Clickteacher2 = (e) => {
console.log(e); console.log(e);
let {gouxuans4} =this.state; let { gouxuans4 } = this.state;
for (var i=0;i<gouxuans4.length;i++){ for (var i = 0; i < gouxuans4.length; i++) {
if(gouxuans4[i].id === e){ if (gouxuans4[i].id === e) {
console.log("51"); console.log("51");
console.log(e); console.log(e);
if(gouxuans4[i].bool === true){ if (gouxuans4[i].bool === true) {
gouxuans4[i].bool=false; gouxuans4[i].bool = false;
}else{ } else {
gouxuans4[i].bool=true; gouxuans4[i].bool = true;
} }
} }
} }
console.log(gouxuans4); console.log(gouxuans4);
this.setState({ this.setState({
gouxuans4:gouxuans4, gouxuans4: gouxuans4,
}) })
} }
setMyEduCoderModals=()=>{ setMyEduCoderModals = () => {
this.setState({ this.setState({
MyEduCoderModals:true MyEduCoderModals: true
}) })
} }
//兴趣页面点击 //兴趣页面点击
Interestcompletionpage(){ Interestcompletionpage() {
if(this.state.gouxuans.length === 0){ if (this.state.gouxuans.length === 0) {
this.openNotification("请选择职业"); this.openNotification("请选择职业");
return return
} }
var ints=[]; var ints = [];
for (var i =0;i<this.state.gouxuans4.length;i++) { for (var i = 0; i < this.state.gouxuans4.length; i++) {
if(this.state.gouxuans4[i].bool === true){ if (this.state.gouxuans4[i].bool === true) {
ints.push(this.state.gouxuans4[i].id); ints.push(this.state.gouxuans4[i].id);
} }
} }
console.log("200200"); console.log("200200");
console.log(ints); console.log(ints);
if(ints.length<1){ if (ints.length < 1) {
this.openNotification("请至少选择一个您感兴趣的内容"); this.openNotification("请至少选择一个您感兴趣的内容");
return return
} }
var url = "/users/interest.json"; var url = "/users/interest.json";
axios.post(url, { axios.post(url, {
identity:this.state.gouxuans, identity: this.state.gouxuans,
interest_ids: ints, interest_ids: ints,
}).then((response) => { }).then((response) => {
if (response !== undefined) { if (response !== undefined) {
// this.Jumptotheinterestpage(); // this.Jumptotheinterestpage();
// window.location.href = "/" // window.location.href = "/"
if(response.data.status===0){ if (response.data.status === 0) {
this.setMyEduCoderModals() this.setMyEduCoderModals()
} }
} }
@ -219,39 +219,10 @@ class InterestpageMax extends Component {
}) })
} }
// //跳转然后登入 setNotcompleteds = () => {
// Jumptotheinterestpage=()=>{
// console.log(this.state.login);
// console.log(this.state.password);
// var url = "/accounts/login.json";
// axios.post(url, {
// login: this.props.login,
// password: this.props.password,
// }).then((response) => {
// if (response === undefined) {
// return
// }
// if (response.status === 200) {
// // if (response.data.status === 402) {
// // window.location.href = response.data.url;
// // } else {
// // broadcastChannelPostMessage('refreshPage')
// // this.setState({
// // isRender: false
// // })
// window.location.href = "/"
// // }
// }
//
//
// }).catch((error) => {
// console.log(error);
// })
// }
setNotcompleteds=()=>{
this.setState({ this.setState({
Notcompleteds:true, Notcompleteds: true,
MyEduCoderModals:false MyEduCoderModals: false
}) })
} }
@ -263,44 +234,44 @@ class InterestpageMax extends Component {
// height: 346px; // height: 346px;
return ( return (
<div className="ysllogin_register_contents2" style={{width:"800px",height: "550px"}}> <div className="ysllogin_register_contents2" style={{ width: "800px", height: "550px" }}>
<MyEduCoderModal <MyEduCoderModal
modalsType={this.state.MyEduCoderModals} modalsType={this.state.MyEduCoderModals}
setNotcompleteds={()=>{this.setNotcompleteds()}} setNotcompleteds={() => { this.setNotcompleteds() }}
/> />
<div className="ysllogin_section2"> <div className="ysllogin_section2">
<div className="mt15"><span className="yslspans12">请选择你的职业</span></div> <div className="mt15"><span className="yslspans12">请选择你的职业</span></div>
<div className="ysldivhome12" > <div className="ysldivhome12" >
<div className="ysldivhomediv222" style={{marginLeft:"30px"}} > <div className="ysldivhomediv222" style={{ marginLeft: "30px" }} >
<div className="ysldivhomedivtxt2" onClick={()=>this.Clickteacher("teacher")}>{gouxuans ==="teacher"? <img src={gouxuan} className="gouxuanimg2"/>:<img className="gouxuanimg2" src={meigouxuan}/>}老师</div> <div className="ysldivhomedivtxt2" onClick={() => this.Clickteacher("teacher")}>{gouxuans === "teacher" ? <img src={gouxuan} className="gouxuanimg2" /> : <img className="gouxuanimg2" src={meigouxuan} />}老师</div>
<div className="ysldivhomedivimg2" ><img onClick={()=>this.Clickteacher("teacher")} src={skzbdx} className="ysldivhomedivimg2"/></div> <div className="ysldivhomedivimg2" ><img onClick={() => this.Clickteacher("teacher")} src={skzbdx} className="ysldivhomedivimg2" /></div>
</div> </div>
<div className="ysldivhomediv222" style={{ marginLeft:"101px",marginRight:"101px"}}> <div className="ysldivhomediv222" style={{ marginLeft: "101px", marginRight: "101px" }}>
<div className="ysldivhomedivtxt2" onClick={()=>this.Clickteacher("student")}>{gouxuans==="student"? <img src={gouxuan} className="gouxuanimg2"/>:<img className="gouxuanimg2" src={meigouxuan}/>}学生</div> <div className="ysldivhomedivtxt2" onClick={() => this.Clickteacher("student")}>{gouxuans === "student" ? <img src={gouxuan} className="gouxuanimg2" /> : <img className="gouxuanimg2" src={meigouxuan} />}学生</div>
<div className="ysldivhomedivimg2"><img onClick={()=>this.Clickteacher("student")} src={mytc} className="ysldivhomedivimg2"/></div> <div className="ysldivhomedivimg2"><img onClick={() => this.Clickteacher("student")} src={mytc} className="ysldivhomedivimg2" /></div>
</div> </div>
<div className="ysldivhomediv222" > <div className="ysldivhomediv222" >
<div className="ysldivhomedivtxt2" onClick={()=>this.Clickteacher("professional")}>{gouxuans==="professional"?<img src={gouxuan} className="gouxuanimg2"/>:<img className="gouxuanimg2" src={meigouxuan}/>}专业人士</div> <div className="ysldivhomedivtxt2" onClick={() => this.Clickteacher("professional")}>{gouxuans === "professional" ? <img src={gouxuan} className="gouxuanimg2" /> : <img className="gouxuanimg2" src={meigouxuan} />}专业人士</div>
<div className="ysldivhomedivimg2"><img onClick={()=>this.Clickteacher("professional")} src={zyrs1} className="ysldivhomedivimg2"/></div> <div className="ysldivhomedivimg2"><img onClick={() => this.Clickteacher("professional")} src={zyrs1} className="ysldivhomedivimg2" /></div>
</div> </div>
</div> </div>
<div><span className="yslspans22">选择你可能感兴趣的内容</span></div> <div><span className="yslspans22">选择你可能感兴趣的内容</span></div>
<div ><span className="yslspans32">基于你关注的内容推荐</span></div> <div ><span className="yslspans32">基于你关注的内容推荐</span></div>
<div className="ysldivhome22"> <div className="ysldivhome22">
{gouxuans4&&gouxuans4.map((item,key)=>{ {gouxuans4 && gouxuans4.map((item, key) => {
return( return (
<div className={item.id<5?"ysldivhomediv12":"ysldivhomediv22"} onClick={()=>this.Clickteacher2(item.id)}> <div className={item.id < 5 ? "ysldivhomediv12" : "ysldivhomediv22"} onClick={() => this.Clickteacher2(item.id)}>
{item.bool===true?<img src={gouxuan} className="yslgouxuanimg22x"/>:<div className="yslgouxuanimg22x"></div>} {item.bool === true ? <img src={gouxuan} className="yslgouxuanimg22x" /> : <div className="yslgouxuanimg22x"></div>}
<img className="div1img2" src={item.url}/> <img className="div1img2" src={item.url} />
<span className="textall2">{item.name}</span> <span className="textall2">{item.name}</span>
</div> </div>
) )
})} })}
</div> </div>
<Button className="yslbutton2" size={"large"} type="primary"onClick={()=>this.Interestcompletionpage()} style={{width:"255px",height: "35px",background: "#4CACFF",marginTop: "17px"} }>完成</Button> <Button className="yslbutton2" size={"large"} type="primary" onClick={() => this.Interestcompletionpage()} style={{ width: "255px", height: "35px", background: "#4CACFF", marginTop: "17px" }}>完成</Button>
</div> </div>
</div> </div>

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save