dev_aliyun2
harry 5 years ago
parent fc2aff16e4
commit 89c7c078cf

@ -30,15 +30,8 @@
|| navigator.userAgent.indexOf('MSIE 10') != -1) || navigator.userAgent.indexOf('MSIE 10') != -1)
&& &&
location.pathname.indexOf("/compatibility") == -1) { location.pathname.indexOf("/compatibility") == -1) {
debugger;
// location.href = './compatibility'
location.href = '/compatibility.html' 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> </script>
<link rel="stylesheet" type="text/css" href="/css/css_min_all.css"> <link rel="stylesheet" type="text/css" href="/css/css_min_all.css">
@ -65,24 +58,6 @@
<div id="picture_display" style="display: none;"></div> <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/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> <script>
(function () { // Scoping function to avoid globals (function () { // Scoping function to avoid globals
var href = location.href; var href = location.href;
@ -108,12 +83,8 @@
} }
} }
})(); })();
</script> </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> <script type="text/javascript" src="https://cdn.bootcss.com/quill/1.3.7/quill.core.min.js"></script>
</body> </body>

@ -8,7 +8,7 @@ import {
} from "antd"; } from "antd";
import Colleagechart from './colleagechart/Colleagechart' import Colleagechart from './colleagechart/Colleagechart'
import Colleagechartzu from './colleagechart/Colleagechartzu' 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 NoneData from './../modules/courses/coursesPublic/NoneData';
import './colleagecss/colleage.css'; import './colleagecss/colleage.css';

