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,7 +11,7 @@ class ShowSpin extends Component{
render() { render() {
let marigin={ let marigin = {
width: '100%', width: '100%',
minHeight: '500px', minHeight: '500px',
} }
@ -30,4 +30,4 @@ class ShowSpin extends Component{
} }
} }
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,9 +6,9 @@ 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() {
@ -34,4 +34,4 @@ class http500 extends Component {
} }
} }
export default SnackbarHOC() (TPMIndexHOC ( http500 )); export default SnackbarHOC()(TPMIndexHOC(http500));

@ -6,9 +6,9 @@ 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() {
@ -34,4 +34,4 @@ class Shixunnopage extends Component {
} }
} }
export default SnackbarHOC() (TPMIndexHOC ( Shixunnopage )); export default SnackbarHOC()(TPMIndexHOC(Shixunnopage));

@ -7,7 +7,7 @@ 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) {
@ -146,7 +146,7 @@ class CompatibilityPage extends Component {
<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>
@ -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>
@ -199,4 +199,4 @@ class CompatibilityPage extends Component {
} }
} }
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,15 +51,15 @@ 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",

@ -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);\
@ -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>
{ {
` `
@ -956,7 +949,7 @@ class Registration extends React.Component {
} }
<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
@ -980,8 +973,8 @@ 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> : "")
: ""} : ""}
@ -1067,7 +1060,7 @@ class Registration extends React.Component {
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>

@ -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,7 +11,7 @@ class Registrationitem extends React.Component {
render() { render() {
let {item} = this.props; let { item } = this.props;
return ( return (
<div className="yslborderbottom"> <div className="yslborderbottom">
{ {

@ -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,7 +77,7 @@ 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>

@ -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]);
@ -254,7 +245,7 @@ class PersonalCompetititem extends React.Component {
: { : {
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",
@ -272,7 +263,7 @@ 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 ?
@ -315,17 +306,17 @@ class PersonalCompetititem extends React.Component {
}}>战队详情</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>
@ -339,17 +330,17 @@ class PersonalCompetititem extends React.Component {
> >
<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>
@ -375,17 +366,17 @@ class PersonalCompetititem extends React.Component {
}}>战队详情</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>
@ -397,17 +388,17 @@ class PersonalCompetititem extends React.Component {
}} }}
> >
<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>

@ -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 = '竞赛';
} }
@ -64,7 +62,7 @@ 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} />)
} }
/> />
@ -89,4 +87,4 @@ class Competitions extends Component {
} }
} }
export default CNotificationHOC() (TPMIndexHOC (Competitions)) ; export default CNotificationHOC()(TPMIndexHOC(Competitions));

@ -1,43 +1,41 @@
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() {
@ -97,4 +95,4 @@ class CoursesIndex extends Component{
} }
} }
export default CNotificationHOC() ( SnackbarHOC() ( (CoursesIndex) )); export default CNotificationHOC()(SnackbarHOC()((CoursesIndex)));

