dev_aliyun2
harry 5 years ago
parent fc2aff16e4
commit 89c7c078cf

@ -30,15 +30,8 @@
|| navigator.userAgent.indexOf('MSIE 10') != -1)
&&
location.pathname.indexOf("/compatibility") == -1) {
debugger;
// location.href = './compatibility'
location.href = '/compatibility.html'
}
// const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
const isWeiXin = (/MicroMessenger/i.test(navigator.userAgent.toLowerCase()));
if (isWeiXin) {
document.write('<script type="text/javascript" src="/javascripts/wx/jweixin-1.3.0.js"><\/script>');
}
</script>
<link rel="stylesheet" type="text/css" href="/css/css_min_all.css">
@ -65,24 +58,6 @@
<div id="picture_display" style="display: none;"></div>
<script type="text/javascript" src="/js/js_min_all.js"></script>
<script type="text/javascript" src="/js/editormd/marked.min.js"></script>
<script type="text/javascript" src="/js/editormd/prettify.min.js"></script>
<script type="text/javascript" src="/js/editormd/sequence-diagram.min.js"></script>
<script type="text/javascript" src="/js/editormd/flowchart.min.js"></script>
<script type="text/javascript" src="/js/editormd/jquery.flowchart.min.js"></script>
<script type="text/javascript" src="/js/editormd/editormd.min.js"></script>
<script type="text/javascript" src="/js/codemirror/codemirror.js"></script>
<script type="text/javascript" src="/js/codemirror/mode/javascript.js"></script>
<script type="text/javascript" src="/js/diff_match_patch.js"></script>
<script type="text/javascript" src="/js/merge.js"></script>
<script type="text/javascript" src="/js/edu_tpi.js"></script>
<script>
(function () { // Scoping function to avoid globals
var href = location.href;
@ -108,12 +83,8 @@
}
}
})();
</script>
<!-- <script type="text/javascript" src="https://testeduplus2.educoder.net/assets/kindeditor/kindeditor.js"></script>
<script type="text/javascript" src="/js/create_kindeditor.js"></script>
<script type="text/javascript" src="https://testeduplus2.educoder.net/javascripts/educoder/edu_application.js"></script> -->
<script type="text/javascript" src="https://cdn.bootcss.com/quill/1.3.7/quill.core.min.js"></script>
</body>

@ -8,7 +8,7 @@ import {
} from "antd";
import Colleagechart from './colleagechart/Colleagechart'
import Colleagechartzu from './colleagechart/Colleagechartzu'
import { TPMIndexHOC } from "../modules/tpm/TPMIndexHOC";
import TPMIndexHOC from "../modules/tpm/TPMIndexHOC";
import NoneData from './../modules/courses/coursesPublic/NoneData';
import './colleagecss/colleage.css';

@ -1,9 +1,9 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import { TPMIndexHOC } from '../modules/tpm/TPMIndexHOC';
import {Spin,Alert} from 'antd';
import TPMIndexHOC from '../modules/tpm/TPMIndexHOC';
import { Spin, Alert } from 'antd';
class ShowSpin extends Component{
class ShowSpin extends Component {
constructor(props) {
super(props)
}
@ -11,23 +11,23 @@ class ShowSpin extends Component{
render() {
let marigin={
let marigin = {
width: '100%',
minHeight: '500px',
}
return (
<Spin style={marigin}>
<Spin style={marigin}>
<Alert
style={marigin}
type="info"
/>
<Alert
style={marigin}
type="info"
/>
</Spin>
</Spin>
)
}
}
export default SnackbarHOC() ( TPMIndexHOC(ShowSpin) );
export default SnackbarHOC()(TPMIndexHOC(ShowSpin));

@ -7,7 +7,7 @@ export {
export { setmiyah as setmiyah } from './Component';
export { default as queryString } from './UrlTool2';
export { SnackbarHOC as SnackbarHOC } from './SnackbarHOC';
export { default as SnackbarHOC } from './SnackbarHOC';
export {
trigger as trigger, on as on, off as off
@ -42,7 +42,7 @@ export { default as AttachmentList } from './components/attachment/AttachmentLis
export { themes, ThemeContext } from './context/ThemeContext'
export { ModalHOC } from './components/ModalHOC'
export { default as ModalHOC } from './components/ModalHOC'
export { SetAppModel } from './components/SetAppModel'
@ -73,7 +73,7 @@ export { default as ImageLayer2 } from './hooks/ImageLayer2'
// 外部
export { default as CBreadcrumb } from '../modules/courses/common/CBreadcrumb'
export { CNotificationHOC as CNotificationHOC } from '../modules/courses/common/CNotificationHOC'
export { default as CNotificationHOC } from '../modules/courses/common/CNotificationHOC'
export { default as ModalWrapper } from '../modules/courses/common/ModalWrapper'
export { default as NoneData } from '../modules/courses/coursesPublic/NoneData'

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import TPMIndexHOC from '../tpm/TPMIndexHOC';
import { SnackbarHOC, getImageUrl } from 'educoder';

@ -6,32 +6,32 @@ import Loading from '../../Loading';
import Loadable from 'react-loadable';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import TPMIndexHOC from '../tpm/TPMIndexHOC';
import { SnackbarHOC,getImageUrl } from 'educoder';
import { SnackbarHOC, getImageUrl } from 'educoder';
class http500 extends Component {
render() {
return (
<div className="newMain clearfix">
<div className=" edu-txt-center mt60 mb60">
{/*mt100 mb100*/}
<img src={getImageUrl("images/warn/pic_404.jpg")} />
<p className="font-18 mt40">
您可以稍后尝试&nbsp;<a href="/"
className="color-blue">返回首页</a>
或者&nbsp;
<div className=" edu-txt-center mt60 mb60">
{/*mt100 mb100*/}
<img src={getImageUrl("images/warn/pic_404.jpg")} />
<p className="font-18 mt40">
您可以稍后尝试&nbsp;<a href="/"
className="color-blue">返回首页</a>
或者&nbsp;
<a target="_blank"
href="//shang.qq.com/wpa/qunwpa?idkey=2f2043d88c1bd61d182b98bf1e061c6185e23055bec832c07d8148fe11c5a6cd"
className="color-blue">QQ反馈&gt;&gt;</a>
</p>
</div>
{/*<div style="clear:both;"></div>*/}
{/*<div id="ajax-indicator" style="display:none;"><span>载入中...</span></div>*/}
{/*<div id="ajax-modal" style="display:none;"></div>*/}
href="//shang.qq.com/wpa/qunwpa?idkey=2f2043d88c1bd61d182b98bf1e061c6185e23055bec832c07d8148fe11c5a6cd"
className="color-blue">QQ反馈&gt;&gt;</a>
</p>
</div>
{/*<div style="clear:both;"></div>*/}
{/*<div id="ajax-indicator" style="display:none;"><span>载入中...</span></div>*/}
{/*<div id="ajax-modal" style="display:none;"></div>*/}
</div>
);
}
}
export default SnackbarHOC() (TPMIndexHOC ( http500 ));
export default SnackbarHOC()(TPMIndexHOC(http500));

@ -6,32 +6,32 @@ import Loading from '../../Loading';
import Loadable from 'react-loadable';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import TPMIndexHOC from '../tpm/TPMIndexHOC';
import { SnackbarHOC,getImageUrl } from 'educoder';
import { SnackbarHOC, getImageUrl } from 'educoder';
class Shixunnopage extends Component {
render() {
return (
<div className="newMain clearfix">
<div className=" edu-txt-center mt60 mb60">
{/*mt100 mb100*/}
<img src={getImageUrl("images/warn/pic_500.jpg")} />
<p className="font-18 mt40">
您可以稍后尝试&nbsp;<a href="/"
className="color-blue">返回首页</a>
或者&nbsp;
<div className=" edu-txt-center mt60 mb60">
{/*mt100 mb100*/}
<img src={getImageUrl("images/warn/pic_500.jpg")} />
<p className="font-18 mt40">
您可以稍后尝试&nbsp;<a href="/"
className="color-blue">返回首页</a>
或者&nbsp;
<a target="_blank"
href="//shang.qq.com/wpa/qunwpa?idkey=2f2043d88c1bd61d182b98bf1e061c6185e23055bec832c07d8148fe11c5a6cd"
className="color-blue">QQ反馈&gt;&gt;</a>
</p>
</div>
{/*<div style="clear:both;"></div>*/}
{/*<div id="ajax-indicator" style="display:none;"><span>载入中...</span></div>*/}
{/*<div id="ajax-modal" style="display:none;"></div>*/}
href="//shang.qq.com/wpa/qunwpa?idkey=2f2043d88c1bd61d182b98bf1e061c6185e23055bec832c07d8148fe11c5a6cd"
className="color-blue">QQ反馈&gt;&gt;</a>
</p>
</div>
{/*<div style="clear:both;"></div>*/}
{/*<div id="ajax-indicator" style="display:none;"><span>载入中...</span></div>*/}
{/*<div id="ajax-modal" style="display:none;"></div>*/}
</div>
);
}
}
export default SnackbarHOC() (TPMIndexHOC ( Shixunnopage ));
export default SnackbarHOC()(TPMIndexHOC(Shixunnopage));

@ -7,27 +7,27 @@ import ffImg from './imgs/firefox_icon.png'
import bannerImg from './imgs/icon@2x.png'
import { TPMIndexHOC } from '..//tpm/TPMIndexHOC';
import TPMIndexHOC from '..//tpm/TPMIndexHOC';
class CompatibilityPage extends Component {
constructor(props) {
super(props)
constructor(props) {
super(props)
this.state = {
this.state = {
}
}
}
}
onGoldRewardInputChange(event) {
this.setState({ goldRewardInput: event.target.value, goldRewardInputError: false });
}
onGoldRewardInputChange(event) {
this.setState({ goldRewardInput: event.target.value, goldRewardInputError: false });
}
render() {
const { goldRewardDialogOpen } = this.props;
const { goldRewardInputError } = this.state;
render() {
const { goldRewardDialogOpen } = this.props;
const { goldRewardInputError } = this.state;
return (
return (
<React.Fragment>
<style>{`
.Header {
@ -146,7 +146,7 @@ class CompatibilityPage extends Component {
<div className="Compatibility">
<div className="Compatibility-icon">
<img src={ bannerImg }
<img src={bannerImg}
></img>
</div>
<div className="Compatibility-tip">你正在使用的浏览器版本过低将不能正常浏览和使用Educoder</div>
@ -161,7 +161,7 @@ class CompatibilityPage extends Component {
<a href="https://www.google.cn/intl/zh-CN/chrome/" className="CompatibilityBrowsers-item"
target="_blank">
<div className="CompatibilityBrowsers-icon CompatibilityBrowsers-chromeIcon">
<img src={ chromeImg }
<img src={chromeImg}
>
</img>
</div>
@ -172,7 +172,7 @@ class CompatibilityPage extends Component {
<a href="http://www.firefox.com.cn/" className="CompatibilityBrowsers-item"
target="_blank">
<div className="CompatibilityBrowsers-icon CompatibilityBrowsers-ieIcon">
<img src={ ffImg }
<img src={ffImg}
>
</img>
@ -184,7 +184,7 @@ class CompatibilityPage extends Component {
<a href="https://www.microsoft.com/zh-cn/download/internet-explorer.aspx" className="CompatibilityBrowsers-item"
target="_blank">
<div className="CompatibilityBrowsers-icon CompatibilityBrowsers-ieIcon">
<img src={ ieImg }
<img src={ieImg}
>
</img>
@ -195,8 +195,8 @@ class CompatibilityPage extends Component {
</div>
</React.Fragment>
);
}
);
}
}
export default TPMIndexHOC ( CompatibilityPage );
export default TPMIndexHOC(CompatibilityPage);

@ -1,15 +1,5 @@
import React, {Component} from 'react';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
import axios from 'axios';
import moment from 'moment';
import {SnackbarHOC, WordsBtn, getImageUrl} from 'educoder';
import {TPMIndexHOC} from '../tpm/TPMIndexHOC';
import competition from './comcss/competition.css';
import {Button} from 'antd';
import React from 'react';
import { getImageUrl } from 'educoder';
// 团队竞赛报名无报名子组件团队 竞赛报名-已创建战队
class RegisListviewdata extends React.Component {
@ -35,7 +25,7 @@ class RegisListviewdata extends React.Component {
}
render() {
const {item} = this.props;
const { item } = this.props;
return (
<div>
@ -61,23 +51,23 @@ class RegisListviewdata extends React.Component {
textAlign: "center",
}} className="textsize maxnamewidth160">
{
this.props.admin?
this.props.admin===true?
<a className="maxnamewidth160" title={item.name} style={{
this.props.admin ?
this.props.admin === true ?
<a className="maxnamewidth160" title={item.name} style={{
fontSize: "16px",
width: "160px",
textAlign: "center",
cursor:"pointer"
cursor: "pointer"
}}
onClick={()=>this.getotiku(`/competitions/${this.props.match.params.identifier}/competition_teams/${item.id}`)}
onClick={() => this.getotiku(`/competitions/${this.props.match.params.identifier}/competition_teams/${item.id}`)}
>{item.name}</a>
: <p className="maxnamewidth160" style={{
: <p className="maxnamewidth160" style={{
color: "#05101A",
fontSize: "16px",
width: "160px",
textAlign: "center"
}}>{item.name}</p>
: <p className="maxnamewidth160" style={{
: <p className="maxnamewidth160" style={{
color: "#05101A",
fontSize: "16px",
width: "160px",
@ -101,31 +91,31 @@ class RegisListviewdata extends React.Component {
</img>
: index === 1 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 2 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 3 ?
: index === 2 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 4 ?
: index === 3 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 5 ?
<div>
: index === 4 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
<img className="regitemimgs22"
src={getImageUrl(`images/educoder/competitions/pexjiazai.png`)}>
</img>
</div>
: ""
: index === 5 ?
<div>
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
<img className="regitemimgs22"
src={getImageUrl(`images/educoder/competitions/pexjiazai.png`)}>
</img>
</div>
: ""
)
})

@ -1,16 +1,9 @@
import React, {Component} from 'react';
import React from 'react';
import {
BrowserRouter as Router,
Route,
Switch,
Link
} from 'react-router-dom';
import axios from 'axios';
import moment from 'moment';
import {SnackbarHOC, WordsBtn} from 'educoder';
import {TPMIndexHOC} from '../tpm/TPMIndexHOC';
import competition from './comcss/competition.css';
import {Button, Pagination, message, Spin, Breadcrumb} from 'antd';
import { Pagination, Spin, Breadcrumb } from 'antd';
import Registrationitem from './Registrationitem';
import RegisNodata from './RegisNodata';
import CompetitionMaxImg from './CompetitionMaxImg';
@ -84,7 +77,7 @@ class Registration extends React.Component {
// //////console.log(this.props.isAdmin());
// //// //////console.log(this.props.isAdmin())
try {
const {keyword, page, per_page} = this.state;
const { keyword, page, per_page } = this.state;
this.Getdata(keyword, page, per_page, this.props.user.admin);// 获取列表数据
this.GetenrollmentAPI();//获取我的报名配置
this.setState({
@ -106,7 +99,7 @@ class Registration extends React.Component {
////console.log("Registration");
////console.log("componentDidUpdate");
////console.log(this.props.user.admin);
const {keyword, page, per_page} = this.state;
const { keyword, page, per_page } = this.state;
this.Getdata(keyword, page, per_page, this.props.user.admin);
//取报名配置
this.GetenrollmentAPI();
@ -219,7 +212,7 @@ class Registration extends React.Component {
per_page: per_page,
};
let url = `/competitions/${this.props.match.params.identifier}/competition_teams.json`;
axios.get((url), {params: datas}).then((result) => {
axios.get((url), { params: datas }).then((result) => {
if (result) {
if (result.data) {
//// //////console.log(result);\
@ -266,25 +259,25 @@ class Registration extends React.Component {
} else {
//有数据的
if (admin === true) {
this.setState({
type: 5,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
competition_name: result.data.competition_name,
members_count: result.data.members_count
})
this.setState({
type: 5,
data: result.data.my_teams,
count: result.data.count,
competition_teams: result.data.competition_teams,
personal: result.data.personal,
competition_name: result.data.competition_name,
members_count: result.data.members_count
})
} else {
//普通账号true 为创建了竞赛
this.setState({
type: 2,
data: result.data.my_teams,
count: result.data.count,
personal: result.data.personal,
competition_name: result.data.competition_name,
members_count: result.data.members_count
})
//普通账号true 为创建了竞赛
this.setState({
type: 2,
data: result.data.my_teams,
count: result.data.count,
personal: result.data.personal,
competition_name: result.data.competition_name,
members_count: result.data.members_count
})
}
}
@ -526,7 +519,7 @@ class Registration extends React.Component {
pages: pageNumber,
loadingstate: true,
})
const {keyword, per_page} = this.state;
const { keyword, per_page } = this.state;
this.Getdata(keyword, pageNumber, per_page, this.props.user.admin);
};
@ -539,7 +532,7 @@ class Registration extends React.Component {
return
}
let {region_schools} = this.state;
let { region_schools } = this.state;
//判断是否是否是同一个学校数组元素为0就不用判断
try {
if (region_schools.length > 0) {
@ -657,7 +650,7 @@ class Registration extends React.Component {
return
}
let {region_schools} = this.state;
let { region_schools } = this.state;
//判断是否是否是同一个学校数组元素为0就不用判断
try {
if (region_schools.length > 0) {
@ -825,7 +818,7 @@ class Registration extends React.Component {
};
//刷新战队
Refreshteam = () => {
const {keyword, page, per_page} = this.state;
const { keyword, page, per_page } = this.state;
this.Getdata(keyword, page, per_page, this.props.user.admin);
this.GetenrollmentAPI();
}
@ -872,9 +865,9 @@ class Registration extends React.Component {
}
//个人竞赛
// /competitions/:identifier/competition_teams.json
// /competitions/:identifier/competition_teams.json
Personalregistration = () => {
let {teacher_staff, member_staff, data, enroll_ended, enrolled} = this.state;
let { teacher_staff, member_staff, data, enroll_ended, enrolled } = this.state;
if (this.props.checkIfLogin() === false) {
this.props.showLoginDialog();
@ -905,12 +898,12 @@ class Registration extends React.Component {
render() {
const {page, admin, typeysl, mode, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate, pint, competition_name, mutiple_limited, teamutiple_limited, members_count} = this.state;
const { page, admin, typeysl, mode, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate, pint, competition_name, mutiple_limited, teamutiple_limited, members_count } = this.state;
return (
<div className="newMain clearfix newMainybot">
<div className={"educontent mb20 persmstyle"} style={{width: "1200px", marginTop: "26px"}}>
<div className={"educontent mb20 persmstyle"} style={{ width: "1200px", marginTop: "26px" }}>
<style>
{
`
@ -924,19 +917,19 @@ class Registration extends React.Component {
{
messagePerbool === true ?
<MessagePersonModal messagePer={this.state.messagePer} {...this.props} {...this.state}
messagePerboolbuton={() => this.messagePerboolbuton()}
GetenrollmentAPI={GetenrollmentAPI}></MessagePersonModal>
messagePerboolbuton={() => this.messagePerboolbuton()}
GetenrollmentAPI={GetenrollmentAPI}></MessagePersonModal>
: ""
}
{/*编辑创建战队*/}
{
tmodalsType === true ?
<PersonModal modalsType={tmodalsType} {...this.props} {...this.state} Newtit={Newtit}
mutiple_limited={mutiple_limited}
teamutiple_limited={teamutiple_limited}
itemiddata={itemiddata} GetenrollmentAPI={GetenrollmentAPI}
Tmoconfirm1={(bool) => this.Tmoconfirm1(bool)}
GetenrollmentAPIopens={() => this.GetenrollmentAPI()}
mutiple_limited={mutiple_limited}
teamutiple_limited={teamutiple_limited}
itemiddata={itemiddata} GetenrollmentAPI={GetenrollmentAPI}
Tmoconfirm1={(bool) => this.Tmoconfirm1(bool)}
GetenrollmentAPIopens={() => this.GetenrollmentAPI()}
></PersonModal>
:
""
@ -944,19 +937,19 @@ class Registration extends React.Component {
{
tmodalsTypes === true ?
<PersonalModalteam tmodalsTypes={tmodalsTypes} {...this.props} {...this.state}
GetenrollmentAPI={GetenrollmentAPI}
Tmoconfirm={(bool) => this.Tmoconfirm(bool)}></PersonalModalteam>
GetenrollmentAPI={GetenrollmentAPI}
Tmoconfirm={(bool) => this.Tmoconfirm(bool)}></PersonalModalteam>
: ""
}
{
messageexitol === true ?
<ExittheteamModel {...this.props} {...this.state} GetenrollmentAPI={GetenrollmentAPI}
Exittheteam={(bool) => this.Exittheteam(bool)}></ExittheteamModel>
Exittheteam={(bool) => this.Exittheteam(bool)}></ExittheteamModel>
: ""
}
<div style={{marginBottom: '12px'}}>
<div style={{ marginBottom: '12px' }}>
<Breadcrumb separator=">">
<Breadcrumb.Item><Link to={"/competitions"}>在线竞赛</Link></Breadcrumb.Item>
<Breadcrumb.Item><Link
@ -968,10 +961,10 @@ class Registration extends React.Component {
</div>
{/*大图*/}
<CompetitionMaxImg type={type} Jointheteam={() => this.Jointheteam()}
pint={pint}
{...this.props} {...this.state}
Createateam={() => this.Createateam()}
Personalregistration={() => this.Personalregistration()}
pint={pint}
{...this.props} {...this.state}
Createateam={() => this.Createateam()}
Personalregistration={() => this.Personalregistration()}
></CompetitionMaxImg>
{/*大图结尾*/}
{/*没数据*/}
@ -980,11 +973,11 @@ class Registration extends React.Component {
<div style={{
marginTop: "22px"
}}>
<p>参赛总人数<span style={{color: "#459BE5"}}>{members_count}</span><span
style={{marginLeft: "5px"}}></span>
<p>参赛总人数<span style={{ color: "#459BE5" }}>{members_count}</span><span
style={{ marginLeft: "5px" }}></span>
</p>
</div> : "")
: ""}
: ""}
{/*列表*/}
{
type === 6 ?
@ -1019,9 +1012,9 @@ class Registration extends React.Component {
data && data.map((item, index) => {
return (
<PersonalCompetititem key={index} type={type} item={item} index={index} mode={mode}
Exittheteamshow={(itemid) => this.Exittheteamshow(itemid)}
Createateamedit={(itemid) => this.Createateamedit(itemid)}
{...this.props} {...this.state}
Exittheteamshow={(itemid) => this.Exittheteamshow(itemid)}
Createateamedit={(itemid) => this.Createateamedit(itemid)}
{...this.props} {...this.state}
></PersonalCompetititem>
)
})
@ -1033,7 +1026,7 @@ class Registration extends React.Component {
{
type === 4 || type === 5 ?
<RegistrationSearch {...this.props} {...this.state} count={count}
RegistrationSearchvalue={(value) => this.RegistrationSearchvalue(value)}></RegistrationSearch>
RegistrationSearchvalue={(value) => this.RegistrationSearchvalue(value)}></RegistrationSearch>
: ""
}
{/*<Registrationitem></Registrationitem>*/}
@ -1064,13 +1057,13 @@ class Registration extends React.Component {
type === 4 || type === 5 ?
(
count < 20 ? <div style={{
height: "20px",
minHeight: "20px"
}}></div> :
<div className="edu-txt-center ysyslxh mt56 " style={{marginBottom: "192px",}}>
height: "20px",
minHeight: "20px"
}}></div> :
<div className="edu-txt-center ysyslxh mt56 " style={{ marginBottom: "192px", }}>
<Pagination showQuickJumper current={pages}
onChange={this.paginationonChangestwo} pageSize={limit}
total={count}></Pagination>
onChange={this.paginationonChangestwo} pageSize={limit}
total={count}></Pagination>
</div>
)

@ -1,16 +1,5 @@
import React, {Component} from 'react';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
import axios from 'axios';
import moment from 'moment';
import {SnackbarHOC, WordsBtn, getImageUrl} from 'educoder';
import {TPMIndexHOC} from '../tpm/TPMIndexHOC';
import competition from './comcss/competition.css';
import {Button} from 'antd';
import RegisListviewdata from "./RegisListviewdata";
import React from 'react';
import { getImageUrl } from 'educoder';
// 团队竞赛报名无报名子组件团队 竞赛报名-已创建战队
class Registrationitem extends React.Component {
@ -22,57 +11,57 @@ class Registrationitem extends React.Component {
render() {
let {item} = this.props;
let { item } = this.props;
return (
<div className="yslborderbottom">
{
item !== undefined ?
<div className="regitem2">
<div className="perregitemimg1 ">
<img className="personregitemimg" src={getImageUrl("images/" + item.creator.image_url)}>
<div className="regitem2">
<div className="perregitemimg1 ">
<img className="personregitemimg" src={getImageUrl("images/" + item.creator.image_url)}>
</img>
</div>
<div className="" style={{
marginTop: "19px",
marginLeft: "54px",
display: "flex",
flexDirection: "initial",
}}>
<p className="" style={{
color: "#05101A",
fontSize: "16px",
width: "160px",
textAlign: "center"
}}>{item.creator.name}</p>
{
item.manage_permission === true ?
<p className="" style={{
color: "#459BE5",
fontSize: "16px",
textAlign: "center",
marginLeft: "25px",
}}>已报名</p>
:
""
}
</img>
</div>
<div className="" style={{
marginTop: "19px",
marginLeft: "54px",
display: "flex",
flexDirection: "initial",
}}>
<p className="" style={{
color: "#05101A",
fontSize: "16px",
width: "160px",
textAlign: "center"
}}>{item.creator.name}</p>
{
item.manage_permission === true ?
<p className="" style={{
color: "#459BE5",
fontSize: "16px",
textAlign: "center",
marginLeft: "25px",
}}>已报名</p>
:
""
}
</div>
</div>
<div className="" style={{
marginLeft: "632px",
width: "151px",
marginTop: "19px",
marginRight: "35px",
}}>
<p style={{
color: "#999999",
fontSize: "16px",
textAlign: "center",
}}>{item.created_at}</p>
</div>
<div className="" style={{
marginLeft: "632px",
width: "151px",
marginTop: "19px",
marginRight: "35px",
}}>
<p style={{
color: "#999999",
fontSize: "16px",
textAlign: "center",
}}>{item.created_at}</p>
</div>
</div>
</div>
: ""
}
</div>

@ -1,8 +1,7 @@
import React, {Component} from 'react';
import {SnackbarHOC, WordsBtn} from 'educoder';
import {TPMIndexHOC} from '../../tpm/TPMIndexHOC';
import competition from '../comcss/competition.css';
import {Button, Pagination,} from 'antd';
import React, { Component } from 'react';
import { SnackbarHOC, WordsBtn } from 'educoder';
import TPMIndexHOC from '../../tpm/TPMIndexHOC';
import { Pagination, } from 'antd';
import CompetitionMaxImg from '../CompetitionMaxImg';
import Registrationitem from '../Registrationitem';
@ -29,13 +28,13 @@ class PersonalCompetit extends React.Component {
}
render() {
const {test, page, limit, type, pint} = this.state;
const { test, page, limit, type, pint } = this.state;
const listItems = test.map((item, index) =>
<Registrationitem></Registrationitem>
);
return (
<div className="newMain clearfix ">
<div className={"educontent mb20"} style={{width: "1200px", marginTop: "26px"}}>
<div className={"educontent mb20"} style={{ width: "1200px", marginTop: "26px" }}>
<div className="educontent mb20 ">
<p className="clearfix mb20 mt10">
<a className="btn colorgrey fl hovercolorblue ">在线竞赛</a>
@ -58,7 +57,7 @@ class PersonalCompetit extends React.Component {
<div style={{
marginTop: "22px"
}}>
<p>参赛总人数<span style={{color: "#459BE5"}}>132</span><span style={{marginLeft: "5px"}}></span></p>
<p>参赛总人数<span style={{ color: "#459BE5" }}>132</span><span style={{ marginLeft: "5px" }}></span></p>
</div>
: ""}
@ -78,10 +77,10 @@ class PersonalCompetit extends React.Component {
: ""}
{
pint === 1 || pint === 3 ?
<div className="edu-txt-center ysyslxh mt56 " style={{marginBottom: "192px",}}>
<div className="edu-txt-center ysyslxh mt56 " style={{ marginBottom: "192px", }}>
<Pagination showQuickJumper current={page}
onChange={this.paginationonChangestwo} pageSize={limit}
total={30}></Pagination>
onChange={this.paginationonChangestwo} pageSize={limit}
total={30}></Pagination>
</div>
: ""
}

@ -1,15 +1,6 @@
import React, {Component} from 'react';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
import axios from 'axios';
import moment from 'moment';
import {SnackbarHOC, WordsBtn, getImageUrl} from 'educoder';
import {TPMIndexHOC} from '../../tpm/TPMIndexHOC';
import competition from '../comcss/competition.css';
import {Button, message, Tooltip} from 'antd';
import React from 'react';
import { getImageUrl } from 'educoder';
import { message, Tooltip } from 'antd';
// 点击按钮复制功能
function jsCopy(s) {
var e = document.getElementById(s);
@ -51,7 +42,7 @@ class PersonalCompetititem extends React.Component {
}
render() {
const {key, item, type, mode} = this.props;
const { key, item, type, mode } = this.props;
// ////console.log("PersonalCompetititem");
// ////console.log(data);
// ////console.log(data[0]);
@ -69,22 +60,22 @@ class PersonalCompetititem extends React.Component {
<div>
{
item !== undefined || item !== null ? <div className={"yslborderbottom"}>
<div
className={this.props.index === undefined || this.props.index === null ? "myregitem11" : this.props.index === 0 ? "regitem" : "myregitem11"}
style={{
<div
className={this.props.index === undefined || this.props.index === null ? "myregitem11" : this.props.index === 0 ? "regitem" : "myregitem11"}
style={{
marginBottom: "19px",
}}>
<div className="regitemimg1 ">
<img className="regitemimg2" src={getImageUrl("images/" + item.creator.image_url)}>
<div className="regitemimg1 ">
<img className="regitemimg2" src={getImageUrl("images/" + item.creator.image_url)}>
</img>
<a className="maxnamewidth78" title={item.creator.name} style={{
<a className="maxnamewidth78" title={item.creator.name} style={{
color: "#999999",
fontSize: "14px",
width: "78px",
textAlign: "center"
}}>{item.creator.name}</a>
}}>{item.creator.name}</a>
</div>
<div className=" maxnamewidth160" style={{
marginTop: "29px",
@ -100,97 +91,48 @@ class PersonalCompetititem extends React.Component {
textAlign: "center"
}}>{item.name}</a>
</div>
{this.props.type === 5 || this.props.type === 2 ?
(this.props.mode === 3 ?
<div style={{
marginLeft: "37px",
display: "flex",
flexDirection: "initial",
width: "340px"
}}>
{
item && item.team_members.map((item, index) => {
return (
index === 0 ?
<img className="regitemimgs" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 1 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 2 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 3 ?
<div>
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
<img className="regitemimgs222"
src={getImageUrl(`images/educoder/competitions/pexjiazai.png`)}>
</img>
</div>
: ""
)
})
}
{this.props.type === 5 || this.props.type === 2 ?
(this.props.mode === 3 ?
<div style={{
marginLeft: "37px",
display: "flex",
flexDirection: "initial",
width: "340px"
}}>
{
item && item.team_members.map((item, index) => {
return (
</div>
index === 0 ?
<img className="regitemimgs" src={getImageUrl("images/" + item.image_url)}>
:
<div className=" " style={{
marginLeft: "37px",
display: "flex",
flexDirection: "initial",
width: "487px"
}}>
{
item && item.team_members.map((item, index) => {
return (
index === 0 ?
<img className="regitemimgs" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 1 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 1 ?
</img>
: index === 2 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 2 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 3 ?
: index === 3 ?
<div>
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 4 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 5 ?
<div>
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
<img className="regitemimgs222"
src={getImageUrl(`images/educoder/competitions/pexjiazai.png`)}>
<img className="regitemimgs222"
src={getImageUrl(`images/educoder/competitions/pexjiazai.png`)}>
</img>
</div>
: ""
)
})
}
</img>
</div>
: ""
)
})
}
</div>
</div>
)
:
<div className=" " style={{
marginLeft: "37px",
@ -207,6 +149,55 @@ class PersonalCompetititem extends React.Component {
</img>
: index === 1 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 2 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 3 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 4 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 5 ?
<div>
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
<img className="regitemimgs222"
src={getImageUrl(`images/educoder/competitions/pexjiazai.png`)}>
</img>
</div>
: ""
)
})
}
</div>
)
:
<div className=" " style={{
marginLeft: "37px",
display: "flex",
flexDirection: "initial",
width: "487px"
}}>
{
item && item.team_members.map((item, index) => {
return (
index === 0 ?
<img className="regitemimgs" src={getImageUrl("images/" + item.image_url)}>
</img>
: index === 1 ?
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
</img>
@ -229,42 +220,42 @@ class PersonalCompetititem extends React.Component {
</img>
<img className="regitemimgs222"
src={getImageUrl(`images/educoder/competitions/pexjiazai.png`)}>
src={getImageUrl(`images/educoder/competitions/pexjiazai.png`)}>
</img>
</div>
: ""
)
})
}
)
})
}
</div>
}
<div style={this.props.type === 5 || this.props.type === 2 ?
(this.props.mode === 3 ?
</div>
}
<div style={this.props.type === 5 || this.props.type === 2 ?
(this.props.mode === 3 ?
{
marginLeft: "37px",
}
:
{
marginLeft: "18px",
}
)
: {
marginLeft: "16px",
}}>
<div style={{marginTop: "23px", width: '140px'}}>
<span style={{
color: "#05101A",
fontSize: "16px",
}}>邀请码</span>
{
marginLeft: "37px",
}
:
{
marginLeft: "18px",
}
)
: {
marginLeft: "16px",
}}>
<div style={{ marginTop: "23px", width: '140px' }}>
<span style={{
color: "#05101A",
fontSize: "16px",
}}>邀请码</span>
<span
style={{
style={{
color: "#05101A",
fontSize: "16px",
}}>{item.invite_code === null || item.invite_code === undefined ? "" : item.invite_code}</span>
color: "#05101A",
fontSize: "16px",
}}>{item.invite_code === null || item.invite_code === undefined ? "" : item.invite_code}</span>
</div>
<div style={{
overflow: 'hidden',
@ -272,166 +263,166 @@ class PersonalCompetititem extends React.Component {
width: "1px"
}}>
<input id={"copy_invite_code" + this.props.index}
value={item.invite_code === null || item.invite_code === undefined ? "" : item.invite_code}/>
value={item.invite_code === null || item.invite_code === undefined ? "" : item.invite_code} />
</div>
</div>
{item.invite_code === null || item.invite_code === undefined ?
{item.invite_code === null || item.invite_code === undefined ?
<i className="regitemimgs3 iconfont icon-fuzhi1 font-14 font-n"
style={{
marginLeft: "18px",
}}
>
</i>
:
<Tooltip placement="bottom" title={"复制邀请码"}>
<i className="regitemimgs3 iconfont icon-fuzhi1 font-14 font-n"
style={{
marginLeft: "18px",
}}
style={{
marginLeft: "18px",
}}
onClick={() => {
jsCopy("copy_invite_code" + this.props.index)
}}
>
</i>
:
<Tooltip placement="bottom" title={"复制邀请码"}>
<i className="regitemimgs3 iconfont icon-fuzhi1 font-14 font-n"
style={{
marginLeft: "18px",
}}
onClick={() => {
jsCopy("copy_invite_code" + this.props.index)
}}
>
</i>
</Tooltip>
}
</Tooltip>
}
{
this.props.type === 5 ?
(this.props.mode === 3 ?
<div className="regitemimgs444"
style={{
marginLeft: "32px",
}}
>
<div className="regitemimgs555">
<a
href={`/competitions/${this.props.match.params.identifier}/competition_teams/${item.id}`}
style={{
<div className="regitemimgs444"
style={{
marginLeft: "32px",
}}
>
<div className="regitemimgs555">
<a
href={`/competitions/${this.props.match.params.identifier}/competition_teams/${item.id}`}
style={{
color: "#459be5",
width: "100%",
height: "100%",
lineHeight: "39px",
}}>战队详情</a>
</div>
<div className="regitemimgs555"
style={item.manage_permission === true ? {display: "block"} : {display: "none"}}
onClick={() => this.props.Exittheteamshow(item.id, true)}>
<p onClick={() => this.props.Exittheteamshow(item.id, true)}>删除战队</p>
</div>
<div className="regitemimgs6"
style={item.manage_permission === true ? {display: "block"} : {display: "none"}}
onClick={() => this.props.Createateamedit(item)}>
<p onClick={() => this.props.Createateamedit(item)}>编辑战队</p>
</div>
<div className="regitemimgs6"
style={item.manage_permission === true ? {display: "none"} : {display: "block"}}
onClick={() => this.props.Exittheteamshow(item.id, false)}>
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
</div>
</div>
:
<div className="regitemimgs444"
style={{
marginLeft: "32px",
}}
>
<div className="regitemimgs555"
style={item.manage_permission === true ? { display: "block" } : { display: "none" }}
onClick={() => this.props.Exittheteamshow(item.id, true)}>
<p onClick={() => this.props.Exittheteamshow(item.id, true)}>删除战队</p>
</div>
<div className="regitemimgs6"
style={item.manage_permission === true ? { display: "block" } : { display: "none" }}
onClick={() => this.props.Createateamedit(item)}>
<p onClick={() => this.props.Createateamedit(item)}>编辑战队</p>
</div>
<div className="regitemimgs6"
style={item.manage_permission === true ? { display: "none" } : { display: "block" }}
onClick={() => this.props.Exittheteamshow(item.id, false)}>
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
</div>
<div className="regitemimgs5"
style={item.manage_permission === true ? {display: "block"} : {display: "none"}}
onClick={() => this.props.Exittheteamshow(item.id, true)}>
<p onClick={() => this.props.Exittheteamshow(item.id, true)}>删除战队</p>
</div>
<div className="regitemimgs6"
style={item.manage_permission === true ? {display: "block"} : {display: "none"}}
onClick={() => this.props.Createateamedit(item)}>
<p onClick={() => this.props.Createateamedit(item)}>编辑战队</p>
</div>
<div className="regitemimgs6"
style={item.manage_permission === true ? {display: "none"} : {display: "block"}}
onClick={() => this.props.Exittheteamshow(item.id, false)}>
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
</div>
</div>
:
<div className="regitemimgs444"
style={{
marginLeft: "32px",
}}
>
<div className="regitemimgs5"
style={item.manage_permission === true ? { display: "block" } : { display: "none" }}
onClick={() => this.props.Exittheteamshow(item.id, true)}>
<p onClick={() => this.props.Exittheteamshow(item.id, true)}>删除战队</p>
</div>
<div className="regitemimgs6"
style={item.manage_permission === true ? { display: "block" } : { display: "none" }}
onClick={() => this.props.Createateamedit(item)}>
<p onClick={() => this.props.Createateamedit(item)}>编辑战队</p>
</div>
<div className="regitemimgs6"
style={item.manage_permission === true ? { display: "none" } : { display: "block" }}
onClick={() => this.props.Exittheteamshow(item.id, false)}>
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
</div>
</div>
)
: this.props.type === 2 ?
(this.props.mode === 3 ?
(this.props.mode === 3 ?
<div className="regitemimgs444 "
style={{
marginLeft: "32px",
}}
style={{
marginLeft: "32px",
}}
>
<div className="regitemimgs555">
<a
href={`/competitions/${this.props.match.params.identifier}/competition_teams/${item.id}`}
style={{
color: "#459be5",
width: "100%",
height: "100%",
lineHeight: "39px",
}}>战队详情</a>
color: "#459be5",
width: "100%",
height: "100%",
lineHeight: "39px",
}}>战队详情</a>
</div>
<div className="regitemimgs555"
style={item.manage_permission === true ? {display: "block"} : {display: "none"}}
onClick={() => this.props.Exittheteamshow(item.id, true)}>
style={item.manage_permission === true ? { display: "block" } : { display: "none" }}
onClick={() => this.props.Exittheteamshow(item.id, true)}>
<p onClick={() => this.props.Exittheteamshow(item.id, true)}>删除战队</p>
</div>
<div className="regitemimgs6"
style={item.manage_permission === true ? {display: "block"} : {display: "none"}}
onClick={() => this.props.Createateamedit(item)}>
style={item.manage_permission === true ? { display: "block" } : { display: "none" }}
onClick={() => this.props.Createateamedit(item)}>
<p onClick={() => this.props.Createateamedit(item)}>编辑战队</p>
</div>
<div className="regitemimgs6"
style={item.manage_permission === true ? {display: "none"} : {display: "block"}}
onClick={() => this.props.Exittheteamshow(item.id, false)}>
style={item.manage_permission === true ? { display: "none" } : { display: "block" }}
onClick={() => this.props.Exittheteamshow(item.id, false)}>
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
</div>
</div>
:
<div className="regitemimgs444 "
style={{
marginLeft: "32px",
}}
style={{
marginLeft: "32px",
}}
>
<div className="regitemimgs5"
style={item.manage_permission === true ? {display: "block"} : {display: "none"}}
onClick={() => this.props.Exittheteamshow(item.id, true)}>
style={item.manage_permission === true ? { display: "block" } : { display: "none" }}
onClick={() => this.props.Exittheteamshow(item.id, true)}>
<p onClick={() => this.props.Exittheteamshow(item.id, true)}>删除战队</p>
</div>
<div className="regitemimgs6"
style={item.manage_permission === true ? {display: "block"} : {display: "none"}}
onClick={() => this.props.Createateamedit(item)}>
style={item.manage_permission === true ? { display: "block" } : { display: "none" }}
onClick={() => this.props.Createateamedit(item)}>
<p onClick={() => this.props.Createateamedit(item)}>编辑战队</p>
</div>
<div className="regitemimgs6"
style={item.manage_permission === true ? {display: "none"} : {display: "block"}}
onClick={() => this.props.Exittheteamshow(item.id, false)}>
style={item.manage_permission === true ? { display: "none" } : { display: "block" }}
onClick={() => this.props.Exittheteamshow(item.id, false)}>
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
</div>
</div>
)
:
this.props.type === 3 ?
<div className="regitemimgs4"
style={{
marginLeft: "32px",
}}
>
)
:
this.props.type === 3 ?
<div className="regitemimgs4"
style={{
marginLeft: "32px",
}}
>
<div className="regitemimgs6" onClick={() => this.props.Exittheteamshow(item.id, false)}>
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
</div>
<div className="regitemimgs6" onClick={() => this.props.Exittheteamshow(item.id, false)}>
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
</div>
</div>
:
""
</div>
:
""
}
</div>
</div>
</div>
: ""
}
</div>

@ -1,14 +1,12 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { Route, Link, Switch } from "react-router-dom";
import { Route, Switch } from "react-router-dom";
import Loading from '../../Loading';
import Loadable from 'react-loadable';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../courses/common/CNotificationHOC';
import TPMIndexHOC from '../tpm/TPMIndexHOC';
import CNotificationHOC from '../courses/common/CNotificationHOC';
//新版竞赛首页
const CompetitionsIndex = Loadable({
@ -17,7 +15,7 @@ const CompetitionsIndex = Loadable({
})
//竞赛详情页
const CompetitionCommon=Loadable({
const CompetitionCommon = Loadable({
loader: () => import('./Competitioncommon/CompetitionCommon'),
loading: Loading,
})
@ -40,7 +38,7 @@ class Competitions extends Component {
super(props)
}
componentDidMount(){
componentDidMount() {
window.document.title = '竞赛';
}
@ -54,9 +52,9 @@ class Competitions extends Component {
{/*新版竞赛战队详情*/}
<Route path="/competitions/:identifier/competition_teams/:competition_team_id"
render={
(props) => (<CompetitionTeams {...this.props} {...props} {...this.state} />)
}
render={
(props) => (<CompetitionTeams {...this.props} {...props} {...this.state} />)
}
></Route>
@ -64,22 +62,22 @@ class Competitions extends Component {
<Route
path="/competitions/:identifier/enroll"
render={
(props) => (<Registration {...this.props} {...props} {...this.state}/>)
(props) => (<Registration {...this.props} {...props} {...this.state} />)
}
/>
{/*新版竞赛详情页面*/}
<Route path="/competitions/:identifier"
render={
(props) => (<CompetitionCommon {...this.props} {...props} {...this.state} />)
}
render={
(props) => (<CompetitionCommon {...this.props} {...props} {...this.state} />)
}
></Route>
{/*新版竞赛首页*/}
<Route path="/competitions"
render={
(props) => (<CompetitionsIndex {...this.props} {...props} {...this.state} />)
}
render={
(props) => (<CompetitionsIndex {...this.props} {...props} {...this.state} />)
}
></Route>
</Switch>
@ -89,4 +87,4 @@ class Competitions extends Component {
}
}
export default CNotificationHOC() (TPMIndexHOC (Competitions)) ;
export default CNotificationHOC()(TPMIndexHOC(Competitions));

@ -1,56 +1,54 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import { Route, Switch } from 'react-router-dom';
import Loadable from 'react-loadable';
import Loading from '../../Loading';
import axios from 'axios';
// import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import { CNotificationHOC } from './common/CNotificationHOC'
import CNotificationHOC from './common/CNotificationHOC'
import "./css/Courses.css"
//引入对应跳转的组件
const ListPageIndex = Loadable({
loader: () => import('./ListPageIndex'),
loading:Loading,
loader: () => import('./ListPageIndex'),
loading: Loading,
})
// 讨论
const BoardsNew= Loadable({
const BoardsNew = Loadable({
loader: () => import('./boards/BoardsNew'),
loading: Loading,
})
const TopicDetail= Loadable({
const TopicDetail = Loadable({
loader: () => import('./boards/TopicDetail'),
loading: Loading,
})
// 讨论
const Boards= Loadable({
const Boards = Loadable({
loader: () => import('./boards'),
loading: Loading,
})
class CoursesIndex extends Component{
class CoursesIndex extends Component {
constructor(props) {
super(props)
this.state={
this.state = {
// coursedata:undefined
}
}
componentDidMount(){
componentDidMount() {
}
render() {
const common = {
render() {
const common = {
}
}
return (
<Switch {...this.props}>
return (
<Switch {...this.props}>
{/*课堂讨论*/}
{/* /board/5464/messages/new */}
{/* <Route exact path="/courses/:coursesId/board/:boardId/messages/:topicId/edit"
{/*课堂讨论*/}
{/* /board/5464/messages/new */}
{/* <Route exact path="/courses/:coursesId/board/:boardId/messages/:topicId/edit"
render={
(props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />)
}
@ -65,36 +63,36 @@ class CoursesIndex extends Component{
{/*课堂讨论*/}
<Route exact path="/courses/:coursesId/boards/:boardId/messages/:topicId/edit"
render={
(props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route exact path="/courses/:coursesId/boards/:boardId/messages/new"
render={
(props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route exact path="/courses/:coursesId/boards/:boardId/messages/:topicId"
render={
(props) => (<TopicDetail {...this.props} {...this.state} {...props} {...common} />)
}
></Route>
<Route exact path="/courses/:coursesId/boards/:boardId/messages/:topicId"
render={
(props) => (<TopicDetail {...this.props} {...this.state} {...props} {...common} />)
}
></Route>
<Route exact path="/courses/:coursesId/boards/:boardId"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/*课堂讨论*/}
<Route exact path="/courses/:coursesId/boards/:boardId/messages/:topicId/edit"
render={
(props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route exact path="/courses/:coursesId/boards/:boardId/messages/new"
render={
(props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route exact path="/courses/:coursesId/boards/:boardId/messages/:topicId"
render={
(props) => (<TopicDetail {...this.props} {...this.state} {...props} {...common} />)
}
></Route>
<Route exact path="/courses/:coursesId/boards/:boardId/messages/:topicId"
render={
(props) => (<TopicDetail {...this.props} {...this.state} {...props} {...common} />)
}
></Route>
<Route exact path="/courses/:coursesId/boards/:boardId"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
</Switch>
)
}
</Switch>
)
}
}
export default CNotificationHOC() ( SnackbarHOC() ( (CoursesIndex) ));
export default CNotificationHOC()(SnackbarHOC()((CoursesIndex)));

File diff suppressed because it is too large Load Diff

@ -3,7 +3,7 @@ import React, { Component } from 'react';
import axios from 'axios'
import moment from 'moment'
import Comments from '../../comment/Comments'
import {ImageLayerOfCommentHOC} from '../../page/layers/ImageLayerOfCommentHOC'
import ImageLayerOfCommentHOC from '../../page/layers/ImageLayerOfCommentHOC'
import MemoDetailMDEditor from '../../forums/MemoDetailMDEditor'
import { RouteHOC } from './common.js'
import '../../forums/Post.css'
@ -11,7 +11,7 @@ import '../../forums/RightSection.css'
import './TopicDetail.css'
import '../common/courseMessage.css'
import { MarkdownToHtml, setImagesUrl } from 'educoder'
import { Pagination, Tooltip,Button } from 'antd'
import { Pagination, Tooltip, Button } from 'antd'
import SendToCourseModal from '../coursesPublic/modal/SendToCourseModal'
import CBreadcrumb from '../common/CBreadcrumb'
import {
@ -40,19 +40,19 @@ class TopicDetail extends Component {
constructor(props) {
super(props)
this.state = {
memo: {},
memoLoading: true,
hasMoreComments: false,
pageCount: 1,
comments: [],
goldRewardDialogOpen: false,
author:undefined,
commentstype:false
}
this.state = {
memo: {},
memoLoading: true,
hasMoreComments: false,
pageCount: 1,
comments: [],
goldRewardDialogOpen: false,
author: undefined,
commentstype: false
}
componentDidMount() {
window.$("html,body").animate({"scrollTop":0})
}
componentDidMount() {
window.$("html,body").animate({ "scrollTop": 0 })
const topicId = this.props.match.params.topicId
const bid = this.props.match.params.boardId
@ -504,19 +504,19 @@ class TopicDetail extends Component {
}
}
startcomments=()=>{
setTime = setInterval( ()=> {
this.fetchReplies()
}, 5000);
this.setState({
commentstype:true
})
}
startcomments = () => {
setTime = setInterval(() => {
this.fetchReplies()
}, 5000);
this.setState({
commentstype: true
})
}
clearcomments=()=>{
clearcomments = () => {
clearInterval(setTime);
this.setState({
commentstype:false
commentstype: false
})
}
@ -695,18 +695,18 @@ class TopicDetail extends Component {
{/* onClick={ this.createNewComment }
enableReplyTo={true}
*/}
<div className="padding20 memoReplies commentsDelegateParent comments_hideSecondReplyUserHeader"
style={{ display: (comments && !!comments.length) ? 'block' : 'none', paddingBottom: '0px' }}>
<div className="replies_count commentstypetop">
{this.props.isAdmin()===true? <span className="commentstypebutton font-16 ">
{this.state.commentstype===false?<Button type="primary" onClick={()=>this.startcomments()}>开启刷新评论</Button>
:<Button type="danger" onClick={()=>this.clearcomments()}>停止刷新</Button>}
</span>:""}
<span className="labal font-16">全部回复</span>
<span className="count font-16">({memo.total_replies_count})</span>
</div>
<div className="padding20 memoReplies commentsDelegateParent comments_hideSecondReplyUserHeader"
style={{ display: (comments && !!comments.length) ? 'block' : 'none', paddingBottom: '0px' }}>
<div className="replies_count commentstypetop">
{this.props.isAdmin() === true ? <span className="commentstypebutton font-16 ">
{this.state.commentstype === false ? <Button type="primary" onClick={() => this.startcomments()}>开启刷新评论</Button>
: <Button type="danger" onClick={() => this.clearcomments()}>停止刷新</Button>}
</span> : ""}
<span className="labal font-16">全部回复</span>
<span className="count font-16">({memo.total_replies_count})</span>
</div>
<Comments comments={comments} user={current_user}
replyComment={this.replyComment}

@ -1,142 +1,142 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import { CNotificationHOC } from '../common/CNotificationHOC'
import CNotificationHOC from '../common/CNotificationHOC'
import { RouteHOC } from './common'
import "../css/busyWork.css"
//引入对应跳转的组件
const ListPageIndex = Loadable({
loader: () => import('../ListPageIndex'),
loading:Loading,
loader: () => import('../ListPageIndex'),
loading: Loading,
})
//新建分组/普通作业
const NewWork = Loadable({
loader: () => import('./NewWork'),
loading:Loading,
loader: () => import('./NewWork'),
loading: Loading,
})
const CommonWorkDetailIndex = Loadable({
loader: () => import('./CommonWorkDetailIndex'),
loading:Loading,
loading: Loading,
})
const CommonWorkSetting = Loadable({
loader: () => import('./CommonWorkSetting'),
loading:Loading,
loading: Loading,
})
const CommonWorkList = Loadable({
loader: () => import('./CommonWorkList'),
loading:Loading,
loading: Loading,
})
const CommonWorkQuestion = Loadable({
loader: () => import('./CommonWorkQuestion'),
loading:Loading,
loading: Loading,
})
const CommonWorkAnswer = Loadable({
loader: () => import('./CommonWorkAnswer'),
loading:Loading,
loading: Loading,
})
const CommonWorkAppraise = Loadable({
loader: () => import('./CommonWorkAppraise'),
loading:Loading,
loading: Loading,
})
const CommonWorkPost = Loadable({
loader: () => import('./CommonWorkPost'),
loading:Loading,
loading: Loading,
})
const CommonWork = Loadable({
loader: () => import('./commonWork'),
loading:Loading,
loading: Loading,
})
class CoursesWorkIndex extends Component{
class CoursesWorkIndex extends Component {
constructor(props) {
super(props)
}
render() {
return (
<div>
<Switch {...this.props}>
{/* --------------------------------------------------------------------- */}
{/* 作业设置 */}
{/* http://localhost:3007/courses/1309/homework/9300/setting */}
<Route exact path="/courses/:coursesId/common_homeworks/:workId/setting"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作品列表 */}
<Route exact path="/courses/:coursesId/common_homeworks/:workId/list"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作业问答 */}
<Route exact path="/courses/:coursesId/common_homeworks/:workId/question"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/courses/:coursesId/common_homeworks/:workId/answer"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 评阅 */}
<Route exact path="/courses/:coursesId/common_homeworks/:workId/:studentWorkId/appraise"
render={
(props) => (<CommonWorkAppraise {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 提交作品 */}
<Route exact path="/courses/:coursesId/common_homeworks/:workId/post"
render={
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/courses/:coursesId/common_homeworks/:workId/:studentWorkId/post_edit"
render={
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 新建 */}
{/* http://localhost:3007/courses/1309/common_homeworks/9299/edit/1 */}
<Route exact path="/courses/:coursesId/common_homeworks/:workId/:pageType"
render={
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/courses/:coursesId/common_homeworks/:categroy_id/new"
render={
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作业列表 */}
<Route path="/courses/:coursesId/common_homeworks"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* --------------------------------------------------------------------- */}
</Switch>
<Switch {...this.props}>
{/* --------------------------------------------------------------------- */}
{/* 作业设置 */}
{/* http://localhost:3007/courses/1309/homework/9300/setting */}
<Route exact path="/courses/:coursesId/common_homeworks/:workId/setting"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作品列表 */}
<Route exact path="/courses/:coursesId/common_homeworks/:workId/list"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作业问答 */}
<Route exact path="/courses/:coursesId/common_homeworks/:workId/question"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/courses/:coursesId/common_homeworks/:workId/answer"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 评阅 */}
<Route exact path="/courses/:coursesId/common_homeworks/:workId/:studentWorkId/appraise"
render={
(props) => (<CommonWorkAppraise {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 提交作品 */}
<Route exact path="/courses/:coursesId/common_homeworks/:workId/post"
render={
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/courses/:coursesId/common_homeworks/:workId/:studentWorkId/post_edit"
render={
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 新建 */}
{/* http://localhost:3007/courses/1309/common_homeworks/9299/edit/1 */}
<Route exact path="/courses/:coursesId/common_homeworks/:workId/:pageType"
render={
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/courses/:coursesId/common_homeworks/:categroy_id/new"
render={
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作业列表 */}
<Route path="/courses/:coursesId/common_homeworks"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* --------------------------------------------------------------------- */}
</Switch>
</div>
)
}
}
export default RouteHOC() (CNotificationHOC() (SnackbarHOC() ( CoursesWorkIndex) ));
export default RouteHOC()(CNotificationHOC()(SnackbarHOC()(CoursesWorkIndex)));

@ -1,140 +1,140 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import { CNotificationHOC } from '../common/CNotificationHOC'
import CNotificationHOC from '../common/CNotificationHOC'
import { RouteHOC } from './common'
import "../css/busyWork.css"
//引入对应跳转的组件
const ListPageIndex = Loadable({
loader: () => import('../ListPageIndex'),
loading:Loading,
loader: () => import('../ListPageIndex'),
loading: Loading,
})
//新建分组/普通作业
const NewWork = Loadable({
loader: () => import('./NewWork'),
loading:Loading,
loader: () => import('./NewWork'),
loading: Loading,
})
const CommonWorkPost = Loadable({
loader: () => import('./CommonWorkPost'),
loading:Loading,
loading: Loading,
})
const CommonWorkSetting = Loadable({
loader: () => import('./CommonWorkSetting'),
loading:Loading,
loading: Loading,
})
const CommonWorkList = Loadable({
loader: () => import('./CommonWorkList'),
loading:Loading,
loading: Loading,
})
const CommonWorkQuestion = Loadable({
loader: () => import('./CommonWorkQuestion'),
loading:Loading,
loading: Loading,
})
const CommonWorkAnswer = Loadable({
loader: () => import('./CommonWorkAnswer'),
loading:Loading,
loading: Loading,
})
const CommonWorkAppraise = Loadable({
loader: () => import('./CommonWorkAppraise'),
loading:Loading,
loading: Loading,
})
const CommonWork = Loadable({
loader: () => import('./commonWork'),
loading:Loading,
loading: Loading,
})
const CommonWorkDetailIndex = Loadable({
loader: () => import('./CommonWorkDetailIndex'),
loading:Loading,
loading: Loading,
})
class CoursesWorkIndex extends Component{
class CoursesWorkIndex extends Component {
constructor(props) {
super(props)
}
render() {
return (
<div>
<Switch {...this.props}>
{/* --------------------------------------------------------------------- */}
{/* --------------------------------------------------------------------- */}
{/* 作业设置 */}
<Route exact path="/courses/:coursesId/group_homeworks/:workId/setting"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作品列表 */}
<Route exact path="/courses/:coursesId/group_homeworks/:workId/list"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作业问答 */}
<Route exact path="/courses/:coursesId/group_homeworks/:workId/question"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 参考答案 */}
<Route exact path="/courses/:coursesId/group_homeworks/:workId/answer"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 评阅 */}
<Route exact path="/courses/:coursesId/group_homeworks/:workId/:studentWorkId/appraise"
render={
(props) => (<CommonWorkAppraise {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/courses/:coursesId/group_homeworks/:workId/post"
render={
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/courses/:coursesId/group_homeworks/:workId/:studentWorkId/post_edit"
render={
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 新建 */}
{/* http://localhost:3007/courses/1309/group_homeworks/9299/edit/1 */}
<Route exact path="/courses/:coursesId/group_homeworks/:workId/:pageType"
render={
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/courses/:coursesId/group_homeworks/:categroy_id/new"
render={
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作业列表 */}
<Route path="/courses/:coursesId/group_homeworks"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
</Switch>
<Switch {...this.props}>
{/* --------------------------------------------------------------------- */}
{/* --------------------------------------------------------------------- */}
{/* 作业设置 */}
<Route exact path="/courses/:coursesId/group_homeworks/:workId/setting"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作品列表 */}
<Route exact path="/courses/:coursesId/group_homeworks/:workId/list"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作业问答 */}
<Route exact path="/courses/:coursesId/group_homeworks/:workId/question"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 参考答案 */}
<Route exact path="/courses/:coursesId/group_homeworks/:workId/answer"
render={
(props) => (<CommonWorkDetailIndex {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 评阅 */}
<Route exact path="/courses/:coursesId/group_homeworks/:workId/:studentWorkId/appraise"
render={
(props) => (<CommonWorkAppraise {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/courses/:coursesId/group_homeworks/:workId/post"
render={
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/courses/:coursesId/group_homeworks/:workId/:studentWorkId/post_edit"
render={
(props) => (<CommonWorkPost {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 新建 */}
{/* http://localhost:3007/courses/1309/group_homeworks/9299/edit/1 */}
<Route exact path="/courses/:coursesId/group_homeworks/:workId/:pageType"
render={
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/courses/:coursesId/group_homeworks/:categroy_id/new"
render={
(props) => (<NewWork {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 作业列表 */}
<Route path="/courses/:coursesId/group_homeworks"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
</Switch>
</div>
)
}
}
export default RouteHOC() (CNotificationHOC() (SnackbarHOC() ( CoursesWorkIndex) ));
export default RouteHOC()(CNotificationHOC()(SnackbarHOC()(CoursesWorkIndex)));

@ -3,7 +3,7 @@ import axios from 'axios';
import moment from 'moment';
import _ from 'lodash';
import { ImageLayerOfCommentHOC } from '../../../page/layers/ImageLayerOfCommentHOC';
import ImageLayerOfCommentHOC from '../../../page/layers/ImageLayerOfCommentHOC';
import GraduationTasksappraiseMainEditor from '../../graduation/tasks/GraduationTasksappraiseMainEditor';
import CCommentItem from '../../common/comments/CCommentItem';
import '../../../forums/Post.css';

@ -1,37 +1,36 @@
import React,{ Component } from "react";
import React, { Component } from "react";
import { Pagination } from "antd";
import update from 'immutability-helper'
import axios from 'axios'
import MemoDetailMDEditor from '../../../forums/MemoDetailMDEditor'
import '../../../forums/Post.css'
import '../../../forums/RightSection.css'
import {ImageLayerOfCommentHOC} from '../../../page/layers/ImageLayerOfCommentHOC'
import ImageLayerOfCommentHOC from '../../../page/layers/ImageLayerOfCommentHOC'
import Comments from '../../../comment/Comments'
// import './GraduateTopicReply.css'
import '../../common/courseMessage.css'
import { generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment
import {
generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment
, addSecondLevelComment, NEED_TO_WRITE_CONTENT, handleContentBeforeCreateSecondLevelComment
, handleDeleteComment, handleCommentPraise, handleHiddenComment } from '../../common/CommentsHelper'
, handleDeleteComment, handleCommentPraise, handleHiddenComment
} from '../../common/CommentsHelper'
const REPLY_PAGE_COUNT = 10
const $ = window.$;
/*
相比较GraduateTopicReply 改动的地方
列表接口名 /graduation_tasks/${graduation_topic_id}/show_comment.json?parent_id=${parent.id}&limit=500
回复类型名 jour_type: this.props.jour_type,
*/
class CommonReply extends Component{
constructor(props){
class CommonReply extends Component {
constructor(props) {
super(props);
this.state={
this.state = {
pageCount: 1
}
}
componentDidMount(){
componentDidMount() {
this.fetchReplies()
@ -51,14 +50,14 @@ class CommonReply extends Component{
let { comments } = this.state;
axios.post(url, {
journals_for_message: {
jour_type: this.props.jour_type,
jour_id: graduation_topic_id,
notes: content,
// m_parent_id
reply_id: memo.user_id || this.state.homework_user_id
}
journals_for_message: {
jour_type: this.props.jour_type,
jour_id: graduation_topic_id,
notes: content,
// m_parent_id
reply_id: memo.user_id || this.state.homework_user_id
}
}
).then((response) => {
if (response.data.status === -1) {
console.error('服务端异常')
@ -93,7 +92,7 @@ class CommonReply extends Component{
// return;
// }
if (this.props.memo.id === id ) { // 回复帖子
if (this.props.memo.id === id) { // 回复帖子
this.createNewComment(commentContent, id, editor);
return;
}
@ -107,56 +106,56 @@ class CommonReply extends Component{
commentContent = handleContentBeforeCreateSecondLevelComment(commentContent)
axios.post(url, {
journals_for_message: {
// 'GraduationTask'
jour_type: this.props.jour_type,
jour_id: graduation_topic_id,
notes: commentContent,
m_parent_id: id,
reply_id: comment.user_id
}
},
{
}
).then((response) => {
if (response.data.id) {
let newId = response.data.id;
journals_for_message: {
// 'GraduationTask'
jour_type: this.props.jour_type,
jour_id: graduation_topic_id,
notes: commentContent,
m_parent_id: id,
reply_id: comment.user_id
}
},
{
}
).then((response) => {
if (response.data.id) {
let newId = response.data.id;
const newMemo2 = Object.assign({}, this.props.memo);
newMemo2.total_count = newMemo2.total_count + 1;
const newMemo2 = Object.assign({}, this.props.memo);
newMemo2.total_count = newMemo2.total_count + 1;
this.setState({
comments: addSecondLevelComment(comments, comment, commentIndex, newId, commentContent, user, editor),
memo: newMemo2,
total_count: this.state.total_count + 1
this.setState({
comments: addSecondLevelComment(comments, comment, commentIndex, newId, commentContent, user, editor),
memo: newMemo2,
total_count: this.state.total_count + 1
})
}
})
}
}).catch((error) => {
console.log(error)
})
}).catch((error) => {
console.log(error)
})
}
loadMoreChildComments = (parent) => {
const graduation_topic_id = this.props.memo.id
const course_id = this.props.course_id
const url = `/${this.props.apiRouteName}/${graduation_topic_id}/show_comment.json?parent_id=${parent.id}&limit=500`
axios.get(url,{
axios.get(url, {
})
.then((response) => {
const { comments } = response.data
.then((response) => {
const { comments } = response.data
// const memo = Object.assign({}, this.state.memo)
// memo.sum_replies_count = sum_replies_count;
this.setState({
// memo,
comments: generateChildComments(comments, this.state.comments, parent, this.transformReply)
// const memo = Object.assign({}, this.state.memo)
// memo.sum_replies_count = sum_replies_count;
this.setState({
// memo,
comments: generateChildComments(comments, this.state.comments, parent, this.transformReply)
})
}).catch((error) => {
console.log(error)
})
}).catch((error) => {
console.log(error)
})
}
onPaginationChange = (pageCount) => {
@ -170,20 +169,20 @@ class CommonReply extends Component{
const course_id = this.props.course_id
const url = `/${this.props.apiRouteName}/${graduation_topic_id}/show_comment.json?page=${this.state.pageCount}`
// page limit parent_id
axios.get(url,{
axios.get(url, {
})
.then((response) => {
const { comments, messages_count, homework_user_id, parent_messages_count } = response.data
this.setState({
comments: generateComments(comments, this.transformReply),
// : this.state.comments.concat(comments),
total_count: parent_messages_count,
homework_user_id
.then((response) => {
const { comments, messages_count, homework_user_id, parent_messages_count } = response.data
this.setState({
comments: generateComments(comments, this.transformReply),
// : this.state.comments.concat(comments),
total_count: parent_messages_count,
homework_user_id
})
}).catch((error) => {
console.log(error)
})
}).catch((error) => {
console.log(error)
})
}
transformReply = (reply, children = []) => {
@ -231,12 +230,12 @@ class CommonReply extends Component{
}
}
render(){
render() {
let { total_count, comments, pageCount } = this.state
const { current_user, memo } = this.props
return(
<div style={{background: 'rgb(255, 255, 255)', marginTop: '20px'}} className="course-message">
return (
<div style={{ background: 'rgb(255, 255, 255)', marginTop: '20px' }} className="course-message">
<style>{`
.course-message .commentInput {
padding-bottom: 56px !important;
@ -250,14 +249,14 @@ class CommonReply extends Component{
}
`}</style>
<MemoDetailMDEditor ref="editor" memo={memo} usingMockInput={true} placeholder="说点什么"
height={160} showError={true} imageExpand={true}
replyComment={this.replyComment}
{...this.props}
commentsLength={comments ? comments.length : 0}
height={160} showError={true} imageExpand={true}
replyComment={this.replyComment}
{...this.props}
commentsLength={comments ? comments.length : 0}
></MemoDetailMDEditor>
{/* bor-bottom-greyE */}
<div className="padding40 memoReplies commentsDelegateParent"
style={{ display: (comments && !!comments.length) ? 'block' : 'none' }}>
style={{ display: (comments && !!comments.length) ? 'block' : 'none' }}>
<div className="replies_count">
<span className="labal">全部回复</span>
<span className="count">{total_count}</span>
@ -279,19 +278,19 @@ class CommonReply extends Component{
></Comments>
{/* { true ? :
{/* { true ? :
<div className="memoMore">
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
</div>} */}
</div>
{ total_count > REPLY_PAGE_COUNT &&
<div className="memoMore">
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10}/>
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
</div> }
{total_count > REPLY_PAGE_COUNT &&
<div className="memoMore">
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10} />
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
</div>}
</div>
)
}
}
export default ImageLayerOfCommentHOC() (CommonReply);
export default ImageLayerOfCommentHOC()(CommonReply);

@ -1,14 +1,12 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { Route, Link, Switch } from "react-router-dom";
import { Route, Switch } from "react-router-dom";
import Loading from '../../Loading';
import Loadable from 'react-loadable';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../courses/common/CNotificationHOC';
import TPMIndexHOC from '../tpm/TPMIndexHOC';
import CNotificationHOC from '../courses/common/CNotificationHOC';
//新版竞赛首页
const CompetitionsIndex = Loadable({
@ -17,7 +15,7 @@ const CompetitionsIndex = Loadable({
})
//竞赛详情页
const CompetitionCommon=Loadable({
const CompetitionCommon = Loadable({
loader: () => import('./Competitioncommon/CompetitionCommon'),
loading: Loading,
})
@ -40,7 +38,7 @@ class Competitions extends Component {
super(props)
}
componentDidMount(){
componentDidMount() {
window.document.title = '竞赛';
}
@ -54,9 +52,9 @@ class Competitions extends Component {
{/*新版竞赛战队详情*/}
<Route path="/competitions/:identifier/competition_teams/:competition_team_id"
render={
(props) => (<CompetitionTeams {...this.props} {...props} {...this.state} />)
}
render={
(props) => (<CompetitionTeams {...this.props} {...props} {...this.state} />)
}
></Route>
@ -64,22 +62,22 @@ class Competitions extends Component {
<Route
path="/competitions/:identifier/enroll"
render={
(props) => (<Registration {...this.props} {...props} {...this.state}/>)
(props) => (<Registration {...this.props} {...props} {...this.state} />)
}
/>
{/*新版竞赛详情页面*/}
<Route path="/competitions/:identifier"
render={
(props) => (<CompetitionCommon {...this.props} {...props} {...this.state} />)
}
render={
(props) => (<CompetitionCommon {...this.props} {...props} {...this.state} />)
}
></Route>
{/*新版竞赛首页*/}
<Route path="/competitions"
render={
(props) => (<CompetitionsIndex {...this.props} {...props} {...this.state} />)
}
render={
(props) => (<CompetitionsIndex {...this.props} {...props} {...this.state} />)
}
></Route>
</Switch>
@ -89,4 +87,4 @@ class Competitions extends Component {
}
}
export default CNotificationHOC() (TPMIndexHOC (Competitions)) ;
export default CNotificationHOC()(TPMIndexHOC(Competitions));

@ -1,48 +1,43 @@
import React,{ Component } from "react";
import { Pagination } from "antd";
import React, { Component } from "react";
import axios from 'axios'
import moment from 'moment'
import { getImageUrl,WordsBtn } from 'educoder';
import {ImageLayerOfCommentHOC} from '../../../page/layers/ImageLayerOfCommentHOC';
import ImageLayerOfCommentHOC from '../../../page/layers/ImageLayerOfCommentHOC';
import GraduationTasksappraiseReplyChild from './GraduationTasksappraiseReplyChild';
import '../../../forums/Post.css'
import '../../../comment/Comment.css'
import '../../common/courseMessage.css'
import './GraduationTasksappraiseReply.css'
const REPLY_PAGE_COUNT = 10
const $ = window.$;
/*
*/
class GraduationTasksappraiseReply extends Component{
constructor(props){
class GraduationTasksappraiseReply extends Component {
constructor(props) {
super(props);
this.state={
this.state = {
total_count: 0,
comment_scores: []
}
}
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`
axios.get(url).then((result)=>{
if(result.data.comment_scores){
axios.get(url).then((result) => {
if (result.data.comment_scores) {
const comment_scores = result.data.comment_scores.map(item => {
return this.transformReply(item)
return this.transformReply(item)
})
this.setState({
...result.data,
comment_scores
})
}
}).catch((error)=>{
}).catch((error) => {
console.log(error)
})
}
componentDidMount(){
componentDidMount() {
this.fetchAllComments()
}
addSuccess = () => {
@ -77,14 +72,14 @@ class GraduationTasksappraiseReply extends Component{
okText: '确定',
cancelText: '取消',
onOk: () => {
let category_id= this.props.match.params.category_id;
let category_id = this.props.match.params.category_id;
const url = `/graduation_works/${category_id}/delete_score.json?comment_id=${item.id}`
axios.delete(url).then((result)=>{
if(result.data.status == 0){
axios.delete(url).then((result) => {
if (result.data.status == 0) {
this.props.showNotification('删除成功')
this.fetchAllComments()
}
}).catch((error)=>{
}).catch((error) => {
console.log(error)
})
},
@ -95,102 +90,102 @@ class GraduationTasksappraiseReply extends Component{
}
showModulationtype=(id)=>{
showModulationtype = (id) => {
// console.log(id)
this.setState({
Modulationtype:true,
operationId:id
Modulationtype: true,
operationId: id
})
}
cancelmodel=()=>{
cancelmodel = () => {
this.setState({
Modalstype:false,
Loadtype:false,
visible:false,
Modulationtype:false,
Allocationtype:false,
Modalstopval:"",
ModalCancel:"",
ModalSave:"",
Modalstype: false,
Loadtype: false,
visible: false,
Modulationtype: false,
Allocationtype: false,
Modalstopval: "",
ModalCancel: "",
ModalSave: "",
})
}
saveModulationModal=(value,num)=>{
console.log(value,num)
let {operationId}=this.state;
let category_id= this.props.match.params.category_id;
saveModulationModal = (value, num) => {
console.log(value, num)
let { operationId } = this.state;
let category_id = this.props.match.params.category_id;
// console.log(value,num)
let url ="/graduation_works/"+category_id+"/adjust_score.json";
axios.post(url,{
score:num,
comment:value
}).then((result)=>{
let url = "/graduation_works/" + category_id + "/adjust_score.json";
axios.post(url, {
score: num,
comment: value
}).then((result) => {
// console.log(result)
if(result.data.status===0){
if (result.data.status === 0) {
this.setState({
Modalstype:true,
Allocationtype:false,
Modalstopval:result.data.message,
ModalSave:this.cancelmodel,
Modalstype: true,
Allocationtype: false,
Modalstopval: result.data.message,
ModalSave: this.cancelmodel,
})
this.fetchAllComments()
this.fetchAllComments()
}
}).catch((error)=>{
}).catch((error) => {
console.log(error)
})
}
render(){
render() {
let { total_count, comments, pageCount, comment_scores } = this.state
const { current_user, memo } = this.props
const isAdmin = this.props.isAdmin();
const isStudent=this.props.isStudent();
const isNotMember=this.props.isNotMember();
const isStudent = this.props.isStudent();
const isNotMember = this.props.isNotMember();
return(
return (
<React.Fragment>
{comment_scores.length===0&&isStudent===true||comment_scores.length===0&&isNotMember===true? "": <div className="edu-back-white" style={{marginTop: '16px'}}>
{isStudent===true?
<GraduationTasksappraiseReplyChild
{comment_scores.length === 0 && isStudent === true || comment_scores.length === 0 && isNotMember === true ? "" : <div className="edu-back-white" style={{ marginTop: '16px' }}>
{isStudent === true ?
<GraduationTasksappraiseReplyChild
{...this.props}
{...this.state}
cancelmodel={this.cancelmodel}
showModulationtype={(id)=>this.showModulationtype(id)}
saveModulationModal={(value,num)=>this.saveModulationModal(value,num)}
showModulationtype={(id) => this.showModulationtype(id)}
saveModulationModal={(value, num) => this.saveModulationModal(value, num)}
addSuccess={this.addSuccess}
onDelete={this.onDelete}
/>
: <GraduationTasksappraiseReplyChild {...this.state} {...this.props}
cancelmodel={this.cancelmodel}
showModulationtype={(id) => this.showModulationtype(id)}
saveModulationModal={(value, num) => this.saveModulationModal(value, num)}
addSuccess={this.addSuccess}
onDelete={this.onDelete}
/>
: <GraduationTasksappraiseReplyChild {...this.state} {...this.props}
cancelmodel={this.cancelmodel}
showModulationtype={(id)=>this.showModulationtype(id)}
saveModulationModal={(value,num)=>this.saveModulationModal(value,num)}
addSuccess={this.addSuccess}
onDelete={this.onDelete}
/>
}
}
</div>
}
}
</React.Fragment>
)
}
}
export default ImageLayerOfCommentHOC() (GraduationTasksappraiseReply);
{/*<div id="forum_list" className="forum_table">*/}
{/*<div className="mh650 edu-back-white">*/}
{/*<div*/}
{/*className="edu-tab-con-box clearfix edu-txt-center">*/}
{/*<img className="edu-nodata-img mb20"*/}
{/*src={getImageUrl("images/educoder/nodata.png")}/>*/}
{/*<p className="edu-nodata-p mb30">暂时还没有相关数据哦!</p>*/}
{/*</div>*/}
{/*</div>*/}
{/*</div>*/}
export default ImageLayerOfCommentHOC()(GraduationTasksappraiseReply);
{/*<div id="forum_list" className="forum_table">*/ }
{/*<div className="mh650 edu-back-white">*/ }
{/*<div*/ }
{/*className="edu-tab-con-box clearfix edu-txt-center">*/ }
{/*<img className="edu-nodata-img mb20"*/ }
{/*src={getImageUrl("images/educoder/nodata.png")}/>*/ }
{/*<p className="edu-nodata-p mb30">暂时还没有相关数据哦!</p>*/ }
{/*</div>*/ }
{/*</div>*/ }
{/*</div>*/ }

@ -1,6 +1,5 @@
import React,{ Component } from "react";
import { Pagination } from "antd";
import {ImageLayerOfCommentHOC} from '../../../page/layers/ImageLayerOfCommentHOC'
import React, { Component } from "react";
import ImageLayerOfCommentHOC from '../../../page/layers/ImageLayerOfCommentHOC'
import GraduationTasksappraiseMainEditor from './GraduationTasksappraiseMainEditor'
import Graduationtaskitem from './Graduationtaskitem'
import '../../../forums/Post.css'
@ -9,96 +8,92 @@ import '../../common/courseMessage.css'
import './GraduationTasksappraiseReply.css'
import ModulationModal from "../../coursesPublic/ModulationModal";
import Modals from '../../../modals/Modals';
const REPLY_PAGE_COUNT = 10
const $ = window.$;
class GraduationTasksappraiseReplyChild extends Component{
constructor(props){
class GraduationTasksappraiseReplyChild extends Component {
constructor(props) {
super(props);
this.state={
this.state = {
}
}
render(){
let { total_count, comments, pageCount, comment_scores} = this.props;
render() {
let { total_count, comments, pageCount, comment_scores } = this.props;
const isAdmin = this.props.isAdmin();
const isStudent=this.props.isStudent();
return(
return (
<React.Fragment>
<div className={`${comment_scores && comment_scores.length && 'bor-bottom-greyE'} stud-class-set edu-back-white mb10 padding20-30 `}
style={{height:"100%"}}>
<Modals
modalsType={this.props.Modalstype}
modalsTopval={this.props.Modalstopval}
modalCancel={this.props.ModalCancel}
modalSave={this.props.ModalSave}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
/>
{this.props.Modulationtype===true?<ModulationModal
modalname={"调分"}
visible={this.props.Modulationtype}
Cancelname={"取消"}
Savesname={"保存"}
Cancel={this.props.cancelmodel}
Saves={(value,num)=>this.props.saveModulationModal(value,num)}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
/>:""}
{/*<div style={{ width:'100%',height:'75px'}} >*/}
{/*<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>*/}
{/*{this.props.isStudent()?<a className={"fr color-blue font-16 mt10 mr20"} onClick={this.addAccessory}>补交附件</a>:""}*/}
{/*</div>*/}
{this.props.ultimate===true? isAdmin &&
<div style={{ width:'100%',height:'75px'}} >
<a className={"fr color-blue font-16 mt10 mr20"} onClick={()=>this.props.showModulationtype(this.props.task_id)}>调分</a>
</div>
:""}
{this.props.ultimate===true?"":<div className={"color-grey-6 mb10"}>
<span className="labal">全部评阅</span>
{ !!comment_scores.length && <span className="count">
{comment_scores.length===0?"":`(${comment_scores.length})`}
</span> }
</div>}
{this.props.ultimate===true ? "": isAdmin && <GraduationTasksappraiseMainEditor {...this.props}
addSuccess={() => this.props.addSuccess()}
showSameScore={this.props.task_type == 2}
></GraduationTasksappraiseMainEditor> }
<div className={`${comment_scores && comment_scores.length && 'bor-bottom-greyE'} stud-class-set edu-back-white mb10 padding20-30 `}
style={{ height: "100%" }}>
<Modals
modalsType={this.props.Modalstype}
modalsTopval={this.props.Modalstopval}
modalCancel={this.props.ModalCancel}
modalSave={this.props.ModalSave}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
/>
{this.props.Modulationtype === true ? <ModulationModal
modalname={"调分"}
visible={this.props.Modulationtype}
Cancelname={"取消"}
Savesname={"保存"}
Cancel={this.props.cancelmodel}
Saves={(value, num) => this.props.saveModulationModal(value, num)}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
/> : ""}
{/*<div style={{ width:'100%',height:'75px'}} >*/}
{/*<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>*/}
{/*{this.props.isStudent()?<a className={"fr color-blue font-16 mt10 mr20"} onClick={this.addAccessory}>补交附件</a>:""}*/}
{/*</div>*/}
{this.props.ultimate === true ? isAdmin &&
<div style={{ width: '100%', height: '75px' }} >
<a className={"fr color-blue font-16 mt10 mr20"} onClick={() => this.props.showModulationtype(this.props.task_id)}>调分</a>
</div>
: ""}
{this.props.ultimate === true ? "" : <div className={"color-grey-6 mb10"}>
<span className="labal">全部评阅</span>
{!!comment_scores.length && <span className="count">
{comment_scores.length === 0 ? "" : `(${comment_scores.length})`}
</span>}
</div>}
{this.props.ultimate === true ? "" : isAdmin && <GraduationTasksappraiseMainEditor {...this.props}
addSuccess={() => this.props.addSuccess()}
showSameScore={this.props.task_type == 2}
></GraduationTasksappraiseMainEditor>}
</div>
{!!comment_scores.length && <div className={"stud-class-set edu-back-white mb10"} style={{height:"100%"}}>
{!!comment_scores.length && <div className={"stud-class-set edu-back-white mb10"} style={{ height: "100%" }}>
<div className="padding20 memoReplies commentsDelegateParent course-message"
style={{ paddingTop: '0px', paddingBottom: '0px' }}
style={{ paddingTop: '0px', paddingBottom: '0px' }}
>
<style>{`
`}</style>
<div className="panel-comment_item">
{ comment_scores.map(item => {
{comment_scores.map(item => {
return <Graduationtaskitem item={item} onDelete={this.props.onDelete} {...this.props}></Graduationtaskitem>
}) }
})}
</div>
</div>
</div> }
</div>}
</React.Fragment>
)
}
}
export default ImageLayerOfCommentHOC() (GraduationTasksappraiseReplyChild);
export default ImageLayerOfCommentHOC()(GraduationTasksappraiseReplyChild);

@ -1,4 +1,4 @@
import React,{ Component } from "react";
import React, { Component } from "react";
import { Pagination } from "antd";
import update from 'immutability-helper'
@ -7,14 +7,16 @@ import MemoDetailMDEditor from '../../../forums/MemoDetailMDEditor'
import '../../../forums/Post.css'
import '../../../forums/RightSection.css'
import {ImageLayerOfCommentHOC} from '../../../page/layers/ImageLayerOfCommentHOC'
import ImageLayerOfCommentHOC from '../../../page/layers/ImageLayerOfCommentHOC'
import Comments from '../../../comment/Comments'
// import './GraduateTopicReply.css'
import '../../common/courseMessage.css'
import { generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment
import {
generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment
, addSecondLevelComment, NEED_TO_WRITE_CONTENT, handleContentBeforeCreateSecondLevelComment
, handleDeleteComment, handleCommentPraise, handleHiddenComment } from '../../common/CommentsHelper'
, handleDeleteComment, handleCommentPraise, handleHiddenComment
} from '../../common/CommentsHelper'
const REPLY_PAGE_COUNT = 10
const $ = window.$;
@ -23,15 +25,15 @@ const $ = window.$;
列表接口名 /graduation_tasks/${graduation_topic_id}/show_comment.json?parent_id=${parent.id}&limit=500
回复类型名 jour_type: 'GraduationTask',
*/
class GraduationTaskssettingReply extends Component{
constructor(props){
class GraduationTaskssettingReply extends Component {
constructor(props) {
super(props);
this.state={
this.state = {
pageCount: 1
}
}
componentDidMount(){
componentDidMount() {
this.fetchReplies()
@ -51,14 +53,14 @@ class GraduationTaskssettingReply extends Component{
let { comments } = this.state;
axios.post(url, {
journals_for_message: {
jour_type: 'GraduationTask',
jour_id: graduation_topic_id,
notes: content,
// m_parent_id
reply_id: memo.user_id
}
journals_for_message: {
jour_type: 'GraduationTask',
jour_id: graduation_topic_id,
notes: content,
// m_parent_id
reply_id: memo.user_id
}
}
).then((response) => {
if (response.data.status === -1) {
console.error('服务端异常')
@ -90,7 +92,7 @@ class GraduationTaskssettingReply extends Component{
// return;
// }
if (this.props.memo.id === id ) { // 回复帖子
if (this.props.memo.id === id) { // 回复帖子
this.createNewComment(commentContent, id, editor);
return;
}
@ -104,55 +106,55 @@ class GraduationTaskssettingReply extends Component{
commentContent = handleContentBeforeCreateSecondLevelComment(commentContent)
axios.post(url, {
journals_for_message: {
jour_type: 'GraduationTask',
jour_id: graduation_topic_id,
notes: commentContent,
m_parent_id: id,
reply_id: comment.user_id
}
},
{
}
).then((response) => {
if (response.data.id) {
let newId = response.data.id;
this.setState({
comments: addSecondLevelComment(comments, comment, commentIndex, newId, commentContent, user, editor)
})
const newMemo2 = Object.assign({}, this.props.memo);
newMemo2.total_count = newMemo2.total_count + 1;
this.setState({
memo: newMemo2
})
}
journals_for_message: {
jour_type: 'GraduationTask',
jour_id: graduation_topic_id,
notes: commentContent,
m_parent_id: id,
reply_id: comment.user_id
}
},
{
}
).then((response) => {
if (response.data.id) {
let newId = response.data.id;
}).catch((error) => {
console.log(error)
})
this.setState({
comments: addSecondLevelComment(comments, comment, commentIndex, newId, commentContent, user, editor)
})
const newMemo2 = Object.assign({}, this.props.memo);
newMemo2.total_count = newMemo2.total_count + 1;
this.setState({
memo: newMemo2
})
}
}).catch((error) => {
console.log(error)
})
}
loadMoreChildComments = (parent) => {
const graduation_topic_id = this.props.memo.id
const course_id = this.props.course_id
const url = `/graduation_tasks/${graduation_topic_id}/show_comment.json?parent_id=${parent.id}&limit=500`
axios.get(url,{
axios.get(url, {
})
.then((response) => {
const { comments } = response.data
.then((response) => {
const { comments } = response.data
// const memo = Object.assign({}, this.state.memo)
// memo.sum_replies_count = sum_replies_count;
this.setState({
// memo,
comments: generateChildComments(comments, this.state.comments, parent, this.transformReply)
// const memo = Object.assign({}, this.state.memo)
// memo.sum_replies_count = sum_replies_count;
this.setState({
// memo,
comments: generateChildComments(comments, this.state.comments, parent, this.transformReply)
})
}).catch((error) => {
console.log(error)
})
}).catch((error) => {
console.log(error)
})
}
onPaginationChange = (pageCount) => {
@ -166,19 +168,19 @@ class GraduationTaskssettingReply extends Component{
const course_id = this.props.course_id
const url = `/graduation_tasks/${graduation_topic_id}/show_comment.json?page=${this.state.pageCount}`
// page limit parent_id
axios.get(url,{
axios.get(url, {
})
.then((response) => {
const { comments, messages_count } = response.data
.then((response) => {
const { comments, messages_count } = response.data
this.setState({
comments: generateComments(comments, this.transformReply),
// : this.state.comments.concat(comments),
total_count: messages_count
this.setState({
comments: generateComments(comments, this.transformReply),
// : this.state.comments.concat(comments),
total_count: messages_count
})
}).catch((error) => {
console.log(error)
})
}).catch((error) => {
console.log(error)
})
}
transformReply = (reply, children = []) => {
@ -226,20 +228,20 @@ class GraduationTaskssettingReply extends Component{
}
}
render(){
render() {
let { total_count, comments, pageCount } = this.state
const { current_user, memo } = this.props
return(
return (
<React.Fragment>
<style>{`
`}</style>
<MemoDetailMDEditor {...this.props} ref="editor" memo={memo} usingMockInput={true} placeholder="请在此输入对本作品的评语最大限制2000个字符"
height={160} showError={true}></MemoDetailMDEditor>
height={160} showError={true}></MemoDetailMDEditor>
<div className="padding40 bor-bottom-greyE memoReplies commentsDelegateParent"
style={{ display: (comments && !!comments.length) ? 'block' : 'none' }}>
style={{ display: (comments && !!comments.length) ? 'block' : 'none' }}>
<div className="replies_count">
<span className="labal">全部回复</span>
<span className="count">{total_count}</span>
@ -261,19 +263,19 @@ class GraduationTaskssettingReply extends Component{
></Comments>
{/* { true ? :
{/* { true ? :
<div className="memoMore">
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
</div>} */}
</div>
{ total_count > REPLY_PAGE_COUNT &&
<div className="memoMore">
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10}/>
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
</div> }
{total_count > REPLY_PAGE_COUNT &&
<div className="memoMore">
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10} />
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
</div>}
</React.Fragment>
)
}
}
export default ImageLayerOfCommentHOC() (GraduationTaskssettingReply);
export default ImageLayerOfCommentHOC()(GraduationTaskssettingReply);

@ -1,31 +1,32 @@
import React,{ Component } from "react";
import React, { Component } from "react";
import { Pagination } from "antd";
import update from 'immutability-helper'
import axios from 'axios'
import MemoDetailMDEditor from '../../../forums/MemoDetailMDEditor'
import '../../../forums/Post.css'
import '../../../forums/RightSection.css'
import {ImageLayerOfCommentHOC} from '../../../page/layers/ImageLayerOfCommentHOC'
import ImageLayerOfCommentHOC from '../../../page/layers/ImageLayerOfCommentHOC'
import Comments from '../../../comment/Comments'
import './GraduateTopicReply.css'
import '../../common/courseMessage.css'
import { generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment
import {
generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment
, addSecondLevelComment, NEED_TO_WRITE_CONTENT, handleContentBeforeCreateSecondLevelComment
, handleDeleteComment, handleCommentPraise, handleHiddenComment } from '../../common/CommentsHelper'
, handleDeleteComment, handleCommentPraise, handleHiddenComment
} from '../../common/CommentsHelper'
const REPLY_PAGE_COUNT = 10
const $ = window.$;
class GraduateTopicReply extends Component{
constructor(props){
class GraduateTopicReply extends Component {
constructor(props) {
super(props);
this.state={
this.state = {
pageCount: 1
}
}
componentDidMount(){
componentDidMount() {
this.fetchReplies()
@ -45,14 +46,14 @@ class GraduateTopicReply extends Component{
let { comments } = this.state;
axios.post(url, {
journals_for_message: {
jour_type: 'GraduationTopic',
jour_id: graduation_topic_id,
notes: content,
// m_parent_id
reply_id: memo.user_id
}
journals_for_message: {
jour_type: 'GraduationTopic',
jour_id: graduation_topic_id,
notes: content,
// m_parent_id
reply_id: memo.user_id
}
}
).then((response) => {
if (response.data.status === -1) {
console.error('服务端异常')
@ -84,7 +85,7 @@ class GraduateTopicReply extends Component{
// return;
// }
if (this.props.memo.id === id ) { // 回复帖子
if (this.props.memo.id === id) { // 回复帖子
this.createNewComment(commentContent, id, editor);
return;
}
@ -98,55 +99,55 @@ class GraduateTopicReply extends Component{
commentContent = handleContentBeforeCreateSecondLevelComment(commentContent)
axios.post(url, {
journals_for_message: {
jour_type: 'GraduationTopic',
jour_id: graduation_topic_id,
notes: commentContent,
m_parent_id: id,
reply_id: comment.user_id
}
},
{
}
).then((response) => {
if (response.data.id) {
let newId = response.data.id;
this.setState({
comments: addSecondLevelComment(comments, comment, commentIndex, newId, commentContent, user, editor)
})
const newMemo2 = Object.assign({}, this.props.memo);
newMemo2.total_count = newMemo2.total_count + 1;
this.setState({
memo: newMemo2
})
}
journals_for_message: {
jour_type: 'GraduationTopic',
jour_id: graduation_topic_id,
notes: commentContent,
m_parent_id: id,
reply_id: comment.user_id
}
},
{
}
).then((response) => {
if (response.data.id) {
let newId = response.data.id;
}).catch((error) => {
console.log(error)
})
this.setState({
comments: addSecondLevelComment(comments, comment, commentIndex, newId, commentContent, user, editor)
})
const newMemo2 = Object.assign({}, this.props.memo);
newMemo2.total_count = newMemo2.total_count + 1;
this.setState({
memo: newMemo2
})
}
}).catch((error) => {
console.log(error)
})
}
loadMoreChildComments = (parent) => {
const graduation_topic_id = this.props.memo.id
const course_id = this.props.course_id
const url = `/courses/${course_id}/graduation_topics/${graduation_topic_id}/show_comment.json?parent_id=${parent.id}&limit=500`
axios.get(url,{
axios.get(url, {
})
.then((response) => {
const { comments } = response.data
.then((response) => {
const { comments } = response.data
// const memo = Object.assign({}, this.state.memo)
// memo.sum_replies_count = sum_replies_count;
this.setState({
// memo,
comments: generateChildComments(comments, this.state.comments, parent, this.transformReply)
// const memo = Object.assign({}, this.state.memo)
// memo.sum_replies_count = sum_replies_count;
this.setState({
// memo,
comments: generateChildComments(comments, this.state.comments, parent, this.transformReply)
})
}).catch((error) => {
console.log(error)
})
}).catch((error) => {
console.log(error)
})
}
onPaginationChange = (pageCount) => {
@ -160,19 +161,19 @@ class GraduateTopicReply extends Component{
const course_id = this.props.course_id
const url = `/courses/${course_id}/graduation_topics/${graduation_topic_id}/show_comment.json?page=${this.state.pageCount}`
// page limit parent_id
axios.get(url,{
axios.get(url, {
})
.then((response) => {
const { comments, messages_count } = response.data
.then((response) => {
const { comments, messages_count } = response.data
this.setState({
comments: generateComments(comments, this.transformReply),
// : this.state.comments.concat(comments),
total_count: messages_count
this.setState({
comments: generateComments(comments, this.transformReply),
// : this.state.comments.concat(comments),
total_count: messages_count
})
}).catch((error) => {
console.log(error)
})
}).catch((error) => {
console.log(error)
})
}
transformReply = (reply, children = []) => {
@ -220,17 +221,17 @@ class GraduateTopicReply extends Component{
}
}
render(){
render() {
let { total_count, comments, pageCount } = this.state
const { current_user, memo } = this.props
return(
return (
<React.Fragment>
<MemoDetailMDEditor {...this.props} ref="editor" memo={memo} usingMockInput={true} placeholder="说点什么"
height={160} showError={true}></MemoDetailMDEditor>
height={160} showError={true}></MemoDetailMDEditor>
<div className="padding40 bor-bottom-greyE memoReplies commentsDelegateParent"
style={{ display: (comments && !!comments.length) ? 'block' : 'none' }}>
style={{ display: (comments && !!comments.length) ? 'block' : 'none' }}>
<div className="replies_count">
<span className="labal">全部回复</span>
<span className="count">{total_count}</span>
@ -253,19 +254,19 @@ class GraduateTopicReply extends Component{
></Comments>
{/* { true ? :
{/* { true ? :
<div className="memoMore">
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
</div>} */}
</div>
{ total_count > REPLY_PAGE_COUNT &&
<div className="memoMore">
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10}/>
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
</div> }
{total_count > REPLY_PAGE_COUNT &&
<div className="memoMore">
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10} />
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
</div>}
</React.Fragment>
)
}
}
export default ImageLayerOfCommentHOC() (GraduateTopicReply);
export default ImageLayerOfCommentHOC()(GraduateTopicReply);

@ -1,24 +1,24 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import TPMIndexHOC from '../../tpm/TPMIndexHOC';
import "../css/Courses.css"
//引入对应跳转的组件
{/*提交总结*/}
{/*提交总结*/ }
const Polldepoly = Loadable({
loader: () => import('./pollmount'),
loading:Loading,
loading: Loading,
})
class Polllist extends Component{
class Polllist extends Component {
constructor(props) {
super(props)
}
@ -40,4 +40,4 @@ class Polllist extends Component{
}
}
export default SnackbarHOC() ( TPMIndexHOC(Polllist) );
export default SnackbarHOC()(TPMIndexHOC(Polllist));

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { Checkbox,Input,DatePicker } from 'antd';
import TPMIndexHOC from '../../tpm/TPMIndexHOC';
import { Checkbox, Input, DatePicker } from 'antd';
import locale from 'antd/lib/date-picker/locale/zh_CN';
import "../css/Courses.css";
@ -10,29 +10,29 @@ import CoursesListType from '../coursesPublic/CoursesListType';
class Polldepoly extends Component{
class Polldepoly extends Component {
constructor(props) {
super(props)
this.state = {
contents: [{val:"",id:1}],
contents: [{ val: "", id: 1 }],
}
}
componentDidMount() {
}
submitCommitSummary=()=> {
submitCommitSummary = () => {
const mdContnet = this.refs[`md${1}`].getValue().trim();;
console.log(mdContnet)
}
asdasdsad=()=>{
asdasdsad = () => {
this.setState({
contents:""
contents: ""
})
}
render() {
let {contents}=this.state;
let { contents } = this.state;
const dateFormat = 'YYYY-MM-DD HH:mm:ss';
return (
<React.Fragment>
@ -40,108 +40,108 @@ class Polldepoly extends Component{
<div className="newMain clearfix">
<div className={"educontent mb20"}>
<div style={{
width:'100%',
height:'70px'
width: '100%',
height: '70px'
}} >
<p className="ml15 fl color-black mt30 summaryname" onClick={this.asdasdsad}>Java语言之控制语句</p>
<CoursesListType
typelist={["已开启补交"]}
typesylename={"mt28"}
/>
<a onClick={()=>this.props.history.goBack()} className="color-grey-6 fr font-16 ml30 mt18 mr20">返回</a>
<a onClick={() => this.props.history.goBack()} className="color-grey-6 fr font-16 ml30 mt18 mr20">返回</a>
</div>
{/*<div className={"edu-con-bg01 user_bg_shadow bor-grey-e educontentbox"}>*/}
{/*<span className={"commitcontents"}>*/}
{/*<span className={"color-red"}>*</span>*/}
{/*内容</span>*/}
{/*<div className={"ml30 mr30 mt10"}>*/}
{/*<span className={"commitcontents"}>*/}
{/*<span className={"color-red"}>*</span>*/}
{/*内容</span>*/}
{/*<div className={"ml30 mr30 mt10"}>*/}
{/*</div>*/}
{/*</div>*/}
<div className="stud-class-set bor-bottom-greyE">
<div className="mt10 clearfix edu-back-white poll_list pl20">
<a className="active">答题列表</a>
<a>统计结果</a>
<a>问卷预览</a>
<a>配置</a>
<a className={"fr color-blue font-16"}>导出统计</a>
</div>
</div>
{/*</div>*/}
<div className="stud-class-set bor-bottom-greyE">
<div className="mt10 clearfix edu-back-white poll_list pl20">
<a className="active">答题列表</a>
<a>统计结果</a>
<a>问卷预览</a>
<a>配置</a>
<a className={"fr color-blue font-16"}>导出统计</a>
</div>
</div>
<div className="stud-class-set edu-back-white pt30 pb30 pr10 pl20">
<div className="stud-class-set edu-back-white pt30 pb30 pr10 pl20">
<div className="clearfix">
<p className="ml22 fl font-16 mt5 color-grey-6">发布设置</p>
{/*<a href="javascript:void(0);" className="white-btn orange-btn fr mr15 mt15" title="编辑"*/}
{/*onClick="show_poll_edit_setting();">编辑</a>*/}
</div>
<div className="clearfix">
<p className="ml22 fl font-16 mt5 color-grey-6">发布设置</p>
{/*<a href="javascript:void(0);" className="white-btn orange-btn fr mr15 mt15" title="编辑"*/}
{/*onClick="show_poll_edit_setting();">编辑</a>*/}
</div>
<div className="clearfix pl60 pt20">
<Checkbox className={"color-grey-6"}>统一设置 </Checkbox> <span className={"color-grey-9"}>(使)</span>
</div>
<div className="clearfix pl60 pt20">
<Checkbox className={"color-grey-6"}>统一设置 </Checkbox> <span className={"color-grey-9"}>(使)</span>
</div>
<div className="clearfix pl60 pt20">
{/*<span className={"color-grey-6"}>发布时间:</span> <Input size="large" placeholder="请选择发布时间" /><span className={"color-grey-9"}>(发布之前,学生不会收到问卷)</span>*/}
<span className="color-grey-6 mt5 fl" style={{minWidth: '70px'}}>发布时间</span>
<span className="fl mt5">
<DatePicker
showTime
showToday={false}
locale={locale}
format={dateFormat}
placeholder="请选择发布时间"
// value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
// onChange={this.onChangeTimePicker}
/>
<label style={{top:'6px'}} className="color-grey-9 ml10" >发布之前学生不会收到问卷</label>
</span>
</div>
<div className="clearfix pl60 pt20">
{/*<span className={"color-grey-6"}>发布时间:</span> <Input size="large" placeholder="请选择发布时间" /><span className={"color-grey-9"}>(发布之前,学生不会收到问卷)</span>*/}
<span className="color-grey-6 mt5 fl" style={{ minWidth: '70px' }}>发布时间</span>
<span className="fl mt5">
<DatePicker
showTime
showToday={false}
locale={locale}
format={dateFormat}
placeholder="请选择发布时间"
// value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
// onChange={this.onChangeTimePicker}
/>
<label style={{ top: '6px' }} className="color-grey-9 ml10" >发布之前学生不会收到问卷</label>
</span>
</div>
<div className="clearfix pl60 pt20">
{/*<span className={"color-grey-6"}>发布时间:</span> <Input size="large" placeholder="请选择发布时间" /><span className={"color-grey-9"}>(发布之前,学生不会收到问卷)</span>*/}
<span className="color-grey-6 mt5 fl" style={{minWidth: '70px'}}>截止时间</span>
<span className="fl mt5">
<DatePicker
showToday={false}
showTime
locale={locale}
format={dateFormat}
placeholder="请选择截止时间"
// value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
// onChange={this.onChangeTimePicker}
/>
<label style={{top:'6px'}} className="color-grey-9 ml10" >截止时间点系统将自动提交所有学生的答题学生将不能继续答题</label>
</span>
</div>
<div className="clearfix pl60 pt20">
{/*<span className={"color-grey-6"}>发布时间:</span> <Input size="large" placeholder="请选择发布时间" /><span className={"color-grey-9"}>(发布之前,学生不会收到问卷)</span>*/}
<span className="color-grey-6 mt5 fl" style={{ minWidth: '70px' }}>截止时间</span>
<span className="fl mt5">
<DatePicker
showToday={false}
showTime
locale={locale}
format={dateFormat}
placeholder="请选择截止时间"
// value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
// onChange={this.onChangeTimePicker}
/>
<label style={{ top: '6px' }} className="color-grey-9 ml10" >截止时间点系统将自动提交所有学生的答题学生将不能继续答题</label>
</span>
</div>
<div className="stud-class-set edu-back-white pt30 pb30 pr10 pl20">
<div className="stud-class-set edu-back-white pt30 pb30 pr10 pl20">
<div className="clearfix">
<p className="ml22 fl font-16 mt5 color-grey-6">公开设置</p>
{/*<a href="javascript:void(0);" className="white-btn orange-btn fr mr15 mt15" title="编辑"*/}
{/*onClick="show_poll_edit_setting();">编辑</a>*/}
</div>
<div className="clearfix">
<p className="ml22 fl font-16 mt5 color-grey-6">公开设置</p>
{/*<a href="javascript:void(0);" className="white-btn orange-btn fr mr15 mt15" title="编辑"*/}
{/*onClick="show_poll_edit_setting();">编辑</a>*/}
</div>
<div className="clearfix pl40 pt20">
<Checkbox className={"color-grey-6"}>公开统计 </Checkbox> <span className={"color-grey-9"}></span>
</div>
<div className="clearfix pl40 pt20">
<Checkbox className={"color-grey-6"}>公开统计 </Checkbox> <span className={"color-grey-9"}></span>
</div>
<div className="clearfix pl40 pt10">
<Checkbox className={"color-grey-6"}>实名问卷 </Checkbox> <span className={"color-grey-9"}></span>
</div>
<div className="clearfix pl40 pt10">
<Checkbox className={"color-grey-6"}>实名问卷 </Checkbox> <span className={"color-grey-9"}></span>
</div>
</div>
</div>
</div>
<div className="clearfix mt30 mb30">
<a className="defalutSubmitbtn fl mr20"
onClick={this.submitCommitSummary}>提交</a>
<a className="defalutCancelbtn fl">取消</a>
onClick={this.submitCommitSummary}>提交</a>
<a className="defalutCancelbtn fl">取消</a>
</div>
</div>
@ -152,6 +152,6 @@ class Polldepoly extends Component{
}
}
export default SnackbarHOC() ( TPMIndexHOC(Polldepoly) );
export default SnackbarHOC()(TPMIndexHOC(Polldepoly));

@ -1,30 +1,30 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import TPMIndexHOC from '../../tpm/TPMIndexHOC';
import "../css/Courses.css";
import CoursesMarkdown from "../coursesPublic/CoursesMarkdown";
import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor';
import {
Form, Icon, Input, Button, Checkbox,message,
Form, Icon, Input, Button, Checkbox, message,
} from "antd";
import {WordsBtn} from 'educoder';
import { WordsBtn } from 'educoder';
//引入对应跳转的组件
import axios from 'axios';
//提交总结
class CommitSummary extends Component{
class CommitSummary extends Component {
constructor(props) {
super(props)
this.state = {
contents: [{val:"",id:1}],
course_id:0,
course_name:"",
category:[],
homework_id:0,
user_name:"",
work_id:0,
description:"",
data:undefined,
cancels:false,
contents: [{ val: "", id: 1 }],
course_id: 0,
course_name: "",
category: [],
homework_id: 0,
user_name: "",
work_id: 0,
description: "",
data: undefined,
cancels: false,
}
}
@ -34,18 +34,18 @@ class CommitSummary extends Component{
let query = this.props.location.pathname;
const type = query.split('/');
this.setState({
shixuntypes:type[3]
shixuntypes: type[3]
})
}
//获取提交总结接口
Getsubmissionsummaryinterface=()=>{
var worksid=this.props.match.params.id;
Getsubmissionsummaryinterface = () => {
var worksid = this.props.match.params.id;
// console.log("Getsubmissionsummaryinterface");
// console.log(this.props.match.params);
// console.log(worksid);
var url = `/student_works/${worksid}/commit_des.json`;
var url = `/student_works/${worksid}/commit_des.json`;
axios.get(url).then((result) => {
// console.log(result);
if (result.status === 200) {
@ -53,11 +53,11 @@ class CommitSummary extends Component{
// console.log("提交总结接口")
// console.log(JSON.stringify(result))
this.setState({
data:result.data,
data: result.data,
description: result.data.description,
cancels:true,
cancels: true,
})
}else {
} else {
this.props.showNotification(result.data.message);
}
@ -66,11 +66,11 @@ class CommitSummary extends Component{
})
}
submitCommitSummary=()=> {
submitCommitSummary = () => {
const mdContnet = this.refs[`md${1}`].getValue().trim();
console.log(mdContnet)
}
gotohome=()=>{
gotohome = () => {
// let courseId=this.props.match.params.coursesId;
// if(courseId===undefined){
// this.props.history.push("/courses");
@ -79,27 +79,27 @@ class CommitSummary extends Component{
// }
this.props.history.goBack()
}
asdasdsad=()=>{
asdasdsad = () => {
this.setState({
contents:""
contents: ""
})
}
handleSubmit=(e) => {
handleSubmit = (e) => {
e.preventDefault();
this.props.form.validateFields((err, values) => {
if (!err) {
console.log(values.description);
if(values.description === undefined|| values.description === "" || values.description ===null){
if (values.description === undefined || values.description === "" || values.description === null) {
this.props.showNotification(`请输入提交内容`);
return
}
var worksid=this.props.match.params.id;
var worksid = this.props.match.params.id;
var url = `/student_works/${worksid}/update_des.json`;
axios.post(url,{
description:values.description,
var url = `/student_works/${worksid}/update_des.json`;
axios.post(url, {
description: values.description,
}).then((result) => {
if (result.status === 200) {
// console.log(url)
@ -118,26 +118,26 @@ class CommitSummary extends Component{
}
render() {
const {getFieldDecorator} = this.props.form;
let {contents,data}=this.state;
const { getFieldDecorator } = this.props.form;
let { contents, data } = this.state;
// console.log(this.props);
document.title=data === undefined ? "" :data.course_name===undefined?"": data.course_name;
document.title = data === undefined ? "" : data.course_name === undefined ? "" : data.course_name;
return (
<div>
<div className="newMain clearfix">
{/*<Form onSubmit={this.handleSubmit}>*/}
<div className={"educontent mb20"}>
<div style={{
width:'100%',
height:'20px'
width: '100%',
height: '20px'
}} >
<div className="educontent mb30">
<p className="clearfix mb20 mt10 ">
<a className="btn colorgrey fl hovercolorblue " onClick={()=>this.gotohome()}>{data === undefined ? "" :data.course_name===undefined?"": data.course_name}</a>
<a className="btn colorgrey fl hovercolorblue " onClick={() => this.gotohome()}>{data === undefined ? "" : data.course_name === undefined ? "" : data.course_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
{/* style="grey" */}
<a
className="btn colorgrey fl hovercolorblue ">{data === undefined ? "" :data.category===undefined?"":data.category.category_name}</a>
className="btn colorgrey fl hovercolorblue ">{data === undefined ? "" : data.category === undefined ? "" : data.category.category_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<a className="fl">作业详情</a>
</p>
@ -146,23 +146,23 @@ class CommitSummary extends Component{
</div>
<div className="mt20">
<p className=" fl color-black mt10 summaryname" onClick={this.asdasdsad}>{this.state.description ? '修改总结' : '提交总结'}</p>
<a onClick={()=>this.gotohome()} className="color-grey-6 fr font-16 ml30 mt10">返回</a>
<a onClick={() => this.gotohome()} className="color-grey-6 fr font-16 ml30 mt10">返回</a>
</div>
{/*educontentbox*/}
<div className="stud-class-set pt40 pb40">
<div className={"mt10"}>
<div style={{ "background": "#fff", "padding": "15px"}}>
<span className="commitcontentsysl">
<span className="color-red">*</span>
内容</span>
<div style={{ "background": "#fff", "padding": "15px" }}>
<span className="commitcontentsysl">
<span className="color-red">*</span>
内容</span>
</div>
<div className="new-wrap">
<Form layout='vertical' onSubmit={this.handleSubmit} >
<Form.Item
>
<div style={{ "background": "#fff","padding-bottom":"20px","padding-left":"20px","padding-right":"20px"}}
className="mdInForm">
<div style={{ "background": "#fff", "padding-bottom": "20px", "padding-left": "20px", "padding-right": "20px" }}
className="mdInForm">
{getFieldDecorator('description', {
rules: [{
required: true, message: '请在此输入总结内容,最多5000个字符',
@ -171,7 +171,7 @@ class CommitSummary extends Component{
}],
})(
<TPMMDEditor ref={this.mdRef} placeholder={'请在此输入总结内容最多5000个字符'}
mdID={'courseMessageMD'} initValue={this.state.description} className="courseMessageMD"></TPMMDEditor>
mdID={'courseMessageMD'} initValue={this.state.description} className="courseMessageMD"></TPMMDEditor>
)}
</div>
</Form.Item>

@ -1,9 +1,9 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import TPMIndexHOC from '../../tpm/TPMIndexHOC';
import "../css/Courses.css"
//引入对应跳转的组件
@ -23,7 +23,7 @@ import "../css/Courses.css"
// })
//
class CommitSummaryIndex extends Component{
class CommitSummaryIndex extends Component {
constructor(props) {
super(props)
}
@ -50,4 +50,4 @@ class CommitSummaryIndex extends Component{
}
}
export default SnackbarHOC() ( TPMIndexHOC(CommitSummaryIndex) );
export default SnackbarHOC()(TPMIndexHOC(CommitSummaryIndex));

@ -6,13 +6,13 @@
* @Last Modified time: 2019-11-15 20:43:27
*/
import React from 'react';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import TPMIndexHOC from '../tpm/TPMIndexHOC';
import { SnackbarHOC } from 'educoder';
import DeveloperHome from './DeveloperHome';
const App = (props) => {
return (
<DeveloperHome {...props}/>
<DeveloperHome {...props} />
);
}

@ -12,13 +12,10 @@ import { connect } from 'react-redux';
import SplitPane from 'react-split-pane';
import LeftPane from './leftpane';
import RightPane from './rightpane';
// import { Link } from 'react-router-dom';
// import { getImageUrl } from 'educoder'
// import RightPane from '../newOrEditTask/rightpane';
import { Icon } from 'antd';
import UserInfo from '../components/userInfo';
import actions from '../../../redux/actions';
import { fromStore, CNotificationHOC } from 'educoder';
import { CNotificationHOC } from 'educoder';
import { withRouter } from 'react-router';
function StudentStudy(props) {

@ -7,8 +7,7 @@ import axios from 'axios';
import { Table, InputNumber } from 'antd';
// import EcTitleCourseEvaluations from '../ecTitle/ecTitle'
import { ECModalHOC } from '../../common/ECModalHOC'
import ECModalHOC from '../../common/ECModalHOC'
import 'antd/lib/style/index.css';

@ -3,7 +3,7 @@ import { Switch, Route } from 'react-router-dom';
import { SnackbarHOC } from 'educoder';
import CustomLoadable from "../../CustomLoadable";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import TPMIndexHOC from "../tpm/TPMIndexHOC";
const Home = CustomLoadable(() => import('./Home/index'));
const EcYear = CustomLoadable(() => import('./EcYear/index'));
@ -11,54 +11,54 @@ const EcSetting = CustomLoadable(() => import('./EcSetting/index'));
const $ = window.$
//工程认证各个页面的查看详情弹层
function elasticLayer(forumId){
if (window.__memo) {
doElasticLayer(window.__memo, true)
return;
function elasticLayer(forumId) {
if (window.__memo) {
doElasticLayer(window.__memo, true)
return;
}
if (!forumId) return;
var url = 'https://www.educoder.net/api/memos/' + forumId
$.ajax({
url: url,
type: 'get',
success: function (res) {
console.log(res)
doElasticLayer(res.memo)
}
if (!forumId) return;
var url = 'https://www.educoder.net/api/memos/' + forumId
$.ajax({
url: url,
type: 'get',
success: function(res) {
console.log(res)
doElasticLayer(res.memo)
}
});
});
// document.body.addEventListener('touchmove',bodyScroll,false);
// $('body').css({'position':'fixed',"width":"100%"});
// document.body.addEventListener('touchmove',bodyScroll,false);
// $('body').css({'position':'fixed',"width":"100%"});
}
function doElasticLayer(memo, rendered){
if (rendered) {
$(".layerContent").show();
$(".newMain").hide();
return;
}
window.__memo = memo
var content = memo.content
var subject = memo.subject
var html='<div class="layerContent"><div class="educontent">' +
'<p class="clearfix pt25 pb25 color-grey-3 bor-bottom-greyE"><span class="fl font-24">'+ subject +'</span>' +
'<a href="javascript:void(0)" onclick="removeElasticLayer();" class="fr font-16 mt5">返回</a></p>' +
'<div id="MDContent"><textarea style="display:none">'
+ content +
'</textarea></div>'
function doElasticLayer(memo, rendered) {
if (rendered) {
$(".layerContent").show();
$(".newMain").hide();
return;
}
window.__memo = memo
var content = memo.content
var subject = memo.subject
var html = '<div class="layerContent"><div class="educontent">' +
'<p class="clearfix pt25 pb25 color-grey-3 bor-bottom-greyE"><span class="fl font-24">' + subject + '</span>' +
'<a href="javascript:void(0)" onclick="removeElasticLayer();" class="fr font-16 mt5">返回</a></p>' +
'<div id="MDContent"><textarea style="display:none">'
+ content +
'</textarea></div>'
$(".newMain").after(html).hide();
$(".newMain").after(html).hide();
window.editormd.markdownToHTML("MDContent", {
htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true,
tex: true, // 默认不解析
flowChart: true, // 默认不解析
sequenceDiagram: true // 默认不解析
});
window.editormd.markdownToHTML("MDContent", {
htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true,
tex: true, // 默认不解析
flowChart: true, // 默认不解析
sequenceDiagram: true // 默认不解析
});
}
function removeElasticLayer(){
$(".layerContent").hide();
$(".newMain").show();
function removeElasticLayer() {
$(".layerContent").hide();
$(".newMain").show();
}
window.elasticLayer = elasticLayer
window.doElasticLayer = doElasticLayer
@ -79,4 +79,4 @@ class Ecs extends React.Component {
}
}
export default SnackbarHOC() (TPMIndexHOC ( Ecs ));
export default SnackbarHOC()(TPMIndexHOC(Ecs));

@ -8,7 +8,7 @@ import { SnackbarHOC } from 'educoder'
import axios from 'axios'
import 'antd/dist/antd.css';
import './style.less'
import { ECModalHOC } from '../../common/ECModalHOC'
import ECModalHOC from '../../common/ECModalHOC'
class EcCourseSupportSetting extends Component {
constructor(props) {

@ -2,11 +2,11 @@ import React, { Component } from 'react';
import axios from 'axios';
import { TPMIndexHOC } from '../../../tpm/TPMIndexHOC';
import TPMIndexHOC from '../../../tpm/TPMIndexHOC';
import { SnackbarHOC,getImageUrl } from 'educoder'
import { SnackbarHOC, getImageUrl } from 'educoder'
import { Pagination,Upload,Modal,Checkbox,Spin } from 'antd';
import { Pagination, Upload, Modal, Checkbox, Spin } from 'antd';
import EcTitleCourseEvaluations from '../../ecTitle/ecTitle'
@ -19,199 +19,204 @@ const $ = window.$;
class EcStudentList extends Component {
constructor(props) {
super(props)
this.state={
majorschoollist:undefined,
titlemessage:"提示",
this.state = {
majorschoollist: undefined,
titlemessage: "提示",
// ecComponentState:"ecStudentList",
visible:false,
Modallist:'',
Modallisttypes:0,
studentall:false,
student_id:undefined,
Modallisttypess:0,
ismanager:false,
isSpin:false,
pages:1,
per_pages:20,
total_student:0,
Myschoolstudents:[],
visible: false,
Modallist: '',
Modallisttypes: 0,
studentall: false,
student_id: undefined,
Modallisttypess: 0,
ismanager: false,
isSpin: false,
pages: 1,
per_pages: 20,
total_student: 0,
Myschoolstudents: [],
}
}
componentDidMount(){
componentDidMount() {
window.document.title = '学生列表';
let major_id=this.props.match.params.majorId;
let year_id=this.props.match.params.yearId;
const url ='/ec_years/'+year_id+'/students.json';
axios.get(url, {params: {
page:this.state.pages,
per_page:this.state.per_pages,
}}).then((response) => {
if(response){
if(response.status){
if(response.status===200){
this.setState({
total_student:response.data.count,
majorschoollist:response.data,
ismanager:response.data.ismanager,
});
try {
if(response.data.students.length>0){
var mst=response.data.students;
for(var i=0;i<mst.length;i++){
mst[i].istrue=false;
}
this.setState({
Myschoolstudents:mst
});
let major_id = this.props.match.params.majorId;
let year_id = this.props.match.params.yearId;
const url = '/ec_years/' + year_id + '/students.json';
axios.get(url, {
params: {
page: this.state.pages,
per_page: this.state.per_pages,
}
}).then((response) => {
if (response) {
if (response.status) {
if (response.status === 200) {
this.setState({
total_student: response.data.count,
majorschoollist: response.data,
ismanager: response.data.ismanager,
});
try {
if (response.data.students.length > 0) {
var mst = response.data.students;
for (var i = 0; i < mst.length; i++) {
mst[i].istrue = false;
}
}catch (e) {
this.setState({
Myschoolstudents:[]
Myschoolstudents: mst
});
}
} catch (e) {
this.setState({
Myschoolstudents: []
});
}
}
}
}
})
})
.catch(function (error) {
console.log(error);
});
}
uploadcomponentDidMount(){
let major_id=this.props.match.params.majorId;
let year_id=this.props.match.params.yearId;
const url ='/ec_years/'+year_id+'/students.json';
axios.get(url, {params: {
uploadcomponentDidMount() {
let major_id = this.props.match.params.majorId;
let year_id = this.props.match.params.yearId;
const url = '/ec_years/' + year_id + '/students.json';
axios.get(url, {
params: {
page: this.state.pages,
per_page: this.state.per_pages,
}
}
}
).then((response) => {
if(response){
if(response.status){
if(response.status===200){
this.setState({
total_student:response.data.count,
majorschoollist:response.data,
ismanager:response.data.ismanager,
});
try {
if(response.data.students.length>0){
var mst=response.data.students;
for(var i=0;i<mst.length;i++){
mst[i].istrue=false;
}
this.setState({
Myschoolstudents:mst
});
}
}catch (e) {
this.setState({
Myschoolstudents:[]
});
}
}
}
}
if (response) {
if (response.status) {
if (response.status === 200) {
this.setState({
total_student: response.data.count,
majorschoollist: response.data,
ismanager: response.data.ismanager,
});
try {
if (response.data.students.length > 0) {
var mst = response.data.students;
for (var i = 0; i < mst.length; i++) {
mst[i].istrue = false;
}
this.setState({
Myschoolstudents: mst
});
}
} catch (e) {
this.setState({
Myschoolstudents: []
});
}
}
}
}
})
.catch(function (error) {
console.log(error);
});
.catch(function (error) {
console.log(error);
});
}
windowsgoblack=()=>{
windowsgoblack = () => {
window.history.go(-1)
}
uploadfile=(file)=>{
uploadfile = (file) => {
console.log("导入的文件");
console.log(file);
this.setState({isSpin:true})
let {majorschoollist}=this.state;
let year_id=this.props.match.params.yearId;
let Url ='/ec_years/'+year_id+'/students/import.json';
this.setState({ isSpin: true })
let { majorschoollist } = this.state;
let year_id = this.props.match.params.yearId;
let Url = '/ec_years/' + year_id + '/students/import.json';
const config = {
headers: { "Content-Type": "multipart/form-data" }
};
const form = new FormData();
form.append('file', file.file);
axios.post(Url,form
,config).then((response) => {
if(response.data.status===0){
// message.success('已成功导入'+response.data.count+"条数据!");
this.setState({
// titlemessage: response.data.message+"(支撑关系变更)",
Modallist: '已成功导入'+response.data.success_count+"条数据!",
Modallisttype:true,
Modallisttypes:1,
Modallisttypess:0,
isSpin:false
})
}else{
// message.warning(response.data.message);
this.setState({
// titlemessage: response.data.message+"(支撑关系变更)",
Modallist:response.data.message,
Modallisttype:true,
Modallisttypes:0,
Modallisttypess:0,
isSpin:false
})
}
}).catch((error) => {
console.log(error)
})
axios.post(Url, form
, config).then((response) => {
if (response.data.status === 0) {
// message.success('已成功导入'+response.data.count+"条数据!");
this.setState({
// titlemessage: response.data.message+"(支撑关系变更)",
Modallist: '已成功导入' + response.data.success_count + "条数据!",
Modallisttype: true,
Modallisttypes: 1,
Modallisttypess: 0,
isSpin: false
})
} else {
// message.warning(response.data.message);
this.setState({
// titlemessage: response.data.message+"(支撑关系变更)",
Modallist: response.data.message,
Modallisttype: true,
Modallisttypes: 0,
Modallisttypess: 0,
isSpin: false
})
}
}).catch((error) => {
console.log(error)
})
}
hidemodeldelete=(Modallisttypes)=>{
hidemodeldelete = (Modallisttypes) => {
this.setState({
Modallisttype:false,
Modallist:'',
Modallisttypess:0
Modallisttype: false,
Modallist: '',
Modallisttypess: 0
})
if(Modallisttypes===1){
if (Modallisttypes === 1) {
// window.location.reload();
this.uploadcomponentDidMount();
}
}
showecStudentList=(page)=>{
let major_id=this.props.match.params.majorId;
let year_id=this.props.match.params.yearId;
const url ='/ec_years/'+year_id+'/students.json';
axios.get(url, {params: {
page:page,
per_page:this.state.per_pages,
}}).then((response) => {
if(response){
if(response.status){
if(response.status===200){
showecStudentList = (page) => {
let major_id = this.props.match.params.majorId;
let year_id = this.props.match.params.yearId;
const url = '/ec_years/' + year_id + '/students.json';
axios.get(url, {
params: {
page: page,
per_page: this.state.per_pages,
}
}).then((response) => {
if (response) {
if (response.status) {
if (response.status === 200) {
this.setState({
total_student:response.data.count,
majorschoollist:response.data,
ismanager:response.data.ismanager,
pages:page,
total_student: response.data.count,
majorschoollist: response.data,
ismanager: response.data.ismanager,
pages: page,
});
try {
if(response.data.students.length>0){
var mst=response.data.students;
for(var i=0;i<mst.length;i++){
mst[i].istrue=false;
if (response.data.students.length > 0) {
var mst = response.data.students;
for (var i = 0; i < mst.length; i++) {
mst[i].istrue = false;
}
this.setState({
Myschoolstudents:mst
Myschoolstudents: mst
});
}
}catch (e) {
} catch (e) {
this.setState({
Myschoolstudents:[]
Myschoolstudents: []
});
}
@ -219,88 +224,90 @@ class EcStudentList extends Component {
}
}
}).catch(function (error) {
console.log(error);
});
console.log(error);
});
};
//全选
onChangestudentall=(e)=>{
let {Myschoolstudents}=this.state;
let mewmajorschoollist=Myschoolstudents
for(var i=0; i<mewmajorschoollist.length; i++){
mewmajorschoollist[i].istrue=e.target.checked
//全选
onChangestudentall = (e) => {
let { Myschoolstudents } = this.state;
let mewmajorschoollist = Myschoolstudents
for (var i = 0; i < mewmajorschoollist.length; i++) {
mewmajorschoollist[i].istrue = e.target.checked
}
this.setState({
studentall:e.target.checked,
Myschoolstudents:mewmajorschoollist
})
studentall: e.target.checked,
Myschoolstudents: mewmajorschoollist
})
};
//单选
onChangestudent=(e)=>{
let {Myschoolstudents,studentall}=this.state;
let mewmajorschoollist=Myschoolstudents;
let newstudentall=studentall;
if(e.target.checked===false){
newstudentall=false
onChangestudent = (e) => {
let { Myschoolstudents, studentall } = this.state;
let mewmajorschoollist = Myschoolstudents;
let newstudentall = studentall;
if (e.target.checked === false) {
newstudentall = false
}
for(var i=0; i<mewmajorschoollist.length; i++){
if(i===e.target.index&&e.target.id===mewmajorschoollist[i].student_id){
mewmajorschoollist[i].istrue=e.target.checked
for (var i = 0; i < mewmajorschoollist.length; i++) {
if (i === e.target.index && e.target.id === mewmajorschoollist[i].student_id) {
mewmajorschoollist[i].istrue = e.target.checked
}
}
this.setState({
student_id:e.target.id,
studentall:newstudentall,
Myschoolstudents:mewmajorschoollist
})
this.setState({
student_id: e.target.id,
studentall: newstudentall,
Myschoolstudents: mewmajorschoollist
})
};
// 删除提示
deletelistbth=()=>{
let {Myschoolstudents,studentall} =this.state;
let studentalltype=0
for(var i=0; i<Myschoolstudents.length; i++){
if(Myschoolstudents[i].istrue===true){
studentalltype=1
// 删除提示
deletelistbth = () => {
let { Myschoolstudents, studentall } = this.state;
let studentalltype = 0
for (var i = 0; i < Myschoolstudents.length; i++) {
if (Myschoolstudents[i].istrue === true) {
studentalltype = 1
}
}
if(studentall===true||studentalltype===1){
if (studentall === true || studentalltype === 1) {
this.setState({
Modallist: '确定删除这些学生吗?',
Modallisttype:true,
Modallisttypess:1
Modallisttype: true,
Modallisttypess: 1
})
}else{
} else {
this.setState({
Modallist: '请选择学生!',
Modallisttype:true
Modallisttype: true
})
}
};
//删除学生
deletelistbthenters=()=>{
debugger
let {Myschoolstudents,studentall} =this.state;
let major_id=this.props.match.params.majorId;
let year_id=this.props.match.params.yearId;
let newstudent_id=[];
if(studentall===false){
for(var i=0; i<Myschoolstudents.length; i++){
if(Myschoolstudents[i].istrue===true){
deletelistbthenters = () => {
debugger
let { Myschoolstudents, studentall } = this.state;
let major_id = this.props.match.params.majorId;
let year_id = this.props.match.params.yearId;
let newstudent_id = [];
if (studentall === false) {
for (var i = 0; i < Myschoolstudents.length; i++) {
if (Myschoolstudents[i].istrue === true) {
newstudent_id.push(Myschoolstudents[i].id)
}
}
}
let url ='/ec_years/'+year_id+'/students.json'
axios.delete(url,{data:{
ids:newstudent_id,
}}).then((response) => {
if(response.data.status===0){
this.setState({
let url = '/ec_years/' + year_id + '/students.json'
axios.delete(url, {
data: {
ids: newstudent_id,
}
}).then((response) => {
if (response.data.status === 0) {
this.setState({
// Modallist: "删除成功!",
// Modallisttype:true,
Modallisttypes:1,
Modallisttypess:0
})
this.hidemodeldelete(1);
Modallisttypes: 1,
Modallisttypess: 0
})
this.hidemodeldelete(1);
}
}).catch((error) => {
console.log(error)
@ -319,7 +326,7 @@ class EcStudentList extends Component {
total_student,
ismanager,
Myschoolstudents
}=this.state;
} = this.state;
const uploadProps = {
name: 'file',
@ -336,126 +343,126 @@ class EcStudentList extends Component {
}
}
return (
<div className="newMain clearfix">
<Modal
title={titlemessage}
// visible={modeldelet===true&&listid===list.id?true:false}
visible={Modallisttype}
className={"ecmodeldelet"}
closable={false}
footer={null}
>
<div className="task-popup-content">
<div className="task-popup-text-center font-14">{Modallist}</div>
</div>
<div className="task-popup-submit clearfix">
<a onClick={()=>this.hidemodeldelete(1)} className="task-btn fl">取消</a>
{
Modallisttypess===0?<a className="task-btn task-btn-orange fr"
onClick={()=>this.hidemodeldelete(1)}
>确定</a>:<a className="task-btn task-btn-orange fr"
onClick={this.deletelistbthenters}
>确定</a>
}
</div>
</Modal>
<div className="educontent mb290">
{/*<div className="clearfix padding20-30 bor-bottom-greyE mb10 edu-back-white">*/}
{/*<span className="fl font-18 courseSystem ">学生列表</span>*/}
{/*<a className="fr font-15 courseSystem" onClick={this.windowsgoblack}>返回</a>*/}
{/*</div>*/}
<div className="edu-back-white ">
<div className="clearfix padding20-30 bor-bottom-greyE"><span
className=" font-18 courseSystem">学生列表
<div className="newMain clearfix">
<Modal
title={titlemessage}
// visible={modeldelet===true&&listid===list.id?true:false}
visible={Modallisttype}
className={"ecmodeldelet"}
closable={false}
footer={null}
>
<div className="task-popup-content">
<div className="task-popup-text-center font-14">{Modallist}</div>
</div>
<div className="task-popup-submit clearfix">
<a onClick={() => this.hidemodeldelete(1)} className="task-btn fl">取消</a>
{
Modallisttypess === 0 ? <a className="task-btn task-btn-orange fr"
onClick={() => this.hidemodeldelete(1)}
>确定</a> : <a className="task-btn task-btn-orange fr"
onClick={this.deletelistbthenters}
>确定</a>
}
</div>
</Modal>
<div className="educontent mb290">
{/*<div className="clearfix padding20-30 bor-bottom-greyE mb10 edu-back-white">*/}
{/*<span className="fl font-18 courseSystem ">学生列表</span>*/}
{/*<a className="fr font-15 courseSystem" onClick={this.windowsgoblack}>返回</a>*/}
{/*</div>*/}
<div className="edu-back-white ">
<div className="clearfix padding20-30 bor-bottom-greyE"><span
className=" font-18 courseSystem">学生列表
{total_student}
</span>
<div className="color-grey-9 mr10">提供模板支持导入学生信息(请先下载模板)
</span>
<div className="color-grey-9 mr10">提供模板支持导入学生信息(请先下载模板)
<a className={"color-blue"} target="_blank" href={'/forums/3533'}>查看详情</a>
</div>
</div>
<div className="padding20-30 padbottom" id="training_objective_contents">
{ismanager===false?"":
<span className="mr30">请使用导入模板<a href={'/attachments/download/279190/01_学生列表导入模板2.0.xls'} className="color-green"><i className="iconfont icon-fujian mr5 color-green font-16"></i></a>便</span>
}
<a className="white-btn edu-orangeback-btn fr mr10" >
{ismanager===false?"":<Upload
{...uploadProps}
showUploadList={false}
style={{color:'#fff'}}
>
导入
</div>
</div>
<div className="padding20-30 padbottom" id="training_objective_contents">
{ismanager === false ? "" :
<span className="mr30">请使用导入模板<a href={'/attachments/download/279190/01_学生列表导入模板2.0.xls'} className="color-green"><i className="iconfont icon-fujian mr5 color-green font-16"></i></a>便</span>
}
<a className="white-btn edu-orangeback-btn fr mr10" >
{ismanager === false ? "" : <Upload
{...uploadProps}
showUploadList={false}
style={{ color: '#fff' }}
>
导入
</Upload>}
</a>
</div>
</a>
</div>
<div id="training_objective_contents" className='deletelist' >
{ismanager===false?"":<div className="white-btn deletebth ml30 mr10" onClick={this.deletelistbth}>
删除
<div id="training_objective_contents" className='deletelist' >
{ismanager === false ? "" : <div className="white-btn deletebth ml30 mr10" onClick={this.deletelistbth}>
删除
</div>}
</div>
<Spin spinning={this.state.isSpin}>
<div>
<div className="ListTableLine minH-500 edu-back-white" id="listContent">
<p className="clearfix">
<span className="column-No column-2 relative">
<Checkbox
className={'mr20 changestudent'}
checked={studentall===true?true:false}
onChange={this.onChangestudentall}></Checkbox>
序号
</div>
<Spin spinning={this.state.isSpin}>
<div>
<div className="ListTableLine minH-500 edu-back-white" id="listContent">
<p className="clearfix">
<span className="column-No column-2 relative">
<Checkbox
className={'mr20 changestudent'}
checked={studentall === true ? true : false}
onChange={this.onChangestudentall}></Checkbox>
序号
</span>
<span className="column-2">姓名</span>
<span className="column-2">学号</span>
</p>
<style>{
`
<span className="column-2">姓名</span>
<span className="column-2">学号</span>
</p>
<style>{
`
.myslispan{
display: flex;
flex-direction:initial;
}
`
}</style>
<ul>
{
Myschoolstudents===undefined?
<div className="edu-txt-center color-grey-9 pt50">
<p className="mb20"><img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")} /></p>
<p>学生数据为空请导入数据</p>
</div>
:Myschoolstudents&&Myschoolstudents.length===0?
<div className="edu-txt-center color-grey-9 pt50">
<p className="mb20"><img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/></p>
<p>学生数据为空请导入数据</p>
</div>:Myschoolstudents&&Myschoolstudents.map((item,key)=>{
// console.log(item)
return(
<li className="clearfix myslispan" key={key}>
<div className="column-No column-2 relative">
<Checkbox
className={'mr20 changestudents'}
checked={item.istrue===true?true:false}
key={key}
index={key}
onChange={this.onChangestudent} id={item.student_id}></Checkbox>
{item.index}
</div>
<div className="column-2" >{item.name}</div>
<div className="column-2">{item.student_id}</div>
</li>
)
})
}
</ul>
</div>
</div>
<style>
{
`
}</style>
<ul>
{
Myschoolstudents === undefined ?
<div className="edu-txt-center color-grey-9 pt50">
<p className="mb20"><img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")} /></p>
<p>学生数据为空请导入数据</p>
</div>
: Myschoolstudents && Myschoolstudents.length === 0 ?
<div className="edu-txt-center color-grey-9 pt50">
<p className="mb20"><img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")} /></p>
<p>学生数据为空请导入数据</p>
</div> : Myschoolstudents && Myschoolstudents.map((item, key) => {
// console.log(item)
return (
<li className="clearfix myslispan" key={key}>
<div className="column-No column-2 relative">
<Checkbox
className={'mr20 changestudents'}
checked={item.istrue === true ? true : false}
key={key}
index={key}
onChange={this.onChangestudent} id={item.student_id}></Checkbox>
{item.index}
</div>
<div className="column-2" >{item.name}</div>
<div className="column-2">{item.student_id}</div>
</li>
)
})
}
</ul>
</div>
</div>
<style>
{
`
.idpagin{
width: 100% !important;
display: flex;
@ -463,27 +470,27 @@ class EcStudentList extends Component {
}
`
}
</style>
<div style={{width:'100%',position: 'relative'}}>
{
majorschoollist&&majorschoollist.students&&majorschoollist.students.length===0?"":
<Pagination className={"pagelistStudentList mt30 idpagin"}
showQuickJumper current={this.state.pages}
onChange={this.showecStudentList} pageSize={20}
total={majorschoollist&&majorschoollist.count}></Pagination>
}
</div>
</Spin>
</div>
</div>
</div>
}
</style>
<div style={{ width: '100%', position: 'relative' }}>
{
majorschoollist && majorschoollist.students && majorschoollist.students.length === 0 ? "" :
<Pagination className={"pagelistStudentList mt30 idpagin"}
showQuickJumper current={this.state.pages}
onChange={this.showecStudentList} pageSize={20}
total={majorschoollist && majorschoollist.count}></Pagination>
}
</div>
</Spin>
</div>
</div>
</div>
)
}
}
export default SnackbarHOC() (EcStudentList);
export default SnackbarHOC()(EcStudentList);

@ -1,20 +1,12 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import { Route, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import Loading from '../../Loading'
import Loadable from 'react-loadable';
import classNames from 'classnames'
import MemoTechShare from './MemoTechShare'
// import MemoGuide from './MemoGuide'
// import MemoNewest from './MemoNewest'
// import MemoHottest from './MemoHottest'
import MemoDetail from './MemoDetail'
import MemoNew from './MemoNew'
@ -22,7 +14,7 @@ import MemoMyPublish from './MemoMyPublish'
import MemoShixun from './shixun/MemoShixun'
import { TPMIndexHOC } from '../tpm/TPMIndexHOC'
import TPMIndexHOC from '../tpm/TPMIndexHOC'
import RightMyPublish from './RightMyPublish'
import UserSection from './UserSection'
@ -32,146 +24,142 @@ import RightMemoLabel from './RightMemoLabel'
import RecommendShixun from './RecommendShixun'
import ForumsNavTab from './ForumsNavTab'
import axios from 'axios'
import 'rc-select/assets/index.css';
import './ForumsIndex.css'
import './RightSection.css'
import { SnackbarHOC, getUrl } from 'educoder'
import { CNotificationHOC } from '../courses/common/CNotificationHOC'
import CNotificationHOC from '../courses/common/CNotificationHOC'
let _url_origin = getUrl()
const $ = window.$
$('head').append( $('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-admin.css?6`) );
$('head').append( $('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-forum.css?1525440977`) );
$('head').append( $('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/magic-check.css?1525440977`) );
setTimeout(()=>{
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-admin.css?6`));
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-forum.css?1525440977`));
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/magic-check.css?1525440977`));
setTimeout(() => {
// 附件上传滚动条 \public\stylesheets\jquery\jquery-ui-1.9.2.css
$('head').append( $('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/jquery/jquery-ui-1.9.2.css`) );
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/jquery/jquery-ui-1.9.2.css`));
}, 1000)
class ForumsIndex extends Component {
constructor(props) {
super(props)
this.state = {
searchValue: '',
enterKeyFlag: false,
showSearchValue: false,
selectedHotLabelIndex: -1,
}
constructor(props) {
super(props)
this.state = {
searchValue: '',
enterKeyFlag: false,
showSearchValue: false,
selectedHotLabelIndex: -1,
}
}
setSearchValue = (searchValue, enterKeyFlag) => {
if (enterKeyFlag === true) {
this.setState({
selectedHotLabelIndex: -1
})
}
setSearchValue = (searchValue, enterKeyFlag) => {
if (enterKeyFlag === true) {
this.setState({
searchValue,
showSearchValue: (enterKeyFlag && searchValue) ? true : false,
enterKeyFlag: enterKeyFlag === true ? !this.state.enterKeyFlag : this.state.enterKeyFlag
selectedHotLabelIndex: -1
})
}
setHotLabelIndex = (index, callback) => {
const newState = {
selectedHotLabelIndex: index,
}
if (index != -1) {
newState.searchValue = ''
newState.showSearchValue = false
}
this.setState({
...newState
}, callback)
}
initForumState(data) {
this.setState({...data})
this.setState({
searchValue,
showSearchValue: (enterKeyFlag && searchValue) ? true : false,
enterKeyFlag: enterKeyFlag === true ? !this.state.enterKeyFlag : this.state.enterKeyFlag
})
}
setHotLabelIndex = (index, callback) => {
const newState = {
selectedHotLabelIndex: index,
}
componentDidMount() {
window.document.title = '交流问答'
if (index != -1) {
newState.searchValue = ''
newState.showSearchValue = false
}
this.setState({
...newState
}, callback)
}
initForumState(data) {
this.setState({ ...data })
}
componentWillReceiveProps(newProps, newContext) {
componentDidMount() {
window.document.title = '交流问答'
}
}
render() {
const { match, history, resLoading } = this.props
const { memo } = this.state;
componentWillReceiveProps(newProps, newContext) {
const techSharePath = `${match.path}/categories/:memoType`
const guidePath = `${match.path}/categories/:memoType`
const hottestPath = `${match.path}/categories/:memoType` // ?order=hottest
const newestPath = `${match.path}/categories/:memoType` // ?order=newest
}
const shixunDiscussPath = `/forums/categories/shixun_discuss`
const locationPath = history.location.pathname
const isWidth100 = (locationPath.indexOf('forums/new') !== -1
|| locationPath.indexOf('/edit') !== -1) ? true : false
render() {
const { match, history, resLoading } = this.props
const { memo } = this.state;
const pathArray = locationPath.split('/');
const isMemoDetail = (!isWidth100 &&
pathArray.length === 3 && !isNaN(parseInt(pathArray[2])) ) ? true : false
const techSharePath = `${match.path}/categories/:memoType`
const guidePath = `${match.path}/categories/:memoType`
const hottestPath = `${match.path}/categories/:memoType` // ?order=hottest
const newestPath = `${match.path}/categories/:memoType` // ?order=newest
const isGuide = locationPath.indexOf('/forums/categories/3') !== -1
const shixunDiscussPath = `/forums/categories/shixun_discuss`
const locationPath = history.location.pathname
return (
<div className="newMain clearfix">
<div className="educontent mt30 clearfix">
{/* component={TechShare}
<ForumsNavTab {...this.props}></ForumsNavTab> */}
<div className={classNames('fl', { with75: !isWidth100}, { width100: isWidth100}) }>
const isWidth100 = (locationPath.indexOf('forums/new') !== -1
|| locationPath.indexOf('/edit') !== -1) ? true : false
<Switch>
<Route path={`/forums/categories/my_published`} render={
(props) => (<MemoMyPublish {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)}
setSearchValue={this.setSearchValue}
setHotLabelIndex={this.setHotLabelIndex}
/>)
}></Route>
<Route path={`${shixunDiscussPath}`} render={
(props) => (<MemoShixun {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)}
setSearchValue={this.setSearchValue}
setHotLabelIndex={this.setHotLabelIndex}
/>)
}></Route>
<Route path={`${techSharePath}`} render={
(props) => (<MemoTechShare {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)}
setSearchValue={this.setSearchValue}
setHotLabelIndex={this.setHotLabelIndex}
/>)
}></Route>
const pathArray = locationPath.split('/');
const isMemoDetail = (!isWidth100 &&
pathArray.length === 3 && !isNaN(parseInt(pathArray[2]))) ? true : false
const isGuide = locationPath.indexOf('/forums/categories/3') !== -1
{/*
return (
<div className="newMain clearfix">
<div className="educontent mt30 clearfix">
{/* component={TechShare}
<ForumsNavTab {...this.props}></ForumsNavTab> */}
<div className={classNames('fl', { with75: !isWidth100 }, { width100: isWidth100 })}>
<Switch>
<Route path={`/forums/categories/my_published`} render={
(props) => (<MemoMyPublish {...this.props} {...this.state} {...props}
initForumState={(data) => this.initForumState(data)}
setSearchValue={this.setSearchValue}
setHotLabelIndex={this.setHotLabelIndex}
/>)
}></Route>
<Route path={`${shixunDiscussPath}`} render={
(props) => (<MemoShixun {...this.props} {...this.state} {...props}
initForumState={(data) => this.initForumState(data)}
setSearchValue={this.setSearchValue}
setHotLabelIndex={this.setHotLabelIndex}
/>)
}></Route>
<Route path={`${techSharePath}`} render={
(props) => (<MemoTechShare {...this.props} {...this.state} {...props}
initForumState={(data) => this.initForumState(data)}
setSearchValue={this.setSearchValue}
setHotLabelIndex={this.setHotLabelIndex}
/>)
}></Route>
{/*
<Route path={`${guidePath}`} render={
(props) => (<MemoGuide {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)} />)
@ -185,71 +173,71 @@ class ForumsIndex extends Component {
initForumState={(data)=>this.initForumState(data)} />)
}></Route> */}
{/* :forumTypeId/ */}
<Route path={`/forums/new`} render={
(props) => (<MemoNew {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)}
/>)
}></Route>
{/* :forumTypeId/ */}
<Route path={`/forums/new`} render={
(props) => (<MemoNew {...this.props} {...this.state} {...props}
initForumState={(data) => this.initForumState(data)}
/>)
}></Route>
<Route path={`/forums/:memoId/edit`} render={
(props) => (<MemoNew {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)}
/>)
}></Route>
<Route path={`/forums/:memoId/edit`} render={
(props) => (<MemoNew {...this.props} {...this.state} {...props}
initForumState={(data) => this.initForumState(data)}
/>)
}></Route>
<Route path={`${match.path}/:memoId`} render={
(props) => (<MemoDetail {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)}
/>)
}></Route>
<Route path={`${match.path}/:memoId`} render={
(props) => (<MemoDetail {...this.props} {...this.state} {...props}
initForumState={(data) => this.initForumState(data)}
/>)
}></Route>
<Redirect from={`${match.url}`} to={`/forums/categories/all?order=newest`} />
</Switch>
<Redirect from={`${match.url}`} to={`/forums/categories/all?order=newest`} />
</Switch>
</div>
</div>
{/* 右边栏 */}
{ !isWidth100 && <div className="with25 fl">
<div className="ml20">
{isMemoDetail ?
<React.Fragment>
<UserSection {...this.props} {...this.state} initForumState={(data)=>this.initForumState(data)} ></UserSection>
{/*todo 新增RightMemoLabel 和 推荐实训RecommendShixun */}
{ memo && memo.tag && <RightMemoLabel {...this.props} {...this.state}></RightMemoLabel> }
<RecommendShixun {...this.props} {...this.state}></RecommendShixun>
</React.Fragment>
:
<React.Fragment>
<RightMyPublish {...this.props} {...this.state} setSearchValue={this.setSearchValue}></RightMyPublish>
{ !isGuide && <RightHotLabel {...this.props} {...this.state} ></RightHotLabel> }
<RightHotQuestion {...this.props} {...this.state} ></RightHotQuestion>
<RecommendShixun {...this.props} {...this.state}></RecommendShixun>
</React.Fragment>
}
{/* 右边栏 */}
{!isWidth100 && <div className="with25 fl">
<div className="ml20">
{isMemoDetail ?
<React.Fragment>
<UserSection {...this.props} {...this.state} initForumState={(data) => this.initForumState(data)} ></UserSection>
{/*todo 新增RightMemoLabel 和 推荐实训RecommendShixun */}
{memo && memo.tag && <RightMemoLabel {...this.props} {...this.state}></RightMemoLabel>}
<RecommendShixun {...this.props} {...this.state}></RecommendShixun>
</React.Fragment>
:
<React.Fragment>
<RightMyPublish {...this.props} {...this.state} setSearchValue={this.setSearchValue}></RightMyPublish>
{!isGuide && <RightHotLabel {...this.props} {...this.state} ></RightHotLabel>}
<RightHotQuestion {...this.props} {...this.state} ></RightHotQuestion>
<RecommendShixun {...this.props} {...this.state}></RecommendShixun>
</React.Fragment>
}
</div>
</div>
}
</div>
}
</div>
);
}
</div>
);
}
}
export default CNotificationHOC() (SnackbarHOC() ( TPMIndexHOC ( ForumsIndex ) ));
export default CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(ForumsIndex)));
/*
:

@ -1,11 +1,7 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import { Link } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames'
import axios from 'axios'
@ -17,17 +13,16 @@ import update from 'immutability-helper'
// import Tooltip from '@material-ui/core/Tooltip';
import RewardDialog from '../common/RewardDialog';
import { ImageLayerOfCommentHOC } from '../page/layers/ImageLayerOfCommentHOC'
import ImageLayerOfCommentHOC from '../page/layers/ImageLayerOfCommentHOC'
import MemoDetailKEEditor from './MemoDetailKEEditor'
import MemoDetailMDEditor from './MemoDetailMDEditor'
import { bytesToSize, CBreadcrumb, htmlEncode } from 'educoder'
import { CBreadcrumb, htmlEncode } from 'educoder'
import { Tooltip } from 'antd'
// import CBreadcrumb from '../courses/common/CBreadcrumb'
import { typeNameMap2 } from './MemoNew'
import CaseDetail from "../moop_cases/CaseDetail";
const $ = window.$
function urlStringify(params) {
let noParams = true;

@ -1,28 +1,15 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames'
import Pagination from 'rc-pagination';
import {getImageUrl, toPath} from 'educoder';
import { postPaginationHOC } from './PostPaginationHOC'
import PostItem from './PostItem'
import ForumsNavTab from './ForumsNavTab'
import { getImageUrl } from 'educoder';
import { queryString, ThemeContext } from 'educoder'
import { ThemeContext } from 'educoder'
class MemoList extends Component {
render() {
const { match, history, currentPage, memo_count ,memo_list, renderMemoList, onPaginationChange } = this.props
const { match, history, currentPage, memo_count, memo_list, renderMemoList, onPaginationChange } = this.props
let theme = this.context;
return (
@ -36,7 +23,7 @@ class MemoList extends Component {
<div className="mh650 edu-back-white">
{!memo_list || memo_list.length === 0 ?
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")} />
<p className="edu-nodata-p mb30">暂时还没有相关数据哦</p>
</div>
: renderMemoList()
@ -44,12 +31,12 @@ class MemoList extends Component {
</div>
</div>
{ !!memo_count && memo_count > 15 &&
<div style={{ width: '100%', background: '#FAFAFA'}}>
<Pagination className={'ec-pagination'}
onChange={(pageNum, pageSize) => onPaginationChange(pageNum, pageSize)}
showQuickJumper current={currentPage} total={memo_count} pageSize={15}/>
</div> }
{!!memo_count && memo_count > 15 &&
<div style={{ width: '100%', background: '#FAFAFA' }}>
<Pagination className={'ec-pagination'}
onChange={(pageNum, pageSize) => onPaginationChange(pageNum, pageSize)}
showQuickJumper current={currentPage} total={memo_count} pageSize={15} />
</div>}
</React.Fragment>
);
@ -57,4 +44,4 @@ class MemoList extends Component {
}
MemoList.contextType = ThemeContext;
export default ( MemoList );
export default (MemoList);

@ -1,73 +1,62 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import { Link } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames'
import postPaginationHOC from './PostPaginationHOC'
import Pagination from 'rc-pagination';
import { postPaginationHOC } from './PostPaginationHOC'
import PostItem from './PostItem'
import ForumsNavTab from './ForumsNavTab'
// import queryString from 'query-string'
import { queryString } from 'educoder'
import MemoList from './MemoList'
class MemoMyPublish extends Component {
constructor(props) {
super(props)
constructor(props) {
super(props)
this.state = {
this.state = {
}
}
}
onPaginationChange(pageNum, pageSize) {
this.props.onPaginationChange(pageNum, pageSize)
}
onPaginationChange(pageNum, pageSize) {
this.props.onPaginationChange(pageNum, pageSize)
}
componentDidMount() {
componentDidMount() {
}
}
componentWillUnmount() {
componentWillUnmount() {
}
componentWillReceiveProps(newProps, newContext) {
}
componentWillReceiveProps(newProps, newContext) {
}
renderMemoList() {
}
renderMemoList() {
return this.props.renderMemoList();
}
return this.props.renderMemoList();
}
render() {
const { match, history, currentPage, memo_count, memo_list } = this.props
render() {
const { match, history, currentPage, memo_count, memo_list } = this.props
return (
<React.Fragment>
return (
<React.Fragment>
<div className="discuss-tab bor-bottom-greyE clearfix pr boxsizing">
<p className="_forum_tab pl20 pr20 clearfix boxsizing" style={{fontSize:'18px', color:'rgba(5,16,26,1)'}}>
我的发布
<p className="_forum_tab pl20 pr20 clearfix boxsizing" style={{ fontSize: '18px', color: 'rgba(5,16,26,1)' }}>
我的发布
<Link className="returnBtnA fr mr10" to={`/forums`}><span className="color-grey-9 font-16">返回</span></Link>
</p>
</div>
</p>
</div>
<MemoList {...this.props} renderMemoList={() => this.renderMemoList()}
onPaginationChange={ (pageNum, pageSize) => this.props.onPaginationChange(pageNum, pageSize) }
onPaginationChange={(pageNum, pageSize) => this.props.onPaginationChange(pageNum, pageSize)}
>
</MemoList>
</React.Fragment>
</React.Fragment>
);
}
);
}
}
export default postPaginationHOC({ isMyPublish: true }) ( MemoMyPublish );
export default postPaginationHOC({ isMyPublish: true })(MemoMyPublish);

@ -1,65 +1,56 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames'
import Pagination from 'rc-pagination';
import { postPaginationHOC } from './PostPaginationHOC'
import PostItem from './PostItem'
import postPaginationHOC from './PostPaginationHOC'
import ForumsNavTab from './ForumsNavTab'
class MemoGuide extends Component {
constructor(props) {
super(props)
constructor(props) {
super(props)
this.state = {
this.state = {
}
}
onPaginationChange(pageNum, pageSize) {
this.props.onPaginationChange(pageNum, pageSize)
}
renderMemoList() {
// const { memo_list, user } = this.props;
// if (!memo_list) {
// return ''
// }
// return memo_list.map( (item, index) => {
// return (
// <PostItem key={item.id} memo={item} user={user} index={index} {...this.props}></PostItem>
// )
// })
return this.props.renderMemoList();
}
render() {
const { match, history, currentPage, memo_count } = this.props
return (
<React.Fragment>
}
onPaginationChange(pageNum, pageSize) {
this.props.onPaginationChange(pageNum, pageSize)
}
renderMemoList() {
// const { memo_list, user } = this.props;
// if (!memo_list) {
// return ''
// }
// return memo_list.map( (item, index) => {
// return (
// <PostItem key={item.id} memo={item} user={user} index={index} {...this.props}></PostItem>
// )
// })
return this.props.renderMemoList();
}
render() {
const { match, history, currentPage, memo_count } = this.props
return (
<React.Fragment>
<ForumsNavTab {...this.props}></ForumsNavTab>
<div id="forum_list" className="forum_table mh650">
<div id="forum_list" className="forum_table mh650">
{this.renderMemoList()}
{ !!memo_count && <Pagination onChange={(pageNum, pageSize) => this.onPaginationChange(pageNum, pageSize)}
showQuickJumper current={currentPage} total={memo_count} pageSize={15}/> }
{!!memo_count && <Pagination onChange={(pageNum, pageSize) => this.onPaginationChange(pageNum, pageSize)}
showQuickJumper current={currentPage} total={memo_count} pageSize={15} />}
</div>
</React.Fragment>
</React.Fragment>
);
}
);
}
}
export default postPaginationHOC( MemoGuide );
export default postPaginationHOC(MemoGuide);

@ -1,84 +1,74 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames'
import Pagination from 'rc-pagination';
import { postPaginationHOC } from './PostPaginationHOC'
import PostItem from './PostItem'
import postPaginationHOC from './PostPaginationHOC'
import ForumsNavTab from './ForumsNavTab'
class MemoHottest extends Component {
constructor(props) {
super(props)
constructor(props) {
super(props)
this.handleLocationChange = this.handleLocationChange.bind(this);
this.handleLocationChange = this.handleLocationChange.bind(this);
this.state = {
this.state = {
}
}
}
onPaginationChange(pageNum, pageSize) {
onPaginationChange(pageNum, pageSize) {
this.props.onPaginationChange(pageNum, pageSize)
}
this.props.onPaginationChange(pageNum, pageSize)
}
componentDidMount() {
// this.handleLocationChange(this.props.history.location);
this.unlisten = this.props.history.listen(this.handleLocationChange);
}
componentDidMount() {
// this.handleLocationChange(this.props.history.location);
this.unlisten = this.props.history.listen(this.handleLocationChange);
}
componentWillUnmount() {
this.unlisten();
}
handleLocationChange(location) {
// your staff here
console.log(`- - - location: '${location.pathname}'`);
if (location.pathname && location.pathname.indexOf('/forums/categories/all') != -1
&& this.locationSearch != location.search) {
this.props.fetchMemos();
}
this.locationSearch = location.search;
}
componentWillUnmount() {
this.unlisten();
}
renderMemoList() {
// const { memo_list, user } = this.props;
// if (!memo_list) {
// return ''
// }
// return memo_list.map( (item, index) => {
// return (
// <PostItem key={item.id} memo={item} user={user} index={index} {...this.props}></PostItem>
// )
// })
return this.props.renderMemoList();
handleLocationChange(location) {
// your staff here
console.log(`- - - location: '${location.pathname}'`);
if (location.pathname && location.pathname.indexOf('/forums/categories/all') != -1
&& this.locationSearch != location.search) {
this.props.fetchMemos();
}
render() {
const { match, history, currentPage, memo_count } = this.props
return (
<React.Fragment>
<ForumsNavTab {...this.props}></ForumsNavTab>
<div id="forum_list" className="forum_table mh650">
{this.renderMemoList()}
{ !!memo_count && <Pagination onChange={(pageNum, pageSize) => this.onPaginationChange(pageNum, pageSize)}
showQuickJumper current={currentPage} total={memo_count} pageSize={15}/> }
</div>
</React.Fragment>
);
}
this.locationSearch = location.search;
}
renderMemoList() {
// const { memo_list, user } = this.props;
// if (!memo_list) {
// return ''
// }
// return memo_list.map( (item, index) => {
// return (
// <PostItem key={item.id} memo={item} user={user} index={index} {...this.props}></PostItem>
// )
// })
return this.props.renderMemoList();
}
render() {
const { match, history, currentPage, memo_count } = this.props
return (
<React.Fragment>
<ForumsNavTab {...this.props}></ForumsNavTab>
<div id="forum_list" className="forum_table mh650">
{this.renderMemoList()}
{!!memo_count && <Pagination onChange={(pageNum, pageSize) => this.onPaginationChange(pageNum, pageSize)}
showQuickJumper current={currentPage} total={memo_count} pageSize={15} />}
</div>
</React.Fragment>
);
}
}
export default postPaginationHOC( MemoHottest );
export default postPaginationHOC(MemoHottest);

@ -1,63 +1,53 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames'
import Pagination from 'rc-pagination';
import { postPaginationHOC } from './PostPaginationHOC'
import PostItem from './PostItem'
import postPaginationHOC from './PostPaginationHOC'
import ForumsNavTab from './ForumsNavTab'
class MemoNewest extends Component {
constructor(props) {
super(props)
this.state = {
}
}
onPaginationChange(pageNum, pageSize) {
this.props.onPaginationChange(pageNum, pageSize)
}
constructor(props) {
super(props)
this.state = {
renderMemoList() {
// const { memo_list, user } = this.props;
// if (!memo_list) {
// return ''
// }
// return memo_list.map( (item, index) => {
// return (
// <PostItem key={item.id} memo={item} user={user} index={index} {...this.props}></PostItem>
// )
// })
return this.props.renderMemoList();
}
render() {
const { match, history, currentPage, memo_count } = this.props
return (
<React.Fragment>
<ForumsNavTab {...this.props}></ForumsNavTab>
<div id="forum_list" className="forum_table mh650">
{this.renderMemoList()}
{ !!memo_count && <Pagination onChange={(pageNum, pageSize) => this.onPaginationChange(pageNum, pageSize)}
showQuickJumper current={currentPage} total={memo_count} pageSize={15}/> }
</div>
</React.Fragment>
);
}
}
onPaginationChange(pageNum, pageSize) {
this.props.onPaginationChange(pageNum, pageSize)
}
renderMemoList() {
// const { memo_list, user } = this.props;
// if (!memo_list) {
// return ''
// }
// return memo_list.map( (item, index) => {
// return (
// <PostItem key={item.id} memo={item} user={user} index={index} {...this.props}></PostItem>
// )
// })
return this.props.renderMemoList();
}
render() {
const { match, history, currentPage, memo_count } = this.props
return (
<React.Fragment>
<ForumsNavTab {...this.props}></ForumsNavTab>
<div id="forum_list" className="forum_table mh650">
{this.renderMemoList()}
{!!memo_count && <Pagination onChange={(pageNum, pageSize) => this.onPaginationChange(pageNum, pageSize)}
showQuickJumper current={currentPage} total={memo_count} pageSize={15} />}
</div>
</React.Fragment>
);
}
}
export default postPaginationHOC( MemoNewest );
export default postPaginationHOC(MemoNewest);

@ -1,116 +1,104 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames'
import Pagination from 'rc-pagination';
import { postPaginationHOC } from './PostPaginationHOC'
import PostItem from './PostItem'
import postPaginationHOC from './PostPaginationHOC'
import ForumsNavTab from './ForumsNavTab'
// import queryString from 'query-string'
import { queryString } from 'educoder'
import { queryString } from 'educoder'
import MemoList from './MemoList'
class MemoTechShare extends Component {
constructor(props) {
super(props)
this.handleLocationChange = this.handleLocationChange.bind(this);
constructor(props) {
super(props)
this.state = {
this.handleLocationChange = this.handleLocationChange.bind(this);
}
}
onPaginationChange(pageNum, pageSize) {
this.props.onPaginationChange(pageNum, pageSize)
}
this.state = {
componentDidMount() {
// this.handleLocationChange(this.props.history.location);
// this.unlisten = this.props.history.listen(this.handleLocationChange);
}
componentWillUnmount() {
// this.unlisten();
}
onPaginationChange(pageNum, pageSize) {
this.props.onPaginationChange(pageNum, pageSize)
}
componentDidMount() {
// this.handleLocationChange(this.props.history.location);
// this.unlisten = this.props.history.listen(this.handleLocationChange);
}
componentWillUnmount() {
// this.unlisten();
}
componentDidUpdate(prevProps) {
if (this.props.match.params.memoType !== prevProps.match.params.memoType) {
// do something
console.log(`memoType changed`)
this.props.fetchMemos();
}
componentDidUpdate(prevProps) {
if(this.props.match.params.memoType !== prevProps.match.params.memoType) {
// do something
console.log(`memoType changed`)
this.props.fetchMemos();
}
}
componentWillReceiveProps(newProps, newContext) {
if (newProps.match.url === this.props.match.url) {
const oldParsed = queryString.parse(this.props.location.search);
const newParsed = queryString.parse(newProps.location.search);
if (!newParsed.page && oldParsed.page ||
(oldParsed.order && newParsed.order && oldParsed.order != newParsed.order)) {
this.props.fetchMemos();
}
// console.log('componentWillReceiveProps...')
}
componentWillReceiveProps(newProps, newContext) {
if (newProps.match.url === this.props.match.url) {
}
handleLocationChange(location) {
console.log(`- - - location: '${location.pathname}'`);
if (location.pathname) {
if (location.pathname.indexOf('/forums/categories/all') != -1
&& this.props.location.search && this.props.location.search.indexOf('order=') != -1
&& location.search.indexOf('order=') != -1) {
const oldParsed = queryString.parse(this.props.location.search);
const newParsed = queryString.parse(newProps.location.search);
if (!newParsed.page && oldParsed.page ||
(oldParsed.order && newParsed.order && oldParsed.order != newParsed.order)) {
const newParsed = queryString.parse(location.search);
if (oldParsed.order != newParsed.order) { // 只有在热门和最新间跳转时,才需要处理
this.props.fetchMemos();
}
// console.log('componentWillReceiveProps...')
}
}
handleLocationChange(location) {
console.log(`- - - location: '${location.pathname}'`);
if (location.pathname) {
if (location.pathname.indexOf('/forums/categories/all') != -1
&& this.props.location.search && this.props.location.search.indexOf('order=') != -1
&& location.search.indexOf('order=') != -1) {
const oldParsed = queryString.parse(this.props.location.search);
const newParsed = queryString.parse(location.search);
if (oldParsed.order != newParsed.order) { // 只有在热门和最新间跳转时,才需要处理
this.props.fetchMemos();
}
}
}
}
renderMemoList() {
// const { memo_list, user } = this.props;
// if (!memo_list) {
// return ''
// }
// return memo_list.map( (item, index) => {
// return (
// <PostItem key={item.id} user={user} index={index} {...this.props}
// setTop={(memo)=>this.setTop(memo)}
// setDown={(memo)=>this.setDown(memo)} memo={item}
// ></PostItem>
// )
// })
return this.props.renderMemoList();
}
render() {
const { match, history, currentPage, memo_count ,memo_list } = this.props
return (
<React.Fragment>
<ForumsNavTab {...this.props}></ForumsNavTab>
<MemoList {...this.props} renderMemoList={() => this.renderMemoList()}
onPaginationChange={ (pageNum, pageSize) => this.props.onPaginationChange(pageNum, pageSize) }
>
</MemoList>
</React.Fragment>
);
}
}
renderMemoList() {
// const { memo_list, user } = this.props;
// if (!memo_list) {
// return ''
// }
// return memo_list.map( (item, index) => {
// return (
// <PostItem key={item.id} user={user} index={index} {...this.props}
// setTop={(memo)=>this.setTop(memo)}
// setDown={(memo)=>this.setDown(memo)} memo={item}
// ></PostItem>
// )
// })
return this.props.renderMemoList();
}
render() {
const { match, history, currentPage, memo_count, memo_list } = this.props
return (
<React.Fragment>
<ForumsNavTab {...this.props}></ForumsNavTab>
<MemoList {...this.props} renderMemoList={() => this.renderMemoList()}
onPaginationChange={(pageNum, pageSize) => this.props.onPaginationChange(pageNum, pageSize)}
>
</MemoList>
</React.Fragment>
);
}
}
export default postPaginationHOC() ( MemoTechShare );
export default postPaginationHOC()(MemoTechShare);

@ -7,7 +7,7 @@ import { SnackbarHOC } from 'educoder';
import './Help.css';
import CustomLoadable from "../../CustomLoadable";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import TPMIndexHOC from "../tpm/TPMIndexHOC";
const AboutUs = CustomLoadable(() => import('./AboutUs'));
const ContactUs = CustomLoadable(() => import('./ContactUs'));
@ -17,7 +17,7 @@ const HelpCenter = CustomLoadable(() => import('./HelpCenter'));
const Feedback = CustomLoadable(() => import('./Feedback'));
class Help extends React.Component {
constructor (props) {
constructor(props) {
super(props);
this.state = {
@ -26,7 +26,7 @@ class Help extends React.Component {
}
componentDidUpdate(prevProps) {
if(prevProps.match.params.type !== this.props.match.params.type){
if (prevProps.match.params.type !== this.props.match.params.type) {
this.setState({ type: this.props.match.params.type });
}
}
@ -61,8 +61,8 @@ class Help extends React.Component {
<Route path='/help/cooperatives' component={Cooperatives}></Route>
<Route path='/help/agreement' component={Agreement}></Route>
<Route path='/help/help_center' component={HelpCenter}></Route>
<Route path='/help/feedback' render={ (props)=>(<Feedback {...this.props} {...props} {...this.state}></Feedback>) }></Route>
<Route component={AboutUs}/>
<Route path='/help/feedback' render={(props) => (<Feedback {...this.props} {...props} {...this.state}></Feedback>)}></Route>
<Route component={AboutUs} />
</Switch>
</div>
</Col>
@ -73,4 +73,4 @@ class Help extends React.Component {
}
}
export default SnackbarHOC() (TPMIndexHOC ( Help ));
export default SnackbarHOC()(TPMIndexHOC(Help));

@ -5,7 +5,7 @@ import { Link } from "react-router-dom";
import axios from 'axios';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import TPMIndexHOC from '../tpm/TPMIndexHOC';
import UpgradeModals from '../modals/UpgradeModals';

@ -1,11 +1,9 @@
import React, { Component } from 'react';
import {Input,Pagination,Tooltip} from 'antd';
import {TPMIndexHOC} from "../../../modules/tpm/TPMIndexHOC";
import { WordsBtn ,ActionBtn,SnackbarHOC,markdownToHTML,getImageUrl} from 'educoder';
import TPMIndexHOC from "../../../modules/tpm/TPMIndexHOC";
import { SnackbarHOC, getImageUrl } from 'educoder';
import axios from 'axios';
import "../css/messagemy.css"
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import { Route, Switch } from "react-router-dom";
import Loading from '../../../Loading'
import Loadable from 'react-loadable';
@ -25,20 +23,20 @@ const MessagChat = Loadable({
loader: () => import('./MessagChat'),
loading: Loading,
})
class Messagerouting extends Component{
class Messagerouting extends Component {
constructor(props) {
super(props);
this.state={
routing:1,
unread_message_count:0,
unread_tiding_count:0,
this.state = {
routing: 1,
unread_message_count: 0,
unread_tiding_count: 0,
}
}
componentDidMount(){
componentDidMount() {
// console.log("Messagerouting");
// console.log(this.props);
// let courstype=this.props.location.search;
// let courstype=this.props.location.search;
// // courstype=courstype.splice('/');
// // courstype=courstype[3];
// // console.log("45");
@ -54,207 +52,207 @@ class Messagerouting extends Component{
// console.log("22222222222");
// console.log(this.props);
// console.log("33333333333");
if(prevProps.current_user !== this.props.current_user){
this.Messageprivatemessageunreadmessage(this.props.current_user.login);
// console.log("Messagerouting59");
// console.log(this.props.current_user);
}
if (prevProps.current_user !== this.props.current_user) {
this.Messageprivatemessageunreadmessage(this.props.current_user.login);
// console.log("Messagerouting59");
// console.log(this.props.current_user);
}
}
//消息未读
Messageprivatemessageunreadmessage=(user_id)=>{
const url=`/users/${user_id}/unread_message_info.json`
Messageprivatemessageunreadmessage = (user_id) => {
const url = `/users/${user_id}/unread_message_info.json`
axios.get(url).then((result) => {
if(result===undefined){
if (result === undefined) {
return
}
// console.log("消息未读1");
// console.log(result);
this.setState({
unread_message_count:result.data.unread_message_count,
unread_tiding_count:result.data.unread_tiding_count,
unread_message_count: result.data.unread_message_count,
unread_tiding_count: result.data.unread_tiding_count,
})
}).catch((error) => {
console.log(error)
})
};
SwitchonClick=(value,child)=>{
this.setState({
routing:value,
});
this.Messageprivatemessageunreadmessage(this.props.current_user.login);
if(value===1){
this.props.history.replace(`/messages/${this.props.current_user.login}/user_tidings`);
this.homeworkendss1(child);
}
if(value===2){
this.props.history.replace(`/messages/${this.props.current_user.login}/private_messages`);
this.homeworkendss2(child);
}
SwitchonClick = (value, child) => {
this.setState({
routing: value,
});
this.Messageprivatemessageunreadmessage(this.props.current_user.login);
if (value === 1) {
this.props.history.replace(`/messages/${this.props.current_user.login}/user_tidings`);
this.homeworkendss1(child);
}
if (value === 2) {
this.props.history.replace(`/messages/${this.props.current_user.login}/private_messages`);
this.homeworkendss2(child);
}
};
Message2=(data)=>{
Message2 = (data) => {
// console.log("64");
// console.log(data);
this.setState({
unread_message_count:parseInt(data.unread_message_count),
unread_tiding_count:parseInt(data.unread_tiding_count),
unread_message_count: parseInt(data.unread_message_count),
unread_tiding_count: parseInt(data.unread_tiding_count),
})
};
//跳转到链接
Modifyur=(i,id)=>{
Modifyur = (i, id) => {
// console.log("跳转到链接1");
// console.log(i);
// console.log(item);
// console.log("跳转到链接2");
if(i<3){
if (i < 3) {
this.setState({
routing:i,
routing: i,
});
if(i===1){
if (i === 1) {
this.props.history.replace(`/messages/${this.props.current_user.login}/user_tidings`);
}
if(i===2){
if (i === 2) {
this.props.history.replace(`/messages/${this.props.current_user.login}/private_messages`);
}
}else {
} else {
this.setState({
routing:i,
routing: i,
});
console.log("22222222222");
this.props.history.replace(`/messages/${this.props.current_user.login}/message_detail?target_ids=${id}`);
}
};
myCome=(e)=>{
window.location.href="/users/"+e.target.login;
myCome = (e) => {
window.location.href = "/users/" + e.target.login;
}
myxiaoxisixintab=(i)=>{
if(i===1){
myxiaoxisixintab = (i) => {
if (i === 1) {
this.setState({
routing:1,
routing: 1,
});
}
if(i===2){
if (i === 2) {
this.setState({
routing:2,
routing: 2,
});
}
if(i===3){
if (i === 3) {
this.setState({
routing:3,
routing: 3,
});
}
};
bindRef = ref => { this.child = ref };
homeworkendss1(child){
homeworkendss1(child) {
// console.log(child);
// // console.log(this.refs.childModel);
// console.log(child);
try {
child.getdatas();
}catch (e) {
} catch (e) {
}
//
}
homeworkendss2(child){
homeworkendss2(child) {
// console.log(child);
// // console.log(this.refs.childModel);
// console.log(child);
try {
child.getdatas2();
}catch (e) {
} catch (e) {
}
//
}
render() {
let{routing,unread_message_count,unread_tiding_count} =this.state;
let { routing, unread_message_count, unread_tiding_count } = this.state;
// console.log(this.props);
// console.log(routing);
return (
<div className="newMain clearfix">
<div className="educontent mt20 mb80 clearfix">
{/*左边*/}
<div className="leftPanel">
{/*头像*/}
<div className="mb20 edu-back-white pt40 pb40 edu-txt-center">
<a >
{
this.props.current_user!== undefined?
<img className="person radius myw120 myh120" src={getImageUrl("images/"+this.props.current_user.image_url)}/>
:""
}
<div className="educontent mt20 mb80 clearfix">
{/*左边*/}
<div className="leftPanel">
{/*头像*/}
<div className="mb20 edu-back-white pt40 pb40 edu-txt-center">
<a >
{
this.props.current_user !== undefined ?
<img className="person radius myw120 myh120" src={getImageUrl("images/" + this.props.current_user.image_url)} />
: ""
}
</a>
<p className="font-24 lineh-25 mt10" >{this.props.current_user&&this.props.current_user.username}</p>
<p className="color-grey-6 mt5" >{this.props.current_user&&this.props.current_user.user_identity}</p>
</div>
{/*路由跳转*/}
<ul className="edu-back-white">
<li className={routing ===1?"nav pr active":"nav pr"}>
<a onClick={(value,child)=>this.SwitchonClick(1,this.child)}>消息</a>
{unread_tiding_count===0?"":unread_tiding_count>0?<span className="new-info">{unread_tiding_count}</span>:""}
</a>
<p className="font-24 lineh-25 mt10" >{this.props.current_user && this.props.current_user.username}</p>
<p className="color-grey-6 mt5" >{this.props.current_user && this.props.current_user.user_identity}</p>
</div>
{/*路由跳转*/}
<ul className="edu-back-white">
<li className={routing === 1 ? "nav pr active" : "nav pr"}>
<a onClick={(value, child) => this.SwitchonClick(1, this.child)}>消息</a>
{unread_tiding_count === 0 ? "" : unread_tiding_count > 0 ? <span className="new-info">{unread_tiding_count}</span> : ""}
</li>
<li className={routing ===2?"nav pr active":routing ===3?"nav pr active":"nav pr"}>
<a onClick={(value,child)=>this.SwitchonClick(2,this.child)}>私信</a>
{unread_message_count===0?"":unread_message_count>0?<span className="new-info">{unread_message_count}</span>:""}
<li className={routing === 2 ? "nav pr active" : routing === 3 ? "nav pr active" : "nav pr"}>
<a onClick={(value, child) => this.SwitchonClick(2, this.child)}>私信</a>
{unread_message_count === 0 ? "" : unread_message_count > 0 ? <span className="new-info">{unread_message_count}</span> : ""}
</li>
</ul>
</div>
</div>
{/*右边*/}
<div className="rightPanel">
<div className="clearfix">
{/*/!*消息自路由*!/*/}
{/*{routing===1?<MessagSub {...this.state} {...this.props} Message2={()=>this.Message2()}></MessagSub> :""}*/}
{/*右边*/}
<div className="rightPanel">
<div className="clearfix">
{/*/!*消息自路由*!/*/}
{/*{routing===1?<MessagSub {...this.state} {...this.props} Message2={()=>this.Message2()}></MessagSub> :""}*/}
{/*/!*私信*!/*/}
{/*{routing===2?<MessagePrivate {...this.state} {...this.props} Message2={()=>this.Message2()} Modifyur={(i,item)=>this.Modifyur(i,item)}></MessagePrivate> :""}*/}
{/*/!*私信*!/*/}
{/*{routing===2?<MessagePrivate {...this.state} {...this.props} Message2={()=>this.Message2()} Modifyur={(i,item)=>this.Modifyur(i,item)}></MessagePrivate> :""}*/}
{/*/!*私信聊天页面*!/*/}
{/*{routing===3?<MessagChat {...this.state} {...this.props} Message2={()=>this.Message2()} Modifyur={(i)=>this.Modifyur(i)}></MessagChat>:""}*/}
{/*/!*私信聊天页面*!/*/}
{/*{routing===3?<MessagChat {...this.state} {...this.props} Message2={()=>this.Message2()} Modifyur={(i)=>this.Modifyur(i)}></MessagChat>:""}*/}
<Switch>
{/*/!*消息自路由*! name 是 /message/info/:userid/*/}
<Route path="/messages/:userid/user_tidings"
render={
(props) => (<MessagSub triggerRef={this.bindRef} {...this.state} {...this.props} {...props} Message2={()=>this.Message2()} Mtab={(i)=>this.myxiaoxisixintab(i)}></MessagSub>)
}
></Route>
{/*/!*私信*! name 是letter/*/}
<Route path="/messages/:userid/private_messages"
render={
(props) => (<MessagePrivate triggerRef={this.bindRef} {...this.state} {...this.props} {...props} Message2={()=>this.Message2()} Modifyur={(i,item)=>this.Modifyur(i,item)} Mtab={(i)=>this.myxiaoxisixintab(i)}></MessagePrivate> )
}
></Route>
{/*/!*私信聊天页面*! letters/*/}
<Route path="/messages/:userid/message_detail"
render={
(props) => (<MessagChat triggerRef={this.bindRef} {...this.state} {...this.props} {...props} Message2={()=>this.Message2()} Modifyur={(i)=>this.Modifyur(i)} Mtab={(i)=>this.myxiaoxisixintab(i)}></MessagChat>)
}
></Route>
<Switch>
{/*/!*消息自路由*! name 是 /message/info/:userid/*/}
<Route path="/messages/:userid/user_tidings"
render={
(props) => (<MessagSub triggerRef={this.bindRef} {...this.state} {...this.props} {...props} Message2={() => this.Message2()} Mtab={(i) => this.myxiaoxisixintab(i)}></MessagSub>)
}
></Route>
{/*/!*私信*! name 是letter/*/}
<Route path="/messages/:userid/private_messages"
render={
(props) => (<MessagePrivate triggerRef={this.bindRef} {...this.state} {...this.props} {...props} Message2={() => this.Message2()} Modifyur={(i, item) => this.Modifyur(i, item)} Mtab={(i) => this.myxiaoxisixintab(i)}></MessagePrivate>)
}
></Route>
{/*/!*私信聊天页面*! letters/*/}
<Route path="/messages/:userid/message_detail"
render={
(props) => (<MessagChat triggerRef={this.bindRef} {...this.state} {...this.props} {...props} Message2={() => this.Message2()} Modifyur={(i) => this.Modifyur(i)} Mtab={(i) => this.myxiaoxisixintab(i)}></MessagChat>)
}
></Route>
</Switch>
</Switch>
</div>
</div>
</div>
</div>
</div>
</div>
)
}
}
export default SnackbarHOC() (TPMIndexHOC ( Messagerouting ));
export default SnackbarHOC()(TPMIndexHOC(Messagerouting));

@ -1,97 +1,97 @@
import React,{ Component } from "react";
import React, { Component } from "react";
import './css/moopCases.css'
import '../courses/css/Courses.css'
import { SnackbarHOC } from 'educoder';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../courses/common/CNotificationHOC'
import TPMIndexHOC from '../tpm/TPMIndexHOC';
import CNotificationHOC from '../courses/common/CNotificationHOC'
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import { Route, Switch } from 'react-router-dom';
import Loading from '../../Loading';
import Loadable from 'react-loadable';
import axios from 'axios';
const CaseList = Loadable({
loader: () => import('./CaseList'),
loading:Loading,
loader: () => import('./CaseList'),
loading: Loading,
})
const CaseDetail = Loadable({
loader: () => import('./CaseDetail'),
loading:Loading,
loader: () => import('./CaseDetail'),
loading: Loading,
})
const CaseNew = Loadable({
loader: () => import('./CaseNew'),
loading:Loading,
loader: () => import('./CaseNew'),
loading: Loading,
})
const CaseSuccess = Loadable({
loader: () => import('./Success'),
loading:Loading,
loader: () => import('./Success'),
loading: Loading,
})
class Index extends Component{
constructor(props){
class Index extends Component {
constructor(props) {
super(props);
this.state={
praise_count:0,
CaseDetail:undefined,
cover:undefined,
creator:undefined,
operation:undefined,
tags:undefined,
attachments:undefined,
user_praised:true,
this.state = {
praise_count: 0,
CaseDetail: undefined,
cover: undefined,
creator: undefined,
operation: undefined,
tags: undefined,
attachments: undefined,
user_praised: true,
}
}
componentDidMount(){
componentDidMount() {
}
// 获取案例详情
getDetail = (caseID) =>{
let url=`/libraries/${caseID}.json`
axios.get(url).then((result)=>{
if(result){
getDetail = (caseID) => {
let url = `/libraries/${caseID}.json`
axios.get(url).then((result) => {
if (result) {
this.setState({
CaseDetail:result.data,
praise_count:result.data.praise_count,
cover:result.data.cover,
creator:result.data.creator,
operation:result.data.operation,
user_praised:result.data.operation.user_praised,
tags:result.data.tags,
attachments:result.data.attachments
CaseDetail: result.data,
praise_count: result.data.praise_count,
cover: result.data.cover,
creator: result.data.creator,
operation: result.data.operation,
user_praised: result.data.operation.user_praised,
tags: result.data.tags,
attachments: result.data.attachments
})
window.document.title = result.data.title;
window.document.title = result.data.title;
}
}).catch((error)=>{
}).catch((error) => {
console.log(error);
})
}
// 点赞
praisePoint=(caseID)=>{
let { praise_count }=this.state;
let url =`/praise_tread/like.json`;
axios.post(url,{
object_id:caseID,
object_type:"library"
}).then((result)=>{
if(result){
praisePoint = (caseID) => {
let { praise_count } = this.state;
let url = `/praise_tread/like.json`;
axios.post(url, {
object_id: caseID,
object_type: "library"
}).then((result) => {
if (result) {
this.setState({
praise_count: parseInt(praise_count)+1,
user_praised:true
praise_count: parseInt(praise_count) + 1,
user_praised: true
})
}
}).catch((error)=>{
}).catch((error) => {
console.log(error);
})
}
render(){
render() {
return(
return (
<div className="newMain">
<Switch {...this.props}>
@ -109,20 +109,20 @@ class Index extends Component{
<Route exact path="/moop_cases/:caseID"
render={
(props) => (<CaseDetail {...this.props} {...props} {...this.state} getDetail={this.getDetail} praisePoint ={this.praisePoint}/>)
(props) => (<CaseDetail {...this.props} {...props} {...this.state} getDetail={this.getDetail} praisePoint={this.praisePoint} />)
}
></Route>
<Route exact path="/moop_cases/:caseID/edit"
render={
(props) => (<CaseNew {...this.props} {...props} {...this.state} getDetail={this.getDetail} />)
(props) => (<CaseNew {...this.props} {...props} {...this.state} getDetail={this.getDetail} />)
}
></Route>
<Route exact path="/moop_cases/:caseID/publish_success"
render={
(props) => (<CaseSuccess {...this.props} {...props} {...this.state} getDetail={this.getDetail} />)
(props) => (<CaseSuccess {...this.props} {...props} {...this.state} getDetail={this.getDetail} />)
}
></Route>
@ -131,4 +131,4 @@ class Index extends Component{
)
}
}
export default CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(Index) ));
export default CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Index)));

@ -1,9 +1,9 @@
import React, {Component} from 'react';
import React, { Component } from 'react';
import axios from 'axios';
import {SnackbarHOC, WordsBtn,getImageUrl,markdownToHTML} from 'educoder';
import {Row, Col,Input,Divider,Card,Button,Pagination,Breadcrumb,Icon,Spin} from 'antd';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../courses/common/CNotificationHOC';
import { getImageUrl, markdownToHTML } from 'educoder';
import { Row, Col, Input, Divider, Card, Button, Pagination, Breadcrumb, Icon, Spin } from 'antd';
import TPMIndexHOC from '../tpm/TPMIndexHOC';
import CNotificationHOC from '../courses/common/CNotificationHOC';
import Osshackathonmd from './Osshackathonmd';
import './Osshackathon.css';
import Osshackathonmodel from "./Osshackathonmodel";
@ -13,15 +13,15 @@ class Osshackathon extends Component {
constructor(props) {
super(props)
this.state = {
page:1,
limit:10,
search:undefined,
data:undefined,
hackathonedit:false,
Osshackathonmodeltype:false,
spinning:false,
opentitletype:true,
boxoffsetHeigh:0
page: 1,
limit: 10,
search: undefined,
data: undefined,
hackathonedit: false,
Osshackathonmodeltype: false,
spinning: false,
opentitletype: true,
boxoffsetHeigh: 0
}
}
@ -30,96 +30,98 @@ class Osshackathon extends Component {
window.document.title = '竞赛报名';
}
getosshackathon=(page,limit,search)=>{
getosshackathon = (page, limit, search) => {
this.setState({
spinning:true
spinning: true
})
let url=`/osshackathon.json`;
axios.get(url,{params:{
page:page,
limit:limit,
search:search,
}}).then((result)=>{
if(result.status==200){
let url = `/osshackathon.json`;
axios.get(url, {
params: {
page: page,
limit: limit,
search: search,
}
}).then((result) => {
if (result.status == 200) {
this.setState({
data:result.data,
spinning:false
data: result.data,
spinning: false
})
}else{
} else {
this.setState({
spinning:false
spinning: false
})
}
}).catch((error)=>{
}).catch((error) => {
this.setState({
spinning:true
spinning: true
})
})
}
getosshackathonlist=()=>{
let {page,limit,search}=this.state;
getosshackathonlist = () => {
let { page, limit, search } = this.state;
this.setState({
page:1,
search:undefined
page: 1,
search: undefined
})
this.getosshackathon(1,limit,undefined)
this.getosshackathon(1, limit, undefined)
}
componentDidUpdate = (prevProps,prevState) => {
if(prevState.data!=this.state.data){
//防止陷入无限循环
let box=document.getElementById("Osshackathonfontlists");
if(box){
this.setState({
boxoffsetHeigh:box.offsetHeight
})
}
componentDidUpdate = (prevProps, prevState) => {
if (prevState.data != this.state.data) {
//防止陷入无限循环
let box = document.getElementById("Osshackathonfontlists");
if (box) {
this.setState({
boxoffsetHeigh: box.offsetHeight
})
}
}
}
PaginationTask=(pageNumber)=>{
let {hackathonedit}=this.state;
if(hackathonedit===true){
PaginationTask = (pageNumber) => {
let { hackathonedit } = this.state;
if (hackathonedit === true) {
this.props.showNotification(`请先保存或者关闭编辑状态`);
}else {
} else {
this.setState({
page: pageNumber
})
let {page, limit, search} = this.state;
let { page, limit, search } = this.state;
this.getosshackathon(pageNumber, limit, search)
}
}
hackathonedit=(id)=>{
hackathonedit = (id) => {
//管理员编辑title
this.setState({
hackathonedit:true
})
this.setState({
hackathonedit: true
})
}
hidehackathonedit=()=>{
hidehackathonedit = () => {
this.setState({
hackathonedit:false
hackathonedit: false
})
}
Signupentry=(id)=>{
// 用户报名
if(this.props.checkIfLogin()===false){
Signupentry = (id) => {
// 用户报名
if (this.props.checkIfLogin() === false) {
this.props.showLoginDialog()
return
}
if(this.props.checkIfProfileCompleted()===false){
if (this.props.checkIfProfileCompleted() === false) {
this.props.showProfileCompleteDialog()
return
}
//判断是否绑定邮箱
if(this.props.user.email===null&&this.props.user.phone===null){
if (this.props.user.email === null && this.props.user.phone === null) {
this.props.showhideAccountPhoneemailDialog()
return
}
@ -133,11 +135,11 @@ class Osshackathon extends Component {
}
Signupentrys=(id)=>{
let url=`/osshackathon/${id}/entry.json`;
Signupentrys = (id) => {
let url = `/osshackathon/${id}/entry.json`;
axios.post(url
).then((response) => {
if(response.data.status===0){
if (response.data.status === 0) {
this.getosshackathonlist()
this.props.showNotification(`报名成功,预祝您夺得桂冠`);
}
@ -146,46 +148,46 @@ class Osshackathon extends Component {
})
}
editSignupentry=(id,name,description)=>{
let {hackathonedit}=this.state;
if(hackathonedit===true){
editSignupentry = (id, name, description) => {
let { hackathonedit } = this.state;
if (hackathonedit === true) {
this.props.showNotification(`请先保存或者关闭编辑状态`);
}else{
} else {
// 管理员编辑项目
this.setState({
Osshackathonmodeltype:true
Osshackathonmodeltype: true
})
if(id===undefined){
if (id === undefined) {
this.setState({
modelid:undefined,
modelname:undefined,
modeldescription:undefined
modelid: undefined,
modelname: undefined,
modeldescription: undefined
})
}else{
} else {
this.setState({
modelid:id,
modelname:name,
modeldescription:description
modelid: id,
modelname: name,
modeldescription: description
})
}
}
}
hideeditSignupentry=(id)=>{
hideeditSignupentry = (id) => {
// 管理员取消项目
this.setState({
Osshackathonmodeltype:false
Osshackathonmodeltype: false
})
}
delSignupentry=(id)=>{
delSignupentry = (id) => {
// 管理员删除项目
let {hackathonedit}=this.state;
if(hackathonedit===true){
let { hackathonedit } = this.state;
if (hackathonedit === true) {
this.props.showNotification(`请先保存或者关闭编辑状态`);
}else {
} else {
this.props.confirm({
content: `是否确认删除该项目?`,
onOk: () => {
@ -194,8 +196,8 @@ class Osshackathon extends Component {
})
}
}
delSignupentrys=(id)=>{
let url=`/osshackathon/${id}.json`;
delSignupentrys = (id) => {
let url = `/osshackathon/${id}.json`;
axios.delete(url)
.then((response) => {
if (response.data.status == 0) {
@ -211,37 +213,37 @@ class Osshackathon extends Component {
}
onsearchvalue=(value)=>{
let {hackathonedit}=this.state;
if(hackathonedit===true){
onsearchvalue = (value) => {
let { hackathonedit } = this.state;
if (hackathonedit === true) {
this.props.showNotification(`请先保存或者关闭编辑状态`);
}else {
} else {
this.setState({
search:value
search: value
})
if(value.length>300){
if (value.length > 300) {
this.props.showNotification(`搜索字数大于300个字`);
}
let {page,limit,search}=this.state;
this.getosshackathon(page,limit,value)
let { page, limit, search } = this.state;
this.getosshackathon(page, limit, value)
}
}
onsetsearchvalue=(e)=>{
onsetsearchvalue = (e) => {
this.setState({
search:e.target.value
search: e.target.value
})
}
opentitle=()=>{
opentitle = () => {
this.setState({
opentitletype:false
opentitletype: false
})
}
render() {
let {page,data,hackathonedit,opentitletype}=this.state;
let { page, data, hackathonedit, opentitletype } = this.state;
return (
<div className="newMain clearfix newMainybot">
@ -261,117 +263,117 @@ class Osshackathon extends Component {
}
</style>
<div className={"educontent mb60 persmstyle"} style={{width: "1200px", marginTop: "26px"}}>
<div className={"educontent mb60 persmstyle"} style={{ width: "1200px", marginTop: "26px" }}>
<div className="registrationback"
style={{"background": `url(${getImageUrl(`images/educoder/competitions/heikesong.jpg`)})`,"height":"360px"}}
style={{ "background": `url(${getImageUrl(`images/educoder/competitions/heikesong.jpg`)})`, "height": "360px" }}
></div>
<Spin spinning={this.state.spinning}>
{this.props.user&&this.props.user.admin===true?<Row className={"mt20"}>
<Col span={6}>
<Search
className={"Osshackathon-btn-primary"}
placeholder="请输入项目名称进行搜索"
enterButton="搜索"
size="large"
value={this.state.search}
onInput={(e)=>this.onsetsearchvalue(e)}
onSearch={value => this.onsearchvalue(value)}
/>
</Col>
<Col span={3} className={"fr textright"}>
{this.props.user && this.props.user.admin === true ? <Row className={"mt20"}>
<Col span={6}>
<Search
className={"Osshackathon-btn-primary"}
placeholder="请输入项目名称进行搜索"
enterButton="搜索"
size="large"
value={this.state.search}
onInput={(e) => this.onsetsearchvalue(e)}
onSearch={value => this.onsearchvalue(value)}
/>
</Col>
<Col span={3} className={"fr textright"}>
<div>
报名总数<span className={"color-red"}>{data&&data.hackathon.hackathon_users_count}</span>
报名总数<span className={"color-red"}>{data && data.hackathon.hackathon_users_count}</span>
</div>
</Col>
</Row>:""}
{hackathonedit===true?"":<Row className={"mt20"}>
<Col span={6} className={"Osshackathonfont"}>
{data&&data.hackathon.name}
</Col>
{this.props.user&&this.props.user.admin===true?<Col span={3} className={"fr textright"}>
<Button type="primary" className={"OsshackprimaryButtonsyle"} onClick={()=>this.hackathonedit(data&&data.hackathon.id)}>编辑</Button>
</Col>:""}
</Row>}
{hackathonedit===true?"": <style>
{
`
</Col>
</Row> : ""}
{hackathonedit === true ? "" : <Row className={"mt20"}>
<Col span={6} className={"Osshackathonfont"}>
{data && data.hackathon.name}
</Col>
{this.props.user && this.props.user.admin === true ? <Col span={3} className={"fr textright"}>
<Button type="primary" className={"OsshackprimaryButtonsyle"} onClick={() => this.hackathonedit(data && data.hackathon.id)}>编辑</Button>
</Col> : ""}
</Row>}
{hackathonedit === true ? "" : <style>
{
`
.ant-divider-horizontal{
margin: 19px 0;
}
`
}
</style>}
}
</style>}
{hackathonedit===true?"":<Divider />}
{hackathonedit === true ? "" : <Divider />}
{opentitletype===true?<style>
{opentitletype === true ? <style>
{
`
`
.Osshackathonfontlist{
max-height: 180px;
overflow: hidden;
}
`
}
</style>:""}
{hackathonedit===true?"":<p className={"Osshackathonfontlist mb30"} id={"Osshackathonfontlists"}>
{data&&data.hackathon.description===null?"":<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(data&&data.hackathon.description).replace(/▁/g, "▁▁▁")}}></div>}
</p>}
{opentitletype===true&&this.state.boxoffsetHeigh===180?<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont"}>展开阅读全文<Icon type="down" /></Divider>:""}
{hackathonedit===true?<Osshackathonmd
getosshackathon={()=>this.getosshackathonlist()}
hidehackathonedit={()=>this.hidehackathonedit()}
{...this.props}
{...this.state}
/>:""}
{this.state.Osshackathonmodeltype===true?<Osshackathonmodel
getosshackathon={()=>this.getosshackathonlist()}
hideeditSignupentry={()=>this.hideeditSignupentry()}
{...this.props}
{...this.state}
/>:""}
{this.props.user&&this.props.user.admin===true?<Row className={"mb20 mt30"}>
<Col span={8}></Col>
<Col span={8}><Button type="primary" className={"OsshackprimaryButton OsshackprimaryButtonsyle"} onClick={()=>this.editSignupentry()}><Icon type="plus" />新建项目</Button></Col>
<Col span={8}></Col>
</Row>:""}
{/*学生身份*/}
{
this.props.user&&this.props.user.admin===false?data&&data.hacks.length==0?"":data&&data.hacks.map((item,key)=>{
return(
<Card className={"OsshackathonCard mb20"} key={key}>
<Row>
<Col span={20} className={"OsshackathonCardtitle"}>
{item.name}
</Col>
<Col span={6} className={"fr textright"}>
<span style={{"line-height":"30px","margin-right": "30px"}}>报名人数{item.hack_users_count}</span>
{item.entry_info===true?<Button type="primary fr mr20" disabled>
已报名
</Button>:<Button type="primary fr issignup" onClick={()=>this.Signupentry(item.id)}></Button>}
</Col>
</Row>
<p className={"mt20"}>{item.description}</p>
</Card>
)
}):""
}
</style> : ""}
{hackathonedit === true ? "" : <p className={"Osshackathonfontlist mb30"} id={"Osshackathonfontlists"}>
{data && data.hackathon.description === null ? "" : <div className={"markdown-body"}
dangerouslySetInnerHTML={{ __html: markdownToHTML(data && data.hackathon.description).replace(/▁/g, "▁▁▁") }}></div>}
</p>}
{opentitletype === true && this.state.boxoffsetHeigh === 180 ? <Divider dashed={true} onClick={() => this.opentitle()} className={"pointer Breadcrumbfont"}>展开阅读全文<Icon type="down" /></Divider> : ""}
{hackathonedit === true ? <Osshackathonmd
getosshackathon={() => this.getosshackathonlist()}
hidehackathonedit={() => this.hidehackathonedit()}
{...this.props}
{...this.state}
/> : ""}
{this.state.Osshackathonmodeltype === true ? <Osshackathonmodel
getosshackathon={() => this.getosshackathonlist()}
hideeditSignupentry={() => this.hideeditSignupentry()}
{...this.props}
{...this.state}
/> : ""}
{this.props.user && this.props.user.admin === true ? <Row className={"mb20 mt30"}>
<Col span={8}></Col>
<Col span={8}><Button type="primary" className={"OsshackprimaryButton OsshackprimaryButtonsyle"} onClick={() => this.editSignupentry()}><Icon type="plus" />新建项目</Button></Col>
<Col span={8}></Col>
</Row> : ""}
{/*学生身份*/}
{
this.props.user && this.props.user.admin === false ? data && data.hacks.length == 0 ? "" : data && data.hacks.map((item, key) => {
return (
<Card className={"OsshackathonCard mb20"} key={key}>
<Row>
<Col span={20} className={"OsshackathonCardtitle"}>
{item.name}
</Col>
<Col span={6} className={"fr textright"}>
<span style={{ "line-height": "30px", "margin-right": "30px" }}>报名人数{item.hack_users_count}</span>
{item.entry_info === true ? <Button type="primary fr mr20" disabled>
已报名
</Button> : <Button type="primary fr issignup" onClick={() => this.Signupentry(item.id)}></Button>}
</Col>
</Row>
<p className={"mt20"}>{item.description}</p>
</Card>
)
}) : ""
}
{/*教师身份*/}
{this.props.user&&this.props.user.admin===true?<style>
{
`
{/*教师身份*/}
{this.props.user && this.props.user.admin === true ? <style>
{
`
.ant-col-pull-6 {
right: 17%;
}
@ -382,61 +384,62 @@ class Osshackathon extends Component {
text-align: center;
}
`
}
</style> : ""}
{
this.props.user && this.props.user.admin === true ? data && data.hacks.length == 0 ? "" : data && data.hacks.map((item, key) => {
return (
<Card className={"OsshackathonCard mb20"}>
<Row>
<Col span={20} className={"OsshackathonCardtitle"}>
{item.name}
</Col>
<Col span={4} className={"fr textcenter width14bai"}>
<Breadcrumb separator="">
<Breadcrumb.Item className={"Breadcrumbfont iscursor"} onClick={() => this.editSignupentry(item.id, item.name, item.description)}>编辑</Breadcrumb.Item>
<Breadcrumb.Item className={"Breadcrumbfont iscursor"} onClick={() => this.delSignupentry(item.id)}>删除</Breadcrumb.Item>
</Breadcrumb>
</Col>
</Row>
<Row className={"mt20"}>
<Col span={4} push={20} className={"minheight50px borderDEDEDE"}>
<div className={"pl80pt6"}>
<Row gutter={16}>
<Col className="gutter-row" span={15}>
<div className="gutter-box Osshackprimaryfonttop">{item.hack_users_count}</div>
</Col>
</Row>
<Row gutter={16}>
<Col className="gutter-row" span={15}>
<div className="gutter-box CompetitionsIndexbottomvalue">报名数</div>
</Col>
</Row>
</div>
</Col>
<Col span={18} pull={6} className={"minheight50px ml5"}>
{item.description}
</Col>
</Row>
</Card>
)
}) : ""
}
</style>:""}
{
this.props.user&&this.props.user.admin===true?data&&data.hacks.length==0?"":data&&data.hacks.map((item,key)=>{
return(
<Card className={"OsshackathonCard mb20"}>
<Row>
<Col span={20} className={"OsshackathonCardtitle"}>
{item.name}
</Col>
<Col span={4} className={"fr textcenter width14bai"}>
<Breadcrumb separator="">
<Breadcrumb.Item className={"Breadcrumbfont iscursor"} onClick={()=>this.editSignupentry(item.id,item.name,item.description)}>编辑</Breadcrumb.Item>
<Breadcrumb.Item className={"Breadcrumbfont iscursor"} onClick={()=>this.delSignupentry(item.id)}>删除</Breadcrumb.Item>
</Breadcrumb>
</Col>
</Row>
<Row className={"mt20"}>
<Col span={4} push={20} className={"minheight50px borderDEDEDE"}>
<div className={"pl80pt6"}>
<Row gutter={16}>
<Col className="gutter-row" span={15}>
<div className="gutter-box Osshackprimaryfonttop">{item.hack_users_count}</div>
</Col>
</Row>
<Row gutter={16}>
<Col className="gutter-row" span={15}>
<div className="gutter-box CompetitionsIndexbottomvalue">报名数</div>
</Col>
</Row>
</div>
</Col>
<Col span={18} pull={6} className={"minheight50px ml5"}>
{item.description}
</Col>
</Row>
</Card>
)}):""
}
{data&&data.hacks_count>10?data&&data.hacks.length===0?"":<div className="mb40 edu-txt-center padding20-30" >
<Pagination
showQuickJumper
defaultCurrent={1}
pageSize={10}
total={data&&data.hacks_count}
current={page}
onChange={this.PaginationTask}
/>
</div>:""}
{data && data.hacks_count > 10 ? data && data.hacks.length === 0 ? "" : <div className="mb40 edu-txt-center padding20-30" >
<Pagination
showQuickJumper
defaultCurrent={1}
pageSize={10}
total={data && data.hacks_count}
current={page}
onChange={this.PaginationTask}
/>
</div> : ""}
</Spin>
</div>
@ -448,4 +451,4 @@ class Osshackathon extends Component {
export default CNotificationHOC() (TPMIndexHOC (Osshackathon)) ;
export default CNotificationHOC()(TPMIndexHOC(Osshackathon));

@ -5,7 +5,7 @@ import LeftView from './LeftView'
import axios from 'axios'
import { commentHOC } from '../../comment/CommentsHOC'
import commentHOC from '../../comment/CommentsHOC'
import ImageLayer from '../layers/ImageLayer'

@ -3,19 +3,18 @@ import React, { Component } from 'react';
import { SnackbarHOC, CNotificationHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import { Route, Switch } from 'react-router-dom';
import Loadable from 'react-loadable';
import Loading from '../../Loading';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import NewFooter from "../tpm/NewFooter";
import TPMIndexHOC from '../tpm/TPMIndexHOC';
const PathsDetail = Loadable({
loader: () => import('./PathDetail/PathDetailIndex'),
loading:Loading,
loading: Loading,
})
const PathsNew = Loadable({
loader: () => import('./PathNew'),
loading:Loading,
loading: Loading,
})
// const Statistics = Loadable({
// loader: () => import('./SchoolStatistics/Statistics'),
@ -28,10 +27,10 @@ const Statistics = Loadable({
const ShixunPaths = Loadable({
loader: () => import('./ShixunPaths'),
loading:Loading,
loading: Loading,
})
class Index extends Component{
class Index extends Component {
constructor(props) {
super(props)
}
@ -39,26 +38,26 @@ class Index extends Component{
return (
<div>
<Switch {...this.props}>
<Route path="/paths/:pathId/statistics" component = {Statistics} {...this.props} {...this.state}></Route>
<Route path="/paths/:pathId/statistics" component={Statistics} {...this.props} {...this.state}></Route>
<Route path="/paths/new"
render={(props)=>(<PathsNew {...this.props} {...this.state} {...props}/>)}
render={(props) => (<PathsNew {...this.props} {...this.state} {...props} />)}
></Route>
<Route path="/paths/:pathId/edit"
render={(props)=>(<PathsNew {...this.props} {...this.state} {...props}/>)}
render={(props) => (<PathsNew {...this.props} {...this.state} {...props} />)}
></Route>
{/*编辑页面*/}
<Route path="/paths/:pathId"
render={(props) => (<PathsDetail {...this.props} {...this.state} {...props} />)}
></Route>
{/*编辑页面*/}
<Route path="/paths/:pathId"
render={(props)=>(<PathsDetail {...this.props} {...this.state} {...props}/>)}
></Route>
{/*<Route path="/paths/:pathId" exact component = {PathsDetail} {...this.props} {...this.state}></Route>*/}
<Route path="/paths" exact
render={(props)=>(<ShixunPaths {...this.props} {...this.state} {...props}/>)}
></Route>
<Route path="/paths" exact
render={(props) => (<ShixunPaths {...this.props} {...this.state} {...props} />)}
></Route>
</Switch>
</div>
)
}
}
export default CNotificationHOC() (SnackbarHOC() ( TPMIndexHOC(Index) ));
export default CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Index)));

@ -7,7 +7,7 @@ import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import Loading from '../../Loading'
import Loadable from 'react-loadable';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC'
import TPMIndexHOC from '../tpm/TPMIndexHOC'
import { SnackbarHOC } from 'educoder'
@ -31,7 +31,7 @@ class ProjectPackageIndex extends Component {
super(props)
}
componentDidMount(){
componentDidMount() {
window.document.title = '众包创新'
}
@ -44,27 +44,27 @@ class ProjectPackageIndex extends Component {
{/*众包首页*/}
<Route path="/crowdsourcing/:id/edit"
render={
(props) => (<PackageIndexNewandEdit {...this.props} {...props} {...this.state} />)
}
render={
(props) => (<PackageIndexNewandEdit {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/crowdsourcing/new"
render={
(props) => (<PackageIndexNewandEdit {...this.props} {...props} {...this.state} />)
}
render={
(props) => (<PackageIndexNewandEdit {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/crowdsourcing/:id"
render={
(props) => (<PackageIndexNEITaskDetails {...this.props} {...props} {...this.state} />)
}
render={
(props) => (<PackageIndexNEITaskDetails {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/crowdsourcing"
render={
(props) => (<PackageIndex {...this.props} {...props} {...this.state} />)
}
render={
(props) => (<PackageIndex {...this.props} {...props} {...this.state} />)
}
></Route>
</Switch>
@ -73,4 +73,4 @@ class ProjectPackageIndex extends Component {
}
}
export default SnackbarHOC() (TPMIndexHOC (ProjectPackageIndex)) ;
export default SnackbarHOC()(TPMIndexHOC(ProjectPackageIndex));

@ -1,23 +1,12 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
import React, { Component } from "react";
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Tooltip
} from "antd";
import {parabola} from './animation/parabola'
import Headplugselections from "./component/Headplugselections";
import QuestionModal from "./component/QuestionModal";
import QuestionModals from "./component/QuestionModals";
import Contentpart from "./component/Contentpart";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import NoneData from './component/NoneData';
import './questioncss/questioncom.css';
import Bottomsubmit from "../modals/Bottomsubmit";
@ -27,16 +16,16 @@ class NewMyShixunModel extends Component {
super(props);
this.state = {
count: 50,
defaultActiveKey:"1",
defaultActiveKey: "1",
Headertop: "",
Footerdown: "",
visible: false,
placement: 'right',
modalsType: false,
modalsTypes:false,
modalsTypes: false,
titilesm: "在平台审核后,所有成员均可使用试题",
titiless: "是否设置为公开?",
titilesms:"单选题",
titilesms: "单选题",
titbool: false,
Contentdata: [],
difficulty: null,
@ -54,109 +43,109 @@ class NewMyShixunModel extends Component {
program_questions_count: 0,
single_questions_count: 0,
subjective_questions_count: 0,
page:1,
per_page:10,
disciplinesdata:[],
discipline_id:null,
sub_discipline_id:null,
tag_discipline_id:null,
booljupyterurls:false,
disciplinesdatakc:0,
disciplinesdatazsd:0,
selectallquestionsonthispages:false,
oj_status:null,
page: 1,
per_page: 10,
disciplinesdata: [],
discipline_id: null,
sub_discipline_id: null,
tag_discipline_id: null,
booljupyterurls: false,
disciplinesdatakc: 0,
disciplinesdatazsd: 0,
selectallquestionsonthispages: false,
oj_status: null,
isVisible: false,
selectionbools:false,
selectionbools: false,
}
}
setdiscipline_id=(discipline_id)=>{
setdiscipline_id = (discipline_id) => {
this.setState({
discipline_id:discipline_id,
sub_discipline_id:null,
tag_discipline_id:null,
keywords:"",
page:1,
per_page:10,
oj_status:null
discipline_id: discipline_id,
sub_discipline_id: null,
tag_discipline_id: null,
keywords: "",
page: 1,
per_page: 10,
oj_status: null
})
var data = {
discipline_id:discipline_id,
sub_discipline_id:null,
tag_discipline_id:null,
discipline_id: discipline_id,
sub_discipline_id: null,
tag_discipline_id: null,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: null,
page: this.state.page,
per_page:10,
oj_status:null,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
per_page: 10,
oj_status: null,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
}
setsub_discipline_id=(discipline_id,sub_discipline_id)=>{
setsub_discipline_id = (discipline_id, sub_discipline_id) => {
this.setState({
sub_discipline_id:sub_discipline_id,
tag_discipline_id:null,
keywords:"",
page:1,
per_page:10,
oj_status:null
sub_discipline_id: sub_discipline_id,
tag_discipline_id: null,
keywords: "",
page: 1,
per_page: 10,
oj_status: null
})
var data = {
discipline_id:discipline_id,
sub_discipline_id:sub_discipline_id,
tag_discipline_id:null,
discipline_id: discipline_id,
sub_discipline_id: sub_discipline_id,
tag_discipline_id: null,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords:null,
keywords: null,
page: 1,
per_page:10,
oj_status:null,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
per_page: 10,
oj_status: null,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
}
settag_discipline_id=(tag_discipline_id)=>{
settag_discipline_id = (tag_discipline_id) => {
this.setState({
tag_discipline_id:tag_discipline_id,
keywords:"",
page:1,
per_page:10,
oj_status:null
tag_discipline_id: tag_discipline_id,
keywords: "",
page: 1,
per_page: 10,
oj_status: null
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: null,
page: 1,
per_page:10,
oj_status:null,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
per_page: 10,
oj_status: null,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
}
//初始化
componentDidMount() {
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
let {defaultActiveKey} = this.props;
var defaultActiveKeys=defaultActiveKey;
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="0"
}else{
defaultActiveKeys="1"
const isysladmins = this.props && this.props.current_user && this.props.current_user.admin ? this.props.current_user.admin : false;
const is_teacher = this.props && this.props.current_user && this.props.current_user.is_teacher ? this.props.current_user.is_teacher : false;
const professional_certification = this.props && this.props.current_user && this.props.current_user.professional_certification ? this.props.current_user.professional_certification : false;
let { defaultActiveKey } = this.props;
var defaultActiveKeys = defaultActiveKey;
if (isysladmins === true || (is_teacher === true && professional_certification === true)) {
defaultActiveKeys = "0"
} else {
defaultActiveKeys = "1"
}
this.callback(defaultActiveKeys);
let url = `/users/get_navigation_info.json`;
@ -177,9 +166,11 @@ class NewMyShixunModel extends Component {
//获取题库筛选资料
let urls = `/disciplines.json`;
axios.get(urls, {params: {
source:"question"
}}).then((response) => {
axios.get(urls, {
params: {
source: "question"
}
}).then((response) => {
//console.log("Questiondisciplines");
//console.log(response.data);
if (response) {
@ -191,17 +182,17 @@ class NewMyShixunModel extends Component {
}
componentDidUpdate(prevProps) {
if(prevProps.current_user !== this.props.current_user) {
if (prevProps.current_user !== this.props.current_user) {
debugger
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
let {defaultActiveKey} = this.props;
var defaultActiveKeys=defaultActiveKey;
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="0"
}else{
defaultActiveKeys="1"
const isysladmins = this.props && this.props.current_user && this.props.current_user.admin ? this.props.current_user.admin : false;
const is_teacher = this.props && this.props.current_user && this.props.current_user.is_teacher ? this.props.current_user.is_teacher : false;
const professional_certification = this.props && this.props.current_user && this.props.current_user.professional_certification ? this.props.current_user.professional_certification : false;
let { defaultActiveKey } = this.props;
var defaultActiveKeys = defaultActiveKey;
if (isysladmins === true || (is_teacher === true && professional_certification === true)) {
defaultActiveKeys = "0"
} else {
defaultActiveKeys = "1"
}
this.callback(defaultActiveKeys);
}
@ -211,22 +202,22 @@ class NewMyShixunModel extends Component {
callback = (key) => {
this.setState({
defaultActiveKey: key,
selectallquestionsonthispages:false,
difficulty:null,
page:1,
oj_status:null
selectallquestionsonthispages: false,
difficulty: null,
page: 1,
oj_status: null
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: key,
item_type: this.state.item_type,
difficulty: null,
page: 1,
per_page:10,
oj_status:null,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
per_page: 10,
oj_status: null,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
@ -236,15 +227,15 @@ class NewMyShixunModel extends Component {
getdata = (data) => {
const url = `/item_banks.json`;
this.setState({
booljupyterurls:true,
selectionbools:false,
booljupyterurls: true,
selectionbools: false,
})
axios.get((url), {params: data}).then((response) => {
setTimeout(()=>{
axios.get((url), { params: data }).then((response) => {
setTimeout(() => {
this.setState({
booljupyterurls:false,
booljupyterurls: false,
})
},1000);
}, 1000);
if (response === null || response === undefined) {
return
@ -264,7 +255,7 @@ class NewMyShixunModel extends Component {
}).catch((error) => {
//////console.log(error)
this.setState({
booljupyterurls:false,
booljupyterurls: false,
})
});
}
@ -273,12 +264,12 @@ class NewMyShixunModel extends Component {
getdatasy = (data) => {
const url = `/item_banks.json`;
this.setState({
selectionbools:false,
selectionbools: false,
})
axios.get((url), {params: data}).then((response) => {
setTimeout(()=>{
axios.get((url), { params: data }).then((response) => {
setTimeout(() => {
},1000);
}, 1000);
if (response === null || response === undefined) {
return
@ -303,43 +294,43 @@ class NewMyShixunModel extends Component {
}
//计算
getdataslen=(arr)=>{
var contes=0;
for(let data of arr) {
if(data.item_type==="PROGRAM"){
getdataslen = (arr) => {
var contes = 0;
for (let data of arr) {
if (data.item_type === "PROGRAM") {
//编程题
if(data.choosed===true){
if (data.choosed === true) {
}else{
} else {
//未选用
if(data.program_attr.status===1){
if (data.program_attr.status === 1) {
//已发布
contes=contes+1;
contes = contes + 1;
}
}
}else{
} else {
//不是编程题
if(data.choosed===true){
if (data.choosed === true) {
}else{
} else {
//未选用
contes=contes+1;
contes = contes + 1;
}
}
}
if(contes>0){
if (contes > 0) {
this.setState({
selectionbools:false,
selectallquestionsonthispages:false,
selectionbools: false,
selectallquestionsonthispages: false,
})
}else {
} else {
this.setState({
selectionbools:true,
selectallquestionsonthispages:true,
selectionbools: true,
selectallquestionsonthispages: true,
})
}
}
@ -349,27 +340,27 @@ class NewMyShixunModel extends Component {
page: pageNumber,
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: pageNumber,
per_page:10,
oj_status:this.state.oj_status,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
per_page: 10,
oj_status: this.state.oj_status,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
}
showDrawer = () => {
if(this.state.visible===true){
if (this.state.visible === true) {
this.setState({
visible: false,
});
}else{
} else {
this.setState({
visible: true,
});
@ -425,19 +416,19 @@ class NewMyShixunModel extends Component {
modalsType: false
})
}
modalCancels=()=>{
modalCancels = () => {
this.setState({
modalsTypes: false
})
}
showQuestionModals =(item_type)=>{
showQuestionModals = (item_type) => {
this.setState({
modalsTypes: true,
titilesms:item_type,
titilesms: item_type,
})
}
setDownloads=(item_type)=>{
setDownloads = (item_type) => {
this.Deletebigquestiontype(item_type);
this.setState({
modalsTypes: false
@ -462,23 +453,23 @@ class NewMyShixunModel extends Component {
difficulty: difficulty,
visiblemys: false,
page: 1,
per_page:10,
keywords:"",
oj_status:null
per_page: 10,
keywords: "",
oj_status: null
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: difficulty,
item_type: this.state.item_type,
keywords:null,
page:1,
per_page:10,
oj_status:null,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
keywords: null,
page: 1,
per_page: 10,
oj_status: null,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
@ -489,23 +480,23 @@ class NewMyShixunModel extends Component {
item_type: item_type,
visiblemyss: false,
page: 1,
per_page:10,
keywords:"",
oj_status:null
per_page: 10,
keywords: "",
oj_status: null
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: item_type,
page: 1,
per_page:10,
keywords:null,
oj_status:null,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
per_page: 10,
keywords: null,
oj_status: null,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
@ -550,17 +541,17 @@ class NewMyShixunModel extends Component {
keywords: value,
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: value,
page: this.state.page,
per_page:10,
oj_status:this.state.oj_status,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
per_page: 10,
oj_status: this.state.oj_status,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
@ -575,16 +566,16 @@ class NewMyShixunModel extends Component {
// this.props.showNotification('删除试题成功')
// props.history.push(response.data.right_url)
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:10,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
per_page: 10,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
}
@ -601,23 +592,23 @@ class NewMyShixunModel extends Component {
if (result.data.status == 0) {
// this.props.showNotification(`公开题目成功`);
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:10,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
per_page: 10,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
}
}).catch((error) => {
////console.log(error);
})
////console.log(error);
})
}
getbasket_listdata = () => {
@ -654,13 +645,13 @@ class NewMyShixunModel extends Component {
//选用
getitem_baskets=(data)=>{
getitem_baskets = (data) => {
//选用题型可以上传单个 或者多个题型
let url="";
if(this.props.exam_id===undefined){
url="/item_baskets.json";
}else{
url="/examination_items.json";
let url = "";
if (this.props.exam_id === undefined) {
url = "/item_baskets.json";
} else {
url = "/examination_items.json";
}
@ -669,16 +660,16 @@ class NewMyShixunModel extends Component {
if (result.data.status == 0) {
// this.props.showNotification(`选用成功`);
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:10,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
per_page: 10,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdatasy(data);
this.getbasket_listdata();
@ -687,128 +678,132 @@ class NewMyShixunModel extends Component {
// })
}
}).catch((error) => {
////console.log(error);
})
////console.log(error);
})
}
// 撤销
getitem_basketss=(id)=>{
let url="";
if(this.props.exam_id===undefined){
url=`/item_baskets/${id}.json`;
getitem_basketss = (id) => {
let url = "";
if (this.props.exam_id === undefined) {
url = `/item_baskets/${id}.json`;
axios.delete(url)
.then((result) => {
if (result.data.status == 0) {
// this.props.showNotification(`撤销成功`);
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:10,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
per_page: 10,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdatasy(data);
this.getbasket_listdata();
}
}).catch((error) => {
////console.log(error);
////console.log(error);
})
} else {
url = `/examination_banks/${this.props.exam_id}/revoke_item.json`;
axios.delete(url, {
data: {
item_id: id === undefined ? "" : parseInt(id),
}
})
}else{
url=`/examination_banks/${this.props.exam_id}/revoke_item.json`;
axios.delete(url,{ data: {
item_id:id===undefined?"":parseInt(id),
}})
.then((result) => {
if (result.data.status == 0) {
// this.props.showNotification(`撤销成功`);
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:10,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
per_page: 10,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdatasy(data);
this.getbasket_listdata();
}
}).catch((error) => {
////console.log(error);
})
////console.log(error);
})
}
}
//全选试题库
selectallquestionsonthispage=()=>{
var item_idsdata=[];
selectallquestionsonthispage = () => {
var item_idsdata = [];
var arr= this.state.Contentdata.items;
for(let data of arr) {
if(data.item_type==="PROGRAM"){
var arr = this.state.Contentdata.items;
for (let data of arr) {
if (data.item_type === "PROGRAM") {
//编程题
if(data.choosed===true){
if (data.choosed === true) {
}else{
} else {
//未选用
if(data.program_attr.status===1){
if (data.program_attr.status === 1) {
//已发布
item_idsdata.push(data.id);
}
}
}else{
} else {
//不是编程题
if(data.choosed===true){
if (data.choosed === true) {
}else{
} else {
//未选用
item_idsdata.push(data.id);
}
}
}
const data={
item_ids:item_idsdata,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
const data = {
item_ids: item_idsdata,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
}
this.getitem_baskets(data);
this.setState({
selectallquestionsonthispages:true,
selectallquestionsonthispages: true,
})
}
//全选的状态
//删除大题型
Deletebigquestiontype =(item_type)=>{
const url=`/item_baskets/delete_item_type.json`;
axios.delete((url), { data: {
item_type:item_type
}})
Deletebigquestiontype = (item_type) => {
const url = `/item_baskets/delete_item_type.json`;
axios.delete((url), {
data: {
item_type: item_type
}
})
.then((response) => {
if (response.data.status == 0) {
// this.props.showNotification('删除成功');
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:10,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
per_page: 10,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
this.getbasket_listdata();
@ -822,31 +817,31 @@ class NewMyShixunModel extends Component {
//跳转
gotopaperreview=()=>{
gotopaperreview = () => {
this.props.history.replace("/paperreview");
}
setoj_status=(oj_status)=>{
setoj_status = (oj_status) => {
//编程题发布未发布
this.setState({
selectallquestionsonthispages:false,
difficulty:null,
oj_status:oj_status
selectallquestionsonthispages: false,
difficulty: null,
oj_status: oj_status
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:10,
oj_status:oj_status,
exam_id:this.props.exam_id===undefined?"":parseInt(this.props.exam_id),
per_page: 10,
oj_status: oj_status,
exam_id: this.props.exam_id === undefined ? "" : parseInt(this.props.exam_id),
};
this.getdata(data);
}
@ -854,9 +849,9 @@ class NewMyShixunModel extends Component {
render() {
let {
page, per_page, items_count, Headertop, visible, placement, modalsType, modalsTypes,basket_list,
page, per_page, items_count, Headertop, visible, placement, modalsType, modalsTypes, basket_list,
completion_questions_count, judgement_questions_count, multiple_questions_count, practical_questions_count,
program_questions_count, single_questions_count, subjective_questions_count,selectionbools
program_questions_count, single_questions_count, subjective_questions_count, selectionbools
} = this.state;
const Datacount = completion_questions_count + judgement_questions_count
@ -866,11 +861,11 @@ class NewMyShixunModel extends Component {
+ subjective_questions_count;
return (
<div className="newMain clearfix " ref={this.saveContainer}>
<div className="newMain clearfix " ref={this.saveContainer}>
{
visible===true?
visible === true ?
<style>
{
`
@ -893,26 +888,26 @@ class NewMyShixunModel extends Component {
`
}
</style>
:""
: ""
}
{
visible===true?
visible === true ?
<div
style={{
marginTop: "60px"
}}></div>
:""}
: ""}
{
modalsTypes===true?
modalsTypes === true ?
<QuestionModals {...this.props}{...this.state} modalsTypes={modalsTypes} modalCancels={() => this.modalCancels()}
setDownloads={(e) => this.setDownloads(e)}></QuestionModals>
:""
setDownloads={(e) => this.setDownloads(e)}></QuestionModals>
: ""
}
{
modalsType===true?
modalsType === true ?
<QuestionModal {...this.props}{...this.state} modalsType={modalsType} modalCancel={() => this.modalCancel()}
setDownload={() => this.setDownload()}></QuestionModal>
:""
setDownload={() => this.setDownload()}></QuestionModal>
: ""
}
{/*顶部*/}
@ -923,43 +918,43 @@ class NewMyShixunModel extends Component {
{...this.state}
setdifficulty={(e) => this.setdifficulty(e)}
setitem_types={(e) => this.setitem_types(e)}
setdiscipline_id={(e)=>this.setdiscipline_id(e)}
setsub_discipline_id={(e)=>this.setsub_discipline_id(e)}
settag_discipline_id={(e)=>this.settag_discipline_id(e)}
setdiscipline_id={(e) => this.setdiscipline_id(e)}
setsub_discipline_id={(e) => this.setsub_discipline_id(e)}
settag_discipline_id={(e) => this.settag_discipline_id(e)}
/>
{/*头部*/}
<Contentpart {...this.state} {...this.props}
exam_id={this.props.exam_id}
Isitapopup={"true"}
getitem_basketss={(id)=>this.getitem_basketss(id)}
selectallquestionsonthispage={()=>this.selectallquestionsonthispage()}
getitem_baskets={(e)=>this.getitem_baskets(e)}
setdatafuns={(e) => this.setdatafuns(e)}
setdatafunsval={(e) => this.setdatafunsval(e)}
handleVisibleChanges={(e) => this.handleVisibleChanges(e)}
handleVisibleChange={(e) => this.handleVisibleChange(e)}
showmodels={(e) => this.showmodels(e)}
showmodelysl={(e) => this.showmodelysl(e)}
callback={(e) => this.callback(e)}
setoj_status={(e)=>this.setoj_status(e)}></Contentpart>
exam_id={this.props.exam_id}
Isitapopup={"true"}
getitem_basketss={(id) => this.getitem_basketss(id)}
selectallquestionsonthispage={() => this.selectallquestionsonthispage()}
getitem_baskets={(e) => this.getitem_baskets(e)}
setdatafuns={(e) => this.setdatafuns(e)}
setdatafunsval={(e) => this.setdatafunsval(e)}
handleVisibleChanges={(e) => this.handleVisibleChanges(e)}
handleVisibleChange={(e) => this.handleVisibleChange(e)}
showmodels={(e) => this.showmodels(e)}
showmodelysl={(e) => this.showmodelysl(e)}
callback={(e) => this.callback(e)}
setoj_status={(e) => this.setoj_status(e)}></Contentpart>
{
items_count&&items_count>10?
items_count && items_count > 10 ?
<div className="mb30 clearfix educontent mt40 intermediatecenter">
<Pagination showQuickJumper current={page} onChange={this.paginationonChange}
pageSize={per_page}
total={items_count}></Pagination>
pageSize={per_page}
total={items_count}></Pagination>
</div>
:<div className="h30 clearfix educontent mt40 intermediatecenter">
: <div className="h30 clearfix educontent mt40 intermediatecenter">
</div>
}
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"确定"}
Cohetepaperbool={true}
setCohetepaperbool={() => this.props.setnewmyshixunmodelbool(false)}
onSubmits={() => this.props.setnewmyshixunmodelbool(false)} url={'/paperlibrary'}></Bottomsubmit>
Cohetepaperbool={true}
setCohetepaperbool={() => this.props.setnewmyshixunmodelbool(false)}
onSubmits={() => this.props.setnewmyshixunmodelbool(false)} url={'/paperlibrary'}></Bottomsubmit>
</div>
)

@ -1,26 +1,10 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
import React, { Component } from "react";
import { SnackbarHOC } from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb
} from "antd";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import Itembankstop from "./component/Itembankstop";
import NoneData from './component/NoneData';
import { Breadcrumb } from "antd";
import TPMIndexHOC from "../tpm/TPMIndexHOC";
import './questioncss/questioncom.css';
import '../tpm/newshixuns/css/Newshixuns.css';
import Choicequestion from './component/Choicequestion';
import SingleEditor from "./component/SingleEditor";
import ChoquesEditor from "./component/ChoquesEditor"
import JudquestionEditor from "./component/JudquestionEditor";
import Paperreview_item from "./Paperreview_item"
import Bottomsubmit from "../../modules/modals/Bottomsubmit";
import Comthetestpaperst from "./comthetestpaper/Comthetestpaperst";
@ -38,22 +22,22 @@ class Paperreview extends Component {
disciplinesdata: [],
knowledgepoints: [],
disciplmy: [],
single_questions:null,
multiple_questions:null,
judgement_questions:null,
program_questions:null,
all_score:0,
all_questions_count:0,
Cohetepaperbool:false,
discipline_id:null,
sub_discipline_id:null,
tag_discipline_id:null,
difficulty:null,
name:null,
duration:null,
newmyshixunmodelbool:false,
artificialtype:"artificial",
Intelligentformation:false,
single_questions: null,
multiple_questions: null,
judgement_questions: null,
program_questions: null,
all_score: 0,
all_questions_count: 0,
Cohetepaperbool: false,
discipline_id: null,
sub_discipline_id: null,
tag_discipline_id: null,
difficulty: null,
name: null,
duration: null,
newmyshixunmodelbool: false,
artificialtype: "artificial",
Intelligentformation: false,
}
// single_questions:null, 单选题
@ -70,10 +54,10 @@ class Paperreview extends Component {
//console.log("Paperreview.js");
//console.log(this.props.match.params);
this.setState({
artificialtype:this.props.match.params.type
artificialtype: this.props.match.params.type
})
var data = {};
this.getdata(data);
var data = {};
this.getdata(data);
let urls = `/disciplines.json`;
axios.get(urls, {
params: {
@ -90,7 +74,7 @@ class Paperreview extends Component {
const didata = response.data.disciplines;
for (var i = 0; i < didata.length; i++) {
const childern=[];
const childern = [];
//方向
const fxdidata = didata[i].sub_disciplines;
@ -112,7 +96,7 @@ class Paperreview extends Component {
}
}
const datakec={
const datakec = {
value: didata[i].id,
label: didata[i].name,
children: childern,
@ -122,7 +106,7 @@ class Paperreview extends Component {
this.setState({
knowledgepoints: this.state.knowledgepoints,
disciplmy:this.state.disciplmy,
disciplmy: this.state.disciplmy,
})
@ -137,23 +121,23 @@ class Paperreview extends Component {
getdata = (data) => {
if(this.props.match.params.type==="artificial"){
if (this.props.match.params.type === "artificial") {
//人工组卷
}else{
} else {
//智能组卷
//
data = {
exam_setting_id:this.props.match.params.id
exam_setting_id: this.props.match.params.id
}
}
const url = `/item_baskets.json`;
this.setState({
booljupyterurls: true,
})
axios.get((url), {params: data}).then((response) => {
if(response===undefined|| response===null){
axios.get((url), { params: data }).then((response) => {
if (response === undefined || response === null) {
return;
}
setTimeout(() => {
@ -173,14 +157,14 @@ class Paperreview extends Component {
try {
this.setState({
Contentdata: response.data,
single_questions:response.data.single_questions.questions_count===0? null:response.data.single_questions,
multiple_questions:response.data.multiple_questions.questions_count===0? null:response.data.multiple_questions,
judgement_questions:response.data.judgement_questions.questions_count===0? null:response.data.judgement_questions,
program_questions:response.data.program_questions.questions_count===0? null:response.data.program_questions,
all_score:response.data.all_score,
all_questions_count:response.data.all_questions_count,
single_questions: response.data.single_questions.questions_count === 0 ? null : response.data.single_questions,
multiple_questions: response.data.multiple_questions.questions_count === 0 ? null : response.data.multiple_questions,
judgement_questions: response.data.judgement_questions.questions_count === 0 ? null : response.data.judgement_questions,
program_questions: response.data.program_questions.questions_count === 0 ? null : response.data.program_questions,
all_score: response.data.all_score,
all_questions_count: response.data.all_questions_count,
})
}catch (e) {
} catch (e) {
}
@ -211,46 +195,46 @@ class Paperreview extends Component {
}
preservation = () => {
//保存试卷
if(this.state.artificialtype==="artificial"){
if(this.state.Cohetepaperbool===true){
if (this.contentMdRef.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return;
}
var myrbkc=[];
var Getdatasdatas=this.contentMdRef.Getdatas()[2].rbzsd;
for(let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
const url = `/examination_banks.json`;
var data={
difficulty:this.contentMdRef.Getdatas()[0].rbnd,
name:this.contentMdRef.Getdatas()[4].classroom,
duration:this.contentMdRef.Getdatas()[5].kssc,
discipline_id: this.contentMdRef.Getdatas()[3].rbkc[0],
sub_discipline_id: this.contentMdRef.Getdatas()[3].rbkc[1],
tag_discipline_id: myrbkc,
}
axios.post(url, data)
.then((result) => {
if (result.data.status === 0) {
// this.props.showNotification(`组卷成功`);
this.props.history.replace('/paperlibrary');
}
}).catch((error) => {
if (this.state.artificialtype === "artificial") {
if (this.state.Cohetepaperbool === true) {
if (this.contentMdRef.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return;
}
var myrbkc = [];
var Getdatasdatas = this.contentMdRef.Getdatas()[2].rbzsd;
for (let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
const url = `/examination_banks.json`;
var data = {
difficulty: this.contentMdRef.Getdatas()[0].rbnd,
name: this.contentMdRef.Getdatas()[4].classroom,
duration: this.contentMdRef.Getdatas()[5].kssc,
discipline_id: this.contentMdRef.Getdatas()[3].rbkc[0],
sub_discipline_id: this.contentMdRef.Getdatas()[3].rbkc[1],
tag_discipline_id: myrbkc,
}
axios.post(url, data)
.then((result) => {
if (result.data.status === 0) {
// this.props.showNotification(`组卷成功`);
this.props.history.replace('/paperlibrary');
}
}).catch((error) => {
//console.log(error);
})
}else{
this.setCohetepaperbool(true);
} else {
this.setCohetepaperbool(true);
}
}
}else{
//智能组卷
this.setIntelligentformation(true);
} else {
//智能组卷
this.setIntelligentformation(true);
}
}
@ -264,32 +248,32 @@ class Paperreview extends Component {
}
setCohetepaperbool =(bool)=>{
this.setState({
Cohetepaperbool:bool
})
setCohetepaperbool = (bool) => {
this.setState({
Cohetepaperbool: bool
})
}
getcontentMdRef = (Ref) => {
this.contentMdRef = Ref;
}
setnewmyshixunmodelbool=(bool)=>{
//人工组卷
if(bool===true){
let scrollToTop = window.setInterval(function() {
let pos = window.pageYOffset;
if ( pos > 0 ) {
window.scrollTo( 0, pos - 20 ); // how far to scroll on each step
} else {
window.clearInterval( scrollToTop );
}
}, 2);
}
this.setState({
newmyshixunmodelbool:bool
})
var data = {}
this.getdata(data);
setnewmyshixunmodelbool = (bool) => {
//人工组卷
if (bool === true) {
let scrollToTop = window.setInterval(function () {
let pos = window.pageYOffset;
if (pos > 0) {
window.scrollTo(0, pos - 20); // how far to scroll on each step
} else {
window.clearInterval(scrollToTop);
}
}, 2);
}
this.setState({
newmyshixunmodelbool: bool
})
var data = {}
this.getdata(data);
@ -297,27 +281,27 @@ class Paperreview extends Component {
}
//换题型
Replacementtype=(value)=>{
var item_types="";
if(value==="单选题"){
item_types="SINGLE";
Replacementtype = (value) => {
var item_types = "";
if (value === "单选题") {
item_types = "SINGLE";
}
else if(value==="多选题"){
item_types="MULTIPLE";
else if (value === "多选题") {
item_types = "MULTIPLE";
}
else if(value==="判断题"){
item_types="JUDGMENT";
else if (value === "判断题") {
item_types = "JUDGMENT";
}
else if(value==="编程题"){
item_types="PROGRAM";
else if (value === "编程题") {
item_types = "PROGRAM";
}
const url=`/examination_intelligent_settings/${this.props.match.params.id}/exchange_items.json`;
let data={
item_type:item_types,
}
const url = `/examination_intelligent_settings/${this.props.match.params.id}/exchange_items.json`;
let data = {
item_type: item_types,
}
axios.post(url, data)
.then((result) => {
if (result.data.status == 0) {
@ -326,14 +310,14 @@ class Paperreview extends Component {
this.getdata(data);
}
}).catch((error) => {
//console.log(error);
})
//console.log(error);
})
}
//换题
Changingtopics=(id)=>{
const url=`/examination_intelligent_settings/${this.props.match.params.id}/exchange_one_item.json`;
let data={
item_id:id,
Changingtopics = (id) => {
const url = `/examination_intelligent_settings/${this.props.match.params.id}/exchange_one_item.json`;
let data = {
item_id: id,
}
axios.post(url, data)
.then((result) => {
@ -343,23 +327,23 @@ class Paperreview extends Component {
this.getdata(data);
}
}).catch((error) => {
//console.log(error);
})
//console.log(error);
})
}
setIntelligentformation=(bool)=>{
setIntelligentformation = (bool) => {
this.setState({
Intelligentformation:bool
Intelligentformation: bool
})
}
Confirmationofvolumeformations=()=>{
Confirmationofvolumeformations = () => {
this.setState({
Intelligentformation:false
Intelligentformation: false
})
}
render() {
let {page, limit, count, Headertop, visible, placement, modalsType, item_type,artificialtype,Cohetepaperbool,newmyshixunmodelbool,Intelligentformation} = this.state;
let { page, limit, count, Headertop, visible, placement, modalsType, item_type, artificialtype, Cohetepaperbool, newmyshixunmodelbool, Intelligentformation } = this.state;
const params = this.props && this.props.match && this.props.match.params;
// ////console.log(params);
return (
@ -367,24 +351,24 @@ class Paperreview extends Component {
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
>
{
Intelligentformation===true?
<IntelligentModel getdata={(data)=>this.getdata(data)} {...this.state} {...this.props} exam_id={this.props.match.params.id} Confirmationofvolumeformations={()=>this.Confirmationofvolumeformations()}></IntelligentModel>
:""
Intelligentformation === true ?
<IntelligentModel getdata={(data) => this.getdata(data)} {...this.state} {...this.props} exam_id={this.props.match.params.id} Confirmationofvolumeformations={() => this.Confirmationofvolumeformations()}></IntelligentModel>
: ""
}
{
newmyshixunmodelbool===true?
newmyshixunmodelbool === true ?
<style>{
`
body{ overflow: hidden !important; }
`
}</style>
:""
: ""
}
{
newmyshixunmodelbool===true?
newmyshixunmodelbool === true ?
<div className="fangdatwo">
<NewMyShixunModel {...this.props} {...this.state} exam_id={this.props.match.params.id} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}></NewMyShixunModel>
<NewMyShixunModel {...this.props} {...this.state} exam_id={this.props.match.params.id} setnewmyshixunmodelbool={(e) => this.setnewmyshixunmodelbool(e)}></NewMyShixunModel>
</div>
:
""
@ -403,8 +387,8 @@ class Paperreview extends Component {
<div className="w1200ms">
<div className="w100s mt30">
{
Cohetepaperbool===false?
artificialtype==="artificial"?
Cohetepaperbool === false ?
artificialtype === "artificial" ?
<Breadcrumb separator=">">
<Breadcrumb.Item href="/question">试题库</Breadcrumb.Item>
<Breadcrumb.Item className={"xiaoshou"}>人工组卷</Breadcrumb.Item>
@ -426,14 +410,14 @@ class Paperreview extends Component {
</div>
{
Cohetepaperbool===false?
<Paperreview_item {...this.state} {...this.props} Changingtopics={(e)=>this.Changingtopics(e)} Replacementtype={(e)=>this.Replacementtype(e)} getdata={(data)=>this.getdata(data)} setnewmyshixunmodelbool={(e)=>this.setnewmyshixunmodelbool(e)}>
Cohetepaperbool === false ?
<Paperreview_item {...this.state} {...this.props} Changingtopics={(e) => this.Changingtopics(e)} Replacementtype={(e) => this.Replacementtype(e)} getdata={(data) => this.getdata(data)} setnewmyshixunmodelbool={(e) => this.setnewmyshixunmodelbool(e)}>
</Paperreview_item>
:
<Comthetestpaperst {...this.state} {...this.props}
getJudquestio={(ref) => this.getcontentMdRef(ref)}
setitem_type={(item) => this.setitem_type(item)}
getJudquestio={(ref) => this.getcontentMdRef(ref)}
setitem_type={(item) => this.setitem_type(item)}
></Comthetestpaperst>
}
@ -447,9 +431,9 @@ class Paperreview extends Component {
</div>
<Bottomsubmit {...this.props} {...this.state} bottomvalue={Cohetepaperbool===false?"保存组卷":"完成"}
setCohetepaperbool={(bool)=>this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/question'}></Bottomsubmit>
<Bottomsubmit {...this.props} {...this.state} bottomvalue={Cohetepaperbool === false ? "保存组卷" : "完成"}
setCohetepaperbool={(bool) => this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/question'}></Bottomsubmit>
</div>
)

File diff suppressed because it is too large Load Diff

@ -1,18 +1,8 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
import React, { Component } from "react";
import { SnackbarHOC } from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb
} from "antd";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import { Breadcrumb } from "antd";
import TPMIndexHOC from "../tpm/TPMIndexHOC";
import Itembankstop from "./component/Itembankstop";
import './questioncss/questioncom.css';
import '../tpm/newshixuns/css/Newshixuns.css';
@ -35,7 +25,7 @@ class Questionitem_banks extends Component {
myquestion_choicesco: [],
disciplinesdata: [],
knowledgepoints: [],
disciplmy:[]
disciplmy: []
}
}
@ -115,7 +105,7 @@ class Questionitem_banks extends Component {
const didata = response.data.disciplines;
for (var i = 0; i < didata.length; i++) {
const childern=[];
const childern = [];
//方向
const fxdidata = didata[i].sub_disciplines;
@ -137,7 +127,7 @@ class Questionitem_banks extends Component {
}
}
const datakec={
const datakec = {
value: didata[i].id,
label: didata[i].name,
children: childern,
@ -147,7 +137,7 @@ class Questionitem_banks extends Component {
this.setState({
knowledgepoints: this.state.knowledgepoints,
disciplmy:this.state.disciplmy,
disciplmy: this.state.disciplmy,
})
@ -225,15 +215,15 @@ class Questionitem_banks extends Component {
// "编辑"
}
if (this.contentMdRef.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return;
}
if (this.contentMdRef.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return;
}
var Getdatasdata=this.contentMdRef.Getdatas();
if (this.state.item_type === null) {
return
}
var Getdatasdata = this.contentMdRef.Getdatas();
if (this.state.item_type === null) {
return
}
if (this.state.item_type === "SINGLE") {
@ -260,18 +250,18 @@ class Questionitem_banks extends Component {
// repertoire_id:1,
// sub_repertoire_id:1,
// tag_repertoire_id:[1,3],
var myrbkc=[];
var Getdatasdatas=Getdatasdata[2].rbzsd;
for(let myda of Getdatasdatas) {
var myrbkc = [];
var Getdatasdatas = Getdatasdata[2].rbzsd;
for (let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
var data = {
discipline_id: Getdatasdata[3].rbkc[0],
sub_discipline_id: Getdatasdata[3].rbkc[1],
sub_discipline_id: Getdatasdata[3].rbkc[1],
tag_discipline_id: myrbkc,
name: anserdata[0],
item_type: Getdatasdata[1].rbtx,
difficulty:Getdatasdata[0].rbnd,
difficulty: Getdatasdata[0].rbnd,
analysis: anserdata[3],
choices: choices,
@ -287,8 +277,8 @@ class Questionitem_banks extends Component {
}
}).catch((error) => {
////console.log(error);
})
////console.log(error);
})
} else {
axios.put(url, data)
.then((result) => {
@ -299,8 +289,8 @@ class Questionitem_banks extends Component {
}
}).catch((error) => {
////console.log(error);
})
////console.log(error);
})
}
@ -338,18 +328,18 @@ class Questionitem_banks extends Component {
}
var myrbkc=[];
var Getdatasdatas=Getdatasdata[2].rbzsd;
for(let myda of Getdatasdatas) {
var myrbkc = [];
var Getdatasdatas = Getdatasdata[2].rbzsd;
for (let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
var data = {
discipline_id: Getdatasdata[3].rbkc[0],
sub_discipline_id: Getdatasdata[3].rbkc[1],
sub_discipline_id: Getdatasdata[3].rbkc[1],
tag_discipline_id: myrbkc,
name: anserdata[0],
item_type: Getdatasdata[1].rbtx,
difficulty:Getdatasdata[0].rbnd,
difficulty: Getdatasdata[0].rbnd,
analysis: anserdata[3],
choices: choices,
@ -366,8 +356,8 @@ class Questionitem_banks extends Component {
}
}).catch((error) => {
////console.log(error);
})
////console.log(error);
})
} else {
axios.put(url, data)
@ -379,8 +369,8 @@ class Questionitem_banks extends Component {
}
}).catch((error) => {
////console.log(error);
})
////console.log(error);
})
}
@ -407,18 +397,18 @@ class Questionitem_banks extends Component {
is_answer: anserdata[1] === "1" ? 1 : 0,
}
choices.push(choicesdatas);
var myrbkc=[];
var Getdatasdatas=Getdatasdata[2].rbzsd;
for(let myda of Getdatasdatas) {
var myrbkc = [];
var Getdatasdatas = Getdatasdata[2].rbzsd;
for (let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
var data = {
discipline_id: Getdatasdata[3].rbkc[0],
sub_discipline_id: Getdatasdata[3].rbkc[1],
sub_discipline_id: Getdatasdata[3].rbkc[1],
tag_discipline_id: myrbkc,
name: anserdata[0],
item_type: Getdatasdata[1].rbtx,
difficulty:Getdatasdata[0].rbnd,
difficulty: Getdatasdata[0].rbnd,
analysis: anserdata[2],
choices: choices,
@ -432,8 +422,8 @@ class Questionitem_banks extends Component {
}
}).catch((error) => {
////console.log(error);
})
////console.log(error);
})
} else {
axios.put(url, data)
@ -444,8 +434,8 @@ class Questionitem_banks extends Component {
}
}).catch((error) => {
////console.log(error);
})
////console.log(error);
})
}
@ -454,9 +444,9 @@ class Questionitem_banks extends Component {
}
if (this.state.item_type === "PROGRAM") {
//编程题 跳转到 oj 中创建
var myrbkc=[];
var Getdatasdatas=Getdatasdata[2].rbzsd;
for(let myda of Getdatasdatas) {
var myrbkc = [];
var Getdatasdatas = Getdatasdata[2].rbzsd;
for (let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
@ -480,7 +470,7 @@ class Questionitem_banks extends Component {
}
render() {
let {page, limit, count, Headertop, visible, placement, modalsType, item_type} = this.state;
let { page, limit, count, Headertop, visible, placement, modalsType, item_type } = this.state;
const params = this.props && this.props.match && this.props.match.params;
// ////console.log(params);
return (
@ -516,48 +506,48 @@ class Questionitem_banks extends Component {
</Itembankstop>
<div >
{
item_type && item_type === "SINGLE" ?
<div className=" clearfix educontent w100s w1200fpx mt19">
<SingleEditor
{...this.state}
{...this.props}
getanswerMdRef={(ref) => this.getanswerMdRef(ref)}
>
</SingleEditor>
</div>
: item_type && item_type === "MULTIPLE" ?
<div className=" clearfix educontent w100s w1200fpx mt19">
<ChoquesEditor
{...this.state}
{...this.props}
getanswerMdRef={(ref) => this.getChoquesEditor(ref)}
>
</ChoquesEditor>
</div>
: item_type && item_type === "JUDGMENT" ?
{
item_type && item_type === "SINGLE" ?
<div className=" clearfix educontent w100s w1200fpx mt19">
<JudquestionEditor
<SingleEditor
{...this.state}
{...this.props}
item_banksedit={this.state.item_banksedit}
getanswerMdRef={(ref) => this.getJudquestio(ref)}
getanswerMdRef={(ref) => this.getanswerMdRef(ref)}
>
</JudquestionEditor>
</SingleEditor>
</div>
: item_type && item_type === "PROGRAM" ?
""
: ""
}
</div>
: item_type && item_type === "MULTIPLE" ?
<div className=" clearfix educontent w100s w1200fpx mt19">
<ChoquesEditor
{...this.state}
{...this.props}
getanswerMdRef={(ref) => this.getChoquesEditor(ref)}
>
</ChoquesEditor>
</div>
: item_type && item_type === "JUDGMENT" ?
<div className=" clearfix educontent w100s w1200fpx mt19">
<JudquestionEditor
{...this.state}
{...this.props}
item_banksedit={this.state.item_banksedit}
getanswerMdRef={(ref) => this.getJudquestio(ref)}
>
</JudquestionEditor>
</div>
: item_type && item_type === "PROGRAM" ?
""
: ""
}
</div>
</div>
@ -567,7 +557,7 @@ class Questionitem_banks extends Component {
""
:
<Bottomsubmit {...this.props} {...this.state} bottomvalue={item_type === "PROGRAM" ? "创建" : "保存"}
onSubmits={() => this.preservation()} url={item_type === "PROGRAM" ?'/problems':'/question'}></Bottomsubmit>
onSubmits={() => this.preservation()} url={item_type === "PROGRAM" ? '/problems' : '/question'}></Bottomsubmit>
}
</div>
)

@ -1,6 +1,6 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
import React, { Component } from "react";
import { Link, NavLink } from 'react-router-dom';
import { WordsBtn, ActionBtn, SnackbarHOC, getImageUrl } from 'educoder';
import axios from 'axios';
import {
notification,
@ -12,7 +12,7 @@ import {
Button,
Breadcrumb
} from "antd";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import TPMIndexHOC from "../tpm/TPMIndexHOC";
import './testioncss/testioncss.css';
import '../tpm/newshixuns/css/Newshixuns.css';
import Bottomsubmit from "../../modules/modals/Bottomsubmit";
@ -29,11 +29,11 @@ class Intecomponents extends Component {
knowledgepoints: [],
disciplmy: [],
item_banksedit: [],
newmyshixunmodelbool:false,
single_question_count:0,
multiple_question_count:0,
judgement_question_count:0,
program_question_count:0,
newmyshixunmodelbool: false,
single_question_count: 0,
multiple_question_count: 0,
judgement_question_count: 0,
program_question_count: 0,
}
@ -111,107 +111,107 @@ class Intecomponents extends Component {
}
//难度
getdatas=()=>{
if (this.Judquestio.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return false;
}
//console.log(this.Judquestio.Getdatas());
var myrbkc=[];
var Getdatasdatas=this.Judquestio.Getdatas()[1].rbzsd;
for(let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
const url="/examination_intelligent_settings/optinal_items.json";
var data={
sub_discipline_id:this.Judquestio.Getdatas()[2].rbkc[1],
tag_discipline_id:myrbkc,
source:this.Judquestio.Getdatas()[7].rbly,
difficulty:this.Judquestio.Getdatas()[0].rbnd,
getdatas = () => {
if (this.Judquestio.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return false;
}
//console.log(this.Judquestio.Getdatas());
var myrbkc = [];
var Getdatasdatas = this.Judquestio.Getdatas()[1].rbzsd;
for (let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
const url = "/examination_intelligent_settings/optinal_items.json";
var data = {
sub_discipline_id: this.Judquestio.Getdatas()[2].rbkc[1],
tag_discipline_id: myrbkc,
source: this.Judquestio.Getdatas()[7].rbly,
difficulty: this.Judquestio.Getdatas()[0].rbnd,
}
this.getwangluodata(url,data);
this.getwangluodata(url, data);
}
//课程
getdatasss=(kech)=>{
getdatasss = (kech) => {
if (this.Judquestio.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return false;
}
//console.log(this.Judquestio.Getdatas());
var myrbkc=[];
var Getdatasdatas=this.Judquestio.Getdatas()[1].rbzsd;
for(let myda of Getdatasdatas) {
var myrbkc = [];
var Getdatasdatas = this.Judquestio.Getdatas()[1].rbzsd;
for (let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
const url="/examination_intelligent_settings/optinal_items.json";
var data={
sub_discipline_id:kech,
tag_discipline_id:myrbkc,
source:this.Judquestio.Getdatas()[7].rbly,
difficulty:this.Judquestio.Getdatas()[0].rbnd,
const url = "/examination_intelligent_settings/optinal_items.json";
var data = {
sub_discipline_id: kech,
tag_discipline_id: myrbkc,
source: this.Judquestio.Getdatas()[7].rbly,
difficulty: this.Judquestio.Getdatas()[0].rbnd,
}
this.getwangluodata(url,data);
this.getwangluodata(url, data);
}
//知识点
getdatassss=(zhishidian)=>{
getdatassss = (zhishidian) => {
if (this.Judquestio.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return false;
}
//console.log(this.Judquestio.Getdatas());
var myrbkc=[];
var Getdatasdatas=zhishidian;
for(let myda of Getdatasdatas) {
var myrbkc = [];
var Getdatasdatas = zhishidian;
for (let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
const url="/examination_intelligent_settings/optinal_items.json";
var data={
sub_discipline_id:this.Judquestio.Getdatas()[2].rbkc[1],
tag_discipline_id:myrbkc,
source:this.Judquestio.Getdatas()[7].rbly,
difficulty:this.Judquestio.Getdatas()[0].rbnd,
const url = "/examination_intelligent_settings/optinal_items.json";
var data = {
sub_discipline_id: this.Judquestio.Getdatas()[2].rbkc[1],
tag_discipline_id: myrbkc,
source: this.Judquestio.Getdatas()[7].rbly,
difficulty: this.Judquestio.Getdatas()[0].rbnd,
}
this.getwangluodata(url,data);
this.getwangluodata(url, data);
}
//来源
getdatassssy=(rbly)=>{
getdatassssy = (rbly) => {
if (this.Judquestio.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return false;
}
//console.log(this.Judquestio.Getdatas());
var myrbkc=[];
var Getdatasdatas=this.Judquestio.Getdatas()[1].rbzsd;
for(let myda of Getdatasdatas) {
var myrbkc = [];
var Getdatasdatas = this.Judquestio.Getdatas()[1].rbzsd;
for (let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
const url="/examination_intelligent_settings/optinal_items.json";
var data={
sub_discipline_id:this.Judquestio.Getdatas()[2].rbkc[1],
tag_discipline_id:myrbkc,
source:rbly,
difficulty:this.Judquestio.Getdatas()[0].rbnd,
const url = "/examination_intelligent_settings/optinal_items.json";
var data = {
sub_discipline_id: this.Judquestio.Getdatas()[2].rbkc[1],
tag_discipline_id: myrbkc,
source: rbly,
difficulty: this.Judquestio.Getdatas()[0].rbnd,
}
this.getwangluodata(url,data);
this.getwangluodata(url, data);
}
getwangluodata=(url,data)=>{
axios.post(url,data).then((response) => {
getwangluodata = (url, data) => {
axios.post(url, data).then((response) => {
if (response) {
//console.log("智能组卷");
//console.log(response);
if(response.data){
if (response.data) {
this.setState({
single_question_count:response.data.single_question_count,
multiple_question_count:response.data.multiple_question_count,
judgement_question_count:response.data.judgement_question_count,
program_question_count:response.data.program_question_count,
single_question_count: response.data.single_question_count,
multiple_question_count: response.data.multiple_question_count,
judgement_question_count: response.data.judgement_question_count,
program_question_count: response.data.program_question_count,
})
}
@ -220,35 +220,35 @@ class Intecomponents extends Component {
});
}
//难度
getdatass=(nandu)=>{
getdatass = (nandu) => {
if (this.Judquestio.Getdatas().length === 0) {
this.scrollToAnchor("Itembankstopid");
return false;
}
//console.log(this.Judquestio.Getdatas());
var myrbkc=[];
var Getdatasdatas=this.Judquestio.Getdatas()[1].rbzsd;
for(let myda of Getdatasdatas) {
var myrbkc = [];
var Getdatasdatas = this.Judquestio.Getdatas()[1].rbzsd;
for (let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
const url="/examination_intelligent_settings/optinal_items.json";
var data={
sub_discipline_id:this.Judquestio.Getdatas()[2].rbkc[1],
tag_discipline_id:myrbkc,
source:this.Judquestio.Getdatas()[7].rbly,
difficulty:nandu,
const url = "/examination_intelligent_settings/optinal_items.json";
var data = {
sub_discipline_id: this.Judquestio.Getdatas()[2].rbkc[1],
tag_discipline_id: myrbkc,
source: this.Judquestio.Getdatas()[7].rbly,
difficulty: nandu,
}
axios.post(url,data).then((response) => {
axios.post(url, data).then((response) => {
if (response) {
//console.log("智能组卷");
//console.log(response);
if(response.data){
if (response.data) {
this.setState({
single_question_count:response.data.single_question_count,
multiple_question_count:response.data.multiple_question_count,
judgement_question_count:response.data.judgement_question_count,
program_question_count:response.data.program_question_count,
single_question_count: response.data.single_question_count,
multiple_question_count: response.data.multiple_question_count,
judgement_question_count: response.data.judgement_question_count,
program_question_count: response.data.program_question_count,
})
}
@ -286,9 +286,9 @@ class Intecomponents extends Component {
this.scrollToAnchor("Itembankstopid");
return;
}
var myrbkc=[];
var Getdatasdatas=this.Judquestio.Getdatas()[1].rbzsd;
for(let myda of Getdatasdatas) {
var myrbkc = [];
var Getdatasdatas = this.Judquestio.Getdatas()[1].rbzsd;
for (let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
// //console.log(myrbkc);
@ -296,7 +296,7 @@ class Intecomponents extends Component {
// //console.log(this.Judquestio.Getdatas());
var question_settings =[
var question_settings = [
{
"item_type": "SINGLE",
"count": this.Judquestio.Getdatas()[3].rbdxt
@ -316,14 +316,14 @@ class Intecomponents extends Component {
]
const url="/examination_intelligent_settings.json"
const url = "/examination_intelligent_settings.json"
var data = {
discipline_id: this.Judquestio.Getdatas()[2].rbkc[0],
sub_discipline_id:this.Judquestio.Getdatas()[2].rbkc[1],
tag_discipline_id:myrbkc,
source:this.Judquestio.Getdatas()[7].rbly,
difficulty:this.Judquestio.Getdatas()[0].rbnd,
question_settings:question_settings,
sub_discipline_id: this.Judquestio.Getdatas()[2].rbkc[1],
tag_discipline_id: myrbkc,
source: this.Judquestio.Getdatas()[7].rbly,
difficulty: this.Judquestio.Getdatas()[0].rbnd,
question_settings: question_settings,
}
axios.post(url, data)
.then((result) => {
@ -332,8 +332,8 @@ class Intecomponents extends Component {
this.props.history.push(`/Integeneration/Intelligence/${result.data.exam_setting_id}`);
}
}).catch((error) => {
//console.log(error);
})
//console.log(error);
})
}
@ -350,12 +350,12 @@ class Intecomponents extends Component {
this.contentMdRef = Ref;
}
setnewmyshixunmodelbool=()=>{
setnewmyshixunmodelbool = () => {
}
render() {
let {paperlibrartdata,newmyshixunmodelbool,single_question_count,multiple_question_count,judgement_question_count,program_question_count} = this.state;
let { paperlibrartdata, newmyshixunmodelbool, single_question_count, multiple_question_count, judgement_question_count, program_question_count } = this.state;
const params = this.props && this.props.match && this.props.match.params;
return (
<div>
@ -379,16 +379,16 @@ class Intecomponents extends Component {
</Breadcrumb>
</div>
<Intelligentcomponents {...this.state} {...this.props}
single_question_count={this.state.single_question_count}
multiple_question_count={this.state.multiple_question_count}
judgement_question_count={this.state.judgement_question_count}
program_question_count={this.state.program_question_count}
getdatas={()=>this.getdatas()}
getdatass={(nd)=>this.getdatass(nd)}
getJudquestio={(ref) => this.getJudquestio(ref)}
getdatasss={(e)=>this.getdatasss(e)}
getdatassss={(e)=>this.getdatassss(e)}
getdatassssy={(e)=>this.getdatassssy(e)}
single_question_count={this.state.single_question_count}
multiple_question_count={this.state.multiple_question_count}
judgement_question_count={this.state.judgement_question_count}
program_question_count={this.state.program_question_count}
getdatas={() => this.getdatas()}
getdatass={(nd) => this.getdatass(nd)}
getJudquestio={(ref) => this.getJudquestio(ref)}
getdatasss={(e) => this.getdatasss(e)}
getdatassss={(e) => this.getdatassss(e)}
getdatassssy={(e) => this.getdatassssy(e)}
></Intelligentcomponents>
@ -401,9 +401,9 @@ class Intecomponents extends Component {
{
newmyshixunmodelbool === true ? "" :
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"保存"}
Cohetepaperbool={false}
setCohetepaperbool={(bool) => this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit>
Cohetepaperbool={false}
setCohetepaperbool={(bool) => this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit>
}
</div>
)

@ -4,7 +4,7 @@ import axios from 'axios';
import {
Breadcrumb
} from "antd";
import { TPMIndexHOC } from "../tpm/TPMIndexHOC";
import TPMIndexHOC from "../tpm/TPMIndexHOC";
import './testioncss/testioncss.css';
import '../tpm/newshixuns/css/Newshixuns.css';
import Bottomsubmit from "../../modules/modals/Bottomsubmit";

@ -1,19 +1,8 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
import React, { Component } from "react";
import { SnackbarHOC } from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb
} from "antd";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import NoneData from './component/NoneData';
import { Breadcrumb } from "antd";
import TPMIndexHOC from "../tpm/TPMIndexHOC";
import './testioncss/testioncss.css';
import '../tpm/newshixuns/css/Newshixuns.css';
import Bottomsubmit from "../../modules/modals/Bottomsubmit";
@ -25,7 +14,7 @@ class Paperlibraryseeid extends Component {
super(props);
this.contentMdRef = React.createRef();
this.state = {
paperlibrartdata:[],
paperlibrartdata: [],
}
@ -85,14 +74,14 @@ class Paperlibraryseeid extends Component {
}
setCohetepaperbool =(bool)=>{
setCohetepaperbool = (bool) => {
}
getcontentMdRef = (Ref) => {
this.contentMdRef = Ref;
}
render() {
let {paperlibrartdata} = this.state;
let { paperlibrartdata } = this.state;
const params = this.props && this.props.match && this.props.match.params;
// ////console.log(params);
return (
@ -112,21 +101,21 @@ class Paperlibraryseeid extends Component {
</style>
<div className="w1200ms">
<div className="w100s mt30">
<Breadcrumb separator=">">
<Breadcrumb.Item href="/paperlibrary">试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>公告试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>试卷查看</Breadcrumb.Item>
</Breadcrumb>
<Breadcrumb separator=">">
<Breadcrumb.Item href="/paperlibrary">试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>公告试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>试卷查看</Breadcrumb.Item>
</Breadcrumb>
</div>
<div className="seesjtit intermediatecenter mt16">
{paperlibrartdata&&paperlibrartdata.exam&&paperlibrartdata.exam.name}
{paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.name}
</div>
<div className=" clearfix educontent Contentquestionbankstyle w100s w1200wuh mt19">
<Seeoagertit all_score={paperlibrartdata&&paperlibrartdata.exam&&paperlibrartdata.exam.all_questions_count}
all_questions_count={paperlibrartdata&&paperlibrartdata.exam&&paperlibrartdata.exam.all_score}
<Seeoagertit all_score={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_questions_count}
all_questions_count={paperlibrartdata && paperlibrartdata.exam && paperlibrartdata.exam.all_score}
>
@ -135,17 +124,17 @@ class Paperlibraryseeid extends Component {
<Paperlibraryseeid_item
{...this.state}
{...this.props}
getdata={()=>this.getdata()}
single_questions={paperlibrartdata&&paperlibrartdata.single_questions&&paperlibrartdata.single_questions.questions.length>0?paperlibrartdata.single_questions:null}
multiple_questions={paperlibrartdata&&paperlibrartdata.multiple_questions
&&paperlibrartdata.multiple_questions.questions.length>0?paperlibrartdata.multiple_questions:null
}
judgement_questions={paperlibrartdata&&paperlibrartdata.judgement_questions
&&paperlibrartdata.judgement_questions.questions.length>0?paperlibrartdata.judgement_questions:null
}
program_questions={paperlibrartdata&&paperlibrartdata.program_questions
&&paperlibrartdata.program_questions.questions.length>0?paperlibrartdata.program_questions:null
}
getdata={() => this.getdata()}
single_questions={paperlibrartdata && paperlibrartdata.single_questions && paperlibrartdata.single_questions.questions.length > 0 ? paperlibrartdata.single_questions : null}
multiple_questions={paperlibrartdata && paperlibrartdata.multiple_questions
&& paperlibrartdata.multiple_questions.questions.length > 0 ? paperlibrartdata.multiple_questions : null
}
judgement_questions={paperlibrartdata && paperlibrartdata.judgement_questions
&& paperlibrartdata.judgement_questions.questions.length > 0 ? paperlibrartdata.judgement_questions : null
}
program_questions={paperlibrartdata && paperlibrartdata.program_questions
&& paperlibrartdata.program_questions.questions.length > 0 ? paperlibrartdata.program_questions : null
}
>
@ -170,8 +159,8 @@ class Paperlibraryseeid extends Component {
</div>
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"发起考试"}
setCohetepaperbool={(bool)=>this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit>
setCohetepaperbool={(bool) => this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit>
</div>
)

@ -1,17 +1,8 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
import React, { Component } from "react";
import { SnackbarHOC } from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input
} from "antd";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import NoneData from './component/NoneData';
import { Pagination, } from "antd";
import TPMIndexHOC from "../tpm/TPMIndexHOC";
import './testioncss/testioncss.css';
import Contentpart from "./component/Contentpart";
import SiderBar from "../tpm/SiderBar";
@ -23,23 +14,23 @@ class Testpaperlibrary extends Component {
super(props);
this.state = {
Headertop: "",
disciplinesdata:null,
discipline_id:null,
sub_discipline_id:null,
tag_discipline_id:null,
public:null,
difficulty:null,
item_type:null,
keywords:null,
page:1,
per_page:10,
booljupyterurls:false,
Contentdata:[],
items_count:0,
defaultActiveKey:"1",
modalsTypes:false,
modalsType:false,
timuid:0,
disciplinesdata: null,
discipline_id: null,
sub_discipline_id: null,
tag_discipline_id: null,
public: null,
difficulty: null,
item_type: null,
keywords: null,
page: 1,
per_page: 10,
booljupyterurls: false,
Contentdata: [],
items_count: 0,
defaultActiveKey: "1",
modalsTypes: false,
modalsType: false,
timuid: 0,
}
}
getContainer = () => {
@ -66,9 +57,11 @@ class Testpaperlibrary extends Component {
});
//获取题库筛选资料
let urls = `/disciplines.json`;
axios.get(urls, {params: {
source:"question"
}}).then((response) => {
axios.get(urls, {
params: {
source: "question"
}
}).then((response) => {
if (response) {
this.setState({
disciplinesdata: response.data.disciplines,
@ -77,19 +70,19 @@ class Testpaperlibrary extends Component {
});
}
paginationonChange=(pages)=>{
paginationonChange = (pages) => {
this.setState({
page:pages
page: pages
})
var data={
page:pages,
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
var data = {
page: pages,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
keywords: null,
per_page:10,
per_page: 10,
}
this.getdata(data);
}
@ -105,50 +98,50 @@ class Testpaperlibrary extends Component {
this.setState({
keywords: value,
})
var data={
page:this.state.page,
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
var data = {
page: this.state.page,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
keywords: value,
per_page:10,
per_page: 10,
}
this.getdata(data);
}
callback = (key) => {
this.setState({
defaultActiveKey: key,
difficulty:null,
keywords:null,
page:1,
difficulty: null,
keywords: null,
page: 1,
})
var data={
page:1,
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
var data = {
page: 1,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: key,
difficulty:null,
difficulty: null,
keywords: null,
per_page:10,
per_page: 10,
}
this.getdata(data);
}
//获取数据
getdata=(data)=>{
getdata = (data) => {
const url = `/examination_banks.json`;
this.setState({
booljupyterurls:true,
booljupyterurls: true,
})
axios.get((url), {params: data}).then((response) => {
setTimeout(()=>{
axios.get((url), { params: data }).then((response) => {
setTimeout(() => {
this.setState({
booljupyterurls:false,
booljupyterurls: false,
})
},1000);
}, 1000);
if (response === null || response === undefined) {
return
@ -167,88 +160,88 @@ class Testpaperlibrary extends Component {
}).catch((error) => {
//////console.log(error)
this.setState({
booljupyterurls:false,
booljupyterurls: false,
})
});
}
setdiscipline_id=(discipline_id)=>{
setdiscipline_id = (discipline_id) => {
this.setState({
discipline_id:discipline_id,
sub_discipline_id:null,
tag_discipline_id:null,
keywords:null,
discipline_id: discipline_id,
sub_discipline_id: null,
tag_discipline_id: null,
keywords: null,
page: 1,
per_page:10,
per_page: 10,
})
var data = {
discipline_id:discipline_id,
sub_discipline_id:null,
tag_discipline_id:null,
discipline_id: discipline_id,
sub_discipline_id: null,
tag_discipline_id: null,
public: this.state.defaultActiveKey,
difficulty: this.props.difficulty,
keywords: null,
page: 1,
per_page:10,
per_page: 10,
};
this.getdata(data);
}
setsub_discipline_id=(discipline_id,sub_discipline_id)=>{
setsub_discipline_id = (discipline_id, sub_discipline_id) => {
this.setState({
sub_discipline_id:sub_discipline_id,
tag_discipline_id:null,
keywords:null,
page:1,
per_page:10,
sub_discipline_id: sub_discipline_id,
tag_discipline_id: null,
keywords: null,
page: 1,
per_page: 10,
})
var data = {
discipline_id:discipline_id,
sub_discipline_id:sub_discipline_id,
tag_discipline_id:null,
discipline_id: discipline_id,
sub_discipline_id: sub_discipline_id,
tag_discipline_id: null,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
keywords: null,
page:1,
per_page:10,
page: 1,
per_page: 10,
};
this.getdata(data);
}
settag_discipline_id=(tag_discipline_id)=>{
settag_discipline_id = (tag_discipline_id) => {
this.setState({
tag_discipline_id:tag_discipline_id,
keywords:null,
page:1,
per_page:10,
tag_discipline_id: tag_discipline_id,
keywords: null,
page: 1,
per_page: 10,
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
keywords: null,
page: 1,
per_page:10,
per_page: 10,
};
this.getdata(data);
}
modalCancels=()=>{
modalCancels = () => {
this.setState({
modalsTypes: false
})
}
setDownloads=(item_type)=>{
setDownloads = (item_type) => {
this.Deletebigquestiontype(item_type);
this.setState({
modalsTypes: false
})
}
//删除大题型
Deletebigquestiontype =(item_type)=>{
Deletebigquestiontype = (item_type) => {
}
modalCancel = () => {
@ -279,20 +272,20 @@ class Testpaperlibrary extends Component {
if (result.data.status == 0) {
// this.props.showNotification(`公开试卷成功`);
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
keywords: this.state.keywords,
page: this.state.page,
per_page:10,
per_page: 10,
};
this.getdata(data);
}
}).catch((error) => {
////console.log(error);
})
////console.log(error);
})
}
//删除试卷
@ -305,14 +298,14 @@ class Testpaperlibrary extends Component {
// this.props.showNotification('删除试卷成功');
// props.history.push(response.data.right_url)
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
keywords: this.state.keywords,
page: this.state.page,
per_page:10,
per_page: 10,
};
this.getdata(data);
}
@ -332,7 +325,7 @@ class Testpaperlibrary extends Component {
})
};
Testpapereditor=(id)=>{
Testpapereditor = (id) => {
this.props.history.push(`/paperlibrary/edit/${id}`);
}
@ -349,24 +342,24 @@ class Testpaperlibrary extends Component {
})
};
setdifficulty=(difficulty)=>{
setdifficulty = (difficulty) => {
this.setState({
difficulty: difficulty,
visiblemys: false,
keywords:"",
keywords: "",
page: 1,
per_page:10,
per_page: 10,
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: difficulty,
keywords:null,
page:1,
per_page:10,
keywords: null,
page: 1,
per_page: 10,
};
this.getdata(data);
@ -379,21 +372,21 @@ class Testpaperlibrary extends Component {
this.setState({
item_type: item_type,
visiblemyss: false,
keywords:null,
keywords: null,
page: 1,
per_page:10,
per_page: 10,
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: item_type,
keywords:"",
keywords: "",
page: 1,
per_page:10,
per_page: 10,
};
this.getdata(data);
@ -403,55 +396,55 @@ class Testpaperlibrary extends Component {
render() {
let{Headertop,items_count,page,per_page,modalsTypes,modalsType}=this.state;
let { Headertop, items_count, page, per_page, modalsTypes, modalsType } = this.state;
const isysladmins=this.props&&this.props.current_user&&this.props.current_user.admin?this.props.current_user.admin:false;
const is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
const isysladmins = this.props && this.props.current_user && this.props.current_user.admin ? this.props.current_user.admin : false;
const is_teacher = this.props && this.props.current_user && this.props.current_user.is_teacher ? this.props.current_user.is_teacher : false;
const professional_certification = this.props && this.props.current_user && this.props.current_user.professional_certification ? this.props.current_user.professional_certification : false;
return (
<div className="newMain clearfix" ref={this.saveContainer}>
{
modalsTypes===true?
modalsTypes === true ?
<QuestionModals {...this.props}{...this.state} modalsTypes={modalsTypes} modalCancels={() => this.modalCancels()}
setDownloads={(e) => this.setDownloads(e)}></QuestionModals>
:""
setDownloads={(e) => this.setDownloads(e)}></QuestionModals>
: ""
}
{
modalsType===true?
modalsType === true ?
<QuestionModal {...this.props}{...this.state} modalsType={modalsType} modalCancel={() => this.modalCancel()}
setDownload={() => this.setDownload()}></QuestionModal>
:""
setDownload={() => this.setDownload()}></QuestionModal>
: ""
}
{/*试卷库*/}
<SiderBar
{...this.props}
{...this.state}
showDrawer={() => this.showDrawer()}
Headertop={Headertop}/>
Headertop={Headertop} />
{/*顶部*/}
<Headplugselections {...this.props} {...this.state}
disciplinesdata={this.state.disciplinesdata}
setdiscipline_id={(e)=>this.setdiscipline_id(e)}
setsub_discipline_id={(e,id)=>this.setsub_discipline_id(e,id)}
settag_discipline_id={(e)=>this.settag_discipline_id(e)}
setitem_types={(e) => this.setitem_types(e)}
setdifficulty={(e) => this.setdifficulty(e)}
disciplinesdata={this.state.disciplinesdata}
setdiscipline_id={(e) => this.setdiscipline_id(e)}
setsub_discipline_id={(e, id) => this.setsub_discipline_id(e, id)}
settag_discipline_id={(e) => this.settag_discipline_id(e)}
setitem_types={(e) => this.setitem_types(e)}
setdifficulty={(e) => this.setdifficulty(e)}
></Headplugselections>
{/*头部*/}
<Contentpart
{...this.props}
{...this.state}
Isitapopup={"false"}
Testpapereditor={(e)=>this.Testpapereditor(e)}
setdifficulty={(e)=>this.setdifficulty(e)}
showmodels={(e)=>this.showmodels(e)}
showmodelysl={(e)=>this.showmodelysl(e)}
setdatafuns={(key)=>this.setdatafuns(key)}
callback={(key)=>this.callback(key)}
setdatafunsval={(key)=>this.setdatafunsval(key)}
setdifficulty={(bool)=>this.setdifficulty(bool)}
Testpapereditor={(e) => this.Testpapereditor(e)}
setdifficulty={(e) => this.setdifficulty(e)}
showmodels={(e) => this.showmodels(e)}
showmodelysl={(e) => this.showmodelysl(e)}
setdatafuns={(key) => this.setdatafuns(key)}
callback={(key) => this.callback(key)}
setdatafunsval={(key) => this.setdatafunsval(key)}
setdifficulty={(bool) => this.setdifficulty(bool)}
>
</Contentpart>
@ -460,11 +453,11 @@ class Testpaperlibrary extends Component {
{
items_count&&items_count>10?
items_count && items_count > 10 ?
<div className="mb30 clearfix educontent mt40 intermediatecenter">
<Pagination showQuickJumper current={page} onChange={this.paginationonChange}
pageSize={per_page}
total={items_count}></Pagination>
pageSize={per_page}
total={items_count}></Pagination>
</div>
:
<div className="h30 clearfix educontent mt40 intermediatecenter">

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import { Route, Switch } from "react-router-dom";
import Loading from '../../Loading'
import Loadable from 'react-loadable';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC'
import TPMIndexHOC from '../tpm/TPMIndexHOC'
import { SnackbarHOC } from 'educoder'

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import Comments from '../comment/Comments'
import { commentHOC } from '../comment/CommentsHOC'
import commentHOC from '../comment/CommentsHOC'
import './TPMShixunDiscuss.css'

File diff suppressed because it is too large Load Diff

@ -6,7 +6,7 @@ import TPMRightSection from './component/TPMRightSection'
import TPMNav from './component/TPMNav'
import Comments from '../comment/Comments'
import { commentHOC } from '../comment/CommentsHOC'
import commentHOC from '../comment/CommentsHOC'
import Loading from '../../components/loading';

@ -1,14 +1,14 @@
import React, {Component} from 'react';
import React, { Component } from 'react';
import {TPMIndexHOC} from '../TPMIndexHOC';
import TPMIndexHOC from '../TPMIndexHOC';
import {SnackbarHOC} from 'educoder';
import { SnackbarHOC } from 'educoder';
import {Select, Radio, Input, Modal, Button, Form, Tooltip, Upload, Icon, notification} from 'antd';
import { Select, Radio, Input, Modal, Button, Form, Tooltip, Upload, Icon, notification } from 'antd';
import axios from 'axios';
import {getUploadActionUrl} from 'educoder';
import { getUploadActionUrl } from 'educoder';
import './css/Newshixuns.css';
@ -32,7 +32,7 @@ class Newshixuns extends Component {
run_method: undefined,
postapplyvisible: undefined,
fileList: [],
Radiovalue:"1"
Radiovalue: "1"
}
}
@ -103,15 +103,15 @@ class Newshixuns extends Component {
let Url = `/shixuns.json`;
axios.post(Url, {
description: mdContnet,
main_type: values.main_type,
sub_type: values.sub_type,
shixun: {
name: values.name,
trainee: values.select,
is_jupyter: values.is_jupyter === "2" ? true : false,
}
description: mdContnet,
main_type: values.main_type,
sub_type: values.sub_type,
shixun: {
name: values.name,
trainee: values.select,
is_jupyter: values.is_jupyter === "2" ? true : false,
}
}
).then((response) => {
if (response.status === 200) {
window.location.href = "/shixuns/" + response.data.shixun_identifier + "/challenges";
@ -126,7 +126,7 @@ class Newshixuns extends Component {
loading: false
})
})
}else{
} else {
this.setState({
loading: false
})
@ -198,7 +198,7 @@ class Newshixuns extends Component {
sendsure_apply = () => {
let {language, runtime, run_method} = this.state;
let { language, runtime, run_method } = this.state;
if (!language || language === "") {
// this.props.showNotification(`请填写该镜像是基于什么语言`);
@ -326,7 +326,7 @@ class Newshixuns extends Component {
// 附件相关 START
handleChange = (info) => {
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let {fileList} = this.state;
let { fileList } = this.state;
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
console.log("handleChange1");
@ -369,7 +369,7 @@ class Newshixuns extends Component {
axios.delete(url, {})
.then((response) => {
if (response.data) {
const {status} = response.data;
const { status } = response.data;
if (status == 0) {
// console.log('--- success')
@ -392,8 +392,8 @@ class Newshixuns extends Component {
}
render() {
const {getFieldDecorator} = this.props.form;
const {newshixunlist, fileList, postapplytitle, postapplyvisible} = this.state;
const { getFieldDecorator } = this.props.form;
const { newshixunlist, fileList, postapplytitle, postapplyvisible } = this.state;
const uploadProps = {
width: 600,
fileList,
@ -452,11 +452,11 @@ class Newshixuns extends Component {
<span className="fl font-18 lineh-35">新建实训项目</span>
{this.props.user && this.props.user.main_site === true ?
<a className="fr font-16 mt3 color-blue" href="/forums/2943"
target="_blank">实训制作指南</a> : ""}
target="_blank">实训制作指南</a> : ""}
</div>
<div className="padding10-20 color-grey-3 clearfix">
<Form>
<Form.Item label="实训类型">
<Form.Item label="实训类型">
{getFieldDecorator('is_jupyter')(
<Radio.Group onChange={this.RadiovalueonChange} value={this.state.Radiovalue}>
<Radio value="1">普通实训</Radio>
@ -478,37 +478,37 @@ class Newshixuns extends Component {
}],
})(
<Input placeholder="请输入名称最大限制60个字符"
className={"input-100-45 greyInput"}
onInput={this.shixunNameInput} autoComplete="off"
addonAfter={`${String(!this.state.shixunName ? 0 : this.state.shixunName.length)}/${this.state.NAME_COUNT}`}
className="newViewAfter"/>
className={"input-100-45 greyInput"}
onInput={this.shixunNameInput} autoComplete="off"
addonAfter={`${String(!this.state.shixunName ? 0 : this.state.shixunName.length)}/${this.state.NAME_COUNT}`}
className="newViewAfter" />
)}
</Form.Item>
<Form.Item
label="简介"
style={{"borderBottom": 'none'}}
style={{ "borderBottom": 'none' }}
className="chooseDes pr"
>
<TPMMDEditor ref={this.contentMdRef} placeholder="请输入简介" mdID={'courseContentMD'}
refreshTimeout={1500}
className="courseMessageMD"
// initValue={this.state.description === null ? "" : this.state.description}
refreshTimeout={1500}
className="courseMessageMD"
// initValue={this.state.description === null ? "" : this.state.description}
></TPMMDEditor>
</Form.Item>
<Form.Item
label={"难易度"}
style={{"borderBottom": 'none'}}
style={{ "borderBottom": 'none' }}
className="chooseDes pr"
>
{getFieldDecorator('select', {
rules: [{required: true, message: '请选择难易度'}],
rules: [{ required: true, message: '请选择难易度' }],
})(
<div className="with15 fl pr">
<Select placeholder="请选择难易度"
style={{width: 180}}
onChange={this.Selectthestudent}
style={{ width: 180 }}
onChange={this.Selectthestudent}
>
<Option value={1}>初级</Option>
<Option value={2}>中级</Option>
@ -524,52 +524,52 @@ class Newshixuns extends Component {
<Form.Item
label={"实验环境"}
style={{"borderBottom": 'none', 'width': '18%', 'float': 'left'}}
style={{ "borderBottom": 'none', 'width': '18%', 'float': 'left' }}
className="chooseDes pr"
>
<div>
{getFieldDecorator('main_type', {
rules: [{required: true, message: '请选择主类别'}],
rules: [{ required: true, message: '请选择主类别' }],
})(
<div className="width100 fl mr20">
<Select placeholder="请选择主类别"
style={{width: 180}}
onChange={this.main_type}
defaultOpen={false}
style={{ width: 180 }}
onChange={this.main_type}
defaultOpen={false}
>
{
newshixunlist === undefined ? "" : this.state.Radiovalue==="2"?newshixunlist.main_type.map((item, key) => {
let itemtype=item.type_name.toLowerCase().indexOf('jupyter'.toLowerCase())
if(itemtype>-1){
newshixunlist === undefined ? "" : this.state.Radiovalue === "2" ? newshixunlist.main_type.map((item, key) => {
let itemtype = item.type_name.toLowerCase().indexOf('jupyter'.toLowerCase())
if (itemtype > -1) {
return (
<Option value={item.id} key={key} name={item.description}>
<Tooltip placement="right"
title={item.description === "" ? "无描述" : item.description}>
title={item.description === "" ? "无描述" : item.description}>
{item.type_name}
</Tooltip>
</Option>
)
}
}):""
}) : ""
}
{
newshixunlist === undefined ? "" : this.state.Radiovalue==="1"?newshixunlist.main_type.map((item, key) => {
let itemtype=item.type_name.toLowerCase().indexOf('jupyter'.toLowerCase())
if(itemtype===-1){
newshixunlist === undefined ? "" : this.state.Radiovalue === "1" ? newshixunlist.main_type.map((item, key) => {
let itemtype = item.type_name.toLowerCase().indexOf('jupyter'.toLowerCase())
if (itemtype === -1) {
return (
<Option value={item.id} key={key} name={item.description}>
<Tooltip placement="right"
title={item.description === "" ? "无描述" : item.description}>
title={item.description === "" ? "无描述" : item.description}>
{item.type_name}
</Tooltip>
</Option>
)
}
}):""
}) : ""
}
</Select>
@ -588,25 +588,25 @@ class Newshixuns extends Component {
}
</style>
<Form.Item
style={{"borderBottom": 'none', 'width': '82%', 'float': 'left', 'marginTop': '40px'}}
style={{ "borderBottom": 'none', 'width': '82%', 'float': 'left', 'marginTop': '40px' }}
className="chooseDes pr"
>
<div className=" fl pr mr20">
{getFieldDecorator('sub_type')(
<div className=" fl pr mr20">
<Select placeholder="请选择小类别"
mode="multiple"
style={{width: 280}}
onChange={this.sub_type}
defaultOpen={false}
className={"Selectlittle"}
mode="multiple"
style={{ width: 280 }}
onChange={this.sub_type}
defaultOpen={false}
className={"Selectlittle"}
>
{
newshixunlist === undefined ? "" : newshixunlist.small_type.map((item, key) => {
return (
<Option value={item.id} key={key} name={item.description}>
<Tooltip placement="right"
title={item.description === "" ? "无描述" : item.description}>
title={item.description === "" ? "无描述" : item.description}>
{item.type_name}
</Tooltip>
</Option>
@ -617,17 +617,17 @@ class Newshixuns extends Component {
</div>
)}
<span className="fl ml20 color-grey lineh-20">
<div>
{this.state.mainvalues === undefined && this.state.subvalues === undefined || this.state.mainvalues === "" && this.state.subvalues === "" ? "" :
<div className={"font-12"} style={{'max-width': '600px'}}>
{`${this.state.mainvalues === undefined || this.state.mainvalues === "" ? "" : this.state.mainvalues}`}
{`${this.state.subvalues === undefined || this.state.subvalues === "" ? "" : this.state.mainvalues === undefined || this.state.mainvalues === "" ? this.state.subvalues : this.state.subvalues}`}
{`${this.state.mainvalues === undefined || this.state.mainvalues === "" ? "" : ""}${this.state.subvalues === undefined || this.state.subvalues === "" ? "" :
this.state.mainvalues === undefined || this.state.mainvalues === "" ? this.state.subvalues : this.state.subvalues}`}
</div>}
</div>
</span>
<div>
{this.state.mainvalues === undefined && this.state.subvalues === undefined || this.state.mainvalues === "" && this.state.subvalues === "" ? "" :
<div className={"font-12"} style={{ 'max-width': '600px' }}>
{`${this.state.mainvalues === undefined || this.state.mainvalues === "" ? "" : this.state.mainvalues}`}
{`${this.state.subvalues === undefined || this.state.subvalues === "" ? "" : this.state.mainvalues === undefined || this.state.mainvalues === "" ? this.state.subvalues : this.state.subvalues}`}
{`${this.state.mainvalues === undefined || this.state.mainvalues === "" ? "" : ""}${this.state.subvalues === undefined || this.state.subvalues === "" ? "" :
this.state.mainvalues === undefined || this.state.mainvalues === "" ? this.state.subvalues : this.state.subvalues}`}
</div>}
</div>
</span>
</div>
</Form.Item>
@ -663,7 +663,7 @@ class Newshixuns extends Component {
className="color-red fl mt3">*</span>&nbsp;&nbsp;</label>
<textarea
className={this.state.languagewritetype === true ? "fl task-form-80 task-height-150 bor-reds" : "fl task-form-80 task-height-150"}
style={{width: '89%', height: '100px'}}
style={{ width: '89%', height: '100px' }}
onInput={this.setlanguage}
value={this.state.language}
placeholder="请填写该镜像是基于什么语言示例Python"
@ -677,7 +677,7 @@ class Newshixuns extends Component {
<textarea
className={this.state.systemenvironmenttype === true ? "fl task-form-80 task-height-150 bor-reds" : "fl task-form-80 task-height-150"}
onInput={this.setruntime}
style={{height: '100px'}}
style={{ height: '100px' }}
value={this.state.runtime}
placeholder="请填写该镜像是基于什么linux系统环境,代码运行环境"
id="demand_info"></textarea>
@ -692,7 +692,7 @@ class Newshixuns extends Component {
className={this.state.testcoderunmodetype === true ? "fl task-form-80 task-height-150 bor-reds" : "fl task-form-80 task-height-150"}
onInput={this.setrun_method}
value={this.state.run_method}
style={{height: '100px'}}
style={{ height: '100px' }}
placeholder="请填写该镜像中测试代码运行方式"
id="demand_info"></textarea>
</li>
@ -718,10 +718,10 @@ class Newshixuns extends Component {
</div>
<li className="edu-txt-center clearfix ">
<a className="pop_close task-btn mr30"
onClick={() => this.sendhideModaly()}
onClick={() => this.sendhideModaly()}
>取消</a>
<Button type="primary" onClick={() => this.sendsure_apply()}
className="task-btn task-btn-orange">确定</Button>
className="task-btn task-btn-orange">确定</Button>
</li>
<div className="cl"></div>
</div>
@ -733,14 +733,14 @@ class Newshixuns extends Component {
</div>
</div>
</div>
<Bottomsubmit {...this.props} {...this.state} url={"/shixuns"} onSubmits={() => this.handleSubmit()} loadings={this.state.loading}/>
<Bottomsubmit {...this.props} {...this.state} url={"/shixuns"} onSubmits={() => this.handleSubmit()} loadings={this.state.loading} />
</div>
);
}
}
const NewshixunsNew = Form.create({name: 'newshixun'})(Newshixuns);
const NewshixunsNew = Form.create({ name: 'newshixun' })(Newshixuns);
export default SnackbarHOC()(TPMIndexHOC(NewshixunsNew));

File diff suppressed because it is too large Load Diff

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link} from "react-router-dom";
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { Switch } from 'antd';
@ -9,15 +9,15 @@ import PropTypes from 'prop-types';
import classNames from 'classnames'
import { TPMIndexHOC } from '../TPMIndexHOC'
import TPMIndexHOC from '../TPMIndexHOC'
import { SnackbarHOC } from 'educoder'
import ShixunCard from '.././shixuns/ShixunCard';
import { Pagination,Row,Col,Rate } from 'antd';
import { Pagination, Row, Col, Rate } from 'antd';
import './shixunchildCss/Shixunfork_list.css';
import './shixunchildCss/Shixunfork_list.css';
import 'antd/lib/rate/style/index.css';
@ -29,41 +29,41 @@ class Shixunforklist extends Component {
this.state = {
}
}
}
handleChange = (value) => {
console.log('Page: ', value);
// this.setState({ value });
}
handleChange = (value) => {
console.log('Page: ', value);
// this.setState({ value });
}
//JSX
render() {
render() {
const { match, history } = this.props
return (
<div className="newMain clearfix">
return (
<div className="newMain clearfix">
<div className="educontent">
<div className="edu-back-white padding20 clearfix mb20 mt30">
<span className="fl font-16">Fork实训列表</span>
<Link to="/shixunchild" className="font-16 color-grey-9 fr">返回</Link>
</div>
<div className="edu-back-white padding20 clearfix mb20 mt30">
<span className="fl font-16">Fork实训列表</span>
<Link to="/shixunchild" className="font-16 color-grey-9 fr">返回</Link>
</div>
<ShixunCard/>
<ShixunCard />
<div className="educontent edu-txt-center mb80">
<div className="inline pages_user_show">
<ul>
<div className="educontent edu-txt-center mb80">
<div className="inline pages_user_show">
<ul>
</ul>
<div className="cl"></div>
</div>
</ul>
<div className="cl"></div>
</div>
</div>
</div>
</div>
</div>
);
}
</div>
);
}
}
export default SnackbarHOC() (TPMIndexHOC ( Shixunforklist ));
export default SnackbarHOC()(TPMIndexHOC(Shixunforklist));

@ -8,7 +8,7 @@ import axios from 'axios';
import { Spin } from 'antd';
import { TPMIndexHOC } from '../TPMIndexHOC';
import TPMIndexHOC from '../TPMIndexHOC';
import { SnackbarHOC } from 'educoder';
@ -27,89 +27,89 @@ const $ = window.$;
class ShixunsIndex extends Component {
constructor(props) {
super(props)
this.state={
this.state = {
order_by: "new",
page:1,
limit:16,
keyword:"",
status:0,
diff:0,
page: 1,
limit: 16,
keyword: "",
status: 0,
diff: 0,
tag_level: 1,
tag_id:'',
middleshixundata:[],
typepvisible:true,
pages:1,
search_tags:null,
parsedid:undefined,
newtag_level:undefined,
newpalce:undefined,
sort:"desc"
tag_id: '',
middleshixundata: [],
typepvisible: true,
pages: 1,
search_tags: null,
parsedid: undefined,
newtag_level: undefined,
newpalce: undefined,
sort: "desc"
}
}
componentDidMount(){
componentDidMount() {
const upsystem=`/users/system_update.json`;
axios.get(upsystem).then((response)=>{
let updata=response.data;
this.setState({
updata:updata
})
}).catch((error)=>{
console.log(error);
})
const upsystem = `/users/system_update.json`;
axios.get(upsystem).then((response) => {
let updata = response.data;
this.setState({
updata: updata
})
}).catch((error) => {
console.log(error);
})
let _keyword;
let _keyword;
if (window.__headSearchKeyword) {
this.setState({ keyword: window.__headSearchKeyword })
_keyword = window.__headSearchKeyword
delete window.__headSearchKeyword
}
const parsed = queryString.parse(this.props.location.search);
if(parsed.id===undefined&&parsed.type===undefined){
let {order_by, tag_level, tag_id, page, limit, keyword, status, diff} = this.state;
let params={
order_by:order_by,
tag_level:tag_level,
tag_id:tag_id,
page:page,
limit:limit,
keyword: _keyword || keyword ,
status:status,
diff:diff,
if (parsed.id === undefined && parsed.type === undefined) {
let { order_by, tag_level, tag_id, page, limit, keyword, status, diff } = this.state;
let params = {
order_by: order_by,
tag_level: tag_level,
tag_id: tag_id,
page: page,
limit: limit,
keyword: _keyword || keyword,
status: status,
diff: diff,
sort: "desc"
}
this.shixunresultend(params);
}else{
let {order_by,page, limit, keyword, status, diff} = this.state;
let nawparsed=parsed.type;
let newpalce=parsed.palce;
if(nawparsed==="rep"){
nawparsed=1
} else {
let { order_by, page, limit, keyword, status, diff } = this.state;
let nawparsed = parsed.type;
let newpalce = parsed.palce;
if (nawparsed === "rep") {
nawparsed = 1
}
else if(nawparsed==="sub"){
nawparsed=2
}else if(nawparsed==="tag"){
nawparsed=3
else if (nawparsed === "sub") {
nawparsed = 2
} else if (nawparsed === "tag") {
nawparsed = 3
}
let params={
order_by:order_by,
tag_level:nawparsed,
tag_id:parsed.id,
page:page,
limit:limit,
let params = {
order_by: order_by,
tag_level: nawparsed,
tag_id: parsed.id,
page: page,
limit: limit,
keyword: _keyword || keyword,
status:status,
diff:diff,
status: status,
diff: diff,
sort: "desc"
}
this.setState({
parsedid:parsed.id,
newtag_level:nawparsed,
tag_level:nawparsed,
newpalce:newpalce,
tag_id:parsed.id,
parsedid: parsed.id,
newtag_level: nawparsed,
tag_level: nawparsed,
newpalce: newpalce,
tag_id: parsed.id,
keyword: _keyword || keyword,
})
this.shixunresultend(params);
@ -117,221 +117,221 @@ class ShixunsIndex extends Component {
}
allUpdatashixunlist=()=>{
let{sort,order_by}=this.state;
allUpdatashixunlist = () => {
let { sort, order_by } = this.state;
this.setState({
tag_level: 1,
tag_id:'',
tag_id: '',
page: 1,
limit: 16,
keyword:'',
keyword: '',
status: 0,
diff: 0,
})
let params={
order_by:order_by,
let params = {
order_by: order_by,
tag_level: 1,
tag_id:'',
tag_id: '',
page: 1,
limit: 16,
keyword:'',
keyword: '',
status: 0,
diff: 0,
sort:sort
sort: sort
}
this.shixunresultend(params)
}
Updatasearchlist=(value)=>{
Updatasearchlist = (value) => {
if (value[1].tag_id === " ") {
this.setState({
keyword: ""
})
}
this.setState({
tag_level:value[0].tag_level,
tag_id:value[1].tag_id,
typepvisible:true
tag_level: value[0].tag_level,
tag_id: value[1].tag_id,
typepvisible: true
})
let {order_by, sort, limit, keyword, status, diff} = this.state;
let params={
order_by:order_by,
tag_level:value[0].tag_level,
tag_id:value[1].tag_id,
page:1,
limit:limit,
keyword:keyword,
status:status,
diff:diff,
sort:sort
let { order_by, sort, limit, keyword, status, diff } = this.state;
let params = {
order_by: order_by,
tag_level: value[0].tag_level,
tag_id: value[1].tag_id,
page: 1,
limit: limit,
keyword: keyword,
status: status,
diff: diff,
sort: sort
}
this.shixunresultend(params)
}
StatusEnquiry=(key)=>{
StatusEnquiry = (key) => {
let Vrl=`/shixuns.json`;
let Vrl = `/shixuns.json`;
let newstatus;
let newdiff;
if(key[0].type===1){
if (key[0].type === 1) {
this.setState({
status: key[1].value,
typepvisible:true
typepvisible: true
})
newstatus=key[1].value;
newdiff=this.state.diff;
}else if(key[0].type===2){
newstatus = key[1].value;
newdiff = this.state.diff;
} else if (key[0].type === 2) {
this.setState({
diff: key[1].value,
typepvisible:true
typepvisible: true
})
newdiff=key[1].value;
newstatus=this.state.status;
newdiff = key[1].value;
newstatus = this.state.status;
}
let params= {
order_by:this.state.order_by,
tag_level:this.state.tag_level,
tag_id:this.state.tag_id,
page:1,
limit:this.state.limit,
keyword:this.state.keyword,
status:newstatus,
diff:newdiff,
let params = {
order_by: this.state.order_by,
tag_level: this.state.tag_level,
tag_id: this.state.tag_id,
page: 1,
limit: this.state.limit,
keyword: this.state.keyword,
status: newstatus,
diff: newdiff,
}
this.shixunresultend(params)
}
OnSearchInput=(value,type)=>{
if(type===true){
this.setState({
keyword:value,
typepvisible:true,
pages:1
})
let {order_by, tag_level, tag_id, sort, limit, status, diff} = this.state;
let params= {
order_by:order_by,
tag_level:tag_level,
tag_id:tag_id,
page:1,
limit:limit,
keyword:value,
status:status,
diff:diff,
sort:sort
OnSearchInput = (value, type) => {
if (type === true) {
this.setState({
keyword: value,
typepvisible: true,
pages: 1
})
let { order_by, tag_level, tag_id, sort, limit, status, diff } = this.state;
let params = {
order_by: order_by,
tag_level: tag_level,
tag_id: tag_id,
page: 1,
limit: limit,
keyword: value,
status: status,
diff: diff,
sort: sort
}
this.shixunresultend(params)
} else {
this.setState({
keyword: value,
pages: 1
})
}
this.shixunresultend(params)
}else{
this.setState({
keyword:value,
pages:1
})
}
}
ShixunsSwitch=()=>{
ShixunsSwitch = () => {
//types
this.setState({
order_by:"mine",
typepvisible:true,
pages:1,
order_by: "mine",
typepvisible: true,
pages: 1,
})
let{tag_level,tag_id,page,limit,keyword,status,diff,sort}=this.state;
let newsort=sort;
if(newsort===undefined){
newsort="desc"
let { tag_level, tag_id, page, limit, keyword, status, diff, sort } = this.state;
let newsort = sort;
if (newsort === undefined) {
newsort = "desc"
}
let params= {
order_by:"mine",
tag_level:tag_level,
tag_id:tag_id,
page:1,
limit:limit,
keyword:keyword,
status:status,
diff:diff,
sort:newsort
let params = {
order_by: "mine",
tag_level: tag_level,
tag_id: tag_id,
page: 1,
limit: limit,
keyword: keyword,
status: status,
diff: diff,
sort: newsort
}
this.shixunresultend(params)
}
shixunsPage=(value)=>{
shixunsPage = (value) => {
this.setState({
page:value,
typepvisible:true,
pages:value
page: value,
typepvisible: true,
pages: value
})
let {order_by, tag_level, tag_id, limit, keyword, status, diff,sort} = this.state;
let params= {
order_by:order_by,
tag_level:tag_level,
tag_id:tag_id,
page:value,
limit:limit,
keyword:keyword,
status:status,
diff:diff,
sort:sort
let { order_by, tag_level, tag_id, limit, keyword, status, diff, sort } = this.state;
let params = {
order_by: order_by,
tag_level: tag_level,
tag_id: tag_id,
page: value,
limit: limit,
keyword: keyword,
status: status,
diff: diff,
sort: sort
}
let Url=`/shixuns.json`;
axios.get(Url,{
let Url = `/shixuns.json`;
axios.get(Url, {
params
}).then((response)=> {
if(response.status===200){
}).then((response) => {
if (response.status === 200) {
this.setState({
middleshixundata: response.data,
typepvisible:false,
typepvisible: false,
});
}
}).catch((error)=>{
}).catch((error) => {
console.log(error)
});
}
ShixunsState=(val,type,sorts)=>{
ShixunsState = (val, type, sorts) => {
// sort,
let {tag_level, tag_id, page, limit, keyword, status, diff,sort} = this.state;
let newsort=sorts?sorts:sort;
let { tag_level, tag_id, page, limit, keyword, status, diff, sort } = this.state;
let newsort = sorts ? sorts : sort;
this.setState({
order_by:type,
typepvisible:true,
pages:1,
sort:sorts?sorts:sort
order_by: type,
typepvisible: true,
pages: 1,
sort: sorts ? sorts : sort
})
let params
// let vals=false
if(newsort===undefined){
newsort="desc"
}else{
newsort=sorts?sorts:sort
}
params= {
order_by:type,
tag_level:tag_level,
tag_id:tag_id,
page:1,
limit:limit,
keyword:keyword,
status:status,
diff:diff,
sort:newsort
if (newsort === undefined) {
newsort = "desc"
} else {
newsort = sorts ? sorts : sort
}
params = {
order_by: type,
tag_level: tag_level,
tag_id: tag_id,
page: 1,
limit: limit,
keyword: keyword,
status: status,
diff: diff,
sort: newsort
}
this.shixunresultend(params)
}
Shixunsupcircles=(sort)=>{
Shixunsupcircles = (sort) => {
console.log(sort)
this.setState({
sort:sort
sort: sort
})
let {
order_by,
@ -345,16 +345,16 @@ class ShixunsIndex extends Component {
let params= {
order_by:order_by,
tag_level:tag_level,
tag_id:tag_id,
page:1,
limit:limit,
keyword:keyword,
status:status,
diff:diff,
sort:sort
let params = {
order_by: order_by,
tag_level: tag_level,
tag_id: tag_id,
page: 1,
limit: limit,
keyword: keyword,
status: status,
diff: diff,
sort: sort
}
this.shixunresultend(params)
}
@ -362,69 +362,69 @@ class ShixunsIndex extends Component {
shixunresultend=(params)=>{
let Url=`/shixuns.json`;
axios.get(Url,{
shixunresultend = (params) => {
let Url = `/shixuns.json`;
axios.get(Url, {
params
}).then((response)=> {
}).then((response) => {
// TODO 有keyword返回值时 显示一共有多少条记录
if(response.status===200){
if (response.status === 200) {
this.setState({
search_tags:response.data.search_tags,
search_tags: response.data.search_tags,
middleshixundata: response.data,
typepvisible:false,
pages:1
typepvisible: false,
pages: 1
});
}
}).catch((error)=>{
}).catch((error) => {
console.log(error)
});
}
render() {
let {middleshixundata, typepvisible, pages, search_tags, keyword,parsedid,newtag_level,newpalce} = this.state;
let { middleshixundata, typepvisible, pages, search_tags, keyword, parsedid, newtag_level, newpalce } = this.state;
// console.log(this.state.updata)
return (
<div className="newMain clearfix backFAFAFA">
{this.state.updata===undefined?"":<UpgradeModals
{...this.state}
/>}
{this.state.updata === undefined ? "" : <UpgradeModals
{...this.state}
/>}
{/*<Spin spinning={typepvisible} size="large" style={{marginTop:'15%'}}>*/}
<ShixunSearchBar
Updatasearchlist={this.Updatasearchlist.bind(this)}
allUpdatashixunlist={this.allUpdatashixunlist}
StatusEnquiry={this.StatusEnquiry.bind(this)}
OnSearchInput={this.OnSearchInput.bind(this)}
keyword={keyword}
parsedid={parsedid}
newtag_level={newtag_level}
newpalce={newpalce}
{...this.props}
{...this.state}
/>
<ShixunCardList
ShixunsState={this.ShixunsState.bind(this)}
ShixunsSwitch={this.ShixunsSwitch.bind(this)}
Shixunsupcircles={this.Shixunsupcircles.bind(this)}
allUpdatashixunlist={this.allUpdatashixunlist}
{...this.props}
{...this.state}
OnSearchInput={this.OnSearchInput.bind(this)}
/>
{/*下方图片*/}
<ShixunCard
typepvisible={typepvisible}
middleshixundata={middleshixundata.shixuns}
totalcount={middleshixundata.total_count}
pagination={middleshixundata.pagination}
pages={pages}
shixunsPage={this.shixunsPage.bind(this)}
/>
<ShixunSearchBar
Updatasearchlist={this.Updatasearchlist.bind(this)}
allUpdatashixunlist={this.allUpdatashixunlist}
StatusEnquiry={this.StatusEnquiry.bind(this)}
OnSearchInput={this.OnSearchInput.bind(this)}
keyword={keyword}
parsedid={parsedid}
newtag_level={newtag_level}
newpalce={newpalce}
{...this.props}
{...this.state}
/>
<ShixunCardList
ShixunsState={this.ShixunsState.bind(this)}
ShixunsSwitch={this.ShixunsSwitch.bind(this)}
Shixunsupcircles={this.Shixunsupcircles.bind(this)}
allUpdatashixunlist={this.allUpdatashixunlist}
{...this.props}
{...this.state}
OnSearchInput={this.OnSearchInput.bind(this)}
/>
{/*下方图片*/}
<ShixunCard
typepvisible={typepvisible}
middleshixundata={middleshixundata.shixuns}
totalcount={middleshixundata.total_count}
pagination={middleshixundata.pagination}
pages={pages}
shixunsPage={this.shixunsPage.bind(this)}
/>
{/*</Spin>*/}
</div>
);
}
}
export default SnackbarHOC() (TPMIndexHOC ( ShixunsIndex ));
export default SnackbarHOC()(TPMIndexHOC(ShixunsIndex));

@ -1,86 +1,86 @@
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import {CNotificationHOC} from '../courses/common/CNotificationHOC'
import { Route, Switch } from "react-router-dom";
import CNotificationHOC from '../courses/common/CNotificationHOC'
import Loading from '../../Loading';
import Loadable from 'react-loadable';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import TPMIndexHOC from '../tpm/TPMIndexHOC';
import { SnackbarHOC, getImageUrl } from 'educoder';
import { SnackbarHOC } from 'educoder';
import AccountNav from './account/AccountNav'
import axios from 'axios'
const AccountBasic= Loadable({
const AccountBasic = Loadable({
loader: () => import('./account/AccountBasic'),
loading: Loading,
})
const AccountBasicEdit= Loadable({
const AccountBasicEdit = Loadable({
loader: () => import('./account/AccountBasicEdit'),
loading: Loading,
})
const AccountCertification= Loadable({
const AccountCertification = Loadable({
loader: () => import('./account/AccountCertification'),
loading: Loading,
})
const AccountSecure= Loadable({
const AccountSecure = Loadable({
loader: () => import('./account/AccountSecure'),
loading: Loading,
})
const AccountBinding= Loadable({
loader: () => import('./account/AccountBinding'),
loading: Loading,
const AccountBinding = Loadable({
loader: () => import('./account/AccountBinding'),
loading: Loading,
})
class AccountPage extends Component {
constructor (props) {
constructor(props) {
super(props)
this.state = {
basicInfo: {}
}
}
componentDidUpdate =(prevState)=>{
if(this.props.current_user && this.props.current_user != prevState.current_user){
componentDidUpdate = (prevState) => {
if (this.props.current_user && this.props.current_user != prevState.current_user) {
this.getBasicInfo(this.props.current_user.login);
}
}
componentDidMount = () =>{
if(this.props.current_user){
componentDidMount = () => {
if (this.props.current_user) {
this.getBasicInfo(this.props.current_user.login);
}
}
getBasicInfo=(login)=>{
let url=`/users/accounts/${login || this.props.current_user.login}.json`;
axios.get(url).then((result)=>{
if(result.data){
if(result.data && result.data.base_info_completed == false){
getBasicInfo = (login) => {
let url = `/users/accounts/${login || this.props.current_user.login}.json`;
axios.get(url).then((result) => {
if (result.data) {
if (result.data && result.data.base_info_completed == false) {
this.props.history.push(`/account/profile/edit`);
}
// "authentication": "uncertified", // "uncertified" | "applying" | "certified"
this.setState({
basicInfo: Object.assign({}, {...result.data}, {
avatar_url: `${result.data.avatar_url}`,
gender: result.data.gender == null || result.data.gender == undefined ? 0 : result.data.gender
})
basicInfo: Object.assign({}, { ...result.data }, {
avatar_url: `${result.data.avatar_url}`,
gender: result.data.gender == null || result.data.gender == undefined ? 0 : result.data.gender
})
})
}
}).catch((error)=>{
}).catch((error) => {
console.log(error);
})
}
render() {
let { basicInfo }=this.state;
const common = { basicInfo, getBasicInfo : this.getBasicInfo }
return (
<div className="newMain clearfix">
<div className="educontent df pt20">
<style>{`
render() {
let { basicInfo } = this.state;
const common = { basicInfo, getBasicInfo: this.getBasicInfo }
return (
<div className="newMain clearfix">
<div className="educontent df pt20">
<style>{`
.accountPage {
display: flex;
}
@ -101,52 +101,52 @@ class AccountPage extends Component {
height: 460px;
}
`}</style>
<AccountNav {...this.props} {...common}></AccountNav>
<div className="basicFormWrap">
<Switch {...this.props}>
<Route path="/account/profile/edit"
render={
(props) => (<AccountBasicEdit {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route path="/account/profile"
render={
(props) => (<AccountBasic {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route path="/account/certification"
render={
(props) => (<AccountCertification {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route path="/account/secure"
render={
(props) => (<AccountSecure {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route path="/account/binding"
render={
(props) => (<AccountBinding {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route exact path="/account"
render={
(props) => (<AccountBasic getBasicInfo={()=>this.getBasicInfo()} {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
</Switch>
</div>
</div>
<AccountNav {...this.props} {...common}></AccountNav>
<div className="basicFormWrap">
<Switch {...this.props}>
<Route path="/account/profile/edit"
render={
(props) => (<AccountBasicEdit {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route path="/account/profile"
render={
(props) => (<AccountBasic {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route path="/account/certification"
render={
(props) => (<AccountCertification {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route path="/account/secure"
render={
(props) => (<AccountSecure {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route path="/account/binding"
render={
(props) => (<AccountBinding {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route exact path="/account"
render={
(props) => (<AccountBasic getBasicInfo={() => this.getBasicInfo()} {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
</Switch>
</div>
);
}
</div>
</div>
);
}
}
export default CNotificationHOC()(SnackbarHOC() ( TPMIndexHOC ( AccountPage )));
export default CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(AccountPage)));

@ -1,30 +1,22 @@
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import Loading from '../../Loading';
import Loadable from 'react-loadable';
// import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import { SnackbarHOC, getImageUrl } from 'educoder';
import { SnackbarHOC } from 'educoder';
import LoginRegisterComponent from './LoginRegisterComponent';
import FindPasswordComponent from './FindPasswordComponent';
class LoginRegisterPage extends Component {
render() {
// newMain clearfix
return (
<div className="">
<LoginRegisterComponent {...this.props} {...this.state}></LoginRegisterComponent>
<br></br>
<br></br>
<FindPasswordComponent {...this.props} {...this.state}></FindPasswordComponent>
</div>
);
}
render() {
// newMain clearfix
return (
<div className="">
<LoginRegisterComponent {...this.props} {...this.state}></LoginRegisterComponent>
<br></br>
<br></br>
<FindPasswordComponent {...this.props} {...this.state}></FindPasswordComponent>
</div>
);
}
}
export default SnackbarHOC() ( ( LoginRegisterPage ));
export default SnackbarHOC()((LoginRegisterPage));

@ -1,62 +1,58 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip, Menu, Pagination, Spin, Dropdown} from 'antd';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import { Tooltip, Menu, Pagination, Spin, Dropdown } from 'antd';
import axios from 'axios';
import NoneData from '../../courses/coursesPublic/NoneData'
import {getImageUrl} from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC'
import { getImageUrl } from 'educoder';
import "./usersInfo.css"
import Create from './publicCreatNew'
class InfosCourse extends Component{
constructor(props){
class InfosCourse extends Component {
constructor(props) {
super(props);
this.state={
category:undefined,
status:undefined,
page:1,
per_page:16,
this.state = {
category: undefined,
status: undefined,
page: 1,
per_page: 16,
sort_by: "updated_at",
sort_direction: "desc",
totalCount:undefined,
data:undefined,
isSpin:false
totalCount: undefined,
data: undefined,
isSpin: false
}
}
componentDidMount=()=>{
componentDidMount = () => {
this.setState({
isSpin:true
isSpin: true
})
let {category, status, page, sort_by, sort_direction} = this.state;
let { category, status, page, sort_by, sort_direction } = this.state;
this.getCourses(category, status, page, sort_by, sort_direction);
}
getCourses = (category, status, page, sort_by, sort_direction) => {
let url=`/users/${this.props.match.params.username}/courses.json`;
axios.get((url),{params:{
category,
status,
page,
let url = `/users/${this.props.match.params.username}/courses.json`;
axios.get((url), {
params: {
category,
status,
page,
sort_by,
sort_direction,
per_page: this.props.is_current && category && page ==1?17:16
}}).then((result)=>{
if(result){
per_page: this.props.is_current && category && page == 1 ? 17 : 16
}
}).then((result) => {
if (result) {
console.log("请求成功");
this.setState({
totalCount:result.data.count,
data:result.data,
totalCount: result.data.count,
data: result.data,
sort_direction: sort_direction,
sort_by: sort_by,
isSpin:false
isSpin: false
})
}
}).catch((error)=>{
}).catch((error) => {
console.log(error);
this.setState({
isSpin: false
@ -65,38 +61,38 @@ class InfosCourse extends Component{
}
//切换种类
changeCategory=(cate)=>{
changeCategory = (cate) => {
this.setState({
category:cate,
page:1,
isSpin:true
category: cate,
page: 1,
isSpin: true
})
let {status, sort_by, sort_direction} = this.state;
let { status, sort_by, sort_direction } = this.state;
this.getCourses(cate, status, 1, sort_by, sort_direction);
}
//切换状态
changeStatus=(status)=>{
changeStatus = (status) => {
this.setState({
status:status,
page:1,
isSpin:true
status: status,
page: 1,
isSpin: true
})
let {category, sort_by, sort_direction} = this.state;
let { category, sort_by, sort_direction } = this.state;
this.getCourses(category, status, 1, sort_by, sort_direction);
}
//切换页数
changePage=(page)=>{
changePage = (page) => {
this.setState({
page,
isSpin:true
isSpin: true
})
let {category, status, sort_by, sort_direction} = this.state;
let { category, status, sort_by, sort_direction } = this.state;
this.getCourses(category, status, page, sort_by, sort_direction);
}
// 进入课堂
turnToCourses=(url,flag)=>{
if(flag){
turnToCourses = (url, flag) => {
if (flag) {
this.props.history.push(url);
}
}
@ -106,7 +102,7 @@ class InfosCourse extends Component{
this.setState({
isSpin: true
});
let {category, status, page, sort_direction} = this.state;
let { category, status, page, sort_direction } = this.state;
this.getCourses(category, status, 1, sort_by, "desc");
}
@ -119,7 +115,7 @@ class InfosCourse extends Component{
isSpin: true
});
let {category, status, page, sort_by, sort_direction} = this.state;
let { category, status, page, sort_by, sort_direction } = this.state;
let sort_directiony = sort_directions;
if (sort_directions === "asc") {
if (sort_directions === sort_direction) {
@ -134,8 +130,8 @@ class InfosCourse extends Component{
this.getCourses(category, status, page, sort_by, sort_directiony);
}
render(){
let{
render() {
let {
category,
status,
page,
@ -145,9 +141,9 @@ class InfosCourse extends Component{
sort_by,
sort_direction
} = this.state;
let is_current=this.props.is_current;
let is_current = this.props.is_current;
// console.log(this.props.current_user&&this.props.current_user.user_identity==="学生")
// console.log(this.props.current_user&&this.props.current_user.user_identity==="学生")
const menu = (
<Menu>
<Menu.Item onClick={() => this.updatedlist("updated_at")}>
@ -161,7 +157,7 @@ class InfosCourse extends Component{
);
console.log("InfosCourse");
console.log(status);
return(
return (
<div className="educontent">
<Spin size="large" spinning={isSpin}>
<style>
@ -209,16 +205,16 @@ class InfosCourse extends Component{
`
}
</style>
<div className="white-panel edu-back-white pt20 pb20 clearfix ">
<li className={category ? " font-16 whitepanelyslli" : "active font-16 whitepanelyslli"}><a
href="javascript:void(0)" onClick={() => this.changeCategory()} className="font-16 w32">全部</a></li>
<li className={category == "manage" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a
href="javascript:void(0)" onClick={() => this.changeCategory("manage")}
className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}管理的</a></li>
<li className={category == "study" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a
href="javascript:void(0)" onClick={() => this.changeCategory("study")}
className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}学习的</a></li>
</div>
<div className="white-panel edu-back-white pt20 pb20 clearfix ">
<li className={category ? " font-16 whitepanelyslli" : "active font-16 whitepanelyslli"}><a
href="javascript:void(0)" onClick={() => this.changeCategory()} className="font-16 w32">全部</a></li>
<li className={category == "manage" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a
href="javascript:void(0)" onClick={() => this.changeCategory("manage")}
className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}管理的</a></li>
<li className={category == "study" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a
href="javascript:void(0)" onClick={() => this.changeCategory("study")}
className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}学习的</a></li>
</div>
<style>
{
@ -236,46 +232,46 @@ class InfosCourse extends Component{
`
}
</style>
{
is_current &&
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a href="javascript:void(0)"
onClick={() => this.changeStatus()}
className="w32">全部</a></li>
<li className={status == "processing" ? "active whitepanelysllis" : "whitepanelysllis"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("processing")} className="w66">正在进行</a></li>
<li className={status == "end" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("end")} className="w66">已结束</a></li>
</div>
}
<p className=" clearfix font-12 " style={{
{
is_current &&
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a href="javascript:void(0)"
onClick={() => this.changeStatus()}
className="w32">全部</a></li>
<li className={status == "processing" ? "active whitepanelysllis" : "whitepanelysllis"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("processing")} className="w66">正在进行</a></li>
<li className={status == "end" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("end")} className="w66">已结束</a></li>
</div>
}
<p className=" clearfix font-12 " style={{
lineHeight: "41px",
marginTop: "10px",
marginTop: "10px",
}}>
<span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"课堂"}</span>
<span className="fl color-grey-9">共参与{totalCount}{category ? category == "manage" ? "发布" : "学习" : "课堂"}</span>
<sapn className="relativef color-grey-9 fr"
style={{
display: "flex",
flexDirection: "column",
height: "40px",
lineHeight: "40px",
}}
>
<span
style={{
display: "flex",
flexDirection: "column",
textAlign: "center",
height: "10px",
lineHeight: "10px",
display: "table",
marginTop: "9px",
height: "40px",
lineHeight: "40px",
}}
>
<i className={sort_direction === "asc" ?
"iconfont icon-sanjiaoxing-up font-12 color-blue h10 " : "iconfont icon-sanjiaoxing-up font-12 h10"}
onClick={() => this.updatedlists("asc", 1)}></i>
<span
style={{
flexDirection: "column",
textAlign: "center",
height: "10px",
lineHeight: "10px",
display: "table",
marginTop: "9px",
}}
>
<i className={sort_direction === "asc" ?
"iconfont icon-sanjiaoxing-up font-12 color-blue h10 " : "iconfont icon-sanjiaoxing-up font-12 h10"}
onClick={() => this.updatedlists("asc", 1)}></i>
</span>
</span>
<span
style={{
@ -286,22 +282,22 @@ class InfosCourse extends Component{
display: "table",
}}
>
<i className={sort_direction === "desc" ?
"iconfont icon-sanjiaoxing-down font-12 yslbottomsj color-blue h10" : "iconfont icon-sanjiaoxing-down font-12 yslbottomsj h10"}
onClick={() => this.updatedlists("desc", 2)}></i>
</span>
<i className={sort_direction === "desc" ?
"iconfont icon-sanjiaoxing-down font-12 yslbottomsj color-blue h10" : "iconfont icon-sanjiaoxing-down font-12 yslbottomsj h10"}
onClick={() => this.updatedlists("desc", 2)}></i>
</span>
</sapn>
<Dropdown overlay={menu}>
<span className="fr color-grey-9 mr10 pointer " style={{
display: "flex",
flexDirection: "initial",
}}>
<span>{sort_by === "updated_at" ? '最新动态' : sort_by === "created_at" ? '最新创建' : ""}</span>
<span className="fr color-grey-9 mr10 pointer " style={{
display: "flex",
flexDirection: "initial",
}}>
<span>{sort_by === "updated_at" ? '最新动态' : sort_by === "created_at" ? '最新创建' : ""}</span>
</span>
</span>
</Dropdown>
</p>
</p>
<style>
{
`
@ -309,87 +305,87 @@ class InfosCourse extends Component{
`
}
</style>
<div className="square-list clearfix">
{/* 289 */}
{
page == 1 && is_current && !category &&
this.props.current_user && this.props.current_user.user_identity != "学生" ?
<Create href={"/courses/new"} name={"新建课堂"} index="1"></Create> : ""
}
{
(!data || (data && data.courses.length === 0)) && (category || (!category && this.props.current_user && this.props.current_user.user_identity == "学生")) && <NoneData></NoneData>
}
{
data && data.courses && data.courses.map((item,key)=>{
return(
<div className="square-Item" onClick={()=>this.turnToCourses(`${item.first_category_url}`,item.can_visited)} style={{"cursor": "pointer",height:"289px"}}>
{
item.is_public == 1 &&
<React.Fragment>
<div className={key == 0 ?"publicpart orangeBlack":"publicpart"}></div>
<span className="smalltrangle"></span>
<span className="publicword">公开</span>
</React.Fragment>
}
{
item.can_visited ==false?
<div className="closeSquare">
<img src={getImageUrl("images/educoder/icon/lockclose.svg")} className="mt80 mb25"/>
<p className="font-14 color-white">非成员不能访问</p>
</div>:""
}
<div className="square-list clearfix">
{/* 289 */}
{
page == 1 && is_current && !category &&
this.props.current_user && this.props.current_user.user_identity != "学生" ?
<Create href={"/courses/new"} name={"新建课堂"} index="1"></Create> : ""
}
{
(!data || (data && data.courses.length === 0)) && (category || (!category && this.props.current_user && this.props.current_user.user_identity == "学生")) && <NoneData></NoneData>
}
{
data && data.courses && data.courses.map((item, key) => {
return (
<div className="square-Item" onClick={() => this.turnToCourses(`${item.first_category_url}`, item.can_visited)} style={{ "cursor": "pointer", height: "289px" }}>
{
item.is_public == 1 &&
<React.Fragment>
<div className={key == 0 ? "publicpart orangeBlack" : "publicpart"}></div>
<span className="smalltrangle"></span>
<span className="publicword">公开</span>
</React.Fragment>
}
{
item.can_visited == false ?
<div className="closeSquare">
<img src={getImageUrl("images/educoder/icon/lockclose.svg")} className="mt80 mb25" />
<p className="font-14 color-white">非成员不能访问</p>
</div> : ""
}
<div className="substance">
<p className="subName font-16">
<span>{item.name}</span>
</p>
<span><img alt="用户" className="radius mt15" height="60" src={getImageUrl('images/'+`${item.teacher && item.teacher.avatar_url}`)} width="60"/></span>
<p className="font-14 mt10 task-hide"><span>{item.teacher && item.teacher.real_name}</span></p>
<p className="font-16 mb15 task-hide mt10"><span className="color-grey-98">{item&&item.school}</span></p>
</div>
<div className="edu-txt-center course-bottom">
<div className="inline color-grey-6">
{item.visits>0?<span className="fl ml10 mr10 squareIconSpan">
<Tooltip placement="bottom" title="访问量">
<i className="iconfont icon-liulanyan fl mr3"></i>{item.visits}
</Tooltip>
<div className="substance">
<p className="subName font-16">
<span>{item.name}</span>
</p>
<span><img alt="用户" className="radius mt15" height="60" src={getImageUrl('images/' + `${item.teacher && item.teacher.avatar_url}`)} width="60" /></span>
<p className="font-14 mt10 task-hide"><span>{item.teacher && item.teacher.real_name}</span></p>
<p className="font-16 mb15 task-hide mt10"><span className="color-grey-98">{item && item.school}</span></p>
</div>
<div className="edu-txt-center course-bottom">
<div className="inline color-grey-6">
{item.visits > 0 ? <span className="fl ml10 mr10 squareIconSpan">
<Tooltip placement="bottom" title="访问量">
<i className="iconfont icon-liulanyan fl mr3"></i>{item.visits}
</Tooltip>
</span>:""}
</span> : ""}
{
item.members_count > 0 &&
<Tooltip placement="bottom" title="成员">
<span className="fl ml10 mr10 squareIconSpan">
<i className="iconfont icon-chengyuan fl mr3" data-tip-down="成员"></i>{item.members_count}</span>
</Tooltip>
}
{
item.homework_commons_count > 0 &&
<Tooltip placement="bottom" title="作业">
<span className="fl ml10 mr10 squareIconSpan">
<i className="iconfont icon-zuoye fl mr3" data-tip-down="作业"></i>{item.homework_commons_count}</span>
</Tooltip>
}
{/*{*/}
{
item.members_count > 0 &&
<Tooltip placement="bottom" title="成员">
<span className="fl ml10 mr10 squareIconSpan">
<i className="iconfont icon-chengyuan fl mr3" data-tip-down="成员"></i>{item.members_count}</span>
</Tooltip>
}
{
item.homework_commons_count > 0 &&
<Tooltip placement="bottom" title="作业">
<span className="fl ml10 mr10 squareIconSpan">
<i className="iconfont icon-zuoye fl mr3" data-tip-down="作业"></i>{item.homework_commons_count}</span>
</Tooltip>
}
{/*{*/}
{/*item.attachments_count > 0 && */}
{/*<Tooltip placement="bottom" title="资源">*/}
{/*<span className="fl ml10 mr10 squareIconSpan">*/}
{/*<i className="iconfont icon-ziyuan fl mr3" data-tip-down="资源"></i>{item.attachments_count}</span>*/}
{/*<span className="fl ml10 mr10 squareIconSpan">*/}
{/*<i className="iconfont icon-ziyuan fl mr3" data-tip-down="资源"></i>{item.attachments_count}</span>*/}
{/*</Tooltip>*/}
{/*}*/}
{/*}*/}
</div>
</div>
</div>
</div>
)
})
}
</div>
{
totalCount > 15 &&
<div className="mt30 mb50 edu-txt-center">
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/>
)
})
}
</div>
}
{
totalCount > 15 &&
<div className="mt30 mb50 edu-txt-center">
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page} />
</div>
}
</Spin>
</div>
)

@ -1,90 +1,89 @@
import React, { Component } from 'react';
import {Link} from 'react-router-dom';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import { Route, Switch } from 'react-router-dom';
import { SnackbarHOC } from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC'
import TPMIndexHOC from '../../tpm/TPMIndexHOC';
import CNotificationHOC from '../../courses/common/CNotificationHOC'
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
const UsersInfo = Loadable({
loader: () => import('./Infos'),
loading: Loading,
loader: () => import('./Infos'),
loading: Loading,
})
const VideoUploadList = Loadable({
loader: () => import('./video/VideoUploadList'),
loading: Loading,
loader: () => import('./video/VideoUploadList'),
loading: Loading,
})
const VideoPublishSuccess = Loadable({
loader: () => import('./video/VideoPublishSuccess'),
loading: Loading,
loader: () => import('./video/VideoPublishSuccess'),
loading: Loading,
})
const VideoProtocol = Loadable({
loader: () => import('./video/VideoProtocol'),
loading: Loading,
loader: () => import('./video/VideoProtocol'),
loading: Loading,
})
const $ = window.$;
class InfosIndex extends Component{
constructor(props){
class InfosIndex extends Component {
constructor(props) {
super(props);
this.state={
data:undefined,
this.state = {
data: undefined,
}
}
componentDidMount =()=>{
componentDidMount = () => {
}
//判断是否看的是当前用户的个人主页
componentDidUpdate =(prevProps)=> {
componentDidUpdate = (prevProps) => {
}
render(){
render() {
let {
data ,
}=this.state;
return(
<Switch {...this.props}>
data,
} = this.state;
return (
<Switch {...this.props}>
{/* --------------------------------------------------------------------- */}
{/* --------------------------------------------------------------------- */}
{/* 视频发布 */}
<Route exact path="/users/:username/videos/upload"
render={
(props) => (<VideoUploadList {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/users/:username/videos/success"
render={
(props) => (<VideoPublishSuccess {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/users/:username/videos/protocol"
render={
(props) => (<VideoProtocol {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 视频发布 */}
<Route exact path="/users/:username/videos/upload"
render={
(props) => (<VideoUploadList {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/users/:username/videos/success"
render={
(props) => (<VideoPublishSuccess {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/users/:username/videos/protocol"
render={
(props) => (<VideoProtocol {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/users/:username"
render={
(props) => (<UsersInfo {...this.props} {...props} {...this.state} />)
}
></Route>
<Route path="/users/:username"
render={
(props) => (<UsersInfo {...this.props} {...props} {...this.state} />)
}
></Route>
</Switch>
</Switch>
)
}
}
export default CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(InfosIndex) ));
export default CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(InfosIndex)));

@ -1,62 +1,58 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip, Menu, Pagination, Spin, Dropdown} from 'antd';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import { Tooltip, Menu, Pagination, Spin, Dropdown } from 'antd';
import NoneData from '../../courses/coursesPublic/NoneData'
import axios from 'axios';
import {getImageUrl,setImagesUrl} from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC'
import { getImageUrl } from 'educoder';
import "./usersInfo.css"
import Create from './publicCreatNew'
class InfosPath extends Component{
constructor(props){
class InfosPath extends Component {
constructor(props) {
super(props);
this.state={
category:undefined,
page:1,
status:undefined,
per_page:16,
isSpin:false,
this.state = {
category: undefined,
page: 1,
status: undefined,
per_page: 16,
isSpin: false,
sort_by: "updated_at",
sort_direction: "desc",
totalCount:undefined,
data:undefined
totalCount: undefined,
data: undefined
}
}
componentDidMount=()=>{
componentDidMount = () => {
this.setState({
isSpin:true
isSpin: true
})
let {category, status, sort_by, page, per_page, sort_direction} = this.state;
let { category, status, sort_by, page, per_page, sort_direction } = this.state;
this.getCourses(category, status, sort_by, page, sort_direction);
}
getCourses = (category, status, sort_by, page, sort_direction) => {
let url=`/users/${this.props.match.params.username}/subjects.json`;
axios.get((url),{params:{
category,
status,
sort_by,
page,
let url = `/users/${this.props.match.params.username}/subjects.json`;
axios.get((url), {
params: {
category,
status,
sort_by,
page,
sort_direction,
per_page:this.props.is_current && category && page ==1?17:16
}}).then((result)=>{
if(result){
per_page: this.props.is_current && category && page == 1 ? 17 : 16
}
}).then((result) => {
if (result) {
this.setState({
totalCount:result.data.count,
data:result.data,
totalCount: result.data.count,
data: result.data,
sort_by: sort_by,
sort_direction: sort_direction,
isSpin:false
isSpin: false
})
}
}).catch((error)=>{
}).catch((error) => {
console.log(error);
this.setState({
isSpin: false
@ -65,49 +61,49 @@ class InfosPath extends Component{
}
//切换种类
changeCategory=(cate)=>{
changeCategory = (cate) => {
this.setState({
category:cate,
status:undefined,
page:1,
isSpin:true
category: cate,
status: undefined,
page: 1,
isSpin: true
})
let {sort_by, sort_direction} = this.state;
let { sort_by, sort_direction } = this.state;
this.getCourses(cate, undefined, sort_by, 1, sort_direction);
}
// 切换状态
changeStatus=(status)=>{
let {category, sort_by, sort_direction} = this.state;
changeStatus = (status) => {
let { category, sort_by, sort_direction } = this.state;
this.setState({
status,
page:1,
isSpin:true
page: 1,
isSpin: true
})
this.getCourses(category, status, sort_by, 1, sort_direction);
}
//切换页数
changePage=(page)=>{
changePage = (page) => {
this.setState({
page,
isSpin:true
isSpin: true
})
let {category, sort_by, status, sort_direction} = this.state;
let { category, sort_by, status, sort_direction } = this.state;
this.getCourses(category, status, sort_by, page, sort_direction);
}
// 进入课堂
turnToCourses=(url)=>{
turnToCourses = (url) => {
this.props.history.push(url);
}
// 切换排序方式
changeOrder= (sort)=>{
changeOrder = (sort) => {
this.setState({
sort_by:sort,
isSpin:true
sort_by: sort,
isSpin: true
})
let {category, status, page, sort_direction} = this.state;
let { category, status, page, sort_direction } = this.state;
this.getCourses(category, status, sort, page, sort_direction);
}
@ -118,7 +114,7 @@ class InfosPath extends Component{
this.setState({
isSpin: true
});
let {category, status, page, sort_direction} = this.state;
let { category, status, page, sort_direction } = this.state;
this.getCourses(category, status, sort_by, 1, "desc");
}
@ -128,7 +124,7 @@ class InfosPath extends Component{
this.setState({
isSpin: true
});
let {category, status, page, sort_by, sort_direction} = this.state;
let { category, status, page, sort_by, sort_direction } = this.state;
let sort_directiony = sort_directions;
if (sort_directions === "asc") {
if (sort_directions === sort_direction) {
@ -144,8 +140,8 @@ class InfosPath extends Component{
}
render(){
let{
render() {
let {
category,
status,
sort_by,
@ -156,7 +152,7 @@ class InfosPath extends Component{
isSpin
} = this.state;
let isStudent = this.props.isStudent();
let is_current=this.props.is_current;
let is_current = this.props.is_current;
const menu = (
<Menu>
<Menu.Item onClick={() => this.updatedlist("updated_at")}>
@ -170,7 +166,7 @@ class InfosPath extends Component{
);
// console.log(this.props.user&&this.props.user.main_site)
return(
return (
<div className="educontent">
<Spin size="large" spinning={isSpin}>
<style>
@ -240,62 +236,62 @@ class InfosPath extends Component{
`
}
</style>
{
category && category == "manage" && is_current &&
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a href="javascript:void(0)"
onClick={() => this.changeStatus()}
className="w32">全部</a></li>
<li className={status == "editing" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("editing")} className="w60">编辑中</a></li>
<li className={status == "applying" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("applying")} className="w60">待审核</a></li>
<li className={status == "published" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("published")} className="w60">已发布</a></li>
<li className={status == "publiced" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("publiced")} className="w60" href="javascript:void(0)">已公开</a></li>
</div>
}
{
category && category == "study" && is_current &&
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a href="javascript:void(0)"
onClick={() => this.changeStatus()}
className="w32">全部</a></li>
<li className={status == "unfinished" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("unfinished")} className="w60">未完成</a></li>
<li className={status == "finished" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("finished")} className="w60">已完成</a></li>
</div>
}
{
category && category == "manage" && is_current &&
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a href="javascript:void(0)"
onClick={() => this.changeStatus()}
className="w32">全部</a></li>
<li className={status == "editing" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("editing")} className="w60">编辑中</a></li>
<li className={status == "applying" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("applying")} className="w60">待审核</a></li>
<li className={status == "published" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("published")} className="w60">已发布</a></li>
<li className={status == "publiced" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("publiced")} className="w60" href="javascript:void(0)">已公开</a></li>
</div>
}
{
category && category == "study" && is_current &&
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a href="javascript:void(0)"
onClick={() => this.changeStatus()}
className="w32">全部</a></li>
<li className={status == "unfinished" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("unfinished")} className="w60">未完成</a></li>
<li className={status == "finished" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
href="javascript:void(0)" onClick={() => this.changeStatus("finished")} className="w60">已完成</a></li>
</div>
}
<div className="clearfix font-12 " style={{
lineHeight: "41px",
marginTop: "10px",
}}>
<span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"实践课程"}</span>
<span className="fl color-grey-9">共参与{totalCount}{category ? category == "manage" ? "发布" : "学习" : "实践课程"}</span>
<sapn className="relativef color-grey-9 fr"
style={{
display: "flex",
flexDirection: "column",
height: "40px",
lineHeight: "40px",
}}
>
<span
style={{
display: "flex",
flexDirection: "column",
textAlign: "center",
height: "10px",
lineHeight: "10px",
display: "table",
marginTop: "9px",
height: "40px",
lineHeight: "40px",
}}
>
<i className={sort_direction === "asc" ?
"iconfont icon-sanjiaoxing-up font-12 color-blue h10 " : "iconfont icon-sanjiaoxing-up font-12 h10"}
onClick={() => this.updatedlists("asc")}></i>
<span
style={{
flexDirection: "column",
textAlign: "center",
height: "10px",
lineHeight: "10px",
display: "table",
marginTop: "9px",
}}
>
<i className={sort_direction === "asc" ?
"iconfont icon-sanjiaoxing-up font-12 color-blue h10 " : "iconfont icon-sanjiaoxing-up font-12 h10"}
onClick={() => this.updatedlists("asc")}></i>
</span>
</span>
<span
style={{
@ -306,21 +302,21 @@ class InfosPath extends Component{
display: "table",
}}
>
<i className={sort_direction === "desc" ?
"iconfont icon-sanjiaoxing-down font-12 yslbottomsj color-blue h10" : "iconfont icon-sanjiaoxing-down font-12 yslbottomsj h10"}
onClick={() => this.updatedlists("desc")}></i>
</span>
<i className={sort_direction === "desc" ?
"iconfont icon-sanjiaoxing-down font-12 yslbottomsj color-blue h10" : "iconfont icon-sanjiaoxing-down font-12 yslbottomsj h10"}
onClick={() => this.updatedlists("desc")}></i>
</span>
</sapn>
<Dropdown overlay={menu}>
<span className="fr color-grey-9 mr10 pointer " style={{
display: "flex",
flexDirection: "initial",
}}>
<span>{sort_by === "updated_at" ? '最近更新' : sort_by === "created_at" ? '最新创建' : ""}</span>
<span className="fr color-grey-9 mr10 pointer " style={{
display: "flex",
flexDirection: "initial",
}}>
<span>{sort_by === "updated_at" ? '最近更新' : sort_by === "created_at" ? '最新创建' : ""}</span>
</span>
</span>
</Dropdown>
</div>
</div>
<style>
{
`
@ -328,57 +324,57 @@ class InfosPath extends Component{
`
}
</style>
<div className="square-list clearfix">
{/* 295 */}
{
this.props.user&&this.props.user.main_site===true?page == 1 && is_current && !category ? <Create href={"/paths/new"} name={"新建实践课程"} index="3"></Create>:"":""
}
{
this.props.user&&this.props.user.main_site===false?this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.is_teacher===true||this.props.user&&this.props.user.business===true?page == 1 && is_current && !category ? <Create href={"/paths/new"} name={"新建实践课程"} index="3"></Create>:"":"":""
}
{
(!data || (data && data.subjects.length==0)) && category && <NoneData></NoneData>
}
{
data && data.subjects && data.subjects.map((item,key)=>{
return(
<div className="square-Item" style={{height:"295px"}} onClick={()=>this.turnToCourses(`/paths/${item.id}`)}>
{
item.tag && <div className="tag-green"><span className="tag-name">{item.tag}</span>
{/*<img src={setImagesUrl("images/educoder/tag2.png")} className="fl"/>*/}
</div>
}
<a href="javascript:void(0)" className="square-img"><img alt="Subject12" src={getImageUrl(`${item.image_url}`)}/></a>
<div className="square-main">
<p className="task-hide">
<a href="javascript:void(0)" className="justify color-grey-name "
>{item.name}</a>
</p>
<div className="mt10">
<p className="color-grey-6 clearfix">
<a href="javascript:void(0)" className="fl color-grey-9 overflowHidden1"
title={item.owner_name.length > 12 ? item.owner_name : ''} style={{ maxWidth: '175px'}}
>{item.owner_name}</a>
<span className="fr squareIconSpan">
<Tooltip placement='bottom' title="访问量">
<i className="iconfont icon-liulanyan fl mr5"></i>
</Tooltip>
{item.visits_count}
</span>
<div className="square-list clearfix">
{/* 295 */}
{
this.props.user && this.props.user.main_site === true ? page == 1 && is_current && !category ? <Create href={"/paths/new"} name={"新建实践课程"} index="3"></Create> : "" : ""
}
{
this.props.user && this.props.user.main_site === false ? this.props.user && this.props.user.admin === true || this.props.user && this.props.user.is_teacher === true || this.props.user && this.props.user.business === true ? page == 1 && is_current && !category ? <Create href={"/paths/new"} name={"新建实践课程"} index="3"></Create> : "" : "" : ""
}
{
(!data || (data && data.subjects.length == 0)) && category && <NoneData></NoneData>
}
{
data && data.subjects && data.subjects.map((item, key) => {
return (
<div className="square-Item" style={{ height: "295px" }} onClick={() => this.turnToCourses(`/paths/${item.id}`)}>
{
item.tag && <div className="tag-green"><span className="tag-name">{item.tag}</span>
{/*<img src={setImagesUrl("images/educoder/tag2.png")} className="fl"/>*/}
</div>
}
<a href="javascript:void(0)" className="square-img"><img alt="Subject12" src={getImageUrl(`${item.image_url}`)} /></a>
<div className="square-main">
<p className="task-hide">
<a href="javascript:void(0)" className="justify color-grey-name "
>{item.name}</a>
</p>
<div className="mt10">
<p className="color-grey-6 clearfix">
<a href="javascript:void(0)" className="fl color-grey-9 overflowHidden1"
title={item.owner_name.length > 12 ? item.owner_name : ''} style={{ maxWidth: '175px' }}
>{item.owner_name}</a>
<span className="fr squareIconSpan">
<Tooltip placement='bottom' title="访问量">
<i className="iconfont icon-liulanyan fl mr5"></i>
</Tooltip>
{item.visits_count}
</span>
</p>
</div>
</div>
</div>
</div>
)
})
}
</div>
{
totalCount > 15 &&
<div className="mt30 mb50 edu-txt-center">
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/>
)
})
}
</div>
}
{
totalCount > 15 &&
<div className="mt30 mb50 edu-txt-center">
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page} />
</div>
}
</Spin>
</div>
)

@ -1,11 +1,10 @@
import React, { Component } from 'react';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import { Route, Switch } from 'react-router-dom';
import { Breadcrumb } from 'antd';
import { SnackbarHOC } from 'educoder';
import { TPMIndexHOC } from '../../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../../courses/common/CNotificationHOC'
import TPMIndexHOC from '../../../tpm/TPMIndexHOC';
import CNotificationHOC from '../../../courses/common/CNotificationHOC'
import "../usersInfo.css"
import "../../../courses/css/members.css"
@ -16,68 +15,68 @@ import Loading from '../../../../Loading';
// 毕设选题
const GtopicBanks = Loadable({
loader: () => import('./GtopicBanks'),
loading: Loading,
loader: () => import('./GtopicBanks'),
loading: Loading,
})
const BanksTabIndex = Loadable({
loader: () => import('./BanksTabIndex'),
loading: Loading,
loader: () => import('./BanksTabIndex'),
loading: Loading,
})
const GtopicBanksEdit = Loadable({
loader: () => import('./GtopicBanksEdit'),
loading: Loading,
loader: () => import('./GtopicBanksEdit'),
loading: Loading,
})
const HomeworkBanksEdit = Loadable({
loader: () => import('./HomeworkBanksEdit'),
loading: Loading,
loader: () => import('./HomeworkBanksEdit'),
loading: Loading,
});
const ExerciseBanksEdit = Loadable({
loader: () => import('./ExerciseBanksEdit'),
loading: Loading,
loader: () => import('./ExerciseBanksEdit'),
loading: Loading,
});
//普通作业题库详情
const Generaljobbankdetails =Loadable({
const Generaljobbankdetails = Loadable({
loader: () => import('../../../courses/questionbank/Generaljobbankdetails'),
loading: Loading,
});
//分组作业题库详情
const GroupjobbankPage =Loadable({
const GroupjobbankPage = Loadable({
loader: () => import('../../../courses/groupjobbank/GroupjobbankPage'),
loading: Loading,
});
//毕设选题详情
const CompletetopicdePage =Loadable({
const CompletetopicdePage = Loadable({
loader: () => import('../../../courses/comtopicdetails/CompletetopicdePage'),
loading: Loading,
});
//毕设任务详情
const Completetaskpage =Loadable({
const Completetaskpage = Loadable({
loader: () => import('../../../courses/completetaskdetails/Completetaskpage'),
loading: Loading,
});
//问卷编辑
const PollNewQuestbank =Loadable({
const PollNewQuestbank = Loadable({
loader: () => import('../../../courses/poll/PollNewQuestbank'),
loading: Loading,
});
const GtaskBanksEdit = Loadable({
loader: () => import('./GtaskBanksEdit'),
loading: Loading,
loader: () => import('./GtaskBanksEdit'),
loading: Loading,
})
class BanksIndex extends Component{
constructor(props){
class BanksIndex extends Component {
constructor(props) {
super(props);
this.state={
crumbData:undefined,
publicly:undefined
this.state = {
crumbData: undefined,
publicly: undefined
}
}
componentDidMount = () =>{
componentDidMount = () => {
// let pathname = this.props.location.pathname;
// this.setState({
// publicly:pathname.indexOf("/publicly") > -1
@ -85,8 +84,8 @@ class BanksIndex extends Component{
}
initPublic = (crumbData,data) =>{
if(data && data.status && data.status == -2){
initPublic = (crumbData, data) => {
if (data && data.status && data.status == -2) {
this.props.history.push(`/topicbank/publicly`);
}
this.setState({
@ -94,8 +93,8 @@ class BanksIndex extends Component{
})
}
componentDidUpdate(prevProps) {
// if(prevProps.current_user!=this.props.current_user){
componentDidUpdate(prevProps) {
// if(prevProps.current_user!=this.props.current_user){
// let { publicly }=this.state;
// if( this.props.checkIfLogin()) {
// if (this.props.current_user && this.props.current_user.professional_certification == false && publicly){
@ -116,21 +115,21 @@ class BanksIndex extends Component{
// }
}
render(){
let { crumbData }=this.state
render() {
let { crumbData } = this.state
const common = {
initPublic:this.initPublic
initPublic: this.initPublic
}
return(
return (
<div className="newMain">
<div className="educontent">
{
crumbData &&
<Breadcrumb separator=">" className="breadcrumb mt22">
<Breadcrumb.Item href={crumbData && crumbData.is_public == true ?`/topicbank/publicly`:`/users/${this.props.current_user && this.props.current_user.login}/topics/personal`}>{ crumbData && crumbData.is_public == true ? '公共' : '我的' }题库</Breadcrumb.Item>
<Breadcrumb.Item href={crumbData && crumbData.is_public == true ? `/topicbank/publicly` : `/users/${this.props.current_user && this.props.current_user.login}/topics/personal`}>{crumbData && crumbData.is_public == true ? '公共' : '我的'}题库</Breadcrumb.Item>
{
crumbData.crumbArray && crumbData.crumbArray.map((item,key)=>{
return(
crumbData.crumbArray && crumbData.crumbArray.map((item, key) => {
return (
<Breadcrumb.Item key={key} href={item.to || ""}>{item.content}</Breadcrumb.Item>
)
})
@ -138,34 +137,34 @@ class BanksIndex extends Component{
</Breadcrumb>
}
{
crumbData &&<p className="clearfix mt15 mb10 ">
<span className="fl font-24 color-grey-3 task-hide lineh-30" style={{maxWidth:'800px'}}>{crumbData && crumbData.title}</span>
{ crumbData.is_public == true ?
<span className="bank_is_public">公开</span>
:
<span className="bank_is_private">私有</span>
}
{
crumbData && <p className="clearfix mt15 mb10 ">
<span className="fl font-24 color-grey-3 task-hide lineh-30" style={{ maxWidth: '800px' }}>{crumbData && crumbData.title}</span>
{crumbData.is_public == true ?
<span className="bank_is_public">公开</span>
:
<span className="bank_is_private">私有</span>
}
</p> }
</p>}
<Switch {...this.props}>
{/*毕设任务编辑*/}
<Route path='/banks/gtask/:workId/edit/:type'
render={
(props) => {
return (<GtaskBanksEdit {...this.props} {...props} {...this.state} {...common}/>)
}
}></Route>
{/*毕设任务编辑*/}
<Route path='/banks/gtask/:workId/edit/:type'
render={
(props) => {
return (<GtaskBanksEdit {...this.props} {...props} {...this.state} {...common} />)
}
}></Route>
<Route path='/banks/normal/:workId/edit/:type'
<Route path='/banks/normal/:workId/edit/:type'
render={
(props) => {
return (<HomeworkBanksEdit {...this.props} {...props} {...this.state} {...common}
isGroup={false}
/>)
}
}></Route>
}></Route>
<Route path='/banks/group/:workId/edit/:type'
render={
@ -174,7 +173,7 @@ class BanksIndex extends Component{
isGroup={true}
/>)
}
}></Route>
}></Route>
<Route path='/banks/exercise/:Id/edit/:type'
render={
@ -182,23 +181,23 @@ class BanksIndex extends Component{
return (<ExerciseBanksEdit {...this.props} {...props} {...this.state} {...common}
/>)
}
}></Route>
}></Route>
<Route path='/banks/gtopic/:bankId/edit/:type'
render={
(props) => {
return (<GtopicBanksEdit {...this.props} {...props} {...this.state} {...common}/>)
return (<GtopicBanksEdit {...this.props} {...props} {...this.state} {...common} />)
}
}></Route>
}></Route>
{/*题库问卷编辑详情*/}
<Route path="/banks/poll/:workid/edit/:type"
render={
(props) => (<PollNewQuestbank {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/*题库问卷编辑详情*/}
<Route path="/banks/poll/:workid/edit/:type"
render={
(props) => (<PollNewQuestbank {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route path='/banks/poll/:bankId/:type'
@ -206,37 +205,37 @@ class BanksIndex extends Component{
(props) => {
return (<BanksTabIndex {...this.props} {...props} {...this.state} {...common} />)
}
}></Route>
<Route path='/banks/exercise/:Id/:type'
render={
(props) => {
return (<BanksTabIndex {...this.props} {...props} {...this.state} {...common}
/>)
}
}></Route>
{/*毕设任务题库详情*/}
}></Route>
<Route path='/banks/exercise/:Id/:type'
render={
(props) => {
return (<BanksTabIndex {...this.props} {...props} {...this.state} {...common}
/>)
}
}></Route>
{/*毕设任务题库详情*/}
<Route path="/banks/gtask/:workid/:type"
render={
(props) => (<Completetaskpage {...this.props} {...props} {...this.state} {...common} />)
}
render={
(props) => (<Completetaskpage {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/*毕设内容题库详情*/}
<Route path="/banks/gtopic/:workid/:type"
render={
(props) => (<CompletetopicdePage {...this.props} {...props} {...this.state} {...common}/>)
}
render={
(props) => (<CompletetopicdePage {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/*分组作业题库详情*/}
<Route path="/banks/group/:workid/:type"
render={
(props) => (<GroupjobbankPage {...this.props} {...props} {...this.state} {...common} />)
}
render={
(props) => (<GroupjobbankPage {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/* 普通作业题库详情*/}
<Route path="/banks/normal/:workid/:type"
render={
(props) => (<Generaljobbankdetails {...this.props} {...props} {...this.state} {...common} />)
}
render={
(props) => (<Generaljobbankdetails {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
</Switch>
@ -246,7 +245,7 @@ class BanksIndex extends Component{
)
}
}
export default CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(BanksIndex) ));
export default CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(BanksIndex)));

@ -1,86 +1,76 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip,Menu,Pagination} from 'antd';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import axios from 'axios';
import {getImageUrl} from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC';
import GotoQQgroup from '../../../modal/GotoQQgroup';
import "./usersInfo.css"
class publicCreateNew extends Component{
constructor(props){
super(props);
this.state={
class publicCreateNew extends Component {
constructor(props) {
super(props);
this.state = {
}
}
}
//头部获取是否已经登录了
getUser=(url,name)=> {
if (this.props.user&&this.props.user.email===undefined||this.props.user&&this.props.user.email===null||this.props.user&&this.props.user.email==="") {
this.props.showNotification("请先绑定邮箱,谢谢");
return
getUser = (url, name) => {
if (this.props.user && this.props.user.email === undefined || this.props.user && this.props.user.email === null || this.props.user && this.props.user.email === "") {
this.props.showNotification("请先绑定邮箱,谢谢");
return
}
if (name === "新建实训") {
if (this.props && this.props.current_user && this.props.current_user.is_shixun_marker === false) {
this.props.setgoshowqqgtounp(true);
return;
}
if(name==="新建实训"){
if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){
this.props.setgoshowqqgtounp(true);
return;
}
}
}
if(url !== undefined || url!==""){
if (url !== undefined || url !== "") {
window.location.href = url;
}
}
getUsers=(url,name)=> {
getUsers = (url, name) => {
if(name==="新建实训"){
if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){
this.props.setgoshowqqgtounp(true);
return;
}
if (name === "新建实训") {
if (this.props && this.props.current_user && this.props.current_user.is_shixun_marker === false) {
this.props.setgoshowqqgtounp(true);
return;
}
}
if(url !== undefined || url!==""){
if (url !== undefined || url !== "") {
window.location.href = url;
}
}
render() {
let {href,name,index}=this.props;
render() {
let { href, name, index } = this.props;
return (
<div className="square-Item" style={{"height":`${index=="1"?"289":index=="2"?"298":index=="3"?"295":"289"}px`}}>
return (
<div className="square-Item" style={{ "height": `${index == "1" ? "289" : index == "2" ? "298" : index == "3" ? "295" : "289"}px` }}>
<div className="substance substancepad">
{this.props.Createtype==="projects"?<a onClick={()=>this.getUser(href,name)}>
<div className="substance substancepad">
{this.props.Createtype === "projects" ? <a onClick={() => this.getUser(href, name)}>
<div className="substancenenew">
<div className="leftten"></div>
<div className="topten"></div>
</div>
</a>: <a onClick={()=>this.getUsers(href,name)}>
<div className="substancenenew">
<div className="leftten"></div>
<div className="topten"></div>
</div>
</a>}
</div>
<div className="edu-txt-center course-bottom">
<div className="inline color-grey-6">
<span className="fl ml10 mr10 squareIconSpan substancefont">
{name}
</span>
</div>
</div>
</div>
)
}
</a> : <a onClick={() => this.getUsers(href, name)}>
<div className="substancenenew">
<div className="leftten"></div>
<div className="topten"></div>
</div>
</a>}
</div>
<div className="edu-txt-center course-bottom">
<div className="inline color-grey-6">
<span className="fl ml10 mr10 squareIconSpan substancefont">
{name}
</span>
</div>
</div>
</div>
)
}
}
export default publicCreateNew;

@ -1,14 +1,12 @@
import React, { useState, useEffect, useContext, useRef, memo } from 'react';
import {Link} from 'react-router-dom';
import {Pagination, Input, Button} from 'antd'
import { getUrl2, isDev, ThemeContext, ActionBtn, NoneData } from 'educoder'
import { Pagination, Input, Button } from 'antd'
import { ThemeContext, ActionBtn, NoneData } from 'educoder'
import axios from 'axios'
import VideoInReviewItem from './VideoInReviewItem'
import EditVideoModal from './EditVideoModal'
import './InfosVideo.css'
import InfoTab from '../common/InfoTab'
import HeadlessModal from '../common/HeadlessModal'
import CRoundSelect from '../common/CRoundSelect'
import ClipboardJS from 'clipboard'
@ -45,11 +43,11 @@ const DEFAULT_VIDEO_WIDTH_IN_MD = "90%" // 400
const DEFAULT_VIDEO_HEIGHT_IN_MD = "55%" // 400
let videoId = {};
let _clipboard = null;
const _items=[
{key: 'published_at-desc', name: '最新上传'},
{key: 'published_at-asc', name: '最早上传'},
const _items = [
{ key: 'published_at-desc', name: '最新上传' },
{ key: 'published_at-asc', name: '最早上传' },
]
function InfoVideo (props) {
function InfoVideo(props) {
const [videos, setvideos] = useState(undefined)
const [reviewvideos, setReviewvideos] = useState(undefined)
const [count, setCount] = useState(0)
@ -80,30 +78,30 @@ function InfoVideo (props) {
const fetchUrl = `/users/${username}/videos.json`
const sorts = sortKey.split('-')
setLoading(true)
axios.get(fetchUrl, {
axios.get(fetchUrl, {
params: {
page: pageObj.current,
per_page: PAGE_SIZE,
sort_by: sorts[0],
sort_direction: sorts[1],
//
//
}
})
.then((response) => {
setLoading(false)
if (response.data.videos) {
setvideos(response.data.videos)
setCount(response.data.count)
}
}).catch(() => {
setLoading(false)
})
.then((response) => {
setLoading(false)
if (response.data.videos) {
setvideos(response.data.videos)
setCount(response.data.count)
}
}).catch(() => {
setLoading(false)
})
}
function fetchReviewvideos() {
const fetchUrl = `/users/${username}/videos/review.json`
const sorts = sortKey.split('-')
setLoading(true)
axios.get(fetchUrl, {
axios.get(fetchUrl, {
params: {
page: pageObj.current,
per_page: PAGE_SIZE,
@ -111,15 +109,15 @@ function InfoVideo (props) {
sort_direction: sorts[1],
}
})
.then((response) => {
setLoading(false)
if (response.data.videos) {
setReviewvideos(response.data.videos)
setCount(response.data.count)
}
}).catch(() => {
.then((response) => {
setLoading(false)
if (response.data.videos) {
setReviewvideos(response.data.videos)
setCount(response.data.count)
}
}).catch(() => {
})
})
}
useEffect(() => {
@ -130,7 +128,7 @@ function InfoVideo (props) {
fetchReviewvideos()
}
} else {
pageObj.onChange(1)
pageObj.onChange(1)
}
}, [categoryObj.category])
@ -140,7 +138,7 @@ function InfoVideo (props) {
} else {
fetchReviewvideos()
}
}, [ pageObj.current, sortKey ])
}, [pageObj.current, sortKey])
useEffect(() => {
if (videoModalObj.visible == false) {
@ -158,9 +156,9 @@ function InfoVideo (props) {
_clipboard = new ClipboardJS('.copybtn');
_clipboard.on('success', (e) => {
showNotification('复制成功')
});
});
}
}, 200)
}, 200)
}
}, [videoModalObj.visible])
@ -173,7 +171,7 @@ function InfoVideo (props) {
}
function onEditVideo(item) {
videoId = {
videoId = {
videoId: item.id,
title: item.title
}
@ -182,7 +180,7 @@ function InfoVideo (props) {
// this.refs['editVideoModal'].setVisible(true, video);
}
function onMaskClick(item) {
videoId = {
videoId = {
videoId: item.id,
title: item.title,
file_url: item.file_url,
@ -219,12 +217,12 @@ function InfoVideo (props) {
}
function getCopyText (file_url, cover_url) {
function getCopyText(file_url, cover_url) {
return `<video src="${file_url}" controls="true" controlslist="nodownload" width="${DEFAULT_VIDEO_WIDTH_IN_MD}" height="${DEFAULT_VIDEO_HEIGHT_IN_MD}" poster="${cover_url}">您的浏览器不支持 video 标签。</video>`
}
const _inputValue = getCopyText(videoId.file_url, videoId.cover_url);
const sorts = sortKey.split('-')
const _inputValue = getCopyText(videoId.file_url, videoId.cover_url);
const sorts = sortKey.split('-')
return (
<div className="educontent infoVideo">
@ -238,7 +236,7 @@ function InfoVideo (props) {
className="showVideoModal"
width={800 - 1}
>
<video
<video
autoplay="true"
ref={videoEl}
src={videoId.file_url} controls="true" controlslist="nodownload">
@ -318,130 +316,130 @@ function InfoVideo (props) {
onClick={() => { toUpload() }}
className="toUploadBtn"
>
>
上传视频
</Button>
}
></InfoTab>
<div className="toolbarRow df" style={{
lineHeight: "40px",
}}>
<div className="toolbarRow df" style={{
lineHeight: "40px",
}}>
<span>
<span style={{color: theme.foreground_orange1}}> {count} </span>
<span style={{ color: theme.foreground_orange1 }}> {count} </span>
个视频
</span>
{/*{categoryObj.category == 'all' && <CRoundSelect {...props}*/}
{/*width={'90px'}*/}
{/*items={_items}*/}
{/*onSortChange={onSortChange}*/}
{/*sortKey={sortKey }*/}
{/*width={'90px'}*/}
{/*items={_items}*/}
{/*onSortChange={onSortChange}*/}
{/*sortKey={sortKey }*/}
{/*></CRoundSelect>}*/}
{categoryObj.category == 'all' &&<div className="fr">
<li className="drop_down">
<span className="color-grey-9 font-12" style={{
marginRight: " 5px",
}}>{"最新上传"}</span>
<sapn className="relativef color-grey-9 fr"
style={{
display: "flex",
flexDirection: "column",
height: "40px",
lineHeight: "40px",
}}
>
<span
style={{
flexDirection: "column",
textAlign: "center",
height: "10px",
lineHeight: "10px",
display: "table",
marginTop: "9px",
}}
>
<i className={sorts[1] === "asc" ?
"iconfont icon-sanjiaoxing-up font-12 color-blue h10 " : "iconfont icon-sanjiaoxing-up font-12 h10"}
onClick={() => onSortChange("published_at-asc", 0)}></i>
</span>
<span
style={{
flexDirection: "column",
height: "10px",
lineHeight: "10px",
textAlign: "center",
display: "table",
}}
>
<i className={sorts[1] === "desc" ?
"iconfont icon-sanjiaoxing-down font-12 yslbottomsj color-blue h10" : "iconfont icon-sanjiaoxing-down font-12 yslbottomsj h10"}
onClick={() => onSortChange("published_at-desc", 0)}></i>
</span>
</sapn>
</li>
</div>}
{categoryObj.category == 'all' && <div className="fr">
<li className="drop_down">
<span className="color-grey-9 font-12" style={{
marginRight: " 5px",
}}>{"最新上传"}</span>
<sapn className="relativef color-grey-9 fr"
style={{
display: "flex",
flexDirection: "column",
height: "40px",
lineHeight: "40px",
}}
>
<span
style={{
flexDirection: "column",
textAlign: "center",
height: "10px",
lineHeight: "10px",
display: "table",
marginTop: "9px",
}}
>
<i className={sorts[1] === "asc" ?
"iconfont icon-sanjiaoxing-up font-12 color-blue h10 " : "iconfont icon-sanjiaoxing-up font-12 h10"}
onClick={() => onSortChange("published_at-asc", 0)}></i>
</span>
<span
style={{
flexDirection: "column",
height: "10px",
lineHeight: "10px",
textAlign: "center",
display: "table",
}}
>
<i className={sorts[1] === "desc" ?
"iconfont icon-sanjiaoxing-down font-12 yslbottomsj color-blue h10" : "iconfont icon-sanjiaoxing-down font-12 yslbottomsj h10"}
onClick={() => onSortChange("published_at-desc", 0)}></i>
</span>
</sapn>
</li>
</div>}
</div>
{categoryObj.category == 'all' ?
<div className="itemWrap">
{
videos == undefined ? '' :
videos.length ?
videos.map((item, index) => {
return (<VideoInReviewItem
{...props}
{...item}
key={item.id}
onEditVideo={onEditVideo}
onMaskClick={onMaskClick}
getCopyText={getCopyText}
>
</VideoInReviewItem>)
})
: <NoneData style={{width: '100%'}}></NoneData>
}
</div>
:
<div className="itemWrap">
{
reviewvideos == undefined ? '' :
reviewvideos.length ?
reviewvideos.map((item, index) => {
return (<VideoInReviewItem
{...props}
{...item}
key={item.id}
isReview={true}
>
</VideoInReviewItem>)
})
: <NoneData style={{width: '100%'}}></NoneData>
}
</div>
{categoryObj.category == 'all' ?
<div className="itemWrap">
{
videos == undefined ? '' :
videos.length ?
videos.map((item, index) => {
return (<VideoInReviewItem
{...props}
{...item}
key={item.id}
onEditVideo={onEditVideo}
onMaskClick={onMaskClick}
getCopyText={getCopyText}
>
</VideoInReviewItem>)
})
: <NoneData style={{ width: '100%' }}></NoneData>
}
</div>
:
<div className="itemWrap">
{
reviewvideos == undefined ? '' :
reviewvideos.length ?
reviewvideos.map((item, index) => {
return (<VideoInReviewItem
{...props}
{...item}
key={item.id}
isReview={true}
>
</VideoInReviewItem>)
})
: <NoneData style={{ width: '100%' }}></NoneData>
}
</div>
}
{/* categoryObj.category == 'all' && */}
{/* categoryObj.category == 'all' && */}
{
count > PAGE_SIZE &&
count > PAGE_SIZE &&
<div className="mt30 mb50 edu-txt-center">
<Pagination showQuickJumper total={count} pageSize={PAGE_SIZE}
{...pageObj}
<Pagination showQuickJumper total={count} pageSize={PAGE_SIZE}
{...pageObj}
/>
</div>
}
</div>
</div>
)
}

@ -1,122 +1,122 @@
import React,{ Component } from "react";
import {Checkbox,Input,Table, Pagination,Menu,Icon} from "antd";
import {TPMIndexHOC} from "../modules/tpm/TPMIndexHOC";
import {Link,NavLink} from 'react-router-dom';
import { WordsBtn ,ActionBtn,SnackbarHOC,markdownToHTML,getImageUrl} from 'educoder';
import React, { Component } from "react";
import { Input, Pagination, Menu, Icon } from "antd";
import TPMIndexHOC from "../modules/tpm/TPMIndexHOC";
import { SnackbarHOC, getImageUrl } from 'educoder';
import axios from 'axios';
import './searchc.css'
const Search = Input.Search;
class SearchPage extends Component{
class SearchPage extends Component {
constructor(props) {
super(props);
this.state={
tab:"1",
count:0,
keywords:undefined,
type:"subject",
page:1,
perpages:20,
data:[],
jupyterbool:false,
this.state = {
tab: "1",
count: 0,
keywords: undefined,
type: "subject",
page: 1,
perpages: 20,
data: [],
jupyterbool: false,
}
}
//切换tab
changeTab=(e)=>{
changeTab = (e) => {
// course 2 课堂, shixun 0 实训项目 subject 1 实践课程 memo 3交流问答
let types ="";
if(parseInt(e.key)===0){
types="shixun";
let types = "";
if (parseInt(e.key) === 0) {
types = "shixun";
}
if(parseInt(e.key)===1){
types="subject";
if (parseInt(e.key) === 1) {
types = "subject";
}
if(parseInt(e.key)===2){
types="course";
if (parseInt(e.key) === 2) {
types = "course";
}
if(parseInt(e.key)===3){
types="memo";
if (parseInt(e.key) === 3) {
types = "memo";
}
this.setState({
tab:e.key,
type:types,
page:1,
tab: e.key,
type: types,
page: 1,
})
this.getdata(1,types,this.state.keywords);
this.getdata(1, types, this.state.keywords);
}
componentDidMount(){
let courstype=decodeURI(decodeURI(this.props.location.search));
componentDidMount() {
let courstype = decodeURI(decodeURI(this.props.location.search));
courstype = courstype.split('?value=');
this.setState({
keywords:courstype[1]
keywords: courstype[1]
})
this.getdata(this.state.page,this.state.type,courstype[1]);
this.getdata(this.state.page, this.state.type, courstype[1]);
}
componentDidUpdate(prevProps) {
if(prevProps.location.search!=this.props.location.search){
let courstype=decodeURI(decodeURI(this.props.location.search));
if (prevProps.location.search != this.props.location.search) {
let courstype = decodeURI(decodeURI(this.props.location.search));
courstype = courstype.split('?value=');
this.setState({
keywords:courstype[1]
keywords: courstype[1]
})
this.getdata(this.state.page,this.state.type,courstype[1]);
this.getdata(this.state.page, this.state.type, courstype[1]);
}
}
setdatafunsval=(e)=>{
setdatafunsval = (e) => {
this.setState({
keywords:e.target.value
keywords: e.target.value
})
}
setdatafuns =(value)=>{
setdatafuns = (value) => {
this.setState({
keywords:value,
page:1
keywords: value,
page: 1
})
this.props.history.replace(`/search?value=${value}`)
this.getdata(1,this.state.type,value);
this.getdata(1, this.state.type, value);
}
paginationonChanges = (pageNumber) => {
this.setState({
page: pageNumber,
loadingstate: true,
})
this.getdata(pageNumber,this.state.type,this.state.keywords);
this.getdata(pageNumber, this.state.type, this.state.keywords);
}
//获取数据
getdata=(pages,type,keywords)=>{
getdata = (pages, type, keywords) => {
let url = "/search.json";
this.setState({ loading: true })
axios.get(url,{params:{
keyword:keywords,
type:type,
page:pages,
per_page:this.state.perpages,
axios.get(url, {
params: {
keyword: keywords,
type: type,
page: pages,
per_page: this.state.perpages,
}
}).then((response) => {
this.setState({ loading: false })
if(response === undefined){
if (response === undefined) {
return
}
this.setState({
count:response.data.count,
data:response.data.results,
count: response.data.count,
data: response.data.results,
})
}).catch((error) => {
@ -124,11 +124,11 @@ class SearchPage extends Component{
});
}
render(){
let {tab,count,data,page,perpages, type }=this.state;
render() {
let { tab, count, data, page, perpages, type } = this.state;
return(
return (
<div className="newMain clearfix">
<style>{`
.ziticor.iconfont {
@ -142,26 +142,26 @@ class SearchPage extends Component{
`}</style>
<div className="shixunDetail_top shixundetailtopcss" >
{/*<div style={{height:"53px"}}></div>*/}
<div className="intermediatecenter" style={{ width: "100%"}}>
<div className="intermediatecenter" style={{ width: "100%" }}>
<Search
style={{ width: "800px", marginTop:"53px"}}
style={{ width: "800px", marginTop: "53px" }}
className="packinput"
value={this.state.keywords}
enterButton={<span><Icon type="search" className="mr5"/> 搜索</span>}
onInput={(e)=>this.setdatafunsval(e)}
onSearch={ (value)=>this.setdatafuns(value)} />
enterButton={<span><Icon type="search" className="mr5" /> 搜索</span>}
onInput={(e) => this.setdatafunsval(e)}
onSearch={(value) => this.setdatafuns(value)} />
</div>
</div>
<div className="tabtitle">
<div className="tabtitles2">
<Menu mode="horizontal" className="tabtitless" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item className={"tabtitle1"} key="1">实践课程</Menu.Item>
<Menu.Item className={"tabtitle2"} key="2">教学课堂</Menu.Item>
<Menu.Item className={"tabtitle2"} key="0">实训项目</Menu.Item>
<Menu.Item className={"tabtitle2"} key="3">交流问答</Menu.Item>
</Menu>
<Menu mode="horizontal" className="tabtitless" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item className={"tabtitle1"} key="1">实践课程</Menu.Item>
<Menu.Item className={"tabtitle2"} key="2">教学课堂</Menu.Item>
<Menu.Item className={"tabtitle2"} key="0">实训项目</Menu.Item>
<Menu.Item className={"tabtitle2"} key="3">交流问答</Menu.Item>
</Menu>
</div>
</div>
{
@ -170,7 +170,7 @@ class SearchPage extends Component{
<div id="forum_list" className="forum_table">
<div className="mh650 bjyss">
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")} />
<p className="edu-nodata-p mb30">暂时还没有相关数据哦</p>
</div>
</div>
@ -201,108 +201,108 @@ class SearchPage extends Component{
{data === undefined ? "" : data.map((item, key) => {
return (
<a key={key}
href={
item.type==="shixun"?`/shixuns/${item.identifier}/challenges`:item.type==="course"?`${item.first_category_url}`:item.type==="subject"?`/paths/${item.id}`:item.type==="memo"?`/forums/${item.id}`:""
href={
item.type === "shixun" ? `/shixuns/${item.identifier}/challenges` : item.type === "course" ? `${item.first_category_url}` : item.type === "subject" ? `/paths/${item.id}` : item.type === "memo" ? `/forums/${item.id}` : ""
}
target="_blank"
target="_blank"
>
<div className="project-package-item">
<div className="project-package-item">
<div className={"font-16 color-dark fl "} style={{width:"100%"}} >
{/*标题*/}
<div className="sortinxdirection jupytertextheig" style={{width:"100%"}}>
<div className={"font-16 color-dark fl "} style={{ width: "100%" }} >
{/*标题*/}
<div className="sortinxdirection jupytertextheig" style={{ width: "100%" }}>
<span className={"markdown-body fonttext maxnamewidth92"}
<span className={"markdown-body fonttext maxnamewidth92"}
dangerouslySetInnerHTML={{__html:item.title}}/>
{
type==="shixun"?
(
item.is_jupyter===true?
<div className="jupytertext intermediatecenter ml20"><p className="jupytertextp">Jupyter</p></div>
:""
)
:""
}
</div>
{/*描述*/}
<div>
dangerouslySetInnerHTML={{ __html: item.title }} />
{
type === "shixun" ?
(
item.is_jupyter === true ?
<div className="jupytertext intermediatecenter ml20"><p className="jupytertextp">Jupyter</p></div>
: ""
)
: ""
}
</div>
{/*描述*/}
<div>
{item.content.content === undefined || item.content.content===0?"": item.content.content.map((item4, key4) => {
return (
<span className={"markdown-body magr11 fontextcolor"}
dangerouslySetInnerHTML={{__html: item4}} />
)
})
}
</div>
<div>
{/*内容*/}
{item.content.description === undefined || item.content.description===0?"": item.content.description.map((item3, key3) => {
return (
<span className={"markdown-body magr11 fontextcolor"}
dangerouslySetInnerHTML={{__html: item3}} />
)
})
}
</div>
<div className="xuxianpro"></div>
{item.content.content === undefined || item.content.content === 0 ? "" : item.content.content.map((item4, key4) => {
return (
<span className={"markdown-body magr11 fontextcolor"}
dangerouslySetInnerHTML={{ __html: item4 }} />
)
})
}
</div>
<div>
{/*内容*/}
{item.content.description === undefined || item.content.description === 0 ? "" : item.content.description.map((item3, key3) => {
return (
<span className={"markdown-body magr11 fontextcolor"}
dangerouslySetInnerHTML={{ __html: item3 }} />
)
})
}
</div>
<div>
{/*挑战名字*/}
<div className="xuxianpro"></div>
<div>
{/*挑战名字*/}
{item.content.challenge_names === undefined || item.content.challenge_names===0?"": item.content.challenge_names.map((item5, key5) => {
return (
<div className={"df"}>
<span style={{flex: '0 0 82px'}}>关卡名称</span>
<span className={""}
dangerouslySetInnerHTML={{__html: item5}} />
</div>
)
})
}
</div>
<div>
{/*挑战标签*/}
{item.content.challenge_tag_names === undefined || item.content.challenge_tag_names===0?"": item.content.challenge_tag_names.map((item6, key6) => {
return (
<div className={"df"}>
<span style={{flex: '0 0 82px'}}>关卡标签</span>
<span className={key6>1?" tzbq ":" tzbqx"} style={{
width:"100%"
}}
dangerouslySetInnerHTML={{__html:item6}} />
</div>
)
})
}
</div>
<div>
{/*合作单位*/}
{item.content.member_user_names === undefined || item.content.member_user_names===0?"": item.content.member_user_names.map((item7, key7) => {
return (
<div className={"df"}>
<span style={{flex: '0 0 82px'}}>合作团队</span>
<span className={key7>1?" tzbq ":" tzbqx"}
dangerouslySetInnerHTML={{__html:item7}} />
</div>
)
})
}
</div>
{item.content.challenge_names === undefined || item.content.challenge_names === 0 ? "" : item.content.challenge_names.map((item5, key5) => {
return (
<div className={"df"}>
<span style={{ flex: '0 0 82px' }}>关卡名称</span>
<span className={""}
dangerouslySetInnerHTML={{ __html: item5 }} />
</div>
)
})
}
</div>
<div>
{/*挑战标签*/}
{item.content.challenge_tag_names === undefined || item.content.challenge_tag_names === 0 ? "" : item.content.challenge_tag_names.map((item6, key6) => {
return (
<div className={"df"}>
<span style={{ flex: '0 0 82px' }}>关卡标签</span>
<span className={key6 > 1 ? " tzbq " : " tzbqx"} style={{
width: "100%"
}}
dangerouslySetInnerHTML={{ __html: item6 }} />
</div>
)
})
}
</div>
<div>
{/*合作单位*/}
{item.content.member_user_names === undefined || item.content.member_user_names === 0 ? "" : item.content.member_user_names.map((item7, key7) => {
return (
<div className={"df"}>
<span style={{ flex: '0 0 82px' }}>合作团队</span>
<span className={key7 > 1 ? " tzbq " : " tzbqx"}
dangerouslySetInnerHTML={{ __html: item7 }} />
</div>
)
})
}
</div>
<div className="mt20">
{/* <span className="ziticor">
<div className="mt20">
{/* <span className="ziticor">
<i className="fa fa-user ziticor"></i><span className="ml10">{item.author_name}</span>
</span>
<span className="ml10 ziticor "><span>{item.author_school_name}</span></span>
@ -319,57 +319,57 @@ class SearchPage extends Component{
</span>
</span> */}
<span className="ziticor">
{/* <i className="fa fa-user ziticor"></i> */}
<span className="">{item.author_name}</span></span>
<span className="ziticor">
{/* <i className="fa fa-user ziticor"></i> */}
<span className="">{item.author_name}</span></span>
<span className="ml10 ziticor "><span>{item.author_school_name}</span>
</span>
{!!item.challenges_count && <span className="ml20 ziticor">
{/* <i className="iconfont icon-shixunguanqia ziticor"></i> */}
<span>任务:
<span className="ml10 ziticor">{item.challenges_count}</span>
</span>
</span> }
{!!item.study_count && <span className="ml20 ziticor">
{/* <i className="iconfont icon-chengyuan ziticor"></i> */}
<span>学习人数:
{!!item.challenges_count && <span className="ml20 ziticor">
{/* <i className="iconfont icon-shixunguanqia ziticor"></i> */}
<span>任务:
<span className="ml10 ziticor">{item.challenges_count}</span>
</span>
</span>}
{!!item.study_count && <span className="ml20 ziticor">
{/* <i className="iconfont icon-chengyuan ziticor"></i> */}
<span>学习人数:
<span className="ml10 ziticor">{item.study_count}</span>
</span>
</span>}
</span>
</span>}
{!!item.shixuns_count && <span className="ml20 ziticor">
{/* <i className="iconfont icon-shixunguanqia ziticor"></i> */}
<span>实训数:
{!!item.shixuns_count && <span className="ml20 ziticor">
{/* <i className="iconfont icon-shixunguanqia ziticor"></i> */}
<span>实训数:
<span className="ml10 ziticor">{item.shixuns_count}</span>
</span>
</span>}
{type == 'subject' && !!item.visits_count && <span className="ml20 ziticor">
{/* <i className="iconfont icon-chengyuan ziticor" style={{ 'margin-bottom': '1px' }}></i> */}
<span>访问数:
</span>
</span>}
{type == 'subject' && !!item.visits_count && <span className="ml20 ziticor">
{/* <i className="iconfont icon-chengyuan ziticor" style={{ 'margin-bottom': '1px' }}></i> */}
<span>访问数:
<span className="ml10 ziticor">{item.visits_count}</span>
</span>
</span>}
</span>
</span>}
{!!item.members_count && <span className="ml20 ziticor">
{/* <i className="iconfont icon-chengyuan ziticor"></i> */}
<span>成员数:
{!!item.members_count && <span className="ml20 ziticor">
{/* <i className="iconfont icon-chengyuan ziticor"></i> */}
<span>成员数:
<span className="ml10 ziticor">{item.members_count}</span>
</span>
</span>}
</span>
</span>}
{!!item.all_replies_count && <span className="ml20 ziticor">
{/* <i className="iconfont icon-huifu1 ziticor"></i> */}
<span>回复数:<span className="ml10 ziticor">{item.all_replies_count}</span></span>
</span> }
{!!item.all_replies_count && <span className="ml20 ziticor">
{/* <i className="iconfont icon-huifu1 ziticor"></i> */}
<span>回复数:<span className="ml10 ziticor">{item.all_replies_count}</span></span>
</span>}
{/* <span className="ml20 ziticor">
{/* <span className="ml20 ziticor">
<i className="iconfont icon-chengyuan ziticor"></i>
<span>
学习人数:<span className="ml10 ziticor">{item.study_count===undefined?0:item.study_count}</span></span></span> */}
</div>
</div>
</div>
</div>
</a>
)
@ -389,11 +389,11 @@ class SearchPage extends Component{
{
count && count && count> perpages ?
<div className="edu-txt-center" style={{marginBottom:"30px",paddingBottom:"30px"}}>
count && count && count > perpages ?
<div className="edu-txt-center" style={{ marginBottom: "30px", paddingBottom: "30px" }}>
<Pagination showQuickJumper current={page}
onChange={this.paginationonChanges} pageSize={perpages}
total={count}></Pagination>
onChange={this.paginationonChanges} pageSize={perpages}
total={count}></Pagination>
</div>
: ""
}
@ -404,4 +404,4 @@ class SearchPage extends Component{
}
}
export default SnackbarHOC() (TPMIndexHOC ( SearchPage ));
export default SnackbarHOC()(TPMIndexHOC(SearchPage));

Loading…
Cancel
Save