@ -1,9 +1,9 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder'; import { SnackbarHOC } from 'educoder';
import { TPMIndexHOC } from '../modules/tpm/TPMIndexHOC'; import TPMIndexHOC from '../modules/tpm/TPMIndexHOC';
import {Spin,Alert} from 'antd'; import { Spin, Alert } from 'antd';
class ShowSpin extends Component{ class ShowSpin extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
} }
@ -11,23 +11,23 @@ class ShowSpin extends Component{
render() { render() {
let marigin={ let marigin = {
width: '100%', width: '100%',
minHeight: '500px', minHeight: '500px',
} }
return ( return (
<Spin style={marigin}> <Spin style={marigin}>
<Alert <Alert
style={marigin} style={marigin}
type="info" 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 { setmiyah as setmiyah } from './Component';
export { default as queryString } from './UrlTool2'; export { default as queryString } from './UrlTool2';
export { SnackbarHOC as SnackbarHOC } from './SnackbarHOC'; export { default as SnackbarHOC } from './SnackbarHOC';
export { export {
trigger as trigger, on as on, off as off 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 { themes, ThemeContext } from './context/ThemeContext'
export { ModalHOC } from './components/ModalHOC' export { default as ModalHOC } from './components/ModalHOC'
export { SetAppModel } from './components/SetAppModel' 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 { 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 ModalWrapper } from '../modules/courses/common/ModalWrapper'
export { default as NoneData } from '../modules/courses/coursesPublic/NoneData' export { default as NoneData } from '../modules/courses/coursesPublic/NoneData'

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

@ -6,32 +6,32 @@ import Loading from '../../Loading';
import Loadable from 'react-loadable'; 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 { class http500 extends Component {
render() { render() {
return ( return (
<div className="newMain clearfix"> <div className="newMain clearfix">
<div className=" edu-txt-center mt60 mb60"> <div className=" edu-txt-center mt60 mb60">
{/*mt100 mb100*/} {/*mt100 mb100*/}
<img src={getImageUrl("images/warn/pic_404.jpg")} /> <img src={getImageUrl("images/warn/pic_404.jpg")} />
<p className="font-18 mt40"> <p className="font-18 mt40">
您可以稍后尝试&nbsp;<a href="/" 您可以稍后尝试&nbsp;<a href="/"
className="color-blue">返回首页</a> className="color-blue">返回首页</a>
或者&nbsp; 或者&nbsp;
<a target="_blank" <a target="_blank"
href="//shang.qq.com/wpa/qunwpa?idkey=2f2043d88c1bd61d182b98bf1e061c6185e23055bec832c07d8148fe11c5a6cd" href="//shang.qq.com/wpa/qunwpa?idkey=2f2043d88c1bd61d182b98bf1e061c6185e23055bec832c07d8148fe11c5a6cd"
className="color-blue">QQ反馈&gt;&gt;</a> className="color-blue">QQ反馈&gt;&gt;</a>
</p> </p>
</div> </div>
{/*<div style="clear:both;"></div>*/} {/*<div style="clear:both;"></div>*/}
{/*<div id="ajax-indicator" style="display:none;"><span>载入中...</span></div>*/} {/*<div id="ajax-indicator" style="display:none;"><span>载入中...</span></div>*/}
{/*<div id="ajax-modal" style="display:none;"></div>*/} {/*<div id="ajax-modal" style="display:none;"></div>*/}
</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 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 { class Shixunnopage extends Component {
render() { render() {
return ( return (
<div className="newMain clearfix"> <div className="newMain clearfix">
<div className=" edu-txt-center mt60 mb60"> <div className=" edu-txt-center mt60 mb60">
{/*mt100 mb100*/} {/*mt100 mb100*/}
<img src={getImageUrl("images/warn/pic_500.jpg")} /> <img src={getImageUrl("images/warn/pic_500.jpg")} />
<p className="font-18 mt40"> <p className="font-18 mt40">
您可以稍后尝试&nbsp;<a href="/" 您可以稍后尝试&nbsp;<a href="/"
className="color-blue">返回首页</a> className="color-blue">返回首页</a>
或者&nbsp; 或者&nbsp;
<a target="_blank" <a target="_blank"
href="//shang.qq.com/wpa/qunwpa?idkey=2f2043d88c1bd61d182b98bf1e061c6185e23055bec832c07d8148fe11c5a6cd" href="//shang.qq.com/wpa/qunwpa?idkey=2f2043d88c1bd61d182b98bf1e061c6185e23055bec832c07d8148fe11c5a6cd"
className="color-blue">QQ反馈&gt;&gt;</a> className="color-blue">QQ反馈&gt;&gt;</a>
</p> </p>
</div> </div>
{/*<div style="clear:both;"></div>*/} {/*<div style="clear:both;"></div>*/}
{/*<div id="ajax-indicator" style="display:none;"><span>载入中...</span></div>*/} {/*<div id="ajax-indicator" style="display:none;"><span>载入中...</span></div>*/}
{/*<div id="ajax-modal" style="display:none;"></div>*/} {/*<div id="ajax-modal" style="display:none;"></div>*/}
</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 bannerImg from './imgs/icon@2x.png'
import { TPMIndexHOC } from '..//tpm/TPMIndexHOC'; import TPMIndexHOC from '..//tpm/TPMIndexHOC';
class CompatibilityPage extends Component { class CompatibilityPage extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
}
}
onGoldRewardInputChange(event) { }
this.setState({ goldRewardInput: event.target.value, goldRewardInputError: false }); }
}
render() { onGoldRewardInputChange(event) {
const { goldRewardDialogOpen } = this.props; this.setState({ goldRewardInput: event.target.value, goldRewardInputError: false });
const { goldRewardInputError } = this.state; }
return ( render() {
const { goldRewardDialogOpen } = this.props;
const { goldRewardInputError } = this.state;
return (
<React.Fragment> <React.Fragment>
<style>{` <style>{`
.Header { .Header {
@ -144,14 +144,14 @@ class CompatibilityPage extends Component {
</div> </div>
</div> */} </div> */}
<div className="Compatibility"> <div className="Compatibility">
<div className="Compatibility-icon"> <div className="Compatibility-icon">
<img src={ bannerImg } <img src={bannerImg}
></img> ></img>
</div> </div>
<div className="Compatibility-tip">你正在使用的浏览器版本过低将不能正常浏览和使用Educoder</div> <div className="Compatibility-tip">你正在使用的浏览器版本过低将不能正常浏览和使用Educoder</div>
<div className="CompatibilityBrowsers"> <div className="CompatibilityBrowsers">
{/* https://www.google.cn/intl/zh-CN/chrome/ */} {/* https://www.google.cn/intl/zh-CN/chrome/ */}
{/* <a href="http://www.google.com/chrome/" className="CompatibilityBrowsers-item"> {/* <a href="http://www.google.com/chrome/" className="CompatibilityBrowsers-item">
@ -161,7 +161,7 @@ class CompatibilityPage extends Component {
<a href="https://www.google.cn/intl/zh-CN/chrome/" className="CompatibilityBrowsers-item" <a href="https://www.google.cn/intl/zh-CN/chrome/" className="CompatibilityBrowsers-item"
target="_blank"> target="_blank">
<div className="CompatibilityBrowsers-icon CompatibilityBrowsers-chromeIcon"> <div className="CompatibilityBrowsers-icon CompatibilityBrowsers-chromeIcon">
<img src={ chromeImg } <img src={chromeImg}
> >
</img> </img>
</div> </div>
@ -172,7 +172,7 @@ class CompatibilityPage extends Component {
<a href="http://www.firefox.com.cn/" className="CompatibilityBrowsers-item" <a href="http://www.firefox.com.cn/" className="CompatibilityBrowsers-item"
target="_blank"> target="_blank">
<div className="CompatibilityBrowsers-icon CompatibilityBrowsers-ieIcon"> <div className="CompatibilityBrowsers-icon CompatibilityBrowsers-ieIcon">
<img src={ ffImg } <img src={ffImg}
> >
</img> </img>
@ -184,7 +184,7 @@ class CompatibilityPage extends Component {
<a href="https://www.microsoft.com/zh-cn/download/internet-explorer.aspx" className="CompatibilityBrowsers-item" <a href="https://www.microsoft.com/zh-cn/download/internet-explorer.aspx" className="CompatibilityBrowsers-item"
target="_blank"> target="_blank">
<div className="CompatibilityBrowsers-icon CompatibilityBrowsers-ieIcon"> <div className="CompatibilityBrowsers-icon CompatibilityBrowsers-ieIcon">
<img src={ ieImg } <img src={ieImg}
> >
</img> </img>
@ -195,8 +195,8 @@ class CompatibilityPage extends Component {
</div> </div>
</React.Fragment> </React.Fragment>
); );
} }
} }
export default TPMIndexHOC ( CompatibilityPage ); export default TPMIndexHOC(CompatibilityPage);

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

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

@ -1,8 +1,7 @@
import React, {Component} from 'react'; import React, { Component } from 'react';
import {SnackbarHOC, WordsBtn} from 'educoder'; import { SnackbarHOC, WordsBtn } from 'educoder';
import {TPMIndexHOC} from '../../tpm/TPMIndexHOC'; import TPMIndexHOC from '../../tpm/TPMIndexHOC';
import competition from '../comcss/competition.css'; import { Pagination, } from 'antd';
import {Button, Pagination,} from 'antd';
import CompetitionMaxImg from '../CompetitionMaxImg'; import CompetitionMaxImg from '../CompetitionMaxImg';
import Registrationitem from '../Registrationitem'; import Registrationitem from '../Registrationitem';
@ -29,13 +28,13 @@ class PersonalCompetit extends React.Component {
} }
render() { render() {
const {test, page, limit, type, pint} = this.state; const { test, page, limit, type, pint } = this.state;
const listItems = test.map((item, index) => const listItems = test.map((item, index) =>
<Registrationitem></Registrationitem> <Registrationitem></Registrationitem>
); );
return ( return (
<div className="newMain clearfix "> <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 "> <div className="educontent mb20 ">
<p className="clearfix mb20 mt10"> <p className="clearfix mb20 mt10">
<a className="btn colorgrey fl hovercolorblue ">在线竞赛</a> <a className="btn colorgrey fl hovercolorblue ">在线竞赛</a>
@ -58,7 +57,7 @@ class PersonalCompetit extends React.Component {
<div style={{ <div style={{
marginTop: "22px" 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> </div>
: ""} : ""}
@ -78,10 +77,10 @@ class PersonalCompetit extends React.Component {
: ""} : ""}
{ {
pint === 1 || pint === 3 ? 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} <Pagination showQuickJumper current={page}
onChange={this.paginationonChangestwo} pageSize={limit} onChange={this.paginationonChangestwo} pageSize={limit}
total={30}></Pagination> total={30}></Pagination>
</div> </div>
: "" : ""
} }

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

@ -1,14 +1,12 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Route, Switch } from "react-router-dom";
import { Route, Link, Switch } from "react-router-dom";
import Loading from '../../Loading'; import Loading from '../../Loading';
import Loadable from 'react-loadable'; import Loadable from 'react-loadable';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC'; import TPMIndexHOC from '../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../courses/common/CNotificationHOC'; import CNotificationHOC from '../courses/common/CNotificationHOC';
//新版竞赛首页 //新版竞赛首页
const CompetitionsIndex = Loadable({ const CompetitionsIndex = Loadable({
@ -17,7 +15,7 @@ const CompetitionsIndex = Loadable({
}) })
//竞赛详情页 //竞赛详情页
const CompetitionCommon=Loadable({ const CompetitionCommon = Loadable({
loader: () => import('./Competitioncommon/CompetitionCommon'), loader: () => import('./Competitioncommon/CompetitionCommon'),
loading: Loading, loading: Loading,
}) })
@ -40,7 +38,7 @@ class Competitions extends Component {
super(props) super(props)
} }
componentDidMount(){ componentDidMount() {
window.document.title = '竞赛'; window.document.title = '竞赛';
} }
@ -54,9 +52,9 @@ class Competitions extends Component {
{/*新版竞赛战队详情*/} {/*新版竞赛战队详情*/}
<Route path="/competitions/:identifier/competition_teams/:competition_team_id" <Route path="/competitions/:identifier/competition_teams/:competition_team_id"
render={ render={
(props) => (<CompetitionTeams {...this.props} {...props} {...this.state} />) (props) => (<CompetitionTeams {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
@ -64,22 +62,22 @@ class Competitions extends Component {
<Route <Route
path="/competitions/:identifier/enroll" path="/competitions/:identifier/enroll"
render={ render={
(props) => (<Registration {...this.props} {...props} {...this.state}/>) (props) => (<Registration {...this.props} {...props} {...this.state} />)
} }
/> />
{/*新版竞赛详情页面*/} {/*新版竞赛详情页面*/}
<Route path="/competitions/:identifier" <Route path="/competitions/:identifier"
render={ render={
(props) => (<CompetitionCommon {...this.props} {...props} {...this.state} />) (props) => (<CompetitionCommon {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
{/*新版竞赛首页*/} {/*新版竞赛首页*/}
<Route path="/competitions" <Route path="/competitions"
render={ render={
(props) => (<CompetitionsIndex {...this.props} {...props} {...this.state} />) (props) => (<CompetitionsIndex {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
</Switch> </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 React, { Component } from 'react';
import { SnackbarHOC } from 'educoder'; 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 Loadable from 'react-loadable';
import Loading from '../../Loading'; import Loading from '../../Loading';
import axios from 'axios'; import CNotificationHOC from './common/CNotificationHOC'
// import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import { CNotificationHOC } from './common/CNotificationHOC'
import "./css/Courses.css" import "./css/Courses.css"
//引入对应跳转的组件 //引入对应跳转的组件
const ListPageIndex = Loadable({ const ListPageIndex = Loadable({
loader: () => import('./ListPageIndex'), loader: () => import('./ListPageIndex'),
loading:Loading, loading: Loading,
}) })
// 讨论 // 讨论
const BoardsNew= Loadable({ const BoardsNew = Loadable({
loader: () => import('./boards/BoardsNew'), loader: () => import('./boards/BoardsNew'),
loading: Loading, loading: Loading,
}) })
const TopicDetail= Loadable({ const TopicDetail = Loadable({
loader: () => import('./boards/TopicDetail'), loader: () => import('./boards/TopicDetail'),
loading: Loading, loading: Loading,
}) })
// 讨论 // 讨论
const Boards= Loadable({ const Boards = Loadable({
loader: () => import('./boards'), loader: () => import('./boards'),
loading: Loading, loading: Loading,
}) })
class CoursesIndex extends Component{ class CoursesIndex extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state={ this.state = {
// coursedata:undefined // coursedata:undefined
} }
} }
componentDidMount(){ componentDidMount() {
} }
render() { render() {
const common = { const common = {
} }
return ( return (
<Switch {...this.props}> <Switch {...this.props}>
{/*课堂讨论*/} {/*课堂讨论*/}
{/* /board/5464/messages/new */} {/* /board/5464/messages/new */}
{/* <Route exact path="/courses/:coursesId/board/:boardId/messages/:topicId/edit" {/* <Route exact path="/courses/:coursesId/board/:boardId/messages/:topicId/edit"
render={ render={
(props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />) (props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />)
} }
@ -62,39 +60,39 @@ class CoursesIndex extends Component{
} }
></Route> */} ></Route> */}
{/*课堂讨论*/}
<Route exact path="/courses/:coursesId/boards/:boardId/messages/:topicId/edit" {/*课堂讨论*/}
render={ <Route exact path="/courses/:coursesId/boards/:boardId/messages/:topicId/edit"
(props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />) render={
} (props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />)
></Route> }
<Route exact path="/courses/:coursesId/boards/:boardId/messages/new" ></Route>
render={ <Route exact path="/courses/:coursesId/boards/:boardId/messages/new"
(props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />) render={
} (props) => (<BoardsNew {...this.props} {...props} {...this.state} {...common} />)
></Route> }
<Route exact path="/courses/:coursesId/boards/:boardId/messages/:topicId" ></Route>
render={ <Route exact path="/courses/:coursesId/boards/:boardId/messages/:topicId"
(props) => (<TopicDetail {...this.props} {...this.state} {...props} {...common} />) render={
} (props) => (<TopicDetail {...this.props} {...this.state} {...props} {...common} />)
></Route> }
<Route exact path="/courses/:coursesId/boards/:boardId/messages/:topicId" ></Route>
render={ <Route exact path="/courses/:coursesId/boards/:boardId/messages/:topicId"
(props) => (<TopicDetail {...this.props} {...this.state} {...props} {...common} />) render={
} (props) => (<TopicDetail {...this.props} {...this.state} {...props} {...common} />)
></Route> }
<Route exact path="/courses/:coursesId/boards/:boardId" ></Route>
render={ <Route exact path="/courses/:coursesId/boards/:boardId"
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />) render={
} (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
></Route> }
></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 axios from 'axios'
import moment from 'moment' import moment from 'moment'
import Comments from '../../comment/Comments' import Comments from '../../comment/Comments'
import {ImageLayerOfCommentHOC} from '../../page/layers/ImageLayerOfCommentHOC' import ImageLayerOfCommentHOC from '../../page/layers/ImageLayerOfCommentHOC'
import MemoDetailMDEditor from '../../forums/MemoDetailMDEditor' import MemoDetailMDEditor from '../../forums/MemoDetailMDEditor'
import { RouteHOC } from './common.js' import { RouteHOC } from './common.js'
import '../../forums/Post.css' import '../../forums/Post.css'
@ -11,7 +11,7 @@ import '../../forums/RightSection.css'
import './TopicDetail.css' import './TopicDetail.css'
import '../common/courseMessage.css' import '../common/courseMessage.css'
import { MarkdownToHtml, setImagesUrl } from 'educoder' import { MarkdownToHtml, setImagesUrl } from 'educoder'
import { Pagination, Tooltip,Button } from 'antd' import { Pagination, Tooltip, Button } from 'antd'
import SendToCourseModal from '../coursesPublic/modal/SendToCourseModal' import SendToCourseModal from '../coursesPublic/modal/SendToCourseModal'
import CBreadcrumb from '../common/CBreadcrumb' import CBreadcrumb from '../common/CBreadcrumb'
import { import {
@ -40,19 +40,19 @@ class TopicDetail extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
memo: {}, memo: {},
memoLoading: true, memoLoading: true,
hasMoreComments: false, hasMoreComments: false,
pageCount: 1, pageCount: 1,
comments: [], comments: [],
goldRewardDialogOpen: false, goldRewardDialogOpen: false,
author:undefined, author: undefined,
commentstype:false commentstype: false
}
} }
componentDidMount() { }
window.$("html,body").animate({"scrollTop":0}) componentDidMount() {
window.$("html,body").animate({ "scrollTop": 0 })
const topicId = this.props.match.params.topicId const topicId = this.props.match.params.topicId
const bid = this.props.match.params.boardId const bid = this.props.match.params.boardId
@ -504,19 +504,19 @@ class TopicDetail extends Component {
} }
} }
startcomments=()=>{ startcomments = () => {
setTime = setInterval( ()=> { setTime = setInterval(() => {
this.fetchReplies() this.fetchReplies()
}, 5000); }, 5000);
this.setState({ this.setState({
commentstype:true commentstype: true
}) })
} }
clearcomments=()=>{ clearcomments = () => {
clearInterval(setTime); clearInterval(setTime);
this.setState({ this.setState({
commentstype:false commentstype: false
}) })
} }
@ -695,18 +695,18 @@ class TopicDetail extends Component {
{/* onClick={ this.createNewComment } {/* onClick={ this.createNewComment }
enableReplyTo={true} enableReplyTo={true}
*/} */}
<div className="padding20 memoReplies commentsDelegateParent comments_hideSecondReplyUserHeader" <div className="padding20 memoReplies commentsDelegateParent comments_hideSecondReplyUserHeader"
style={{ display: (comments && !!comments.length) ? 'block' : 'none', paddingBottom: '0px' }}> style={{ display: (comments && !!comments.length) ? 'block' : 'none', paddingBottom: '0px' }}>
<div className="replies_count commentstypetop"> <div className="replies_count commentstypetop">
{this.props.isAdmin()===true? <span className="commentstypebutton font-16 "> {this.props.isAdmin() === true ? <span className="commentstypebutton font-16 ">
{this.state.commentstype===false?<Button type="primary" onClick={()=>this.startcomments()}>开启刷新评论</Button> {this.state.commentstype === false ? <Button type="primary" onClick={() => this.startcomments()}>开启刷新评论</Button>
:<Button type="danger" onClick={()=>this.clearcomments()}>停止刷新</Button>} : <Button type="danger" onClick={() => this.clearcomments()}>停止刷新</Button>}
</span>:""} </span> : ""}
<span className="labal font-16">全部回复</span> <span className="labal font-16">全部回复</span>
<span className="count font-16">({memo.total_replies_count})</span> <span className="count font-16">({memo.total_replies_count})</span>
</div> </div>
<Comments comments={comments} user={current_user} <Comments comments={comments} user={current_user}
replyComment={this.replyComment} replyComment={this.replyComment}

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

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

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

@ -1,14 +1,12 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; import { Route, Switch } from "react-router-dom";
import { Route, Link, Switch } from "react-router-dom";
import Loading from '../../Loading'; import Loading from '../../Loading';
import Loadable from 'react-loadable'; import Loadable from 'react-loadable';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC'; import TPMIndexHOC from '../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../courses/common/CNotificationHOC'; import CNotificationHOC from '../courses/common/CNotificationHOC';
//新版竞赛首页 //新版竞赛首页
const CompetitionsIndex = Loadable({ const CompetitionsIndex = Loadable({
@ -17,7 +15,7 @@ const CompetitionsIndex = Loadable({
}) })
//竞赛详情页 //竞赛详情页
const CompetitionCommon=Loadable({ const CompetitionCommon = Loadable({
loader: () => import('./Competitioncommon/CompetitionCommon'), loader: () => import('./Competitioncommon/CompetitionCommon'),
loading: Loading, loading: Loading,
}) })
@ -40,7 +38,7 @@ class Competitions extends Component {
super(props) super(props)
} }
componentDidMount(){ componentDidMount() {
window.document.title = '竞赛'; window.document.title = '竞赛';
} }
@ -54,9 +52,9 @@ class Competitions extends Component {
{/*新版竞赛战队详情*/} {/*新版竞赛战队详情*/}
<Route path="/competitions/:identifier/competition_teams/:competition_team_id" <Route path="/competitions/:identifier/competition_teams/:competition_team_id"
render={ render={
(props) => (<CompetitionTeams {...this.props} {...props} {...this.state} />) (props) => (<CompetitionTeams {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
@ -64,22 +62,22 @@ class Competitions extends Component {
<Route <Route
path="/competitions/:identifier/enroll" path="/competitions/:identifier/enroll"
render={ render={
(props) => (<Registration {...this.props} {...props} {...this.state}/>) (props) => (<Registration {...this.props} {...props} {...this.state} />)
} }
/> />
{/*新版竞赛详情页面*/} {/*新版竞赛详情页面*/}
<Route path="/competitions/:identifier" <Route path="/competitions/:identifier"
render={ render={
(props) => (<CompetitionCommon {...this.props} {...props} {...this.state} />) (props) => (<CompetitionCommon {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
{/*新版竞赛首页*/} {/*新版竞赛首页*/}
<Route path="/competitions" <Route path="/competitions"
render={ render={
(props) => (<CompetitionsIndex {...this.props} {...props} {...this.state} />) (props) => (<CompetitionsIndex {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
</Switch> </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 React, { Component } from "react";
import { Pagination } from "antd";
import axios from 'axios' import axios from 'axios'
import moment from 'moment' 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 GraduationTasksappraiseReplyChild from './GraduationTasksappraiseReplyChild';
import '../../../forums/Post.css' import '../../../forums/Post.css'
import '../../../comment/Comment.css' import '../../../comment/Comment.css'
import '../../common/courseMessage.css' import '../../common/courseMessage.css'
import './GraduationTasksappraiseReply.css' import './GraduationTasksappraiseReply.css'
const REPLY_PAGE_COUNT = 10
const $ = window.$;
/* /*
*/ */
class GraduationTasksappraiseReply extends Component{ class GraduationTasksappraiseReply extends Component {
constructor(props){ constructor(props) {
super(props); super(props);
this.state={ this.state = {
total_count: 0, total_count: 0,
comment_scores: [] comment_scores: []
} }
} }
fetchAllComments = () => { fetchAllComments = () => {
let category_id= this.props.match.params.category_id; let category_id = this.props.match.params.category_id;
const url = `/graduation_works/${category_id}/comment_list.json` const url = `/graduation_works/${category_id}/comment_list.json`
axios.get(url).then((result)=>{ axios.get(url).then((result) => {
if(result.data.comment_scores){ if (result.data.comment_scores) {
const comment_scores = result.data.comment_scores.map(item => { const comment_scores = result.data.comment_scores.map(item => {
return this.transformReply(item) return this.transformReply(item)
}) })
this.setState({ this.setState({
...result.data, ...result.data,
comment_scores comment_scores
}) })
} }
}).catch((error)=>{ }).catch((error) => {
console.log(error) console.log(error)
}) })
} }
componentDidMount(){ componentDidMount() {
this.fetchAllComments() this.fetchAllComments()
} }
addSuccess = () => { addSuccess = () => {
@ -77,14 +72,14 @@ class GraduationTasksappraiseReply extends Component{
okText: '确定', okText: '确定',
cancelText: '取消', cancelText: '取消',
onOk: () => { onOk: () => {
let category_id= this.props.match.params.category_id; let category_id = this.props.match.params.category_id;
const url = `/graduation_works/${category_id}/delete_score.json?comment_id=${item.id}` const url = `/graduation_works/${category_id}/delete_score.json?comment_id=${item.id}`
axios.delete(url).then((result)=>{ axios.delete(url).then((result) => {
if(result.data.status == 0){ if (result.data.status == 0) {
this.props.showNotification('删除成功') this.props.showNotification('删除成功')
this.fetchAllComments() this.fetchAllComments()
} }
}).catch((error)=>{ }).catch((error) => {
console.log(error) console.log(error)
}) })
}, },
@ -92,105 +87,105 @@ class GraduationTasksappraiseReply extends Component{
console.log('Cancel'); console.log('Cancel');
}, },
}); });
} }
showModulationtype=(id)=>{ showModulationtype = (id) => {
// console.log(id) // console.log(id)
this.setState({ this.setState({
Modulationtype:true, Modulationtype: true,
operationId:id operationId: id
}) })
} }
cancelmodel=()=>{ cancelmodel = () => {
this.setState({ this.setState({
Modalstype:false, Modalstype: false,
Loadtype:false, Loadtype: false,
visible:false, visible: false,
Modulationtype:false, Modulationtype: false,
Allocationtype:false, Allocationtype: false,
Modalstopval:"", Modalstopval: "",
ModalCancel:"", ModalCancel: "",
ModalSave:"", ModalSave: "",
}) })
} }
saveModulationModal=(value,num)=>{ saveModulationModal = (value, num) => {
console.log(value,num) console.log(value, num)
let {operationId}=this.state; let { operationId } = this.state;
let category_id= this.props.match.params.category_id; let category_id = this.props.match.params.category_id;
// console.log(value,num) // console.log(value,num)
let url ="/graduation_works/"+category_id+"/adjust_score.json"; let url = "/graduation_works/" + category_id + "/adjust_score.json";
axios.post(url,{ axios.post(url, {
score:num, score: num,
comment:value comment: value
}).then((result)=>{ }).then((result) => {
// console.log(result) // console.log(result)
if(result.data.status===0){ if (result.data.status === 0) {
this.setState({ this.setState({
Modalstype:true, Modalstype: true,
Allocationtype:false, Allocationtype: false,
Modalstopval:result.data.message, Modalstopval: result.data.message,
ModalSave:this.cancelmodel, ModalSave: this.cancelmodel,
}) })
this.fetchAllComments() this.fetchAllComments()
} }
}).catch((error)=>{ }).catch((error) => {
console.log(error) console.log(error)
}) })
} }
render(){ render() {
let { total_count, comments, pageCount, comment_scores } = this.state let { total_count, comments, pageCount, comment_scores } = this.state
const { current_user, memo } = this.props const { current_user, memo } = this.props
const isAdmin = this.props.isAdmin(); const isAdmin = this.props.isAdmin();
const isStudent=this.props.isStudent(); const isStudent = this.props.isStudent();
const isNotMember=this.props.isNotMember(); const isNotMember = this.props.isNotMember();
return( return (
<React.Fragment> <React.Fragment>
{comment_scores.length===0&&isStudent===true||comment_scores.length===0&&isNotMember===true? "": <div className="edu-back-white" style={{marginTop: '16px'}}> {comment_scores.length === 0 && isStudent === true || comment_scores.length === 0 && isNotMember === true ? "" : <div className="edu-back-white" style={{ marginTop: '16px' }}>
{isStudent===true? {isStudent === true ?
<GraduationTasksappraiseReplyChild <GraduationTasksappraiseReplyChild
{...this.props} {...this.props}
{...this.state} {...this.state}
cancelmodel={this.cancelmodel} cancelmodel={this.cancelmodel}
showModulationtype={(id)=>this.showModulationtype(id)} showModulationtype={(id) => this.showModulationtype(id)}
saveModulationModal={(value,num)=>this.saveModulationModal(value,num)} saveModulationModal={(value, num) => this.saveModulationModal(value, num)}
addSuccess={this.addSuccess} addSuccess={this.addSuccess}
onDelete={this.onDelete} onDelete={this.onDelete}
/> />
: <GraduationTasksappraiseReplyChild {...this.state} {...this.props} : <GraduationTasksappraiseReplyChild {...this.state} {...this.props}
cancelmodel={this.cancelmodel} cancelmodel={this.cancelmodel}
showModulationtype={(id)=>this.showModulationtype(id)} showModulationtype={(id) => this.showModulationtype(id)}
saveModulationModal={(value,num)=>this.saveModulationModal(value,num)} saveModulationModal={(value, num) => this.saveModulationModal(value, num)}
addSuccess={this.addSuccess} addSuccess={this.addSuccess}
onDelete={this.onDelete} onDelete={this.onDelete}
/> />
} }
</div> </div>
} }
</React.Fragment> </React.Fragment>
) )
} }
} }
export default ImageLayerOfCommentHOC() (GraduationTasksappraiseReply); export default ImageLayerOfCommentHOC()(GraduationTasksappraiseReply);
{/*<div id="forum_list" className="forum_table">*/} {/*<div id="forum_list" className="forum_table">*/ }
{/*<div className="mh650 edu-back-white">*/} {/*<div className="mh650 edu-back-white">*/ }
{/*<div*/} {/*<div*/ }
{/*className="edu-tab-con-box clearfix edu-txt-center">*/} {/*className="edu-tab-con-box clearfix edu-txt-center">*/ }
{/*<img className="edu-nodata-img mb20"*/} {/*<img className="edu-nodata-img mb20"*/ }
{/*src={getImageUrl("images/educoder/nodata.png")}/>*/} {/*src={getImageUrl("images/educoder/nodata.png")}/>*/ }
{/*<p className="edu-nodata-p mb30">暂时还没有相关数据哦!</p>*/} {/*<p className="edu-nodata-p mb30">暂时还没有相关数据哦!</p>*/ }
{/*</div>*/} {/*</div>*/ }
{/*</div>*/} {/*</div>*/ }
{/*</div>*/} {/*</div>*/ }

@ -1,6 +1,5 @@
import React,{ Component } from "react"; import React, { Component } from "react";
import { Pagination } from "antd"; import ImageLayerOfCommentHOC from '../../../page/layers/ImageLayerOfCommentHOC'
import {ImageLayerOfCommentHOC} from '../../../page/layers/ImageLayerOfCommentHOC'
import GraduationTasksappraiseMainEditor from './GraduationTasksappraiseMainEditor' import GraduationTasksappraiseMainEditor from './GraduationTasksappraiseMainEditor'
import Graduationtaskitem from './Graduationtaskitem' import Graduationtaskitem from './Graduationtaskitem'
import '../../../forums/Post.css' import '../../../forums/Post.css'
@ -9,96 +8,92 @@ import '../../common/courseMessage.css'
import './GraduationTasksappraiseReply.css' import './GraduationTasksappraiseReply.css'
import ModulationModal from "../../coursesPublic/ModulationModal"; import ModulationModal from "../../coursesPublic/ModulationModal";
import Modals from '../../../modals/Modals'; import Modals from '../../../modals/Modals';
const REPLY_PAGE_COUNT = 10
const $ = window.$;
class GraduationTasksappraiseReplyChild extends Component{ class GraduationTasksappraiseReplyChild extends Component {
constructor(props){ constructor(props) {
super(props); super(props);
this.state={ this.state = {
} }
} }
render(){ render() {
let { total_count, comments, pageCount, comment_scores} = this.props; let { total_count, comments, pageCount, comment_scores } = this.props;
const isAdmin = this.props.isAdmin(); const isAdmin = this.props.isAdmin();
const isStudent=this.props.isStudent();
return (
return(
<React.Fragment> <React.Fragment>
<div className={`${comment_scores && comment_scores.length && 'bor-bottom-greyE'} stud-class-set edu-back-white mb10 padding20-30 `} <div className={`${comment_scores && comment_scores.length && 'bor-bottom-greyE'} stud-class-set edu-back-white mb10 padding20-30 `}
style={{height:"100%"}}> style={{ height: "100%" }}>
<Modals <Modals
modalsType={this.props.Modalstype} modalsType={this.props.Modalstype}
modalsTopval={this.props.Modalstopval} modalsTopval={this.props.Modalstopval}
modalCancel={this.props.ModalCancel} modalCancel={this.props.ModalCancel}
modalSave={this.props.ModalSave} modalSave={this.props.ModalSave}
closable={false} closable={false}
footer={null} footer={null}
destroyOnClose={true} destroyOnClose={true}
centered={true} centered={true}
/> />
{this.props.Modulationtype===true?<ModulationModal {this.props.Modulationtype === true ? <ModulationModal
modalname={"调分"} modalname={"调分"}
visible={this.props.Modulationtype} visible={this.props.Modulationtype}
Cancelname={"取消"} Cancelname={"取消"}
Savesname={"保存"} Savesname={"保存"}
Cancel={this.props.cancelmodel} Cancel={this.props.cancelmodel}
Saves={(value,num)=>this.props.saveModulationModal(value,num)} Saves={(value, num) => this.props.saveModulationModal(value, num)}
closable={false} closable={false}
footer={null} footer={null}
destroyOnClose={true} destroyOnClose={true}
centered={true} centered={true}
/>:""} /> : ""}
{/*<div style={{ width:'100%',height:'75px'}} >*/} {/*<div style={{ width:'100%',height:'75px'}} >*/}
{/*<p className=" fl color-black mt25 summaryname">{datalist&&datalist.task_name}</p>*/} {/*<p className=" fl color-black mt25 summaryname">{datalist&&datalist.task_name}</p>*/}
{/*<a className="color-grey-6 fr font-16 mt10 mr20" onClick={this.goback}>返回</a>*/} {/*<a className="color-grey-6 fr font-16 mt10 mr20" onClick={this.goback}>返回</a>*/}
{/*{this.props.isStudent()?<a className={"fr color-blue font-16 mt10 mr20"} onClick={this.addAccessory}>补交附件</a>:""}*/} {/*{this.props.isStudent()?<a className={"fr color-blue font-16 mt10 mr20"} onClick={this.addAccessory}>补交附件</a>:""}*/}
{/*</div>*/} {/*</div>*/}
{this.props.ultimate===true? isAdmin && {this.props.ultimate === true ? isAdmin &&
<div style={{ width:'100%',height:'75px'}} > <div style={{ width: '100%', height: '75px' }} >
<a className={"fr color-blue font-16 mt10 mr20"} onClick={()=>this.props.showModulationtype(this.props.task_id)}>调分</a> <a className={"fr color-blue font-16 mt10 mr20"} onClick={() => this.props.showModulationtype(this.props.task_id)}>调分</a>
</div> </div>
:""} : ""}
{this.props.ultimate===true?"":<div className={"color-grey-6 mb10"}> {this.props.ultimate === true ? "" : <div className={"color-grey-6 mb10"}>
<span className="labal">全部评阅</span> <span className="labal">全部评阅</span>
{ !!comment_scores.length && <span className="count"> {!!comment_scores.length && <span className="count">
{comment_scores.length===0?"":`(${comment_scores.length})`} {comment_scores.length === 0 ? "" : `(${comment_scores.length})`}
</span> } </span>}
</div>} </div>}
{this.props.ultimate===true ? "": isAdmin && <GraduationTasksappraiseMainEditor {...this.props} {this.props.ultimate === true ? "" : isAdmin && <GraduationTasksappraiseMainEditor {...this.props}
addSuccess={() => this.props.addSuccess()} addSuccess={() => this.props.addSuccess()}
showSameScore={this.props.task_type == 2} showSameScore={this.props.task_type == 2}
></GraduationTasksappraiseMainEditor> } ></GraduationTasksappraiseMainEditor>}
</div> </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" <div className="padding20 memoReplies commentsDelegateParent course-message"
style={{ paddingTop: '0px', paddingBottom: '0px' }} style={{ paddingTop: '0px', paddingBottom: '0px' }}
> >
<style>{` <style>{`
`}</style> `}</style>
<div className="panel-comment_item"> <div className="panel-comment_item">
{ comment_scores.map(item => { {comment_scores.map(item => {
return <Graduationtaskitem item={item} onDelete={this.props.onDelete} {...this.props}></Graduationtaskitem> return <Graduationtaskitem item={item} onDelete={this.props.onDelete} {...this.props}></Graduationtaskitem>
}) } })}
</div> </div>
</div> </div>
</div> } </div>}
</React.Fragment> </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 { Pagination } from "antd";
import update from 'immutability-helper' import update from 'immutability-helper'
@ -7,14 +7,16 @@ import MemoDetailMDEditor from '../../../forums/MemoDetailMDEditor'
import '../../../forums/Post.css' import '../../../forums/Post.css'
import '../../../forums/RightSection.css' import '../../../forums/RightSection.css'
import {ImageLayerOfCommentHOC} from '../../../page/layers/ImageLayerOfCommentHOC' import ImageLayerOfCommentHOC from '../../../page/layers/ImageLayerOfCommentHOC'
import Comments from '../../../comment/Comments' import Comments from '../../../comment/Comments'
// import './GraduateTopicReply.css' // import './GraduateTopicReply.css'
import '../../common/courseMessage.css' import '../../common/courseMessage.css'
import { generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment import {
generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment
, addSecondLevelComment, NEED_TO_WRITE_CONTENT, handleContentBeforeCreateSecondLevelComment , addSecondLevelComment, NEED_TO_WRITE_CONTENT, handleContentBeforeCreateSecondLevelComment
, handleDeleteComment, handleCommentPraise, handleHiddenComment } from '../../common/CommentsHelper' , handleDeleteComment, handleCommentPraise, handleHiddenComment
} from '../../common/CommentsHelper'
const REPLY_PAGE_COUNT = 10 const REPLY_PAGE_COUNT = 10
const $ = window.$; const $ = window.$;
@ -23,15 +25,15 @@ const $ = window.$;
列表接口名 /graduation_tasks/${graduation_topic_id}/show_comment.json?parent_id=${parent.id}&limit=500 列表接口名 /graduation_tasks/${graduation_topic_id}/show_comment.json?parent_id=${parent.id}&limit=500
回复类型名 jour_type: 'GraduationTask', 回复类型名 jour_type: 'GraduationTask',
*/ */
class GraduationTaskssettingReply extends Component{ class GraduationTaskssettingReply extends Component {
constructor(props){ constructor(props) {
super(props); super(props);
this.state={ this.state = {
pageCount: 1 pageCount: 1
} }
} }
componentDidMount(){ componentDidMount() {
this.fetchReplies() this.fetchReplies()
@ -51,14 +53,14 @@ class GraduationTaskssettingReply extends Component{
let { comments } = this.state; let { comments } = this.state;
axios.post(url, { axios.post(url, {
journals_for_message: { journals_for_message: {
jour_type: 'GraduationTask', jour_type: 'GraduationTask',
jour_id: graduation_topic_id, jour_id: graduation_topic_id,
notes: content, notes: content,
// m_parent_id // m_parent_id
reply_id: memo.user_id reply_id: memo.user_id
}
} }
}
).then((response) => { ).then((response) => {
if (response.data.status === -1) { if (response.data.status === -1) {
console.error('服务端异常') console.error('服务端异常')
@ -90,7 +92,7 @@ class GraduationTaskssettingReply extends Component{
// return; // return;
// } // }
if (this.props.memo.id === id ) { // 回复帖子 if (this.props.memo.id === id) { // 回复帖子
this.createNewComment(commentContent, id, editor); this.createNewComment(commentContent, id, editor);
return; return;
} }
@ -104,55 +106,55 @@ class GraduationTaskssettingReply extends Component{
commentContent = handleContentBeforeCreateSecondLevelComment(commentContent) commentContent = handleContentBeforeCreateSecondLevelComment(commentContent)
axios.post(url, { axios.post(url, {
journals_for_message: { journals_for_message: {
jour_type: 'GraduationTask', jour_type: 'GraduationTask',
jour_id: graduation_topic_id, jour_id: graduation_topic_id,
notes: commentContent, notes: commentContent,
m_parent_id: id, m_parent_id: id,
reply_id: comment.user_id reply_id: comment.user_id
} }
}, },
{ {
} }
).then((response) => { ).then((response) => {
if (response.data.id) { if (response.data.id) {
let newId = 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
})
}
}).catch((error) => { this.setState({
console.log(error) 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) => { loadMoreChildComments = (parent) => {
const graduation_topic_id = this.props.memo.id const graduation_topic_id = this.props.memo.id
const course_id = this.props.course_id const course_id = this.props.course_id
const url = `/graduation_tasks/${graduation_topic_id}/show_comment.json?parent_id=${parent.id}&limit=500` const url = `/graduation_tasks/${graduation_topic_id}/show_comment.json?parent_id=${parent.id}&limit=500`
axios.get(url,{ axios.get(url, {
}) })
.then((response) => { .then((response) => {
const { comments } = response.data const { comments } = response.data
// const memo = Object.assign({}, this.state.memo) // const memo = Object.assign({}, this.state.memo)
// memo.sum_replies_count = sum_replies_count; // memo.sum_replies_count = sum_replies_count;
this.setState({ this.setState({
// memo, // memo,
comments: generateChildComments(comments, this.state.comments, parent, this.transformReply) comments: generateChildComments(comments, this.state.comments, parent, this.transformReply)
})
}).catch((error) => {
console.log(error)
}) })
}).catch((error) => {
console.log(error)
})
} }
onPaginationChange = (pageCount) => { onPaginationChange = (pageCount) => {
@ -166,19 +168,19 @@ class GraduationTaskssettingReply extends Component{
const course_id = this.props.course_id const course_id = this.props.course_id
const url = `/graduation_tasks/${graduation_topic_id}/show_comment.json?page=${this.state.pageCount}` const url = `/graduation_tasks/${graduation_topic_id}/show_comment.json?page=${this.state.pageCount}`
// page limit parent_id // page limit parent_id
axios.get(url,{ axios.get(url, {
}) })
.then((response) => { .then((response) => {
const { comments, messages_count } = response.data const { comments, messages_count } = response.data
this.setState({ this.setState({
comments: generateComments(comments, this.transformReply), comments: generateComments(comments, this.transformReply),
// : this.state.comments.concat(comments), // : this.state.comments.concat(comments),
total_count: messages_count total_count: messages_count
})
}).catch((error) => {
console.log(error)
}) })
}).catch((error) => {
console.log(error)
})
} }
transformReply = (reply, children = []) => { transformReply = (reply, children = []) => {
@ -226,20 +228,20 @@ class GraduationTaskssettingReply extends Component{
} }
} }
render(){ render() {
let { total_count, comments, pageCount } = this.state let { total_count, comments, pageCount } = this.state
const { current_user, memo } = this.props const { current_user, memo } = this.props
return( return (
<React.Fragment> <React.Fragment>
<style>{` <style>{`
`}</style> `}</style>
<MemoDetailMDEditor {...this.props} ref="editor" memo={memo} usingMockInput={true} placeholder="请在此输入对本作品的评语最大限制2000个字符" <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" <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"> <div className="replies_count">
<span className="labal">全部回复</span> <span className="labal">全部回复</span>
<span className="count">{total_count}</span> <span className="count">{total_count}</span>
@ -261,19 +263,19 @@ class GraduationTaskssettingReply extends Component{
></Comments> ></Comments>
{/* { true ? : {/* { true ? :
<div className="memoMore"> <div className="memoMore">
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div> <div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
</div>} */} </div>} */}
</div> </div>
{ total_count > REPLY_PAGE_COUNT && {total_count > REPLY_PAGE_COUNT &&
<div className="memoMore"> <div className="memoMore">
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10}/> <Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10} />
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div> <div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
</div> } </div>}
</React.Fragment> </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 { Pagination } from "antd";
import update from 'immutability-helper'
import axios from 'axios' import axios from 'axios'
import MemoDetailMDEditor from '../../../forums/MemoDetailMDEditor' import MemoDetailMDEditor from '../../../forums/MemoDetailMDEditor'
import '../../../forums/Post.css' import '../../../forums/Post.css'
import '../../../forums/RightSection.css' import '../../../forums/RightSection.css'
import {ImageLayerOfCommentHOC} from '../../../page/layers/ImageLayerOfCommentHOC' import ImageLayerOfCommentHOC from '../../../page/layers/ImageLayerOfCommentHOC'
import Comments from '../../../comment/Comments' import Comments from '../../../comment/Comments'
import './GraduateTopicReply.css' import './GraduateTopicReply.css'
import '../../common/courseMessage.css' import '../../common/courseMessage.css'
import { generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment import {
generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment
, addSecondLevelComment, NEED_TO_WRITE_CONTENT, handleContentBeforeCreateSecondLevelComment , addSecondLevelComment, NEED_TO_WRITE_CONTENT, handleContentBeforeCreateSecondLevelComment
, handleDeleteComment, handleCommentPraise, handleHiddenComment } from '../../common/CommentsHelper' , handleDeleteComment, handleCommentPraise, handleHiddenComment
} from '../../common/CommentsHelper'
const REPLY_PAGE_COUNT = 10 const REPLY_PAGE_COUNT = 10
const $ = window.$; const $ = window.$;
class GraduateTopicReply extends Component{ class GraduateTopicReply extends Component {
constructor(props){ constructor(props) {
super(props); super(props);
this.state={ this.state = {
pageCount: 1 pageCount: 1
} }
} }
componentDidMount(){ componentDidMount() {
this.fetchReplies() this.fetchReplies()
@ -45,14 +46,14 @@ class GraduateTopicReply extends Component{
let { comments } = this.state; let { comments } = this.state;
axios.post(url, { axios.post(url, {
journals_for_message: { journals_for_message: {
jour_type: 'GraduationTopic', jour_type: 'GraduationTopic',
jour_id: graduation_topic_id, jour_id: graduation_topic_id,
notes: content, notes: content,
// m_parent_id // m_parent_id
reply_id: memo.user_id reply_id: memo.user_id
}
} }
}
).then((response) => { ).then((response) => {
if (response.data.status === -1) { if (response.data.status === -1) {
console.error('服务端异常') console.error('服务端异常')
@ -84,7 +85,7 @@ class GraduateTopicReply extends Component{
// return; // return;
// } // }
if (this.props.memo.id === id ) { // 回复帖子 if (this.props.memo.id === id) { // 回复帖子
this.createNewComment(commentContent, id, editor); this.createNewComment(commentContent, id, editor);
return; return;
} }
@ -98,55 +99,55 @@ class GraduateTopicReply extends Component{
commentContent = handleContentBeforeCreateSecondLevelComment(commentContent) commentContent = handleContentBeforeCreateSecondLevelComment(commentContent)
axios.post(url, { axios.post(url, {
journals_for_message: { journals_for_message: {
jour_type: 'GraduationTopic', jour_type: 'GraduationTopic',
jour_id: graduation_topic_id, jour_id: graduation_topic_id,
notes: commentContent, notes: commentContent,
m_parent_id: id, m_parent_id: id,
reply_id: comment.user_id reply_id: comment.user_id
} }
}, },
{ {
} }
).then((response) => { ).then((response) => {
if (response.data.id) { if (response.data.id) {
let newId = 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
})
}
}).catch((error) => { this.setState({
console.log(error) 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) => { loadMoreChildComments = (parent) => {
const graduation_topic_id = this.props.memo.id const graduation_topic_id = this.props.memo.id
const course_id = this.props.course_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` 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) => { .then((response) => {
const { comments } = response.data const { comments } = response.data
// const memo = Object.assign({}, this.state.memo) // const memo = Object.assign({}, this.state.memo)
// memo.sum_replies_count = sum_replies_count; // memo.sum_replies_count = sum_replies_count;
this.setState({ this.setState({
// memo, // memo,
comments: generateChildComments(comments, this.state.comments, parent, this.transformReply) comments: generateChildComments(comments, this.state.comments, parent, this.transformReply)
})
}).catch((error) => {
console.log(error)
}) })
}).catch((error) => {
console.log(error)
})
} }
onPaginationChange = (pageCount) => { onPaginationChange = (pageCount) => {
@ -160,19 +161,19 @@ class GraduateTopicReply extends Component{
const course_id = this.props.course_id const course_id = this.props.course_id
const url = `/courses/${course_id}/graduation_topics/${graduation_topic_id}/show_comment.json?page=${this.state.pageCount}` const url = `/courses/${course_id}/graduation_topics/${graduation_topic_id}/show_comment.json?page=${this.state.pageCount}`
// page limit parent_id // page limit parent_id
axios.get(url,{ axios.get(url, {
}) })
.then((response) => { .then((response) => {
const { comments, messages_count } = response.data const { comments, messages_count } = response.data
this.setState({ this.setState({
comments: generateComments(comments, this.transformReply), comments: generateComments(comments, this.transformReply),
// : this.state.comments.concat(comments), // : this.state.comments.concat(comments),
total_count: messages_count total_count: messages_count
})
}).catch((error) => {
console.log(error)
}) })
}).catch((error) => {
console.log(error)
})
} }
transformReply = (reply, children = []) => { transformReply = (reply, children = []) => {
@ -220,17 +221,17 @@ class GraduateTopicReply extends Component{
} }
} }
render(){ render() {
let { total_count, comments, pageCount } = this.state let { total_count, comments, pageCount } = this.state
const { current_user, memo } = this.props const { current_user, memo } = this.props
return( return (
<React.Fragment> <React.Fragment>
<MemoDetailMDEditor {...this.props} ref="editor" memo={memo} usingMockInput={true} placeholder="说点什么" <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" <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"> <div className="replies_count">
<span className="labal">全部回复</span> <span className="labal">全部回复</span>
<span className="count">{total_count}</span> <span className="count">{total_count}</span>
@ -253,19 +254,19 @@ class GraduateTopicReply extends Component{
></Comments> ></Comments>
{/* { true ? : {/* { true ? :
<div className="memoMore"> <div className="memoMore">
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div> <div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
</div>} */} </div>} */}
</div> </div>
{ total_count > REPLY_PAGE_COUNT && {total_count > REPLY_PAGE_COUNT &&
<div className="memoMore"> <div className="memoMore">
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10}/> <Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10} />
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div> <div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
</div> } </div>}
</React.Fragment> </React.Fragment>
) )
} }
} }
export default ImageLayerOfCommentHOC() (GraduateTopicReply); export default ImageLayerOfCommentHOC()(GraduateTopicReply);

@ -1,24 +1,24 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder'; 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 Loadable from 'react-loadable';
import Loading from '../../../Loading'; import Loading from '../../../Loading';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC'; import TPMIndexHOC from '../../tpm/TPMIndexHOC';
import "../css/Courses.css" import "../css/Courses.css"
//引入对应跳转的组件 //引入对应跳转的组件
{/*提交总结*/} {/*提交总结*/ }
const Polldepoly = Loadable({ const Polldepoly = Loadable({
loader: () => import('./pollmount'), loader: () => import('./pollmount'),
loading:Loading, loading: Loading,
}) })
class Polllist extends Component{ class Polllist extends Component {
constructor(props) { constructor(props) {
super(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 React, { Component } from 'react';
import { SnackbarHOC } from 'educoder'; import { SnackbarHOC } from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC'; import TPMIndexHOC from '../../tpm/TPMIndexHOC';
import { Checkbox,Input,DatePicker } from 'antd'; import { Checkbox, Input, DatePicker } from 'antd';
import locale from 'antd/lib/date-picker/locale/zh_CN'; import locale from 'antd/lib/date-picker/locale/zh_CN';
import "../css/Courses.css"; import "../css/Courses.css";
@ -10,29 +10,29 @@ import CoursesListType from '../coursesPublic/CoursesListType';
class Polldepoly extends Component{ class Polldepoly extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
contents: [{val:"",id:1}], contents: [{ val: "", id: 1 }],
} }
} }
componentDidMount() { componentDidMount() {
} }
submitCommitSummary=()=> { submitCommitSummary = () => {
const mdContnet = this.refs[`md${1}`].getValue().trim();; const mdContnet = this.refs[`md${1}`].getValue().trim();;
console.log(mdContnet) console.log(mdContnet)
} }
asdasdsad=()=>{ asdasdsad = () => {
this.setState({ this.setState({
contents:"" contents: ""
}) })
} }
render() { render() {
let {contents}=this.state; let { contents } = this.state;
const dateFormat = 'YYYY-MM-DD HH:mm:ss'; const dateFormat = 'YYYY-MM-DD HH:mm:ss';
return ( return (
<React.Fragment> <React.Fragment>
@ -40,108 +40,108 @@ class Polldepoly extends Component{
<div className="newMain clearfix"> <div className="newMain clearfix">
<div className={"educontent mb20"}> <div className={"educontent mb20"}>
<div style={{ <div style={{
width:'100%', width: '100%',
height:'70px' height: '70px'
}} > }} >
<p className="ml15 fl color-black mt30 summaryname" onClick={this.asdasdsad}>Java语言之控制语句</p> <p className="ml15 fl color-black mt30 summaryname" onClick={this.asdasdsad}>Java语言之控制语句</p>
<CoursesListType <CoursesListType
typelist={["已开启补交"]} typelist={["已开启补交"]}
typesylename={"mt28"} 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>
{/*<div className={"edu-con-bg01 user_bg_shadow bor-grey-e educontentbox"}>*/} {/*<div className={"edu-con-bg01 user_bg_shadow bor-grey-e educontentbox"}>*/}
{/*<span className={"commitcontents"}>*/} {/*<span className={"commitcontents"}>*/}
{/*<span className={"color-red"}>*</span>*/} {/*<span className={"color-red"}>*</span>*/}
{/*内容</span>*/} {/*内容</span>*/}
{/*<div className={"ml30 mr30 mt10"}>*/} {/*<div className={"ml30 mr30 mt10"}>*/}
{/*</div>*/}
{/*</div>*/} {/*</div>*/}
<div className="stud-class-set bor-bottom-greyE"> {/*</div>*/}
<div className="mt10 clearfix edu-back-white poll_list pl20"> <div className="stud-class-set bor-bottom-greyE">
<a className="active">答题列表</a> <div className="mt10 clearfix edu-back-white poll_list pl20">
<a>统计结果</a> <a className="active">答题列表</a>
<a>问卷预览</a> <a>统计结果</a>
<a>配置</a> <a>问卷预览</a>
<a className={"fr color-blue font-16"}>导出统计</a> <a>配置</a>
</div> <a className={"fr color-blue font-16"}>导出统计</a>
</div> </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"> <div className="clearfix">
<p className="ml22 fl font-16 mt5 color-grey-6">发布设置</p> <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="编辑"*/} {/*<a href="javascript:void(0);" className="white-btn orange-btn fr mr15 mt15" title="编辑"*/}
{/*onClick="show_poll_edit_setting();">编辑</a>*/} {/*onClick="show_poll_edit_setting();">编辑</a>*/}
</div> </div>
<div className="clearfix pl60 pt20"> <div className="clearfix pl60 pt20">
<Checkbox className={"color-grey-6"}>统一设置 </Checkbox> <span className={"color-grey-9"}>(使)</span> <Checkbox className={"color-grey-6"}>统一设置 </Checkbox> <span className={"color-grey-9"}>(使)</span>
</div> </div>
<div className="clearfix pl60 pt20"> <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"}>发布时间:</span> <Input size="large" placeholder="请选择发布时间" /><span className={"color-grey-9"}>(发布之前,学生不会收到问卷)</span>*/}
<span className="color-grey-6 mt5 fl" style={{minWidth: '70px'}}>发布时间</span> <span className="color-grey-6 mt5 fl" style={{ minWidth: '70px' }}>发布时间</span>
<span className="fl mt5"> <span className="fl mt5">
<DatePicker <DatePicker
showTime showTime
showToday={false} showToday={false}
locale={locale} locale={locale}
format={dateFormat} format={dateFormat}
placeholder="请选择发布时间" placeholder="请选择发布时间"
// value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)} // value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
// onChange={this.onChangeTimePicker} // onChange={this.onChangeTimePicker}
/> />
<label style={{top:'6px'}} className="color-grey-9 ml10" >发布之前学生不会收到问卷</label> <label style={{ top: '6px' }} className="color-grey-9 ml10" >发布之前学生不会收到问卷</label>
</span> </span>
</div> </div>
<div className="clearfix pl60 pt20"> <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"}>发布时间:</span> <Input size="large" placeholder="请选择发布时间" /><span className={"color-grey-9"}>(发布之前,学生不会收到问卷)</span>*/}
<span className="color-grey-6 mt5 fl" style={{minWidth: '70px'}}>截止时间</span> <span className="color-grey-6 mt5 fl" style={{ minWidth: '70px' }}>截止时间</span>
<span className="fl mt5"> <span className="fl mt5">
<DatePicker <DatePicker
showToday={false} showToday={false}
showTime showTime
locale={locale} locale={locale}
format={dateFormat} format={dateFormat}
placeholder="请选择截止时间" placeholder="请选择截止时间"
// value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)} // value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
// onChange={this.onChangeTimePicker} // onChange={this.onChangeTimePicker}
/> />
<label style={{top:'6px'}} className="color-grey-9 ml10" >截止时间点系统将自动提交所有学生的答题学生将不能继续答题</label> <label style={{ top: '6px' }} className="color-grey-9 ml10" >截止时间点系统将自动提交所有学生的答题学生将不能继续答题</label>
</span> </span>
</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"> <div className="clearfix">
<p className="ml22 fl font-16 mt5 color-grey-6">公开设置</p> <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="编辑"*/} {/*<a href="javascript:void(0);" className="white-btn orange-btn fr mr15 mt15" title="编辑"*/}
{/*onClick="show_poll_edit_setting();">编辑</a>*/} {/*onClick="show_poll_edit_setting();">编辑</a>*/}
</div> </div>
<div className="clearfix pl40 pt20"> <div className="clearfix pl40 pt20">
<Checkbox className={"color-grey-6"}>公开统计 </Checkbox> <span className={"color-grey-9"}></span> <Checkbox className={"color-grey-6"}>公开统计 </Checkbox> <span className={"color-grey-9"}></span>
</div> </div>
<div className="clearfix pl40 pt10"> <div className="clearfix pl40 pt10">
<Checkbox className={"color-grey-6"}>实名问卷 </Checkbox> <span className={"color-grey-9"}></span> <Checkbox className={"color-grey-6"}>实名问卷 </Checkbox> <span className={"color-grey-9"}></span>
</div> </div>
</div> </div>
</div> </div>
<div className="clearfix mt30 mb30"> <div className="clearfix mt30 mb30">
<a className="defalutSubmitbtn fl mr20" <a className="defalutSubmitbtn fl mr20"
onClick={this.submitCommitSummary}>提交</a> onClick={this.submitCommitSummary}>提交</a>
<a className="defalutCancelbtn fl">取消</a> <a className="defalutCancelbtn fl">取消</a>
</div> </div>
</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 React, { Component } from 'react';
import { SnackbarHOC } from 'educoder'; import { SnackbarHOC } from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC'; import TPMIndexHOC from '../../tpm/TPMIndexHOC';
import "../css/Courses.css"; import "../css/Courses.css";
import CoursesMarkdown from "../coursesPublic/CoursesMarkdown"; import CoursesMarkdown from "../coursesPublic/CoursesMarkdown";
import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor'; import TPMMDEditor from '../../tpm/challengesnew/TPMMDEditor';
import { import {
Form, Icon, Input, Button, Checkbox,message, Form, Icon, Input, Button, Checkbox, message,
} from "antd"; } from "antd";
import {WordsBtn} from 'educoder'; import { WordsBtn } from 'educoder';
//引入对应跳转的组件 //引入对应跳转的组件
import axios from 'axios'; import axios from 'axios';
//提交总结 //提交总结
class CommitSummary extends Component{ class CommitSummary extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
contents: [{val:"",id:1}], contents: [{ val: "", id: 1 }],
course_id:0, course_id: 0,
course_name:"", course_name: "",
category:[], category: [],
homework_id:0, homework_id: 0,
user_name:"", user_name: "",
work_id:0, work_id: 0,
description:"", description: "",
data:undefined, data: undefined,
cancels:false, cancels: false,
} }
} }
@ -34,18 +34,18 @@ class CommitSummary extends Component{
let query = this.props.location.pathname; let query = this.props.location.pathname;
const type = query.split('/'); const type = query.split('/');
this.setState({ this.setState({
shixuntypes:type[3] shixuntypes: type[3]
}) })
} }
//获取提交总结接口 //获取提交总结接口
Getsubmissionsummaryinterface=()=>{ Getsubmissionsummaryinterface = () => {
var worksid=this.props.match.params.id; var worksid = this.props.match.params.id;
// console.log("Getsubmissionsummaryinterface"); // console.log("Getsubmissionsummaryinterface");
// console.log(this.props.match.params); // console.log(this.props.match.params);
// console.log(worksid); // console.log(worksid);
var url = `/student_works/${worksid}/commit_des.json`; var url = `/student_works/${worksid}/commit_des.json`;
axios.get(url).then((result) => { axios.get(url).then((result) => {
// console.log(result); // console.log(result);
if (result.status === 200) { if (result.status === 200) {
@ -53,11 +53,11 @@ class CommitSummary extends Component{
// console.log("提交总结接口") // console.log("提交总结接口")
// console.log(JSON.stringify(result)) // console.log(JSON.stringify(result))
this.setState({ this.setState({
data:result.data, data: result.data,
description: result.data.description, description: result.data.description,
cancels:true, cancels: true,
}) })
}else { } else {
this.props.showNotification(result.data.message); this.props.showNotification(result.data.message);
} }
@ -66,11 +66,11 @@ class CommitSummary extends Component{
}) })
} }
submitCommitSummary=()=> { submitCommitSummary = () => {
const mdContnet = this.refs[`md${1}`].getValue().trim(); const mdContnet = this.refs[`md${1}`].getValue().trim();
console.log(mdContnet) console.log(mdContnet)
} }
gotohome=()=>{ gotohome = () => {
// let courseId=this.props.match.params.coursesId; // let courseId=this.props.match.params.coursesId;
// if(courseId===undefined){ // if(courseId===undefined){
// this.props.history.push("/courses"); // this.props.history.push("/courses");
@ -79,27 +79,27 @@ class CommitSummary extends Component{
// } // }
this.props.history.goBack() this.props.history.goBack()
} }
asdasdsad=()=>{ asdasdsad = () => {
this.setState({ this.setState({
contents:"" contents: ""
}) })
} }
handleSubmit=(e) => { handleSubmit = (e) => {
e.preventDefault(); e.preventDefault();
this.props.form.validateFields((err, values) => { this.props.form.validateFields((err, values) => {
if (!err) { if (!err) {
console.log(values.description); 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(`请输入提交内容`); this.props.showNotification(`请输入提交内容`);
return return
} }
var worksid=this.props.match.params.id; var worksid = this.props.match.params.id;
var url = `/student_works/${worksid}/update_des.json`; var url = `/student_works/${worksid}/update_des.json`;
axios.post(url,{ axios.post(url, {
description:values.description, description: values.description,
}).then((result) => { }).then((result) => {
if (result.status === 200) { if (result.status === 200) {
// console.log(url) // console.log(url)
@ -118,26 +118,26 @@ class CommitSummary extends Component{
} }
render() { render() {
const {getFieldDecorator} = this.props.form; const { getFieldDecorator } = this.props.form;
let {contents,data}=this.state; let { contents, data } = this.state;
// console.log(this.props); // 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 ( return (
<div> <div>
<div className="newMain clearfix"> <div className="newMain clearfix">
{/*<Form onSubmit={this.handleSubmit}>*/} {/*<Form onSubmit={this.handleSubmit}>*/}
<div className={"educontent mb20"}> <div className={"educontent mb20"}>
<div style={{ <div style={{
width:'100%', width: '100%',
height:'20px' height: '20px'
}} > }} >
<div className="educontent mb30"> <div className="educontent mb30">
<p className="clearfix mb20 mt10 "> <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> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
{/* style="grey" */} {/* style="grey" */}
<a <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> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<a className="fl">作业详情</a> <a className="fl">作业详情</a>
</p> </p>
@ -146,23 +146,23 @@ class CommitSummary extends Component{
</div> </div>
<div className="mt20"> <div className="mt20">
<p className=" fl color-black mt10 summaryname" onClick={this.asdasdsad}>{this.state.description ? '修改总结' : '提交总结'}</p> <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> </div>
{/*educontentbox*/} {/*educontentbox*/}
<div className="stud-class-set pt40 pb40"> <div className="stud-class-set pt40 pb40">
<div className={"mt10"}> <div className={"mt10"}>
<div style={{ "background": "#fff", "padding": "15px"}}> <div style={{ "background": "#fff", "padding": "15px" }}>
<span className="commitcontentsysl"> <span className="commitcontentsysl">
<span className="color-red">*</span> <span className="color-red">*</span>
内容</span> 内容</span>
</div> </div>
<div className="new-wrap"> <div className="new-wrap">
<Form layout='vertical' onSubmit={this.handleSubmit} > <Form layout='vertical' onSubmit={this.handleSubmit} >
<Form.Item <Form.Item
> >
<div style={{ "background": "#fff","padding-bottom":"20px","padding-left":"20px","padding-right":"20px"}} <div style={{ "background": "#fff", "padding-bottom": "20px", "padding-left": "20px", "padding-right": "20px" }}
className="mdInForm"> className="mdInForm">
{getFieldDecorator('description', { {getFieldDecorator('description', {
rules: [{ rules: [{
required: true, message: '请在此输入总结内容,最多5000个字符', required: true, message: '请在此输入总结内容,最多5000个字符',
@ -171,7 +171,7 @@ class CommitSummary extends Component{
}], }],
})( })(
<TPMMDEditor ref={this.mdRef} placeholder={'请在此输入总结内容最多5000个字符'} <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> </div>
</Form.Item> </Form.Item>

@ -1,9 +1,9 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder'; 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 Loadable from 'react-loadable';
import Loading from '../../../Loading'; import Loading from '../../../Loading';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC'; import TPMIndexHOC from '../../tpm/TPMIndexHOC';
import "../css/Courses.css" import "../css/Courses.css"
//引入对应跳转的组件 //引入对应跳转的组件
@ -23,7 +23,7 @@ import "../css/Courses.css"
// }) // })
// //
class CommitSummaryIndex extends Component{ class CommitSummaryIndex extends Component {
constructor(props) { constructor(props) {
super(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 * @Last Modified time: 2019-11-15 20:43:27
*/ */
import React from 'react'; import React from 'react';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC'; import TPMIndexHOC from '../tpm/TPMIndexHOC';
import { SnackbarHOC } from 'educoder'; import { SnackbarHOC } from 'educoder';
import DeveloperHome from './DeveloperHome'; import DeveloperHome from './DeveloperHome';
const App = (props) => { const App = (props) => {
return ( return (
<DeveloperHome {...props}/> <DeveloperHome {...props} />
); );
} }

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

@ -7,8 +7,7 @@ import axios from 'axios';
import { Table, InputNumber } from 'antd'; 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'; import 'antd/lib/style/index.css';

@ -3,7 +3,7 @@ import { Switch, Route } from 'react-router-dom';
import { SnackbarHOC } from 'educoder'; import { SnackbarHOC } from 'educoder';
import CustomLoadable from "../../CustomLoadable"; import CustomLoadable from "../../CustomLoadable";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC"; import TPMIndexHOC from "../tpm/TPMIndexHOC";
const Home = CustomLoadable(() => import('./Home/index')); const Home = CustomLoadable(() => import('./Home/index'));
const EcYear = CustomLoadable(() => import('./EcYear/index')); const EcYear = CustomLoadable(() => import('./EcYear/index'));
@ -11,54 +11,54 @@ const EcSetting = CustomLoadable(() => import('./EcSetting/index'));
const $ = window.$ const $ = window.$
//工程认证各个页面的查看详情弹层 //工程认证各个页面的查看详情弹层
function elasticLayer(forumId){ function elasticLayer(forumId) {
if (window.__memo) { if (window.__memo) {
doElasticLayer(window.__memo, true) doElasticLayer(window.__memo, true)
return; 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({ // document.body.addEventListener('touchmove',bodyScroll,false);
url: url, // $('body').css({'position':'fixed',"width":"100%"});
type: 'get',
success: function(res) {
console.log(res)
doElasticLayer(res.memo)
}
});
// document.body.addEventListener('touchmove',bodyScroll,false);
// $('body').css({'position':'fixed',"width":"100%"});
} }
function doElasticLayer(memo, rendered){ function doElasticLayer(memo, rendered) {
if (rendered) { if (rendered) {
$(".layerContent").show(); $(".layerContent").show();
$(".newMain").hide(); $(".newMain").hide();
return; return;
} }
window.__memo = memo window.__memo = memo
var content = memo.content var content = memo.content
var subject = memo.subject var subject = memo.subject
var html='<div class="layerContent"><div class="educontent">' + 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>' + '<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>' + '<a href="javascript:void(0)" onclick="removeElasticLayer();" class="fr font-16 mt5">返回</a></p>' +
'<div id="MDContent"><textarea style="display:none">' '<div id="MDContent"><textarea style="display:none">'
+ content + + content +
'</textarea></div>' '</textarea></div>'
$(".newMain").after(html).hide(); $(".newMain").after(html).hide();
window.editormd.markdownToHTML("MDContent", { window.editormd.markdownToHTML("MDContent", {
htmlDecode: "style,script,iframe", // you can filter tags decode htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true, taskList: true,
tex: true, // 默认不解析 tex: true, // 默认不解析
flowChart: true, // 默认不解析 flowChart: true, // 默认不解析
sequenceDiagram: true // 默认不解析 sequenceDiagram: true // 默认不解析
}); });
} }
function removeElasticLayer(){ function removeElasticLayer() {
$(".layerContent").hide(); $(".layerContent").hide();
$(".newMain").show(); $(".newMain").show();
} }
window.elasticLayer = elasticLayer window.elasticLayer = elasticLayer
window.doElasticLayer = doElasticLayer 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 axios from 'axios'
import 'antd/dist/antd.css'; import 'antd/dist/antd.css';
import './style.less' import './style.less'
import { ECModalHOC } from '../../common/ECModalHOC' import ECModalHOC from '../../common/ECModalHOC'
class EcCourseSupportSetting extends Component { class EcCourseSupportSetting extends Component {
constructor(props) { constructor(props) {

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

@ -1,20 +1,12 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Redirect } from 'react-router'; 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 classNames from 'classnames'
import MemoTechShare from './MemoTechShare' import MemoTechShare from './MemoTechShare'
// import MemoGuide from './MemoGuide'
// import MemoNewest from './MemoNewest'
// import MemoHottest from './MemoHottest'
import MemoDetail from './MemoDetail' import MemoDetail from './MemoDetail'
import MemoNew from './MemoNew' import MemoNew from './MemoNew'
@ -22,7 +14,7 @@ import MemoMyPublish from './MemoMyPublish'
import MemoShixun from './shixun/MemoShixun' import MemoShixun from './shixun/MemoShixun'
import { TPMIndexHOC } from '../tpm/TPMIndexHOC' import TPMIndexHOC from '../tpm/TPMIndexHOC'
import RightMyPublish from './RightMyPublish' import RightMyPublish from './RightMyPublish'
import UserSection from './UserSection' import UserSection from './UserSection'
@ -32,146 +24,142 @@ import RightMemoLabel from './RightMemoLabel'
import RecommendShixun from './RecommendShixun' import RecommendShixun from './RecommendShixun'
import ForumsNavTab from './ForumsNavTab'
import axios from 'axios'
import 'rc-select/assets/index.css'; import 'rc-select/assets/index.css';
import './ForumsIndex.css' import './ForumsIndex.css'
import './RightSection.css' import './RightSection.css'
import { SnackbarHOC, getUrl } from 'educoder' import { SnackbarHOC, getUrl } from 'educoder'
import { CNotificationHOC } from '../courses/common/CNotificationHOC' import CNotificationHOC from '../courses/common/CNotificationHOC'
let _url_origin = getUrl() let _url_origin = getUrl()
const $ = window.$ const $ = window.$
$('head').append( $('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-admin.css?6`) ); .attr('href', `${_url_origin}/stylesheets/css/edu-admin.css?6`));
$('head').append( $('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-forum.css?1525440977`) ); .attr('href', `${_url_origin}/stylesheets/css/edu-forum.css?1525440977`));
$('head').append( $('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/magic-check.css?1525440977`) ); .attr('href', `${_url_origin}/stylesheets/educoder/magic-check.css?1525440977`));
setTimeout(()=>{ setTimeout(() => {
// 附件上传滚动条 \public\stylesheets\jquery\jquery-ui-1.9.2.css // 附件上传滚动条 \public\stylesheets\jquery\jquery-ui-1.9.2.css
$('head').append( $('<link rel="stylesheet" type="text/css" />') $('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/jquery/jquery-ui-1.9.2.css`) ); .attr('href', `${_url_origin}/stylesheets/jquery/jquery-ui-1.9.2.css`));
}, 1000) }, 1000)
class ForumsIndex extends Component { class ForumsIndex extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
searchValue: '', searchValue: '',
enterKeyFlag: false, enterKeyFlag: false,
showSearchValue: false, showSearchValue: false,
selectedHotLabelIndex: -1, selectedHotLabelIndex: -1,
}
} }
}
setSearchValue = (searchValue, enterKeyFlag) => { setSearchValue = (searchValue, enterKeyFlag) => {
if (enterKeyFlag === true) { if (enterKeyFlag === true) {
this.setState({
selectedHotLabelIndex: -1
})
}
this.setState({ this.setState({
searchValue, selectedHotLabelIndex: -1
showSearchValue: (enterKeyFlag && searchValue) ? true : false,
enterKeyFlag: enterKeyFlag === true ? !this.state.enterKeyFlag : this.state.enterKeyFlag
}) })
} }
this.setState({
setHotLabelIndex = (index, callback) => { searchValue,
const newState = { showSearchValue: (enterKeyFlag && searchValue) ? true : false,
selectedHotLabelIndex: index, enterKeyFlag: enterKeyFlag === true ? !this.state.enterKeyFlag : this.state.enterKeyFlag
} })
if (index != -1) { }
newState.searchValue = ''
newState.showSearchValue = false setHotLabelIndex = (index, callback) => {
} const newState = {
this.setState({ selectedHotLabelIndex: index,
...newState
}, callback)
} }
if (index != -1) {
initForumState(data) { newState.searchValue = ''
this.setState({...data}) newState.showSearchValue = false
} }
this.setState({
...newState
}, callback)
}
initForumState(data) {
this.setState({ ...data })
}
componentDidMount() {
window.document.title = '交流问答'
}
componentDidMount() {
window.document.title = '交流问答'
}
componentWillReceiveProps(newProps, newContext) {
}
render() { componentWillReceiveProps(newProps, newContext) {
const { match, history, resLoading } = this.props
const { memo } = this.state; }
const techSharePath = `${match.path}/categories/:memoType` render() {
const guidePath = `${match.path}/categories/:memoType` const { match, history, resLoading } = this.props
const hottestPath = `${match.path}/categories/:memoType` // ?order=hottest const { memo } = this.state;
const newestPath = `${match.path}/categories/:memoType` // ?order=newest
const shixunDiscussPath = `/forums/categories/shixun_discuss` const techSharePath = `${match.path}/categories/:memoType`
const locationPath = history.location.pathname 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
const pathArray = locationPath.split('/'); const isWidth100 = (locationPath.indexOf('forums/new') !== -1
const isMemoDetail = (!isWidth100 && || locationPath.indexOf('/edit') !== -1) ? true : false
pathArray.length === 3 && !isNaN(parseInt(pathArray[2])) ) ? true : false
const isGuide = locationPath.indexOf('/forums/categories/3') !== -1 const pathArray = locationPath.split('/');
const isMemoDetail = (!isWidth100 &&
pathArray.length === 3 && !isNaN(parseInt(pathArray[2]))) ? true : false
return ( const isGuide = locationPath.indexOf('/forums/categories/3') !== -1
<div className="newMain clearfix">
<div className="educontent mt30 clearfix"> return (
{/* component={TechShare} <div className="newMain clearfix">
<div className="educontent mt30 clearfix">
{/* component={TechShare}
<ForumsNavTab {...this.props}></ForumsNavTab> */} <ForumsNavTab {...this.props}></ForumsNavTab> */}
<div className={classNames('fl', { with75: !isWidth100}, { width100: isWidth100}) }> <div className={classNames('fl', { with75: !isWidth100 }, { width100: isWidth100 })}>
<Switch> <Switch>
<Route path={`/forums/categories/my_published`} render={ <Route path={`/forums/categories/my_published`} render={
(props) => (<MemoMyPublish {...this.props} {...this.state} {...props} (props) => (<MemoMyPublish {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)} initForumState={(data) => this.initForumState(data)}
setSearchValue={this.setSearchValue} setSearchValue={this.setSearchValue}
setHotLabelIndex={this.setHotLabelIndex} setHotLabelIndex={this.setHotLabelIndex}
/>) />)
}></Route> }></Route>
<Route path={`${shixunDiscussPath}`} render={ <Route path={`${shixunDiscussPath}`} render={
(props) => (<MemoShixun {...this.props} {...this.state} {...props} (props) => (<MemoShixun {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)} initForumState={(data) => this.initForumState(data)}
setSearchValue={this.setSearchValue} setSearchValue={this.setSearchValue}
setHotLabelIndex={this.setHotLabelIndex} setHotLabelIndex={this.setHotLabelIndex}
/>) />)
}></Route> }></Route>
<Route path={`${techSharePath}`} render={ <Route path={`${techSharePath}`} render={
(props) => (<MemoTechShare {...this.props} {...this.state} {...props} (props) => (<MemoTechShare {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)} initForumState={(data) => this.initForumState(data)}
setSearchValue={this.setSearchValue} setSearchValue={this.setSearchValue}
setHotLabelIndex={this.setHotLabelIndex} setHotLabelIndex={this.setHotLabelIndex}
/>) />)
}></Route> }></Route>
{/* {/*
<Route path={`${guidePath}`} render={ <Route path={`${guidePath}`} render={
(props) => (<MemoGuide {...this.props} {...this.state} {...props} (props) => (<MemoGuide {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)} />) initForumState={(data)=>this.initForumState(data)} />)
@ -185,71 +173,71 @@ class ForumsIndex extends Component {
initForumState={(data)=>this.initForumState(data)} />) initForumState={(data)=>this.initForumState(data)} />)
}></Route> */} }></Route> */}
{/* :forumTypeId/ */} {/* :forumTypeId/ */}
<Route path={`/forums/new`} render={ <Route path={`/forums/new`} render={
(props) => (<MemoNew {...this.props} {...this.state} {...props} (props) => (<MemoNew {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)} initForumState={(data) => this.initForumState(data)}
/>) />)
}></Route> }></Route>
<Route path={`/forums/:memoId/edit`} render={ <Route path={`/forums/:memoId/edit`} render={
(props) => (<MemoNew {...this.props} {...this.state} {...props} (props) => (<MemoNew {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)} initForumState={(data) => this.initForumState(data)}
/>) />)
}></Route> }></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>
</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>
}
</div>
</div>
}
<Redirect from={`${match.url}`} to={`/forums/categories/all?order=newest`} />
</Switch>
</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>
}
</div>
</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 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' import axios from 'axios'
@ -17,17 +13,16 @@ import update from 'immutability-helper'
// import Tooltip from '@material-ui/core/Tooltip'; // import Tooltip from '@material-ui/core/Tooltip';
import RewardDialog from '../common/RewardDialog'; import RewardDialog from '../common/RewardDialog';
import { ImageLayerOfCommentHOC } from '../page/layers/ImageLayerOfCommentHOC' import ImageLayerOfCommentHOC from '../page/layers/ImageLayerOfCommentHOC'
import MemoDetailKEEditor from './MemoDetailKEEditor' import MemoDetailKEEditor from './MemoDetailKEEditor'
import MemoDetailMDEditor from './MemoDetailMDEditor' import MemoDetailMDEditor from './MemoDetailMDEditor'
import { bytesToSize, CBreadcrumb, htmlEncode } from 'educoder' import { CBreadcrumb, htmlEncode } from 'educoder'
import { Tooltip } from 'antd' import { Tooltip } from 'antd'
// import CBreadcrumb from '../courses/common/CBreadcrumb' // import CBreadcrumb from '../courses/common/CBreadcrumb'
import { typeNameMap2 } from './MemoNew' import { typeNameMap2 } from './MemoNew'
import CaseDetail from "../moop_cases/CaseDetail";
const $ = window.$ const $ = window.$
function urlStringify(params) { function urlStringify(params) {
let noParams = true; let noParams = true;

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

@ -1,73 +1,62 @@
import React, { Component } from 'react'; 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' import MemoList from './MemoList'
class MemoMyPublish extends Component { class MemoMyPublish extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
}
}
onPaginationChange(pageNum, pageSize) {
this.props.onPaginationChange(pageNum, pageSize)
} }
}
componentDidMount() { onPaginationChange(pageNum, pageSize) {
this.props.onPaginationChange(pageNum, pageSize)
}
} componentDidMount() {
componentWillUnmount() { }
} componentWillUnmount() {
componentWillReceiveProps(newProps, newContext) {
} }
renderMemoList() { componentWillReceiveProps(newProps, newContext) {
}
renderMemoList() {
return this.props.renderMemoList();
}
render() {
const { match, history, currentPage, memo_count, memo_list } = this.props
return ( return this.props.renderMemoList();
<React.Fragment> }
render() {
const { match, history, currentPage, memo_count, memo_list } = this.props
return (
<React.Fragment>
<div className="discuss-tab bor-bottom-greyE clearfix pr boxsizing"> <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> <Link className="returnBtnA fr mr10" to={`/forums`}><span className="color-grey-9 font-16">返回</span></Link>
</p> </p>
</div> </div>
<MemoList {...this.props} renderMemoList={() => this.renderMemoList()} <MemoList {...this.props} renderMemoList={() => this.renderMemoList()}
onPaginationChange={ (pageNum, pageSize) => this.props.onPaginationChange(pageNum, pageSize) } onPaginationChange={(pageNum, pageSize) => this.props.onPaginationChange(pageNum, pageSize)}
> >
</MemoList> </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 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 Pagination from 'rc-pagination';
import { postPaginationHOC } from './PostPaginationHOC' import postPaginationHOC from './PostPaginationHOC'
import PostItem from './PostItem'
import ForumsNavTab from './ForumsNavTab' import ForumsNavTab from './ForumsNavTab'
class MemoGuide extends Component { class MemoGuide extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = {
}
}
onPaginationChange(pageNum, pageSize) {
this.props.onPaginationChange(pageNum, pageSize)
}
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
onPaginationChange(pageNum, pageSize) {
return (
<React.Fragment> 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> <ForumsNavTab {...this.props}></ForumsNavTab>
<div id="forum_list" className="forum_table mh650"> <div id="forum_list" className="forum_table mh650">
{this.renderMemoList()} {this.renderMemoList()}
{ !!memo_count && <Pagination onChange={(pageNum, pageSize) => this.onPaginationChange(pageNum, pageSize)} {!!memo_count && <Pagination onChange={(pageNum, pageSize) => this.onPaginationChange(pageNum, pageSize)}
showQuickJumper current={currentPage} total={memo_count} pageSize={15}/> } showQuickJumper current={currentPage} total={memo_count} pageSize={15} />}
</div> </div>
</React.Fragment> </React.Fragment>
); );
} }
} }
export default postPaginationHOC( MemoGuide ); export default postPaginationHOC(MemoGuide);

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

@ -7,7 +7,7 @@ import { SnackbarHOC } from 'educoder';
import './Help.css'; import './Help.css';
import CustomLoadable from "../../CustomLoadable"; import CustomLoadable from "../../CustomLoadable";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC"; import TPMIndexHOC from "../tpm/TPMIndexHOC";
const AboutUs = CustomLoadable(() => import('./AboutUs')); const AboutUs = CustomLoadable(() => import('./AboutUs'));
const ContactUs = CustomLoadable(() => import('./ContactUs')); const ContactUs = CustomLoadable(() => import('./ContactUs'));
@ -17,7 +17,7 @@ const HelpCenter = CustomLoadable(() => import('./HelpCenter'));
const Feedback = CustomLoadable(() => import('./Feedback')); const Feedback = CustomLoadable(() => import('./Feedback'));
class Help extends React.Component { class Help extends React.Component {
constructor (props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
@ -26,7 +26,7 @@ class Help extends React.Component {
} }
componentDidUpdate(prevProps) { 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 }); 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/cooperatives' component={Cooperatives}></Route>
<Route path='/help/agreement' component={Agreement}></Route> <Route path='/help/agreement' component={Agreement}></Route>
<Route path='/help/help_center' component={HelpCenter}></Route> <Route path='/help/help_center' component={HelpCenter}></Route>
<Route path='/help/feedback' render={ (props)=>(<Feedback {...this.props} {...props} {...this.state}></Feedback>) }></Route> <Route path='/help/feedback' render={(props) => (<Feedback {...this.props} {...props} {...this.state}></Feedback>)}></Route>
<Route component={AboutUs}/> <Route component={AboutUs} />
</Switch> </Switch>
</div> </div>
</Col> </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 axios from 'axios';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC'; import TPMIndexHOC from '../tpm/TPMIndexHOC';
import UpgradeModals from '../modals/UpgradeModals'; import UpgradeModals from '../modals/UpgradeModals';

@ -1,11 +1,9 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {Input,Pagination,Tooltip} from 'antd'; import TPMIndexHOC from "../../../modules/tpm/TPMIndexHOC";
import {TPMIndexHOC} from "../../../modules/tpm/TPMIndexHOC"; import { SnackbarHOC, getImageUrl } from 'educoder';
import { WordsBtn ,ActionBtn,SnackbarHOC,markdownToHTML,getImageUrl} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import "../css/messagemy.css" import "../css/messagemy.css"
import { Redirect } from 'react-router'; import { Route, Switch } from "react-router-dom";
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import Loading from '../../../Loading' import Loading from '../../../Loading'
import Loadable from 'react-loadable'; import Loadable from 'react-loadable';
@ -25,20 +23,20 @@ const MessagChat = Loadable({
loader: () => import('./MessagChat'), loader: () => import('./MessagChat'),
loading: Loading, loading: Loading,
}) })
class Messagerouting extends Component{ class Messagerouting extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state={ this.state = {
routing:1, routing: 1,
unread_message_count:0, unread_message_count: 0,
unread_tiding_count:0, unread_tiding_count: 0,
} }
} }
componentDidMount(){ componentDidMount() {
// console.log("Messagerouting"); // console.log("Messagerouting");
// console.log(this.props); // console.log(this.props);
// let courstype=this.props.location.search; // let courstype=this.props.location.search;
// // courstype=courstype.splice('/'); // // courstype=courstype.splice('/');
// // courstype=courstype[3]; // // courstype=courstype[3];
// // console.log("45"); // // console.log("45");
@ -54,207 +52,207 @@ class Messagerouting extends Component{
// console.log("22222222222"); // console.log("22222222222");
// console.log(this.props); // console.log(this.props);
// console.log("33333333333"); // console.log("33333333333");
if(prevProps.current_user !== this.props.current_user){ if (prevProps.current_user !== this.props.current_user) {
this.Messageprivatemessageunreadmessage(this.props.current_user.login); this.Messageprivatemessageunreadmessage(this.props.current_user.login);
// console.log("Messagerouting59"); // console.log("Messagerouting59");
// console.log(this.props.current_user); // console.log(this.props.current_user);
} }
} }
//消息未读 //消息未读
Messageprivatemessageunreadmessage=(user_id)=>{ Messageprivatemessageunreadmessage = (user_id) => {
const url=`/users/${user_id}/unread_message_info.json` const url = `/users/${user_id}/unread_message_info.json`
axios.get(url).then((result) => { axios.get(url).then((result) => {
if(result===undefined){ if (result === undefined) {
return return
} }
// console.log("消息未读1"); // console.log("消息未读1");
// console.log(result); // console.log(result);
this.setState({ this.setState({
unread_message_count:result.data.unread_message_count, unread_message_count: result.data.unread_message_count,
unread_tiding_count:result.data.unread_tiding_count, unread_tiding_count: result.data.unread_tiding_count,
}) })
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}) })
}; };
SwitchonClick=(value,child)=>{ SwitchonClick = (value, child) => {
this.setState({ this.setState({
routing:value, routing: value,
}); });
this.Messageprivatemessageunreadmessage(this.props.current_user.login); this.Messageprivatemessageunreadmessage(this.props.current_user.login);
if(value===1){ if (value === 1) {
this.props.history.replace(`/messages/${this.props.current_user.login}/user_tidings`); this.props.history.replace(`/messages/${this.props.current_user.login}/user_tidings`);
this.homeworkendss1(child); this.homeworkendss1(child);
} }
if(value===2){ if (value === 2) {
this.props.history.replace(`/messages/${this.props.current_user.login}/private_messages`); this.props.history.replace(`/messages/${this.props.current_user.login}/private_messages`);
this.homeworkendss2(child); this.homeworkendss2(child);
} }
}; };
Message2=(data)=>{ Message2 = (data) => {
// console.log("64"); // console.log("64");
// console.log(data); // console.log(data);
this.setState({ this.setState({
unread_message_count:parseInt(data.unread_message_count), unread_message_count: parseInt(data.unread_message_count),
unread_tiding_count:parseInt(data.unread_tiding_count), unread_tiding_count: parseInt(data.unread_tiding_count),
}) })
}; };
//跳转到链接 //跳转到链接
Modifyur=(i,id)=>{ Modifyur = (i, id) => {
// console.log("跳转到链接1"); // console.log("跳转到链接1");
// console.log(i); // console.log(i);
// console.log(item); // console.log(item);
// console.log("跳转到链接2"); // console.log("跳转到链接2");
if(i<3){ if (i < 3) {
this.setState({ this.setState({
routing:i, routing: i,
}); });
if(i===1){ if (i === 1) {
this.props.history.replace(`/messages/${this.props.current_user.login}/user_tidings`); 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`); this.props.history.replace(`/messages/${this.props.current_user.login}/private_messages`);
} }
}else { } else {
this.setState({ this.setState({
routing:i, routing: i,
}); });
console.log("22222222222"); console.log("22222222222");
this.props.history.replace(`/messages/${this.props.current_user.login}/message_detail?target_ids=${id}`); this.props.history.replace(`/messages/${this.props.current_user.login}/message_detail?target_ids=${id}`);
} }
}; };
myCome=(e)=>{ myCome = (e) => {
window.location.href="/users/"+e.target.login; window.location.href = "/users/" + e.target.login;
} }
myxiaoxisixintab=(i)=>{ myxiaoxisixintab = (i) => {
if(i===1){ if (i === 1) {
this.setState({ this.setState({
routing:1, routing: 1,
}); });
} }
if(i===2){ if (i === 2) {
this.setState({ this.setState({
routing:2, routing: 2,
}); });
} }
if(i===3){ if (i === 3) {
this.setState({ this.setState({
routing:3, routing: 3,
}); });
} }
}; };
bindRef = ref => { this.child = ref }; bindRef = ref => { this.child = ref };
homeworkendss1(child){ homeworkendss1(child) {
// console.log(child); // console.log(child);
// // console.log(this.refs.childModel); // // console.log(this.refs.childModel);
// console.log(child); // console.log(child);
try { try {
child.getdatas(); child.getdatas();
}catch (e) { } catch (e) {
} }
// //
} }
homeworkendss2(child){ homeworkendss2(child) {
// console.log(child); // console.log(child);
// // console.log(this.refs.childModel); // // console.log(this.refs.childModel);
// console.log(child); // console.log(child);
try { try {
child.getdatas2(); child.getdatas2();
}catch (e) { } catch (e) {
} }
// //
} }
render() { 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(this.props);
// console.log(routing); // console.log(routing);
return ( return (
<div className="newMain clearfix"> <div className="newMain clearfix">
<div className="educontent mt20 mb80 clearfix"> <div className="educontent mt20 mb80 clearfix">
{/*左边*/} {/*左边*/}
<div className="leftPanel"> <div className="leftPanel">
{/*头像*/} {/*头像*/}
<div className="mb20 edu-back-white pt40 pb40 edu-txt-center"> <div className="mb20 edu-back-white pt40 pb40 edu-txt-center">
<a > <a >
{ {
this.props.current_user!== undefined? this.props.current_user !== undefined ?
<img className="person radius myw120 myh120" src={getImageUrl("images/"+this.props.current_user.image_url)}/> <img className="person radius myw120 myh120" src={getImageUrl("images/" + this.props.current_user.image_url)} />
:"" : ""
} }
</a> </a>
<p className="font-24 lineh-25 mt10" >{this.props.current_user&&this.props.current_user.username}</p> <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> <p className="color-grey-6 mt5" >{this.props.current_user && this.props.current_user.user_identity}</p>
</div> </div>
{/*路由跳转*/} {/*路由跳转*/}
<ul className="edu-back-white"> <ul className="edu-back-white">
<li className={routing ===1?"nav pr active":"nav pr"}> <li className={routing === 1 ? "nav pr active" : "nav pr"}>
<a onClick={(value,child)=>this.SwitchonClick(1,this.child)}>消息</a> <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>:""} {unread_tiding_count === 0 ? "" : unread_tiding_count > 0 ? <span className="new-info">{unread_tiding_count}</span> : ""}
</li> </li>
<li className={routing ===2?"nav pr active":routing ===3?"nav pr active":"nav pr"}> <li className={routing === 2 ? "nav pr active" : routing === 3 ? "nav pr active" : "nav pr"}>
<a onClick={(value,child)=>this.SwitchonClick(2,this.child)}>私信</a> <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>:""} {unread_message_count === 0 ? "" : unread_message_count > 0 ? <span className="new-info">{unread_message_count}</span> : ""}
</li> </li>
</ul> </ul>
</div> </div>
{/*右边*/} {/*右边*/}
<div className="rightPanel"> <div className="rightPanel">
<div className="clearfix"> <div className="clearfix">
{/*/!*消息自路由*!/*/} {/*/!*消息自路由*!/*/}
{/*{routing===1?<MessagSub {...this.state} {...this.props} Message2={()=>this.Message2()}></MessagSub> :""}*/} {/*{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> <Switch>
{/*/!*消息自路由*! name 是 /message/info/:userid/*/} {/*/!*消息自路由*! name 是 /message/info/:userid/*/}
<Route path="/messages/:userid/user_tidings" <Route path="/messages/:userid/user_tidings"
render={ render={
(props) => (<MessagSub triggerRef={this.bindRef} {...this.state} {...this.props} {...props} Message2={()=>this.Message2()} Mtab={(i)=>this.myxiaoxisixintab(i)}></MessagSub>) (props) => (<MessagSub triggerRef={this.bindRef} {...this.state} {...this.props} {...props} Message2={() => this.Message2()} Mtab={(i) => this.myxiaoxisixintab(i)}></MessagSub>)
} }
></Route> ></Route>
{/*/!*私信*! name 是letter/*/} {/*/!*私信*! name 是letter/*/}
<Route path="/messages/:userid/private_messages" <Route path="/messages/:userid/private_messages"
render={ 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> ) (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> ></Route>
{/*/!*私信聊天页面*! letters/*/} {/*/!*私信聊天页面*! letters/*/}
<Route path="/messages/:userid/message_detail" <Route path="/messages/:userid/message_detail"
render={ 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>) (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> ></Route>
</Switch> </Switch>
</div> </div>
</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 './css/moopCases.css'
import '../courses/css/Courses.css' import '../courses/css/Courses.css'
import { SnackbarHOC } from 'educoder'; import { SnackbarHOC } from 'educoder';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC'; import TPMIndexHOC from '../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../courses/common/CNotificationHOC' 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 Loading from '../../Loading';
import Loadable from 'react-loadable'; import Loadable from 'react-loadable';
import axios from 'axios'; import axios from 'axios';
const CaseList = Loadable({ const CaseList = Loadable({
loader: () => import('./CaseList'), loader: () => import('./CaseList'),
loading:Loading, loading: Loading,
}) })
const CaseDetail = Loadable({ const CaseDetail = Loadable({
loader: () => import('./CaseDetail'), loader: () => import('./CaseDetail'),
loading:Loading, loading: Loading,
}) })
const CaseNew = Loadable({ const CaseNew = Loadable({
loader: () => import('./CaseNew'), loader: () => import('./CaseNew'),
loading:Loading, loading: Loading,
}) })
const CaseSuccess = Loadable({ const CaseSuccess = Loadable({
loader: () => import('./Success'), loader: () => import('./Success'),
loading:Loading, loading: Loading,
}) })
class Index extends Component{ class Index extends Component {
constructor(props){ constructor(props) {
super(props); super(props);
this.state={ this.state = {
praise_count:0, praise_count: 0,
CaseDetail:undefined, CaseDetail: undefined,
cover:undefined, cover: undefined,
creator:undefined, creator: undefined,
operation:undefined, operation: undefined,
tags:undefined, tags: undefined,
attachments:undefined, attachments: undefined,
user_praised:true, user_praised: true,
} }
} }
componentDidMount(){ componentDidMount() {
} }
// 获取案例详情 // 获取案例详情
getDetail = (caseID) =>{ getDetail = (caseID) => {
let url=`/libraries/${caseID}.json` let url = `/libraries/${caseID}.json`
axios.get(url).then((result)=>{ axios.get(url).then((result) => {
if(result){ if (result) {
this.setState({ this.setState({
CaseDetail:result.data, CaseDetail: result.data,
praise_count:result.data.praise_count, praise_count: result.data.praise_count,
cover:result.data.cover, cover: result.data.cover,
creator:result.data.creator, creator: result.data.creator,
operation:result.data.operation, operation: result.data.operation,
user_praised:result.data.operation.user_praised, user_praised: result.data.operation.user_praised,
tags:result.data.tags, tags: result.data.tags,
attachments:result.data.attachments attachments: result.data.attachments
}) })
window.document.title = result.data.title; window.document.title = result.data.title;
} }
}).catch((error)=>{ }).catch((error) => {
console.log(error); console.log(error);
}) })
} }
// 点赞 // 点赞
praisePoint=(caseID)=>{ praisePoint = (caseID) => {
let { praise_count }=this.state; let { praise_count } = this.state;
let url =`/praise_tread/like.json`; let url = `/praise_tread/like.json`;
axios.post(url,{ axios.post(url, {
object_id:caseID, object_id: caseID,
object_type:"library" object_type: "library"
}).then((result)=>{ }).then((result) => {
if(result){ if (result) {
this.setState({ this.setState({
praise_count: parseInt(praise_count)+1, praise_count: parseInt(praise_count) + 1,
user_praised:true user_praised: true
}) })
} }
}).catch((error)=>{ }).catch((error) => {
console.log(error); console.log(error);
}) })
} }
render(){ render() {
return( return (
<div className="newMain"> <div className="newMain">
<Switch {...this.props}> <Switch {...this.props}>
@ -100,29 +100,29 @@ class Index extends Component{
(props) => (<CaseList {...this.props} {...props} {...this.state} />) (props) => (<CaseList {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
<Route exact path="/moop_cases/new" <Route exact path="/moop_cases/new"
render={ render={
(props) => (<CaseNew {...this.props} {...props} {...this.state} />) (props) => (<CaseNew {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
<Route exact path="/moop_cases/:caseID" <Route exact path="/moop_cases/:caseID"
render={ 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>
<Route exact path="/moop_cases/:caseID/edit" <Route exact path="/moop_cases/:caseID/edit"
render={ render={
(props) => (<CaseNew {...this.props} {...props} {...this.state} getDetail={this.getDetail} />) (props) => (<CaseNew {...this.props} {...props} {...this.state} getDetail={this.getDetail} />)
} }
></Route> ></Route>
<Route exact path="/moop_cases/:caseID/publish_success" <Route exact path="/moop_cases/:caseID/publish_success"
render={ render={
(props) => (<CaseSuccess {...this.props} {...props} {...this.state} getDetail={this.getDetail} />) (props) => (<CaseSuccess {...this.props} {...props} {...this.state} getDetail={this.getDetail} />)
} }
></Route> ></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 axios from 'axios';
import {SnackbarHOC, WordsBtn,getImageUrl,markdownToHTML} from 'educoder'; import { getImageUrl, markdownToHTML } from 'educoder';
import {Row, Col,Input,Divider,Card,Button,Pagination,Breadcrumb,Icon,Spin} from 'antd'; import { Row, Col, Input, Divider, Card, Button, Pagination, Breadcrumb, Icon, Spin } from 'antd';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC'; import TPMIndexHOC from '../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../courses/common/CNotificationHOC'; import CNotificationHOC from '../courses/common/CNotificationHOC';
import Osshackathonmd from './Osshackathonmd'; import Osshackathonmd from './Osshackathonmd';
import './Osshackathon.css'; import './Osshackathon.css';
import Osshackathonmodel from "./Osshackathonmodel"; import Osshackathonmodel from "./Osshackathonmodel";
@ -13,15 +13,15 @@ class Osshackathon extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state = { this.state = {
page:1, page: 1,
limit:10, limit: 10,
search:undefined, search: undefined,
data:undefined, data: undefined,
hackathonedit:false, hackathonedit: false,
Osshackathonmodeltype:false, Osshackathonmodeltype: false,
spinning:false, spinning: false,
opentitletype:true, opentitletype: true,
boxoffsetHeigh:0 boxoffsetHeigh: 0
} }
} }
@ -30,96 +30,98 @@ class Osshackathon extends Component {
window.document.title = '竞赛报名'; window.document.title = '竞赛报名';
} }
getosshackathon=(page,limit,search)=>{ getosshackathon = (page, limit, search) => {
this.setState({ this.setState({
spinning:true spinning: true
}) })
let url=`/osshackathon.json`; let url = `/osshackathon.json`;
axios.get(url,{params:{ axios.get(url, {
page:page, params: {
limit:limit, page: page,
search:search, limit: limit,
}}).then((result)=>{ search: search,
if(result.status==200){ }
}).then((result) => {
if (result.status == 200) {
this.setState({ this.setState({
data:result.data, data: result.data,
spinning:false spinning: false
}) })
}else{ } else {
this.setState({ this.setState({
spinning:false spinning: false
}) })
} }
}).catch((error)=>{ }).catch((error) => {
this.setState({ this.setState({
spinning:true spinning: true
}) })
}) })
} }
getosshackathonlist=()=>{ getosshackathonlist = () => {
let {page,limit,search}=this.state; let { page, limit, search } = this.state;
this.setState({ this.setState({
page:1, page: 1,
search:undefined search: undefined
}) })
this.getosshackathon(1,limit,undefined) this.getosshackathon(1, limit, undefined)
} }
componentDidUpdate = (prevProps,prevState) => { componentDidUpdate = (prevProps, prevState) => {
if(prevState.data!=this.state.data){ if (prevState.data != this.state.data) {
//防止陷入无限循环 //防止陷入无限循环
let box=document.getElementById("Osshackathonfontlists"); let box = document.getElementById("Osshackathonfontlists");
if(box){ if (box) {
this.setState({ this.setState({
boxoffsetHeigh:box.offsetHeight boxoffsetHeigh: box.offsetHeight
}) })
} }
} }
} }
PaginationTask=(pageNumber)=>{ PaginationTask = (pageNumber) => {
let {hackathonedit}=this.state; let { hackathonedit } = this.state;
if(hackathonedit===true){ if (hackathonedit === true) {
this.props.showNotification(`请先保存或者关闭编辑状态`); this.props.showNotification(`请先保存或者关闭编辑状态`);
}else { } else {
this.setState({ this.setState({
page: pageNumber page: pageNumber
}) })
let {page, limit, search} = this.state; let { page, limit, search } = this.state;
this.getosshackathon(pageNumber, limit, search) this.getosshackathon(pageNumber, limit, search)
} }
} }
hackathonedit=(id)=>{ hackathonedit = (id) => {
//管理员编辑title //管理员编辑title
this.setState({ this.setState({
hackathonedit:true hackathonedit: true
}) })
} }
hidehackathonedit=()=>{ hidehackathonedit = () => {
this.setState({ this.setState({
hackathonedit:false hackathonedit: false
}) })
} }
Signupentry=(id)=>{ Signupentry = (id) => {
// 用户报名 // 用户报名
if(this.props.checkIfLogin()===false){ if (this.props.checkIfLogin() === false) {
this.props.showLoginDialog() this.props.showLoginDialog()
return return
} }
if(this.props.checkIfProfileCompleted()===false){ if (this.props.checkIfProfileCompleted() === false) {
this.props.showProfileCompleteDialog() this.props.showProfileCompleteDialog()
return 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() this.props.showhideAccountPhoneemailDialog()
return return
} }
@ -133,11 +135,11 @@ class Osshackathon extends Component {
} }
Signupentrys=(id)=>{ Signupentrys = (id) => {
let url=`/osshackathon/${id}/entry.json`; let url = `/osshackathon/${id}/entry.json`;
axios.post(url axios.post(url
).then((response) => { ).then((response) => {
if(response.data.status===0){ if (response.data.status === 0) {
this.getosshackathonlist() this.getosshackathonlist()
this.props.showNotification(`报名成功,预祝您夺得桂冠`); this.props.showNotification(`报名成功,预祝您夺得桂冠`);
} }
@ -146,46 +148,46 @@ class Osshackathon extends Component {
}) })
} }
editSignupentry=(id,name,description)=>{ editSignupentry = (id, name, description) => {
let {hackathonedit}=this.state; let { hackathonedit } = this.state;
if(hackathonedit===true){ if (hackathonedit === true) {
this.props.showNotification(`请先保存或者关闭编辑状态`); this.props.showNotification(`请先保存或者关闭编辑状态`);
}else{ } else {
// 管理员编辑项目 // 管理员编辑项目
this.setState({ this.setState({
Osshackathonmodeltype:true Osshackathonmodeltype: true
}) })
if(id===undefined){ if (id === undefined) {
this.setState({ this.setState({
modelid:undefined, modelid: undefined,
modelname:undefined, modelname: undefined,
modeldescription:undefined modeldescription: undefined
}) })
}else{ } else {
this.setState({ this.setState({
modelid:id, modelid: id,
modelname:name, modelname: name,
modeldescription:description modeldescription: description
}) })
} }
} }
} }
hideeditSignupentry=(id)=>{ hideeditSignupentry = (id) => {
// 管理员取消项目 // 管理员取消项目
this.setState({ this.setState({
Osshackathonmodeltype:false Osshackathonmodeltype: false
}) })
} }
delSignupentry=(id)=>{ delSignupentry = (id) => {
// 管理员删除项目 // 管理员删除项目
let {hackathonedit}=this.state; let { hackathonedit } = this.state;
if(hackathonedit===true){ if (hackathonedit === true) {
this.props.showNotification(`请先保存或者关闭编辑状态`); this.props.showNotification(`请先保存或者关闭编辑状态`);
}else { } else {
this.props.confirm({ this.props.confirm({
content: `是否确认删除该项目?`, content: `是否确认删除该项目?`,
onOk: () => { onOk: () => {
@ -194,8 +196,8 @@ class Osshackathon extends Component {
}) })
} }
} }
delSignupentrys=(id)=>{ delSignupentrys = (id) => {
let url=`/osshackathon/${id}.json`; let url = `/osshackathon/${id}.json`;
axios.delete(url) axios.delete(url)
.then((response) => { .then((response) => {
if (response.data.status == 0) { if (response.data.status == 0) {
@ -211,37 +213,37 @@ class Osshackathon extends Component {
} }
onsearchvalue=(value)=>{ onsearchvalue = (value) => {
let {hackathonedit}=this.state; let { hackathonedit } = this.state;
if(hackathonedit===true){ if (hackathonedit === true) {
this.props.showNotification(`请先保存或者关闭编辑状态`); this.props.showNotification(`请先保存或者关闭编辑状态`);
}else { } else {
this.setState({ this.setState({
search:value search: value
}) })
if(value.length>300){ if (value.length > 300) {
this.props.showNotification(`搜索字数大于300个字`); this.props.showNotification(`搜索字数大于300个字`);
} }
let {page,limit,search}=this.state; let { page, limit, search } = this.state;
this.getosshackathon(page,limit,value) this.getosshackathon(page, limit, value)
} }
} }
onsetsearchvalue=(e)=>{ onsetsearchvalue = (e) => {
this.setState({ this.setState({
search:e.target.value search: e.target.value
}) })
} }
opentitle=()=>{ opentitle = () => {
this.setState({ this.setState({
opentitletype:false opentitletype: false
}) })
} }
render() { render() {
let {page,data,hackathonedit,opentitletype}=this.state; let { page, data, hackathonedit, opentitletype } = this.state;
return ( return (
<div className="newMain clearfix newMainybot"> <div className="newMain clearfix newMainybot">
@ -261,117 +263,117 @@ class Osshackathon extends Component {
} }
</style> </style>
<div className={"educontent mb60 persmstyle"} style={{width: "1200px", marginTop: "26px"}}> <div className={"educontent mb60 persmstyle"} style={{ width: "1200px", marginTop: "26px" }}>
<div className="registrationback" <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> ></div>
<Spin spinning={this.state.spinning}> <Spin spinning={this.state.spinning}>
{this.props.user&&this.props.user.admin===true?<Row className={"mt20"}> {this.props.user && this.props.user.admin === true ? <Row className={"mt20"}>
<Col span={6}> <Col span={6}>
<Search <Search
className={"Osshackathon-btn-primary"} className={"Osshackathon-btn-primary"}
placeholder="请输入项目名称进行搜索" placeholder="请输入项目名称进行搜索"
enterButton="搜索" enterButton="搜索"
size="large" size="large"
value={this.state.search} value={this.state.search}
onInput={(e)=>this.onsetsearchvalue(e)} onInput={(e) => this.onsetsearchvalue(e)}
onSearch={value => this.onsearchvalue(value)} onSearch={value => this.onsearchvalue(value)}
/> />
</Col> </Col>
<Col span={3} className={"fr textright"}> <Col span={3} className={"fr textright"}>
<div> <div>
报名总数<span className={"color-red"}>{data&&data.hackathon.hackathon_users_count}</span> 报名总数<span className={"color-red"}>{data && data.hackathon.hackathon_users_count}</span>
</div> </div>
</Col> </Col>
</Row>:""} </Row> : ""}
{hackathonedit===true?"":<Row className={"mt20"}> {hackathonedit === true ? "" : <Row className={"mt20"}>
<Col span={6} className={"Osshackathonfont"}> <Col span={6} className={"Osshackathonfont"}>
{data&&data.hackathon.name} {data && data.hackathon.name}
</Col> </Col>
{this.props.user&&this.props.user.admin===true?<Col span={3} className={"fr textright"}> {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> <Button type="primary" className={"OsshackprimaryButtonsyle"} onClick={() => this.hackathonedit(data && data.hackathon.id)}>编辑</Button>
</Col>:""} </Col> : ""}
</Row>} </Row>}
{hackathonedit===true?"": <style> {hackathonedit === true ? "" : <style>
{ {
` `
.ant-divider-horizontal{ .ant-divider-horizontal{
margin: 19px 0; margin: 19px 0;
} }
` `
} }
</style>} </style>}
{hackathonedit===true?"":<Divider />} {hackathonedit === true ? "" : <Divider />}
{opentitletype===true?<style> {opentitletype === true ? <style>
{ {
` `
.Osshackathonfontlist{ .Osshackathonfontlist{
max-height: 180px; max-height: 180px;
overflow: hidden; overflow: hidden;
} }
` `
} }
</style>:""} </style> : ""}
{hackathonedit===true?"":<p className={"Osshackathonfontlist mb30"} id={"Osshackathonfontlists"}> {hackathonedit === true ? "" : <p className={"Osshackathonfontlist mb30"} id={"Osshackathonfontlists"}>
{data&&data.hackathon.description===null?"":<div className={"markdown-body"} {data && data.hackathon.description === null ? "" : <div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(data&&data.hackathon.description).replace(/▁/g, "▁▁▁")}}></div>} dangerouslySetInnerHTML={{ __html: markdownToHTML(data && data.hackathon.description).replace(/▁/g, "▁▁▁") }}></div>}
</p>} </p>}
{opentitletype===true&&this.state.boxoffsetHeigh===180?<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont"}>展开阅读全文<Icon type="down" /></Divider>:""} {opentitletype === true && this.state.boxoffsetHeigh === 180 ? <Divider dashed={true} onClick={() => this.opentitle()} className={"pointer Breadcrumbfont"}>展开阅读全文<Icon type="down" /></Divider> : ""}
{hackathonedit===true?<Osshackathonmd {hackathonedit === true ? <Osshackathonmd
getosshackathon={()=>this.getosshackathonlist()} getosshackathon={() => this.getosshackathonlist()}
hidehackathonedit={()=>this.hidehackathonedit()} hidehackathonedit={() => this.hidehackathonedit()}
{...this.props} {...this.props}
{...this.state} {...this.state}
/>:""} /> : ""}
{this.state.Osshackathonmodeltype===true?<Osshackathonmodel {this.state.Osshackathonmodeltype === true ? <Osshackathonmodel
getosshackathon={()=>this.getosshackathonlist()} getosshackathon={() => this.getosshackathonlist()}
hideeditSignupentry={()=>this.hideeditSignupentry()} hideeditSignupentry={() => this.hideeditSignupentry()}
{...this.props} {...this.props}
{...this.state} {...this.state}
/>:""} /> : ""}
{this.props.user&&this.props.user.admin===true?<Row className={"mb20 mt30"}> {this.props.user && this.props.user.admin === true ? <Row className={"mb20 mt30"}>
<Col span={8}></Col> <Col span={8}></Col>
<Col span={8}><Button type="primary" className={"OsshackprimaryButton OsshackprimaryButtonsyle"} onClick={()=>this.editSignupentry()}><Icon type="plus" />新建项目</Button></Col> <Col span={8}><Button type="primary" className={"OsshackprimaryButton OsshackprimaryButtonsyle"} onClick={() => this.editSignupentry()}><Icon type="plus" />新建项目</Button></Col>
<Col span={8}></Col> <Col span={8}></Col>
</Row>:""} </Row> : ""}
{/*学生身份*/} {/*学生身份*/}
{ {
this.props.user&&this.props.user.admin===false?data&&data.hacks.length==0?"":data&&data.hacks.map((item,key)=>{ this.props.user && this.props.user.admin === false ? data && data.hacks.length == 0 ? "" : data && data.hacks.map((item, key) => {
return( return (
<Card className={"OsshackathonCard mb20"} key={key}> <Card className={"OsshackathonCard mb20"} key={key}>
<Row> <Row>
<Col span={20} className={"OsshackathonCardtitle"}> <Col span={20} className={"OsshackathonCardtitle"}>
{item.name} {item.name}
</Col> </Col>
<Col span={6} className={"fr textright"}> <Col span={6} className={"fr textright"}>
<span style={{"line-height":"30px","margin-right": "30px"}}>报名人数{item.hack_users_count}</span> <span style={{ "line-height": "30px", "margin-right": "30px" }}>报名人数{item.hack_users_count}</span>
{item.entry_info===true?<Button type="primary fr mr20" disabled> {item.entry_info === true ? <Button type="primary fr mr20" disabled>
已报名 已报名
</Button>:<Button type="primary fr issignup" onClick={()=>this.Signupentry(item.id)}></Button>} </Button> : <Button type="primary fr issignup" onClick={() => this.Signupentry(item.id)}></Button>}
</Col> </Col>
</Row> </Row>
<p className={"mt20"}>{item.description}</p> <p className={"mt20"}>{item.description}</p>
</Card> </Card>
) )
}):"" }) : ""
} }
{/*教师身份*/} {/*教师身份*/}
{this.props.user&&this.props.user.admin===true?<style> {this.props.user && this.props.user.admin === true ? <style>
{ {
` `
.ant-col-pull-6 { .ant-col-pull-6 {
right: 17%; right: 17%;
} }
@ -382,61 +384,62 @@ class Osshackathon extends Component {
text-align: center; 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" > {data && data.hacks_count > 10 ? data && data.hacks.length === 0 ? "" : <div className="mb40 edu-txt-center padding20-30" >
<Pagination <Pagination
showQuickJumper showQuickJumper
defaultCurrent={1} defaultCurrent={1}
pageSize={10} pageSize={10}
total={data&&data.hacks_count} total={data && data.hacks_count}
current={page} current={page}
onChange={this.PaginationTask} onChange={this.PaginationTask}
/> />
</div>:""} </div> : ""}
</Spin> </Spin>
</div> </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 axios from 'axios'
import { commentHOC } from '../../comment/CommentsHOC' import commentHOC from '../../comment/CommentsHOC'
import ImageLayer from '../layers/ImageLayer' import ImageLayer from '../layers/ImageLayer'

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

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

File diff suppressed because it is too large Load Diff

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

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

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

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

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

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

@ -2,7 +2,7 @@ import React, { Component } from 'react';
import Comments from '../comment/Comments' import Comments from '../comment/Comments'
import { commentHOC } from '../comment/CommentsHOC' import commentHOC from '../comment/CommentsHOC'
import './TPMShixunDiscuss.css' 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 TPMNav from './component/TPMNav'
import Comments from '../comment/Comments' import Comments from '../comment/Comments'
import { commentHOC } from '../comment/CommentsHOC' import commentHOC from '../comment/CommentsHOC'
import Loading from '../../components/loading'; 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 axios from 'axios';
import {getUploadActionUrl} from 'educoder'; import { getUploadActionUrl } from 'educoder';
import './css/Newshixuns.css'; import './css/Newshixuns.css';
@ -32,7 +32,7 @@ class Newshixuns extends Component {
run_method: undefined, run_method: undefined,
postapplyvisible: undefined, postapplyvisible: undefined,
fileList: [], fileList: [],
Radiovalue:"1" Radiovalue: "1"
} }
} }
@ -103,15 +103,15 @@ class Newshixuns extends Component {
let Url = `/shixuns.json`; let Url = `/shixuns.json`;
axios.post(Url, { axios.post(Url, {
description: mdContnet, description: mdContnet,
main_type: values.main_type, main_type: values.main_type,
sub_type: values.sub_type, sub_type: values.sub_type,
shixun: { shixun: {
name: values.name, name: values.name,
trainee: values.select, trainee: values.select,
is_jupyter: values.is_jupyter === "2" ? true : false, is_jupyter: values.is_jupyter === "2" ? true : false,
}
} }
}
).then((response) => { ).then((response) => {
if (response.status === 200) { if (response.status === 200) {
window.location.href = "/shixuns/" + response.data.shixun_identifier + "/challenges"; window.location.href = "/shixuns/" + response.data.shixun_identifier + "/challenges";
@ -126,7 +126,7 @@ class Newshixuns extends Component {
loading: false loading: false
}) })
}) })
}else{ } else {
this.setState({ this.setState({
loading: false loading: false
}) })
@ -198,7 +198,7 @@ class Newshixuns extends Component {
sendsure_apply = () => { sendsure_apply = () => {
let {language, runtime, run_method} = this.state; let { language, runtime, run_method } = this.state;
if (!language || language === "") { if (!language || language === "") {
// this.props.showNotification(`请填写该镜像是基于什么语言`); // this.props.showNotification(`请填写该镜像是基于什么语言`);
@ -326,7 +326,7 @@ class Newshixuns extends Component {
// 附件相关 START // 附件相关 START
handleChange = (info) => { handleChange = (info) => {
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') { 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') { if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
console.log("handleChange1"); console.log("handleChange1");
@ -369,7 +369,7 @@ class Newshixuns extends Component {
axios.delete(url, {}) axios.delete(url, {})
.then((response) => { .then((response) => {
if (response.data) { if (response.data) {
const {status} = response.data; const { status } = response.data;
if (status == 0) { if (status == 0) {
// console.log('--- success') // console.log('--- success')
@ -392,8 +392,8 @@ class Newshixuns extends Component {
} }
render() { render() {
const {getFieldDecorator} = this.props.form; const { getFieldDecorator } = this.props.form;
const {newshixunlist, fileList, postapplytitle, postapplyvisible} = this.state; const { newshixunlist, fileList, postapplytitle, postapplyvisible } = this.state;
const uploadProps = { const uploadProps = {
width: 600, width: 600,
fileList, fileList,
@ -452,11 +452,11 @@ class Newshixuns extends Component {
<span className="fl font-18 lineh-35">新建实训项目</span> <span className="fl font-18 lineh-35">新建实训项目</span>
{this.props.user && this.props.user.main_site === true ? {this.props.user && this.props.user.main_site === true ?
<a className="fr font-16 mt3 color-blue" href="/forums/2943" <a className="fr font-16 mt3 color-blue" href="/forums/2943"
target="_blank">实训制作指南</a> : ""} target="_blank">实训制作指南</a> : ""}
</div> </div>
<div className="padding10-20 color-grey-3 clearfix"> <div className="padding10-20 color-grey-3 clearfix">
<Form> <Form>
<Form.Item label="实训类型"> <Form.Item label="实训类型">
{getFieldDecorator('is_jupyter')( {getFieldDecorator('is_jupyter')(
<Radio.Group onChange={this.RadiovalueonChange} value={this.state.Radiovalue}> <Radio.Group onChange={this.RadiovalueonChange} value={this.state.Radiovalue}>
<Radio value="1">普通实训</Radio> <Radio value="1">普通实训</Radio>
@ -478,37 +478,37 @@ class Newshixuns extends Component {
}], }],
})( })(
<Input placeholder="请输入名称最大限制60个字符" <Input placeholder="请输入名称最大限制60个字符"
className={"input-100-45 greyInput"} className={"input-100-45 greyInput"}
onInput={this.shixunNameInput} autoComplete="off" onInput={this.shixunNameInput} autoComplete="off"
addonAfter={`${String(!this.state.shixunName ? 0 : this.state.shixunName.length)}/${this.state.NAME_COUNT}`} addonAfter={`${String(!this.state.shixunName ? 0 : this.state.shixunName.length)}/${this.state.NAME_COUNT}`}
className="newViewAfter"/> className="newViewAfter" />
)} )}
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="简介" label="简介"
style={{"borderBottom": 'none'}} style={{ "borderBottom": 'none' }}
className="chooseDes pr" className="chooseDes pr"
> >
<TPMMDEditor ref={this.contentMdRef} placeholder="请输入简介" mdID={'courseContentMD'} <TPMMDEditor ref={this.contentMdRef} placeholder="请输入简介" mdID={'courseContentMD'}
refreshTimeout={1500} refreshTimeout={1500}
className="courseMessageMD" className="courseMessageMD"
// initValue={this.state.description === null ? "" : this.state.description} // initValue={this.state.description === null ? "" : this.state.description}
></TPMMDEditor> ></TPMMDEditor>
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label={"难易度"} label={"难易度"}
style={{"borderBottom": 'none'}} style={{ "borderBottom": 'none' }}
className="chooseDes pr" className="chooseDes pr"
> >
{getFieldDecorator('select', { {getFieldDecorator('select', {
rules: [{required: true, message: '请选择难易度'}], rules: [{ required: true, message: '请选择难易度' }],
})( })(
<div className="with15 fl pr"> <div className="with15 fl pr">
<Select placeholder="请选择难易度" <Select placeholder="请选择难易度"
style={{width: 180}} style={{ width: 180 }}
onChange={this.Selectthestudent} onChange={this.Selectthestudent}
> >
<Option value={1}>初级</Option> <Option value={1}>初级</Option>
<Option value={2}>中级</Option> <Option value={2}>中级</Option>
@ -524,52 +524,52 @@ class Newshixuns extends Component {
<Form.Item <Form.Item
label={"实验环境"} label={"实验环境"}
style={{"borderBottom": 'none', 'width': '18%', 'float': 'left'}} style={{ "borderBottom": 'none', 'width': '18%', 'float': 'left' }}
className="chooseDes pr" className="chooseDes pr"
> >
<div> <div>
{getFieldDecorator('main_type', { {getFieldDecorator('main_type', {
rules: [{required: true, message: '请选择主类别'}], rules: [{ required: true, message: '请选择主类别' }],
})( })(
<div className="width100 fl mr20"> <div className="width100 fl mr20">
<Select placeholder="请选择主类别" <Select placeholder="请选择主类别"
style={{width: 180}} style={{ width: 180 }}
onChange={this.main_type} onChange={this.main_type}
defaultOpen={false} defaultOpen={false}
> >
{ {
newshixunlist === undefined ? "" : this.state.Radiovalue==="2"?newshixunlist.main_type.map((item, key) => { newshixunlist === undefined ? "" : this.state.Radiovalue === "2" ? newshixunlist.main_type.map((item, key) => {
let itemtype=item.type_name.toLowerCase().indexOf('jupyter'.toLowerCase()) let itemtype = item.type_name.toLowerCase().indexOf('jupyter'.toLowerCase())
if(itemtype>-1){ if (itemtype > -1) {
return ( return (
<Option value={item.id} key={key} name={item.description}> <Option value={item.id} key={key} name={item.description}>
<Tooltip placement="right" <Tooltip placement="right"
title={item.description === "" ? "无描述" : item.description}> title={item.description === "" ? "无描述" : item.description}>
{item.type_name} {item.type_name}
</Tooltip> </Tooltip>
</Option> </Option>
) )
} }
}):"" }) : ""
} }
{ {
newshixunlist === undefined ? "" : this.state.Radiovalue==="1"?newshixunlist.main_type.map((item, key) => { newshixunlist === undefined ? "" : this.state.Radiovalue === "1" ? newshixunlist.main_type.map((item, key) => {
let itemtype=item.type_name.toLowerCase().indexOf('jupyter'.toLowerCase()) let itemtype = item.type_name.toLowerCase().indexOf('jupyter'.toLowerCase())
if(itemtype===-1){ if (itemtype === -1) {
return ( return (
<Option value={item.id} key={key} name={item.description}> <Option value={item.id} key={key} name={item.description}>
<Tooltip placement="right" <Tooltip placement="right"
title={item.description === "" ? "无描述" : item.description}> title={item.description === "" ? "无描述" : item.description}>
{item.type_name} {item.type_name}
</Tooltip> </Tooltip>
</Option> </Option>
) )
} }
}):"" }) : ""
} }
</Select> </Select>
@ -588,25 +588,25 @@ class Newshixuns extends Component {
} }
</style> </style>
<Form.Item <Form.Item
style={{"borderBottom": 'none', 'width': '82%', 'float': 'left', 'marginTop': '40px'}} style={{ "borderBottom": 'none', 'width': '82%', 'float': 'left', 'marginTop': '40px' }}
className="chooseDes pr" className="chooseDes pr"
> >
<div className=" fl pr mr20"> <div className=" fl pr mr20">
{getFieldDecorator('sub_type')( {getFieldDecorator('sub_type')(
<div className=" fl pr mr20"> <div className=" fl pr mr20">
<Select placeholder="请选择小类别" <Select placeholder="请选择小类别"
mode="multiple" mode="multiple"
style={{width: 280}} style={{ width: 280 }}
onChange={this.sub_type} onChange={this.sub_type}
defaultOpen={false} defaultOpen={false}
className={"Selectlittle"} className={"Selectlittle"}
> >
{ {
newshixunlist === undefined ? "" : newshixunlist.small_type.map((item, key) => { newshixunlist === undefined ? "" : newshixunlist.small_type.map((item, key) => {
return ( return (
<Option value={item.id} key={key} name={item.description}> <Option value={item.id} key={key} name={item.description}>
<Tooltip placement="right" <Tooltip placement="right"
title={item.description === "" ? "无描述" : item.description}> title={item.description === "" ? "无描述" : item.description}>
{item.type_name} {item.type_name}
</Tooltip> </Tooltip>
</Option> </Option>
@ -617,17 +617,17 @@ class Newshixuns extends Component {
</div> </div>
)} )}
<span className="fl ml20 color-grey lineh-20"> <span className="fl ml20 color-grey lineh-20">
<div> <div>
{this.state.mainvalues === undefined && this.state.subvalues === undefined || this.state.mainvalues === "" && this.state.subvalues === "" ? "" : {this.state.mainvalues === undefined && this.state.subvalues === undefined || this.state.mainvalues === "" && this.state.subvalues === "" ? "" :
<div className={"font-12"} style={{'max-width': '600px'}}> <div className={"font-12"} style={{ 'max-width': '600px' }}>
{`${this.state.mainvalues === undefined || this.state.mainvalues === "" ? "" : this.state.mainvalues}`} {`${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.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 === 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 : this.state.subvalues}`}
</div>} </div>}
</div> </div>
</span> </span>
</div> </div>
</Form.Item> </Form.Item>
@ -663,7 +663,7 @@ class Newshixuns extends Component {
className="color-red fl mt3">*</span>&nbsp;&nbsp;</label> className="color-red fl mt3">*</span>&nbsp;&nbsp;</label>
<textarea <textarea
className={this.state.languagewritetype === true ? "fl task-form-80 task-height-150 bor-reds" : "fl task-form-80 task-height-150"} 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} onInput={this.setlanguage}
value={this.state.language} value={this.state.language}
placeholder="请填写该镜像是基于什么语言示例Python" placeholder="请填写该镜像是基于什么语言示例Python"
@ -677,7 +677,7 @@ class Newshixuns extends Component {
<textarea <textarea
className={this.state.systemenvironmenttype === true ? "fl task-form-80 task-height-150 bor-reds" : "fl task-form-80 task-height-150"} className={this.state.systemenvironmenttype === true ? "fl task-form-80 task-height-150 bor-reds" : "fl task-form-80 task-height-150"}
onInput={this.setruntime} onInput={this.setruntime}
style={{height: '100px'}} style={{ height: '100px' }}
value={this.state.runtime} value={this.state.runtime}
placeholder="请填写该镜像是基于什么linux系统环境,代码运行环境" placeholder="请填写该镜像是基于什么linux系统环境,代码运行环境"
id="demand_info"></textarea> 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"} 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} onInput={this.setrun_method}
value={this.state.run_method} value={this.state.run_method}
style={{height: '100px'}} style={{ height: '100px' }}
placeholder="请填写该镜像中测试代码运行方式" placeholder="请填写该镜像中测试代码运行方式"
id="demand_info"></textarea> id="demand_info"></textarea>
</li> </li>
@ -718,10 +718,10 @@ class Newshixuns extends Component {
</div> </div>
<li className="edu-txt-center clearfix "> <li className="edu-txt-center clearfix ">
<a className="pop_close task-btn mr30" <a className="pop_close task-btn mr30"
onClick={() => this.sendhideModaly()} onClick={() => this.sendhideModaly()}
>取消</a> >取消</a>
<Button type="primary" onClick={() => this.sendsure_apply()} <Button type="primary" onClick={() => this.sendsure_apply()}
className="task-btn task-btn-orange">确定</Button> className="task-btn task-btn-orange">确定</Button>
</li> </li>
<div className="cl"></div> <div className="cl"></div>
</div> </div>
@ -733,14 +733,14 @@ class Newshixuns extends Component {
</div> </div>
</div> </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> </div>
); );
} }
} }
const NewshixunsNew = Form.create({name: 'newshixun'})(Newshixuns); const NewshixunsNew = Form.create({ name: 'newshixun' })(Newshixuns);
export default SnackbarHOC()(TPMIndexHOC(NewshixunsNew)); 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 React, { Component } from 'react';
import { Redirect } from 'react-router'; 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'; import { Switch } from 'antd';
@ -9,15 +9,15 @@ import PropTypes from 'prop-types';
import classNames from 'classnames' import classNames from 'classnames'
import { TPMIndexHOC } from '../TPMIndexHOC' import TPMIndexHOC from '../TPMIndexHOC'
import { SnackbarHOC } from 'educoder' import { SnackbarHOC } from 'educoder'
import ShixunCard from '.././shixuns/ShixunCard'; 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'; import 'antd/lib/rate/style/index.css';
@ -29,41 +29,41 @@ class Shixunforklist extends Component {
this.state = { this.state = {
} }
} }
handleChange = (value) => { handleChange = (value) => {
console.log('Page: ', value); console.log('Page: ', value);
// this.setState({ value }); // this.setState({ value });
} }
//JSX //JSX
render() { render() {
const { match, history } = this.props const { match, history } = this.props
return ( return (
<div className="newMain clearfix"> <div className="newMain clearfix">
<div className="educontent"> <div className="educontent">
<div className="edu-back-white padding20 clearfix mb20 mt30"> <div className="edu-back-white padding20 clearfix mb20 mt30">
<span className="fl font-16">Fork实训列表</span> <span className="fl font-16">Fork实训列表</span>
<Link to="/shixunchild" className="font-16 color-grey-9 fr">返回</Link> <Link to="/shixunchild" className="font-16 color-grey-9 fr">返回</Link>
</div> </div>
<ShixunCard/> <ShixunCard />
<div className="educontent edu-txt-center mb80"> <div className="educontent edu-txt-center mb80">
<div className="inline pages_user_show"> <div className="inline pages_user_show">
<ul> <ul>
</ul> </ul>
<div className="cl"></div> <div className="cl"></div>
</div> </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 { Spin } from 'antd';
import { TPMIndexHOC } from '../TPMIndexHOC'; import TPMIndexHOC from '../TPMIndexHOC';
import { SnackbarHOC } from 'educoder'; import { SnackbarHOC } from 'educoder';
@ -27,89 +27,89 @@ const $ = window.$;
class ShixunsIndex extends Component { class ShixunsIndex extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state={ this.state = {
order_by: "new", order_by: "new",
page:1, page: 1,
limit:16, limit: 16,
keyword:"", keyword: "",
status:0, status: 0,
diff:0, diff: 0,
tag_level: 1, tag_level: 1,
tag_id:'', tag_id: '',
middleshixundata:[], middleshixundata: [],
typepvisible:true, typepvisible: true,
pages:1, pages: 1,
search_tags:null, search_tags: null,
parsedid:undefined, parsedid: undefined,
newtag_level:undefined, newtag_level: undefined,
newpalce:undefined, newpalce: undefined,
sort:"desc" sort: "desc"
} }
} }
componentDidMount(){ componentDidMount() {
const upsystem=`/users/system_update.json`; const upsystem = `/users/system_update.json`;
axios.get(upsystem).then((response)=>{ axios.get(upsystem).then((response) => {
let updata=response.data; let updata = response.data;
this.setState({ this.setState({
updata:updata updata: updata
}) })
}).catch((error)=>{ }).catch((error) => {
console.log(error); console.log(error);
}) })
let _keyword; let _keyword;
if (window.__headSearchKeyword) { if (window.__headSearchKeyword) {
this.setState({ keyword: window.__headSearchKeyword }) this.setState({ keyword: window.__headSearchKeyword })
_keyword = window.__headSearchKeyword _keyword = window.__headSearchKeyword
delete window.__headSearchKeyword delete window.__headSearchKeyword
} }
const parsed = queryString.parse(this.props.location.search); const parsed = queryString.parse(this.props.location.search);
if(parsed.id===undefined&&parsed.type===undefined){ if (parsed.id === undefined && parsed.type === undefined) {
let {order_by, tag_level, tag_id, page, limit, keyword, status, diff} = this.state; let { order_by, tag_level, tag_id, page, limit, keyword, status, diff } = this.state;
let params={ let params = {
order_by:order_by, order_by: order_by,
tag_level:tag_level, tag_level: tag_level,
tag_id:tag_id, tag_id: tag_id,
page:page, page: page,
limit:limit, limit: limit,
keyword: _keyword || keyword , keyword: _keyword || keyword,
status:status, status: status,
diff:diff, diff: diff,
sort: "desc" sort: "desc"
} }
this.shixunresultend(params); this.shixunresultend(params);
}else{ } else {
let {order_by,page, limit, keyword, status, diff} = this.state; let { order_by, page, limit, keyword, status, diff } = this.state;
let nawparsed=parsed.type; let nawparsed = parsed.type;
let newpalce=parsed.palce; let newpalce = parsed.palce;
if(nawparsed==="rep"){ if (nawparsed === "rep") {
nawparsed=1 nawparsed = 1
} }
else if(nawparsed==="sub"){ else if (nawparsed === "sub") {
nawparsed=2 nawparsed = 2
}else if(nawparsed==="tag"){ } else if (nawparsed === "tag") {
nawparsed=3 nawparsed = 3
} }
let params={ let params = {
order_by:order_by, order_by: order_by,
tag_level:nawparsed, tag_level: nawparsed,
tag_id:parsed.id, tag_id: parsed.id,
page:page, page: page,
limit:limit, limit: limit,
keyword: _keyword || keyword, keyword: _keyword || keyword,
status:status, status: status,
diff:diff, diff: diff,
sort: "desc" sort: "desc"
} }
this.setState({ this.setState({
parsedid:parsed.id, parsedid: parsed.id,
newtag_level:nawparsed, newtag_level: nawparsed,
tag_level:nawparsed, tag_level: nawparsed,
newpalce:newpalce, newpalce: newpalce,
tag_id:parsed.id, tag_id: parsed.id,
keyword: _keyword || keyword, keyword: _keyword || keyword,
}) })
this.shixunresultend(params); this.shixunresultend(params);
@ -117,221 +117,221 @@ class ShixunsIndex extends Component {
} }
allUpdatashixunlist=()=>{ allUpdatashixunlist = () => {
let{sort,order_by}=this.state; let { sort, order_by } = this.state;
this.setState({ this.setState({
tag_level: 1, tag_level: 1,
tag_id:'', tag_id: '',
page: 1, page: 1,
limit: 16, limit: 16,
keyword:'', keyword: '',
status: 0, status: 0,
diff: 0, diff: 0,
}) })
let params={ let params = {
order_by:order_by, order_by: order_by,
tag_level: 1, tag_level: 1,
tag_id:'', tag_id: '',
page: 1, page: 1,
limit: 16, limit: 16,
keyword:'', keyword: '',
status: 0, status: 0,
diff: 0, diff: 0,
sort:sort sort: sort
} }
this.shixunresultend(params) this.shixunresultend(params)
} }
Updatasearchlist=(value)=>{ Updatasearchlist = (value) => {
if (value[1].tag_id === " ") { if (value[1].tag_id === " ") {
this.setState({ this.setState({
keyword: "" keyword: ""
}) })
} }
this.setState({ this.setState({
tag_level:value[0].tag_level, tag_level: value[0].tag_level,
tag_id:value[1].tag_id, tag_id: value[1].tag_id,
typepvisible:true typepvisible: true
}) })
let {order_by, sort, limit, keyword, status, diff} = this.state; let { order_by, sort, limit, keyword, status, diff } = this.state;
let params={ let params = {
order_by:order_by, order_by: order_by,
tag_level:value[0].tag_level, tag_level: value[0].tag_level,
tag_id:value[1].tag_id, tag_id: value[1].tag_id,
page:1, page: 1,
limit:limit, limit: limit,
keyword:keyword, keyword: keyword,
status:status, status: status,
diff:diff, diff: diff,
sort:sort sort: sort
} }
this.shixunresultend(params) this.shixunresultend(params)
} }
StatusEnquiry=(key)=>{ StatusEnquiry = (key) => {
let Vrl=`/shixuns.json`; let Vrl = `/shixuns.json`;
let newstatus; let newstatus;
let newdiff; let newdiff;
if(key[0].type===1){ if (key[0].type === 1) {
this.setState({ this.setState({
status: key[1].value, status: key[1].value,
typepvisible:true typepvisible: true
}) })
newstatus=key[1].value; newstatus = key[1].value;
newdiff=this.state.diff; newdiff = this.state.diff;
}else if(key[0].type===2){ } else if (key[0].type === 2) {
this.setState({ this.setState({
diff: key[1].value, diff: key[1].value,
typepvisible:true typepvisible: true
}) })
newdiff=key[1].value; newdiff = key[1].value;
newstatus=this.state.status; newstatus = this.state.status;
} }
let params= { let params = {
order_by:this.state.order_by, order_by: this.state.order_by,
tag_level:this.state.tag_level, tag_level: this.state.tag_level,
tag_id:this.state.tag_id, tag_id: this.state.tag_id,
page:1, page: 1,
limit:this.state.limit, limit: this.state.limit,
keyword:this.state.keyword, keyword: this.state.keyword,
status:newstatus, status: newstatus,
diff:newdiff, diff: newdiff,
} }
this.shixunresultend(params) this.shixunresultend(params)
} }
OnSearchInput=(value,type)=>{ OnSearchInput = (value, type) => {
if(type===true){ if (type === true) {
this.setState({ this.setState({
keyword:value, keyword: value,
typepvisible:true, typepvisible: true,
pages:1 pages: 1
}) })
let {order_by, tag_level, tag_id, sort, limit, status, diff} = this.state; let { order_by, tag_level, tag_id, sort, limit, status, diff } = this.state;
let params= { let params = {
order_by:order_by, order_by: order_by,
tag_level:tag_level, tag_level: tag_level,
tag_id:tag_id, tag_id: tag_id,
page:1, page: 1,
limit:limit, limit: limit,
keyword:value, keyword: value,
status:status, status: status,
diff:diff, diff: diff,
sort:sort 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 //types
this.setState({ this.setState({
order_by:"mine", order_by: "mine",
typepvisible:true, typepvisible: true,
pages:1, pages: 1,
}) })
let{tag_level,tag_id,page,limit,keyword,status,diff,sort}=this.state; let { tag_level, tag_id, page, limit, keyword, status, diff, sort } = this.state;
let newsort=sort; let newsort = sort;
if(newsort===undefined){ if (newsort === undefined) {
newsort="desc" newsort = "desc"
} }
let params= { let params = {
order_by:"mine", order_by: "mine",
tag_level:tag_level, tag_level: tag_level,
tag_id:tag_id, tag_id: tag_id,
page:1, page: 1,
limit:limit, limit: limit,
keyword:keyword, keyword: keyword,
status:status, status: status,
diff:diff, diff: diff,
sort:newsort sort: newsort
} }
this.shixunresultend(params) this.shixunresultend(params)
} }
shixunsPage=(value)=>{ shixunsPage = (value) => {
this.setState({ this.setState({
page:value, page: value,
typepvisible:true, typepvisible: true,
pages:value pages: value
}) })
let {order_by, tag_level, tag_id, limit, keyword, status, diff,sort} = this.state; let { order_by, tag_level, tag_id, limit, keyword, status, diff, sort } = this.state;
let params= { let params = {
order_by:order_by, order_by: order_by,
tag_level:tag_level, tag_level: tag_level,
tag_id:tag_id, tag_id: tag_id,
page:value, page: value,
limit:limit, limit: limit,
keyword:keyword, keyword: keyword,
status:status, status: status,
diff:diff, diff: diff,
sort:sort sort: sort
} }
let Url=`/shixuns.json`; let Url = `/shixuns.json`;
axios.get(Url,{ axios.get(Url, {
params params
}).then((response)=> { }).then((response) => {
if(response.status===200){ if (response.status === 200) {
this.setState({ this.setState({
middleshixundata: response.data, middleshixundata: response.data,
typepvisible:false, typepvisible: false,
}); });
} }
}).catch((error)=>{ }).catch((error) => {
console.log(error) console.log(error)
}); });
} }
ShixunsState=(val,type,sorts)=>{ ShixunsState = (val, type, sorts) => {
// sort, // sort,
let {tag_level, tag_id, page, limit, keyword, status, diff,sort} = this.state; let { tag_level, tag_id, page, limit, keyword, status, diff, sort } = this.state;
let newsort=sorts?sorts:sort; let newsort = sorts ? sorts : sort;
this.setState({ this.setState({
order_by:type, order_by: type,
typepvisible:true, typepvisible: true,
pages:1, pages: 1,
sort:sorts?sorts:sort sort: sorts ? sorts : sort
}) })
let params let params
// let vals=false // let vals=false
if(newsort===undefined){ if (newsort === undefined) {
newsort="desc" newsort = "desc"
}else{ } else {
newsort=sorts?sorts:sort newsort = sorts ? sorts : sort
} }
params= { params = {
order_by:type, order_by: type,
tag_level:tag_level, tag_level: tag_level,
tag_id:tag_id, tag_id: tag_id,
page:1, page: 1,
limit:limit, limit: limit,
keyword:keyword, keyword: keyword,
status:status, status: status,
diff:diff, diff: diff,
sort:newsort sort: newsort
} }
this.shixunresultend(params) this.shixunresultend(params)
} }
Shixunsupcircles=(sort)=>{ Shixunsupcircles = (sort) => {
console.log(sort) console.log(sort)
this.setState({ this.setState({
sort:sort sort: sort
}) })
let { let {
order_by, order_by,
@ -345,16 +345,16 @@ class ShixunsIndex extends Component {
let params= { let params = {
order_by:order_by, order_by: order_by,
tag_level:tag_level, tag_level: tag_level,
tag_id:tag_id, tag_id: tag_id,
page:1, page: 1,
limit:limit, limit: limit,
keyword:keyword, keyword: keyword,
status:status, status: status,
diff:diff, diff: diff,
sort:sort sort: sort
} }
this.shixunresultend(params) this.shixunresultend(params)
} }
@ -362,69 +362,69 @@ class ShixunsIndex extends Component {
shixunresultend=(params)=>{ shixunresultend = (params) => {
let Url=`/shixuns.json`; let Url = `/shixuns.json`;
axios.get(Url,{ axios.get(Url, {
params params
}).then((response)=> { }).then((response) => {
// TODO 有keyword返回值时 显示一共有多少条记录 // TODO 有keyword返回值时 显示一共有多少条记录
if(response.status===200){ if (response.status === 200) {
this.setState({ this.setState({
search_tags:response.data.search_tags, search_tags: response.data.search_tags,
middleshixundata: response.data, middleshixundata: response.data,
typepvisible:false, typepvisible: false,
pages:1 pages: 1
}); });
} }
}).catch((error)=>{ }).catch((error) => {
console.log(error) console.log(error)
}); });
} }
render() { 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) // console.log(this.state.updata)
return ( return (
<div className="newMain clearfix backFAFAFA"> <div className="newMain clearfix backFAFAFA">
{this.state.updata===undefined?"":<UpgradeModals {this.state.updata === undefined ? "" : <UpgradeModals
{...this.state} {...this.state}
/>} />}
{/*<Spin spinning={typepvisible} size="large" style={{marginTop:'15%'}}>*/} {/*<Spin spinning={typepvisible} size="large" style={{marginTop:'15%'}}>*/}
<ShixunSearchBar <ShixunSearchBar
Updatasearchlist={this.Updatasearchlist.bind(this)} Updatasearchlist={this.Updatasearchlist.bind(this)}
allUpdatashixunlist={this.allUpdatashixunlist} allUpdatashixunlist={this.allUpdatashixunlist}
StatusEnquiry={this.StatusEnquiry.bind(this)} StatusEnquiry={this.StatusEnquiry.bind(this)}
OnSearchInput={this.OnSearchInput.bind(this)} OnSearchInput={this.OnSearchInput.bind(this)}
keyword={keyword} keyword={keyword}
parsedid={parsedid} parsedid={parsedid}
newtag_level={newtag_level} newtag_level={newtag_level}
newpalce={newpalce} newpalce={newpalce}
{...this.props} {...this.props}
{...this.state} {...this.state}
/> />
<ShixunCardList <ShixunCardList
ShixunsState={this.ShixunsState.bind(this)} ShixunsState={this.ShixunsState.bind(this)}
ShixunsSwitch={this.ShixunsSwitch.bind(this)} ShixunsSwitch={this.ShixunsSwitch.bind(this)}
Shixunsupcircles={this.Shixunsupcircles.bind(this)} Shixunsupcircles={this.Shixunsupcircles.bind(this)}
allUpdatashixunlist={this.allUpdatashixunlist} allUpdatashixunlist={this.allUpdatashixunlist}
{...this.props} {...this.props}
{...this.state} {...this.state}
OnSearchInput={this.OnSearchInput.bind(this)} OnSearchInput={this.OnSearchInput.bind(this)}
/> />
{/*下方图片*/} {/*下方图片*/}
<ShixunCard <ShixunCard
typepvisible={typepvisible} typepvisible={typepvisible}
middleshixundata={middleshixundata.shixuns} middleshixundata={middleshixundata.shixuns}
totalcount={middleshixundata.total_count} totalcount={middleshixundata.total_count}
pagination={middleshixundata.pagination} pagination={middleshixundata.pagination}
pages={pages} pages={pages}
shixunsPage={this.shixunsPage.bind(this)} shixunsPage={this.shixunsPage.bind(this)}
/> />
{/*</Spin>*/} {/*</Spin>*/}
</div> </div>
); );
} }
} }
export default SnackbarHOC() (TPMIndexHOC ( ShixunsIndex )); export default SnackbarHOC()(TPMIndexHOC(ShixunsIndex));

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

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

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

@ -1,11 +1,10 @@
import React, { Component } from 'react'; 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 { Breadcrumb } from 'antd';
import { SnackbarHOC } from 'educoder'; import { SnackbarHOC } from 'educoder';
import { TPMIndexHOC } from '../../../tpm/TPMIndexHOC'; import TPMIndexHOC from '../../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../../courses/common/CNotificationHOC' import CNotificationHOC from '../../../courses/common/CNotificationHOC'
import "../usersInfo.css" import "../usersInfo.css"
import "../../../courses/css/members.css" import "../../../courses/css/members.css"
@ -16,77 +15,77 @@ import Loading from '../../../../Loading';
// 毕设选题 // 毕设选题
const GtopicBanks = Loadable({ const GtopicBanks = Loadable({
loader: () => import('./GtopicBanks'), loader: () => import('./GtopicBanks'),
loading: Loading, loading: Loading,
}) })
const BanksTabIndex = Loadable({ const BanksTabIndex = Loadable({
loader: () => import('./BanksTabIndex'), loader: () => import('./BanksTabIndex'),
loading: Loading, loading: Loading,
}) })
const GtopicBanksEdit = Loadable({ const GtopicBanksEdit = Loadable({
loader: () => import('./GtopicBanksEdit'), loader: () => import('./GtopicBanksEdit'),
loading: Loading, loading: Loading,
}) })
const HomeworkBanksEdit = Loadable({ const HomeworkBanksEdit = Loadable({
loader: () => import('./HomeworkBanksEdit'), loader: () => import('./HomeworkBanksEdit'),
loading: Loading, loading: Loading,
}); });
const ExerciseBanksEdit = Loadable({ const ExerciseBanksEdit = Loadable({
loader: () => import('./ExerciseBanksEdit'), loader: () => import('./ExerciseBanksEdit'),
loading: Loading, loading: Loading,
}); });
//普通作业题库详情 //普通作业题库详情
const Generaljobbankdetails =Loadable({ const Generaljobbankdetails = Loadable({
loader: () => import('../../../courses/questionbank/Generaljobbankdetails'), loader: () => import('../../../courses/questionbank/Generaljobbankdetails'),
loading: Loading, loading: Loading,
}); });
//分组作业题库详情 //分组作业题库详情
const GroupjobbankPage =Loadable({ const GroupjobbankPage = Loadable({
loader: () => import('../../../courses/groupjobbank/GroupjobbankPage'), loader: () => import('../../../courses/groupjobbank/GroupjobbankPage'),
loading: Loading, loading: Loading,
}); });
//毕设选题详情 //毕设选题详情
const CompletetopicdePage =Loadable({ const CompletetopicdePage = Loadable({
loader: () => import('../../../courses/comtopicdetails/CompletetopicdePage'), loader: () => import('../../../courses/comtopicdetails/CompletetopicdePage'),
loading: Loading, loading: Loading,
}); });
//毕设任务详情 //毕设任务详情
const Completetaskpage =Loadable({ const Completetaskpage = Loadable({
loader: () => import('../../../courses/completetaskdetails/Completetaskpage'), loader: () => import('../../../courses/completetaskdetails/Completetaskpage'),
loading: Loading, loading: Loading,
}); });
//问卷编辑 //问卷编辑
const PollNewQuestbank =Loadable({ const PollNewQuestbank = Loadable({
loader: () => import('../../../courses/poll/PollNewQuestbank'), loader: () => import('../../../courses/poll/PollNewQuestbank'),
loading: Loading, loading: Loading,
}); });
const GtaskBanksEdit = Loadable({ const GtaskBanksEdit = Loadable({
loader: () => import('./GtaskBanksEdit'), loader: () => import('./GtaskBanksEdit'),
loading: Loading, loading: Loading,
}) })
class BanksIndex extends Component{ class BanksIndex extends Component {
constructor(props){ constructor(props) {
super(props); super(props);
this.state={ this.state = {
crumbData:undefined, crumbData: undefined,
publicly:undefined publicly: undefined
} }
} }
componentDidMount = () =>{ componentDidMount = () => {
// let pathname = this.props.location.pathname; // let pathname = this.props.location.pathname;
// this.setState({ // this.setState({
// publicly:pathname.indexOf("/publicly") > -1 // publicly:pathname.indexOf("/publicly") > -1
// }) // })
} }
initPublic = (crumbData,data) =>{ initPublic = (crumbData, data) => {
if(data && data.status && data.status == -2){ if (data && data.status && data.status == -2) {
this.props.history.push(`/topicbank/publicly`); this.props.history.push(`/topicbank/publicly`);
} }
this.setState({ this.setState({
@ -94,8 +93,8 @@ class BanksIndex extends Component{
}) })
} }
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
// if(prevProps.current_user!=this.props.current_user){ // if(prevProps.current_user!=this.props.current_user){
// let { publicly }=this.state; // let { publicly }=this.state;
// if( this.props.checkIfLogin()) { // if( this.props.checkIfLogin()) {
// if (this.props.current_user && this.props.current_user.professional_certification == false && publicly){ // if (this.props.current_user && this.props.current_user.professional_certification == false && publicly){
@ -116,57 +115,57 @@ class BanksIndex extends Component{
// } // }
} }
render(){ render() {
let { crumbData }=this.state let { crumbData } = this.state
const common = { const common = {
initPublic:this.initPublic initPublic: this.initPublic
} }
return( return (
<div className="newMain"> <div className="newMain">
<div className="educontent"> <div className="educontent">
{ {
crumbData && crumbData &&
<Breadcrumb separator=">" className="breadcrumb mt22"> <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)=>{ crumbData.crumbArray && crumbData.crumbArray.map((item, key) => {
return( return (
<Breadcrumb.Item key={key} href={item.to || ""}>{item.content}</Breadcrumb.Item> <Breadcrumb.Item key={key} href={item.to || ""}>{item.content}</Breadcrumb.Item>
) )
}) })
} }
</Breadcrumb> </Breadcrumb>
} }
{ {
crumbData &&<p className="clearfix mt15 mb10 "> 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> <span className="fl font-24 color-grey-3 task-hide lineh-30" style={{ maxWidth: '800px' }}>{crumbData && crumbData.title}</span>
{ crumbData.is_public == true ? {crumbData.is_public == true ?
<span className="bank_is_public">公开</span> <span className="bank_is_public">公开</span>
: :
<span className="bank_is_private">私有</span> <span className="bank_is_private">私有</span>
} }
</p> } </p>}
<Switch {...this.props}> <Switch {...this.props}>
{/*毕设任务编辑*/} {/*毕设任务编辑*/}
<Route path='/banks/gtask/:workId/edit/:type' <Route path='/banks/gtask/:workId/edit/:type'
render={ render={
(props) => { (props) => {
return (<GtaskBanksEdit {...this.props} {...props} {...this.state} {...common}/>) return (<GtaskBanksEdit {...this.props} {...props} {...this.state} {...common} />)
} }
}></Route> }></Route>
<Route path='/banks/normal/:workId/edit/:type' <Route path='/banks/normal/:workId/edit/:type'
render={ render={
(props) => { (props) => {
return (<HomeworkBanksEdit {...this.props} {...props} {...this.state} {...common} return (<HomeworkBanksEdit {...this.props} {...props} {...this.state} {...common}
isGroup={false} isGroup={false}
/>) />)
} }
}></Route> }></Route>
<Route path='/banks/group/:workId/edit/:type' <Route path='/banks/group/:workId/edit/:type'
render={ render={
(props) => { (props) => {
@ -174,7 +173,7 @@ class BanksIndex extends Component{
isGroup={true} isGroup={true}
/>) />)
} }
}></Route> }></Route>
<Route path='/banks/exercise/:Id/edit/:type' <Route path='/banks/exercise/:Id/edit/:type'
render={ render={
@ -182,23 +181,23 @@ class BanksIndex extends Component{
return (<ExerciseBanksEdit {...this.props} {...props} {...this.state} {...common} return (<ExerciseBanksEdit {...this.props} {...props} {...this.state} {...common}
/>) />)
} }
}></Route> }></Route>
<Route path='/banks/gtopic/:bankId/edit/:type' <Route path='/banks/gtopic/:bankId/edit/:type'
render={ render={
(props) => { (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" <Route path="/banks/poll/:workid/edit/:type"
render={ render={
(props) => (<PollNewQuestbank {...this.props} {...props} {...this.state} {...common} />) (props) => (<PollNewQuestbank {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
<Route path='/banks/poll/:bankId/:type' <Route path='/banks/poll/:bankId/:type'
@ -206,37 +205,37 @@ class BanksIndex extends Component{
(props) => { (props) => {
return (<BanksTabIndex {...this.props} {...props} {...this.state} {...common} />) return (<BanksTabIndex {...this.props} {...props} {...this.state} {...common} />)
} }
}></Route> }></Route>
<Route path='/banks/exercise/:Id/:type' <Route path='/banks/exercise/:Id/:type'
render={ render={
(props) => { (props) => {
return (<BanksTabIndex {...this.props} {...props} {...this.state} {...common} return (<BanksTabIndex {...this.props} {...props} {...this.state} {...common}
/>) />)
} }
}></Route> }></Route>
{/*毕设任务题库详情*/} {/*毕设任务题库详情*/}
<Route path="/banks/gtask/:workid/:type" <Route path="/banks/gtask/:workid/:type"
render={ render={
(props) => (<Completetaskpage {...this.props} {...props} {...this.state} {...common} />) (props) => (<Completetaskpage {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/*毕设内容题库详情*/} {/*毕设内容题库详情*/}
<Route path="/banks/gtopic/:workid/:type" <Route path="/banks/gtopic/:workid/:type"
render={ render={
(props) => (<CompletetopicdePage {...this.props} {...props} {...this.state} {...common}/>) (props) => (<CompletetopicdePage {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/*分组作业题库详情*/} {/*分组作业题库详情*/}
<Route path="/banks/group/:workid/:type" <Route path="/banks/group/:workid/:type"
render={ render={
(props) => (<GroupjobbankPage {...this.props} {...props} {...this.state} {...common} />) (props) => (<GroupjobbankPage {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/* 普通作业题库详情*/} {/* 普通作业题库详情*/}
<Route path="/banks/normal/:workid/:type" <Route path="/banks/normal/:workid/:type"
render={ render={
(props) => (<Generaljobbankdetails {...this.props} {...props} {...this.state} {...common} />) (props) => (<Generaljobbankdetails {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
</Switch> </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 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" import "./usersInfo.css"
class publicCreateNew extends Component{ class publicCreateNew extends Component {
constructor(props){ constructor(props) {
super(props); super(props);
this.state={ this.state = {
} }
} }
//头部获取是否已经登录了 //头部获取是否已经登录了
getUser=(url,name)=> { 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==="") { 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("请先绑定邮箱,谢谢"); this.props.showNotification("请先绑定邮箱,谢谢");
return 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; window.location.href = url;
} }
} }
getUsers=(url,name)=> { getUsers = (url, name) => {
if(name==="新建实训"){ if (name === "新建实训") {
if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){ if (this.props && this.props.current_user && this.props.current_user.is_shixun_marker === false) {
this.props.setgoshowqqgtounp(true); this.props.setgoshowqqgtounp(true);
return; return;
} }
} }
if(url !== undefined || url!==""){ if (url !== undefined || url !== "") {
window.location.href = url; window.location.href = url;
} }
} }
render() { render() {
let {href,name,index}=this.props; let { href, name, index } = this.props;
return ( return (
<div className="square-Item" style={{"height":`${index=="1"?"289":index=="2"?"298":index=="3"?"295":"289"}px`}}> <div className="square-Item" style={{ "height": `${index == "1" ? "289" : index == "2" ? "298" : index == "3" ? "295" : "289"}px` }}>
<div className="substance substancepad"> <div className="substance substancepad">
{this.props.Createtype==="projects"?<a onClick={()=>this.getUser(href,name)}> {this.props.Createtype === "projects" ? <a onClick={() => this.getUser(href, name)}>
<div className="substancenenew"> <div className="substancenenew">
<div className="leftten"></div> <div className="leftten"></div>
<div className="topten"></div> <div className="topten"></div>
</div> </div>
</a>: <a onClick={()=>this.getUsers(href,name)}> </a> : <a onClick={() => this.getUsers(href, name)}>
<div className="substancenenew"> <div className="substancenenew">
<div className="leftten"></div> <div className="leftten"></div>
<div className="topten"></div> <div className="topten"></div>
</div> </div>
</a>} </a>}
</div> </div>
<div className="edu-txt-center course-bottom"> <div className="edu-txt-center course-bottom">
<div className="inline color-grey-6"> <div className="inline color-grey-6">
<span className="fl ml10 mr10 squareIconSpan substancefont"> <span className="fl ml10 mr10 squareIconSpan substancefont">
{name} {name}
</span> </span>
</div> </div>
</div> </div>
</div> </div>
) )
} }
} }
export default publicCreateNew; export default publicCreateNew;

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

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

Loading…
Cancel
Save