@ -1,31 +1,31 @@
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 { withRouter } from 'react-router' import { withRouter } from 'react-router'
import Loadable from 'react-loadable'; import Loadable from 'react-loadable';
import Loading from '../../Loading'; import Loading from '../../Loading';
import axios from 'axios'; import axios from 'axios';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC'; import TPMIndexHOC from '../tpm/TPMIndexHOC';
import { CNotificationHOC } from './common/CNotificationHOC' import CNotificationHOC from './common/CNotificationHOC'
import {ImageLayerOfCommentHOC} from '../page/layers/ImageLayerOfCommentHOC' import ImageLayerOfCommentHOC from '../page/layers/ImageLayerOfCommentHOC'
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 CoursesHome = Loadable({ const CoursesHome = Loadable({
loader: () => import('./coursesHome/CoursesHome'), loader: () => import('./coursesHome/CoursesHome'),
loading:Loading, loading: Loading,
}) })
//课堂详情页 //课堂详情页
const CoursesDetail= Loadable({ const CoursesDetail = Loadable({
loader: () => import('./coursesDetail/CoursesDetail'), loader: () => import('./coursesDetail/CoursesDetail'),
loading:Loading, loading: Loading,
}) })
@ -33,62 +33,62 @@ const CoursesDetail= Loadable({
// 课堂讨论 // 课堂讨论
const BoardIndex = Loadable({ const BoardIndex = Loadable({
loader: () => import('./BoardIndex'), loader: () => import('./BoardIndex'),
loading:Loading, loading: Loading,
}) })
const GraduationTopics= Loadable({ const GraduationTopics = Loadable({
loader: () => import('./graduation/topics'), loader: () => import('./graduation/topics'),
loading: Loading, loading: Loading,
}) })
const GraduationTopicsDetail= Loadable({ const GraduationTopicsDetail = Loadable({
loader: () => import('./graduation/topics/GraduateTopicDetail'), loader: () => import('./graduation/topics/GraduateTopicDetail'),
loading: Loading, loading: Loading,
}) })
const GraduateTopicPostWorksNew= Loadable({ const GraduateTopicPostWorksNew = Loadable({
loader: () => import('./graduation/topics/GraduateTopicPostWorksNew'), loader: () => import('./graduation/topics/GraduateTopicPostWorksNew'),
loading: Loading, loading: Loading,
}) })
const GraduateTopicNew= Loadable({ const GraduateTopicNew = Loadable({
loader: () => import('./graduation/topics/GraduateTopicNew'), loader: () => import('./graduation/topics/GraduateTopicNew'),
loading: Loading, loading: Loading,
}) })
const GraduationTasks= Loadable({ const GraduationTasks = Loadable({
loader: () => import('./graduation/tasks'), loader: () => import('./graduation/tasks'),
loading: Loading, loading: Loading,
}) })
// 资源 // 资源
const Resourcelist= Loadable({ const Resourcelist = Loadable({
loader: () => import('./Resource/index'), loader: () => import('./Resource/index'),
loading: Loading, loading: Loading,
}) })
//新建实训 //新建实训
const WrappedCoursesNewApp= Loadable({ const WrappedCoursesNewApp = Loadable({
loader: () => import('./new/CoursesNew'), loader: () => import('./new/CoursesNew'),
loading: Loading, loading: Loading,
}) })
//新建精品课堂 //新建精品课堂
const WrappedCoursesNewAppGoldclass= Loadable({ const WrappedCoursesNewAppGoldclass = Loadable({
loader: () => import('./new/Goldsubject'), loader: () => import('./new/Goldsubject'),
loading: Loading, loading: Loading,
}) })
const ShixunHomeworkPage =Loadable({ const ShixunHomeworkPage = Loadable({
loader: () => import('./shixunHomework/ShixunHomeworkPage'), loader: () => import('./shixunHomework/ShixunHomeworkPage'),
loading: Loading, loading: Loading,
}) })
//实训作业 //实训作业
const ShixunHomework= Loadable({ const ShixunHomework = Loadable({
loader: () => import('./shixunHomework/shixunHomework'), loader: () => import('./shixunHomework/shixunHomework'),
loading: Loading, loading: Loading,
}) })
//实训作业设置 //实训作业设置
const Trainingjobsetting= Loadable({ const Trainingjobsetting = Loadable({
loader: () => import('./shixunHomework/Trainingjobsetting'), loader: () => import('./shixunHomework/Trainingjobsetting'),
loading: Loading, loading: Loading,
}) })
@ -100,7 +100,7 @@ const Trainingjobsetting= Loadable({
// loading: Loading, // loading: Loading,
// }) // })
//实训作业列表完成的 //实训作业列表完成的
const Studenthascompleted= Loadable({ const Studenthascompleted = Loadable({
loader: () => import('./shixunHomework/Listofworksstudentone'), loader: () => import('./shixunHomework/Listofworksstudentone'),
loading: Loading, loading: Loading,
}) })
@ -112,67 +112,67 @@ const CommitSummary = Loadable({
loading: Loading, loading: Loading,
}) })
//实训作业设置 //实训作业设置
const Workquestionandanswer= Loadable({ const Workquestionandanswer = Loadable({
loader: () => import('./shixunHomework/Workquestionandanswer'), loader: () => import('./shixunHomework/Workquestionandanswer'),
loading: Loading, loading: Loading,
}) })
//实训报告 //实训报告
const ShixunWorkReport= Loadable({ const ShixunWorkReport = Loadable({
loader: () => import('./shixunHomework/ShixunWorkReport'), loader: () => import('./shixunHomework/ShixunWorkReport'),
loading: Loading, loading: Loading,
}) })
//实训查重 //实训查重
const ShixunStudentWork= Loadable({ const ShixunStudentWork = Loadable({
loader: () => import('./shixunHomework/ShixunStudentWork'), loader: () => import('./shixunHomework/ShixunStudentWork'),
loading: Loading, loading: Loading,
}) })
//实训查重详情 //实训查重详情
const ShixunWorkDetails= Loadable({ const ShixunWorkDetails = Loadable({
loader: () => import('./shixunHomework/ShixunWorkDetails'), loader: () => import('./shixunHomework/ShixunWorkDetails'),
loading: Loading, loading: Loading,
}) })
//问卷 //问卷
const Poll= Loadable({ const Poll = Loadable({
loader: () => import('./poll/Poll'), loader: () => import('./poll/Poll'),
loading: Loading, loading: Loading,
}) })
//问卷新建 //问卷新建
const PollNew= Loadable({ const PollNew = Loadable({
loader: () => import('./poll/PollNew'), loader: () => import('./poll/PollNew'),
loading: Loading, loading: Loading,
}) })
//问卷答题 //问卷答题
const PollInfo= Loadable({ const PollInfo = Loadable({
loader: () => import('./poll/PollInfo'), loader: () => import('./poll/PollInfo'),
loading: Loading, loading: Loading,
}) })
//问卷详情 //问卷详情
const PollDetail= Loadable({ const PollDetail = Loadable({
loader: () => import('./poll/PollDetailIndex'), loader: () => import('./poll/PollDetailIndex'),
loading: Loading, loading: Loading,
}) })
//试卷 //试卷
const Exercise= Loadable({ const Exercise = Loadable({
loader: () => import('./exercise/Exercise'), loader: () => import('./exercise/Exercise'),
loading: Loading, loading: Loading,
}) })
const Testpapersettinghomepage =Loadable({ const Testpapersettinghomepage = Loadable({
loader: () => import('./exercise/Testpapersettinghomepage'), loader: () => import('./exercise/Testpapersettinghomepage'),
loading: Loading, loading: Loading,
}) })
const ExerciseNew =Loadable({ const ExerciseNew = Loadable({
loader: () => import('./exercise/ExerciseNew'), loader: () => import('./exercise/ExerciseNew'),
loading: Loading, loading: Loading,
}) })
const ExerciseReviewAndAnswer=Loadable({ const ExerciseReviewAndAnswer = Loadable({
loader:() => import('./exercise/ExerciseReviewAndAnswer'), loader: () => import('./exercise/ExerciseReviewAndAnswer'),
loading: Loading, loading: Loading,
}) })
@ -183,23 +183,23 @@ const Studentshavecompletedthelist = Loadable({
}) })
//教师列表 //教师列表
const TeacherList= Loadable({ const TeacherList = Loadable({
loader: () => import('./members/teacherList'), loader: () => import('./members/teacherList'),
loading: Loading, loading: Loading,
}) })
//学生列表 //学生列表
const StudentsList= Loadable({ const StudentsList = Loadable({
loader: () => import('./members/studentsList'), loader: () => import('./members/studentsList'),
loading: Loading, loading: Loading,
}) })
//普通作业 //普通作业
const CommonWork= Loadable({ const CommonWork = Loadable({
loader: () => import('./busyWork/Index'), loader: () => import('./busyWork/Index'),
loading: Loading, loading: Loading,
}) })
const GroupWork= Loadable({ const GroupWork = Loadable({
loader: () => import('./busyWork/IndexGroup'), loader: () => import('./busyWork/IndexGroup'),
loading: Loading, loading: Loading,
}) })
@ -212,40 +212,40 @@ const GroupWork= Loadable({
// }) // })
//毕设任务列表新建 //毕设任务列表新建
const GraduationTaskseditApp= Loadable({ const GraduationTaskseditApp = Loadable({
loader: () => import('./graduation/tasks/GraduationTasksedit'), loader: () => import('./graduation/tasks/GraduationTasksedit'),
loading: Loading, loading: Loading,
}) })
//毕设任务列表编辑 //毕设任务列表编辑
const GraduationTasksnewApp= Loadable({ const GraduationTasksnewApp = Loadable({
loader: () => import('./graduation/tasks/GraduationTasksnew'), loader: () => import('./graduation/tasks/GraduationTasksnew'),
loading: Loading, loading: Loading,
}) })
//毕设任务列表设置 //毕设任务列表设置
const GraduationTasksquestions= Loadable({ const GraduationTasksquestions = Loadable({
loader: () => import('./graduation/tasks/GraduationTaskssettingquestions'), loader: () => import('./graduation/tasks/GraduationTaskssettingquestions'),
loading: Loading, loading: Loading,
}) })
//毕设任务列表 //毕设任务列表
const GraduationTaskssettinglist= Loadable({ const GraduationTaskssettinglist = Loadable({
loader: () => import('./graduation/tasks/GraduationTaskDetail'), loader: () => import('./graduation/tasks/GraduationTaskDetail'),
loading: Loading, loading: Loading,
}) })
//毕业任务设置 //毕业任务设置
const GraduationTaskssetting=Loadable({ const GraduationTaskssetting = Loadable({
loader: () => import('./graduation/tasks/GraduationTaskssetting'), loader: () => import('./graduation/tasks/GraduationTaskssetting'),
loading: Loading, loading: Loading,
}) })
// 评阅列表 // 评阅列表
const GraduationTasksappraise=Loadable({ const GraduationTasksappraise = Loadable({
loader: () => import('./graduation/tasks/GraduationTasksappraise'), loader: () => import('./graduation/tasks/GraduationTasksappraise'),
loading: Loading, loading: Loading,
}) })
@ -253,108 +253,109 @@ const GraduationTasksappraise=Loadable({
//创建作品 //创建作品
const GraduationTasksSubmitnewApp=Loadable({ const GraduationTasksSubmitnewApp = Loadable({
loader: () => import('./graduation/tasks/GraduationTasksSubmitnew'), loader: () => import('./graduation/tasks/GraduationTasksSubmitnew'),
loading: Loading, loading: Loading,
}) })
//修改作品 //修改作品
const GraduationTasksSubmiteditApp=Loadable({ const GraduationTasksSubmiteditApp = Loadable({
loader: () => import('./graduation/tasks/GraduationTasksSubmitedit'), loader: () => import('./graduation/tasks/GraduationTasksSubmitedit'),
loading: Loading, loading: Loading,
}) })
//排序 //排序
const Ordering=Loadable({ const Ordering = Loadable({
loader: () => import('../../modules/courses/ordering/Ordering'), loader: () => import('../../modules/courses/ordering/Ordering'),
loading: Loading, loading: Loading,
}); });
class CoursesIndex extends Component{ class CoursesIndex extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state={ this.state = {
coursesids: undefined, coursesids: undefined,
coursesidsfun:this.coursesidsfun, coursesidsfun: this.coursesidsfun,
updataleftNavfun:this.updataleftNav, updataleftNavfun: this.updataleftNav,
course_modules:undefined, course_modules: undefined,
hidden_modules:[], hidden_modules: [],
is_teacher:false, is_teacher: false,
isaloadtype:true, isaloadtype: true,
coursesidtype:undefined, coursesidtype: undefined,
locationNavfun:this.locationNav, locationNavfun: this.locationNav,
unlocationNavfun:this.unlocationNavfun unlocationNavfun: this.unlocationNavfun
} }
} }
coursesidsfun=(id,type)=>{ coursesidsfun = (id, type) => {
this.setState({ this.setState({
coursesids:id, coursesids: id,
coursesidtype:type coursesidtype: type
}) })
} }
componentDidMount(){ componentDidMount() {
// this.updataleftNav() // this.updataleftNav()
this.historyArray = [window.location.pathname]; this.historyArray = [window.location.pathname];
this.props.history.listen( location => { this.props.history.listen(location => {
this.historyArray.unshift(window.location.pathname); this.historyArray.unshift(window.location.pathname);
this.historyArray.length = 2; this.historyArray.length = 2;
//Do your stuff here //Do your stuff here
}); });
} }
//更新左边课堂导航 //更新左边课堂导航
updataleftNav=()=>{ updataleftNav = () => {
let query=this.props.location.pathname let query = this.props.location.pathname
let {isaloadtype}=this.state; let { isaloadtype } = this.state;
let types=isaloadtype===false?true:false let types = isaloadtype === false ? true : false
const type = query.split('/'); const type = query.split('/');
let id=parseInt(type[2]) let id = parseInt(type[2])
if(isNaN(id)){ if (isNaN(id)) {
return return
} }
const querys = this.props.location.search; const querys = this.props.location.search;
var dataqueryss={} var dataqueryss = {}
try { try {
var foqus=this.foo(querys); var foqus = this.foo(querys);
if(JSON.stringify(foqus) ==="{}"){ if (JSON.stringify(foqus) === "{}") {
this.setState({ this.setState({
dataquerys:{}, dataquerys: {},
}); });
}else{ } else {
this.setState({ this.setState({
dataquerys:foqus, dataquerys: foqus,
}); });
dataqueryss=foqus; dataqueryss = foqus;
} }
}catch (e) { } catch (e) {
this.setState({ this.setState({
dataquerys:{}, dataquerys: {},
}) })
} }
// let id=this.props.match.params.coursesId; // let id=this.props.match.params.coursesId;
let url ="/courses/"+id+"/left_banner.json" let url = "/courses/" + id + "/left_banner.json"
axios.get(url, axios.get(url,
{params: {
params:
dataqueryss dataqueryss
} }
).then((response) => { ).then((response) => {
if(response!=undefined){ if (response != undefined) {
if(response.data&&response.data){ if (response.data && response.data) {
this.setState({ this.setState({
course_modules:response.data.course_modules, course_modules: response.data.course_modules,
hidden_modules:response.data.hidden_modules, hidden_modules: response.data.hidden_modules,
is_teacher:response.data.is_teacher, is_teacher: response.data.is_teacher,
isaloadtype:types isaloadtype: types
}) })
this.locationNav(response.data.course_modules) this.locationNav(response.data.course_modules)
} }
} }
}) })
}; };
foo=(url)=> { foo = (url) => {
var json = {}; var json = {};
var regExp = /[\?\&](\w+)(=?)(\w*)/g; var regExp = /[\?\&](\w+)(=?)(\w*)/g;
var arr; var arr;
@ -376,36 +377,36 @@ class CoursesIndex extends Component{
return json; return json;
}; };
locationNav=(list)=>{ locationNav = (list) => {
if(list){ if (list) {
let url=this.props.location.pathname; let url = this.props.location.pathname;
const type = url.split('/'); const type = url.split('/');
let filesId=parseInt(type[4]); let filesId = parseInt(type[4]);
// let urls=this.props.match.url // let urls=this.props.match.url
var lists=list; var lists = list;
lists.forEach((item,index)=>{ lists.forEach((item, index) => {
if(url===item.category_url){ if (url === item.category_url) {
this.setState({ this.setState({
indexs:index, indexs: index,
mainurl:item.category_url mainurl: item.category_url
}) })
this.coursesidsfun(item.id,"node") this.coursesidsfun(item.id, "node")
}else{ } else {
if(item.second_category!=undefined&&item.second_category.length!=0){ if (item.second_category != undefined && item.second_category.length != 0) {
item.second_category.forEach((iem,key)=>{ item.second_category.forEach((iem, key) => {
if(url===iem.second_category_url){ if (url === iem.second_category_url) {
if( parseInt(filesId)===iem.category_id||parseInt(filesId)===item.id){ if (parseInt(filesId) === iem.category_id || parseInt(filesId) === item.id) {
this.setState({ this.setState({
indexs:index, indexs: index,
url:url, url: url,
mainurl:item.category_url mainurl: item.category_url
}) })
} }
this.coursesidsfun(item.id,"child") this.coursesidsfun(item.id, "child")
} }
}) })
} }
@ -417,9 +418,9 @@ class CoursesIndex extends Component{
} }
unlocationNavfun=(val)=>{ unlocationNavfun = (val) => {
this.setState({ this.setState({
indexs:val, indexs: val,
}) })
} }
// // 老师、管理员等 // // 老师、管理员等
@ -517,23 +518,23 @@ class CoursesIndex extends Component{
{/* 资源列表页 */} {/* 资源列表页 */}
<Route path="/courses/:coursesId/file/:Id" exact <Route path="/courses/:coursesId/file/:Id" exact
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/files/:main_id" <Route path="/courses/:coursesId/files/:main_id"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
<Route exact path="/courses/:coursesId/boards/:boardId" <Route exact path="/courses/:coursesId/boards/:boardId"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/*课堂讨论*/} {/*课堂讨论*/}
<Route path="/courses/:coursesId/boards/:boardId" <Route path="/courses/:coursesId/boards/:boardId"
render={ render={
(props) => (<BoardIndex {...this.props} {...props} {...this.state} {...common}/>) (props) => (<BoardIndex {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
@ -541,32 +542,32 @@ class CoursesIndex extends Component{
{/* 毕设问答 */} {/* 毕设问答 */}
<Route path="/courses/:coursesId/graduation_topics/postwork/new" <Route path="/courses/:coursesId/graduation_topics/postwork/new"
render={ render={
(props) => (<GraduateTopicPostWorksNew {...this.props} {...props} {...this.state} {...common}/>) (props) => (<GraduateTopicPostWorksNew {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/* 毕设选题新建页 */} {/* 毕设选题新建页 */}
<Route path="/courses/:coursesId/graduation_topics/new" <Route path="/courses/:coursesId/graduation_topics/new"
render={ render={
(props) => (<GraduateTopicNew {...this.props} {...props} {...this.state} {...common}/>) (props) => (<GraduateTopicNew {...this.props} {...props} {...this.state} {...common} />)
}></Route> }></Route>
{/* 毕设选题编辑页*/} {/* 毕设选题编辑页*/}
<Route path="/courses/:coursesId/graduation_topics/:topicId/edit" <Route path="/courses/:coursesId/graduation_topics/:topicId/edit"
render={ render={
(props) => (<GraduateTopicNew {...this.props} {...props} {...this.state} {...common}/>) (props) => (<GraduateTopicNew {...this.props} {...props} {...this.state} {...common} />)
}></Route> }></Route>
{/* 毕设选题详情页 */} {/* 毕设选题详情页 */}
<Route path="/courses/:course_id/graduation_topics/:graduation_topic_id/detail" <Route path="/courses/:course_id/graduation_topics/:graduation_topic_id/detail"
render={ render={
(props)=>(<GraduationTopicsDetail {...this.props} {...props} {...this.state}></GraduationTopicsDetail>) (props) => (<GraduationTopicsDetail {...this.props} {...props} {...this.state}></GraduationTopicsDetail>)
} }
></Route> ></Route>
{/* 毕设选题列表 */} {/* 毕设选题列表 */}
<Route path="/courses/:coursesId/graduation_topics/:Id" exact <Route path="/courses/:coursesId/graduation_topics/:Id" exact
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
}></Route> }></Route>
@ -574,21 +575,21 @@ class CoursesIndex extends Component{
{/* 作品评阅 https://www.trustie.net/issues/19981 */} {/* 作品评阅 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/appraise" <Route path="/courses/:coursesId/graduation_tasks/:category_id/appraise"
render={ render={
(props) => (<GraduationTasksappraise {...this.props} {...props} {...this.state} {...common}/>) (props) => (<GraduationTasksappraise {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/* 新建作品 */} {/* 新建作品 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/works/:task_Id/new" <Route path="/courses/:coursesId/graduation_tasks/:category_id/works/:task_Id/new"
render={ render={
(props) => (<GraduationTasksSubmitnewApp {...this.props} {...props} {...this.state} {...common}/>) (props) => (<GraduationTasksSubmitnewApp {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/* 修改作品 */} {/* 修改作品 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/works/:work_Id/edit" <Route path="/courses/:coursesId/graduation_tasks/:category_id/works/:work_Id/edit"
render={ render={
(props) => (<GraduationTasksSubmiteditApp {...this.props} {...props} {...this.state} {...common}/>) (props) => (<GraduationTasksSubmiteditApp {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
@ -609,7 +610,7 @@ class CoursesIndex extends Component{
<Route path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id" <Route path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id"
render={ render={
(props) => (<GraduationTaskssettinglist {...this.props} {...props} {...this.state} {...common}/>) (props) => (<GraduationTaskssettinglist {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
@ -617,7 +618,7 @@ class CoursesIndex extends Component{
{/* 修改毕设任务 https://www.trustie.net/issues/19981 */} {/* 修改毕设任务 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/edit" <Route path="/courses/:coursesId/graduation_tasks/:category_id/edit"
render={ render={
(props) => (<GraduationTaskseditApp {...this.props} {...props} {...this.state} {...common}/>) (props) => (<GraduationTaskseditApp {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
@ -625,7 +626,7 @@ class CoursesIndex extends Component{
{/* 新建毕设任务 https://www.trustie.net/issues/19981 */} {/* 新建毕设任务 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/new" <Route path="/courses/:coursesId/graduation_tasks/:category_id/new"
render={ render={
(props) => (<GraduationTasksnewApp {...this.props} {...props} {...this.state} {...common}/>) (props) => (<GraduationTasksnewApp {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
@ -633,7 +634,7 @@ class CoursesIndex extends Component{
{/* 毕设任务列表 https://www.trustie.net/issues/19981 */} {/* 毕设任务列表 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:Id" exact <Route path="/courses/:coursesId/graduation_tasks/:Id" exact
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
@ -653,72 +654,72 @@ class CoursesIndex extends Component{
{/* 教师列表*/} {/* 教师列表*/}
<Route path="/courses/:coursesId/teachers" <Route path="/courses/:coursesId/teachers"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/* 学生列表*/} {/* 学生列表*/}
<Route path="/courses/:coursesId/students" <Route path="/courses/:coursesId/students"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/* 分班列表 */} {/* 分班列表 */}
<Route path="/courses/:coursesId/course_groups/:course_group_id" <Route path="/courses/:coursesId/course_groups/:course_group_id"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/course_groups" <Route path="/courses/:coursesId/course_groups"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/* 普通作业 */} {/* 普通作业 */}
<Route path="/courses/:coursesId/common_homeworks/:category_id" exact <Route path="/courses/:coursesId/common_homeworks/:category_id" exact
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/* 分组作业 */} {/* 分组作业 */}
<Route path="/courses/:coursesId/group_homeworks/:category_id" exact <Route path="/courses/:coursesId/group_homeworks/:category_id" exact
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/* 普通作业 */} {/* 普通作业 */}
<Route path="/courses/:coursesId/common_homeworks/" strict <Route path="/courses/:coursesId/common_homeworks/" strict
render={ render={
(props) => (<CommonWork {...this.props} {...props} {...this.state} {...common}/>) (props) => (<CommonWork {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/* 分组作业 */} {/* 分组作业 */}
<Route path="/courses/:coursesId/group_homeworks/" strict <Route path="/courses/:coursesId/group_homeworks/" strict
render={ render={
(props) => (<GroupWork {...this.props} {...props} {...this.state} {...common}/>) (props) => (<GroupWork {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/* 问卷答题 */} {/* 问卷答题 */}
<Route path="/courses/:coursesId/polls/:pollId/users/:login" <Route path="/courses/:coursesId/polls/:pollId/users/:login"
render={ render={
(props) => (<PollInfo {...this.props} {...props} {...this.state} {...common}/>) (props) => (<PollInfo {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/* 问卷详情 */} {/* 问卷详情 */}
<Route path="/courses/:coursesId/polls/:pollId/detail" <Route path="/courses/:coursesId/polls/:pollId/detail"
render={ render={
(props) => (<PollDetail {...this.props} {...props} {...this.state} {...common}/>) (props) => (<PollDetail {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/* 问卷新建 */} {/* 问卷新建 */}
<Route path="/courses/:coursesId/polls/:pollid/:news" <Route path="/courses/:coursesId/polls/:pollid/:news"
render={ render={
(props) => (<PollNew {...this.props} {...props} {...this.state} {...common}/>) (props) => (<PollNew {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/*/!* 问卷编辑 *!/*/} {/*/!* 问卷编辑 *!/*/}
@ -730,7 +731,7 @@ class CoursesIndex extends Component{
{/* 问卷 */} {/* 问卷 */}
<Route path="/courses/:coursesId/polls/:Id" <Route path="/courses/:coursesId/polls/:Id"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
@ -738,20 +739,20 @@ class CoursesIndex extends Component{
{/* 试卷查看/评阅 */} {/* 试卷查看/评阅 */}
<Route exact path="/courses/:coursesId/exercises/:Id/users/:userId" <Route exact path="/courses/:coursesId/exercises/:Id/users/:userId"
render={ render={
(props)=>(<ExerciseReviewAndAnswer {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ExerciseReviewAndAnswer {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/*试卷新建 */} {/*试卷新建 */}
<Route exact path="/courses/:coursesId/exercises/new" <Route exact path="/courses/:coursesId/exercises/new"
render={ render={
(props) => (<ExerciseNew {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ExerciseNew {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/*试卷新建 */} {/*试卷新建 */}
<Route exact path="/courses/:coursesId/exercises/:Id/edit" <Route exact path="/courses/:coursesId/exercises/:Id/edit"
render={ render={
(props) => (<ExerciseNew {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ExerciseNew {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
@ -759,7 +760,7 @@ class CoursesIndex extends Component{
<Route path="/courses/:coursesId/exercises/:Id/student_exercise_list" <Route path="/courses/:coursesId/exercises/:Id/student_exercise_list"
render={ render={
(props) => (<Testpapersettinghomepage {...this.props} {...props} {...this.state} {...common}/>) (props) => (<Testpapersettinghomepage {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
@ -768,14 +769,14 @@ class CoursesIndex extends Component{
<Route <Route
path="/courses/:coursesId/exercises/:Id/Studentshavecompletedthelist" path="/courses/:coursesId/exercises/:Id/Studentshavecompletedthelist"
render={ render={
(props) => (<Studentshavecompletedthelist {...this.props} {...props} {...this.state} {...common}/>) (props) => (<Studentshavecompletedthelist {...this.props} {...props} {...this.state} {...common} />)
} }
> >
</Route> </Route>
{/* 试卷 */} {/* 试卷 */}
<Route path="/courses/:coursesId/exercises/:Id" <Route path="/courses/:coursesId/exercises/:Id"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
@ -783,65 +784,65 @@ class CoursesIndex extends Component{
{/*实训查重详情*/} {/*实训查重详情*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/review_detail/:userid" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/review_detail/:userid"
render={ render={
(props) => (<ShixunWorkDetails {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ShixunWorkDetails {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/review_detail/:userid" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/review_detail/:userid"
render={ render={
(props) => (<ShixunWorkDetails {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ShixunWorkDetails {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/*实训查重列表*/} {/*实训查重列表*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/student_work" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/student_work"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/student_work" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/student_work"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/*实训报告*/} {/*实训报告*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/shixun_work_report" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/shixun_work_report"
render={ render={
(props) => (<ShixunWorkReport {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ShixunWorkReport {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/shixun_work_report" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/shixun_work_report"
render={ render={
(props) => (<ShixunWorkReport {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ShixunWorkReport {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/*教师列表*/} {/*教师列表*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/list" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/list"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/list" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/list"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/*实训作业page*/} {/*实训作业page*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/Page" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/Page"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/*实训作业设置*/} {/*实训作业设置*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/settings" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/settings"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/settings" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/settings"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/*/!*实训作品列表教师*!/*/} {/*/!*实训作品列表教师*!/*/}
@ -880,21 +881,21 @@ class CoursesIndex extends Component{
{/*实训作业问答主目录*/} {/*实训作业问答主目录*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/questions" <Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/questions"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/*实训作业问答子目录*/} {/*实训作业问答子目录*/}
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/questions" <Route path="/courses/:coursesId/shixun_homework/:homeworkid/questions"
render={ render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/*新建课堂*/} {/*新建课堂*/}
<Route path="/courses/new" <Route path="/courses/new"
render={ render={
(props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} {...common}/>) (props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/*新建精品课堂*/} {/*新建精品课堂*/}
@ -902,33 +903,33 @@ class CoursesIndex extends Component{
{/*id 是否是私有或者公有*/} {/*id 是否是私有或者公有*/}
<Route path="/courses/news/:subjectid/newgold/:id" <Route path="/courses/news/:subjectid/newgold/:id"
render={ render={
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} {...common}/>) (props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/*修改精品课堂*/} {/*修改精品课堂*/}
<Route path="/courses/:coursesId/newgolds/settings" <Route path="/courses/:coursesId/newgolds/settings"
render={ render={
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} {...common}/>) (props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/*修改课堂*/} {/*修改课堂*/}
<Route path="/courses/:coursesId/settings" <Route path="/courses/:coursesId/settings"
render={ render={
(props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} {...common}/>) (props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/* 实训作业子页面*/} {/* 实训作业子页面*/}
<Route path="/courses/:coursesId/shixun_homework/:category_id" <Route path="/courses/:coursesId/shixun_homework/:category_id"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/* 实训作业页面*/} {/* 实训作业页面*/}
<Route path="/courses/:coursesId/shixun_homeworks/:main_id" <Route path="/courses/:coursesId/shixun_homeworks/:main_id"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
@ -943,14 +944,14 @@ class CoursesIndex extends Component{
{/*/!*实训作业and课堂详情页*!/*/} {/*/!*实训作业and课堂详情页*!/*/}
<Route path="/courses/:coursesId" <Route path="/courses/:coursesId"
render={ render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>) (props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/*课堂首页*/} {/*课堂首页*/}
<Route path="/courses" <Route path="/courses"
render={ render={
(props) => (<CoursesHome {...this.props} {...props} {...this.state} {...common}/>) (props) => (<CoursesHome {...this.props} {...props} {...this.state} {...common} />)
} }
></Route> ></Route>
{/*<Route exact path="/courses" component={CoursesHome} {...this.props} {...props} {...this.state} ></Route>*/} {/*<Route exact path="/courses" component={CoursesHome} {...this.props} {...props} {...this.state} ></Route>*/}
@ -960,4 +961,4 @@ class CoursesIndex extends Component{
} }
} }
export default withRouter(ImageLayerOfCommentHOC({imgSelector: '.imageLayerParent img, .imageLayerParent .imageTarget', parentSelector: '.newMain'}) (CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(CoursesIndex) )))); export default withRouter(ImageLayerOfCommentHOC({ imgSelector: '.imageLayerParent img, .imageLayerParent .imageTarget', parentSelector: '.newMain' })(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(CoursesIndex)))));

@ -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 {
@ -47,12 +47,12 @@ class TopicDetail extends Component {
pageCount: 1, pageCount: 1,
comments: [], comments: [],
goldRewardDialogOpen: false, goldRewardDialogOpen: false,
author:undefined, author: undefined,
commentstype:false commentstype: false
} }
} }
componentDidMount() { componentDidMount() {
window.$("html,body").animate({"scrollTop":0}) 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
}) })
} }
@ -698,10 +698,10 @@ class TopicDetail extends Component {
<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>

@ -1,56 +1,56 @@
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)
} }
@ -139,4 +139,4 @@ class CoursesWorkIndex extends Component{
} }
} }
export default RouteHOC() (CNotificationHOC() (SnackbarHOC() ( CoursesWorkIndex) )); export default RouteHOC()(CNotificationHOC()(SnackbarHOC()(CoursesWorkIndex)));

@ -1,57 +1,57 @@
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)
} }
@ -137,4 +137,4 @@ class CoursesWorkIndex extends Component{
} }
} }
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()
@ -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;
} }
@ -142,7 +141,7 @@ class CommonReply extends Component{
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
@ -170,7 +169,7 @@ 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
@ -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;
@ -285,13 +284,13 @@ class CommonReply extends Component{
</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 = '竞赛';
} }
@ -64,7 +62,7 @@ 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} />)
} }
/> />
@ -89,4 +87,4 @@ class Competitions extends Component {
} }
} }
export default CNotificationHOC() (TPMIndexHOC (Competitions)) ; export default CNotificationHOC()(TPMIndexHOC(Competitions));

@ -1,35 +1,30 @@
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)
}) })
@ -38,11 +33,11 @@ class GraduationTasksappraiseReply extends Component{
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)
}) })
}, },
@ -95,84 +90,84 @@ class GraduationTasksappraiseReply extends Component{
} }
showModulationtype=(id)=>{ showModulationtype = (id) => {
// console.log(id) // console.log(id)
this.setState({ this.setState({
Modulationtype:true, Modulationtype: true,
operationId:id operationId: id
}) })
} }
cancelmodel=()=>{ cancelmodel = () => {
this.setState({ this.setState({
Modalstype:false, Modalstype: false,
Loadtype:false, Loadtype: false,
visible:false, visible: false,
Modulationtype:false, Modulationtype: false,
Allocationtype:false, Allocationtype: false,
Modalstopval:"", Modalstopval: "",
ModalCancel:"", ModalCancel: "",
ModalSave:"", ModalSave: "",
}) })
} }
saveModulationModal=(value,num)=>{ saveModulationModal = (value, num) => {
console.log(value,num) console.log(value, num)
let {operationId}=this.state; let { operationId } = this.state;
let 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}
/> />
@ -183,14 +178,14 @@ class GraduationTasksappraiseReply extends Component{
) )
} }
} }
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,29 +8,25 @@ 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}
@ -45,43 +40,43 @@ class GraduationTasksappraiseReplyChild extends Component{
/> />
{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' }}
@ -91,14 +86,14 @@ class GraduationTasksappraiseReplyChild extends Component{
<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()
@ -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;
} }
@ -138,7 +140,7 @@ class GraduationTaskssettingReply extends Component{
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
@ -166,7 +168,7 @@ 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
@ -226,11 +228,11 @@ 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>{`
@ -267,13 +269,13 @@ class GraduationTaskssettingReply extends Component{
</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()
@ -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;
} }
@ -132,7 +133,7 @@ class GraduateTopicReply extends Component{
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
@ -160,7 +161,7 @@ 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
@ -220,11 +221,11 @@ 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>
@ -259,13 +260,13 @@ class GraduateTopicReply extends Component{
</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,15 +40,15 @@ 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"}>*/}
@ -83,7 +83,7 @@ class Polldepoly extends Component{
<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
@ -94,13 +94,13 @@ class Polldepoly extends Component{
// 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}
@ -111,7 +111,7 @@ class Polldepoly extends Component{
// 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>
@ -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,14 +34,14 @@ 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);
@ -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,13 +146,13 @@ 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>
@ -161,7 +161,7 @@ class CommitSummary extends Component{
<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: [{

@ -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,7 +11,7 @@ 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;
@ -21,7 +21,7 @@ function elasticLayer(forumId){
$.ajax({ $.ajax({
url: url, url: url,
type: 'get', type: 'get',
success: function(res) { success: function (res) {
console.log(res) console.log(res)
doElasticLayer(res.memo) doElasticLayer(res.memo)
} }
@ -30,7 +30,7 @@ function elasticLayer(forumId){
// document.body.addEventListener('touchmove',bodyScroll,false); // document.body.addEventListener('touchmove',bodyScroll,false);
// $('body').css({'position':'fixed',"width":"100%"}); // $('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();
@ -39,8 +39,8 @@ function doElasticLayer(memo, rendered){
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 +
@ -56,7 +56,7 @@ function doElasticLayer(memo, rendered){
sequenceDiagram: true // 默认不解析 sequenceDiagram: true // 默认不解析
}); });
} }
function removeElasticLayer(){ function removeElasticLayer() {
$(".layerContent").hide(); $(".layerContent").hide();
$(".newMain").show(); $(".newMain").show();
} }
@ -79,4 +79,4 @@ class Ecs extends React.Component {
} }
} }
export default SnackbarHOC() (TPMIndexHOC ( Ecs )); export default SnackbarHOC()(TPMIndexHOC(Ecs));

@ -3,11 +3,11 @@ import classNames from 'classnames'
import axios from 'axios'; import axios from 'axios';
// import { TPMIndexHOC } from '../../../tpm/TPMIndexHOC'; // import TPMIndexHOC from '../../../tpm/TPMIndexHOC';
import { SnackbarHOC } from 'educoder' import { SnackbarHOC } from 'educoder'
import { message,Modal,Spin,Icon} from 'antd'; import { message, Modal, Spin, Icon } from 'antd';
import 'antd/dist/antd.css'; import 'antd/dist/antd.css';
@ -21,41 +21,41 @@ const $ = window.$;
class EcCompletionCalculation extends Component { class EcCompletionCalculation extends Component {
constructor(props) { constructor(props) {
super(props) super(props)
this.state={ this.state = {
schooldata:{}, schooldata: {},
ecComponentState:"ecCompletion", ecComponentState: "ecCompletion",
course_total_score:[], course_total_score: [],
ec_course_targets:0, ec_course_targets: 0,
graduation_list:[], graduation_list: [],
target_list:[], target_list: [],
target_score:[], target_score: [],
evaluate_result:"", evaluate_result: "",
ec_course_targets_count:0, ec_course_targets_count: 0,
new_target_ec_year_id:0, new_target_ec_year_id: 0,
total_rate_data:undefined, total_rate_data: undefined,
calculatetype:false, calculatetype: false,
ec_course_id:0, ec_course_id: 0,
morelisttype:false, morelisttype: false,
titlemessage:"提示", titlemessage: "提示",
completiontype:false, completiontype: false,
completionlist:"", completionlist: "",
course_total_scoreaverage:0, course_total_scoreaverage: 0,
calculatesetype:false, calculatesetype: false,
Spintype:false, Spintype: false,
ismanager:false, ismanager: false,
course_achievement:"--", course_achievement: "--",
course_rate:"--", course_rate: "--",
score_levels:[], score_levels: [],
score_levelsdata:[], score_levelsdata: [],
hife:"/ecs/major_schools/3/years/60/requirement_vs_courses", hife: "/ecs/major_schools/3/years/60/requirement_vs_courses",
} }
} }
componentWillMount(){ componentWillMount() {
window.document.title = '课程达成评价结果'; window.document.title = '课程达成评价结果';
} }
componentDidMount(){ componentDidMount() {
console.log("componentDidMount"); console.log("componentDidMount");
console.log("EcCompletionCalculation"); console.log("EcCompletionCalculation");
@ -64,28 +64,28 @@ class EcCompletionCalculation extends Component {
// this.UpdateClassData(true); // this.UpdateClassData(true);
// const url =`/ec_major_schools/get_navigation_data?ec_course_id=`+ec_course_id; // const url =`/ec_major_schools/get_navigation_data?ec_course_id=`+ec_course_id;
const ec_course_id=706; const ec_course_id = 706;
const url =`/ec_courses/${ec_course_id}/evaluation.json`; const url = `/ec_courses/${ec_course_id}/evaluation.json`;
axios.get(url) axios.get(url)
.then((response) => { .then((response) => {
if(response.status===200){ if (response.status === 200) {
// if(response.data.allow_visit===false){ // if(response.data.allow_visit===false){
// window.location.href="/403" // window.location.href="/403"
// } // }
this.setState({ this.setState({
schooldata:response.data, schooldata: response.data,
ec_course_id:ec_course_id, ec_course_id: ec_course_id,
// evaluate_result:response.data.evaluate_result, // evaluate_result:response.data.evaluate_result,
// course_total_score:response.data.course_total_score[response.data.course_total_score.length-1].total_rate, // course_total_score:response.data.course_total_score[response.data.course_total_score.length-1].total_rate,
// total_rate_data:response.data.course_total_score[response.data.course_total_score.length-1].total_rate.length, // total_rate_data:response.data.course_total_score[response.data.course_total_score.length-1].total_rate.length,
graduation_list:response.data.graduation_subitem_evaluations, graduation_list: response.data.graduation_subitem_evaluations,
target_list:response.data.course_targets, target_list: response.data.course_targets,
// target_score:response.data.target_score, // target_score:response.data.target_score,
ec_course_targets_count:response.data.course_targets.length, ec_course_targets_count: response.data.course_targets.length,
course_achievement:response.data.course_achievement, course_achievement: response.data.course_achievement,
course_rate:response.data.course_rate, course_rate: response.data.course_rate,
score_levels:response.data.score_levels, score_levels: response.data.score_levels,
// score_levelsdata:response.data.course_targets.score_levels, // score_levelsdata:response.data.course_targets.score_levels,
// morelisttype:newmorelisttype, // morelisttype:newmorelisttype,
// course_total_scoreaverage:course_total_scoreaverage, // course_total_scoreaverage:course_total_scoreaverage,
@ -102,24 +102,24 @@ class EcCompletionCalculation extends Component {
this.props.Ontitine("competition_calculation_info"); this.props.Ontitine("competition_calculation_info");
try { try {
this.props.triggerRef(this); this.props.triggerRef(this);
}catch (e) { } catch (e) {
} }
} }
targetsget_navigation_data=(ec_year_id,ec_course_id)=>{ targetsget_navigation_data = (ec_year_id, ec_course_id) => {
const Url =`/ec_major_schools/get_navigation_data?ec_year_id=`+ec_year_id+"&ec_course_id="+ec_course_id; const Url = `/ec_major_schools/get_navigation_data?ec_year_id=` + ec_year_id + "&ec_course_id=" + ec_course_id;
axios.get(Url, { axios.get(Url, {
withCredentials: true, withCredentials: true,
}) })
.then((response) => { .then((response) => {
if(response.status===200){ if (response.status === 200) {
// if(response.data.allow_visit===false){ // if(response.data.allow_visit===false){
// window.location.href="/403" // window.location.href="/403"
// } // }
this.setState({ this.setState({
schooldata:response.data, schooldata: response.data,
ec_course_id:ec_course_id ec_course_id: ec_course_id
}) })
} }
}) })
@ -127,26 +127,26 @@ class EcCompletionCalculation extends Component {
console.log(error); console.log(error);
}); });
} }
showmorelist=()=>{ showmorelist = () => {
this.setState({ this.setState({
morelisttype:false morelisttype: false
}) })
this.UpdateClassData(false) this.UpdateClassData(false)
} }
UpdateClassData=(key)=>{ UpdateClassData = (key) => {
let {calculatetype} =this.state; let { calculatetype } = this.state;
// let ec_course_id =this.props.match.params.ec_course_id; // let ec_course_id =this.props.match.params.ec_course_id;
this.setState({ this.setState({
ec_course_id:ec_course_id ec_course_id: ec_course_id
}) })
const ec_course_id=706; const ec_course_id = 706;
const Arl =`/ec_courses/`+ec_course_id+`/calculation_info_data`; const Arl = `/ec_courses/` + ec_course_id + `/calculation_info_data`;
axios.get(Arl, { axios.get(Arl, {
withCredentials: true, withCredentials: true,
}) })
.then((response) => { .then((response) => {
if(response.status===200){ if (response.status === 200) {
// var list=[]; // var list=[];
// if(key===true){ // if(key===true){
// for(var i=0; i<response.data.course_total_score.length;i++){ // for(var i=0; i<response.data.course_total_score.length;i++){
@ -158,17 +158,17 @@ class EcCompletionCalculation extends Component {
// list=response.data.course_total_score // list=response.data.course_total_score
// } // }
// let newgraduation_list= response.data.graduation_list.reverse(); // let newgraduation_list= response.data.graduation_list.reverse();
let newmorelisttype=false; let newmorelisttype = false;
if(response.data.course_total_score>10){ if (response.data.course_total_score > 10) {
newmorelisttype=true newmorelisttype = true
} }
let course_total_scoreaverage; let course_total_scoreaverage;
let newlist=response.data.course_total_score[response.data.course_total_score.length-1].total_rate; let newlist = response.data.course_total_score[response.data.course_total_score.length - 1].total_rate;
for(var i=0; i<newlist.length;i++){ for (var i = 0; i < newlist.length; i++) {
if(i===newlist.length-1){ if (i === newlist.length - 1) {
course_total_scoreaverage=newlist[i].total_score course_total_scoreaverage = newlist[i].total_score
} }
} }
@ -176,13 +176,13 @@ class EcCompletionCalculation extends Component {
// evaluate_result:response.data.evaluate_result, // evaluate_result:response.data.evaluate_result,
// course_total_score:response.data.course_total_score[response.data.course_total_score.length-1].total_rate, // course_total_score:response.data.course_total_score[response.data.course_total_score.length-1].total_rate,
// total_rate_data:response.data.course_total_score[response.data.course_total_score.length-1].total_rate.length, // total_rate_data:response.data.course_total_score[response.data.course_total_score.length-1].total_rate.length,
graduation_list:response.data.graduation_subitem_evaluations, graduation_list: response.data.graduation_subitem_evaluations,
target_list:response.data.course_targets, target_list: response.data.course_targets,
// target_score:response.data.target_score, // target_score:response.data.target_score,
ec_course_targets_count:response.data.course_targets.length, ec_course_targets_count: response.data.course_targets.length,
course_achievement:response.data.course_achievement, course_achievement: response.data.course_achievement,
course_rate:response.data.course_rate, course_rate: response.data.course_rate,
score_levels:response.data.score_levels, score_levels: response.data.score_levels,
// score_levelsdata:, // score_levelsdata:,
// morelisttype:newmorelisttype, // morelisttype:newmorelisttype,
// course_total_scoreaverage:course_total_scoreaverage, // course_total_scoreaverage:course_total_scoreaverage,
@ -197,13 +197,13 @@ class EcCompletionCalculation extends Component {
// console.log(response.data.course_targets.score_levels); // console.log(response.data.course_targets.score_levels);
// ec_course_targets:response.data.ec_course_targets, // ec_course_targets:response.data.ec_course_targets,
this.targetsget_navigation_data(response.data.ec_year_id,ec_course_id) this.targetsget_navigation_data(response.data.ec_year_id, ec_course_id)
if(calculatetype===true){ if (calculatetype === true) {
this.setState({ this.setState({
calculatetype:false, calculatetype: false,
completiontype:true, completiontype: true,
completionlist:'刷新列表数据成功', completionlist: '刷新列表数据成功',
calculatesetype:true calculatesetype: true
}) })
} }
@ -307,25 +307,25 @@ class EcCompletionCalculation extends Component {
} }
newrightcalculatebutton=()=>{ newrightcalculatebutton = () => {
console.log("调用了计算"); console.log("调用了计算");
this.setState({ this.setState({
Spintype:true Spintype: true
}) })
// let {ec_course_id}=this.state; // let {ec_course_id}=this.state;
const ec_course_id=706; const ec_course_id = 706;
// const Orl =`/ec_courses/`+ec_course_id+`/sync_data`; // const Orl =`/ec_courses/`+ec_course_id+`/sync_data`;
const Orl =`/ec_courses/${ec_course_id}/evaluation.json`; const Orl = `/ec_courses/${ec_course_id}/evaluation.json`;
axios.get(Orl) axios.get(Orl)
.then((response) => { .then((response) => {
if(response){ if (response) {
if(response.data.status===1){ if (response.data.status === 1) {
this.setState({ this.setState({
calculatetype:true, calculatetype: true,
completiontype:true, completiontype: true,
completionlist:'计算成功', completionlist: '计算成功',
calculatesetype:true, calculatesetype: true,
Spintype:false Spintype: false
}) })
this.UpdateClassData(true); this.UpdateClassData(true);
} }
@ -336,46 +336,46 @@ class EcCompletionCalculation extends Component {
console.log(error) console.log(error)
}); });
} }
hidecompletion=()=>{ hidecompletion = () => {
this.setState({ this.setState({
completiontype:false, completiontype: false,
completionlist:"", completionlist: "",
calculatesetype:false calculatesetype: false
}) })
} }
render() { render() {
let {Spintype,calculatesetype,ec_course_id,course_total_scoreaverage,score_levels,ec_course_targets_count,course_achievement,schooldata,course_rate,ecComponentState,course_total_score,total_rate_data,ec_course_targets,graduation_list,target_list,target_score,evaluate_result,morelisttype,titlemessage,completiontype,completionlist,ismanager} = this.state; let { Spintype, calculatesetype, ec_course_id, course_total_scoreaverage, score_levels, ec_course_targets_count, course_achievement, schooldata, course_rate, ecComponentState, course_total_score, total_rate_data, ec_course_targets, graduation_list, target_list, target_score, evaluate_result, morelisttype, titlemessage, completiontype, completionlist, ismanager } = this.state;
let TargetresList = (length) => { let TargetresList = (length) => {
let target_listres = []; let target_listres = [];
for(let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
// target_listres.push(<span className="column-1 operationleft color-666" key={i}>目标{length-i}</span>) // target_listres.push(<span className="column-1 operationleft color-666" key={i}>目标{length-i}</span>)
// target_listres.push(<span className="column-2 operationleft color-666" key={i}>目标{i+1}</span>) // target_listres.push(<span className="column-2 operationleft color-666" key={i}>目标{i+1}</span>)
target_listres.push(<span className="column-1 color-666" key={i}>目标{i+1}</span>) target_listres.push(<span className="column-1 color-666" key={i}>目标{i + 1}</span>)
} }
return target_listres return target_listres
} }
let TargetresLists = (length) => { let TargetresLists = (length) => {
let target_listress = []; let target_listress = [];
for(let i = 0; i < length; i++) { for (let i = 0; i < length; i++) {
// target_listres.push(<span className="column-1 operationleft color-666" key={i}>目标{length-i}</span>) // target_listres.push(<span className="column-1 operationleft color-666" key={i}>目标{length-i}</span>)
target_listress.push(<span className="column-2 operationleft color-666" key={i}>目标{i+1}</span>) target_listress.push(<span className="column-2 operationleft color-666" key={i}>目标{i + 1}</span>)
// target_listres.push(<span className="column-1 operationright color-666" key={i}>目标{length-i}</span>) // target_listres.push(<span className="column-1 operationright color-666" key={i}>目标{length-i}</span>)
} }
return target_listress return target_listress
} }
let TargetresContentList = (data,value) => { let TargetresContentList = (data, value) => {
let target_listres = []; let target_listres = [];
if(data){ if (data) {
if(data.length>0){ if (data.length > 0) {
for(var i=0;i<data.length;i++){ for (var i = 0; i < data.length; i++) {
console.log("TargetresContentList"); console.log("TargetresContentList");
if(data[i].id===value[0]){ if (data[i].id === value[0]) {
target_listres.push(<span className={i===0?" column-1 color-green":" column-1 color-green"} key={i}><i class="iconfont icon-gouxuan color-green font-16 mr5"></i></span>) target_listres.push(<span className={i === 0 ? " column-1 color-green" : " column-1 color-green"} key={i}><i class="iconfont icon-gouxuan color-green font-16 mr5"></i></span>)
} else{ } else {
target_listres.push(<span className={i===0?" column-1 color-666":"column-1 color-666"} key={i}><i class="iconfont icon-guanbi font-14 mr5"></i></span>) target_listres.push(<span className={i === 0 ? " column-1 color-666" : "column-1 color-666"} key={i}><i class="iconfont icon-guanbi font-14 mr5"></i></span>)
} }
} }
@ -390,27 +390,27 @@ class EcCompletionCalculation extends Component {
let Total_rate_dataList = (value) => { let Total_rate_dataList = (value) => {
let target_listres = []; let target_listres = [];
if(value!=undefined){ if (value != undefined) {
for(let i = 0; i < value.length; i++) { for (let i = 0; i < value.length; i++) {
if(i===value.length-1){ if (i === value.length - 1) {
target_listres.push(<span className="column-1 operationright" key={i}> target_listres.push(<span className="column-1 operationright" key={i}>
{/*<div className="color-red">{value[i].total_score}</div>*/} {/*<div className="color-red">{value[i].total_score}</div>*/}
<div className="color-red">100%</div> <div className="color-red">100%</div>
</span>) </span>)
}else{ } else {
target_listres.push(<span className={i===0?" column-2 operationleft":"column-2 operationleft"} key={i}> target_listres.push(<span className={i === 0 ? " column-2 operationleft" : "column-2 operationleft"} key={i}>
{/*<div>{value[i].score}</div>*/} {/*<div>{value[i].score}</div>*/}
{/*<div className="color-redFF">占比{(value[i].rate*100).toFixed(2)}%</div>*/} {/*<div className="color-redFF">占比{(value[i].rate*100).toFixed(2)}%</div>*/}
<div> <div>
{(value[i].rate*100).toFixed(2)}% {(value[i].rate * 100).toFixed(2)}%
</div> </div>
</span>) </span>)
} }
} }
return target_listres return target_listres
}else{ } else {
target_listres.push(<span className="column-1 operationright"> target_listres.push(<span className="column-1 operationright">
{/*<div className="color-red">{value[i].total_score}</div>*/} {/*<div className="color-red">{value[i].total_score}</div>*/}
<div className="">--</div> <div className="">--</div>
@ -419,11 +419,11 @@ class EcCompletionCalculation extends Component {
} }
} }
let newTotal_rate_dataList = (length,value) => { let newTotal_rate_dataList = (length, value) => {
let target_listres = []; let target_listres = [];
if(value!=undefined){ if (value != undefined) {
for(let i = 0; i < value.length; i++) { for (let i = 0; i < value.length; i++) {
// if(i===0){ // if(i===0){
// target_listres.push(<span className="column-2 color-05101A" key={i}> // target_listres.push(<span className="column-2 color-05101A" key={i}>
@ -435,7 +435,7 @@ class EcCompletionCalculation extends Component {
// </span>) // </span>)
// } // }
if(i<value.length-1){ if (i < value.length - 1) {
target_listres.push(<span className="column-2 color-05101A" key={i}> target_listres.push(<span className="column-2 color-05101A" key={i}>
<div>{value[i].score.toFixed(2)}</div> <div>{value[i].score.toFixed(2)}</div>
</span>) </span>)
@ -460,12 +460,12 @@ class EcCompletionCalculation extends Component {
<div className="task-popup-text-center font-14">{completionlist}</div> <div className="task-popup-text-center font-14">{completionlist}</div>
</div> </div>
{ {
calculatesetype===true? calculatesetype === true ?
<div className="task-popup-submit clearfix" <div className="task-popup-submit clearfix"
style={{width:'69px'}} style={{ width: '69px' }}
> >
<a className="task-btn task-btn-orange fr" <a className="task-btn task-btn-orange fr"
style={{fontWeight: '400'}} style={{ fontWeight: '400' }}
onClick={this.hidecompletion} onClick={this.hidecompletion}
>知道啦</a> >知道啦</a>
</div> </div>
@ -545,33 +545,33 @@ class EcCompletionCalculation extends Component {
<span className="column-1 operationright color-666">权重</span> <span className="column-1 operationright color-666">权重</span>
</p> </p>
{ Spintype===true?<Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:"" } {Spintype === true ? <Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />} /> : ""}
{ target_list.length===0&&Spintype===false? {target_list.length === 0 && Spintype === false ?
<li className={ "clearfix newtarget_scoreclass lipadding10im"}> <li className={"clearfix newtarget_scoreclass lipadding10im"}>
<span className="column-1 color-05101A">--</span> <span className="column-1 color-05101A">--</span>
<span className="column-575 color-05101A">--</span> <span className="column-575 color-05101A">--</span>
<span className={"column-1 operationright Systemnum"}>--</span> <span className={"column-1 operationright Systemnum"}>--</span>
<span className="column-1 operationright color-05101A">--</span> <span className="column-1 operationright color-05101A">--</span>
<span className="column-1 operationright">--</span> <span className="column-1 operationright">--</span>
<span className="column-1 operationright">--</span> <span className="column-1 operationright">--</span>
</li>:""} </li> : ""}
{Spintype===false?target_list.map((item,key)=>{ {Spintype === false ? target_list.map((item, key) => {
return( return (
<li className={key+1===target_list.length?"clearfix newtarget_target lipadding10im":"clearfix newtarget_scoreclass lipadding10im"} key={key}> <li className={key + 1 === target_list.length ? "clearfix newtarget_target lipadding10im" : "clearfix newtarget_scoreclass lipadding10im"} key={key}>
<span className="column-1 color-05101A">{key+1}</span> <span className="column-1 color-05101A">{key + 1}</span>
<span className="column-575 color-05101A">{item.content}</span> <span className="column-575 color-05101A">{item.content}</span>
<span className={item.status==="not_achieved"?"column-1 operationright Systemnum":"column-1 operationright color-green"}>{item.status==="not_achieved"?"未达成":"已达成"}</span> <span className={item.status === "not_achieved" ? "column-1 operationright Systemnum" : "column-1 operationright color-green"}>{item.status === "not_achieved" ? "未达成" : "已达成"}</span>
<span className="column-1 operationright color-05101A ">{item.standard_grade}</span> <span className="column-1 operationright color-05101A ">{item.standard_grade}</span>
<span className="column-1 operationright">{item.actually_grade}</span> <span className="column-1 operationright">{item.actually_grade}</span>
<span className="column-1 operationright">{item.weight}</span> <span className="column-1 operationright">{item.weight}</span>
</li> </li>
) )
}):"" }) : ""
} }
@ -580,8 +580,8 @@ class EcCompletionCalculation extends Component {
<div className="edu-back-white eacourse"> <div className="edu-back-white eacourse">
<div className="padding1030" id="training_objective_contents"> <div className="padding1030" id="training_objective_contents">
<span className="fl SystemParameters lineheight60" style={{height:'46px'}}> 毕业要求指标点达成评价结果</span> <span className="fl SystemParameters lineheight60" style={{ height: '46px' }}> 毕业要求指标点达成评价结果</span>
<span className="right ml20 SystemParameters" style={{height:'46px'}}><span className="color-green"><i class="iconfont icon-gouxuan color-green font-16 mr5"></i></span> <i class="iconfont icon-guanbi font-14 mr5"></i></span> <span className="right ml20 SystemParameters" style={{ height: '46px' }}><span className="color-green"><i class="iconfont icon-gouxuan color-green font-16 mr5"></i></span> <i class="iconfont icon-guanbi font-14 mr5"></i></span>
</div> </div>
</div> </div>
@ -589,8 +589,8 @@ class EcCompletionCalculation extends Component {
<div className="ListTableLine newSystem mb20 graduateRequirement " id="school_major_list"> <div className="ListTableLine newSystem mb20 graduateRequirement " id="school_major_list">
{ {
graduation_list.length===0? graduation_list.length === 0 ?
<p className="clearfix lipadding20im" style={{minWidth:'1200px'}}> <p className="clearfix lipadding20im" style={{ minWidth: '1200px' }}>
<span className="column-1 color-666 mr16">毕业要求</span> <span className="column-1 color-666 mr16">毕业要求</span>
<span className="nowrap329">{5}</span> <span className="nowrap329">{5}</span>
@ -600,24 +600,24 @@ class EcCompletionCalculation extends Component {
<span className="column-1 operationright color-666">课程权重</span> <span className="column-1 operationright color-666">课程权重</span>
{TargetresList(5)} {TargetresList(5)}
</p> </p>
:"" : ""
} }
{ Spintype===true?<Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:"" } {Spintype === true ? <Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />} /> : ""}
{ {
graduation_list.length===0&&Spintype===false? graduation_list.length === 0 && Spintype === false ?
<li className={'clearfix newtarget_scoreclass marlr19'} style={{minWidth:'1137px'}}> <li className={'clearfix newtarget_scoreclass marlr19'} style={{ minWidth: '1137px' }}>
{/* <span className="column-1 color-05101A ec_graduation_name">{item.ec_graduation_name}</span> */} {/* <span className="column-1 color-05101A ec_graduation_name">{item.ec_graduation_name}</span> */}
<span className="column-1 color-05101A ec_graduation_name">{1}</span> <span className="column-1 color-05101A ec_graduation_name">{1}</span>
<span className="column-500 color-05101A">{"--"}</span> <span className="column-500 color-05101A">{"--"}</span>
<span className={"column-1 operationright Systemnum mrj15"}>{"--"}</span> <span className={"column-1 operationright Systemnum mrj15"}>{"--"}</span>
<span className="column-1 operationright color-05101A">{"--"}</span> <span className="column-1 operationright color-05101A">{"--"}</span>
<span className="column-1 operationright">{"--"}</span> <span className="column-1 operationright">{"--"}</span>
<span className="column-1 operationright"> <a href={`/ecs/major_schools/${this.props.match.params.majorId}/years/${this.props.match.params.yearId}/requirement_vs_courses`} style={{color:'rgb(76, 172, 255)'}}>立即配置</a></span> <span className="column-1 operationright"> <a href={`/ecs/major_schools/${this.props.match.params.majorId}/years/${this.props.match.params.yearId}/requirement_vs_courses`} style={{ color: 'rgb(76, 172, 255)' }}>立即配置</a></span>
{TargetresContentList(5,[2,2,2,2,2])} {TargetresContentList(5, [2, 2, 2, 2, 2])}
</li> </li>
:"" : ""
} }
<style> <style>
{ {
@ -631,11 +631,11 @@ class EcCompletionCalculation extends Component {
} }
</style> </style>
{ {
Spintype===false?graduation_list.map((item,key)=>{ Spintype === false ? graduation_list.map((item, key) => {
if(key===0){ if (key === 0) {
return( return (
<li key={key} className="clearfix lipadding20im myliysls" style={{minWidth: ec_course_targets_count > 5 ? (76*(ec_course_targets_count+4)+380+15):1200+"px"}}> <li key={key} className="clearfix lipadding20im myliysls" style={{ minWidth: ec_course_targets_count > 5 ? (76 * (ec_course_targets_count + 4) + 380 + 15) : 1200 + "px" }}>
<div className="myliysls"> <div className="myliysls">
<span className="column-1 color-666 mr16">毕业要求</span> <span className="column-1 color-666 mr16">毕业要求</span>
</div> </div>
@ -653,7 +653,7 @@ class EcCompletionCalculation extends Component {
) )
} }
}):"" }) : ""
} }
{/*mynewtarget_scoreclassysls*/} {/*mynewtarget_scoreclassysls*/}
<style> <style>
@ -669,23 +669,23 @@ class EcCompletionCalculation extends Component {
</style> </style>
<div className=""> <div className="">
{ {
Spintype===false?graduation_list.map((item,key)=>{ Spintype === false ? graduation_list.map((item, key) => {
return( return (
<li key={key} className="clearfix lipadding20im myliysls" style={{minWidth: ec_course_targets_count > 5 ? (76*(ec_course_targets_count+4)+380+15):1200+"px"}}> <li key={key} className="clearfix lipadding20im myliysls" style={{ minWidth: ec_course_targets_count > 5 ? (76 * (ec_course_targets_count + 4) + 380 + 15) : 1200 + "px" }}>
<div className="myliysls "> <div className="myliysls ">
<span className="column-1 color-05101A mr16" >{key+1}</span> <span className="column-1 color-05101A mr16" >{key + 1}</span>
</div> </div>
<span className="column-500 color-05101A" data-tip-down={item.content}>{item.content}</span> <span className="column-500 color-05101A" data-tip-down={item.content}>{item.content}</span>
<div className="myliysls"> <div className="myliysls">
{TargetresContentList(target_list,item.support_course_target_ids)} {TargetresContentList(target_list, item.support_course_target_ids)}
</div> </div>
<div className="myliysls"> <div className="myliysls">
{item.weights===null||item.weights===undefined||item.weights==="0.00"||item.weights===0.00||item.weights===0?<span className="column-1 " ><a href={`/ecs/major_schools/${this.props.match.params.majorId}/years/${this.props.match.params.yearId}/requirement_vs_courses`} style={{color:'rgb(76, 172, 255)'}}>立即配置</a></span>:<span className="column-1 " style={{textAlign:"center"}}>{item.weights}</span>} {item.weights === null || item.weights === undefined || item.weights === "0.00" || item.weights === 0.00 || item.weights === 0 ? <span className="column-1 " ><a href={`/ecs/major_schools/${this.props.match.params.majorId}/years/${this.props.match.params.yearId}/requirement_vs_courses`} style={{ color: 'rgb(76, 172, 255)' }}>立即配置</a></span> : <span className="column-1 " style={{ textAlign: "center" }}>{item.weights}</span>}
<span className="column-1 " style={{textAlign:"center"}}>{item.actually_achievement===null?0:item.actually_achievement}</span> <span className="column-1 " style={{ textAlign: "center" }}>{item.actually_achievement === null ? 0 : item.actually_achievement}</span>
<span className="column-1 color-05101A" style={{textAlign:"center"}}>{item.objective_achievement===null?0:item.objective_achievement}</span> <span className="column-1 color-05101A" style={{ textAlign: "center" }}>{item.objective_achievement === null ? 0 : item.objective_achievement}</span>
<span className={item.status==="not_achieved"?"column-1 Systemnum mrj15":"column-1 color-green mrj15"} style={{textAlign:"center"}}>{item.status==="not_achieved"?"未完成":"完成"}</span> <span className={item.status === "not_achieved" ? "column-1 Systemnum mrj15" : "column-1 color-green mrj15"} style={{ textAlign: "center" }}>{item.status === "not_achieved" ? "未完成" : "完成"}</span>
</div> </div>
</li> </li>
@ -702,7 +702,7 @@ class EcCompletionCalculation extends Component {
// </li> // </li>
) )
}):"" }) : ""
} }
@ -714,19 +714,19 @@ class EcCompletionCalculation extends Component {
<div className="edu-back-white eacourse"> <div className="edu-back-white eacourse">
<div className="padding1030" id="training_objective_contents"> <div className="padding1030" id="training_objective_contents">
<span className="fl SystemParameters lineheight60" style={{height:'46px'}}>课程总评成绩表</span> <span className="fl SystemParameters lineheight60" style={{ height: '46px' }}>课程总评成绩表</span>
</div> </div>
</div> </div>
<div className="ListTableLine newSystem mb20" id="school_major_list"> <div className="ListTableLine newSystem mb20" id="school_major_list">
<p className="clearfix padding10im" style={{width: total_rate_data > 5 ? (180 * total_rate_data+226+16) : 1200+"px"}}> <p className="clearfix padding10im" style={{ width: total_rate_data > 5 ? (180 * total_rate_data + 226 + 16) : 1200 + "px" }}>
{/*<span className="column-1 color-666 mr16 width86">序号</span>*/} {/*<span className="column-1 color-666 mr16 width86">序号</span>*/}
<span className="column-1 color-666 mr16 width86">课程目标</span> <span className="column-1 color-666 mr16 width86">课程目标</span>
{/*<span className="column-1 color-666 mr16">姓名</span>*/} {/*<span className="column-1 color-666 mr16">姓名</span>*/}
{/*<span className="column-1 color-666 mr16">学号</span>*/} {/*<span className="column-1 color-666 mr16">学号</span>*/}
{TargetresLists(total_rate_data-1)} {TargetresLists(total_rate_data - 1)}
<span className="column-1 operationright color-666">总评成绩</span> <span className="column-1 operationright color-666">总评成绩</span>
</p> </p>
{/*style={{width: 113*(total_rate_data+4)>1136?113*(total_rate_data+4.5):1136+"px"}}*/} {/*style={{width: 113*(total_rate_data+4)>1136?113*(total_rate_data+4.5):1136+"px"}}*/}
@ -749,18 +749,18 @@ class EcCompletionCalculation extends Component {
// }) */} // }) */}
} }
{ Spintype===true?<Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:"" } {Spintype === true ? <Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />} /> : ""}
{ {
Spintype===false? <li className={"clearfix newtarget_scoreclass lipadding10im margin64px"} style={{width: total_rate_data > 5 ? (180 * total_rate_data+226+16) : 1200 + "px"}}> Spintype === false ? <li className={"clearfix newtarget_scoreclass lipadding10im margin64px"} style={{ width: total_rate_data > 5 ? (180 * total_rate_data + 226 + 16) : 1200 + "px" }}>
<span className="column-1 color-05101A mr16 width86">占比</span> <span className="column-1 color-05101A mr16 width86">占比</span>
{/*colorTransparent*/} {/*colorTransparent*/}
{/*<span className="column-1 color-05101A ec_graduation_name mr16 colorTransparent"> 平均数 </span>*/} {/*<span className="column-1 color-05101A ec_graduation_name mr16 colorTransparent"> 平均数 </span>*/}
{/*<span className="column-1 color-05101A ec_graduation_name mr16 colorTransparent "> 平均数 </span>*/} {/*<span className="column-1 color-05101A ec_graduation_name mr16 colorTransparent "> 平均数 </span>*/}
{Total_rate_dataList(course_total_score)} {Total_rate_dataList(course_total_score)}
{ {
course_rate===undefined||course_rate===null||course_rate===""||course_rate==="0"||course_rate===0? <span className="column-1 operationright">--</span>:<span className="column-1 color-red operationright">{course_rate}</span> course_rate === undefined || course_rate === null || course_rate === "" || course_rate === "0" || course_rate === 0 ? <span className="column-1 operationright">--</span> : <span className="column-1 color-red operationright">{course_rate}</span>
} }
</li>:"" </li> : ""
} }
{/*style={{width: 113*(total_rate_data+4)>1136?113*(total_rate_data+4):1136+"px"}}*/} {/*style={{width: 113*(total_rate_data+4)>1136?113*(total_rate_data+4):1136+"px"}}*/}
{ {
@ -784,22 +784,22 @@ class EcCompletionCalculation extends Component {
// }) // })
} }
{ {
Spintype===false?<li className={"clearfix newtarget_scoreclass lipadding10im bordereaeaea"} style={{width: 113*(total_rate_data+4)>1200?(113*(total_rate_data+4.5))+63:1200+"px"}}> Spintype === false ? <li className={"clearfix newtarget_scoreclass lipadding10im bordereaeaea"} style={{ width: 113 * (total_rate_data + 4) > 1200 ? (113 * (total_rate_data + 4.5)) + 63 : 1200 + "px" }}>
{/*<span className="column-1 color-05101A mr16 width86">{k+1}</span>*/} {/*<span className="column-1 color-05101A mr16 width86">{k+1}</span>*/}
<span className="column-1 color-05101A mr16 width86">平均分</span> <span className="column-1 color-05101A mr16 width86">平均分</span>
{/*<span className="column-1 color-05101A ec_graduation_name mr16">{i.student_scores.name}</span>*/} {/*<span className="column-1 color-05101A ec_graduation_name mr16">{i.student_scores.name}</span>*/}
{/*<span className="column-1 color999 ec_graduation_name mr16 ">{i.student_scores.student_number}</span>*/} {/*<span className="column-1 color999 ec_graduation_name mr16 ">{i.student_scores.student_number}</span>*/}
{newTotal_rate_dataList(course_total_score-1,course_total_score)} {newTotal_rate_dataList(course_total_score - 1, course_total_score)}
{/* <span className="column-1 color-red operationright">{course_total_score.length===0?"":course_total_score[course_total_score-1].total_score}</span> */} {/* <span className="column-1 color-red operationright">{course_total_score.length===0?"":course_total_score[course_total_score-1].total_score}</span> */}
{ {
course_achievement===undefined||course_achievement===null||course_achievement===""||course_achievement==="0"||course_achievement===0? <span className="column-1 operationright">--</span>:<span className="column-1 color-red operationright">{course_achievement}</span> course_achievement === undefined || course_achievement === null || course_achievement === "" || course_achievement === "0" || course_achievement === 0 ? <span className="column-1 operationright">--</span> : <span className="column-1 color-red operationright">{course_achievement}</span>
} }
</li>:"" </li> : ""
} }
<li class="clearfix newtarget_scoreclass" style={{width: 113*(total_rate_data+4)>1136?113*(total_rate_data+4):1136+"px",display:morelisttype===true?"block":"none"}}> <li class="clearfix newtarget_scoreclass" style={{ width: 113 * (total_rate_data + 4) > 1136 ? 113 * (total_rate_data + 4) : 1136 + "px", display: morelisttype === true ? "block" : "none" }}>
<a className={"ecmorelist"} onClick={()=>this.showmorelist()}>加载更多</a> <a className={"ecmorelist"} onClick={() => this.showmorelist()}>加载更多</a>
</li> </li>
</div> </div>
@ -808,7 +808,7 @@ class EcCompletionCalculation extends Component {
<div className="edu-back-white eacourse"> <div className="edu-back-white eacourse">
<div className="padding1030" id="training_objective_contents"> <div className="padding1030" id="training_objective_contents">
<span className="fl SystemParameters lineheight60" style={{height:'46px'}}>课程目标成绩分析</span> <span className="fl SystemParameters lineheight60" style={{ height: '46px' }}>课程目标成绩分析</span>
</div> </div>
</div> </div>
@ -822,8 +822,8 @@ class EcCompletionCalculation extends Component {
<span className="column-1 color-666">最高分数</span> <span className="column-1 color-666">最高分数</span>
<span className="column-1 color-666">最低分数</span> <span className="column-1 color-666">最低分数</span>
{ {
score_levels&&score_levels.map((i,k)=>{ score_levels && score_levels.map((i, k) => {
return( return (
<span className="column-1 color-666">{i.description}</span> <span className="column-1 color-666">{i.description}</span>
) )
}) })
@ -831,21 +831,21 @@ class EcCompletionCalculation extends Component {
</p> </p>
{ {
Spintype===false?target_list.map((i,k)=>{ Spintype === false ? target_list.map((i, k) => {
return( return (
<li className={"clearfix newtarget_scoreclass lipadding10im"} key={k}> <li className={"clearfix newtarget_scoreclass lipadding10im"} key={k}>
<span className="column-1 color-05101A">{k+1}</span> <span className="column-1 color-05101A">{k + 1}</span>
<span className="column-1 color-05101A">{i.standard_grade}</span> <span className="column-1 color-05101A">{i.standard_grade}</span>
<span className="column-1 colorFF6800">{i.maximum_score===null || i.maximum_score===undefined ||i.maximum_score===""?"--":i.maximum_score}</span> <span className="column-1 colorFF6800">{i.maximum_score === null || i.maximum_score === undefined || i.maximum_score === "" ? "--" : i.maximum_score}</span>
<span className="column-1 color-green">{i.minimum_score===null || i.minimum_score===undefined || i.minimum_score===""?"--":i.minimum_score}</span> <span className="column-1 color-green">{i.minimum_score === null || i.minimum_score === undefined || i.minimum_score === "" ? "--" : i.minimum_score}</span>
{ {
i.score_levels.map((j,l)=>{ i.score_levels.map((j, l) => {
return( return (
<span key={l} className="column-1 color-05101A"> <span key={l} className="column-1 color-05101A">
<div>{j.count}</div> <div>{j.count}</div>
<div className="color999">{j.rate===null||j.rate===undefined||j.rate===""||j.rate===0?0.00:j.rate}%</div> <div className="color999">{j.rate === null || j.rate === undefined || j.rate === "" || j.rate === 0 ? 0.00 : j.rate}%</div>
</span> </span>
) )
} }
@ -881,12 +881,12 @@ class EcCompletionCalculation extends Component {
</li> </li>
) )
}):"" }) : ""
} }
{ Spintype===true?<Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />}/>:"" } {Spintype === true ? <Spin className="Spinlarge" indicator={<Icon type="loading" style={{ fontSize: 30 }} spin />} /> : ""}
{target_list.length===0&&Spintype===false? {target_list.length === 0 && Spintype === false ?
<li className={"clearfix newtarget_scoreclass lipadding10im"}> <li className={"clearfix newtarget_scoreclass lipadding10im"}>
<span className="column-1 color-05101A">--</span> <span className="column-1 color-05101A">--</span>
<span className="column-1 color-05101A">--</span> <span className="column-1 color-05101A">--</span>
@ -916,7 +916,7 @@ class EcCompletionCalculation extends Component {
<div>--</div> <div>--</div>
<div className="color999">--%</div> <div className="color999">--%</div>
</span> </span>
</li>:""} </li> : ""}
</div> </div>
@ -926,5 +926,5 @@ class EcCompletionCalculation extends Component {
} }
} }
export default SnackbarHOC() (EcCompletionCalculation); export default SnackbarHOC()(EcCompletionCalculation);

@ -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,55 +19,57 @@ 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) {
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,
}); });
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: []
}); });
} }
@ -81,37 +83,38 @@ class EcStudentList extends Component {
}); });
} }
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: []
}); });
} }
@ -125,93 +128,95 @@ class EcStudentList extends Component {
} }
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: []
}); });
} }
@ -223,82 +228,84 @@ class EcStudentList extends Component {
}); });
}; };
//全选 //全选
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){ }
}).then((response) => {
if (response.data.status === 0) {
this.setState({ this.setState({
// Modallist: "删除成功!", // Modallist: "删除成功!",
// Modallisttype:true, // Modallisttype:true,
Modallisttypes:1, Modallisttypes: 1,
Modallisttypess:0 Modallisttypess: 0
}) })
this.hidemodeldelete(1); this.hidemodeldelete(1);
} }
@ -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',
@ -349,11 +356,11 @@ class EcStudentList extends Component {
<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>
} }
@ -378,14 +385,14 @@ class EcStudentList extends Component {
</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>}
@ -393,7 +400,7 @@ class EcStudentList extends Component {
</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>
@ -404,7 +411,7 @@ class EcStudentList extends Component {
<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>
@ -421,23 +428,23 @@ class EcStudentList extends Component {
}</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>
@ -465,13 +472,13 @@ 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>
@ -485,5 +492,5 @@ class EcStudentList extends Component {
} }
} }
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,33 +24,29 @@ 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 {
@ -100,7 +88,7 @@ class ForumsIndex extends Component {
} }
initForumState(data) { initForumState(data) {
this.setState({...data}) this.setState({ ...data })
} }
@ -135,7 +123,7 @@ class ForumsIndex extends Component {
const pathArray = locationPath.split('/'); const pathArray = locationPath.split('/');
const isMemoDetail = (!isWidth100 && const isMemoDetail = (!isWidth100 &&
pathArray.length === 3 && !isNaN(parseInt(pathArray[2])) ) ? true : false pathArray.length === 3 && !isNaN(parseInt(pathArray[2]))) ? true : false
const isGuide = locationPath.indexOf('/forums/categories/3') !== -1 const isGuide = locationPath.indexOf('/forums/categories/3') !== -1
@ -144,27 +132,27 @@ class ForumsIndex extends Component {
<div className="educontent mt30 clearfix"> <div className="educontent mt30 clearfix">
{/* component={TechShare} {/* 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}
/>) />)
@ -188,13 +176,13 @@ class ForumsIndex extends Component {
{/* :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>
@ -202,7 +190,7 @@ class ForumsIndex extends Component {
<Route path={`${match.path}/:memoId`} render={ <Route path={`${match.path}/:memoId`} render={
(props) => (<MemoDetail {...this.props} {...this.state} {...props} (props) => (<MemoDetail {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)} initForumState={(data) => this.initForumState(data)}
/>) />)
}></Route> }></Route>
@ -218,19 +206,19 @@ class ForumsIndex extends Component {
{/* 右边栏 */} {/* 右边栏 */}
{ !isWidth100 && <div className="with25 fl"> {!isWidth100 && <div className="with25 fl">
<div className="ml20"> <div className="ml20">
{isMemoDetail ? {isMemoDetail ?
<React.Fragment> <React.Fragment>
<UserSection {...this.props} {...this.state} initForumState={(data)=>this.initForumState(data)} ></UserSection> <UserSection {...this.props} {...this.state} initForumState={(data) => this.initForumState(data)} ></UserSection>
{/*todo 新增RightMemoLabel 和 推荐实训RecommendShixun */} {/*todo 新增RightMemoLabel 和 推荐实训RecommendShixun */}
{ memo && memo.tag && <RightMemoLabel {...this.props} {...this.state}></RightMemoLabel> } {memo && memo.tag && <RightMemoLabel {...this.props} {...this.state}></RightMemoLabel>}
<RecommendShixun {...this.props} {...this.state}></RecommendShixun> <RecommendShixun {...this.props} {...this.state}></RecommendShixun>
</React.Fragment> </React.Fragment>
: :
<React.Fragment> <React.Fragment>
<RightMyPublish {...this.props} {...this.state} setSearchValue={this.setSearchValue}></RightMyPublish> <RightMyPublish {...this.props} {...this.state} setSearchValue={this.setSearchValue}></RightMyPublish>
{ !isGuide && <RightHotLabel {...this.props} {...this.state} ></RightHotLabel> } {!isGuide && <RightHotLabel {...this.props} {...this.state} ></RightHotLabel>}
<RightHotQuestion {...this.props} {...this.state} ></RightHotQuestion> <RightHotQuestion {...this.props} {...this.state} ></RightHotQuestion>
<RecommendShixun {...this.props} {...this.state}></RecommendShixun> <RecommendShixun {...this.props} {...this.state}></RecommendShixun>
</React.Fragment> </React.Fragment>
@ -249,7 +237,7 @@ class ForumsIndex extends Component {
} }
} }
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,22 +1,11 @@
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'
@ -55,13 +44,13 @@ class MemoMyPublish extends Component {
return ( return (
<React.Fragment> <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>
@ -70,4 +59,4 @@ class MemoMyPublish extends Component {
} }
} }
export default postPaginationHOC({ isMyPublish: true }) ( MemoMyPublish ); export default postPaginationHOC({ isMyPublish: true })(MemoMyPublish);

@ -1,17 +1,8 @@
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'
@ -53,8 +44,8 @@ class MemoGuide extends Component {
{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>
@ -62,4 +53,4 @@ class MemoGuide extends Component {
} }
} }
export default postPaginationHOC( MemoGuide ); export default postPaginationHOC(MemoGuide);

@ -1,18 +1,8 @@
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'
@ -73,12 +63,12 @@ class MemoHottest extends Component {
{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( MemoHottest ); export default postPaginationHOC(MemoHottest);

@ -1,18 +1,8 @@
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'
@ -52,12 +42,12 @@ class MemoNewest extends Component {
<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( MemoNewest ); export default postPaginationHOC(MemoNewest);

@ -1,21 +1,9 @@
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'
@ -45,7 +33,7 @@ class MemoTechShare extends Component {
// this.unlisten(); // this.unlisten();
} }
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
if(this.props.match.params.memoType !== prevProps.match.params.memoType) { if (this.props.match.params.memoType !== prevProps.match.params.memoType) {
// do something // do something
console.log(`memoType changed`) console.log(`memoType changed`)
this.props.fetchMemos(); this.props.fetchMemos();
@ -99,13 +87,13 @@ class MemoTechShare extends Component {
} }
render() { render() {
const { match, history, currentPage, memo_count ,memo_list } = this.props const { match, history, currentPage, memo_count, memo_list } = this.props
return ( return (
<React.Fragment> <React.Fragment>
<ForumsNavTab {...this.props}></ForumsNavTab> <ForumsNavTab {...this.props}></ForumsNavTab>
<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>
@ -113,4 +101,4 @@ class MemoTechShare extends Component {
} }
} }
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,17 +23,17 @@ 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;
@ -54,40 +52,40 @@ 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);
} }
@ -97,90 +95,90 @@ class Messagerouting extends Component{
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 (
@ -192,24 +190,24 @@ class Messagerouting extends Component{
<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>
@ -230,19 +228,19 @@ class Messagerouting extends Component{
{/*/!*消息自路由*! 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>
@ -257,4 +255,4 @@ class Messagerouting extends Component{
) )
} }
} }
export default SnackbarHOC() (TPMIndexHOC ( Messagerouting )); export default SnackbarHOC()(TPMIndexHOC(Messagerouting));

@ -1,13 +1,13 @@
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';
@ -15,83 +15,83 @@ 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}>
@ -109,7 +109,7 @@ class Index extends Component{
<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>
@ -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,13 +263,13 @@ 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
@ -276,28 +278,28 @@ class Osshackathon extends Component {
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{
@ -307,9 +309,9 @@ class Osshackathon extends Component {
} }
</style>} </style>}
{hackathonedit===true?"":<Divider />} {hackathonedit === true ? "" : <Divider />}
{opentitletype===true?<style> {opentitletype === true ? <style>
{ {
` `
.Osshackathonfontlist{ .Osshackathonfontlist{
@ -318,35 +320,35 @@ class Osshackathon extends Component {
} }
` `
} }
</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"}>
@ -354,22 +356,22 @@ class Osshackathon extends Component {
</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 {
@ -383,10 +385,10 @@ class Osshackathon extends Component {
} }
` `
} }
</style>:""} </style> : ""}
{ {
this.props.user&&this.props.user.admin===true?data&&data.hacks.length==0?"":data&&data.hacks.map((item,key)=>{ this.props.user && this.props.user.admin === true ? data && data.hacks.length == 0 ? "" : data && data.hacks.map((item, key) => {
return( return (
<Card className={"OsshackathonCard mb20"}> <Card className={"OsshackathonCard mb20"}>
<Row> <Row>
<Col span={20} className={"OsshackathonCardtitle"}> <Col span={20} className={"OsshackathonCardtitle"}>
@ -394,8 +396,8 @@ class Osshackathon extends Component {
</Col> </Col>
<Col span={4} className={"fr textcenter width14bai"}> <Col span={4} className={"fr textcenter width14bai"}>
<Breadcrumb separator=""> <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.editSignupentry(item.id, item.name, item.description)}>编辑</Breadcrumb.Item>
<Breadcrumb.Item className={"Breadcrumbfont iscursor"} onClick={()=>this.delSignupentry(item.id)}>删除</Breadcrumb.Item> <Breadcrumb.Item className={"Breadcrumbfont iscursor"} onClick={() => this.delSignupentry(item.id)}>删除</Breadcrumb.Item>
</Breadcrumb> </Breadcrumb>
</Col> </Col>
</Row> </Row>
@ -423,20 +425,21 @@ class Osshackathon extends Component {
</Card> </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>
{/*编辑页面*/} {/*编辑页面*/}
<Route path="/paths/:pathId" <Route path="/paths/:pathId"
render={(props)=>(<PathsDetail {...this.props} {...this.state} {...props}/>)} render={(props) => (<PathsDetail {...this.props} {...this.state} {...props} />)}
></Route> ></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 = '众包创新'
} }
@ -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,16 +592,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.getdata(data); this.getdata(data);
@ -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();
@ -691,25 +682,25 @@ class NewMyShixunModel extends Component {
}) })
} }
// 撤销 // 撤销
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();
@ -717,25 +708,27 @@ class NewMyShixunModel extends Component {
}).catch((error) => { }).catch((error) => {
////console.log(error); ////console.log(error);
}) })
}else{ } else {
url=`/examination_banks/${this.props.exam_id}/revoke_item.json`; url = `/examination_banks/${this.props.exam_id}/revoke_item.json`;
axios.delete(url,{ data: { axios.delete(url, {
item_id:id===undefined?"":parseInt(id), 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();
@ -748,67 +741,69 @@ class NewMyShixunModel extends Component {
} }
//全选试题库 //全选试题库
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
@ -870,7 +865,7 @@ class NewMyShixunModel extends Component {
{ {
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,17 +918,17 @@ 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)}
@ -941,16 +936,16 @@ class NewMyShixunModel extends Component {
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>
} }

@ -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,7 +54,7 @@ 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);
@ -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,22 +195,22 @@ 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,
@ -241,12 +225,12 @@ class Paperreview extends Component {
//console.log(error); //console.log(error);
}) })
}else{ } else {
this.setCohetepaperbool(true); this.setCohetepaperbool(true);
} }
}else{ } else {
//智能组卷 //智能组卷
this.setIntelligentformation(true); this.setIntelligentformation(true);
@ -264,29 +248,29 @@ 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,26 +281,26 @@ 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) => {
@ -330,10 +314,10 @@ class Paperreview extends Component {
}) })
} }
//换题 //换题
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) => {
@ -347,19 +331,19 @@ class Paperreview extends Component {
}) })
} }
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,8 +410,8 @@ 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>
: :
@ -447,8 +431,8 @@ 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>
) )

@ -1,22 +1,12 @@
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, Drawer } from "antd";
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Tooltip
} 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 TPMIndexHOC from "../tpm/TPMIndexHOC";
import NoneData from './component/NoneData'; import NoneData from './component/NoneData';
import './questioncss/questioncom.css'; import './questioncss/questioncom.css';
import SiderBars from "../question/component/SiderBars"; import SiderBars from "../question/component/SiderBars";
@ -26,16 +16,16 @@ class Question 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,
@ -53,109 +43,109 @@ class Question 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,
chakanjiexiboolindex:"无", chakanjiexiboolindex: "无",
} }
} }
chakanjiexibool=(index)=>{ chakanjiexibool = (index) => {
if(this.state.chakanjiexiboolindex===index){ if (this.state.chakanjiexiboolindex === index) {
this.setState({ this.setState({
chakanjiexiboolindex:"无", chakanjiexiboolindex: "无",
}) })
return return
} }
this.setState({ this.setState({
chakanjiexiboolindex:index, chakanjiexiboolindex: index,
}) })
} }
setmychakanjiexibool=(str)=>{ setmychakanjiexibool = (str) => {
this.setState({ this.setState({
chakanjiexiboolindex:str, chakanjiexiboolindex: str,
}) })
} }
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
}; };
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
}; };
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
}; };
this.getdata(data); this.getdata(data);
} }
@ -176,9 +166,11 @@ class Question extends Component {
this.getbasket_listdata(); this.getbasket_listdata();
//获取题库筛选资料 //获取题库筛选资料
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) {
@ -192,21 +184,21 @@ class Question 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
}; };
this.getdata(data); this.getdata(data);
@ -216,15 +208,15 @@ class Question 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
@ -244,7 +236,7 @@ class Question extends Component {
}).catch((error) => { }).catch((error) => {
//////console.log(error) //////console.log(error)
this.setState({ this.setState({
booljupyterurls:false, booljupyterurls: false,
}) })
}); });
} }
@ -253,12 +245,12 @@ class Question 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
@ -283,43 +275,43 @@ class Question 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,
}) })
} }
} }
@ -329,27 +321,27 @@ class Question 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
}; };
this.getdata(data); this.getdata(data);
this.setmychakanjiexibool("无") this.setmychakanjiexibool("无")
} }
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,
}); });
@ -405,19 +397,19 @@ class Question 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
@ -442,22 +434,22 @@ class Question 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
}; };
this.getdata(data); this.getdata(data);
@ -468,22 +460,22 @@ class Question 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
}; };
this.getdata(data); this.getdata(data);
@ -528,16 +520,16 @@ class Question 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
}; };
this.getdata(data); this.getdata(data);
@ -552,15 +544,15 @@ class Question 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,
}; };
this.getdata(data); this.getdata(data);
} }
@ -577,15 +569,15 @@ class Question 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,
}; };
this.getdata(data); this.getdata(data);
} }
@ -628,24 +620,24 @@ class Question extends Component {
//选用 //选用
getitem_baskets=(data)=>{ getitem_baskets = (data) => {
//选用题型可以上传单个 或者多个题型 //选用题型可以上传单个 或者多个题型
let url="/item_baskets.json"; let url = "/item_baskets.json";
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(`选用成功`);
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,
}; };
this.getdatasy(data); this.getdatasy(data);
this.getbasket_listdata(); this.getbasket_listdata();
@ -658,24 +650,24 @@ class Question extends Component {
}) })
} }
// 撤销 // 撤销
getitem_basketss=(id)=>{ getitem_basketss = (id) => {
//选用题型可以上传单个 或者多个题型 //选用题型可以上传单个 或者多个题型
let url=`/item_baskets/${id}.json`; let 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,
}; };
this.getdatasy(data); this.getdatasy(data);
this.getbasket_listdata(); this.getbasket_listdata();
@ -685,65 +677,67 @@ class Question extends Component {
}) })
} }
//全选试题库 //全选试题库
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
} }
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,
}; };
this.getdata(data); this.getdata(data);
this.getbasket_listdata(); this.getbasket_listdata();
@ -757,30 +751,30 @@ class Question extends Component {
//跳转 //跳转
gotopaperreview=()=>{ gotopaperreview = () => {
this.props.history.replace("/paperreview/artificial"); this.props.history.replace("/paperreview/artificial");
} }
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
}; };
this.getdata(data); this.getdata(data);
} }
@ -790,9 +784,9 @@ class Question 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
@ -800,15 +794,15 @@ class Question extends Component {
+ program_questions_count + program_questions_count
+ single_questions_count + single_questions_count
+ subjective_questions_count; + subjective_questions_count;
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}>
{ {
visible===true? visible === true ?
<style> <style>
{ {
` `
@ -831,26 +825,26 @@ class Question 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>
:"" : ""
} }
@ -865,7 +859,7 @@ class Question extends Component {
} }
</style> </style>
{ {
isysladmins===true? isysladmins === true ?
<SiderBars <SiderBars
Datacount={Datacount} Datacount={Datacount}
myvisible={visible} myvisible={visible}
@ -876,7 +870,7 @@ class Question extends Component {
/> />
: :
is_teacher===true&&professional_certification===true? is_teacher === true && professional_certification === true ?
<SiderBars <SiderBars
Datacount={Datacount} Datacount={Datacount}
myvisible={visible} myvisible={visible}
@ -901,18 +895,18 @@ class Question 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,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)}
/> />
{/*头部*/} {/*头部*/}
<Contentpart {...this.state} {...this.props} <Contentpart {...this.state} {...this.props}
Isitapopup={"false"} Isitapopup={"false"}
chakanjiexiboolindex={this.state.chakanjiexiboolindex} chakanjiexiboolindex={this.state.chakanjiexiboolindex}
chakanjiexibool={(e)=>this.chakanjiexibool(e)} chakanjiexibool={(e) => this.chakanjiexibool(e)}
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)}
@ -920,16 +914,16 @@ class Question extends Component {
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>
} }
@ -990,7 +984,7 @@ class Question extends Component {
<p <p
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">单选题{'('}{single_questions_count}{')'}</p> className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">单选题{'('}{single_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i <p className="w50s intermediatecenterysls xaxisreverseorder"><i
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("SINGLE")}></i></p> className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={() => this.showQuestionModals("SINGLE")}></i></p>
</div> </div>
} }
{ {
@ -1001,7 +995,7 @@ class Question extends Component {
<p <p
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">多选题{'('}{multiple_questions_count}{')'}</p> className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">多选题{'('}{multiple_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i <p className="w50s intermediatecenterysls xaxisreverseorder"><i
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("MULTIPLE")}></i></p> className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={() => this.showQuestionModals("MULTIPLE")}></i></p>
</div> </div>
} }
{ {
@ -1012,7 +1006,7 @@ class Question extends Component {
<p <p
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">判断题{'('}{judgement_questions_count}{')'}</p> className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">判断题{'('}{judgement_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i <p className="w50s intermediatecenterysls xaxisreverseorder"><i
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("JUDGMENT")}></i></p> className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={() => this.showQuestionModals("JUDGMENT")}></i></p>
</div> </div>
} }
{ {
@ -1023,7 +1017,7 @@ class Question extends Component {
<p <p
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">填空题{'('}{completion_questions_count}{')'}</p> className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">填空题{'('}{completion_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i <p className="w50s intermediatecenterysls xaxisreverseorder"><i
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("COMPLETION")}></i></p> className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={() => this.showQuestionModals("COMPLETION")}></i></p>
</div> </div>
} }
{ {
@ -1034,7 +1028,7 @@ class Question extends Component {
<p <p
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">简答题{'('}{subjective_questions_count}{')'}</p> className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">简答题{'('}{subjective_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i <p className="w50s intermediatecenterysls xaxisreverseorder"><i
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("SUBJECTIVE")}></i></p> className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={() => this.showQuestionModals("SUBJECTIVE")}></i></p>
</div> </div>
} }
{ {
@ -1056,13 +1050,13 @@ class Question extends Component {
<p <p
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">编程题{'('}{program_questions_count}{')'}</p> className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">编程题{'('}{program_questions_count}{')'}</p>
<p className="w50s intermediatecenterysls xaxisreverseorder"><i <p className="w50s intermediatecenterysls xaxisreverseorder"><i
className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={()=>this.showQuestionModals("PROGRAM")}></i></p> className="iconfont icon-shanchu1 font-14 lg lh30 icondrawercolor " onClick={() => this.showQuestionModals("PROGRAM")}></i></p>
</div> </div>
} }
<div className="intermediatecenter verticallayout mt42"> <div className="intermediatecenter verticallayout mt42">
<div className="drawerbutton xiaoshou" onClick={()=>this.gotopaperreview()}> <div className="drawerbutton xiaoshou" onClick={() => this.gotopaperreview()}>
试卷预览 试卷预览
</div> </div>
</div> </div>

@ -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,
}) })
@ -230,7 +220,7 @@ class Questionitem_banks extends Component {
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
} }
@ -260,9 +250,9 @@ 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 = {
@ -271,7 +261,7 @@ class Questionitem_banks extends Component {
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,
@ -338,9 +328,9 @@ 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 = {
@ -349,7 +339,7 @@ class Questionitem_banks extends Component {
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,
@ -407,9 +397,9 @@ 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 = {
@ -418,7 +408,7 @@ class Questionitem_banks extends Component {
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,
@ -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 (
@ -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) => {
@ -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>
@ -383,12 +383,12 @@ class Intecomponents extends Component {
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>

@ -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 (
@ -120,13 +109,13 @@ class Paperlibraryseeid extends Component {
</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,16 +124,16 @@ 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,7 +159,7 @@ 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,14 +272,14 @@ 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);
} }
@ -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,39 +396,39 @@ 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>
@ -444,14 +437,14 @@ class Testpaperlibrary extends Component {
{...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,7 +453,7 @@ 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}

@ -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'

@ -2,13 +2,13 @@ import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import { Row, Col ,Menu,Popover,Button} from 'antd'; import { Row, Col, Menu, Popover, Button } from 'antd';
import Loading from '../../Loading'; import Loading from '../../Loading';
import Loadable from 'react-loadable'; import Loadable from 'react-loadable';
import { TPMIndexHOC } from './TPMIndexHOC'; import TPMIndexHOC from './TPMIndexHOC';
import { SnackbarHOC } from 'educoder'; import { SnackbarHOC } from 'educoder';
@ -147,48 +147,48 @@ class TPMIndex extends Component {
shixunId: undefined, shixunId: undefined,
star_info: [0, 0, 0, 0, 0, 0], star_info: [0, 0, 0, 0, 0, 0],
star_infos: [0, 0, 0, 0, 0, 0], star_infos: [0, 0, 0, 0, 0, 0],
identity:undefined, identity: undefined,
TPMRightSectionData:undefined, TPMRightSectionData: undefined,
PropaedeuticsList: undefined, PropaedeuticsList: undefined,
tpmindexjupyterbool:false, tpmindexjupyterbool: false,
is_jupyter:false, is_jupyter: false,
selectedKeys:"", selectedKeys: "",
openknows:false openknows: false
} }
} }
openknow=()=>{ openknow = () => {
let storage=window.localStorage; let storage = window.localStorage;
this.setState({ this.setState({
openknows:false openknows: false
}) })
let newTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings' let newTPMsettings = this.props.user && this.props.user.user_id + 'newTPMsettings'
storage.setItem(newTPMsettings,false); storage.setItem(newTPMsettings, false);
} }
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps, prevState) {
if (prevProps!=this.props) { if (prevProps != this.props) {
if(this.props.user&&this.props.user.user_id){ if (this.props.user && this.props.user.user_id) {
let getnewTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings'; let getnewTPMsettings = this.props.user && this.props.user.user_id + 'newTPMsettings';
let newTPMsettings=window.localStorage.getItem(getnewTPMsettings) let newTPMsettings = window.localStorage.getItem(getnewTPMsettings)
if(newTPMsettings===undefined||newTPMsettings===false||newTPMsettings===null){ if (newTPMsettings === undefined || newTPMsettings === false || newTPMsettings === null) {
this.setState({ this.setState({
openknows:false openknows: false
}) })
}else{ } else {
this.setState({ this.setState({
openknows:false openknows: false
}) })
} }
} }
} }
} }
getcomponentdidmount=()=>{ getcomponentdidmount = () => {
let userid=this.props.user&&this.props.user.user_id; let userid = this.props.user && this.props.user.user_id;
let getnewTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings'; let getnewTPMsettings = this.props.user && this.props.user.user_id + 'newTPMsettings';
let newTPMsettings=window.localStorage.getItem(getnewTPMsettings) let newTPMsettings = window.localStorage.getItem(getnewTPMsettings)
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
// console.log('props', this.props); // console.log('props', this.props);
// let collaborators = `/shixuns/` + id + `/propaedeutics.json`; // let collaborators = `/shixuns/` + id + `/propaedeutics.json`;
@ -211,7 +211,7 @@ class TPMIndex extends Component {
let Url = `/shixuns/` + id + `.json`; let Url = `/shixuns/` + id + `.json`;
axios.get(Url).then((response) => { axios.get(Url).then((response) => {
if (response.status === 200) { if (response.status === 200) {
document.title=response.data.name; document.title = response.data.name;
let newstar_info = []; let newstar_info = [];
// let start1= // let start1=
for (var i = 0; i < response.data.score_info.length; i++) { for (var i = 0; i < response.data.score_info.length; i++) {
@ -230,23 +230,23 @@ class TPMIndex extends Component {
star_infos: newstar_infos, star_infos: newstar_infos,
power: response.data.power, power: response.data.power,
identity: response.data.identity, identity: response.data.identity,
propaedeutics:response.data.propaedeutics, propaedeutics: response.data.propaedeutics,
status: response.data.shixun_status, status: response.data.shixun_status,
secret_repository: response.data.secret_repository, secret_repository: response.data.secret_repository,
public:response.data.public, public: response.data.public,
is_jupyter:response.data.is_jupyter=== undefined||response.data.is_jupyter===null?false:response.data.is_jupyter, is_jupyter: response.data.is_jupyter === undefined || response.data.is_jupyter === null ? false : response.data.is_jupyter,
}); });
if(userid){ if (userid) {
if(response.data.identity <4){ if (response.data.identity < 4) {
if(newTPMsettings===undefined||newTPMsettings===false||newTPMsettings===null){ if (newTPMsettings === undefined || newTPMsettings === false || newTPMsettings === null) {
console.log() console.log()
this.setState({ this.setState({
openknows:true openknows: true
}) })
}else{ } else {
this.setState({ this.setState({
openknows:false openknows: false
}) })
} }
} }
@ -262,15 +262,15 @@ class TPMIndex extends Component {
power: undefined, power: undefined,
identity: undefined, identity: undefined,
status: undefined, status: undefined,
propaedeutics:undefined, propaedeutics: undefined,
is_jupyter:false, is_jupyter: false,
}); });
}); });
this.tpmContentRequestInterceptor = axios.interceptors.request.use((config) => { this.tpmContentRequestInterceptor = axios.interceptors.request.use((config) => {
let url = config.url; let url = config.url;
// console.log('tpmContentRequestInterceptor:', url) // console.log('tpmContentRequestInterceptor:', url)
for ( let i = 0; i < interceptorUrlArray.length; i++ ) { for (let i = 0; i < interceptorUrlArray.length; i++) {
if (url.indexOf(interceptorUrlArray[i]) != -1) { if (url.indexOf(interceptorUrlArray[i]) != -1) {
url = url.split('?')[0] url = url.split('?')[0]
console.log('loadingContent, url:', url) console.log('loadingContent, url:', url)
@ -302,9 +302,9 @@ class TPMIndex extends Component {
return Promise.reject(error); return Promise.reject(error);
}); });
//右侧数据 //右侧数据
let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`; let shixunsDetailsURL = `/shixuns/` + id + `/show_right.json`;
axios.get(shixunsDetailsURL).then((response)=> { axios.get(shixunsDetailsURL).then((response) => {
if(response.data){ if (response.data) {
} }
this.setState({ this.setState({
@ -331,63 +331,63 @@ class TPMIndex extends Component {
} }
getnavdatas=()=>{ getnavdatas = () => {
let selectedKeys; let selectedKeys;
const {location} = this.props; const { location } = this.props;
if(location.pathname.indexOf('/challenges')!=-1){ if (location.pathname.indexOf('/challenges') != -1) {
selectedKeys="1" selectedKeys = "1"
}else if(location.pathname.indexOf('/propaedeutics')!=-1){ } else if (location.pathname.indexOf('/propaedeutics') != -1) {
selectedKeys="2" selectedKeys = "2"
}else if(location.pathname.indexOf('/repository')!=-1){ } else if (location.pathname.indexOf('/repository') != -1) {
selectedKeys="3" selectedKeys = "3"
}else if(location.pathname.indexOf('/secret_repository')!=-1){ } else if (location.pathname.indexOf('/secret_repository') != -1) {
selectedKeys="4" selectedKeys = "4"
} else if(location.pathname.indexOf('/collaborators')!=-1){ } else if (location.pathname.indexOf('/collaborators') != -1) {
selectedKeys="5" selectedKeys = "5"
}else if(location.pathname.indexOf('/dataset')!=-1){ } else if (location.pathname.indexOf('/dataset') != -1) {
selectedKeys="6" selectedKeys = "6"
}else if(location.pathname.indexOf('/shixun_discuss')!=-1){ } else if (location.pathname.indexOf('/shixun_discuss') != -1) {
selectedKeys="7" selectedKeys = "7"
}else if(location.pathname.indexOf('/ranking_list')!=-1){ } else if (location.pathname.indexOf('/ranking_list') != -1) {
selectedKeys="8" selectedKeys = "8"
}else if(location.pathname.indexOf('/settings')!=-1){ } else if (location.pathname.indexOf('/settings') != -1) {
selectedKeys="9" selectedKeys = "9"
} }
this.setState({ this.setState({
selectedKeys:selectedKeys selectedKeys: selectedKeys
}) })
} }
handleClick=(e)=>{ handleClick = (e) => {
this.setState({ this.setState({
selectedKeys: e.key, selectedKeys: e.key,
}); });
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
if(e.key==="1"){ if (e.key === "1") {
this.props.history.replace(`/shixuns/${id}/challenges`); this.props.history.replace(`/shixuns/${id}/challenges`);
}else if(e.key==="2"){ } else if (e.key === "2") {
this.props.history.replace(`/shixuns/${id}/propaedeutics`); this.props.history.replace(`/shixuns/${id}/propaedeutics`);
}else if(e.key==="3"){ } else if (e.key === "3") {
this.props.history.replace(`/shixuns/${id}/repository`); this.props.history.replace(`/shixuns/${id}/repository`);
}else if(e.key==="4"){ } else if (e.key === "4") {
this.props.history.replace(`/shixuns/${id}/secret_repository`); this.props.history.replace(`/shixuns/${id}/secret_repository`);
}else if(e.key==="5"){ } else if (e.key === "5") {
this.props.history.replace(`/shixuns/${id}/collaborators`); this.props.history.replace(`/shixuns/${id}/collaborators`);
}else if(e.key==="6"){ } else if (e.key === "6") {
this.props.history.replace(`/shixuns/${id}/dataset`); this.props.history.replace(`/shixuns/${id}/dataset`);
}else if(e.key==="7"){ } else if (e.key === "7") {
this.props.history.replace(`/shixuns/${id}/shixun_discuss`); this.props.history.replace(`/shixuns/${id}/shixun_discuss`);
}else if(e.key==="8"){ } else if (e.key === "8") {
this.props.history.replace(`/shixuns/${id}/ranking_list`); this.props.history.replace(`/shixuns/${id}/ranking_list`);
}else if(e.key==="9"){ } else if (e.key === "9") {
this.props.history.replace(`/shixuns/${id}/settings`); this.props.history.replace(`/shixuns/${id}/settings`);
} }
} }
render() { render() {
let url = window.location.href; let url = window.location.href;
let flag = url.indexOf("add_file")>-1; let flag = url.indexOf("add_file") > -1;
return ( return (
<div className="newMain clearfix"> <div className="newMain clearfix">
@ -397,7 +397,7 @@ class TPMIndex extends Component {
<TPMBanner <TPMBanner
{...this.props} {...this.props}
{...this.state} {...this.state}
is_jupyter={this.state. is_jupyter} is_jupyter={this.state.is_jupyter}
></TPMBanner> ></TPMBanner>
} }
@ -425,16 +425,16 @@ class TPMIndex extends Component {
<span className={"tpmbannernavstyler"}>任务</span> <span className={"tpmbannernavstyler"}>任务</span>
</Menu.Item> </Menu.Item>
{ this.state.propaedeutics===undefined?"":this.state.propaedeutics===false?"":<Menu.Item key="2" className={"competitionmr50"}> {this.state.propaedeutics === undefined ? "" : this.state.propaedeutics === false ? "" : <Menu.Item key="2" className={"competitionmr50"}>
<span className={"tpmbannernavstyler"}>背景知识</span> <span className={"tpmbannernavstyler"}>背景知识</span>
</Menu.Item>} </Menu.Item>}
{ this.state.identity >4||this.state.identity===undefined ?"": {this.state.identity > 4 || this.state.identity === undefined ? "" :
this.state.is_jupyter===false?<Menu.Item key="3" className={"competitionmr50"}> this.state.is_jupyter === false ? <Menu.Item key="3" className={"competitionmr50"}>
<span className={"tpmbannernavstyler"}>版本库</span> <span className={"tpmbannernavstyler"}>版本库</span>
</Menu.Item>:""} </Menu.Item> : ""}
{this.state.identity >4||this.state.identity===undefined ?"": this.state.secret_repository && <Menu.Item key="4" className={"competitionmr50"}> {this.state.identity > 4 || this.state.identity === undefined ? "" : this.state.secret_repository && <Menu.Item key="4" className={"competitionmr50"}>
<span className={"tpmbannernavstyler"}>私密版本库</span> <span className={"tpmbannernavstyler"}>私密版本库</span>
</Menu.Item>} </Menu.Item>}
@ -442,17 +442,17 @@ class TPMIndex extends Component {
<span className={"tpmbannernavstyler"}>合作者</span> <span className={"tpmbannernavstyler"}>合作者</span>
</Menu.Item> </Menu.Item>
{ this.state.identity >4||this.state.identity===undefined ? "":this.state.is_jupyter===true?<Menu.Item key="6" className={"competitionmr50"}> {this.state.identity > 4 || this.state.identity === undefined ? "" : this.state.is_jupyter === true ? <Menu.Item key="6" className={"competitionmr50"}>
<span className={"tpmbannernavstyler"}>数据集</span> <span className={"tpmbannernavstyler"}>数据集</span>
</Menu.Item>:""} </Menu.Item> : ""}
{ this.state.is_jupyter===false?<Menu.Item key="7" className={"competitionmr50"}> {this.state.is_jupyter === false ? <Menu.Item key="7" className={"competitionmr50"}>
<span className={"tpmbannernavstyler"}>评论</span> <span className={"tpmbannernavstyler"}>评论</span>
</Menu.Item>:""} </Menu.Item> : ""}
{ this.state.is_jupyter===false? <Menu.Item key="8" className={"competitionmr50"}> {this.state.is_jupyter === false ? <Menu.Item key="8" className={"competitionmr50"}>
<span className={"tpmbannernavstyler"}>排行榜</span> <span className={"tpmbannernavstyler"}>排行榜</span>
</Menu.Item>:""} </Menu.Item> : ""}
{/*{this.state.identity >4||this.state.identity===undefined ? "":this.state.openknows===true?<span>*/} {/*{this.state.identity >4||this.state.identity===undefined ? "":this.state.openknows===true?<span>*/}
{/* <Popover*/} {/* <Popover*/}
{/* content={*/} {/* content={*/}
@ -468,13 +468,13 @@ class TPMIndex extends Component {
{/* </Popover>*/} {/* </Popover>*/}
{/*</span>:""}*/} {/*</span>:""}*/}
{this.state.identity >4||this.state.identity===undefined ? "": {this.state.identity > 4 || this.state.identity === undefined ? "" :
<Menu.Item key="9" className={"competitionmr50"}> <Menu.Item key="9" className={"competitionmr50"}>
<span className={"tpmbannernavstyler"}>配置</span> <span className={"tpmbannernavstyler"}>配置</span>
</Menu.Item> </Menu.Item>
} }
{this.state.identity >2||this.state.identity===undefined?"": {this.state.identity > 2 || this.state.identity === undefined ? "" :
<div className={"fr"}> <div className={"fr"}>
<Link to={`/shixuns/${this.props.match.params.shixunId}/audit_situation`} <Link to={`/shixuns/${this.props.match.params.shixunId}/audit_situation`}
className={`${this.props.match.url.indexOf('audit_situation') != -1 ? 'font-16 audit_situationactive' : 'font-16 audit_situationactive'} fl`}>审核情况</Link> className={`${this.props.match.url.indexOf('audit_situation') != -1 ? 'font-16 audit_situationactive' : 'font-16 audit_situationactive'} fl`}>审核情况</Link>
@ -542,7 +542,7 @@ class TPMIndex extends Component {
<Route path="/shixuns/:shixunId/shixun_discuss" render={ <Route path="/shixuns/:shixunId/shixun_discuss" render={
(props) => (<TPMShixunDiscussContainer {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter} (props) => (<TPMShixunDiscussContainer {...this.props} {...this.state} {...props} is_jupyter={this.state.is_jupyter}
initForumState={(data)=>this.initForumState(data)} initForumState={(data) => this.initForumState(data)}
setSearchValue={this.setSearchValue} setSearchValue={this.setSearchValue}
setHotLabelIndex={this.setHotLabelIndex} setHotLabelIndex={this.setHotLabelIndex}
/>) />)
@ -581,18 +581,18 @@ class TPMIndex extends Component {
{/*评测设置*/} {/*评测设置*/}
<Route path="/shixuns/:shixunId/challenges/:checkpointId/tab=2" render={ <Route path="/shixuns/:shixunId/challenges/:checkpointId/tab=2" render={
(props) => (<TPMevaluation {...this.props} {...props} {...this.state}/>) (props) => (<TPMevaluation {...this.props} {...props} {...this.state} />)
}></Route> }></Route>
{/*参考答案*/} {/*参考答案*/}
<Route path="/shixuns/:shixunId/challenges/:checkpointId/tab=3" render={ <Route path="/shixuns/:shixunId/challenges/:checkpointId/tab=3" render={
(props) => (<TPManswer {...this.props} {...props} {...this.state}/>) (props) => (<TPManswer {...this.props} {...props} {...this.state} />)
}></Route> }></Route>
{/*新建关卡*/} {/*新建关卡*/}
<Route path="/shixuns/:shixunId/challenges/new" render={ <Route path="/shixuns/:shixunId/challenges/new" render={
(props) => (<TPMchallengesnew {...this.props} {...props} {...this.state}/>) (props) => (<TPMchallengesnew {...this.props} {...props} {...this.state} />)
}></Route> }></Route>
{/*编辑关卡*/} {/*编辑关卡*/}
@ -607,12 +607,12 @@ class TPMIndex extends Component {
{/*修改选择题*/} {/*修改选择题*/}
<Route path="/shixuns/:shixunId/challenges/:checkpointId/editquestion/:choose_id" render={ <Route path="/shixuns/:shixunId/challenges/:checkpointId/editquestion/:choose_id" render={
(props) => (<TPMquestion {...this.props} {...props} {...this.state}/>) (props) => (<TPMquestion {...this.props} {...props} {...this.state} />)
}></Route> }></Route>
{/*修改选择题*/} {/*修改选择题*/}
<Route path="/shixuns/:shixunId/challenges/:checkpointId/editquestion" render={ <Route path="/shixuns/:shixunId/challenges/:checkpointId/editquestion" render={
(props) => (<TPMquestion {...this.props} {...props} {...this.state}/>) (props) => (<TPMquestion {...this.props} {...props} {...this.state} />)
}></Route> }></Route>
<Route exact path="/shixuns/:shixunId" render={ <Route exact path="/shixuns/:shixunId" render={
@ -629,4 +629,4 @@ class TPMIndex extends Component {
} }
} }
export default SnackbarHOC() (TPMIndexHOC ( TPMIndex )); export default SnackbarHOC()(TPMIndexHOC(TPMIndex));

@ -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"
} }
} }
@ -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,
@ -481,13 +481,13 @@ class Newshixuns extends Component {
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'}
@ -499,15 +499,15 @@ class Newshixuns extends Component {
<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>
@ -524,25 +524,25 @@ 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"
@ -553,12 +553,12 @@ class Newshixuns extends Component {
) )
} }
}):"" }) : ""
} }
{ {
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"
@ -569,7 +569,7 @@ class Newshixuns extends Component {
) )
} }
}):"" }) : ""
} }
</Select> </Select>
@ -588,7 +588,7 @@ 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">
@ -596,7 +596,7 @@ class Newshixuns extends Component {
<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"}
@ -619,7 +619,7 @@ class Newshixuns extends Component {
<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 === "" ? "" :
@ -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>
@ -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));

@ -1,10 +1,10 @@
import React, {Component} from 'react'; import React, { Component } from 'react';
import {TPMIndexHOC} from '../TPMIndexHOC'; import TPMIndexHOC from '../TPMIndexHOC';
import {SnackbarHOC,appendFileSizeToUploadFileAll, getUploadActionUrl} from 'educoder'; import { SnackbarHOC, appendFileSizeToUploadFileAll, getUploadActionUrl } from 'educoder';
import {Input, Select, Radio, Checkbox, Modal, Icon, DatePicker,Upload,Button,message,Form,notification,Tooltip} from 'antd'; import { Input, Select, Radio, Checkbox, Modal, Icon, DatePicker, Upload, Button, message, Form, notification, Tooltip } from 'antd';
// import "antd/dist/antd.css"; // import "antd/dist/antd.css";
@ -14,7 +14,7 @@ import axios from 'axios';
import './css/Newshixuns.css'; import './css/Newshixuns.css';
import {getUrl} from 'educoder' import { getUrl } from 'educoder'
import moment from 'moment'; import moment from 'moment';
@ -225,16 +225,16 @@ class Newshixuns extends Component {
onSearchvalue: "", onSearchvalue: "",
scope_partmenttype: false, scope_partmenttype: false,
languagewrite: undefined, languagewrite: undefined,
systemenvironment:undefined, systemenvironment: undefined,
testcoderunmode:undefined, testcoderunmode: undefined,
file:undefined, file: undefined,
deleteisnot:true, deleteisnot: true,
languagewritetype:false, languagewritetype: false,
systemenvironmenttype:false, systemenvironmenttype: false,
testcoderunmodetype:false, testcoderunmodetype: false,
attachmentidstype:false, attachmentidstype: false,
datalisttype:false, datalisttype: false,
bottonloading:false bottonloading: false
} }
} }
@ -269,7 +269,7 @@ class Newshixuns extends Component {
let newshixunUrl = `/shixuns/new.json`; let newshixunUrl = `/shixuns/new.json`;
axios.get(newshixunUrl).then((response) => { axios.get(newshixunUrl).then((response) => {
if (response.status === 200) { if (response.status === 200) {
if (response.data.message===undefined) { if (response.data.message === undefined) {
this.setState({ this.setState({
newshixunlist: response.data newshixunlist: response.data
}); });
@ -284,7 +284,7 @@ class Newshixuns extends Component {
let departmentsUrl = `/shixuns/departments.json`; let departmentsUrl = `/shixuns/departments.json`;
axios.get(departmentsUrl).then((response) => { axios.get(departmentsUrl).then((response) => {
if (response.status === 200) { if (response.status === 200) {
if (response.data.message===undefined) { if (response.data.message === undefined) {
this.setState({ this.setState({
departmentslist: response.data.shools_name departmentslist: response.data.shools_name
}); });
@ -295,7 +295,7 @@ class Newshixuns extends Component {
}); });
} }
setlanguagewrite = (e)=>{ setlanguagewrite = (e) => {
this.setState({ this.setState({
languagewrite: e.target.value languagewrite: e.target.value
}) })
@ -393,7 +393,7 @@ class Newshixuns extends Component {
} }
adduse_scopeinput = () => { adduse_scopeinput = () => {
let {scope_partment} = this.state; let { scope_partment } = this.state;
let array = scope_partment; let array = scope_partment;
let newarray = "" let newarray = ""
array.push(newarray) array.push(newarray)
@ -403,24 +403,24 @@ class Newshixuns extends Component {
} }
shixunScopeInput = (e, id) => { shixunScopeInput = (e, id) => {
let types=false let types = false
let {scope_partment} = this.state; let { scope_partment } = this.state;
let datalist = scope_partment; let datalist = scope_partment;
if (datalist === undefined) { if (datalist === undefined) {
datalist = [] datalist = []
} }
datalist.map((item,key)=>{ datalist.map((item, key) => {
if(e===item){ if (e === item) {
types=true types = true
this.setState({ this.setState({
datalisttype:true datalisttype: true
}) })
return return
} }
}) })
if(types===false){ if (types === false) {
datalist.push(e) datalist.push(e)
this.setState({ this.setState({
scope_partment: datalist, scope_partment: datalist,
@ -432,7 +432,7 @@ class Newshixuns extends Component {
} }
deleteScopeInput = (key) => { deleteScopeInput = (key) => {
let {scope_partment} = this.state; let { scope_partment } = this.state;
let datalist = scope_partment; let datalist = scope_partment;
datalist.splice(key, 1); datalist.splice(key, 1);
this.setState({ this.setState({
@ -443,7 +443,7 @@ class Newshixuns extends Component {
//提交数据 //提交数据
submit_new_shixun = () => { submit_new_shixun = () => {
const mdVal = this.taskpass_editormd.getValue(); const mdVal = this.taskpass_editormd.getValue();
let {can_copy, main_type, name, scope_partment, small_type, trainee, use_scope, vnc, webssh, multi_webssh, TimePickervalue} = this.state; let { can_copy, main_type, name, scope_partment, small_type, trainee, use_scope, vnc, webssh, multi_webssh, TimePickervalue } = this.state;
let Url = `/shixuns.json` let Url = `/shixuns.json`
if (name === "") { if (name === "") {
this.setState({ this.setState({
@ -496,7 +496,7 @@ class Newshixuns extends Component {
newmulti_webssh = "" newmulti_webssh = ""
} }
this.setState({ this.setState({
bottonloading:true bottonloading: true
}) })
axios.post(Url, { axios.post(Url, {
name: name, name: name,
@ -517,15 +517,15 @@ class Newshixuns extends Component {
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";
// window.open("/shixuns/"+response.data.shixun_identifier+"/challenges"); // window.open("/shixuns/"+response.data.shixun_identifier+"/challenges");
}else{ } else {
this.setState({ this.setState({
bottonloading:false bottonloading: false
}) })
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
this.setState({ this.setState({
bottonloading:false bottonloading: false
}) })
}) })
} }
@ -541,7 +541,7 @@ class Newshixuns extends Component {
function fake() { function fake() {
let departmentsUrl = `/shixuns/departments.json?q=` + currentValue; let departmentsUrl = `/shixuns/departments.json?q=` + currentValue;
axios.get(departmentsUrl).then((response) => { axios.get(departmentsUrl).then((response) => {
if (response.data.message===undefined) { if (response.data.message === undefined) {
callback(response.data.shools_name); callback(response.data.shools_name);
} }
}).catch((error) => { }).catch((error) => {
@ -554,7 +554,7 @@ class Newshixuns extends Component {
shixunHandleSearch = (value) => { shixunHandleSearch = (value) => {
this.shixunsfetch(value, departmentslist => this.setState({departmentslist})); this.shixunsfetch(value, departmentslist => this.setState({ departmentslist }));
this.setState({ this.setState({
onSearchvalue: "" onSearchvalue: ""
@ -567,7 +567,7 @@ class Newshixuns extends Component {
}) })
} }
sendsure_apply = () => { sendsure_apply = () => {
let {languagewrite,systemenvironment,testcoderunmode} = this.state; let { languagewrite, systemenvironment, testcoderunmode } = this.state;
// console.log("点击确定") // console.log("点击确定")
// console.log("languagewrite"+languagewrite); // console.log("languagewrite"+languagewrite);
// console.log("systemenvironment"+systemenvironment); // console.log("systemenvironment"+systemenvironment);
@ -579,36 +579,36 @@ class Newshixuns extends Component {
// return item.response ? item.response.id : item.id // return item.response ? item.response.id : item.id
// }) // })
// } // }
if(languagewrite === undefined || languagewrite === "" ){ if (languagewrite === undefined || languagewrite === "") {
// this.props.showNotification(`请填写该镜像是基于什么语言`); // this.props.showNotification(`请填写该镜像是基于什么语言`);
this.setState({ this.setState({
languagewritetype:true languagewritetype: true
}) })
return return
} }
if(systemenvironment === undefined || systemenvironment === ""){ if (systemenvironment === undefined || systemenvironment === "") {
// this.props.showNotification(`请填写该镜像是基于什么语言系统环境`); // this.props.showNotification(`请填写该镜像是基于什么语言系统环境`);
this.setState({ this.setState({
systemenvironmenttype:true systemenvironmenttype: true
}) })
return; return;
} }
if(testcoderunmode === undefined || testcoderunmode === "") { if (testcoderunmode === undefined || testcoderunmode === "") {
// this.props.showNotification(`请填写该镜像中测试代码运行方式`); // this.props.showNotification(`请填写该镜像中测试代码运行方式`);
this.setState({ this.setState({
testcoderunmodetype:true testcoderunmodetype: true
}) })
return; return;
} }
var attachment_ids=undefined; var attachment_ids = undefined;
if (this.state.fileList) { if (this.state.fileList) {
attachment_ids = this.state.fileList.map(item => { attachment_ids = this.state.fileList.map(item => {
return item.response ? item.response.id : item.id return item.response ? item.response.id : item.id
}) })
} }
if( attachment_ids === undefined || attachment_ids.length===0){ if (attachment_ids === undefined || attachment_ids.length === 0) {
// notification.open( // notification.open(
// { // {
@ -619,7 +619,7 @@ class Newshixuns extends Component {
// } // }
// ) // )
this.setState({ this.setState({
attachmentidstype:true attachmentidstype: true
}) })
return; return;
} }
@ -627,39 +627,39 @@ class Newshixuns extends Component {
// alert(languagewrite +" "+systemenvironment +" "+testcoderunmode + " "+attachment_ids); // alert(languagewrite +" "+systemenvironment +" "+testcoderunmode + " "+attachment_ids);
var data={ var data = {
language:languagewrite, language: languagewrite,
runtime:systemenvironment, runtime: systemenvironment,
run_method:testcoderunmode, run_method: testcoderunmode,
attachment_id:attachment_ids[0], attachment_id: attachment_ids[0],
} }
var url =`/shixuns/apply_shixun_mirror.json`; var url = `/shixuns/apply_shixun_mirror.json`;
axios.post(url,data axios.post(url, data
).then((response) => { ).then((response) => {
try { try {
if (response.data) { if (response.data) {
// const { id } = response.data; // const { id } = response.data;
// if (id) { // if (id) {
if(this.state.file !== undefined){ if (this.state.file !== undefined) {
console.log("549"); console.log("549");
// this.deleteAttachment(this.state.file); // this.deleteAttachment(this.state.file);
this.setState({ this.setState({
file:undefined, file: undefined,
deleteisnot:true, deleteisnot: true,
languagewrite:"", languagewrite: "",
systemenvironment:"", systemenvironment: "",
testcoderunmode:"", testcoderunmode: "",
fileList:[] fileList: []
}) })
}else { } else {
this.setState({ this.setState({
file:undefined, file: undefined,
deleteisnot:true, deleteisnot: true,
languagewrite:"", languagewrite: "",
systemenvironment:"", systemenvironment: "",
testcoderunmode:"", testcoderunmode: "",
fileList:[] fileList: []
}) })
} }
// this.props.showNotification('提交成功!'); // this.props.showNotification('提交成功!');
@ -675,7 +675,7 @@ class Newshixuns extends Component {
// this.props.history.push(`/courses/${cid}/graduation_topics`); // this.props.history.push(`/courses/${cid}/graduation_topics`);
// } // }
} }
}catch (e) { } catch (e) {
} }
@ -686,25 +686,25 @@ class Newshixuns extends Component {
this.setState({ this.setState({
postapplyvisible: false, postapplyvisible: false,
}) })
if(this.state.file !== undefined){ if (this.state.file !== undefined) {
console.log("580"); console.log("580");
// this.deleteAttachment(this.state.file); // this.deleteAttachment(this.state.file);
this.setState({ this.setState({
file:undefined, file: undefined,
deleteisnot:true, deleteisnot: true,
languagewrite:"", languagewrite: "",
systemenvironment:"", systemenvironment: "",
testcoderunmode:"", testcoderunmode: "",
fileList:[] fileList: []
}) })
}else { } else {
this.setState({ this.setState({
file:undefined, file: undefined,
deleteisnot:true, deleteisnot: true,
languagewrite:"", languagewrite: "",
systemenvironment:"", systemenvironment: "",
testcoderunmode:"", testcoderunmode: "",
fileList:[] fileList: []
}) })
} }
} }
@ -764,14 +764,14 @@ class Newshixuns extends Component {
onChangeTimePicker = (value, dateString) => { onChangeTimePicker = (value, dateString) => {
this.setState({ this.setState({
TimePickervalue: dateString=== ""?"":moment(handleDateStrings(dateString)) TimePickervalue: dateString === "" ? "" : moment(handleDateStrings(dateString))
}) })
} }
// 附件相关 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");
@ -787,7 +787,7 @@ class Newshixuns extends Component {
} }
} }
onAttachmentRemove = (file) => { onAttachmentRemove = (file) => {
if(!file.percent || file.percent == 100){ if (!file.percent || file.percent == 100) {
confirm({ confirm({
title: '确定要删除这个附件吗?', title: '确定要删除这个附件吗?',
okText: '确定', okText: '确定',
@ -807,7 +807,7 @@ class Newshixuns extends Component {
} }
deleteAttachment = (file) => { deleteAttachment = (file) => {
console.log(file); console.log(file);
let id=file.response ==undefined ? file.id : file.response.id let id = file.response == undefined ? file.id : file.response.id
const url = `/attachments/${id}.json` const url = `/attachments/${id}.json`
axios.delete(url, { axios.delete(url, {
}) })
@ -824,7 +824,7 @@ class Newshixuns extends Component {
newFileList.splice(index, 1); newFileList.splice(index, 1);
return { return {
fileList: newFileList, fileList: newFileList,
deleteisnot:true deleteisnot: true
}; };
}); });
} }
@ -836,7 +836,7 @@ class Newshixuns extends Component {
} }
handleSubmit=()=>{ handleSubmit = () => {
// console.log(this.state.languagewrite) // console.log(this.state.languagewrite)
// console.log(this.state.systemenvironment) // console.log(this.state.systemenvironment)
// console.log(this.state.testcoderunmode) // console.log(this.state.testcoderunmode)
@ -869,7 +869,7 @@ class Newshixuns extends Component {
} }
render() { render() {
const { getFieldDecorator } = this.props.form; const { getFieldDecorator } = this.props.form;
let {testcoderunmode ,systemenvironment,languagewrite,deleteisnot, fileList,TimePickervalue, scope_partmenttype, opensmail, newshixunlist, name, scope_partment, departmentslist, postapplyvisible, sendsure_applyvalue, postapplytitle, shixun_nametype, main_types, trainee_types, SelectTheCommandtype, opers, datalisttype, onSearchvalue} = this.state; let { testcoderunmode, systemenvironment, languagewrite, deleteisnot, fileList, TimePickervalue, scope_partmenttype, opensmail, newshixunlist, name, scope_partment, departmentslist, postapplyvisible, sendsure_applyvalue, postapplytitle, shixun_nametype, main_types, trainee_types, SelectTheCommandtype, opers, datalisttype, onSearchvalue } = this.state;
let options let options
if (departmentslist != undefined) { if (departmentslist != undefined) {
options = this.state.departmentslist.map((d, k) => { options = this.state.departmentslist.map((d, k) => {
@ -906,14 +906,14 @@ class Newshixuns extends Component {
} }
) )
} }
if(this.state.file !== undefined){ if (this.state.file !== undefined) {
console.log("763") console.log("763")
this.setState({ this.setState({
file:file file: file
}) })
}else { } else {
this.setState({ this.setState({
file:file file: file
}) })
} }
@ -950,8 +950,8 @@ class Newshixuns extends Component {
<div className="mb10 edu-back-white"> <div className="mb10 edu-back-white">
<p className="padding10-20 bor-bottom-greyE color-grey-3 clearfix"> <p className="padding10-20 bor-bottom-greyE color-grey-3 clearfix">
<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?<a className="fr font-16 mt3 color-blue" href="/forums/2943" {this.props.user && this.props.user.main_site === true ? <a className="fr font-16 mt3 color-blue" href="/forums/2943"
target="_blank">实训制作指南</a>:""} target="_blank">实训制作指南</a> : ""}
</p> </p>
<div className="padding30-20"> <div className="padding30-20">
@ -968,7 +968,7 @@ class Newshixuns extends Component {
placeholder="请输入实训名称最多60个字符" placeholder="请输入实训名称最多60个字符"
size="60" size="60"
type="text" type="text"
style={{width: shixun_nametype === false ? '1123px' : '93%'}} style={{ width: shixun_nametype === false ? '1123px' : '93%' }}
/> />
<span <span
className={shixun_nametype === true ? "color-orange fr mt10" : "color-orange fr none"} className={shixun_nametype === true ? "color-orange fr mt10" : "color-orange fr none"}
@ -989,7 +989,7 @@ class Newshixuns extends Component {
<div className="df"> <div className="df">
<div className="flex1 break_word show_content_grey new_li" id="memoMD"> <div className="flex1 break_word show_content_grey new_li" id="memoMD">
<textarea style={{display: 'none'}} id="evaluate_script_shows" <textarea style={{ display: 'none' }} id="evaluate_script_shows"
name="content"></textarea> name="content"></textarea>
</div> </div>
</div> </div>
@ -1005,7 +1005,7 @@ class Newshixuns extends Component {
// onMouseLeave={this.bigopens} // onMouseLeave={this.bigopens}
> >
<Select placeholder="请选择主类别" <Select placeholder="请选择主类别"
style={{width: 180}} style={{ width: 180 }}
onChange={this.bigClass} onChange={this.bigClass}
// onMouseEnter={this.bigopen} // onMouseEnter={this.bigopen}
onSelect={this.bigopens} onSelect={this.bigopens}
@ -1016,7 +1016,7 @@ class Newshixuns extends Component {
newshixunlist === undefined ? "" : newshixunlist.main_type.map((item, key) => { newshixunlist === undefined ? "" : newshixunlist.main_type.map((item, key) => {
return ( return (
<Option value={item.id} key={key} > <Option value={item.id} key={key} >
<Tooltip placement="right" title={item.description=== ""?"无描述":item.description} > <Tooltip placement="right" title={item.description === "" ? "无描述" : item.description} >
{item.type_name} {item.type_name}
</Tooltip> </Tooltip>
</Option> </Option>
@ -1044,24 +1044,24 @@ class Newshixuns extends Component {
<label className="fl mt10 "><span <label className="fl mt10 "><span
className="color-red fl mt3">*</span>&nbsp;&nbsp;</label> className="color-red fl mt3">*</span>&nbsp;&nbsp;</label>
<textarea className="fl task-form-80 task-height-150" <textarea className="fl task-form-80 task-height-150"
style={{width:'89%',height:'100px'}} style={{ width: '89%', height: '100px' }}
onInput={this.setlanguagewrite} onInput={this.setlanguagewrite}
value={languagewrite} value={languagewrite}
placeholder="请填写该镜像是基于什么语言示例Python" placeholder="请填写该镜像是基于什么语言示例Python"
id="demand_info"></textarea> id="demand_info"></textarea>
</li> </li>
<div className={"color-red shixunspanred"}>{this.state.languagewritetype===true?"请填写该镜像语言":""}</div> <div className={"color-red shixunspanred"}>{this.state.languagewritetype === true ? "请填写该镜像语言" : ""}</div>
<li className="clearfix ml1"> <li className="clearfix ml1">
<label className="panel-form-label fl ml50"><span <label className="panel-form-label fl ml50"><span
className="color-red fl mt3">*</span>&nbsp;&nbsp;</label> className="color-red fl mt3">*</span>&nbsp;&nbsp;</label>
<textarea className="fl task-form-80 task-height-150 " <textarea className="fl task-form-80 task-height-150 "
onInput={this.setsystemenvironment} onInput={this.setsystemenvironment}
style={{height:'100px'}} style={{ height: '100px' }}
value={systemenvironment} value={systemenvironment}
placeholder="请填写该镜像是基于什么linux系统环境,代码运行环境" placeholder="请填写该镜像是基于什么linux系统环境,代码运行环境"
id="demand_info"></textarea> id="demand_info"></textarea>
</li> </li>
<div className={"color-red shixunspanred"}>{this.state.systemenvironmenttype===true?"请填写该镜像语言系统环境":""}</div> <div className={"color-red shixunspanred"}>{this.state.systemenvironmenttype === true ? "请填写该镜像语言系统环境" : ""}</div>
<li className="clearfix"> <li className="clearfix">
<label className="fl mt10" ><span <label className="fl mt10" ><span
className="color-red fl mt3">*</span>&nbsp;&nbsp;</label> className="color-red fl mt3">*</span>&nbsp;&nbsp;</label>
@ -1069,11 +1069,11 @@ class Newshixuns extends Component {
<textarea className="fl task-form-80 task-height-150 " <textarea className="fl task-form-80 task-height-150 "
onInput={this.settestcoderunmode} onInput={this.settestcoderunmode}
value={testcoderunmode} value={testcoderunmode}
style={{height:'100px'}} style={{ height: '100px' }}
placeholder="请填写该镜像中测试代码运行方式" placeholder="请填写该镜像中测试代码运行方式"
id="demand_info"></textarea> id="demand_info"></textarea>
</li> </li>
<div className={"color-red shixunspanred"}>{this.state.testcoderunmodetype===true?"请填写该镜像测试代码运行方式":""}</div> <div className={"color-red shixunspanred"}>{this.state.testcoderunmodetype === true ? "请填写该镜像测试代码运行方式" : ""}</div>
<li className="clearfix ml50"> <li className="clearfix ml50">
<label className="panel-form-label fl mt-5"><span <label className="panel-form-label fl mt-5"><span
className="color-red fl">*</span>&nbsp;&nbsp;</label> className="color-red fl">*</span>&nbsp;&nbsp;</label>
@ -1090,13 +1090,13 @@ class Newshixuns extends Component {
</li> </li>
<div className={"color-red shixunspanred"}> <div className={"color-red shixunspanred"}>
{this.state.attachmentidstype===true?"请上传附件":""} {this.state.attachmentidstype === true ? "请上传附件" : ""}
</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>
@ -1131,7 +1131,7 @@ class Newshixuns extends Component {
// onMouseLeave={this.bigopens} // onMouseLeave={this.bigopens}
> >
<Select mode="multiple" placeholder="请选择小类别" <Select mode="multiple" placeholder="请选择小类别"
style={{minWidth: 180}} style={{ minWidth: 180 }}
onChange={this.littleClass} onChange={this.littleClass}
// onMouseEnter={this.bigopensmal} // onMouseEnter={this.bigopensmal}
onSelect={this.bigopens} onSelect={this.bigopens}
@ -1142,7 +1142,7 @@ class Newshixuns extends Component {
newshixunlist === undefined ? "" : newshixunlist.small_type.map((item, key) => { newshixunlist === undefined ? "" : newshixunlist.small_type.map((item, key) => {
return ( return (
<Option value={item.id} key={key}> <Option value={item.id} key={key}>
<Tooltip placement="right" title={item.description=== ""?"无描述":item.description} > <Tooltip placement="right" title={item.description === "" ? "无描述" : item.description} >
{item.type_name} {item.type_name}
</Tooltip> </Tooltip>
</Option> </Option>
@ -1152,7 +1152,7 @@ class Newshixuns extends Component {
</Select> </Select>
</div> </div>
<p className="fl ml10 color-grey-9 mt5">请在配置页面完成后续的评测脚本设置操作</p> <p className="fl ml10 color-grey-9 mt5">请在配置页面完成后续的评测脚本设置操作</p>
<div style={{width: '57px'}} className="ml20 fl"> <div style={{ width: '57px' }} className="ml20 fl">
<span className={main_types === true ? "color-orange fl" : "color-orange fl none"} <span className={main_types === true ? "color-orange fl" : "color-orange fl none"}
id="shixun_tech_platform_notice"><i id="shixun_tech_platform_notice"><i
className="fa fa-exclamation-circle mr3"></i></span> className="fa fa-exclamation-circle mr3"></i></span>
@ -1171,7 +1171,7 @@ class Newshixuns extends Component {
className="color-grey-9">选中则给学员提供用于练习操作的命令行窗口</span></Radio> className="color-grey-9">选中则给学员提供用于练习操作的命令行窗口</span></Radio>
<Radio className="radioStyle" value={2}><span>命令行评测窗口</span> <span <Radio className="radioStyle" value={2}><span>命令行评测窗口</span> <span
className="color-grey-9">选中则给学员提供用于关卡评测的命令行窗口</span></Radio> className="color-grey-9">选中则给学员提供用于关卡评测的命令行窗口</span></Radio>
<Checkbox style={{display: SelectTheCommandtype ? "block" : "none"}} <Checkbox style={{ display: SelectTheCommandtype ? "block" : "none" }}
className={"ml36"} checked={this.state.multi_webssh} className={"ml36"} checked={this.state.multi_webssh}
onChange={this.SelectTheCommandonChange}> onChange={this.SelectTheCommandonChange}>
多个命令行窗口<span className="color-grey-9">选中则允许学员同时开启多个命令行窗口</span> 多个命令行窗口<span className="color-grey-9">选中则允许学员同时开启多个命令行窗口</span>
@ -1192,13 +1192,13 @@ class Newshixuns extends Component {
</RadioGroup> </RadioGroup>
<div className="clearfix none" id="unit-all" <div className="clearfix none" id="unit-all"
style={{display: this.state.scopetype === false ? 'none' : 'block'}}> style={{ display: this.state.scopetype === false ? 'none' : 'block' }}>
<div className="fl ml25"> <div className="fl ml25">
<div className="fl" id="unit-input-part" style={{width: '100%'}}> <div className="fl" id="unit-input-part" style={{ width: '100%' }}>
<div id="person-unit" className="fl pr mr10"> <div id="person-unit" className="fl pr mr10">
<div className="shixunScopeInput fl"> <div className="shixunScopeInput fl">
<Select <Select
style={{width: '200px'}} style={{ width: '200px' }}
placeholder="请输入并选择单位名称" placeholder="请输入并选择单位名称"
onChange={(value) => this.shixunScopeInput(value)} onChange={(value) => this.shixunScopeInput(value)}
onSearch={this.shixunHandleSearch} onSearch={this.shixunHandleSearch}
@ -1215,18 +1215,18 @@ class Newshixuns extends Component {
</Select> </Select>
</div> </div>
<span className="color-grey-9">(搜索选中添加单位名称)</span> <span className="color-grey-9">(搜索选中添加单位名称)</span>
{this.state.datalisttype===true?<span className="color-red ml10">请勿选择重复单位</span>:""} {this.state.datalisttype === true ? <span className="color-red ml10">请勿选择重复单位</span> : ""}
{/*<a className="white-btn orange-btn fl mt1 use_scope-btn" onClick={this.adduse_scopeinput}>+ 添加</a>*/} {/*<a className="white-btn orange-btn fl mt1 use_scope-btn" onClick={this.adduse_scopeinput}>+ 添加</a>*/}
</div> </div>
</div> </div>
<div style={{width: '100%'}}> <div style={{ width: '100%' }}>
<div className="mt20 clearfix" id="task_tag_content"> <div className="mt20 clearfix" id="task_tag_content">
{ {
scope_partment === undefined ? "" : scope_partment.map((item, key) => { scope_partment === undefined ? "" : scope_partment.map((item, key) => {
return ( return (
<li className="task_tag_span" key={key}><span>{item}</span> <li className="task_tag_span" key={key}><span>{item}</span>
<a style={{color: 'rgba(0,0,0,.25)'}} <a style={{ color: 'rgba(0,0,0,.25)' }}
onClick={() => this.deleteScopeInput(key)}>×</a> onClick={() => this.deleteScopeInput(key)}>×</a>
</li> </li>
) )
@ -1272,7 +1272,7 @@ class Newshixuns extends Component {
className="mr10 color-orange mt2 fl">*</span></span> className="mr10 color-orange mt2 fl">*</span></span>
<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}
// onMouseEnter={this.sbigopen} // onMouseEnter={this.sbigopen}
onSelect={this.bigopens} onSelect={this.bigopens}
@ -1285,7 +1285,7 @@ class Newshixuns extends Component {
</Select> </Select>
</div> </div>
<span className="fl ml20 mt3 color-grey">实训难易度定位不限定用户群体</span> <span className="fl ml20 mt3 color-grey">实训难易度定位不限定用户群体</span>
<div style={{width: '57px'}} className="ml20 mt2 fl"> <div style={{ width: '57px' }} className="ml20 mt2 fl">
<span <span
className={trainee_types === true ? "color-orange fl" : "color-orange fl none"} className={trainee_types === true ? "color-orange fl" : "color-orange fl none"}
id="shixun_tech_platform_notice"><i id="shixun_tech_platform_notice"><i
@ -1295,19 +1295,19 @@ class Newshixuns extends Component {
</div> </div>
<li className="mb20 pl25"> <li className="mb20 pl25">
<span className="fl edu-txt-right color-grey-6 mr20" <span className="fl edu-txt-right color-grey-6 mr20"
style={{"width": "86px"}}>复制</span> style={{ "width": "86px" }}>复制</span>
<Checkbox onChange={this.Teacherscopy}></Checkbox> <Checkbox onChange={this.Teacherscopy}></Checkbox>
<label style={{top: '6px'}} className="color-grey-6 ml10">勾选则允许已认证的教师复制该实训</label> <label style={{ top: '6px' }} className="color-grey-6 ml10">勾选则允许已认证的教师复制该实训</label>
</li> </li>
<div className="clearfix pl25"> <div className="clearfix pl25">
<span className="fl edu-txt-right color-grey-6 lineh-30 mr20" <span className="fl edu-txt-right color-grey-6 lineh-30 mr20"
style={{"width": "86px"}}>开启时间</span> style={{ "width": "86px" }}>开启时间</span>
<li className="fl"> <li className="fl">
<DatePicker <DatePicker
showToday={false} showToday={false}
locale={locale} locale={locale}
showTime={{ format: 'HH:mm' }} showTime={{ format: 'HH:mm' }}
style={{"width": "184px"}} style={{ "width": "184px" }}
format="YYYY-MM-DD HH:mm" format="YYYY-MM-DD HH:mm"
placeholder="请选择开启时间" placeholder="请选择开启时间"
onChange={this.onChangeTimePicker} onChange={this.onChangeTimePicker}
@ -1316,7 +1316,7 @@ class Newshixuns extends Component {
disabledTime={disabledDateTime} disabledTime={disabledDateTime}
dropdownClassName="hideDisable" dropdownClassName="hideDisable"
/> />
<label style={{top: '6px'}} className="color-grey-6 ml10"> <label style={{ top: '6px' }} className="color-grey-6 ml10">
为空则学员在实训发布后能随时开启实训挑战否则学员在开启时间后才能开启实训挑战 为空则学员在实训发布后能随时开启实训挑战否则学员在开启时间后才能开启实训挑战
</label> </label>
</li> </li>

@ -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';
@ -49,7 +49,7 @@ class Shixunforklist extends Component {
</div> </div>
<ShixunCard/> <ShixunCard />
@ -66,4 +66,4 @@ class Shixunforklist extends Component {
); );
} }
} }
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,34 +27,34 @@ 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);
}) })
@ -67,49 +67,49 @@ class ShixunsIndex extends Component {
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) this.shixunresultend(params)
}else{ } else {
this.setState({ this.setState({
keyword:value, keyword: value,
pages:1 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,31 +362,31 @@ 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%'}}>*/}
@ -427,4 +427,4 @@ class ShixunsIndex extends Component {
} }
} }
export default SnackbarHOC() (TPMIndexHOC ( ShixunsIndex )); export default SnackbarHOC()(TPMIndexHOC(ShixunsIndex));

@ -1,82 +1,82 @@
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">
@ -136,7 +136,7 @@ class AccountPage extends Component {
<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>
@ -149,4 +149,4 @@ class AccountPage extends Component {
} }
} }
export default CNotificationHOC()(SnackbarHOC() ( TPMIndexHOC ( AccountPage ))); export default CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(AccountPage)));

@ -1,14 +1,6 @@
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';
@ -27,4 +19,4 @@ class LoginRegisterPage extends Component {
} }
} }
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), {
params: {
category, category,
status, status,
page, 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,7 +141,7 @@ 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 = (
@ -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>
@ -252,7 +248,7 @@ class InfosCourse extends Component{
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={{ style={{
display: "flex", display: "flex",
@ -320,41 +316,41 @@ class InfosCourse extends Component{
(!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 &&
@ -387,7 +383,7 @@ class InfosCourse extends Component{
{ {
totalCount > 15 && totalCount > 15 &&
<div className="mt30 mb50 edu-txt-center"> <div className="mt30 mb50 edu-txt-center">
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/> <Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page} />
</div> </div>
} }
</Spin> </Spin>

@ -1,10 +1,9 @@
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';
@ -29,27 +28,27 @@ const VideoProtocol = Loadable({
}) })
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}>
{/* --------------------------------------------------------------------- */} {/* --------------------------------------------------------------------- */}
@ -87,4 +86,4 @@ class InfosIndex extends Component{
) )
} }
} }
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), {
params: {
category, category,
status, status,
sort_by, sort_by,
page, 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>
@ -272,7 +268,7 @@ class InfosPath extends Component{
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={{ style={{
display: "flex", display: "flex",
@ -331,24 +327,24 @@ class InfosPath extends Component{
<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 "
@ -357,7 +353,7 @@ class InfosPath extends Component{
<div className="mt10"> <div className="mt10">
<p className="color-grey-6 clearfix"> <p className="color-grey-6 clearfix">
<a href="javascript:void(0)" className="fl color-grey-9 overflowHidden1" <a href="javascript:void(0)" className="fl color-grey-9 overflowHidden1"
title={item.owner_name.length > 12 ? item.owner_name : ''} style={{ maxWidth: '175px'}} title={item.owner_name.length > 12 ? item.owner_name : ''} style={{ maxWidth: '175px' }}
>{item.owner_name}</a> >{item.owner_name}</a>
<span className="fr squareIconSpan"> <span className="fr squareIconSpan">
<Tooltip placement='bottom' title="访问量"> <Tooltip placement='bottom' title="访问量">
@ -376,7 +372,7 @@ class InfosPath extends Component{
{ {
totalCount > 15 && totalCount > 15 &&
<div className="mt30 mb50 edu-txt-center"> <div className="mt30 mb50 edu-txt-center">
<Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page}/> <Pagination showQuickJumper total={totalCount} onChange={this.changePage} pageSize={16} current={page} />
</div> </div>
} }
</Spin> </Spin>

@ -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"
@ -38,27 +37,27 @@ const ExerciseBanksEdit = Loadable({
}); });
//普通作业题库详情 //普通作业题库详情
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,
}); });
@ -68,16 +67,16 @@ const GtaskBanksEdit = Loadable({
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
@ -85,8 +84,8 @@ class BanksIndex extends Component{
} }
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({
@ -116,21 +115,21 @@ 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>
) )
}) })
@ -139,22 +138,22 @@ class BanksIndex extends Component{
} }
{ {
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>
@ -188,7 +187,7 @@ class BanksIndex extends Component{
<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>
@ -223,7 +222,7 @@ class BanksIndex extends Component{
{/*毕设内容题库详情*/} {/*毕设内容题库详情*/}
<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>
{/*分组作业题库详情*/} {/*分组作业题库详情*/}
@ -246,7 +245,7 @@ class BanksIndex extends Component{
) )
} }
} }
export default CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(BanksIndex) )); export default CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(BanksIndex)));

@ -1,52 +1,42 @@
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 (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;
} }
} }
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;
} }
} }
@ -54,18 +44,18 @@ class publicCreateNew extends Component{
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>

@ -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)
@ -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) {
@ -219,7 +217,7 @@ 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>`
} }
@ -329,7 +327,7 @@ function InfoVideo (props) {
}}> }}>
<span> <span>
<span style={{color: theme.foreground_orange1}}> {count} </span> <span style={{ color: theme.foreground_orange1 }}> {count} </span>
个视频 个视频
</span> </span>
@ -340,7 +338,7 @@ function InfoVideo (props) {
{/*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",
@ -407,7 +405,7 @@ function InfoVideo (props) {
> >
</VideoInReviewItem>) </VideoInReviewItem>)
}) })
: <NoneData style={{width: '100%'}}></NoneData> : <NoneData style={{ width: '100%' }}></NoneData>
} }
</div> </div>
: :
@ -425,7 +423,7 @@ function InfoVideo (props) {
> >
</VideoInReviewItem>) </VideoInReviewItem>)
}) })
: <NoneData style={{width: '100%'}}></NoneData> : <NoneData style={{ width: '100%' }}></NoneData>
} }
</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,14 +142,14 @@ 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>
@ -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>
@ -202,28 +202,28 @@ class SearchPage extends Component{
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>
@ -233,10 +233,10 @@ class SearchPage extends Component{
{item.content.content === undefined || item.content.content===0?"": item.content.content.map((item4, key4) => { {item.content.content === undefined || item.content.content === 0 ? "" : item.content.content.map((item4, key4) => {
return ( return (
<span className={"markdown-body magr11 fontextcolor"} <span className={"markdown-body magr11 fontextcolor"}
dangerouslySetInnerHTML={{__html: item4}} /> dangerouslySetInnerHTML={{ __html: item4 }} />
) )
}) })
} }
@ -244,10 +244,10 @@ class SearchPage extends Component{
<div> <div>
{/*内容*/} {/*内容*/}
{item.content.description === undefined || item.content.description===0?"": item.content.description.map((item3, key3) => { {item.content.description === undefined || item.content.description === 0 ? "" : item.content.description.map((item3, key3) => {
return ( return (
<span className={"markdown-body magr11 fontextcolor"} <span className={"markdown-body magr11 fontextcolor"}
dangerouslySetInnerHTML={{__html: item3}} /> dangerouslySetInnerHTML={{ __html: item3 }} />
) )
}) })
} }
@ -259,12 +259,12 @@ class SearchPage extends Component{
{/*挑战名字*/} {/*挑战名字*/}
{item.content.challenge_names === undefined || item.content.challenge_names===0?"": item.content.challenge_names.map((item5, key5) => { {item.content.challenge_names === undefined || item.content.challenge_names === 0 ? "" : item.content.challenge_names.map((item5, key5) => {
return ( return (
<div className={"df"}> <div className={"df"}>
<span style={{flex: '0 0 82px'}}>关卡名称</span> <span style={{ flex: '0 0 82px' }}>关卡名称</span>
<span className={""} <span className={""}
dangerouslySetInnerHTML={{__html: item5}} /> dangerouslySetInnerHTML={{ __html: item5 }} />
</div> </div>
) )
}) })
@ -273,14 +273,14 @@ class SearchPage extends Component{
<div> <div>
{/*挑战标签*/} {/*挑战标签*/}
{item.content.challenge_tag_names === undefined || item.content.challenge_tag_names===0?"": item.content.challenge_tag_names.map((item6, key6) => { {item.content.challenge_tag_names === undefined || item.content.challenge_tag_names === 0 ? "" : item.content.challenge_tag_names.map((item6, key6) => {
return ( return (
<div className={"df"}> <div className={"df"}>
<span style={{flex: '0 0 82px'}}>关卡标签</span> <span style={{ flex: '0 0 82px' }}>关卡标签</span>
<span className={key6>1?" tzbq ":" tzbqx"} style={{ <span className={key6 > 1 ? " tzbq " : " tzbqx"} style={{
width:"100%" width: "100%"
}} }}
dangerouslySetInnerHTML={{__html:item6}} /> dangerouslySetInnerHTML={{ __html: item6 }} />
</div> </div>
) )
}) })
@ -288,12 +288,12 @@ class SearchPage extends Component{
</div> </div>
<div> <div>
{/*合作单位*/} {/*合作单位*/}
{item.content.member_user_names === undefined || item.content.member_user_names===0?"": item.content.member_user_names.map((item7, key7) => { {item.content.member_user_names === undefined || item.content.member_user_names === 0 ? "" : item.content.member_user_names.map((item7, key7) => {
return ( return (
<div className={"df"}> <div className={"df"}>
<span style={{flex: '0 0 82px'}}>合作团队</span> <span style={{ flex: '0 0 82px' }}>合作团队</span>
<span className={key7>1?" tzbq ":" tzbqx"} <span className={key7 > 1 ? " tzbq " : " tzbqx"}
dangerouslySetInnerHTML={{__html:item7}} /> dangerouslySetInnerHTML={{ __html: item7 }} />
</div> </div>
) )
}) })
@ -329,7 +329,7 @@ class SearchPage extends Component{
<span>任务: <span>任务:
<span className="ml10 ziticor">{item.challenges_count}</span> <span className="ml10 ziticor">{item.challenges_count}</span>
</span> </span>
</span> } </span>}
{!!item.study_count && <span className="ml20 ziticor"> {!!item.study_count && <span className="ml20 ziticor">
{/* <i className="iconfont icon-chengyuan ziticor"></i> */} {/* <i className="iconfont icon-chengyuan ziticor"></i> */}
<span>学习人数: <span>学习人数:
@ -360,7 +360,7 @@ class SearchPage extends Component{
{!!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>
@ -389,8 +389,8 @@ 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>
@ -404,4 +404,4 @@ class SearchPage extends Component{
} }
} }
export default SnackbarHOC() (TPMIndexHOC ( SearchPage )); export default SnackbarHOC()(TPMIndexHOC(SearchPage));

Loading…
Cancel
Save