dev_aliyun2
harry 5 years ago
parent fc2aff16e4
commit 89c7c078cf

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

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

@ -1,9 +1,9 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import { TPMIndexHOC } from '../modules/tpm/TPMIndexHOC';
import {Spin,Alert} from 'antd';
import TPMIndexHOC from '../modules/tpm/TPMIndexHOC';
import { Spin, Alert } from 'antd';
class ShowSpin extends Component{
class ShowSpin extends Component {
constructor(props) {
super(props)
}
@ -11,7 +11,7 @@ class ShowSpin extends Component{
render() {
let marigin={
let marigin = {
width: '100%',
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 { default as queryString } from './UrlTool2';
export { SnackbarHOC as SnackbarHOC } from './SnackbarHOC';
export { default as SnackbarHOC } from './SnackbarHOC';
export {
trigger as trigger, on as on, off as off
@ -42,7 +42,7 @@ export { default as AttachmentList } from './components/attachment/AttachmentLis
export { themes, ThemeContext } from './context/ThemeContext'
export { ModalHOC } from './components/ModalHOC'
export { default as ModalHOC } from './components/ModalHOC'
export { SetAppModel } from './components/SetAppModel'
@ -73,7 +73,7 @@ export { default as ImageLayer2 } from './hooks/ImageLayer2'
// 外部
export { default as CBreadcrumb } from '../modules/courses/common/CBreadcrumb'
export { CNotificationHOC as CNotificationHOC } from '../modules/courses/common/CNotificationHOC'
export { default as CNotificationHOC } from '../modules/courses/common/CNotificationHOC'
export { default as ModalWrapper } from '../modules/courses/common/ModalWrapper'
export { default as NoneData } from '../modules/courses/coursesPublic/NoneData'

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

@ -6,9 +6,9 @@ import Loading from '../../Loading';
import Loadable from 'react-loadable';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import TPMIndexHOC from '../tpm/TPMIndexHOC';
import { SnackbarHOC,getImageUrl } from 'educoder';
import { SnackbarHOC, getImageUrl } from 'educoder';
class http500 extends Component {
render() {
@ -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 { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import TPMIndexHOC from '../tpm/TPMIndexHOC';
import { SnackbarHOC,getImageUrl } from 'educoder';
import { SnackbarHOC, getImageUrl } from 'educoder';
class Shixunnopage extends Component {
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 { TPMIndexHOC } from '..//tpm/TPMIndexHOC';
import TPMIndexHOC from '..//tpm/TPMIndexHOC';
class CompatibilityPage extends Component {
constructor(props) {
@ -146,7 +146,7 @@ class CompatibilityPage extends Component {
<div className="Compatibility">
<div className="Compatibility-icon">
<img src={ bannerImg }
<img src={bannerImg}
></img>
</div>
<div className="Compatibility-tip">你正在使用的浏览器版本过低将不能正常浏览和使用Educoder</div>
@ -161,7 +161,7 @@ class CompatibilityPage extends Component {
<a href="https://www.google.cn/intl/zh-CN/chrome/" className="CompatibilityBrowsers-item"
target="_blank">
<div className="CompatibilityBrowsers-icon CompatibilityBrowsers-chromeIcon">
<img src={ chromeImg }
<img src={chromeImg}
>
</img>
</div>
@ -172,7 +172,7 @@ class CompatibilityPage extends Component {
<a href="http://www.firefox.com.cn/" className="CompatibilityBrowsers-item"
target="_blank">
<div className="CompatibilityBrowsers-icon CompatibilityBrowsers-ieIcon">
<img src={ ffImg }
<img src={ffImg}
>
</img>
@ -184,7 +184,7 @@ class CompatibilityPage extends Component {
<a href="https://www.microsoft.com/zh-cn/download/internet-explorer.aspx" className="CompatibilityBrowsers-item"
target="_blank">
<div className="CompatibilityBrowsers-icon CompatibilityBrowsers-ieIcon">
<img src={ ieImg }
<img src={ieImg}
>
</img>
@ -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 {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
import axios from 'axios';
import moment from 'moment';
import {SnackbarHOC, WordsBtn, getImageUrl} from 'educoder';
import {TPMIndexHOC} from '../tpm/TPMIndexHOC';
import competition from './comcss/competition.css';
import {Button} from 'antd';
import React from 'react';
import { getImageUrl } from 'educoder';
// 团队竞赛报名无报名子组件团队 竞赛报名-已创建战队
class RegisListviewdata extends React.Component {
@ -35,7 +25,7 @@ class RegisListviewdata extends React.Component {
}
render() {
const {item} = this.props;
const { item } = this.props;
return (
<div>
@ -61,15 +51,15 @@ class RegisListviewdata extends React.Component {
textAlign: "center",
}} className="textsize maxnamewidth160">
{
this.props.admin?
this.props.admin===true?
this.props.admin ?
this.props.admin === true ?
<a className="maxnamewidth160" title={item.name} style={{
fontSize: "16px",
width: "160px",
textAlign: "center",
cursor:"pointer"
cursor: "pointer"
}}
onClick={()=>this.getotiku(`/competitions/${this.props.match.params.identifier}/competition_teams/${item.id}`)}
onClick={() => this.getotiku(`/competitions/${this.props.match.params.identifier}/competition_teams/${item.id}`)}
>{item.name}</a>
: <p className="maxnamewidth160" style={{
color: "#05101A",

@ -1,16 +1,9 @@
import React, {Component} from 'react';
import React from 'react';
import {
BrowserRouter as Router,
Route,
Switch,
Link
} from 'react-router-dom';
import axios from 'axios';
import moment from 'moment';
import {SnackbarHOC, WordsBtn} from 'educoder';
import {TPMIndexHOC} from '../tpm/TPMIndexHOC';
import competition from './comcss/competition.css';
import {Button, Pagination, message, Spin, Breadcrumb} from 'antd';
import { Pagination, Spin, Breadcrumb } from 'antd';
import Registrationitem from './Registrationitem';
import RegisNodata from './RegisNodata';
import CompetitionMaxImg from './CompetitionMaxImg';
@ -84,7 +77,7 @@ class Registration extends React.Component {
// //////console.log(this.props.isAdmin());
// //// //////console.log(this.props.isAdmin())
try {
const {keyword, page, per_page} = this.state;
const { keyword, page, per_page } = this.state;
this.Getdata(keyword, page, per_page, this.props.user.admin);// 获取列表数据
this.GetenrollmentAPI();//获取我的报名配置
this.setState({
@ -106,7 +99,7 @@ class Registration extends React.Component {
////console.log("Registration");
////console.log("componentDidUpdate");
////console.log(this.props.user.admin);
const {keyword, page, per_page} = this.state;
const { keyword, page, per_page } = this.state;
this.Getdata(keyword, page, per_page, this.props.user.admin);
//取报名配置
this.GetenrollmentAPI();
@ -219,7 +212,7 @@ class Registration extends React.Component {
per_page: per_page,
};
let url = `/competitions/${this.props.match.params.identifier}/competition_teams.json`;
axios.get((url), {params: datas}).then((result) => {
axios.get((url), { params: datas }).then((result) => {
if (result) {
if (result.data) {
//// //////console.log(result);\
@ -526,7 +519,7 @@ class Registration extends React.Component {
pages: pageNumber,
loadingstate: true,
})
const {keyword, per_page} = this.state;
const { keyword, per_page } = this.state;
this.Getdata(keyword, pageNumber, per_page, this.props.user.admin);
};
@ -539,7 +532,7 @@ class Registration extends React.Component {
return
}
let {region_schools} = this.state;
let { region_schools } = this.state;
//判断是否是否是同一个学校数组元素为0就不用判断
try {
if (region_schools.length > 0) {
@ -657,7 +650,7 @@ class Registration extends React.Component {
return
}
let {region_schools} = this.state;
let { region_schools } = this.state;
//判断是否是否是同一个学校数组元素为0就不用判断
try {
if (region_schools.length > 0) {
@ -825,7 +818,7 @@ class Registration extends React.Component {
};
//刷新战队
Refreshteam = () => {
const {keyword, page, per_page} = this.state;
const { keyword, page, per_page } = this.state;
this.Getdata(keyword, page, per_page, this.props.user.admin);
this.GetenrollmentAPI();
}
@ -872,9 +865,9 @@ class Registration extends React.Component {
}
//个人竞赛
// /competitions/:identifier/competition_teams.json
// /competitions/:identifier/competition_teams.json
Personalregistration = () => {
let {teacher_staff, member_staff, data, enroll_ended, enrolled} = this.state;
let { teacher_staff, member_staff, data, enroll_ended, enrolled } = this.state;
if (this.props.checkIfLogin() === false) {
this.props.showLoginDialog();
@ -905,12 +898,12 @@ class Registration extends React.Component {
render() {
const {page, admin, typeysl, mode, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate, pint, competition_name, mutiple_limited, teamutiple_limited, members_count} = this.state;
const { page, admin, typeysl, mode, pages, limit, type, tmodalsType, tmodalsTypes, data, count, competition_teams, Newtit, itemiddata, messagePerbool, messageexitol, GetenrollmentAPI, loadingstate, pint, competition_name, mutiple_limited, teamutiple_limited, members_count } = this.state;
return (
<div className="newMain clearfix newMainybot">
<div className={"educontent mb20 persmstyle"} style={{width: "1200px", marginTop: "26px"}}>
<div className={"educontent mb20 persmstyle"} style={{ width: "1200px", marginTop: "26px" }}>
<style>
{
`
@ -956,7 +949,7 @@ class Registration extends React.Component {
}
<div style={{marginBottom: '12px'}}>
<div style={{ marginBottom: '12px' }}>
<Breadcrumb separator=">">
<Breadcrumb.Item><Link to={"/competitions"}>在线竞赛</Link></Breadcrumb.Item>
<Breadcrumb.Item><Link
@ -980,8 +973,8 @@ class Registration extends React.Component {
<div style={{
marginTop: "22px"
}}>
<p>参赛总人数<span style={{color: "#459BE5"}}>{members_count}</span><span
style={{marginLeft: "5px"}}></span>
<p>参赛总人数<span style={{ color: "#459BE5" }}>{members_count}</span><span
style={{ marginLeft: "5px" }}></span>
</p>
</div> : "")
: ""}
@ -1067,7 +1060,7 @@ class Registration extends React.Component {
height: "20px",
minHeight: "20px"
}}></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}
onChange={this.paginationonChangestwo} pageSize={limit}
total={count}></Pagination>

@ -1,16 +1,5 @@
import React, {Component} from 'react';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
import axios from 'axios';
import moment from 'moment';
import {SnackbarHOC, WordsBtn, getImageUrl} from 'educoder';
import {TPMIndexHOC} from '../tpm/TPMIndexHOC';
import competition from './comcss/competition.css';
import {Button} from 'antd';
import RegisListviewdata from "./RegisListviewdata";
import React from 'react';
import { getImageUrl } from 'educoder';
// 团队竞赛报名无报名子组件团队 竞赛报名-已创建战队
class Registrationitem extends React.Component {
@ -22,7 +11,7 @@ class Registrationitem extends React.Component {
render() {
let {item} = this.props;
let { item } = this.props;
return (
<div className="yslborderbottom">
{

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

@ -1,15 +1,6 @@
import React, {Component} from 'react';
import {
BrowserRouter as Router,
Route,
Switch
} from 'react-router-dom';
import axios from 'axios';
import moment from 'moment';
import {SnackbarHOC, WordsBtn, getImageUrl} from 'educoder';
import {TPMIndexHOC} from '../../tpm/TPMIndexHOC';
import competition from '../comcss/competition.css';
import {Button, message, Tooltip} from 'antd';
import React from 'react';
import { getImageUrl } from 'educoder';
import { message, Tooltip } from 'antd';
// 点击按钮复制功能
function jsCopy(s) {
var e = document.getElementById(s);
@ -51,7 +42,7 @@ class PersonalCompetititem extends React.Component {
}
render() {
const {key, item, type, mode} = this.props;
const { key, item, type, mode } = this.props;
// ////console.log("PersonalCompetititem");
// ////console.log(data);
// ////console.log(data[0]);
@ -254,7 +245,7 @@ class PersonalCompetititem extends React.Component {
: {
marginLeft: "16px",
}}>
<div style={{marginTop: "23px", width: '140px'}}>
<div style={{ marginTop: "23px", width: '140px' }}>
<span style={{
color: "#05101A",
fontSize: "16px",
@ -272,7 +263,7 @@ class PersonalCompetititem extends React.Component {
width: "1px"
}}>
<input id={"copy_invite_code" + this.props.index}
value={item.invite_code === null || item.invite_code === undefined ? "" : item.invite_code}/>
value={item.invite_code === null || item.invite_code === undefined ? "" : item.invite_code} />
</div>
</div>
{item.invite_code === null || item.invite_code === undefined ?
@ -315,17 +306,17 @@ class PersonalCompetititem extends React.Component {
}}>战队详情</a>
</div>
<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)}>
<p onClick={() => this.props.Exittheteamshow(item.id, true)}>删除战队</p>
</div>
<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)}>
<p onClick={() => this.props.Createateamedit(item)}>编辑战队</p>
</div>
<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)}>
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
</div>
@ -339,17 +330,17 @@ class PersonalCompetititem extends React.Component {
>
<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)}>
<p onClick={() => this.props.Exittheteamshow(item.id, true)}>删除战队</p>
</div>
<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)}>
<p onClick={() => this.props.Createateamedit(item)}>编辑战队</p>
</div>
<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)}>
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
</div>
@ -375,17 +366,17 @@ class PersonalCompetititem extends React.Component {
}}>战队详情</a>
</div>
<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)}>
<p onClick={() => this.props.Exittheteamshow(item.id, true)}>删除战队</p>
</div>
<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)}>
<p onClick={() => this.props.Createateamedit(item)}>编辑战队</p>
</div>
<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)}>
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
</div>
@ -397,17 +388,17 @@ class PersonalCompetititem extends React.Component {
}}
>
<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)}>
<p onClick={() => this.props.Exittheteamshow(item.id, true)}>删除战队</p>
</div>
<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)}>
<p onClick={() => this.props.Createateamedit(item)}>编辑战队</p>
</div>
<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)}>
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
</div>

@ -1,14 +1,12 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { Route, Link, Switch } from "react-router-dom";
import { Route, Switch } from "react-router-dom";
import Loading from '../../Loading';
import Loadable from 'react-loadable';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../courses/common/CNotificationHOC';
import TPMIndexHOC from '../tpm/TPMIndexHOC';
import CNotificationHOC from '../courses/common/CNotificationHOC';
//新版竞赛首页
const CompetitionsIndex = Loadable({
@ -17,7 +15,7 @@ const CompetitionsIndex = Loadable({
})
//竞赛详情页
const CompetitionCommon=Loadable({
const CompetitionCommon = Loadable({
loader: () => import('./Competitioncommon/CompetitionCommon'),
loading: Loading,
})
@ -40,7 +38,7 @@ class Competitions extends Component {
super(props)
}
componentDidMount(){
componentDidMount() {
window.document.title = '竞赛';
}
@ -64,7 +62,7 @@ class Competitions extends Component {
<Route
path="/competitions/:identifier/enroll"
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 { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import { Route, Switch } from 'react-router-dom';
import Loadable from 'react-loadable';
import Loading from '../../Loading';
import axios from 'axios';
// import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import { CNotificationHOC } from './common/CNotificationHOC'
import CNotificationHOC from './common/CNotificationHOC'
import "./css/Courses.css"
//引入对应跳转的组件
const ListPageIndex = Loadable({
loader: () => import('./ListPageIndex'),
loading:Loading,
loading: Loading,
})
// 讨论
const BoardsNew= Loadable({
const BoardsNew = Loadable({
loader: () => import('./boards/BoardsNew'),
loading: Loading,
})
const TopicDetail= Loadable({
const TopicDetail = Loadable({
loader: () => import('./boards/TopicDetail'),
loading: Loading,
})
// 讨论
const Boards= Loadable({
const Boards = Loadable({
loader: () => import('./boards'),
loading: Loading,
})
class CoursesIndex extends Component{
class CoursesIndex extends Component {
constructor(props) {
super(props)
this.state={
this.state = {
// coursedata:undefined
}
}
componentDidMount(){
componentDidMount() {
}
render() {
@ -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 { 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 Loadable from 'react-loadable';
import Loading from '../../Loading';
import axios from 'axios';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import { CNotificationHOC } from './common/CNotificationHOC'
import {ImageLayerOfCommentHOC} from '../page/layers/ImageLayerOfCommentHOC'
import TPMIndexHOC from '../tpm/TPMIndexHOC';
import CNotificationHOC from './common/CNotificationHOC'
import ImageLayerOfCommentHOC from '../page/layers/ImageLayerOfCommentHOC'
import "./css/Courses.css"
//引入对应跳转的组件
const ListPageIndex = Loadable({
loader: () => import('./ListPageIndex'),
loading:Loading,
loading: Loading,
})
//课堂首页
const CoursesHome = Loadable({
loader: () => import('./coursesHome/CoursesHome'),
loading:Loading,
loading: Loading,
})
//课堂详情页
const CoursesDetail= Loadable({
const CoursesDetail = Loadable({
loader: () => import('./coursesDetail/CoursesDetail'),
loading:Loading,
loading: Loading,
})
@ -33,62 +33,62 @@ const CoursesDetail= Loadable({
// 课堂讨论
const BoardIndex = Loadable({
loader: () => import('./BoardIndex'),
loading:Loading,
loading: Loading,
})
const GraduationTopics= Loadable({
const GraduationTopics = Loadable({
loader: () => import('./graduation/topics'),
loading: Loading,
})
const GraduationTopicsDetail= Loadable({
const GraduationTopicsDetail = Loadable({
loader: () => import('./graduation/topics/GraduateTopicDetail'),
loading: Loading,
})
const GraduateTopicPostWorksNew= Loadable({
const GraduateTopicPostWorksNew = Loadable({
loader: () => import('./graduation/topics/GraduateTopicPostWorksNew'),
loading: Loading,
})
const GraduateTopicNew= Loadable({
const GraduateTopicNew = Loadable({
loader: () => import('./graduation/topics/GraduateTopicNew'),
loading: Loading,
})
const GraduationTasks= Loadable({
const GraduationTasks = Loadable({
loader: () => import('./graduation/tasks'),
loading: Loading,
})
// 资源
const Resourcelist= Loadable({
const Resourcelist = Loadable({
loader: () => import('./Resource/index'),
loading: Loading,
})
//新建实训
const WrappedCoursesNewApp= Loadable({
const WrappedCoursesNewApp = Loadable({
loader: () => import('./new/CoursesNew'),
loading: Loading,
})
//新建精品课堂
const WrappedCoursesNewAppGoldclass= Loadable({
const WrappedCoursesNewAppGoldclass = Loadable({
loader: () => import('./new/Goldsubject'),
loading: Loading,
})
const ShixunHomeworkPage =Loadable({
const ShixunHomeworkPage = Loadable({
loader: () => import('./shixunHomework/ShixunHomeworkPage'),
loading: Loading,
})
//实训作业
const ShixunHomework= Loadable({
const ShixunHomework = Loadable({
loader: () => import('./shixunHomework/shixunHomework'),
loading: Loading,
})
//实训作业设置
const Trainingjobsetting= Loadable({
const Trainingjobsetting = Loadable({
loader: () => import('./shixunHomework/Trainingjobsetting'),
loading: Loading,
})
@ -100,7 +100,7 @@ const Trainingjobsetting= Loadable({
// loading: Loading,
// })
//实训作业列表完成的
const Studenthascompleted= Loadable({
const Studenthascompleted = Loadable({
loader: () => import('./shixunHomework/Listofworksstudentone'),
loading: Loading,
})
@ -112,67 +112,67 @@ const CommitSummary = Loadable({
loading: Loading,
})
//实训作业设置
const Workquestionandanswer= Loadable({
const Workquestionandanswer = Loadable({
loader: () => import('./shixunHomework/Workquestionandanswer'),
loading: Loading,
})
//实训报告
const ShixunWorkReport= Loadable({
const ShixunWorkReport = Loadable({
loader: () => import('./shixunHomework/ShixunWorkReport'),
loading: Loading,
})
//实训查重
const ShixunStudentWork= Loadable({
const ShixunStudentWork = Loadable({
loader: () => import('./shixunHomework/ShixunStudentWork'),
loading: Loading,
})
//实训查重详情
const ShixunWorkDetails= Loadable({
const ShixunWorkDetails = Loadable({
loader: () => import('./shixunHomework/ShixunWorkDetails'),
loading: Loading,
})
//问卷
const Poll= Loadable({
const Poll = Loadable({
loader: () => import('./poll/Poll'),
loading: Loading,
})
//问卷新建
const PollNew= Loadable({
const PollNew = Loadable({
loader: () => import('./poll/PollNew'),
loading: Loading,
})
//问卷答题
const PollInfo= Loadable({
const PollInfo = Loadable({
loader: () => import('./poll/PollInfo'),
loading: Loading,
})
//问卷详情
const PollDetail= Loadable({
const PollDetail = Loadable({
loader: () => import('./poll/PollDetailIndex'),
loading: Loading,
})
//试卷
const Exercise= Loadable({
const Exercise = Loadable({
loader: () => import('./exercise/Exercise'),
loading: Loading,
})
const Testpapersettinghomepage =Loadable({
const Testpapersettinghomepage = Loadable({
loader: () => import('./exercise/Testpapersettinghomepage'),
loading: Loading,
})
const ExerciseNew =Loadable({
const ExerciseNew = Loadable({
loader: () => import('./exercise/ExerciseNew'),
loading: Loading,
})
const ExerciseReviewAndAnswer=Loadable({
loader:() => import('./exercise/ExerciseReviewAndAnswer'),
const ExerciseReviewAndAnswer = Loadable({
loader: () => import('./exercise/ExerciseReviewAndAnswer'),
loading: Loading,
})
@ -183,23 +183,23 @@ const Studentshavecompletedthelist = Loadable({
})
//教师列表
const TeacherList= Loadable({
const TeacherList = Loadable({
loader: () => import('./members/teacherList'),
loading: Loading,
})
//学生列表
const StudentsList= Loadable({
const StudentsList = Loadable({
loader: () => import('./members/studentsList'),
loading: Loading,
})
//普通作业
const CommonWork= Loadable({
const CommonWork = Loadable({
loader: () => import('./busyWork/Index'),
loading: Loading,
})
const GroupWork= Loadable({
const GroupWork = Loadable({
loader: () => import('./busyWork/IndexGroup'),
loading: Loading,
})
@ -212,40 +212,40 @@ const GroupWork= Loadable({
// })
//毕设任务列表新建
const GraduationTaskseditApp= Loadable({
const GraduationTaskseditApp = Loadable({
loader: () => import('./graduation/tasks/GraduationTasksedit'),
loading: Loading,
})
//毕设任务列表编辑
const GraduationTasksnewApp= Loadable({
const GraduationTasksnewApp = Loadable({
loader: () => import('./graduation/tasks/GraduationTasksnew'),
loading: Loading,
})
//毕设任务列表设置
const GraduationTasksquestions= Loadable({
const GraduationTasksquestions = Loadable({
loader: () => import('./graduation/tasks/GraduationTaskssettingquestions'),
loading: Loading,
})
//毕设任务列表
const GraduationTaskssettinglist= Loadable({
const GraduationTaskssettinglist = Loadable({
loader: () => import('./graduation/tasks/GraduationTaskDetail'),
loading: Loading,
})
//毕业任务设置
const GraduationTaskssetting=Loadable({
const GraduationTaskssetting = Loadable({
loader: () => import('./graduation/tasks/GraduationTaskssetting'),
loading: Loading,
})
// 评阅列表
const GraduationTasksappraise=Loadable({
const GraduationTasksappraise = Loadable({
loader: () => import('./graduation/tasks/GraduationTasksappraise'),
loading: Loading,
})
@ -253,108 +253,109 @@ const GraduationTasksappraise=Loadable({
//创建作品
const GraduationTasksSubmitnewApp=Loadable({
const GraduationTasksSubmitnewApp = Loadable({
loader: () => import('./graduation/tasks/GraduationTasksSubmitnew'),
loading: Loading,
})
//修改作品
const GraduationTasksSubmiteditApp=Loadable({
const GraduationTasksSubmiteditApp = Loadable({
loader: () => import('./graduation/tasks/GraduationTasksSubmitedit'),
loading: Loading,
})
//排序
const Ordering=Loadable({
const Ordering = Loadable({
loader: () => import('../../modules/courses/ordering/Ordering'),
loading: Loading,
});
class CoursesIndex extends Component{
class CoursesIndex extends Component {
constructor(props) {
super(props)
this.state={
this.state = {
coursesids: undefined,
coursesidsfun:this.coursesidsfun,
updataleftNavfun:this.updataleftNav,
course_modules:undefined,
hidden_modules:[],
is_teacher:false,
isaloadtype:true,
coursesidtype:undefined,
locationNavfun:this.locationNav,
unlocationNavfun:this.unlocationNavfun
coursesidsfun: this.coursesidsfun,
updataleftNavfun: this.updataleftNav,
course_modules: undefined,
hidden_modules: [],
is_teacher: false,
isaloadtype: true,
coursesidtype: undefined,
locationNavfun: this.locationNav,
unlocationNavfun: this.unlocationNavfun
}
}
coursesidsfun=(id,type)=>{
coursesidsfun = (id, type) => {
this.setState({
coursesids:id,
coursesidtype:type
coursesids: id,
coursesidtype: type
})
}
componentDidMount(){
componentDidMount() {
// this.updataleftNav()
this.historyArray = [window.location.pathname];
this.props.history.listen( location => {
this.props.history.listen(location => {
this.historyArray.unshift(window.location.pathname);
this.historyArray.length = 2;
//Do your stuff here
});
}
//更新左边课堂导航
updataleftNav=()=>{
let query=this.props.location.pathname
let {isaloadtype}=this.state;
let types=isaloadtype===false?true:false
updataleftNav = () => {
let query = this.props.location.pathname
let { isaloadtype } = this.state;
let types = isaloadtype === false ? true : false
const type = query.split('/');
let id=parseInt(type[2])
if(isNaN(id)){
let id = parseInt(type[2])
if (isNaN(id)) {
return
}
const querys = this.props.location.search;
var dataqueryss={}
var dataqueryss = {}
try {
var foqus=this.foo(querys);
if(JSON.stringify(foqus) ==="{}"){
var foqus = this.foo(querys);
if (JSON.stringify(foqus) === "{}") {
this.setState({
dataquerys:{},
dataquerys: {},
});
}else{
} else {
this.setState({
dataquerys:foqus,
dataquerys: foqus,
});
dataqueryss=foqus;
dataqueryss = foqus;
}
}catch (e) {
} catch (e) {
this.setState({
dataquerys:{},
dataquerys: {},
})
}
// let id=this.props.match.params.coursesId;
let url ="/courses/"+id+"/left_banner.json"
let url = "/courses/" + id + "/left_banner.json"
axios.get(url,
{params:
{
params:
dataqueryss
}
).then((response) => {
if(response!=undefined){
if(response.data&&response.data){
if (response != undefined) {
if (response.data && response.data) {
this.setState({
course_modules:response.data.course_modules,
hidden_modules:response.data.hidden_modules,
is_teacher:response.data.is_teacher,
isaloadtype:types
course_modules: response.data.course_modules,
hidden_modules: response.data.hidden_modules,
is_teacher: response.data.is_teacher,
isaloadtype: types
})
this.locationNav(response.data.course_modules)
}
}
})
};
foo=(url)=> {
foo = (url) => {
var json = {};
var regExp = /[\?\&](\w+)(=?)(\w*)/g;
var arr;
@ -376,36 +377,36 @@ class CoursesIndex extends Component{
return json;
};
locationNav=(list)=>{
if(list){
let url=this.props.location.pathname;
locationNav = (list) => {
if (list) {
let url = this.props.location.pathname;
const type = url.split('/');
let filesId=parseInt(type[4]);
let filesId = parseInt(type[4]);
// 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({
indexs:index,
mainurl:item.category_url
indexs: index,
mainurl: item.category_url
})
this.coursesidsfun(item.id,"node")
}else{
if(item.second_category!=undefined&&item.second_category.length!=0){
item.second_category.forEach((iem,key)=>{
if(url===iem.second_category_url){
this.coursesidsfun(item.id, "node")
} else {
if (item.second_category != undefined && item.second_category.length != 0) {
item.second_category.forEach((iem, key) => {
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({
indexs:index,
url:url,
mainurl:item.category_url
indexs: index,
url: 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({
indexs:val,
indexs: val,
})
}
// // 老师、管理员等
@ -517,23 +518,23 @@ class CoursesIndex extends Component{
{/* 资源列表页 */}
<Route path="/courses/:coursesId/file/:Id" exact
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route path="/courses/:coursesId/files/:main_id"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route exact path="/courses/:coursesId/boards/:boardId"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/*课堂讨论*/}
<Route path="/courses/:coursesId/boards/:boardId"
render={
(props) => (<BoardIndex {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<BoardIndex {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
@ -541,32 +542,32 @@ class CoursesIndex extends Component{
{/* 毕设问答 */}
<Route path="/courses/:coursesId/graduation_topics/postwork/new"
render={
(props) => (<GraduateTopicPostWorksNew {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<GraduateTopicPostWorksNew {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/* 毕设选题新建页 */}
<Route path="/courses/:coursesId/graduation_topics/new"
render={
(props) => (<GraduateTopicNew {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<GraduateTopicNew {...this.props} {...props} {...this.state} {...common} />)
}></Route>
{/* 毕设选题编辑页*/}
<Route path="/courses/:coursesId/graduation_topics/:topicId/edit"
render={
(props) => (<GraduateTopicNew {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<GraduateTopicNew {...this.props} {...props} {...this.state} {...common} />)
}></Route>
{/* 毕设选题详情页 */}
<Route path="/courses/:course_id/graduation_topics/:graduation_topic_id/detail"
render={
(props)=>(<GraduationTopicsDetail {...this.props} {...props} {...this.state}></GraduationTopicsDetail>)
(props) => (<GraduationTopicsDetail {...this.props} {...props} {...this.state}></GraduationTopicsDetail>)
}
></Route>
{/* 毕设选题列表 */}
<Route path="/courses/:coursesId/graduation_topics/:Id" exact
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
}></Route>
@ -574,21 +575,21 @@ class CoursesIndex extends Component{
{/* 作品评阅 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/appraise"
render={
(props) => (<GraduationTasksappraise {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<GraduationTasksappraise {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/* 新建作品 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/works/:task_Id/new"
render={
(props) => (<GraduationTasksSubmitnewApp {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<GraduationTasksSubmitnewApp {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/* 修改作品 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/works/:work_Id/edit"
render={
(props) => (<GraduationTasksSubmiteditApp {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<GraduationTasksSubmiteditApp {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
@ -609,7 +610,7 @@ class CoursesIndex extends Component{
<Route path="/courses/:coursesId/graduation_tasks/:category_id/detail/:task_Id"
render={
(props) => (<GraduationTaskssettinglist {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<GraduationTaskssettinglist {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
@ -617,7 +618,7 @@ class CoursesIndex extends Component{
{/* 修改毕设任务 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/edit"
render={
(props) => (<GraduationTaskseditApp {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<GraduationTaskseditApp {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
@ -625,7 +626,7 @@ class CoursesIndex extends Component{
{/* 新建毕设任务 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/new"
render={
(props) => (<GraduationTasksnewApp {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<GraduationTasksnewApp {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
@ -633,7 +634,7 @@ class CoursesIndex extends Component{
{/* 毕设任务列表 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:Id" exact
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
@ -653,72 +654,72 @@ class CoursesIndex extends Component{
{/* 教师列表*/}
<Route path="/courses/:coursesId/teachers"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/* 学生列表*/}
<Route path="/courses/:coursesId/students"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/* 分班列表 */}
<Route path="/courses/:coursesId/course_groups/:course_group_id"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route path="/courses/:coursesId/course_groups"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/* 普通作业 */}
<Route path="/courses/:coursesId/common_homeworks/:category_id" exact
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/* 分组作业 */}
<Route path="/courses/:coursesId/group_homeworks/:category_id" exact
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/* 普通作业 */}
<Route path="/courses/:coursesId/common_homeworks/" strict
render={
(props) => (<CommonWork {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<CommonWork {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/* 分组作业 */}
<Route path="/courses/:coursesId/group_homeworks/" strict
render={
(props) => (<GroupWork {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<GroupWork {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/* 问卷答题 */}
<Route path="/courses/:coursesId/polls/:pollId/users/:login"
render={
(props) => (<PollInfo {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<PollInfo {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/* 问卷详情 */}
<Route path="/courses/:coursesId/polls/:pollId/detail"
render={
(props) => (<PollDetail {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<PollDetail {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/* 问卷新建 */}
<Route path="/courses/:coursesId/polls/:pollid/:news"
render={
(props) => (<PollNew {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<PollNew {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/*/!* 问卷编辑 *!/*/}
@ -730,7 +731,7 @@ class CoursesIndex extends Component{
{/* 问卷 */}
<Route path="/courses/:coursesId/polls/:Id"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
@ -738,20 +739,20 @@ class CoursesIndex extends Component{
{/* 试卷查看/评阅 */}
<Route exact path="/courses/:coursesId/exercises/:Id/users/:userId"
render={
(props)=>(<ExerciseReviewAndAnswer {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ExerciseReviewAndAnswer {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/*试卷新建 */}
<Route exact path="/courses/:coursesId/exercises/new"
render={
(props) => (<ExerciseNew {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ExerciseNew {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/*试卷新建 */}
<Route exact path="/courses/:coursesId/exercises/:Id/edit"
render={
(props) => (<ExerciseNew {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ExerciseNew {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
@ -759,7 +760,7 @@ class CoursesIndex extends Component{
<Route path="/courses/:coursesId/exercises/:Id/student_exercise_list"
render={
(props) => (<Testpapersettinghomepage {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<Testpapersettinghomepage {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
@ -768,14 +769,14 @@ class CoursesIndex extends Component{
<Route
path="/courses/:coursesId/exercises/:Id/Studentshavecompletedthelist"
render={
(props) => (<Studentshavecompletedthelist {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<Studentshavecompletedthelist {...this.props} {...props} {...this.state} {...common} />)
}
>
</Route>
{/* 试卷 */}
<Route path="/courses/:coursesId/exercises/:Id"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
@ -783,65 +784,65 @@ class CoursesIndex extends Component{
{/*实训查重详情*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/review_detail/:userid"
render={
(props) => (<ShixunWorkDetails {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ShixunWorkDetails {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/review_detail/:userid"
render={
(props) => (<ShixunWorkDetails {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ShixunWorkDetails {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/*实训查重列表*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/student_work"
render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/student_work"
render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/*实训报告*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/shixun_work_report"
render={
(props) => (<ShixunWorkReport {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ShixunWorkReport {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/shixun_work_report"
render={
(props) => (<ShixunWorkReport {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ShixunWorkReport {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/*教师列表*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/list"
render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/list"
render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/*实训作业page*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/Page"
render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/*实训作业设置*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/settings"
render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/settings"
render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/*/!*实训作品列表教师*!/*/}
@ -880,21 +881,21 @@ class CoursesIndex extends Component{
{/*实训作业问答主目录*/}
<Route path="/courses/:coursesId/shixun_homeworks/:homeworkid/questions"
render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/*实训作业问答子目录*/}
<Route path="/courses/:coursesId/shixun_homework/:homeworkid/questions"
render={
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ShixunHomeworkPage {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/*新建课堂*/}
<Route path="/courses/new"
render={
(props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/*新建精品课堂*/}
@ -902,33 +903,33 @@ class CoursesIndex extends Component{
{/*id 是否是私有或者公有*/}
<Route path="/courses/news/:subjectid/newgold/:id"
render={
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/*修改精品课堂*/}
<Route path="/courses/:coursesId/newgolds/settings"
render={
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<WrappedCoursesNewAppGoldclass {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/*修改课堂*/}
<Route path="/courses/:coursesId/settings"
render={
(props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<WrappedCoursesNewApp {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/* 实训作业子页面*/}
<Route path="/courses/:coursesId/shixun_homework/:category_id"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/* 实训作业页面*/}
<Route path="/courses/:coursesId/shixun_homeworks/:main_id"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
@ -943,14 +944,14 @@ class CoursesIndex extends Component{
{/*/!*实训作业and课堂详情页*!/*/}
<Route path="/courses/:coursesId"
render={
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<ListPageIndex {...this.props} {...props} {...this.state} {...common} />)
}
></Route>
{/*课堂首页*/}
<Route path="/courses"
render={
(props) => (<CoursesHome {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<CoursesHome {...this.props} {...props} {...this.state} {...common} />)
}
></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 moment from 'moment'
import Comments from '../../comment/Comments'
import {ImageLayerOfCommentHOC} from '../../page/layers/ImageLayerOfCommentHOC'
import ImageLayerOfCommentHOC from '../../page/layers/ImageLayerOfCommentHOC'
import MemoDetailMDEditor from '../../forums/MemoDetailMDEditor'
import { RouteHOC } from './common.js'
import '../../forums/Post.css'
@ -11,7 +11,7 @@ import '../../forums/RightSection.css'
import './TopicDetail.css'
import '../common/courseMessage.css'
import { MarkdownToHtml, setImagesUrl } from 'educoder'
import { Pagination, Tooltip,Button } from 'antd'
import { Pagination, Tooltip, Button } from 'antd'
import SendToCourseModal from '../coursesPublic/modal/SendToCourseModal'
import CBreadcrumb from '../common/CBreadcrumb'
import {
@ -47,12 +47,12 @@ class TopicDetail extends Component {
pageCount: 1,
comments: [],
goldRewardDialogOpen: false,
author:undefined,
commentstype:false
author: undefined,
commentstype: false
}
}
componentDidMount() {
window.$("html,body").animate({"scrollTop":0})
window.$("html,body").animate({ "scrollTop": 0 })
const topicId = this.props.match.params.topicId
const bid = this.props.match.params.boardId
@ -504,19 +504,19 @@ class TopicDetail extends Component {
}
}
startcomments=()=>{
setTime = setInterval( ()=> {
startcomments = () => {
setTime = setInterval(() => {
this.fetchReplies()
}, 5000);
this.setState({
commentstype:true
commentstype: true
})
}
clearcomments=()=>{
clearcomments = () => {
clearInterval(setTime);
this.setState({
commentstype:false
commentstype: false
})
}
@ -698,10 +698,10 @@ class TopicDetail extends Component {
<div className="padding20 memoReplies commentsDelegateParent comments_hideSecondReplyUserHeader"
style={{ display: (comments && !!comments.length) ? 'block' : 'none', paddingBottom: '0px' }}>
<div className="replies_count commentstypetop">
{this.props.isAdmin()===true? <span className="commentstypebutton font-16 ">
{this.state.commentstype===false?<Button type="primary" onClick={()=>this.startcomments()}>开启刷新评论</Button>
:<Button type="danger" onClick={()=>this.clearcomments()}>停止刷新</Button>}
</span>:""}
{this.props.isAdmin() === true ? <span className="commentstypebutton font-16 ">
{this.state.commentstype === false ? <Button type="primary" onClick={() => this.startcomments()}>开启刷新评论</Button>
: <Button type="danger" onClick={() => this.clearcomments()}>停止刷新</Button>}
</span> : ""}
<span className="labal font-16">全部回复</span>
<span className="count font-16">({memo.total_replies_count})</span>

@ -1,56 +1,56 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import { CNotificationHOC } from '../common/CNotificationHOC'
import CNotificationHOC from '../common/CNotificationHOC'
import { RouteHOC } from './common'
import "../css/busyWork.css"
//引入对应跳转的组件
const ListPageIndex = Loadable({
loader: () => import('../ListPageIndex'),
loading:Loading,
loading: Loading,
})
//新建分组/普通作业
const NewWork = Loadable({
loader: () => import('./NewWork'),
loading:Loading,
loading: Loading,
})
const CommonWorkDetailIndex = Loadable({
loader: () => import('./CommonWorkDetailIndex'),
loading:Loading,
loading: Loading,
})
const CommonWorkSetting = Loadable({
loader: () => import('./CommonWorkSetting'),
loading:Loading,
loading: Loading,
})
const CommonWorkList = Loadable({
loader: () => import('./CommonWorkList'),
loading:Loading,
loading: Loading,
})
const CommonWorkQuestion = Loadable({
loader: () => import('./CommonWorkQuestion'),
loading:Loading,
loading: Loading,
})
const CommonWorkAnswer = Loadable({
loader: () => import('./CommonWorkAnswer'),
loading:Loading,
loading: Loading,
})
const CommonWorkAppraise = Loadable({
loader: () => import('./CommonWorkAppraise'),
loading:Loading,
loading: Loading,
})
const CommonWorkPost = Loadable({
loader: () => import('./CommonWorkPost'),
loading:Loading,
loading: Loading,
})
const CommonWork = Loadable({
loader: () => import('./commonWork'),
loading:Loading,
loading: Loading,
})
class CoursesWorkIndex extends Component{
class CoursesWorkIndex extends Component {
constructor(props) {
super(props)
}
@ -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 { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import { CNotificationHOC } from '../common/CNotificationHOC'
import CNotificationHOC from '../common/CNotificationHOC'
import { RouteHOC } from './common'
import "../css/busyWork.css"
//引入对应跳转的组件
const ListPageIndex = Loadable({
loader: () => import('../ListPageIndex'),
loading:Loading,
loading: Loading,
})
//新建分组/普通作业
const NewWork = Loadable({
loader: () => import('./NewWork'),
loading:Loading,
loading: Loading,
})
const CommonWorkPost = Loadable({
loader: () => import('./CommonWorkPost'),
loading:Loading,
loading: Loading,
})
const CommonWorkSetting = Loadable({
loader: () => import('./CommonWorkSetting'),
loading:Loading,
loading: Loading,
})
const CommonWorkList = Loadable({
loader: () => import('./CommonWorkList'),
loading:Loading,
loading: Loading,
})
const CommonWorkQuestion = Loadable({
loader: () => import('./CommonWorkQuestion'),
loading:Loading,
loading: Loading,
})
const CommonWorkAnswer = Loadable({
loader: () => import('./CommonWorkAnswer'),
loading:Loading,
loading: Loading,
})
const CommonWorkAppraise = Loadable({
loader: () => import('./CommonWorkAppraise'),
loading:Loading,
loading: Loading,
})
const CommonWork = Loadable({
loader: () => import('./commonWork'),
loading:Loading,
loading: Loading,
})
const CommonWorkDetailIndex = Loadable({
loader: () => import('./CommonWorkDetailIndex'),
loading:Loading,
loading: Loading,
})
class CoursesWorkIndex extends Component{
class CoursesWorkIndex extends Component {
constructor(props) {
super(props)
}
@ -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 _ from 'lodash';
import { ImageLayerOfCommentHOC } from '../../../page/layers/ImageLayerOfCommentHOC';
import ImageLayerOfCommentHOC from '../../../page/layers/ImageLayerOfCommentHOC';
import GraduationTasksappraiseMainEditor from '../../graduation/tasks/GraduationTasksappraiseMainEditor';
import CCommentItem from '../../common/comments/CCommentItem';
import '../../../forums/Post.css';

@ -1,37 +1,36 @@
import React,{ Component } from "react";
import React, { Component } from "react";
import { Pagination } from "antd";
import update from 'immutability-helper'
import axios from 'axios'
import MemoDetailMDEditor from '../../../forums/MemoDetailMDEditor'
import '../../../forums/Post.css'
import '../../../forums/RightSection.css'
import {ImageLayerOfCommentHOC} from '../../../page/layers/ImageLayerOfCommentHOC'
import ImageLayerOfCommentHOC from '../../../page/layers/ImageLayerOfCommentHOC'
import Comments from '../../../comment/Comments'
// import './GraduateTopicReply.css'
import '../../common/courseMessage.css'
import { generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment
import {
generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment
, addSecondLevelComment, NEED_TO_WRITE_CONTENT, handleContentBeforeCreateSecondLevelComment
, handleDeleteComment, handleCommentPraise, handleHiddenComment } from '../../common/CommentsHelper'
, handleDeleteComment, handleCommentPraise, handleHiddenComment
} from '../../common/CommentsHelper'
const REPLY_PAGE_COUNT = 10
const $ = window.$;
/*
相比较GraduateTopicReply 改动的地方
列表接口名 /graduation_tasks/${graduation_topic_id}/show_comment.json?parent_id=${parent.id}&limit=500
回复类型名 jour_type: this.props.jour_type,
*/
class CommonReply extends Component{
constructor(props){
class CommonReply extends Component {
constructor(props) {
super(props);
this.state={
this.state = {
pageCount: 1
}
}
componentDidMount(){
componentDidMount() {
this.fetchReplies()
@ -93,7 +92,7 @@ class CommonReply extends Component{
// return;
// }
if (this.props.memo.id === id ) { // 回复帖子
if (this.props.memo.id === id) { // 回复帖子
this.createNewComment(commentContent, id, editor);
return;
}
@ -142,7 +141,7 @@ class CommonReply extends Component{
const graduation_topic_id = this.props.memo.id
const course_id = this.props.course_id
const url = `/${this.props.apiRouteName}/${graduation_topic_id}/show_comment.json?parent_id=${parent.id}&limit=500`
axios.get(url,{
axios.get(url, {
})
.then((response) => {
const { comments } = response.data
@ -170,7 +169,7 @@ class CommonReply extends Component{
const course_id = this.props.course_id
const url = `/${this.props.apiRouteName}/${graduation_topic_id}/show_comment.json?page=${this.state.pageCount}`
// page limit parent_id
axios.get(url,{
axios.get(url, {
})
.then((response) => {
const { comments, messages_count, homework_user_id, parent_messages_count } = response.data
@ -231,12 +230,12 @@ class CommonReply extends Component{
}
}
render(){
render() {
let { total_count, comments, pageCount } = this.state
const { current_user, memo } = this.props
return(
<div style={{background: 'rgb(255, 255, 255)', marginTop: '20px'}} className="course-message">
return (
<div style={{ background: 'rgb(255, 255, 255)', marginTop: '20px' }} className="course-message">
<style>{`
.course-message .commentInput {
padding-bottom: 56px !important;
@ -285,13 +284,13 @@ class CommonReply extends Component{
</div>} */}
</div>
{ total_count > REPLY_PAGE_COUNT &&
{total_count > REPLY_PAGE_COUNT &&
<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> }
</div>}
</div>
)
}
}
export default ImageLayerOfCommentHOC() (CommonReply);
export default ImageLayerOfCommentHOC()(CommonReply);

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

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

@ -1,4 +1,4 @@
import React,{ Component } from "react";
import React, { Component } from "react";
import { Pagination } from "antd";
import update from 'immutability-helper'
@ -7,14 +7,16 @@ import MemoDetailMDEditor from '../../../forums/MemoDetailMDEditor'
import '../../../forums/Post.css'
import '../../../forums/RightSection.css'
import {ImageLayerOfCommentHOC} from '../../../page/layers/ImageLayerOfCommentHOC'
import ImageLayerOfCommentHOC from '../../../page/layers/ImageLayerOfCommentHOC'
import Comments from '../../../comment/Comments'
// import './GraduateTopicReply.css'
import '../../common/courseMessage.css'
import { generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment
import {
generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment
, addSecondLevelComment, NEED_TO_WRITE_CONTENT, handleContentBeforeCreateSecondLevelComment
, handleDeleteComment, handleCommentPraise, handleHiddenComment } from '../../common/CommentsHelper'
, handleDeleteComment, handleCommentPraise, handleHiddenComment
} from '../../common/CommentsHelper'
const REPLY_PAGE_COUNT = 10
const $ = window.$;
@ -23,15 +25,15 @@ const $ = window.$;
列表接口名 /graduation_tasks/${graduation_topic_id}/show_comment.json?parent_id=${parent.id}&limit=500
回复类型名 jour_type: 'GraduationTask',
*/
class GraduationTaskssettingReply extends Component{
constructor(props){
class GraduationTaskssettingReply extends Component {
constructor(props) {
super(props);
this.state={
this.state = {
pageCount: 1
}
}
componentDidMount(){
componentDidMount() {
this.fetchReplies()
@ -90,7 +92,7 @@ class GraduationTaskssettingReply extends Component{
// return;
// }
if (this.props.memo.id === id ) { // 回复帖子
if (this.props.memo.id === id) { // 回复帖子
this.createNewComment(commentContent, id, editor);
return;
}
@ -138,7 +140,7 @@ class GraduationTaskssettingReply extends Component{
const graduation_topic_id = this.props.memo.id
const course_id = this.props.course_id
const url = `/graduation_tasks/${graduation_topic_id}/show_comment.json?parent_id=${parent.id}&limit=500`
axios.get(url,{
axios.get(url, {
})
.then((response) => {
const { comments } = response.data
@ -166,7 +168,7 @@ class GraduationTaskssettingReply extends Component{
const course_id = this.props.course_id
const url = `/graduation_tasks/${graduation_topic_id}/show_comment.json?page=${this.state.pageCount}`
// page limit parent_id
axios.get(url,{
axios.get(url, {
})
.then((response) => {
const { comments, messages_count } = response.data
@ -226,11 +228,11 @@ class GraduationTaskssettingReply extends Component{
}
}
render(){
render() {
let { total_count, comments, pageCount } = this.state
const { current_user, memo } = this.props
return(
return (
<React.Fragment>
<style>{`
@ -267,13 +269,13 @@ class GraduationTaskssettingReply extends Component{
</div>} */}
</div>
{ total_count > REPLY_PAGE_COUNT &&
{total_count > REPLY_PAGE_COUNT &&
<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> }
</div>}
</React.Fragment>
)
}
}
export default ImageLayerOfCommentHOC() (GraduationTaskssettingReply);
export default ImageLayerOfCommentHOC()(GraduationTaskssettingReply);

@ -1,31 +1,32 @@
import React,{ Component } from "react";
import React, { Component } from "react";
import { Pagination } from "antd";
import update from 'immutability-helper'
import axios from 'axios'
import MemoDetailMDEditor from '../../../forums/MemoDetailMDEditor'
import '../../../forums/Post.css'
import '../../../forums/RightSection.css'
import {ImageLayerOfCommentHOC} from '../../../page/layers/ImageLayerOfCommentHOC'
import ImageLayerOfCommentHOC from '../../../page/layers/ImageLayerOfCommentHOC'
import Comments from '../../../comment/Comments'
import './GraduateTopicReply.css'
import '../../common/courseMessage.css'
import { generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment
import {
generateComments, generateChildComments, _findById, handleContentBeforeCreateNew, addNewComment
, addSecondLevelComment, NEED_TO_WRITE_CONTENT, handleContentBeforeCreateSecondLevelComment
, handleDeleteComment, handleCommentPraise, handleHiddenComment } from '../../common/CommentsHelper'
, handleDeleteComment, handleCommentPraise, handleHiddenComment
} from '../../common/CommentsHelper'
const REPLY_PAGE_COUNT = 10
const $ = window.$;
class GraduateTopicReply extends Component{
constructor(props){
class GraduateTopicReply extends Component {
constructor(props) {
super(props);
this.state={
this.state = {
pageCount: 1
}
}
componentDidMount(){
componentDidMount() {
this.fetchReplies()
@ -84,7 +85,7 @@ class GraduateTopicReply extends Component{
// return;
// }
if (this.props.memo.id === id ) { // 回复帖子
if (this.props.memo.id === id) { // 回复帖子
this.createNewComment(commentContent, id, editor);
return;
}
@ -132,7 +133,7 @@ class GraduateTopicReply extends Component{
const graduation_topic_id = this.props.memo.id
const course_id = this.props.course_id
const url = `/courses/${course_id}/graduation_topics/${graduation_topic_id}/show_comment.json?parent_id=${parent.id}&limit=500`
axios.get(url,{
axios.get(url, {
})
.then((response) => {
const { comments } = response.data
@ -160,7 +161,7 @@ class GraduateTopicReply extends Component{
const course_id = this.props.course_id
const url = `/courses/${course_id}/graduation_topics/${graduation_topic_id}/show_comment.json?page=${this.state.pageCount}`
// page limit parent_id
axios.get(url,{
axios.get(url, {
})
.then((response) => {
const { comments, messages_count } = response.data
@ -220,11 +221,11 @@ class GraduateTopicReply extends Component{
}
}
render(){
render() {
let { total_count, comments, pageCount } = this.state
const { current_user, memo } = this.props
return(
return (
<React.Fragment>
<MemoDetailMDEditor {...this.props} ref="editor" memo={memo} usingMockInput={true} placeholder="说点什么"
height={160} showError={true}></MemoDetailMDEditor>
@ -259,13 +260,13 @@ class GraduateTopicReply extends Component{
</div>} */}
</div>
{ total_count > REPLY_PAGE_COUNT &&
{total_count > REPLY_PAGE_COUNT &&
<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> }
</div>}
</React.Fragment>
)
}
}
export default ImageLayerOfCommentHOC() (GraduateTopicReply);
export default ImageLayerOfCommentHOC()(GraduateTopicReply);

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

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { Checkbox,Input,DatePicker } from 'antd';
import TPMIndexHOC from '../../tpm/TPMIndexHOC';
import { Checkbox, Input, DatePicker } from 'antd';
import locale from 'antd/lib/date-picker/locale/zh_CN';
import "../css/Courses.css";
@ -10,29 +10,29 @@ import CoursesListType from '../coursesPublic/CoursesListType';
class Polldepoly extends Component{
class Polldepoly extends Component {
constructor(props) {
super(props)
this.state = {
contents: [{val:"",id:1}],
contents: [{ val: "", id: 1 }],
}
}
componentDidMount() {
}
submitCommitSummary=()=> {
submitCommitSummary = () => {
const mdContnet = this.refs[`md${1}`].getValue().trim();;
console.log(mdContnet)
}
asdasdsad=()=>{
asdasdsad = () => {
this.setState({
contents:""
contents: ""
})
}
render() {
let {contents}=this.state;
let { contents } = this.state;
const dateFormat = 'YYYY-MM-DD HH:mm:ss';
return (
<React.Fragment>
@ -40,15 +40,15 @@ class Polldepoly extends Component{
<div className="newMain clearfix">
<div className={"educontent mb20"}>
<div style={{
width:'100%',
height:'70px'
width: '100%',
height: '70px'
}} >
<p className="ml15 fl color-black mt30 summaryname" onClick={this.asdasdsad}>Java语言之控制语句</p>
<CoursesListType
typelist={["已开启补交"]}
typesylename={"mt28"}
/>
<a onClick={()=>this.props.history.goBack()} className="color-grey-6 fr font-16 ml30 mt18 mr20">返回</a>
<a onClick={() => this.props.history.goBack()} className="color-grey-6 fr font-16 ml30 mt18 mr20">返回</a>
</div>
{/*<div className={"edu-con-bg01 user_bg_shadow bor-grey-e educontentbox"}>*/}
@ -83,7 +83,7 @@ class Polldepoly extends Component{
<div className="clearfix pl60 pt20">
{/*<span className={"color-grey-6"}>发布时间:</span> <Input size="large" placeholder="请选择发布时间" /><span className={"color-grey-9"}>(发布之前,学生不会收到问卷)</span>*/}
<span className="color-grey-6 mt5 fl" style={{minWidth: '70px'}}>发布时间</span>
<span className="color-grey-6 mt5 fl" style={{ minWidth: '70px' }}>发布时间</span>
<span className="fl mt5">
<DatePicker
showTime
@ -94,13 +94,13 @@ class Polldepoly extends Component{
// value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
// onChange={this.onChangeTimePicker}
/>
<label style={{top:'6px'}} className="color-grey-9 ml10" >发布之前学生不会收到问卷</label>
<label style={{ top: '6px' }} className="color-grey-9 ml10" >发布之前学生不会收到问卷</label>
</span>
</div>
<div className="clearfix pl60 pt20">
{/*<span className={"color-grey-6"}>发布时间:</span> <Input size="large" placeholder="请选择发布时间" /><span className={"color-grey-9"}>(发布之前,学生不会收到问卷)</span>*/}
<span className="color-grey-6 mt5 fl" style={{minWidth: '70px'}}>截止时间</span>
<span className="color-grey-6 mt5 fl" style={{ minWidth: '70px' }}>截止时间</span>
<span className="fl mt5">
<DatePicker
showToday={false}
@ -111,7 +111,7 @@ class Polldepoly extends Component{
// value={opening_time===null||opening_time===""?"":moment(opening_time, dateFormat)}
// onChange={this.onChangeTimePicker}
/>
<label style={{top:'6px'}} className="color-grey-9 ml10" >截止时间点系统将自动提交所有学生的答题学生将不能继续答题</label>
<label style={{ top: '6px' }} className="color-grey-9 ml10" >截止时间点系统将自动提交所有学生的答题学生将不能继续答题</label>
</span>
</div>
@ -152,6 +152,6 @@ class Polldepoly extends Component{
}
}
export default SnackbarHOC() ( TPMIndexHOC(Polldepoly) );
export default SnackbarHOC()(TPMIndexHOC(Polldepoly));

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

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

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

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

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

@ -3,7 +3,7 @@ import { Switch, Route } from 'react-router-dom';
import { SnackbarHOC } from 'educoder';
import CustomLoadable from "../../CustomLoadable";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import TPMIndexHOC from "../tpm/TPMIndexHOC";
const Home = CustomLoadable(() => import('./Home/index'));
const EcYear = CustomLoadable(() => import('./EcYear/index'));
@ -11,7 +11,7 @@ const EcSetting = CustomLoadable(() => import('./EcSetting/index'));
const $ = window.$
//工程认证各个页面的查看详情弹层
function elasticLayer(forumId){
function elasticLayer(forumId) {
if (window.__memo) {
doElasticLayer(window.__memo, true)
return;
@ -21,7 +21,7 @@ function elasticLayer(forumId){
$.ajax({
url: url,
type: 'get',
success: function(res) {
success: function (res) {
console.log(res)
doElasticLayer(res.memo)
}
@ -30,7 +30,7 @@ function elasticLayer(forumId){
// document.body.addEventListener('touchmove',bodyScroll,false);
// $('body').css({'position':'fixed',"width":"100%"});
}
function doElasticLayer(memo, rendered){
function doElasticLayer(memo, rendered) {
if (rendered) {
$(".layerContent").show();
$(".newMain").hide();
@ -39,8 +39,8 @@ function doElasticLayer(memo, rendered){
window.__memo = memo
var content = memo.content
var subject = memo.subject
var html='<div class="layerContent"><div class="educontent">' +
'<p class="clearfix pt25 pb25 color-grey-3 bor-bottom-greyE"><span class="fl font-24">'+ subject +'</span>' +
var html = '<div class="layerContent"><div class="educontent">' +
'<p class="clearfix pt25 pb25 color-grey-3 bor-bottom-greyE"><span class="fl font-24">' + subject + '</span>' +
'<a href="javascript:void(0)" onclick="removeElasticLayer();" class="fr font-16 mt5">返回</a></p>' +
'<div id="MDContent"><textarea style="display:none">'
+ content +
@ -56,7 +56,7 @@ function doElasticLayer(memo, rendered){
sequenceDiagram: true // 默认不解析
});
}
function removeElasticLayer(){
function removeElasticLayer() {
$(".layerContent").hide();
$(".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 { TPMIndexHOC } from '../../../tpm/TPMIndexHOC';
// import TPMIndexHOC from '../../../tpm/TPMIndexHOC';
import { SnackbarHOC } from 'educoder'
import { message,Modal,Spin,Icon} from 'antd';
import { message, Modal, Spin, Icon } from 'antd';
import 'antd/dist/antd.css';
@ -21,41 +21,41 @@ const $ = window.$;
class EcCompletionCalculation extends Component {
constructor(props) {
super(props)
this.state={
schooldata:{},
ecComponentState:"ecCompletion",
course_total_score:[],
ec_course_targets:0,
graduation_list:[],
target_list:[],
target_score:[],
evaluate_result:"",
ec_course_targets_count:0,
new_target_ec_year_id:0,
total_rate_data:undefined,
calculatetype:false,
ec_course_id:0,
morelisttype:false,
titlemessage:"提示",
completiontype:false,
completionlist:"",
course_total_scoreaverage:0,
calculatesetype:false,
Spintype:false,
ismanager:false,
course_achievement:"--",
course_rate:"--",
score_levels:[],
score_levelsdata:[],
hife:"/ecs/major_schools/3/years/60/requirement_vs_courses",
}
}
componentWillMount(){
this.state = {
schooldata: {},
ecComponentState: "ecCompletion",
course_total_score: [],
ec_course_targets: 0,
graduation_list: [],
target_list: [],
target_score: [],
evaluate_result: "",
ec_course_targets_count: 0,
new_target_ec_year_id: 0,
total_rate_data: undefined,
calculatetype: false,
ec_course_id: 0,
morelisttype: false,
titlemessage: "提示",
completiontype: false,
completionlist: "",
course_total_scoreaverage: 0,
calculatesetype: false,
Spintype: false,
ismanager: false,
course_achievement: "--",
course_rate: "--",
score_levels: [],
score_levelsdata: [],
hife: "/ecs/major_schools/3/years/60/requirement_vs_courses",
}
}
componentWillMount() {
window.document.title = '课程达成评价结果';
}
componentDidMount(){
componentDidMount() {
console.log("componentDidMount");
console.log("EcCompletionCalculation");
@ -64,28 +64,28 @@ class EcCompletionCalculation extends Component {
// this.UpdateClassData(true);
// const url =`/ec_major_schools/get_navigation_data?ec_course_id=`+ec_course_id;
const ec_course_id=706;
const url =`/ec_courses/${ec_course_id}/evaluation.json`;
const ec_course_id = 706;
const url = `/ec_courses/${ec_course_id}/evaluation.json`;
axios.get(url)
.then((response) => {
if(response.status===200){
if (response.status === 200) {
// if(response.data.allow_visit===false){
// window.location.href="/403"
// }
this.setState({
schooldata:response.data,
ec_course_id:ec_course_id,
schooldata: response.data,
ec_course_id: ec_course_id,
// evaluate_result:response.data.evaluate_result,
// 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,
graduation_list:response.data.graduation_subitem_evaluations,
target_list:response.data.course_targets,
graduation_list: response.data.graduation_subitem_evaluations,
target_list: response.data.course_targets,
// target_score:response.data.target_score,
ec_course_targets_count:response.data.course_targets.length,
course_achievement:response.data.course_achievement,
course_rate:response.data.course_rate,
score_levels:response.data.score_levels,
ec_course_targets_count: response.data.course_targets.length,
course_achievement: response.data.course_achievement,
course_rate: response.data.course_rate,
score_levels: response.data.score_levels,
// score_levelsdata:response.data.course_targets.score_levels,
// morelisttype:newmorelisttype,
// course_total_scoreaverage:course_total_scoreaverage,
@ -102,24 +102,24 @@ class EcCompletionCalculation extends Component {
this.props.Ontitine("competition_calculation_info");
try {
this.props.triggerRef(this);
}catch (e) {
} catch (e) {
}
}
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;
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;
axios.get(Url, {
withCredentials: true,
})
.then((response) => {
if(response.status===200){
if (response.status === 200) {
// if(response.data.allow_visit===false){
// window.location.href="/403"
// }
this.setState({
schooldata:response.data,
ec_course_id:ec_course_id
schooldata: response.data,
ec_course_id: ec_course_id
})
}
})
@ -127,26 +127,26 @@ class EcCompletionCalculation extends Component {
console.log(error);
});
}
showmorelist=()=>{
showmorelist = () => {
this.setState({
morelisttype:false
morelisttype: false
})
this.UpdateClassData(false)
}
UpdateClassData=(key)=>{
let {calculatetype} =this.state;
UpdateClassData = (key) => {
let { calculatetype } = this.state;
// let ec_course_id =this.props.match.params.ec_course_id;
this.setState({
ec_course_id:ec_course_id
ec_course_id: ec_course_id
})
const ec_course_id=706;
const Arl =`/ec_courses/`+ec_course_id+`/calculation_info_data`;
const ec_course_id = 706;
const Arl = `/ec_courses/` + ec_course_id + `/calculation_info_data`;
axios.get(Arl, {
withCredentials: true,
})
.then((response) => {
if(response.status===200){
if (response.status === 200) {
// var list=[];
// if(key===true){
// 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
// }
// let newgraduation_list= response.data.graduation_list.reverse();
let newmorelisttype=false;
if(response.data.course_total_score>10){
newmorelisttype=true
let newmorelisttype = false;
if (response.data.course_total_score > 10) {
newmorelisttype = true
}
let course_total_scoreaverage;
let newlist=response.data.course_total_score[response.data.course_total_score.length-1].total_rate;
for(var i=0; i<newlist.length;i++){
if(i===newlist.length-1){
course_total_scoreaverage=newlist[i].total_score
let newlist = response.data.course_total_score[response.data.course_total_score.length - 1].total_rate;
for (var i = 0; i < newlist.length; i++) {
if (i === newlist.length - 1) {
course_total_scoreaverage = newlist[i].total_score
}
}
@ -176,13 +176,13 @@ class EcCompletionCalculation extends Component {
// evaluate_result:response.data.evaluate_result,
// 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,
graduation_list:response.data.graduation_subitem_evaluations,
target_list:response.data.course_targets,
graduation_list: response.data.graduation_subitem_evaluations,
target_list: response.data.course_targets,
// target_score:response.data.target_score,
ec_course_targets_count:response.data.course_targets.length,
course_achievement:response.data.course_achievement,
course_rate:response.data.course_rate,
score_levels:response.data.score_levels,
ec_course_targets_count: response.data.course_targets.length,
course_achievement: response.data.course_achievement,
course_rate: response.data.course_rate,
score_levels: response.data.score_levels,
// score_levelsdata:,
// morelisttype:newmorelisttype,
// course_total_scoreaverage:course_total_scoreaverage,
@ -197,13 +197,13 @@ class EcCompletionCalculation extends Component {
// console.log(response.data.course_targets.score_levels);
// ec_course_targets:response.data.ec_course_targets,
this.targetsget_navigation_data(response.data.ec_year_id,ec_course_id)
if(calculatetype===true){
this.targetsget_navigation_data(response.data.ec_year_id, ec_course_id)
if (calculatetype === true) {
this.setState({
calculatetype:false,
completiontype:true,
completionlist:'刷新列表数据成功',
calculatesetype:true
calculatetype: false,
completiontype: true,
completionlist: '刷新列表数据成功',
calculatesetype: true
})
}
@ -307,25 +307,25 @@ class EcCompletionCalculation extends Component {
}
newrightcalculatebutton=()=>{
newrightcalculatebutton = () => {
console.log("调用了计算");
this.setState({
Spintype:true
Spintype: true
})
// 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}/evaluation.json`;
const Orl = `/ec_courses/${ec_course_id}/evaluation.json`;
axios.get(Orl)
.then((response) => {
if(response){
if(response.data.status===1){
if (response) {
if (response.data.status === 1) {
this.setState({
calculatetype:true,
completiontype:true,
completionlist:'计算成功',
calculatesetype:true,
Spintype:false
calculatetype: true,
completiontype: true,
completionlist: '计算成功',
calculatesetype: true,
Spintype: false
})
this.UpdateClassData(true);
}
@ -336,46 +336,46 @@ class EcCompletionCalculation extends Component {
console.log(error)
});
}
hidecompletion=()=>{
hidecompletion = () => {
this.setState({
completiontype:false,
completionlist:"",
calculatesetype:false
completiontype: false,
completionlist: "",
calculatesetype: false
})
}
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 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-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
}
let TargetresLists = (length) => {
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_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>)
}
return target_listress
}
let TargetresContentList = (data,value) => {
let TargetresContentList = (data, value) => {
let target_listres = [];
if(data){
if(data.length>0){
for(var i=0;i<data.length;i++){
if (data) {
if (data.length > 0) {
for (var i = 0; i < data.length; i++) {
console.log("TargetresContentList");
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>)
} 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>)
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>)
} 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>)
}
}
@ -390,27 +390,27 @@ class EcCompletionCalculation extends Component {
let Total_rate_dataList = (value) => {
let target_listres = [];
if(value!=undefined){
for(let i = 0; i < value.length; i++) {
if (value != undefined) {
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}>
{/*<div className="color-red">{value[i].total_score}</div>*/}
<div className="color-red">100%</div>
</span>)
}else{
target_listres.push(<span className={i===0?" column-2 operationleft":"column-2 operationleft"} key={i}>
} else {
target_listres.push(<span className={i === 0 ? " column-2 operationleft" : "column-2 operationleft"} key={i}>
{/*<div>{value[i].score}</div>*/}
{/*<div className="color-redFF">占比{(value[i].rate*100).toFixed(2)}%</div>*/}
<div>
{(value[i].rate*100).toFixed(2)}%
{(value[i].rate * 100).toFixed(2)}%
</div>
</span>)
}
}
return target_listres
}else{
} else {
target_listres.push(<span className="column-1 operationright">
{/*<div className="color-red">{value[i].total_score}</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 = [];
if(value!=undefined){
for(let i = 0; i < value.length; i++) {
if (value != undefined) {
for (let i = 0; i < value.length; i++) {
// if(i===0){
// target_listres.push(<span className="column-2 color-05101A" key={i}>
@ -435,7 +435,7 @@ class EcCompletionCalculation extends Component {
// </span>)
// }
if(i<value.length-1){
if (i < value.length - 1) {
target_listres.push(<span className="column-2 color-05101A" key={i}>
<div>{value[i].score.toFixed(2)}</div>
</span>)
@ -460,12 +460,12 @@ class EcCompletionCalculation extends Component {
<div className="task-popup-text-center font-14">{completionlist}</div>
</div>
{
calculatesetype===true?
calculatesetype === true ?
<div className="task-popup-submit clearfix"
style={{width:'69px'}}
style={{ width: '69px' }}
>
<a className="task-btn task-btn-orange fr"
style={{fontWeight: '400'}}
style={{ fontWeight: '400' }}
onClick={this.hidecompletion}
>知道啦</a>
</div>
@ -545,33 +545,33 @@ class EcCompletionCalculation extends Component {
<span className="column-1 operationright color-666">权重</span>
</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?
<li className={ "clearfix newtarget_scoreclass lipadding10im"}>
{target_list.length === 0 && Spintype === false ?
<li className={"clearfix newtarget_scoreclass lipadding10im"}>
<span className="column-1 color-05101A">--</span>
<span className="column-575 color-05101A">--</span>
<span className={"column-1 operationright Systemnum"}>--</span>
<span className="column-1 operationright color-05101A">--</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(
<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>
return (
<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-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">{item.actually_grade}</span>
<span className="column-1 operationright">{item.weight}</span>
</li>
)
}):""
}) : ""
}
@ -580,8 +580,8 @@ class EcCompletionCalculation extends Component {
<div className="edu-back-white eacourse">
<div className="padding1030" id="training_objective_contents">
<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="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>
</div>
</div>
@ -589,8 +589,8 @@ class EcCompletionCalculation extends Component {
<div className="ListTableLine newSystem mb20 graduateRequirement " id="school_major_list">
{
graduation_list.length===0?
<p className="clearfix lipadding20im" style={{minWidth:'1200px'}}>
graduation_list.length === 0 ?
<p className="clearfix lipadding20im" style={{ minWidth: '1200px' }}>
<span className="column-1 color-666 mr16">毕业要求</span>
<span className="nowrap329">{5}</span>
@ -600,24 +600,24 @@ class EcCompletionCalculation extends Component {
<span className="column-1 operationright color-666">课程权重</span>
{TargetresList(5)}
</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?
<li className={'clearfix newtarget_scoreclass marlr19'} style={{minWidth:'1137px'}}>
graduation_list.length === 0 && Spintype === false ?
<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">{1}</span>
<span className="column-500 color-05101A">{"--"}</span>
<span className={"column-1 operationright Systemnum mrj15"}>{"--"}</span>
<span className="column-1 operationright color-05101A">{"--"}</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>
{TargetresContentList(5,[2,2,2,2,2])}
<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])}
</li>
:""
: ""
}
<style>
{
@ -631,11 +631,11 @@ class EcCompletionCalculation extends Component {
}
</style>
{
Spintype===false?graduation_list.map((item,key)=>{
Spintype === false ? graduation_list.map((item, key) => {
if(key===0){
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"}}>
if (key === 0) {
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" }}>
<div className="myliysls">
<span className="column-1 color-666 mr16">毕业要求</span>
</div>
@ -653,7 +653,7 @@ class EcCompletionCalculation extends Component {
)
}
}):""
}) : ""
}
{/*mynewtarget_scoreclassysls*/}
<style>
@ -669,23 +669,23 @@ class EcCompletionCalculation extends Component {
</style>
<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 ">
<span className="column-1 color-05101A mr16" >{key+1}</span>
<span className="column-1 color-05101A mr16" >{key + 1}</span>
</div>
<span className="column-500 color-05101A" data-tip-down={item.content}>{item.content}</span>
<div className="myliysls">
{TargetresContentList(target_list,item.support_course_target_ids)}
{TargetresContentList(target_list, item.support_course_target_ids)}
</div>
<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>}
<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={item.status==="not_achieved"?"column-1 Systemnum mrj15":"column-1 color-green mrj15"} style={{textAlign:"center"}}>{item.status==="not_achieved"?"未完成":"完成"}</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 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>
</div>
</li>
@ -702,7 +702,7 @@ class EcCompletionCalculation extends Component {
// </li>
)
}):""
}) : ""
}
@ -714,19 +714,19 @@ class EcCompletionCalculation extends Component {
<div className="edu-back-white eacourse">
<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 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">姓名</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>
</p>
{/*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>
{/*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>*/}
{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"}}*/}
{
@ -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">平均分</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>*/}
{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> */}
{
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"}}>
<a className={"ecmorelist"} onClick={()=>this.showmorelist()}>加载更多</a>
<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>
</li>
</div>
@ -808,7 +808,7 @@ class EcCompletionCalculation extends Component {
<div className="edu-back-white eacourse">
<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>
@ -822,8 +822,8 @@ class EcCompletionCalculation extends Component {
<span className="column-1 color-666">最高分数</span>
<span className="column-1 color-666">最低分数</span>
{
score_levels&&score_levels.map((i,k)=>{
return(
score_levels && score_levels.map((i, k) => {
return (
<span className="column-1 color-666">{i.description}</span>
)
})
@ -831,21 +831,21 @@ class EcCompletionCalculation extends Component {
</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}>
<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 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 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>
{
i.score_levels.map((j,l)=>{
i.score_levels.map((j, l) => {
return(
return (
<span key={l} className="column-1 color-05101A">
<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>
)
}
@ -881,12 +881,12 @@ class EcCompletionCalculation extends Component {
</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"}>
<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 className="color999">--%</div>
</span>
</li>:""}
</li> : ""}
</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 'antd/dist/antd.css';
import './style.less'
import { ECModalHOC } from '../../common/ECModalHOC'
import ECModalHOC from '../../common/ECModalHOC'
class EcCourseSupportSetting extends Component {
constructor(props) {

@ -2,11 +2,11 @@ import React, { Component } from 'react';
import axios from 'axios';
import { TPMIndexHOC } from '../../../tpm/TPMIndexHOC';
import TPMIndexHOC from '../../../tpm/TPMIndexHOC';
import { SnackbarHOC,getImageUrl } from 'educoder'
import { SnackbarHOC, getImageUrl } from 'educoder'
import { Pagination,Upload,Modal,Checkbox,Spin } from 'antd';
import { Pagination, Upload, Modal, Checkbox, Spin } from 'antd';
import EcTitleCourseEvaluations from '../../ecTitle/ecTitle'
@ -19,55 +19,57 @@ const $ = window.$;
class EcStudentList extends Component {
constructor(props) {
super(props)
this.state={
majorschoollist:undefined,
titlemessage:"提示",
this.state = {
majorschoollist: undefined,
titlemessage: "提示",
// ecComponentState:"ecStudentList",
visible:false,
Modallist:'',
Modallisttypes:0,
studentall:false,
student_id:undefined,
Modallisttypess:0,
ismanager:false,
isSpin:false,
pages:1,
per_pages:20,
total_student:0,
Myschoolstudents:[],
}
}
componentDidMount(){
visible: false,
Modallist: '',
Modallisttypes: 0,
studentall: false,
student_id: undefined,
Modallisttypess: 0,
ismanager: false,
isSpin: false,
pages: 1,
per_pages: 20,
total_student: 0,
Myschoolstudents: [],
}
}
componentDidMount() {
window.document.title = '学生列表';
let major_id=this.props.match.params.majorId;
let year_id=this.props.match.params.yearId;
const url ='/ec_years/'+year_id+'/students.json';
axios.get(url, {params: {
page:this.state.pages,
per_page:this.state.per_pages,
}}).then((response) => {
if(response){
if(response.status){
if(response.status===200){
let major_id = this.props.match.params.majorId;
let year_id = this.props.match.params.yearId;
const url = '/ec_years/' + year_id + '/students.json';
axios.get(url, {
params: {
page: this.state.pages,
per_page: this.state.per_pages,
}
}).then((response) => {
if (response) {
if (response.status) {
if (response.status === 200) {
this.setState({
total_student:response.data.count,
majorschoollist:response.data,
ismanager:response.data.ismanager,
total_student: response.data.count,
majorschoollist: response.data,
ismanager: response.data.ismanager,
});
try {
if(response.data.students.length>0){
var mst=response.data.students;
for(var i=0;i<mst.length;i++){
mst[i].istrue=false;
if (response.data.students.length > 0) {
var mst = response.data.students;
for (var i = 0; i < mst.length; i++) {
mst[i].istrue = false;
}
this.setState({
Myschoolstudents:mst
Myschoolstudents: mst
});
}
}catch (e) {
} catch (e) {
this.setState({
Myschoolstudents:[]
Myschoolstudents: []
});
}
@ -81,37 +83,38 @@ class EcStudentList extends Component {
});
}
uploadcomponentDidMount(){
let major_id=this.props.match.params.majorId;
let year_id=this.props.match.params.yearId;
const url ='/ec_years/'+year_id+'/students.json';
axios.get(url, {params: {
uploadcomponentDidMount() {
let major_id = this.props.match.params.majorId;
let year_id = this.props.match.params.yearId;
const url = '/ec_years/' + year_id + '/students.json';
axios.get(url, {
params: {
page: this.state.pages,
per_page: this.state.per_pages,
}
}
).then((response) => {
if(response){
if(response.status){
if(response.status===200){
if (response) {
if (response.status) {
if (response.status === 200) {
this.setState({
total_student:response.data.count,
majorschoollist:response.data,
ismanager:response.data.ismanager,
total_student: response.data.count,
majorschoollist: response.data,
ismanager: response.data.ismanager,
});
try {
if(response.data.students.length>0){
var mst=response.data.students;
for(var i=0;i<mst.length;i++){
mst[i].istrue=false;
if (response.data.students.length > 0) {
var mst = response.data.students;
for (var i = 0; i < mst.length; i++) {
mst[i].istrue = false;
}
this.setState({
Myschoolstudents:mst
Myschoolstudents: mst
});
}
}catch (e) {
} catch (e) {
this.setState({
Myschoolstudents:[]
Myschoolstudents: []
});
}
@ -125,93 +128,95 @@ class EcStudentList extends Component {
}
windowsgoblack=()=>{
windowsgoblack = () => {
window.history.go(-1)
}
uploadfile=(file)=>{
uploadfile = (file) => {
console.log("导入的文件");
console.log(file);
this.setState({isSpin:true})
let {majorschoollist}=this.state;
let year_id=this.props.match.params.yearId;
let Url ='/ec_years/'+year_id+'/students/import.json';
this.setState({ isSpin: true })
let { majorschoollist } = this.state;
let year_id = this.props.match.params.yearId;
let Url = '/ec_years/' + year_id + '/students/import.json';
const config = {
headers: { "Content-Type": "multipart/form-data" }
};
const form = new FormData();
form.append('file', file.file);
axios.post(Url,form
,config).then((response) => {
if(response.data.status===0){
axios.post(Url, form
, config).then((response) => {
if (response.data.status === 0) {
// message.success('已成功导入'+response.data.count+"条数据!");
this.setState({
// titlemessage: response.data.message+"(支撑关系变更)",
Modallist: '已成功导入'+response.data.success_count+"条数据!",
Modallisttype:true,
Modallisttypes:1,
Modallisttypess:0,
isSpin:false
Modallist: '已成功导入' + response.data.success_count + "条数据!",
Modallisttype: true,
Modallisttypes: 1,
Modallisttypess: 0,
isSpin: false
})
}else{
} else {
// message.warning(response.data.message);
this.setState({
// titlemessage: response.data.message+"(支撑关系变更)",
Modallist:response.data.message,
Modallisttype:true,
Modallisttypes:0,
Modallisttypess:0,
isSpin:false
Modallist: response.data.message,
Modallisttype: true,
Modallisttypes: 0,
Modallisttypess: 0,
isSpin: false
})
}
}).catch((error) => {
console.log(error)
})
}
hidemodeldelete=(Modallisttypes)=>{
hidemodeldelete = (Modallisttypes) => {
this.setState({
Modallisttype:false,
Modallist:'',
Modallisttypess:0
Modallisttype: false,
Modallist: '',
Modallisttypess: 0
})
if(Modallisttypes===1){
if (Modallisttypes === 1) {
// window.location.reload();
this.uploadcomponentDidMount();
}
}
showecStudentList=(page)=>{
showecStudentList = (page) => {
let major_id=this.props.match.params.majorId;
let year_id=this.props.match.params.yearId;
const url ='/ec_years/'+year_id+'/students.json';
axios.get(url, {params: {
page:page,
per_page:this.state.per_pages,
}}).then((response) => {
if(response){
if(response.status){
if(response.status===200){
let major_id = this.props.match.params.majorId;
let year_id = this.props.match.params.yearId;
const url = '/ec_years/' + year_id + '/students.json';
axios.get(url, {
params: {
page: page,
per_page: this.state.per_pages,
}
}).then((response) => {
if (response) {
if (response.status) {
if (response.status === 200) {
this.setState({
total_student:response.data.count,
majorschoollist:response.data,
ismanager:response.data.ismanager,
pages:page,
total_student: response.data.count,
majorschoollist: response.data,
ismanager: response.data.ismanager,
pages: page,
});
try {
if(response.data.students.length>0){
var mst=response.data.students;
for(var i=0;i<mst.length;i++){
mst[i].istrue=false;
if (response.data.students.length > 0) {
var mst = response.data.students;
for (var i = 0; i < mst.length; i++) {
mst[i].istrue = false;
}
this.setState({
Myschoolstudents:mst
Myschoolstudents: mst
});
}
}catch (e) {
} catch (e) {
this.setState({
Myschoolstudents:[]
Myschoolstudents: []
});
}
@ -223,82 +228,84 @@ class EcStudentList extends Component {
});
};
//全选
onChangestudentall=(e)=>{
let {Myschoolstudents}=this.state;
let mewmajorschoollist=Myschoolstudents
for(var i=0; i<mewmajorschoollist.length; i++){
mewmajorschoollist[i].istrue=e.target.checked
onChangestudentall = (e) => {
let { Myschoolstudents } = this.state;
let mewmajorschoollist = Myschoolstudents
for (var i = 0; i < mewmajorschoollist.length; i++) {
mewmajorschoollist[i].istrue = e.target.checked
}
this.setState({
studentall:e.target.checked,
Myschoolstudents:mewmajorschoollist
studentall: e.target.checked,
Myschoolstudents: mewmajorschoollist
})
};
//单选
onChangestudent=(e)=>{
let {Myschoolstudents,studentall}=this.state;
let mewmajorschoollist=Myschoolstudents;
let newstudentall=studentall;
if(e.target.checked===false){
newstudentall=false
onChangestudent = (e) => {
let { Myschoolstudents, studentall } = this.state;
let mewmajorschoollist = Myschoolstudents;
let newstudentall = studentall;
if (e.target.checked === false) {
newstudentall = false
}
for(var i=0; i<mewmajorschoollist.length; i++){
if(i===e.target.index&&e.target.id===mewmajorschoollist[i].student_id){
mewmajorschoollist[i].istrue=e.target.checked
for (var i = 0; i < mewmajorschoollist.length; i++) {
if (i === e.target.index && e.target.id === mewmajorschoollist[i].student_id) {
mewmajorschoollist[i].istrue = e.target.checked
}
}
this.setState({
student_id:e.target.id,
studentall:newstudentall,
Myschoolstudents:mewmajorschoollist
student_id: e.target.id,
studentall: newstudentall,
Myschoolstudents: mewmajorschoollist
})
};
// 删除提示
deletelistbth=()=>{
let {Myschoolstudents,studentall} =this.state;
let studentalltype=0
for(var i=0; i<Myschoolstudents.length; i++){
if(Myschoolstudents[i].istrue===true){
studentalltype=1
deletelistbth = () => {
let { Myschoolstudents, studentall } = this.state;
let studentalltype = 0
for (var i = 0; i < Myschoolstudents.length; i++) {
if (Myschoolstudents[i].istrue === true) {
studentalltype = 1
}
}
if(studentall===true||studentalltype===1){
if (studentall === true || studentalltype === 1) {
this.setState({
Modallist: '确定删除这些学生吗?',
Modallisttype:true,
Modallisttypess:1
Modallisttype: true,
Modallisttypess: 1
})
}else{
} else {
this.setState({
Modallist: '请选择学生!',
Modallisttype:true
Modallisttype: true
})
}
};
//删除学生
deletelistbthenters=()=>{
deletelistbthenters = () => {
debugger
let {Myschoolstudents,studentall} =this.state;
let major_id=this.props.match.params.majorId;
let year_id=this.props.match.params.yearId;
let newstudent_id=[];
if(studentall===false){
for(var i=0; i<Myschoolstudents.length; i++){
if(Myschoolstudents[i].istrue===true){
let { Myschoolstudents, studentall } = this.state;
let major_id = this.props.match.params.majorId;
let year_id = this.props.match.params.yearId;
let newstudent_id = [];
if (studentall === false) {
for (var i = 0; i < Myschoolstudents.length; i++) {
if (Myschoolstudents[i].istrue === true) {
newstudent_id.push(Myschoolstudents[i].id)
}
}
}
let url ='/ec_years/'+year_id+'/students.json'
axios.delete(url,{data:{
ids:newstudent_id,
}}).then((response) => {
if(response.data.status===0){
let url = '/ec_years/' + year_id + '/students.json'
axios.delete(url, {
data: {
ids: newstudent_id,
}
}).then((response) => {
if (response.data.status === 0) {
this.setState({
// Modallist: "删除成功!",
// Modallisttype:true,
Modallisttypes:1,
Modallisttypess:0
Modallisttypes: 1,
Modallisttypess: 0
})
this.hidemodeldelete(1);
}
@ -319,7 +326,7 @@ class EcStudentList extends Component {
total_student,
ismanager,
Myschoolstudents
}=this.state;
} = this.state;
const uploadProps = {
name: 'file',
@ -349,11 +356,11 @@ class EcStudentList extends Component {
<div className="task-popup-text-center font-14">{Modallist}</div>
</div>
<div className="task-popup-submit clearfix">
<a onClick={()=>this.hidemodeldelete(1)} className="task-btn fl">取消</a>
<a onClick={() => this.hidemodeldelete(1)} className="task-btn fl">取消</a>
{
Modallisttypess===0?<a className="task-btn task-btn-orange fr"
onClick={()=>this.hidemodeldelete(1)}
>确定</a>:<a className="task-btn task-btn-orange fr"
Modallisttypess === 0 ? <a className="task-btn task-btn-orange fr"
onClick={() => this.hidemodeldelete(1)}
>确定</a> : <a className="task-btn task-btn-orange fr"
onClick={this.deletelistbthenters}
>确定</a>
}
@ -378,14 +385,14 @@ class EcStudentList extends Component {
</div>
<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>
}
<a className="white-btn edu-orangeback-btn fr mr10" >
{ismanager===false?"":<Upload
{ismanager === false ? "" : <Upload
{...uploadProps}
showUploadList={false}
style={{color:'#fff'}}
style={{ color: '#fff' }}
>
导入
</Upload>}
@ -393,7 +400,7 @@ class EcStudentList extends Component {
</div>
<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>
@ -404,7 +411,7 @@ class EcStudentList extends Component {
<span className="column-No column-2 relative">
<Checkbox
className={'mr20 changestudent'}
checked={studentall===true?true:false}
checked={studentall === true ? true : false}
onChange={this.onChangestudentall}></Checkbox>
序号
</span>
@ -421,23 +428,23 @@ class EcStudentList extends Component {
}</style>
<ul>
{
Myschoolstudents===undefined?
Myschoolstudents === undefined ?
<div className="edu-txt-center color-grey-9 pt50">
<p className="mb20"><img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")} /></p>
<p>学生数据为空请导入数据</p>
</div>
:Myschoolstudents&&Myschoolstudents.length===0?
: Myschoolstudents && Myschoolstudents.length === 0 ?
<div className="edu-txt-center color-grey-9 pt50">
<p className="mb20"><img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/></p>
<p className="mb20"><img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")} /></p>
<p>学生数据为空请导入数据</p>
</div>:Myschoolstudents&&Myschoolstudents.map((item,key)=>{
</div> : Myschoolstudents && Myschoolstudents.map((item, key) => {
// console.log(item)
return(
return (
<li className="clearfix myslispan" key={key}>
<div className="column-No column-2 relative">
<Checkbox
className={'mr20 changestudents'}
checked={item.istrue===true?true:false}
checked={item.istrue === true ? true : false}
key={key}
index={key}
onChange={this.onChangestudent} id={item.student_id}></Checkbox>
@ -465,13 +472,13 @@ class EcStudentList extends Component {
`
}
</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"}
showQuickJumper current={this.state.pages}
onChange={this.showecStudentList} pageSize={20}
total={majorschoollist&&majorschoollist.count}></Pagination>
total={majorschoollist && majorschoollist.count}></Pagination>
}
</div>
</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 { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import { Route, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import Loading from '../../Loading'
import Loadable from 'react-loadable';
import classNames from 'classnames'
import MemoTechShare from './MemoTechShare'
// import MemoGuide from './MemoGuide'
// import MemoNewest from './MemoNewest'
// import MemoHottest from './MemoHottest'
import MemoDetail from './MemoDetail'
import MemoNew from './MemoNew'
@ -22,7 +14,7 @@ import MemoMyPublish from './MemoMyPublish'
import MemoShixun from './shixun/MemoShixun'
import { TPMIndexHOC } from '../tpm/TPMIndexHOC'
import TPMIndexHOC from '../tpm/TPMIndexHOC'
import RightMyPublish from './RightMyPublish'
import UserSection from './UserSection'
@ -32,33 +24,29 @@ import RightMemoLabel from './RightMemoLabel'
import RecommendShixun from './RecommendShixun'
import ForumsNavTab from './ForumsNavTab'
import axios from 'axios'
import 'rc-select/assets/index.css';
import './ForumsIndex.css'
import './RightSection.css'
import { SnackbarHOC, getUrl } from 'educoder'
import { CNotificationHOC } from '../courses/common/CNotificationHOC'
import CNotificationHOC from '../courses/common/CNotificationHOC'
let _url_origin = getUrl()
const $ = window.$
$('head').append( $('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-admin.css?6`) );
$('head').append( $('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-forum.css?1525440977`) );
$('head').append( $('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/magic-check.css?1525440977`) );
setTimeout(()=>{
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-admin.css?6`));
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/css/edu-forum.css?1525440977`));
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/educoder/magic-check.css?1525440977`));
setTimeout(() => {
// 附件上传滚动条 \public\stylesheets\jquery\jquery-ui-1.9.2.css
$('head').append( $('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/jquery/jquery-ui-1.9.2.css`) );
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/stylesheets/jquery/jquery-ui-1.9.2.css`));
}, 1000)
class ForumsIndex extends Component {
@ -100,7 +88,7 @@ class ForumsIndex extends Component {
}
initForumState(data) {
this.setState({...data})
this.setState({ ...data })
}
@ -135,7 +123,7 @@ class ForumsIndex extends Component {
const pathArray = locationPath.split('/');
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
@ -144,27 +132,27 @@ class ForumsIndex extends Component {
<div className="educontent mt30 clearfix">
{/* component={TechShare}
<ForumsNavTab {...this.props}></ForumsNavTab> */}
<div className={classNames('fl', { with75: !isWidth100}, { width100: isWidth100}) }>
<div className={classNames('fl', { with75: !isWidth100 }, { width100: isWidth100 })}>
<Switch>
<Route path={`/forums/categories/my_published`} render={
(props) => (<MemoMyPublish {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)}
initForumState={(data) => this.initForumState(data)}
setSearchValue={this.setSearchValue}
setHotLabelIndex={this.setHotLabelIndex}
/>)
}></Route>
<Route path={`${shixunDiscussPath}`} render={
(props) => (<MemoShixun {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)}
initForumState={(data) => this.initForumState(data)}
setSearchValue={this.setSearchValue}
setHotLabelIndex={this.setHotLabelIndex}
/>)
}></Route>
<Route path={`${techSharePath}`} render={
(props) => (<MemoTechShare {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)}
initForumState={(data) => this.initForumState(data)}
setSearchValue={this.setSearchValue}
setHotLabelIndex={this.setHotLabelIndex}
/>)
@ -188,13 +176,13 @@ class ForumsIndex extends Component {
{/* :forumTypeId/ */}
<Route path={`/forums/new`} render={
(props) => (<MemoNew {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)}
initForumState={(data) => this.initForumState(data)}
/>)
}></Route>
<Route path={`/forums/:memoId/edit`} render={
(props) => (<MemoNew {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)}
initForumState={(data) => this.initForumState(data)}
/>)
}></Route>
@ -202,7 +190,7 @@ class ForumsIndex extends Component {
<Route path={`${match.path}/:memoId`} render={
(props) => (<MemoDetail {...this.props} {...this.state} {...props}
initForumState={(data)=>this.initForumState(data)}
initForumState={(data) => this.initForumState(data)}
/>)
}></Route>
@ -218,19 +206,19 @@ class ForumsIndex extends Component {
{/* 右边栏 */}
{ !isWidth100 && <div className="with25 fl">
{!isWidth100 && <div className="with25 fl">
<div className="ml20">
{isMemoDetail ?
<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 */}
{ memo && memo.tag && <RightMemoLabel {...this.props} {...this.state}></RightMemoLabel> }
{memo && memo.tag && <RightMemoLabel {...this.props} {...this.state}></RightMemoLabel>}
<RecommendShixun {...this.props} {...this.state}></RecommendShixun>
</React.Fragment>
:
<React.Fragment>
<RightMyPublish {...this.props} {...this.state} setSearchValue={this.setSearchValue}></RightMyPublish>
{ !isGuide && <RightHotLabel {...this.props} {...this.state} ></RightHotLabel> }
{!isGuide && <RightHotLabel {...this.props} {...this.state} ></RightHotLabel>}
<RightHotQuestion {...this.props} {...this.state} ></RightHotQuestion>
<RecommendShixun {...this.props} {...this.state}></RecommendShixun>
</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 { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import { Link } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames'
import axios from 'axios'
@ -17,17 +13,16 @@ import update from 'immutability-helper'
// import Tooltip from '@material-ui/core/Tooltip';
import RewardDialog from '../common/RewardDialog';
import { ImageLayerOfCommentHOC } from '../page/layers/ImageLayerOfCommentHOC'
import ImageLayerOfCommentHOC from '../page/layers/ImageLayerOfCommentHOC'
import MemoDetailKEEditor from './MemoDetailKEEditor'
import MemoDetailMDEditor from './MemoDetailMDEditor'
import { bytesToSize, CBreadcrumb, htmlEncode } from 'educoder'
import { CBreadcrumb, htmlEncode } from 'educoder'
import { Tooltip } from 'antd'
// import CBreadcrumb from '../courses/common/CBreadcrumb'
import { typeNameMap2 } from './MemoNew'
import CaseDetail from "../moop_cases/CaseDetail";
const $ = window.$
function urlStringify(params) {
let noParams = true;

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

@ -1,22 +1,11 @@
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'
@ -55,13 +44,13 @@ class MemoMyPublish extends Component {
return (
<React.Fragment>
<div className="discuss-tab bor-bottom-greyE clearfix pr boxsizing">
<p className="_forum_tab pl20 pr20 clearfix boxsizing" style={{fontSize:'18px', color:'rgba(5,16,26,1)'}}>
<p className="_forum_tab pl20 pr20 clearfix boxsizing" style={{ fontSize: '18px', color: 'rgba(5,16,26,1)' }}>
我的发布
<Link className="returnBtnA fr mr10" to={`/forums`}><span className="color-grey-9 font-16">返回</span></Link>
</p>
</div>
<MemoList {...this.props} renderMemoList={() => this.renderMemoList()}
onPaginationChange={ (pageNum, pageSize) => this.props.onPaginationChange(pageNum, pageSize) }
onPaginationChange={(pageNum, pageSize) => this.props.onPaginationChange(pageNum, pageSize)}
>
</MemoList>
</React.Fragment>
@ -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 { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames'
import Pagination from 'rc-pagination';
import { postPaginationHOC } from './PostPaginationHOC'
import PostItem from './PostItem'
import postPaginationHOC from './PostPaginationHOC'
import ForumsNavTab from './ForumsNavTab'
@ -53,8 +44,8 @@ class MemoGuide extends Component {
{this.renderMemoList()}
{ !!memo_count && <Pagination onChange={(pageNum, pageSize) => this.onPaginationChange(pageNum, pageSize)}
showQuickJumper current={currentPage} total={memo_count} pageSize={15}/> }
{!!memo_count && <Pagination onChange={(pageNum, pageSize) => this.onPaginationChange(pageNum, pageSize)}
showQuickJumper current={currentPage} total={memo_count} pageSize={15} />}
</div>
</React.Fragment>
@ -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 { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames'
import Pagination from 'rc-pagination';
import { postPaginationHOC } from './PostPaginationHOC'
import PostItem from './PostItem'
import postPaginationHOC from './PostPaginationHOC'
import ForumsNavTab from './ForumsNavTab'
@ -73,12 +63,12 @@ class MemoHottest extends Component {
{this.renderMemoList()}
{ !!memo_count && <Pagination onChange={(pageNum, pageSize) => this.onPaginationChange(pageNum, pageSize)}
showQuickJumper current={currentPage} total={memo_count} pageSize={15}/> }
{!!memo_count && <Pagination onChange={(pageNum, pageSize) => this.onPaginationChange(pageNum, pageSize)}
showQuickJumper current={currentPage} total={memo_count} pageSize={15} />}
</div>
</React.Fragment>
);
}
}
export default postPaginationHOC( MemoHottest );
export default postPaginationHOC(MemoHottest);

@ -1,18 +1,8 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames'
import Pagination from 'rc-pagination';
import { postPaginationHOC } from './PostPaginationHOC'
import PostItem from './PostItem'
import postPaginationHOC from './PostPaginationHOC'
import ForumsNavTab from './ForumsNavTab'
@ -52,12 +42,12 @@ class MemoNewest extends Component {
<div id="forum_list" className="forum_table mh650">
{this.renderMemoList()}
{ !!memo_count && <Pagination onChange={(pageNum, pageSize) => this.onPaginationChange(pageNum, pageSize)}
showQuickJumper current={currentPage} total={memo_count} pageSize={15}/> }
{!!memo_count && <Pagination onChange={(pageNum, pageSize) => this.onPaginationChange(pageNum, pageSize)}
showQuickJumper current={currentPage} total={memo_count} pageSize={15} />}
</div>
</React.Fragment>
);
}
}
export default postPaginationHOC( MemoNewest );
export default postPaginationHOC(MemoNewest);

@ -1,21 +1,9 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import PropTypes from 'prop-types';
import classNames from 'classnames'
import Pagination from 'rc-pagination';
import { postPaginationHOC } from './PostPaginationHOC'
import PostItem from './PostItem'
import postPaginationHOC from './PostPaginationHOC'
import ForumsNavTab from './ForumsNavTab'
// import queryString from 'query-string'
import { queryString } from 'educoder'
import MemoList from './MemoList'
@ -45,7 +33,7 @@ class MemoTechShare extends Component {
// this.unlisten();
}
componentDidUpdate(prevProps) {
if(this.props.match.params.memoType !== prevProps.match.params.memoType) {
if (this.props.match.params.memoType !== prevProps.match.params.memoType) {
// do something
console.log(`memoType changed`)
this.props.fetchMemos();
@ -99,13 +87,13 @@ class MemoTechShare extends Component {
}
render() {
const { match, history, currentPage, memo_count ,memo_list } = this.props
const { match, history, currentPage, memo_count, memo_list } = this.props
return (
<React.Fragment>
<ForumsNavTab {...this.props}></ForumsNavTab>
<MemoList {...this.props} renderMemoList={() => this.renderMemoList()}
onPaginationChange={ (pageNum, pageSize) => this.props.onPaginationChange(pageNum, pageSize) }
onPaginationChange={(pageNum, pageSize) => this.props.onPaginationChange(pageNum, pageSize)}
>
</MemoList>
</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 CustomLoadable from "../../CustomLoadable";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import TPMIndexHOC from "../tpm/TPMIndexHOC";
const AboutUs = CustomLoadable(() => import('./AboutUs'));
const ContactUs = CustomLoadable(() => import('./ContactUs'));
@ -17,7 +17,7 @@ const HelpCenter = CustomLoadable(() => import('./HelpCenter'));
const Feedback = CustomLoadable(() => import('./Feedback'));
class Help extends React.Component {
constructor (props) {
constructor(props) {
super(props);
this.state = {
@ -26,7 +26,7 @@ class Help extends React.Component {
}
componentDidUpdate(prevProps) {
if(prevProps.match.params.type !== this.props.match.params.type){
if (prevProps.match.params.type !== this.props.match.params.type) {
this.setState({ type: this.props.match.params.type });
}
}
@ -61,8 +61,8 @@ class Help extends React.Component {
<Route path='/help/cooperatives' component={Cooperatives}></Route>
<Route path='/help/agreement' component={Agreement}></Route>
<Route path='/help/help_center' component={HelpCenter}></Route>
<Route path='/help/feedback' render={ (props)=>(<Feedback {...this.props} {...props} {...this.state}></Feedback>) }></Route>
<Route component={AboutUs}/>
<Route path='/help/feedback' render={(props) => (<Feedback {...this.props} {...props} {...this.state}></Feedback>)}></Route>
<Route component={AboutUs} />
</Switch>
</div>
</Col>
@ -73,4 +73,4 @@ class Help extends React.Component {
}
}
export default SnackbarHOC() (TPMIndexHOC ( Help ));
export default SnackbarHOC()(TPMIndexHOC(Help));

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

@ -1,11 +1,9 @@
import React, { Component } from 'react';
import {Input,Pagination,Tooltip} from 'antd';
import {TPMIndexHOC} from "../../../modules/tpm/TPMIndexHOC";
import { WordsBtn ,ActionBtn,SnackbarHOC,markdownToHTML,getImageUrl} from 'educoder';
import TPMIndexHOC from "../../../modules/tpm/TPMIndexHOC";
import { SnackbarHOC, getImageUrl } from 'educoder';
import axios from 'axios';
import "../css/messagemy.css"
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import { Route, Switch } from "react-router-dom";
import Loading from '../../../Loading'
import Loadable from 'react-loadable';
@ -25,17 +23,17 @@ const MessagChat = Loadable({
loader: () => import('./MessagChat'),
loading: Loading,
})
class Messagerouting extends Component{
class Messagerouting extends Component {
constructor(props) {
super(props);
this.state={
routing:1,
unread_message_count:0,
unread_tiding_count:0,
this.state = {
routing: 1,
unread_message_count: 0,
unread_tiding_count: 0,
}
}
componentDidMount(){
componentDidMount() {
// console.log("Messagerouting");
// console.log(this.props);
// let courstype=this.props.location.search;
@ -54,40 +52,40 @@ class Messagerouting extends Component{
// console.log("22222222222");
// console.log(this.props);
// 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);
// console.log("Messagerouting59");
// console.log(this.props.current_user);
}
}
//消息未读
Messageprivatemessageunreadmessage=(user_id)=>{
const url=`/users/${user_id}/unread_message_info.json`
Messageprivatemessageunreadmessage = (user_id) => {
const url = `/users/${user_id}/unread_message_info.json`
axios.get(url).then((result) => {
if(result===undefined){
if (result === undefined) {
return
}
// console.log("消息未读1");
// console.log(result);
this.setState({
unread_message_count:result.data.unread_message_count,
unread_tiding_count:result.data.unread_tiding_count,
unread_message_count: result.data.unread_message_count,
unread_tiding_count: result.data.unread_tiding_count,
})
}).catch((error) => {
console.log(error)
})
};
SwitchonClick=(value,child)=>{
SwitchonClick = (value, child) => {
this.setState({
routing:value,
routing: value,
});
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.homeworkendss1(child);
}
if(value===2){
if (value === 2) {
this.props.history.replace(`/messages/${this.props.current_user.login}/private_messages`);
this.homeworkendss2(child);
}
@ -97,90 +95,90 @@ class Messagerouting extends Component{
Message2=(data)=>{
Message2 = (data) => {
// console.log("64");
// console.log(data);
this.setState({
unread_message_count:parseInt(data.unread_message_count),
unread_tiding_count:parseInt(data.unread_tiding_count),
unread_message_count: parseInt(data.unread_message_count),
unread_tiding_count: parseInt(data.unread_tiding_count),
})
};
//跳转到链接
Modifyur=(i,id)=>{
Modifyur = (i, id) => {
// console.log("跳转到链接1");
// console.log(i);
// console.log(item);
// console.log("跳转到链接2");
if(i<3){
if (i < 3) {
this.setState({
routing:i,
routing: i,
});
if(i===1){
if (i === 1) {
this.props.history.replace(`/messages/${this.props.current_user.login}/user_tidings`);
}
if(i===2){
if (i === 2) {
this.props.history.replace(`/messages/${this.props.current_user.login}/private_messages`);
}
}else {
} else {
this.setState({
routing:i,
routing: i,
});
console.log("22222222222");
this.props.history.replace(`/messages/${this.props.current_user.login}/message_detail?target_ids=${id}`);
}
};
myCome=(e)=>{
window.location.href="/users/"+e.target.login;
myCome = (e) => {
window.location.href = "/users/" + e.target.login;
}
myxiaoxisixintab=(i)=>{
if(i===1){
myxiaoxisixintab = (i) => {
if (i === 1) {
this.setState({
routing:1,
routing: 1,
});
}
if(i===2){
if (i === 2) {
this.setState({
routing:2,
routing: 2,
});
}
if(i===3){
if (i === 3) {
this.setState({
routing:3,
routing: 3,
});
}
};
bindRef = ref => { this.child = ref };
homeworkendss1(child){
homeworkendss1(child) {
// console.log(child);
// // console.log(this.refs.childModel);
// console.log(child);
try {
child.getdatas();
}catch (e) {
} catch (e) {
}
//
}
homeworkendss2(child){
homeworkendss2(child) {
// console.log(child);
// // console.log(this.refs.childModel);
// console.log(child);
try {
child.getdatas2();
}catch (e) {
} catch (e) {
}
//
}
render() {
let{routing,unread_message_count,unread_tiding_count} =this.state;
let { routing, unread_message_count, unread_tiding_count } = this.state;
// console.log(this.props);
// console.log(routing);
return (
@ -192,24 +190,24 @@ class Messagerouting extends Component{
<div className="mb20 edu-back-white pt40 pb40 edu-txt-center">
<a >
{
this.props.current_user!== undefined?
<img className="person radius myw120 myh120" src={getImageUrl("images/"+this.props.current_user.image_url)}/>
:""
this.props.current_user !== undefined ?
<img className="person radius myw120 myh120" src={getImageUrl("images/" + this.props.current_user.image_url)} />
: ""
}
</a>
<p className="font-24 lineh-25 mt10" >{this.props.current_user&&this.props.current_user.username}</p>
<p className="color-grey-6 mt5" >{this.props.current_user&&this.props.current_user.user_identity}</p>
<p className="font-24 lineh-25 mt10" >{this.props.current_user && this.props.current_user.username}</p>
<p className="color-grey-6 mt5" >{this.props.current_user && this.props.current_user.user_identity}</p>
</div>
{/*路由跳转*/}
<ul className="edu-back-white">
<li className={routing ===1?"nav pr active":"nav pr"}>
<a onClick={(value,child)=>this.SwitchonClick(1,this.child)}>消息</a>
{unread_tiding_count===0?"":unread_tiding_count>0?<span className="new-info">{unread_tiding_count}</span>:""}
<li className={routing === 1 ? "nav pr active" : "nav pr"}>
<a onClick={(value, child) => this.SwitchonClick(1, this.child)}>消息</a>
{unread_tiding_count === 0 ? "" : unread_tiding_count > 0 ? <span className="new-info">{unread_tiding_count}</span> : ""}
</li>
<li className={routing ===2?"nav pr active":routing ===3?"nav pr active":"nav pr"}>
<a onClick={(value,child)=>this.SwitchonClick(2,this.child)}>私信</a>
{unread_message_count===0?"":unread_message_count>0?<span className="new-info">{unread_message_count}</span>:""}
<li className={routing === 2 ? "nav pr active" : routing === 3 ? "nav pr active" : "nav pr"}>
<a onClick={(value, child) => this.SwitchonClick(2, this.child)}>私信</a>
{unread_message_count === 0 ? "" : unread_message_count > 0 ? <span className="new-info">{unread_message_count}</span> : ""}
</li>
</ul>
</div>
@ -230,19 +228,19 @@ class Messagerouting extends Component{
{/*/!*消息自路由*! name 是 /message/info/:userid/*/}
<Route path="/messages/:userid/user_tidings"
render={
(props) => (<MessagSub triggerRef={this.bindRef} {...this.state} {...this.props} {...props} Message2={()=>this.Message2()} Mtab={(i)=>this.myxiaoxisixintab(i)}></MessagSub>)
(props) => (<MessagSub triggerRef={this.bindRef} {...this.state} {...this.props} {...props} Message2={() => this.Message2()} Mtab={(i) => this.myxiaoxisixintab(i)}></MessagSub>)
}
></Route>
{/*/!*私信*! name 是letter/*/}
<Route path="/messages/:userid/private_messages"
render={
(props) => (<MessagePrivate triggerRef={this.bindRef} {...this.state} {...this.props} {...props} Message2={()=>this.Message2()} Modifyur={(i,item)=>this.Modifyur(i,item)} Mtab={(i)=>this.myxiaoxisixintab(i)}></MessagePrivate> )
(props) => (<MessagePrivate triggerRef={this.bindRef} {...this.state} {...this.props} {...props} Message2={() => this.Message2()} Modifyur={(i, item) => this.Modifyur(i, item)} Mtab={(i) => this.myxiaoxisixintab(i)}></MessagePrivate>)
}
></Route>
{/*/!*私信聊天页面*! letters/*/}
<Route path="/messages/:userid/message_detail"
render={
(props) => (<MessagChat triggerRef={this.bindRef} {...this.state} {...this.props} {...props} Message2={()=>this.Message2()} Modifyur={(i)=>this.Modifyur(i)} Mtab={(i)=>this.myxiaoxisixintab(i)}></MessagChat>)
(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>
@ -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 '../courses/css/Courses.css'
import { SnackbarHOC } from 'educoder';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../courses/common/CNotificationHOC'
import TPMIndexHOC from '../tpm/TPMIndexHOC';
import CNotificationHOC from '../courses/common/CNotificationHOC'
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import { Route, Switch } from 'react-router-dom';
import Loading from '../../Loading';
import Loadable from 'react-loadable';
@ -15,83 +15,83 @@ import axios from 'axios';
const CaseList = Loadable({
loader: () => import('./CaseList'),
loading:Loading,
loading: Loading,
})
const CaseDetail = Loadable({
loader: () => import('./CaseDetail'),
loading:Loading,
loading: Loading,
})
const CaseNew = Loadable({
loader: () => import('./CaseNew'),
loading:Loading,
loading: Loading,
})
const CaseSuccess = Loadable({
loader: () => import('./Success'),
loading:Loading,
loading: Loading,
})
class Index extends Component{
constructor(props){
class Index extends Component {
constructor(props) {
super(props);
this.state={
praise_count:0,
CaseDetail:undefined,
cover:undefined,
creator:undefined,
operation:undefined,
tags:undefined,
attachments:undefined,
user_praised:true,
this.state = {
praise_count: 0,
CaseDetail: undefined,
cover: undefined,
creator: undefined,
operation: undefined,
tags: undefined,
attachments: undefined,
user_praised: true,
}
}
componentDidMount(){
componentDidMount() {
}
// 获取案例详情
getDetail = (caseID) =>{
let url=`/libraries/${caseID}.json`
axios.get(url).then((result)=>{
if(result){
getDetail = (caseID) => {
let url = `/libraries/${caseID}.json`
axios.get(url).then((result) => {
if (result) {
this.setState({
CaseDetail:result.data,
praise_count:result.data.praise_count,
cover:result.data.cover,
creator:result.data.creator,
operation:result.data.operation,
user_praised:result.data.operation.user_praised,
tags:result.data.tags,
attachments:result.data.attachments
CaseDetail: result.data,
praise_count: result.data.praise_count,
cover: result.data.cover,
creator: result.data.creator,
operation: result.data.operation,
user_praised: result.data.operation.user_praised,
tags: result.data.tags,
attachments: result.data.attachments
})
window.document.title = result.data.title;
}
}).catch((error)=>{
}).catch((error) => {
console.log(error);
})
}
// 点赞
praisePoint=(caseID)=>{
let { praise_count }=this.state;
let url =`/praise_tread/like.json`;
axios.post(url,{
object_id:caseID,
object_type:"library"
}).then((result)=>{
if(result){
praisePoint = (caseID) => {
let { praise_count } = this.state;
let url = `/praise_tread/like.json`;
axios.post(url, {
object_id: caseID,
object_type: "library"
}).then((result) => {
if (result) {
this.setState({
praise_count: parseInt(praise_count)+1,
user_praised:true
praise_count: parseInt(praise_count) + 1,
user_praised: true
})
}
}).catch((error)=>{
}).catch((error) => {
console.log(error);
})
}
render(){
render() {
return(
return (
<div className="newMain">
<Switch {...this.props}>
@ -109,7 +109,7 @@ class Index extends Component{
<Route exact path="/moop_cases/:caseID"
render={
(props) => (<CaseDetail {...this.props} {...props} {...this.state} getDetail={this.getDetail} praisePoint ={this.praisePoint}/>)
(props) => (<CaseDetail {...this.props} {...props} {...this.state} getDetail={this.getDetail} praisePoint={this.praisePoint} />)
}
></Route>
@ -131,4 +131,4 @@ class Index extends Component{
)
}
}
export default CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC(Index) ));
export default CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Index)));

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

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

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

@ -7,7 +7,7 @@ import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import Loading from '../../Loading'
import Loadable from 'react-loadable';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC'
import TPMIndexHOC from '../tpm/TPMIndexHOC'
import { SnackbarHOC } from 'educoder'
@ -31,7 +31,7 @@ class ProjectPackageIndex extends Component {
super(props)
}
componentDidMount(){
componentDidMount() {
window.document.title = '众包创新'
}
@ -73,4 +73,4 @@ class ProjectPackageIndex extends Component {
}
}
export default SnackbarHOC() (TPMIndexHOC (ProjectPackageIndex)) ;
export default SnackbarHOC()(TPMIndexHOC(ProjectPackageIndex));

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

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

@ -1,22 +1,12 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
import React, { Component } from "react";
import { SnackbarHOC } from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Tooltip
} from "antd";
import {parabola} from './animation/parabola'
import { Pagination, Drawer } from "antd";
import Headplugselections from "./component/Headplugselections";
import QuestionModal from "./component/QuestionModal";
import QuestionModals from "./component/QuestionModals";
import Contentpart from "./component/Contentpart";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import TPMIndexHOC from "../tpm/TPMIndexHOC";
import NoneData from './component/NoneData';
import './questioncss/questioncom.css';
import SiderBars from "../question/component/SiderBars";
@ -26,16 +16,16 @@ class Question extends Component {
super(props);
this.state = {
count: 50,
defaultActiveKey:"1",
defaultActiveKey: "1",
Headertop: "",
Footerdown: "",
visible: false,
placement: 'right',
modalsType: false,
modalsTypes:false,
modalsTypes: false,
titilesm: "在平台审核后,所有成员均可使用试题",
titiless: "是否设置为公开?",
titilesms:"单选题",
titilesms: "单选题",
titbool: false,
Contentdata: [],
difficulty: null,
@ -53,109 +43,109 @@ class Question extends Component {
program_questions_count: 0,
single_questions_count: 0,
subjective_questions_count: 0,
page:1,
per_page:10,
disciplinesdata:[],
discipline_id:null,
sub_discipline_id:null,
tag_discipline_id:null,
booljupyterurls:false,
disciplinesdatakc:0,
disciplinesdatazsd:0,
selectallquestionsonthispages:false,
oj_status:null,
page: 1,
per_page: 10,
disciplinesdata: [],
discipline_id: null,
sub_discipline_id: null,
tag_discipline_id: null,
booljupyterurls: false,
disciplinesdatakc: 0,
disciplinesdatazsd: 0,
selectallquestionsonthispages: false,
oj_status: null,
isVisible: false,
selectionbools:false,
chakanjiexiboolindex:"无",
selectionbools: false,
chakanjiexiboolindex: "无",
}
}
chakanjiexibool=(index)=>{
if(this.state.chakanjiexiboolindex===index){
chakanjiexibool = (index) => {
if (this.state.chakanjiexiboolindex === index) {
this.setState({
chakanjiexiboolindex:"无",
chakanjiexiboolindex: "无",
})
return
}
this.setState({
chakanjiexiboolindex:index,
chakanjiexiboolindex: index,
})
}
setmychakanjiexibool=(str)=>{
setmychakanjiexibool = (str) => {
this.setState({
chakanjiexiboolindex:str,
chakanjiexiboolindex: str,
})
}
setdiscipline_id=(discipline_id)=>{
setdiscipline_id = (discipline_id) => {
this.setState({
discipline_id:discipline_id,
sub_discipline_id:null,
tag_discipline_id:null,
keywords:"",
page:1,
per_page:10,
oj_status:null
discipline_id: discipline_id,
sub_discipline_id: null,
tag_discipline_id: null,
keywords: "",
page: 1,
per_page: 10,
oj_status: null
})
var data = {
discipline_id:discipline_id,
sub_discipline_id:null,
tag_discipline_id:null,
discipline_id: discipline_id,
sub_discipline_id: null,
tag_discipline_id: null,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: null,
page: this.state.page,
per_page:10,
oj_status:null
per_page: 10,
oj_status: null
};
this.getdata(data);
}
setsub_discipline_id=(discipline_id,sub_discipline_id)=>{
setsub_discipline_id = (discipline_id, sub_discipline_id) => {
this.setState({
sub_discipline_id:sub_discipline_id,
tag_discipline_id:null,
keywords:"",
page:1,
per_page:10,
oj_status:null
sub_discipline_id: sub_discipline_id,
tag_discipline_id: null,
keywords: "",
page: 1,
per_page: 10,
oj_status: null
})
var data = {
discipline_id:discipline_id,
sub_discipline_id:sub_discipline_id,
tag_discipline_id:null,
discipline_id: discipline_id,
sub_discipline_id: sub_discipline_id,
tag_discipline_id: null,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords:null,
keywords: null,
page: 1,
per_page:10,
oj_status:null
per_page: 10,
oj_status: null
};
this.getdata(data);
}
settag_discipline_id=(tag_discipline_id)=>{
settag_discipline_id = (tag_discipline_id) => {
this.setState({
tag_discipline_id:tag_discipline_id,
keywords:"",
page:1,
per_page:10,
oj_status:null
tag_discipline_id: tag_discipline_id,
keywords: "",
page: 1,
per_page: 10,
oj_status: null
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: null,
page: 1,
per_page:10,
oj_status:null
per_page: 10,
oj_status: null
};
this.getdata(data);
}
@ -176,9 +166,11 @@ class Question extends Component {
this.getbasket_listdata();
//获取题库筛选资料
let urls = `/disciplines.json`;
axios.get(urls, {params: {
source:"question"
}}).then((response) => {
axios.get(urls, {
params: {
source: "question"
}
}).then((response) => {
//console.log("Questiondisciplines");
//console.log(response.data);
if (response) {
@ -192,21 +184,21 @@ class Question extends Component {
callback = (key) => {
this.setState({
defaultActiveKey: key,
selectallquestionsonthispages:false,
difficulty:null,
page:1,
oj_status:null
selectallquestionsonthispages: false,
difficulty: null,
page: 1,
oj_status: null
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: key,
item_type: this.state.item_type,
difficulty: null,
page: 1,
per_page:10,
oj_status:null
per_page: 10,
oj_status: null
};
this.getdata(data);
@ -216,15 +208,15 @@ class Question extends Component {
getdata = (data) => {
const url = `/item_banks.json`;
this.setState({
booljupyterurls:true,
selectionbools:false,
booljupyterurls: true,
selectionbools: false,
})
axios.get((url), {params: data}).then((response) => {
setTimeout(()=>{
axios.get((url), { params: data }).then((response) => {
setTimeout(() => {
this.setState({
booljupyterurls:false,
booljupyterurls: false,
})
},1000);
}, 1000);
if (response === null || response === undefined) {
return
@ -244,7 +236,7 @@ class Question extends Component {
}).catch((error) => {
//////console.log(error)
this.setState({
booljupyterurls:false,
booljupyterurls: false,
})
});
}
@ -253,12 +245,12 @@ class Question extends Component {
getdatasy = (data) => {
const url = `/item_banks.json`;
this.setState({
selectionbools:false,
selectionbools: false,
})
axios.get((url), {params: data}).then((response) => {
setTimeout(()=>{
axios.get((url), { params: data }).then((response) => {
setTimeout(() => {
},1000);
}, 1000);
if (response === null || response === undefined) {
return
@ -283,43 +275,43 @@ class Question extends Component {
}
//计算
getdataslen=(arr)=>{
var contes=0;
for(let data of arr) {
if(data.item_type==="PROGRAM"){
getdataslen = (arr) => {
var contes = 0;
for (let data of arr) {
if (data.item_type === "PROGRAM") {
//编程题
if(data.choosed===true){
if (data.choosed === true) {
}else{
} else {
//未选用
if(data.program_attr.status===1){
if (data.program_attr.status === 1) {
//已发布
contes=contes+1;
contes = contes + 1;
}
}
}else{
} else {
//不是编程题
if(data.choosed===true){
if (data.choosed === true) {
}else{
} else {
//未选用
contes=contes+1;
contes = contes + 1;
}
}
}
if(contes>0){
if (contes > 0) {
this.setState({
selectionbools:false,
selectallquestionsonthispages:false,
selectionbools: false,
selectallquestionsonthispages: false,
})
}else {
} else {
this.setState({
selectionbools:true,
selectallquestionsonthispages:true,
selectionbools: true,
selectallquestionsonthispages: true,
})
}
}
@ -329,27 +321,27 @@ class Question extends Component {
page: pageNumber,
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: pageNumber,
per_page:10,
oj_status:this.state.oj_status
per_page: 10,
oj_status: this.state.oj_status
};
this.getdata(data);
this.setmychakanjiexibool("无")
}
showDrawer = () => {
if(this.state.visible===true){
if (this.state.visible === true) {
this.setState({
visible: false,
});
}else{
} else {
this.setState({
visible: true,
});
@ -405,19 +397,19 @@ class Question extends Component {
modalsType: false
})
}
modalCancels=()=>{
modalCancels = () => {
this.setState({
modalsTypes: false
})
}
showQuestionModals =(item_type)=>{
showQuestionModals = (item_type) => {
this.setState({
modalsTypes: true,
titilesms:item_type,
titilesms: item_type,
})
}
setDownloads=(item_type)=>{
setDownloads = (item_type) => {
this.Deletebigquestiontype(item_type);
this.setState({
modalsTypes: false
@ -442,22 +434,22 @@ class Question extends Component {
difficulty: difficulty,
visiblemys: false,
page: 1,
per_page:10,
keywords:"",
oj_status:null
per_page: 10,
keywords: "",
oj_status: null
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: difficulty,
item_type: this.state.item_type,
keywords:null,
page:1,
per_page:10,
oj_status:null
keywords: null,
page: 1,
per_page: 10,
oj_status: null
};
this.getdata(data);
@ -468,22 +460,22 @@ class Question extends Component {
item_type: item_type,
visiblemyss: false,
page: 1,
per_page:10,
keywords:"",
oj_status:null
per_page: 10,
keywords: "",
oj_status: null
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: item_type,
page: 1,
per_page:10,
keywords:null,
oj_status:null
per_page: 10,
keywords: null,
oj_status: null
};
this.getdata(data);
@ -528,16 +520,16 @@ class Question extends Component {
keywords: value,
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: value,
page: this.state.page,
per_page:10,
oj_status:this.state.oj_status
per_page: 10,
oj_status: this.state.oj_status
};
this.getdata(data);
@ -552,15 +544,15 @@ class Question extends Component {
// this.props.showNotification('删除试题成功')
// props.history.push(response.data.right_url)
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:10,
per_page: 10,
};
this.getdata(data);
}
@ -577,15 +569,15 @@ class Question extends Component {
if (result.data.status == 0) {
// this.props.showNotification(`公开题目成功`);
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:10,
per_page: 10,
};
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)
.then((result) => {
if (result.data.status == 0) {
// this.props.showNotification(`选用成功`);
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:10,
per_page: 10,
};
this.getdatasy(data);
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)
.then((result) => {
if (result.data.status == 0) {
// this.props.showNotification(`撤销成功`);
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:10,
per_page: 10,
};
this.getdatasy(data);
this.getbasket_listdata();
@ -685,65 +677,67 @@ class Question extends Component {
})
}
//全选试题库
selectallquestionsonthispage=()=>{
var item_idsdata=[];
selectallquestionsonthispage = () => {
var item_idsdata = [];
var arr= this.state.Contentdata.items;
for(let data of arr) {
if(data.item_type==="PROGRAM"){
var arr = this.state.Contentdata.items;
for (let data of arr) {
if (data.item_type === "PROGRAM") {
//编程题
if(data.choosed===true){
if (data.choosed === true) {
}else{
} else {
//未选用
if(data.program_attr.status===1){
if (data.program_attr.status === 1) {
//已发布
item_idsdata.push(data.id);
}
}
}else{
} else {
//不是编程题
if(data.choosed===true){
if (data.choosed === true) {
}else{
} else {
//未选用
item_idsdata.push(data.id);
}
}
}
const data={
item_ids:item_idsdata
const data = {
item_ids: item_idsdata
}
this.getitem_baskets(data);
this.setState({
selectallquestionsonthispages:true,
selectallquestionsonthispages: true,
})
}
//全选的状态
//删除大题型
Deletebigquestiontype =(item_type)=>{
const url=`/item_baskets/delete_item_type.json`;
axios.delete((url), { data: {
item_type:item_type
}})
Deletebigquestiontype = (item_type) => {
const url = `/item_baskets/delete_item_type.json`;
axios.delete((url), {
data: {
item_type: item_type
}
})
.then((response) => {
if (response.data.status == 0) {
// this.props.showNotification('删除成功');
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:10,
per_page: 10,
};
this.getdata(data);
this.getbasket_listdata();
@ -757,30 +751,30 @@ class Question extends Component {
//跳转
gotopaperreview=()=>{
gotopaperreview = () => {
this.props.history.replace("/paperreview/artificial");
}
setoj_status=(oj_status)=>{
setoj_status = (oj_status) => {
//编程题发布未发布
this.setState({
selectallquestionsonthispages:false,
difficulty:null,
oj_status:oj_status
selectallquestionsonthispages: false,
difficulty: null,
oj_status: oj_status
})
var data = {
discipline_id:this.state.discipline_id,
sub_discipline_id:this.state.sub_discipline_id,
tag_discipline_id:this.state.tag_discipline_id,
discipline_id: this.state.discipline_id,
sub_discipline_id: this.state.sub_discipline_id,
tag_discipline_id: this.state.tag_discipline_id,
public: this.state.defaultActiveKey,
difficulty: this.state.difficulty,
item_type: this.state.item_type,
keywords: this.state.keywords,
page: this.state.page,
per_page:10,
oj_status:oj_status
per_page: 10,
oj_status: oj_status
};
this.getdata(data);
}
@ -790,9 +784,9 @@ class Question extends Component {
render() {
let {
page, per_page, items_count, Headertop, visible, placement, modalsType, modalsTypes,basket_list,
page, per_page, items_count, Headertop, visible, placement, modalsType, modalsTypes, basket_list,
completion_questions_count, judgement_questions_count, multiple_questions_count, practical_questions_count,
program_questions_count, single_questions_count, subjective_questions_count,selectionbools
program_questions_count, single_questions_count, subjective_questions_count, selectionbools
} = this.state;
const Datacount = completion_questions_count + judgement_questions_count
@ -800,15 +794,15 @@ class Question extends Component {
+ program_questions_count
+ single_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 is_teacher=this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
const isysladmins = this.props && this.props.current_user && this.props.current_user.admin ? this.props.current_user.admin : false;
const is_teacher = this.props && this.props.current_user && this.props.current_user.is_teacher ? this.props.current_user.is_teacher : false;
const professional_certification = this.props && this.props.current_user && this.props.current_user.professional_certification ? this.props.current_user.professional_certification : false;
return (
<div className="newMain clearfix" ref={this.saveContainer}>
{
visible===true?
visible === true ?
<style>
{
`
@ -831,26 +825,26 @@ class Question extends Component {
`
}
</style>
:""
: ""
}
{
visible===true?
visible === true ?
<div
style={{
marginTop: "60px"
}}></div>
:""}
: ""}
{
modalsTypes===true?
modalsTypes === true ?
<QuestionModals {...this.props}{...this.state} modalsTypes={modalsTypes} modalCancels={() => this.modalCancels()}
setDownloads={(e) => this.setDownloads(e)}></QuestionModals>
:""
: ""
}
{
modalsType===true?
modalsType === true ?
<QuestionModal {...this.props}{...this.state} modalsType={modalsType} modalCancel={() => this.modalCancel()}
setDownload={() => this.setDownload()}></QuestionModal>
:""
: ""
}
@ -865,7 +859,7 @@ class Question extends Component {
}
</style>
{
isysladmins===true?
isysladmins === true ?
<SiderBars
Datacount={Datacount}
myvisible={visible}
@ -876,7 +870,7 @@ class Question extends Component {
/>
:
is_teacher===true&&professional_certification===true?
is_teacher === true && professional_certification === true ?
<SiderBars
Datacount={Datacount}
myvisible={visible}
@ -901,18 +895,18 @@ class Question extends Component {
{...this.state}
setdifficulty={(e) => this.setdifficulty(e)}
setitem_types={(e) => this.setitem_types(e)}
setdiscipline_id={(e)=>this.setdiscipline_id(e)}
setsub_discipline_id={(e,id)=>this.setsub_discipline_id(e,id)}
settag_discipline_id={(e)=>this.settag_discipline_id(e)}
setdiscipline_id={(e) => this.setdiscipline_id(e)}
setsub_discipline_id={(e, id) => this.setsub_discipline_id(e, id)}
settag_discipline_id={(e) => this.settag_discipline_id(e)}
/>
{/*头部*/}
<Contentpart {...this.state} {...this.props}
Isitapopup={"false"}
chakanjiexiboolindex={this.state.chakanjiexiboolindex}
chakanjiexibool={(e)=>this.chakanjiexibool(e)}
getitem_basketss={(id)=>this.getitem_basketss(id)}
selectallquestionsonthispage={()=>this.selectallquestionsonthispage()}
getitem_baskets={(e)=>this.getitem_baskets(e)}
chakanjiexibool={(e) => this.chakanjiexibool(e)}
getitem_basketss={(id) => this.getitem_basketss(id)}
selectallquestionsonthispage={() => this.selectallquestionsonthispage()}
getitem_baskets={(e) => this.getitem_baskets(e)}
setdatafuns={(e) => this.setdatafuns(e)}
setdatafunsval={(e) => this.setdatafunsval(e)}
handleVisibleChanges={(e) => this.handleVisibleChanges(e)}
@ -920,16 +914,16 @@ class Question extends Component {
showmodels={(e) => this.showmodels(e)}
showmodelysl={(e) => this.showmodelysl(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">
<Pagination showQuickJumper current={page} onChange={this.paginationonChange}
pageSize={per_page}
total={items_count}></Pagination>
</div>
:<div className="h30 clearfix educontent mt40 intermediatecenter">
: <div className="h30 clearfix educontent mt40 intermediatecenter">
</div>
}
@ -990,7 +984,7 @@ class Question extends Component {
<p
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">单选题{'('}{single_questions_count}{')'}</p>
<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>
}
{
@ -1001,7 +995,7 @@ class Question extends Component {
<p
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">多选题{'('}{multiple_questions_count}{')'}</p>
<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>
}
{
@ -1012,7 +1006,7 @@ class Question extends Component {
<p
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">判断题{'('}{judgement_questions_count}{')'}</p>
<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>
}
{
@ -1023,7 +1017,7 @@ class Question extends Component {
<p
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">填空题{'('}{completion_questions_count}{')'}</p>
<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>
}
{
@ -1034,7 +1028,7 @@ class Question extends Component {
<p
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">简答题{'('}{subjective_questions_count}{')'}</p>
<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>
}
{
@ -1056,13 +1050,13 @@ class Question extends Component {
<p
className="w50s intermediatecenterysls sortinxdirection font-14 xiaoshou xiaoshoums">编程题{'('}{program_questions_count}{')'}</p>
<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 className="intermediatecenter verticallayout mt42">
<div className="drawerbutton xiaoshou" onClick={()=>this.gotopaperreview()}>
<div className="drawerbutton xiaoshou" onClick={() => this.gotopaperreview()}>
试卷预览
</div>
</div>

@ -1,18 +1,8 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder';
import React, { Component } from "react";
import { SnackbarHOC } from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Drawer,
Input,
Button,
Breadcrumb
} from "antd";
import {TPMIndexHOC} from "../tpm/TPMIndexHOC";
import { Breadcrumb } from "antd";
import TPMIndexHOC from "../tpm/TPMIndexHOC";
import Itembankstop from "./component/Itembankstop";
import './questioncss/questioncom.css';
import '../tpm/newshixuns/css/Newshixuns.css';
@ -35,7 +25,7 @@ class Questionitem_banks extends Component {
myquestion_choicesco: [],
disciplinesdata: [],
knowledgepoints: [],
disciplmy:[]
disciplmy: []
}
}
@ -115,7 +105,7 @@ class Questionitem_banks extends Component {
const didata = response.data.disciplines;
for (var i = 0; i < didata.length; i++) {
const childern=[];
const childern = [];
//方向
const fxdidata = didata[i].sub_disciplines;
@ -137,7 +127,7 @@ class Questionitem_banks extends Component {
}
}
const datakec={
const datakec = {
value: didata[i].id,
label: didata[i].name,
children: childern,
@ -147,7 +137,7 @@ class Questionitem_banks extends Component {
this.setState({
knowledgepoints: this.state.knowledgepoints,
disciplmy:this.state.disciplmy,
disciplmy: this.state.disciplmy,
})
@ -230,7 +220,7 @@ class Questionitem_banks extends Component {
return;
}
var Getdatasdata=this.contentMdRef.Getdatas();
var Getdatasdata = this.contentMdRef.Getdatas();
if (this.state.item_type === null) {
return
}
@ -260,9 +250,9 @@ class Questionitem_banks extends Component {
// repertoire_id:1,
// sub_repertoire_id:1,
// tag_repertoire_id:[1,3],
var myrbkc=[];
var Getdatasdatas=Getdatasdata[2].rbzsd;
for(let myda of Getdatasdatas) {
var myrbkc = [];
var Getdatasdatas = Getdatasdata[2].rbzsd;
for (let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
var data = {
@ -271,7 +261,7 @@ class Questionitem_banks extends Component {
tag_discipline_id: myrbkc,
name: anserdata[0],
item_type: Getdatasdata[1].rbtx,
difficulty:Getdatasdata[0].rbnd,
difficulty: Getdatasdata[0].rbnd,
analysis: anserdata[3],
choices: choices,
@ -338,9 +328,9 @@ class Questionitem_banks extends Component {
}
var myrbkc=[];
var Getdatasdatas=Getdatasdata[2].rbzsd;
for(let myda of Getdatasdatas) {
var myrbkc = [];
var Getdatasdatas = Getdatasdata[2].rbzsd;
for (let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
var data = {
@ -349,7 +339,7 @@ class Questionitem_banks extends Component {
tag_discipline_id: myrbkc,
name: anserdata[0],
item_type: Getdatasdata[1].rbtx,
difficulty:Getdatasdata[0].rbnd,
difficulty: Getdatasdata[0].rbnd,
analysis: anserdata[3],
choices: choices,
@ -407,9 +397,9 @@ class Questionitem_banks extends Component {
is_answer: anserdata[1] === "1" ? 1 : 0,
}
choices.push(choicesdatas);
var myrbkc=[];
var Getdatasdatas=Getdatasdata[2].rbzsd;
for(let myda of Getdatasdatas) {
var myrbkc = [];
var Getdatasdatas = Getdatasdata[2].rbzsd;
for (let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
var data = {
@ -418,7 +408,7 @@ class Questionitem_banks extends Component {
tag_discipline_id: myrbkc,
name: anserdata[0],
item_type: Getdatasdata[1].rbtx,
difficulty:Getdatasdata[0].rbnd,
difficulty: Getdatasdata[0].rbnd,
analysis: anserdata[2],
choices: choices,
@ -454,9 +444,9 @@ class Questionitem_banks extends Component {
}
if (this.state.item_type === "PROGRAM") {
//编程题 跳转到 oj 中创建
var myrbkc=[];
var Getdatasdatas=Getdatasdata[2].rbzsd;
for(let myda of Getdatasdatas) {
var myrbkc = [];
var Getdatasdatas = Getdatasdata[2].rbzsd;
for (let myda of Getdatasdatas) {
myrbkc.push(myda.id);
}
@ -480,7 +470,7 @@ class Questionitem_banks extends Component {
}
render() {
let {page, limit, count, Headertop, visible, placement, modalsType, item_type} = this.state;
let { page, limit, count, Headertop, visible, placement, modalsType, item_type } = this.state;
const params = this.props && this.props.match && this.props.match.params;
// ////console.log(params);
return (
@ -567,7 +557,7 @@ class Questionitem_banks extends Component {
""
:
<Bottomsubmit {...this.props} {...this.state} bottomvalue={item_type === "PROGRAM" ? "创建" : "保存"}
onSubmits={() => this.preservation()} url={item_type === "PROGRAM" ?'/problems':'/question'}></Bottomsubmit>
onSubmits={() => this.preservation()} url={item_type === "PROGRAM" ? '/problems' : '/question'}></Bottomsubmit>
}
</div>
)

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

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

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

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

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

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

@ -2,13 +2,13 @@ import React, { Component } from 'react';
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 Loadable from 'react-loadable';
import { TPMIndexHOC } from './TPMIndexHOC';
import TPMIndexHOC from './TPMIndexHOC';
import { SnackbarHOC } from 'educoder';
@ -147,48 +147,48 @@ class TPMIndex extends Component {
shixunId: undefined,
star_info: [0, 0, 0, 0, 0, 0],
star_infos: [0, 0, 0, 0, 0, 0],
identity:undefined,
TPMRightSectionData:undefined,
identity: undefined,
TPMRightSectionData: undefined,
PropaedeuticsList: undefined,
tpmindexjupyterbool:false,
is_jupyter:false,
selectedKeys:"",
openknows:false
tpmindexjupyterbool: false,
is_jupyter: false,
selectedKeys: "",
openknows: false
}
}
openknow=()=>{
let storage=window.localStorage;
openknow = () => {
let storage = window.localStorage;
this.setState({
openknows:false
openknows: false
})
let newTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings'
storage.setItem(newTPMsettings,false);
let newTPMsettings = this.props.user && this.props.user.user_id + 'newTPMsettings'
storage.setItem(newTPMsettings, false);
}
componentDidUpdate(prevProps, prevState) {
if (prevProps!=this.props) {
if(this.props.user&&this.props.user.user_id){
let getnewTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings';
let newTPMsettings=window.localStorage.getItem(getnewTPMsettings)
if(newTPMsettings===undefined||newTPMsettings===false||newTPMsettings===null){
if (prevProps != this.props) {
if (this.props.user && this.props.user.user_id) {
let getnewTPMsettings = this.props.user && this.props.user.user_id + 'newTPMsettings';
let newTPMsettings = window.localStorage.getItem(getnewTPMsettings)
if (newTPMsettings === undefined || newTPMsettings === false || newTPMsettings === null) {
this.setState({
openknows:false
openknows: false
})
}else{
} else {
this.setState({
openknows:false
openknows: false
})
}
}
}
}
getcomponentdidmount=()=>{
let userid=this.props.user&&this.props.user.user_id;
let getnewTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings';
let newTPMsettings=window.localStorage.getItem(getnewTPMsettings)
getcomponentdidmount = () => {
let userid = this.props.user && this.props.user.user_id;
let getnewTPMsettings = this.props.user && this.props.user.user_id + 'newTPMsettings';
let newTPMsettings = window.localStorage.getItem(getnewTPMsettings)
let id = this.props.match.params.shixunId;
// console.log('props', this.props);
// let collaborators = `/shixuns/` + id + `/propaedeutics.json`;
@ -211,7 +211,7 @@ class TPMIndex extends Component {
let Url = `/shixuns/` + id + `.json`;
axios.get(Url).then((response) => {
if (response.status === 200) {
document.title=response.data.name;
document.title = response.data.name;
let newstar_info = [];
// let start1=
for (var i = 0; i < response.data.score_info.length; i++) {
@ -230,23 +230,23 @@ class TPMIndex extends Component {
star_infos: newstar_infos,
power: response.data.power,
identity: response.data.identity,
propaedeutics:response.data.propaedeutics,
propaedeutics: response.data.propaedeutics,
status: response.data.shixun_status,
secret_repository: response.data.secret_repository,
public:response.data.public,
is_jupyter:response.data.is_jupyter=== undefined||response.data.is_jupyter===null?false:response.data.is_jupyter,
public: response.data.public,
is_jupyter: response.data.is_jupyter === undefined || response.data.is_jupyter === null ? false : response.data.is_jupyter,
});
if(userid){
if(response.data.identity <4){
if(newTPMsettings===undefined||newTPMsettings===false||newTPMsettings===null){
if (userid) {
if (response.data.identity < 4) {
if (newTPMsettings === undefined || newTPMsettings === false || newTPMsettings === null) {
console.log()
this.setState({
openknows:true
openknows: true
})
}else{
} else {
this.setState({
openknows:false
openknows: false
})
}
}
@ -262,15 +262,15 @@ class TPMIndex extends Component {
power: undefined,
identity: undefined,
status: undefined,
propaedeutics:undefined,
is_jupyter:false,
propaedeutics: undefined,
is_jupyter: false,
});
});
this.tpmContentRequestInterceptor = axios.interceptors.request.use((config) => {
let url = config.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) {
url = url.split('?')[0]
console.log('loadingContent, url:', url)
@ -302,9 +302,9 @@ class TPMIndex extends Component {
return Promise.reject(error);
});
//右侧数据
let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`;
axios.get(shixunsDetailsURL).then((response)=> {
if(response.data){
let shixunsDetailsURL = `/shixuns/` + id + `/show_right.json`;
axios.get(shixunsDetailsURL).then((response) => {
if (response.data) {
}
this.setState({
@ -331,63 +331,63 @@ class TPMIndex extends Component {
}
getnavdatas=()=>{
getnavdatas = () => {
let selectedKeys;
const {location} = this.props;
if(location.pathname.indexOf('/challenges')!=-1){
selectedKeys="1"
}else if(location.pathname.indexOf('/propaedeutics')!=-1){
selectedKeys="2"
}else if(location.pathname.indexOf('/repository')!=-1){
selectedKeys="3"
}else if(location.pathname.indexOf('/secret_repository')!=-1){
selectedKeys="4"
} else if(location.pathname.indexOf('/collaborators')!=-1){
selectedKeys="5"
}else if(location.pathname.indexOf('/dataset')!=-1){
selectedKeys="6"
}else if(location.pathname.indexOf('/shixun_discuss')!=-1){
selectedKeys="7"
}else if(location.pathname.indexOf('/ranking_list')!=-1){
selectedKeys="8"
}else if(location.pathname.indexOf('/settings')!=-1){
selectedKeys="9"
const { location } = this.props;
if (location.pathname.indexOf('/challenges') != -1) {
selectedKeys = "1"
} else if (location.pathname.indexOf('/propaedeutics') != -1) {
selectedKeys = "2"
} else if (location.pathname.indexOf('/repository') != -1) {
selectedKeys = "3"
} else if (location.pathname.indexOf('/secret_repository') != -1) {
selectedKeys = "4"
} else if (location.pathname.indexOf('/collaborators') != -1) {
selectedKeys = "5"
} else if (location.pathname.indexOf('/dataset') != -1) {
selectedKeys = "6"
} else if (location.pathname.indexOf('/shixun_discuss') != -1) {
selectedKeys = "7"
} else if (location.pathname.indexOf('/ranking_list') != -1) {
selectedKeys = "8"
} else if (location.pathname.indexOf('/settings') != -1) {
selectedKeys = "9"
}
this.setState({
selectedKeys:selectedKeys
selectedKeys: selectedKeys
})
}
handleClick=(e)=>{
handleClick = (e) => {
this.setState({
selectedKeys: e.key,
});
let id = this.props.match.params.shixunId;
if(e.key==="1"){
if (e.key === "1") {
this.props.history.replace(`/shixuns/${id}/challenges`);
}else if(e.key==="2"){
} else if (e.key === "2") {
this.props.history.replace(`/shixuns/${id}/propaedeutics`);
}else if(e.key==="3"){
} else if (e.key === "3") {
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`);
}else if(e.key==="5"){
} else if (e.key === "5") {
this.props.history.replace(`/shixuns/${id}/collaborators`);
}else if(e.key==="6"){
} else if (e.key === "6") {
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`);
}else if(e.key==="8"){
} else if (e.key === "8") {
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`);
}
}
render() {
let url = window.location.href;
let flag = url.indexOf("add_file")>-1;
let flag = url.indexOf("add_file") > -1;
return (
<div className="newMain clearfix">
@ -397,7 +397,7 @@ class TPMIndex extends Component {
<TPMBanner
{...this.props}
{...this.state}
is_jupyter={this.state. is_jupyter}
is_jupyter={this.state.is_jupyter}
></TPMBanner>
}
@ -425,16 +425,16 @@ class TPMIndex extends Component {
<span className={"tpmbannernavstyler"}>任务</span>
</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>
</Menu.Item>}
{ this.state.identity >4||this.state.identity===undefined ?"":
this.state.is_jupyter===false?<Menu.Item key="3" className={"competitionmr50"}>
{this.state.identity > 4 || this.state.identity === undefined ? "" :
this.state.is_jupyter === false ? <Menu.Item key="3" className={"competitionmr50"}>
<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>
</Menu.Item>}
@ -442,17 +442,17 @@ class TPMIndex extends Component {
<span className={"tpmbannernavstyler"}>合作者</span>
</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>
</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>
</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>
</Menu.Item>:""}
</Menu.Item> : ""}
{/*{this.state.identity >4||this.state.identity===undefined ? "":this.state.openknows===true?<span>*/}
{/* <Popover*/}
{/* content={*/}
@ -468,13 +468,13 @@ class TPMIndex extends Component {
{/* </Popover>*/}
{/*</span>:""}*/}
{this.state.identity >4||this.state.identity===undefined ? "":
{this.state.identity > 4 || this.state.identity === undefined ? "" :
<Menu.Item key="9" className={"competitionmr50"}>
<span className={"tpmbannernavstyler"}>配置</span>
</Menu.Item>
}
{this.state.identity >2||this.state.identity===undefined?"":
{this.state.identity > 2 || this.state.identity === undefined ? "" :
<div className={"fr"}>
<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>
@ -542,7 +542,7 @@ class TPMIndex extends Component {
<Route path="/shixuns/:shixunId/shixun_discuss" render={
(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}
setHotLabelIndex={this.setHotLabelIndex}
/>)
@ -581,18 +581,18 @@ class TPMIndex extends Component {
{/*评测设置*/}
<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 path="/shixuns/:shixunId/challenges/:checkpointId/tab=3" render={
(props) => (<TPManswer {...this.props} {...props} {...this.state}/>)
(props) => (<TPManswer {...this.props} {...props} {...this.state} />)
}></Route>
{/*新建关卡*/}
<Route path="/shixuns/:shixunId/challenges/new" render={
(props) => (<TPMchallengesnew {...this.props} {...props} {...this.state}/>)
(props) => (<TPMchallengesnew {...this.props} {...props} {...this.state} />)
}></Route>
{/*编辑关卡*/}
@ -607,12 +607,12 @@ class TPMIndex extends Component {
{/*修改选择题*/}
<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 path="/shixuns/:shixunId/challenges/:checkpointId/editquestion" render={
(props) => (<TPMquestion {...this.props} {...props} {...this.state}/>)
(props) => (<TPMquestion {...this.props} {...props} {...this.state} />)
}></Route>
<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 Comments from '../comment/Comments'
import { commentHOC } from '../comment/CommentsHOC'
import commentHOC from '../comment/CommentsHOC'
import Loading from '../../components/loading';

@ -1,14 +1,14 @@
import React, {Component} from 'react';
import React, { Component } from 'react';
import {TPMIndexHOC} from '../TPMIndexHOC';
import TPMIndexHOC from '../TPMIndexHOC';
import {SnackbarHOC} from 'educoder';
import { SnackbarHOC } from 'educoder';
import {Select, Radio, Input, Modal, Button, Form, Tooltip, Upload, Icon, notification} from 'antd';
import { Select, Radio, Input, Modal, Button, Form, Tooltip, Upload, Icon, notification } from 'antd';
import axios from 'axios';
import {getUploadActionUrl} from 'educoder';
import { getUploadActionUrl } from 'educoder';
import './css/Newshixuns.css';
@ -32,7 +32,7 @@ class Newshixuns extends Component {
run_method: undefined,
postapplyvisible: undefined,
fileList: [],
Radiovalue:"1"
Radiovalue: "1"
}
}
@ -126,7 +126,7 @@ class Newshixuns extends Component {
loading: false
})
})
}else{
} else {
this.setState({
loading: false
})
@ -198,7 +198,7 @@ class Newshixuns extends Component {
sendsure_apply = () => {
let {language, runtime, run_method} = this.state;
let { language, runtime, run_method } = this.state;
if (!language || language === "") {
// this.props.showNotification(`请填写该镜像是基于什么语言`);
@ -326,7 +326,7 @@ class Newshixuns extends Component {
// 附件相关 START
handleChange = (info) => {
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let {fileList} = this.state;
let { fileList } = this.state;
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
console.log("handleChange1");
@ -369,7 +369,7 @@ class Newshixuns extends Component {
axios.delete(url, {})
.then((response) => {
if (response.data) {
const {status} = response.data;
const { status } = response.data;
if (status == 0) {
// console.log('--- success')
@ -392,8 +392,8 @@ class Newshixuns extends Component {
}
render() {
const {getFieldDecorator} = this.props.form;
const {newshixunlist, fileList, postapplytitle, postapplyvisible} = this.state;
const { getFieldDecorator } = this.props.form;
const { newshixunlist, fileList, postapplytitle, postapplyvisible } = this.state;
const uploadProps = {
width: 600,
fileList,
@ -481,13 +481,13 @@ class Newshixuns extends Component {
className={"input-100-45 greyInput"}
onInput={this.shixunNameInput} autoComplete="off"
addonAfter={`${String(!this.state.shixunName ? 0 : this.state.shixunName.length)}/${this.state.NAME_COUNT}`}
className="newViewAfter"/>
className="newViewAfter" />
)}
</Form.Item>
<Form.Item
label="简介"
style={{"borderBottom": 'none'}}
style={{ "borderBottom": 'none' }}
className="chooseDes pr"
>
<TPMMDEditor ref={this.contentMdRef} placeholder="请输入简介" mdID={'courseContentMD'}
@ -499,15 +499,15 @@ class Newshixuns extends Component {
<Form.Item
label={"难易度"}
style={{"borderBottom": 'none'}}
style={{ "borderBottom": 'none' }}
className="chooseDes pr"
>
{getFieldDecorator('select', {
rules: [{required: true, message: '请选择难易度'}],
rules: [{ required: true, message: '请选择难易度' }],
})(
<div className="with15 fl pr">
<Select placeholder="请选择难易度"
style={{width: 180}}
style={{ width: 180 }}
onChange={this.Selectthestudent}
>
<Option value={1}>初级</Option>
@ -524,25 +524,25 @@ class Newshixuns extends Component {
<Form.Item
label={"实验环境"}
style={{"borderBottom": 'none', 'width': '18%', 'float': 'left'}}
style={{ "borderBottom": 'none', 'width': '18%', 'float': 'left' }}
className="chooseDes pr"
>
<div>
{getFieldDecorator('main_type', {
rules: [{required: true, message: '请选择主类别'}],
rules: [{ required: true, message: '请选择主类别' }],
})(
<div className="width100 fl mr20">
<Select placeholder="请选择主类别"
style={{width: 180}}
style={{ width: 180 }}
onChange={this.main_type}
defaultOpen={false}
>
{
newshixunlist === undefined ? "" : this.state.Radiovalue==="2"?newshixunlist.main_type.map((item, key) => {
let itemtype=item.type_name.toLowerCase().indexOf('jupyter'.toLowerCase())
if(itemtype>-1){
newshixunlist === undefined ? "" : this.state.Radiovalue === "2" ? newshixunlist.main_type.map((item, key) => {
let itemtype = item.type_name.toLowerCase().indexOf('jupyter'.toLowerCase())
if (itemtype > -1) {
return (
<Option value={item.id} key={key} name={item.description}>
<Tooltip placement="right"
@ -553,12 +553,12 @@ class Newshixuns extends Component {
)
}
}):""
}) : ""
}
{
newshixunlist === undefined ? "" : this.state.Radiovalue==="1"?newshixunlist.main_type.map((item, key) => {
let itemtype=item.type_name.toLowerCase().indexOf('jupyter'.toLowerCase())
if(itemtype===-1){
newshixunlist === undefined ? "" : this.state.Radiovalue === "1" ? newshixunlist.main_type.map((item, key) => {
let itemtype = item.type_name.toLowerCase().indexOf('jupyter'.toLowerCase())
if (itemtype === -1) {
return (
<Option value={item.id} key={key} name={item.description}>
<Tooltip placement="right"
@ -569,7 +569,7 @@ class Newshixuns extends Component {
)
}
}):""
}) : ""
}
</Select>
@ -588,7 +588,7 @@ class Newshixuns extends Component {
}
</style>
<Form.Item
style={{"borderBottom": 'none', 'width': '82%', 'float': 'left', 'marginTop': '40px'}}
style={{ "borderBottom": 'none', 'width': '82%', 'float': 'left', 'marginTop': '40px' }}
className="chooseDes pr"
>
<div className=" fl pr mr20">
@ -596,7 +596,7 @@ class Newshixuns extends Component {
<div className=" fl pr mr20">
<Select placeholder="请选择小类别"
mode="multiple"
style={{width: 280}}
style={{ width: 280 }}
onChange={this.sub_type}
defaultOpen={false}
className={"Selectlittle"}
@ -619,7 +619,7 @@ class Newshixuns extends Component {
<span className="fl ml20 color-grey lineh-20">
<div>
{this.state.mainvalues === undefined && this.state.subvalues === undefined || this.state.mainvalues === "" && this.state.subvalues === "" ? "" :
<div className={"font-12"} style={{'max-width': '600px'}}>
<div className={"font-12"} style={{ 'max-width': '600px' }}>
{`${this.state.mainvalues === undefined || this.state.mainvalues === "" ? "" : this.state.mainvalues}`}
{`${this.state.subvalues === undefined || this.state.subvalues === "" ? "" : this.state.mainvalues === undefined || this.state.mainvalues === "" ? this.state.subvalues : this.state.subvalues}`}
{`${this.state.mainvalues === undefined || this.state.mainvalues === "" ? "" : ""}${this.state.subvalues === undefined || this.state.subvalues === "" ? "" :
@ -663,7 +663,7 @@ class Newshixuns extends Component {
className="color-red fl mt3">*</span>&nbsp;&nbsp;</label>
<textarea
className={this.state.languagewritetype === true ? "fl task-form-80 task-height-150 bor-reds" : "fl task-form-80 task-height-150"}
style={{width: '89%', height: '100px'}}
style={{ width: '89%', height: '100px' }}
onInput={this.setlanguage}
value={this.state.language}
placeholder="请填写该镜像是基于什么语言示例Python"
@ -677,7 +677,7 @@ class Newshixuns extends Component {
<textarea
className={this.state.systemenvironmenttype === true ? "fl task-form-80 task-height-150 bor-reds" : "fl task-form-80 task-height-150"}
onInput={this.setruntime}
style={{height: '100px'}}
style={{ height: '100px' }}
value={this.state.runtime}
placeholder="请填写该镜像是基于什么linux系统环境,代码运行环境"
id="demand_info"></textarea>
@ -692,7 +692,7 @@ class Newshixuns extends Component {
className={this.state.testcoderunmodetype === true ? "fl task-form-80 task-height-150 bor-reds" : "fl task-form-80 task-height-150"}
onInput={this.setrun_method}
value={this.state.run_method}
style={{height: '100px'}}
style={{ height: '100px' }}
placeholder="请填写该镜像中测试代码运行方式"
id="demand_info"></textarea>
</li>
@ -733,14 +733,14 @@ class Newshixuns extends Component {
</div>
</div>
</div>
<Bottomsubmit {...this.props} {...this.state} url={"/shixuns"} onSubmits={() => this.handleSubmit()} loadings={this.state.loading}/>
<Bottomsubmit {...this.props} {...this.state} url={"/shixuns"} onSubmits={() => this.handleSubmit()} loadings={this.state.loading} />
</div>
);
}
}
const NewshixunsNew = Form.create({name: 'newshixun'})(Newshixuns);
const NewshixunsNew = Form.create({ name: 'newshixun' })(Newshixuns);
export default SnackbarHOC()(TPMIndexHOC(NewshixunsNew));

@ -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";
@ -14,7 +14,7 @@ import axios from 'axios';
import './css/Newshixuns.css';
import {getUrl} from 'educoder'
import { getUrl } from 'educoder'
import moment from 'moment';
@ -225,16 +225,16 @@ class Newshixuns extends Component {
onSearchvalue: "",
scope_partmenttype: false,
languagewrite: undefined,
systemenvironment:undefined,
testcoderunmode:undefined,
file:undefined,
deleteisnot:true,
languagewritetype:false,
systemenvironmenttype:false,
testcoderunmodetype:false,
attachmentidstype:false,
datalisttype:false,
bottonloading:false
systemenvironment: undefined,
testcoderunmode: undefined,
file: undefined,
deleteisnot: true,
languagewritetype: false,
systemenvironmenttype: false,
testcoderunmodetype: false,
attachmentidstype: false,
datalisttype: false,
bottonloading: false
}
}
@ -269,7 +269,7 @@ class Newshixuns extends Component {
let newshixunUrl = `/shixuns/new.json`;
axios.get(newshixunUrl).then((response) => {
if (response.status === 200) {
if (response.data.message===undefined) {
if (response.data.message === undefined) {
this.setState({
newshixunlist: response.data
});
@ -284,7 +284,7 @@ class Newshixuns extends Component {
let departmentsUrl = `/shixuns/departments.json`;
axios.get(departmentsUrl).then((response) => {
if (response.status === 200) {
if (response.data.message===undefined) {
if (response.data.message === undefined) {
this.setState({
departmentslist: response.data.shools_name
});
@ -295,7 +295,7 @@ class Newshixuns extends Component {
});
}
setlanguagewrite = (e)=>{
setlanguagewrite = (e) => {
this.setState({
languagewrite: e.target.value
})
@ -393,7 +393,7 @@ class Newshixuns extends Component {
}
adduse_scopeinput = () => {
let {scope_partment} = this.state;
let { scope_partment } = this.state;
let array = scope_partment;
let newarray = ""
array.push(newarray)
@ -403,24 +403,24 @@ class Newshixuns extends Component {
}
shixunScopeInput = (e, id) => {
let types=false
let {scope_partment} = this.state;
let types = false
let { scope_partment } = this.state;
let datalist = scope_partment;
if (datalist === undefined) {
datalist = []
}
datalist.map((item,key)=>{
if(e===item){
types=true
datalist.map((item, key) => {
if (e === item) {
types = true
this.setState({
datalisttype:true
datalisttype: true
})
return
}
})
if(types===false){
if (types === false) {
datalist.push(e)
this.setState({
scope_partment: datalist,
@ -432,7 +432,7 @@ class Newshixuns extends Component {
}
deleteScopeInput = (key) => {
let {scope_partment} = this.state;
let { scope_partment } = this.state;
let datalist = scope_partment;
datalist.splice(key, 1);
this.setState({
@ -443,7 +443,7 @@ class Newshixuns extends Component {
//提交数据
submit_new_shixun = () => {
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`
if (name === "") {
this.setState({
@ -496,7 +496,7 @@ class Newshixuns extends Component {
newmulti_webssh = ""
}
this.setState({
bottonloading:true
bottonloading: true
})
axios.post(Url, {
name: name,
@ -517,15 +517,15 @@ class Newshixuns extends Component {
if (response.status === 200) {
window.location.href = "/shixuns/" + response.data.shixun_identifier + "/challenges";
// window.open("/shixuns/"+response.data.shixun_identifier+"/challenges");
}else{
} else {
this.setState({
bottonloading:false
bottonloading: false
})
}
}).catch((error) => {
console.log(error)
this.setState({
bottonloading:false
bottonloading: false
})
})
}
@ -541,7 +541,7 @@ class Newshixuns extends Component {
function fake() {
let departmentsUrl = `/shixuns/departments.json?q=` + currentValue;
axios.get(departmentsUrl).then((response) => {
if (response.data.message===undefined) {
if (response.data.message === undefined) {
callback(response.data.shools_name);
}
}).catch((error) => {
@ -554,7 +554,7 @@ class Newshixuns extends Component {
shixunHandleSearch = (value) => {
this.shixunsfetch(value, departmentslist => this.setState({departmentslist}));
this.shixunsfetch(value, departmentslist => this.setState({ departmentslist }));
this.setState({
onSearchvalue: ""
@ -567,7 +567,7 @@ class Newshixuns extends Component {
})
}
sendsure_apply = () => {
let {languagewrite,systemenvironment,testcoderunmode} = this.state;
let { languagewrite, systemenvironment, testcoderunmode } = this.state;
// console.log("点击确定")
// console.log("languagewrite"+languagewrite);
// console.log("systemenvironment"+systemenvironment);
@ -579,36 +579,36 @@ class Newshixuns extends Component {
// return item.response ? item.response.id : item.id
// })
// }
if(languagewrite === undefined || languagewrite === "" ){
if (languagewrite === undefined || languagewrite === "") {
// this.props.showNotification(`请填写该镜像是基于什么语言`);
this.setState({
languagewritetype:true
languagewritetype: true
})
return
}
if(systemenvironment === undefined || systemenvironment === ""){
if (systemenvironment === undefined || systemenvironment === "") {
// this.props.showNotification(`请填写该镜像是基于什么语言系统环境`);
this.setState({
systemenvironmenttype:true
systemenvironmenttype: true
})
return;
}
if(testcoderunmode === undefined || testcoderunmode === "") {
if (testcoderunmode === undefined || testcoderunmode === "") {
// this.props.showNotification(`请填写该镜像中测试代码运行方式`);
this.setState({
testcoderunmodetype:true
testcoderunmodetype: true
})
return;
}
var attachment_ids=undefined;
var attachment_ids = undefined;
if (this.state.fileList) {
attachment_ids = this.state.fileList.map(item => {
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(
// {
@ -619,7 +619,7 @@ class Newshixuns extends Component {
// }
// )
this.setState({
attachmentidstype:true
attachmentidstype: true
})
return;
}
@ -627,39 +627,39 @@ class Newshixuns extends Component {
// alert(languagewrite +" "+systemenvironment +" "+testcoderunmode + " "+attachment_ids);
var data={
language:languagewrite,
runtime:systemenvironment,
run_method:testcoderunmode,
attachment_id:attachment_ids[0],
var data = {
language: languagewrite,
runtime: systemenvironment,
run_method: testcoderunmode,
attachment_id: attachment_ids[0],
}
var url =`/shixuns/apply_shixun_mirror.json`;
axios.post(url,data
var url = `/shixuns/apply_shixun_mirror.json`;
axios.post(url, data
).then((response) => {
try {
if (response.data) {
// const { id } = response.data;
// if (id) {
if(this.state.file !== undefined){
if (this.state.file !== undefined) {
console.log("549");
// this.deleteAttachment(this.state.file);
this.setState({
file:undefined,
deleteisnot:true,
languagewrite:"",
systemenvironment:"",
testcoderunmode:"",
fileList:[]
file: undefined,
deleteisnot: true,
languagewrite: "",
systemenvironment: "",
testcoderunmode: "",
fileList: []
})
}else {
} else {
this.setState({
file:undefined,
deleteisnot:true,
languagewrite:"",
systemenvironment:"",
testcoderunmode:"",
fileList:[]
file: undefined,
deleteisnot: true,
languagewrite: "",
systemenvironment: "",
testcoderunmode: "",
fileList: []
})
}
// this.props.showNotification('提交成功!');
@ -675,7 +675,7 @@ class Newshixuns extends Component {
// this.props.history.push(`/courses/${cid}/graduation_topics`);
// }
}
}catch (e) {
} catch (e) {
}
@ -686,25 +686,25 @@ class Newshixuns extends Component {
this.setState({
postapplyvisible: false,
})
if(this.state.file !== undefined){
if (this.state.file !== undefined) {
console.log("580");
// this.deleteAttachment(this.state.file);
this.setState({
file:undefined,
deleteisnot:true,
languagewrite:"",
systemenvironment:"",
testcoderunmode:"",
fileList:[]
file: undefined,
deleteisnot: true,
languagewrite: "",
systemenvironment: "",
testcoderunmode: "",
fileList: []
})
}else {
} else {
this.setState({
file:undefined,
deleteisnot:true,
languagewrite:"",
systemenvironment:"",
testcoderunmode:"",
fileList:[]
file: undefined,
deleteisnot: true,
languagewrite: "",
systemenvironment: "",
testcoderunmode: "",
fileList: []
})
}
}
@ -764,14 +764,14 @@ class Newshixuns extends Component {
onChangeTimePicker = (value, dateString) => {
this.setState({
TimePickervalue: dateString=== ""?"":moment(handleDateStrings(dateString))
TimePickervalue: dateString === "" ? "" : moment(handleDateStrings(dateString))
})
}
// 附件相关 START
handleChange = (info) => {
if(info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let {fileList} = this.state;
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
let { fileList } = this.state;
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
console.log("handleChange1");
@ -787,7 +787,7 @@ class Newshixuns extends Component {
}
}
onAttachmentRemove = (file) => {
if(!file.percent || file.percent == 100){
if (!file.percent || file.percent == 100) {
confirm({
title: '确定要删除这个附件吗?',
okText: '确定',
@ -807,7 +807,7 @@ class Newshixuns extends Component {
}
deleteAttachment = (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`
axios.delete(url, {
})
@ -824,7 +824,7 @@ class Newshixuns extends Component {
newFileList.splice(index, 1);
return {
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.systemenvironment)
// console.log(this.state.testcoderunmode)
@ -869,7 +869,7 @@ class Newshixuns extends Component {
}
render() {
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
if (departmentslist != undefined) {
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")
this.setState({
file:file
file: file
})
}else {
} else {
this.setState({
file:file
file: file
})
}
@ -950,8 +950,8 @@ class Newshixuns extends Component {
<div className="mb10 edu-back-white">
<p className="padding10-20 bor-bottom-greyE color-grey-3 clearfix">
<span className="fl font-18 lineh-35">创建实训</span>
{this.props.user&&this.props.user.main_site===true?<a className="fr font-16 mt3 color-blue" href="/forums/2943"
target="_blank">实训制作指南</a>:""}
{this.props.user && this.props.user.main_site === true ? <a className="fr font-16 mt3 color-blue" href="/forums/2943"
target="_blank">实训制作指南</a> : ""}
</p>
<div className="padding30-20">
@ -968,7 +968,7 @@ class Newshixuns extends Component {
placeholder="请输入实训名称最多60个字符"
size="60"
type="text"
style={{width: shixun_nametype === false ? '1123px' : '93%'}}
style={{ width: shixun_nametype === false ? '1123px' : '93%' }}
/>
<span
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="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>
</div>
</div>
@ -1005,7 +1005,7 @@ class Newshixuns extends Component {
// onMouseLeave={this.bigopens}
>
<Select placeholder="请选择主类别"
style={{width: 180}}
style={{ width: 180 }}
onChange={this.bigClass}
// onMouseEnter={this.bigopen}
onSelect={this.bigopens}
@ -1016,7 +1016,7 @@ class Newshixuns extends Component {
newshixunlist === undefined ? "" : newshixunlist.main_type.map((item, key) => {
return (
<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}
</Tooltip>
</Option>
@ -1044,24 +1044,24 @@ class Newshixuns extends Component {
<label className="fl mt10 "><span
className="color-red fl mt3">*</span>&nbsp;&nbsp;</label>
<textarea className="fl task-form-80 task-height-150"
style={{width:'89%',height:'100px'}}
style={{ width: '89%', height: '100px' }}
onInput={this.setlanguagewrite}
value={languagewrite}
placeholder="请填写该镜像是基于什么语言示例Python"
id="demand_info"></textarea>
</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">
<label className="panel-form-label fl ml50"><span
className="color-red fl mt3">*</span>&nbsp;&nbsp;</label>
<textarea className="fl task-form-80 task-height-150 "
onInput={this.setsystemenvironment}
style={{height:'100px'}}
style={{ height: '100px' }}
value={systemenvironment}
placeholder="请填写该镜像是基于什么linux系统环境,代码运行环境"
id="demand_info"></textarea>
</li>
<div className={"color-red shixunspanred"}>{this.state.systemenvironmenttype===true?"请填写该镜像语言系统环境":""}</div>
<div className={"color-red shixunspanred"}>{this.state.systemenvironmenttype === true ? "请填写该镜像语言系统环境" : ""}</div>
<li className="clearfix">
<label className="fl mt10" ><span
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 "
onInput={this.settestcoderunmode}
value={testcoderunmode}
style={{height:'100px'}}
style={{ height: '100px' }}
placeholder="请填写该镜像中测试代码运行方式"
id="demand_info"></textarea>
</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">
<label className="panel-form-label fl mt-5"><span
className="color-red fl">*</span>&nbsp;&nbsp;</label>
@ -1090,13 +1090,13 @@ class Newshixuns extends Component {
</li>
<div className={"color-red shixunspanred"}>
{this.state.attachmentidstype===true?"请上传附件":""}
{this.state.attachmentidstype === true ? "请上传附件" : ""}
</div>
<li className="edu-txt-center clearfix ">
<a className="pop_close task-btn mr30"
onClick={() => this.sendhideModaly()}
>取消</a>
<Button type="primary" onClick={()=>this.sendsure_apply()}
<Button type="primary" onClick={() => this.sendsure_apply()}
className="task-btn task-btn-orange">确定</Button>
</li>
<div className="cl"></div>
@ -1131,7 +1131,7 @@ class Newshixuns extends Component {
// onMouseLeave={this.bigopens}
>
<Select mode="multiple" placeholder="请选择小类别"
style={{minWidth: 180}}
style={{ minWidth: 180 }}
onChange={this.littleClass}
// onMouseEnter={this.bigopensmal}
onSelect={this.bigopens}
@ -1142,7 +1142,7 @@ class Newshixuns extends Component {
newshixunlist === undefined ? "" : newshixunlist.small_type.map((item, key) => {
return (
<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}
</Tooltip>
</Option>
@ -1152,7 +1152,7 @@ class Newshixuns extends Component {
</Select>
</div>
<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"}
id="shixun_tech_platform_notice"><i
className="fa fa-exclamation-circle mr3"></i></span>
@ -1171,7 +1171,7 @@ class Newshixuns extends Component {
className="color-grey-9">选中则给学员提供用于练习操作的命令行窗口</span></Radio>
<Radio className="radioStyle" value={2}><span>命令行评测窗口</span> <span
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}
onChange={this.SelectTheCommandonChange}>
多个命令行窗口<span className="color-grey-9">选中则允许学员同时开启多个命令行窗口</span>
@ -1192,13 +1192,13 @@ class Newshixuns extends Component {
</RadioGroup>
<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" 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 className="shixunScopeInput fl">
<Select
style={{width: '200px'}}
style={{ width: '200px' }}
placeholder="请输入并选择单位名称"
onChange={(value) => this.shixunScopeInput(value)}
onSearch={this.shixunHandleSearch}
@ -1215,18 +1215,18 @@ class Newshixuns extends Component {
</Select>
</div>
<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>*/}
</div>
</div>
<div style={{width: '100%'}}>
<div style={{ width: '100%' }}>
<div className="mt20 clearfix" id="task_tag_content">
{
scope_partment === undefined ? "" : scope_partment.map((item, key) => {
return (
<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>
</li>
)
@ -1272,7 +1272,7 @@ class Newshixuns extends Component {
className="mr10 color-orange mt2 fl">*</span></span>
<div className="with15 fl pr">
<Select placeholder="请选择学员类别"
style={{width: 180}}
style={{ width: 180 }}
onChange={this.Selectthestudent}
// onMouseEnter={this.sbigopen}
onSelect={this.bigopens}
@ -1285,7 +1285,7 @@ class Newshixuns extends Component {
</Select>
</div>
<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
className={trainee_types === true ? "color-orange fl" : "color-orange fl none"}
id="shixun_tech_platform_notice"><i
@ -1295,19 +1295,19 @@ class Newshixuns extends Component {
</div>
<li className="mb20 pl25">
<span className="fl edu-txt-right color-grey-6 mr20"
style={{"width": "86px"}}>复制</span>
style={{ "width": "86px" }}>复制</span>
<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>
<div className="clearfix pl25">
<span className="fl edu-txt-right color-grey-6 lineh-30 mr20"
style={{"width": "86px"}}>开启时间</span>
style={{ "width": "86px" }}>开启时间</span>
<li className="fl">
<DatePicker
showToday={false}
locale={locale}
showTime={{ format: 'HH:mm' }}
style={{"width": "184px"}}
style={{ "width": "184px" }}
format="YYYY-MM-DD HH:mm"
placeholder="请选择开启时间"
onChange={this.onChangeTimePicker}
@ -1316,7 +1316,7 @@ class Newshixuns extends Component {
disabledTime={disabledDateTime}
dropdownClassName="hideDisable"
/>
<label style={{top: '6px'}} className="color-grey-6 ml10">
<label style={{ top: '6px' }} className="color-grey-6 ml10">
为空则学员在实训发布后能随时开启实训挑战否则学员在开启时间后才能开启实训挑战
</label>
</li>

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { Redirect } from 'react-router';
import { BrowserRouter as Router, Route, Link} from "react-router-dom";
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { Switch } from 'antd';
@ -9,15 +9,15 @@ import PropTypes from 'prop-types';
import classNames from 'classnames'
import { TPMIndexHOC } from '../TPMIndexHOC'
import TPMIndexHOC from '../TPMIndexHOC'
import { SnackbarHOC } from 'educoder'
import ShixunCard from '.././shixuns/ShixunCard';
import { Pagination,Row,Col,Rate } from 'antd';
import { Pagination, Row, Col, Rate } from 'antd';
import './shixunchildCss/Shixunfork_list.css';
import './shixunchildCss/Shixunfork_list.css';
import 'antd/lib/rate/style/index.css';
@ -49,7 +49,7 @@ class Shixunforklist extends Component {
</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 { TPMIndexHOC } from '../TPMIndexHOC';
import TPMIndexHOC from '../TPMIndexHOC';
import { SnackbarHOC } from 'educoder';
@ -27,34 +27,34 @@ const $ = window.$;
class ShixunsIndex extends Component {
constructor(props) {
super(props)
this.state={
this.state = {
order_by: "new",
page:1,
limit:16,
keyword:"",
status:0,
diff:0,
page: 1,
limit: 16,
keyword: "",
status: 0,
diff: 0,
tag_level: 1,
tag_id:'',
middleshixundata:[],
typepvisible:true,
pages:1,
search_tags:null,
parsedid:undefined,
newtag_level:undefined,
newpalce:undefined,
sort:"desc"
}
}
componentDidMount(){
const upsystem=`/users/system_update.json`;
axios.get(upsystem).then((response)=>{
let updata=response.data;
tag_id: '',
middleshixundata: [],
typepvisible: true,
pages: 1,
search_tags: null,
parsedid: undefined,
newtag_level: undefined,
newpalce: undefined,
sort: "desc"
}
}
componentDidMount() {
const upsystem = `/users/system_update.json`;
axios.get(upsystem).then((response) => {
let updata = response.data;
this.setState({
updata:updata
updata: updata
})
}).catch((error)=>{
}).catch((error) => {
console.log(error);
})
@ -67,49 +67,49 @@ class ShixunsIndex extends Component {
delete window.__headSearchKeyword
}
const parsed = queryString.parse(this.props.location.search);
if(parsed.id===undefined&&parsed.type===undefined){
let {order_by, tag_level, tag_id, page, limit, keyword, status, diff} = this.state;
let params={
order_by:order_by,
tag_level:tag_level,
tag_id:tag_id,
page:page,
limit:limit,
keyword: _keyword || keyword ,
status:status,
diff:diff,
if (parsed.id === undefined && parsed.type === undefined) {
let { order_by, tag_level, tag_id, page, limit, keyword, status, diff } = this.state;
let params = {
order_by: order_by,
tag_level: tag_level,
tag_id: tag_id,
page: page,
limit: limit,
keyword: _keyword || keyword,
status: status,
diff: diff,
sort: "desc"
}
this.shixunresultend(params);
}else{
let {order_by,page, limit, keyword, status, diff} = this.state;
let nawparsed=parsed.type;
let newpalce=parsed.palce;
if(nawparsed==="rep"){
nawparsed=1
}
else if(nawparsed==="sub"){
nawparsed=2
}else if(nawparsed==="tag"){
nawparsed=3
}
let params={
order_by:order_by,
tag_level:nawparsed,
tag_id:parsed.id,
page:page,
limit:limit,
} else {
let { order_by, page, limit, keyword, status, diff } = this.state;
let nawparsed = parsed.type;
let newpalce = parsed.palce;
if (nawparsed === "rep") {
nawparsed = 1
}
else if (nawparsed === "sub") {
nawparsed = 2
} else if (nawparsed === "tag") {
nawparsed = 3
}
let params = {
order_by: order_by,
tag_level: nawparsed,
tag_id: parsed.id,
page: page,
limit: limit,
keyword: _keyword || keyword,
status:status,
diff:diff,
status: status,
diff: diff,
sort: "desc"
}
this.setState({
parsedid:parsed.id,
newtag_level:nawparsed,
tag_level:nawparsed,
newpalce:newpalce,
tag_id:parsed.id,
parsedid: parsed.id,
newtag_level: nawparsed,
tag_level: nawparsed,
newpalce: newpalce,
tag_id: parsed.id,
keyword: _keyword || keyword,
})
this.shixunresultend(params);
@ -117,221 +117,221 @@ class ShixunsIndex extends Component {
}
allUpdatashixunlist=()=>{
let{sort,order_by}=this.state;
allUpdatashixunlist = () => {
let { sort, order_by } = this.state;
this.setState({
tag_level: 1,
tag_id:'',
tag_id: '',
page: 1,
limit: 16,
keyword:'',
keyword: '',
status: 0,
diff: 0,
})
let params={
order_by:order_by,
let params = {
order_by: order_by,
tag_level: 1,
tag_id:'',
tag_id: '',
page: 1,
limit: 16,
keyword:'',
keyword: '',
status: 0,
diff: 0,
sort:sort
sort: sort
}
this.shixunresultend(params)
}
Updatasearchlist=(value)=>{
Updatasearchlist = (value) => {
if (value[1].tag_id === " ") {
this.setState({
keyword: ""
})
}
this.setState({
tag_level:value[0].tag_level,
tag_id:value[1].tag_id,
typepvisible:true
tag_level: value[0].tag_level,
tag_id: value[1].tag_id,
typepvisible: true
})
let {order_by, sort, limit, keyword, status, diff} = this.state;
let { order_by, sort, limit, keyword, status, diff } = this.state;
let params={
order_by:order_by,
tag_level:value[0].tag_level,
tag_id:value[1].tag_id,
page:1,
limit:limit,
keyword:keyword,
status:status,
diff:diff,
sort:sort
let params = {
order_by: order_by,
tag_level: value[0].tag_level,
tag_id: value[1].tag_id,
page: 1,
limit: limit,
keyword: keyword,
status: status,
diff: diff,
sort: sort
}
this.shixunresultend(params)
}
StatusEnquiry=(key)=>{
StatusEnquiry = (key) => {
let Vrl=`/shixuns.json`;
let Vrl = `/shixuns.json`;
let newstatus;
let newdiff;
if(key[0].type===1){
if (key[0].type === 1) {
this.setState({
status: key[1].value,
typepvisible:true
typepvisible: true
})
newstatus=key[1].value;
newdiff=this.state.diff;
}else if(key[0].type===2){
newstatus = key[1].value;
newdiff = this.state.diff;
} else if (key[0].type === 2) {
this.setState({
diff: key[1].value,
typepvisible:true
typepvisible: true
})
newdiff=key[1].value;
newstatus=this.state.status;
}
let params= {
order_by:this.state.order_by,
tag_level:this.state.tag_level,
tag_id:this.state.tag_id,
page:1,
limit:this.state.limit,
keyword:this.state.keyword,
status:newstatus,
diff:newdiff,
newdiff = key[1].value;
newstatus = this.state.status;
}
let params = {
order_by: this.state.order_by,
tag_level: this.state.tag_level,
tag_id: this.state.tag_id,
page: 1,
limit: this.state.limit,
keyword: this.state.keyword,
status: newstatus,
diff: newdiff,
}
this.shixunresultend(params)
}
OnSearchInput=(value,type)=>{
if(type===true){
OnSearchInput = (value, type) => {
if (type === true) {
this.setState({
keyword:value,
typepvisible:true,
pages:1
keyword: value,
typepvisible: true,
pages: 1
})
let {order_by, tag_level, tag_id, sort, limit, status, diff} = this.state;
let params= {
order_by:order_by,
tag_level:tag_level,
tag_id:tag_id,
page:1,
limit:limit,
keyword:value,
status:status,
diff:diff,
sort:sort
let { order_by, tag_level, tag_id, sort, limit, status, diff } = this.state;
let params = {
order_by: order_by,
tag_level: tag_level,
tag_id: tag_id,
page: 1,
limit: limit,
keyword: value,
status: status,
diff: diff,
sort: sort
}
this.shixunresultend(params)
}else{
} else {
this.setState({
keyword:value,
pages:1
keyword: value,
pages: 1
})
}
}
ShixunsSwitch=()=>{
ShixunsSwitch = () => {
//types
this.setState({
order_by:"mine",
typepvisible:true,
pages:1,
order_by: "mine",
typepvisible: true,
pages: 1,
})
let{tag_level,tag_id,page,limit,keyword,status,diff,sort}=this.state;
let newsort=sort;
if(newsort===undefined){
newsort="desc"
}
let params= {
order_by:"mine",
tag_level:tag_level,
tag_id:tag_id,
page:1,
limit:limit,
keyword:keyword,
status:status,
diff:diff,
sort:newsort
let { tag_level, tag_id, page, limit, keyword, status, diff, sort } = this.state;
let newsort = sort;
if (newsort === undefined) {
newsort = "desc"
}
let params = {
order_by: "mine",
tag_level: tag_level,
tag_id: tag_id,
page: 1,
limit: limit,
keyword: keyword,
status: status,
diff: diff,
sort: newsort
}
this.shixunresultend(params)
}
shixunsPage=(value)=>{
shixunsPage = (value) => {
this.setState({
page:value,
typepvisible:true,
pages:value
page: value,
typepvisible: true,
pages: value
})
let {order_by, tag_level, tag_id, limit, keyword, status, diff,sort} = this.state;
let params= {
order_by:order_by,
tag_level:tag_level,
tag_id:tag_id,
page:value,
limit:limit,
keyword:keyword,
status:status,
diff:diff,
sort:sort
}
let Url=`/shixuns.json`;
axios.get(Url,{
let { order_by, tag_level, tag_id, limit, keyword, status, diff, sort } = this.state;
let params = {
order_by: order_by,
tag_level: tag_level,
tag_id: tag_id,
page: value,
limit: limit,
keyword: keyword,
status: status,
diff: diff,
sort: sort
}
let Url = `/shixuns.json`;
axios.get(Url, {
params
}).then((response)=> {
if(response.status===200){
}).then((response) => {
if (response.status === 200) {
this.setState({
middleshixundata: response.data,
typepvisible:false,
typepvisible: false,
});
}
}).catch((error)=>{
}).catch((error) => {
console.log(error)
});
}
ShixunsState=(val,type,sorts)=>{
ShixunsState = (val, type, sorts) => {
// sort,
let {tag_level, tag_id, page, limit, keyword, status, diff,sort} = this.state;
let newsort=sorts?sorts:sort;
let { tag_level, tag_id, page, limit, keyword, status, diff, sort } = this.state;
let newsort = sorts ? sorts : sort;
this.setState({
order_by:type,
typepvisible:true,
pages:1,
sort:sorts?sorts:sort
order_by: type,
typepvisible: true,
pages: 1,
sort: sorts ? sorts : sort
})
let params
// let vals=false
if(newsort===undefined){
newsort="desc"
}else{
newsort=sorts?sorts:sort
}
params= {
order_by:type,
tag_level:tag_level,
tag_id:tag_id,
page:1,
limit:limit,
keyword:keyword,
status:status,
diff:diff,
sort:newsort
if (newsort === undefined) {
newsort = "desc"
} else {
newsort = sorts ? sorts : sort
}
params = {
order_by: type,
tag_level: tag_level,
tag_id: tag_id,
page: 1,
limit: limit,
keyword: keyword,
status: status,
diff: diff,
sort: newsort
}
this.shixunresultend(params)
}
Shixunsupcircles=(sort)=>{
Shixunsupcircles = (sort) => {
console.log(sort)
this.setState({
sort:sort
sort: sort
})
let {
order_by,
@ -345,16 +345,16 @@ class ShixunsIndex extends Component {
let params= {
order_by:order_by,
tag_level:tag_level,
tag_id:tag_id,
page:1,
limit:limit,
keyword:keyword,
status:status,
diff:diff,
sort:sort
let params = {
order_by: order_by,
tag_level: tag_level,
tag_id: tag_id,
page: 1,
limit: limit,
keyword: keyword,
status: status,
diff: diff,
sort: sort
}
this.shixunresultend(params)
}
@ -362,31 +362,31 @@ class ShixunsIndex extends Component {
shixunresultend=(params)=>{
let Url=`/shixuns.json`;
axios.get(Url,{
shixunresultend = (params) => {
let Url = `/shixuns.json`;
axios.get(Url, {
params
}).then((response)=> {
}).then((response) => {
// TODO 有keyword返回值时 显示一共有多少条记录
if(response.status===200){
if (response.status === 200) {
this.setState({
search_tags:response.data.search_tags,
search_tags: response.data.search_tags,
middleshixundata: response.data,
typepvisible:false,
pages:1
typepvisible: false,
pages: 1
});
}
}).catch((error)=>{
}).catch((error) => {
console.log(error)
});
}
render() {
let {middleshixundata, typepvisible, pages, search_tags, keyword,parsedid,newtag_level,newpalce} = this.state;
let { middleshixundata, typepvisible, pages, search_tags, keyword, parsedid, newtag_level, newpalce } = this.state;
// console.log(this.state.updata)
return (
<div className="newMain clearfix backFAFAFA">
{this.state.updata===undefined?"":<UpgradeModals
{this.state.updata === undefined ? "" : <UpgradeModals
{...this.state}
/>}
{/*<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 { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import {CNotificationHOC} from '../courses/common/CNotificationHOC'
import { Route, Switch } from "react-router-dom";
import CNotificationHOC from '../courses/common/CNotificationHOC'
import Loading from '../../Loading';
import Loadable from 'react-loadable';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import TPMIndexHOC from '../tpm/TPMIndexHOC';
import { SnackbarHOC, getImageUrl } from 'educoder';
import { SnackbarHOC } from 'educoder';
import AccountNav from './account/AccountNav'
import axios from 'axios'
const AccountBasic= Loadable({
const AccountBasic = Loadable({
loader: () => import('./account/AccountBasic'),
loading: Loading,
})
const AccountBasicEdit= Loadable({
const AccountBasicEdit = Loadable({
loader: () => import('./account/AccountBasicEdit'),
loading: Loading,
})
const AccountCertification= Loadable({
const AccountCertification = Loadable({
loader: () => import('./account/AccountCertification'),
loading: Loading,
})
const AccountSecure= Loadable({
const AccountSecure = Loadable({
loader: () => import('./account/AccountSecure'),
loading: Loading,
})
const AccountBinding= Loadable({
const AccountBinding = Loadable({
loader: () => import('./account/AccountBinding'),
loading: Loading,
})
class AccountPage extends Component {
constructor (props) {
constructor(props) {
super(props)
this.state = {
basicInfo: {}
}
}
componentDidUpdate =(prevState)=>{
if(this.props.current_user && this.props.current_user != prevState.current_user){
componentDidUpdate = (prevState) => {
if (this.props.current_user && this.props.current_user != prevState.current_user) {
this.getBasicInfo(this.props.current_user.login);
}
}
componentDidMount = () =>{
if(this.props.current_user){
componentDidMount = () => {
if (this.props.current_user) {
this.getBasicInfo(this.props.current_user.login);
}
}
getBasicInfo=(login)=>{
let url=`/users/accounts/${login || this.props.current_user.login}.json`;
axios.get(url).then((result)=>{
if(result.data){
if(result.data && result.data.base_info_completed == false){
getBasicInfo = (login) => {
let url = `/users/accounts/${login || this.props.current_user.login}.json`;
axios.get(url).then((result) => {
if (result.data) {
if (result.data && result.data.base_info_completed == false) {
this.props.history.push(`/account/profile/edit`);
}
// "authentication": "uncertified", // "uncertified" | "applying" | "certified"
this.setState({
basicInfo: Object.assign({}, {...result.data}, {
basicInfo: Object.assign({}, { ...result.data }, {
avatar_url: `${result.data.avatar_url}`,
gender: result.data.gender == null || result.data.gender == undefined ? 0 : result.data.gender
})
})
}
}).catch((error)=>{
}).catch((error) => {
console.log(error);
})
}
render() {
let { basicInfo }=this.state;
const common = { basicInfo, getBasicInfo : this.getBasicInfo }
let { basicInfo } = this.state;
const common = { basicInfo, getBasicInfo: this.getBasicInfo }
return (
<div className="newMain clearfix">
<div className="educontent df pt20">
@ -136,7 +136,7 @@ class AccountPage extends Component {
<Route exact path="/account"
render={
(props) => (<AccountBasic getBasicInfo={()=>this.getBasicInfo()} {...this.props} {...props} {...this.state} {...common} />)
(props) => (<AccountBasic getBasicInfo={() => this.getBasicInfo()} {...this.props} {...props} {...this.state} {...common} />)
}
></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 { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import Loading from '../../Loading';
import Loadable from 'react-loadable';
// import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
import { SnackbarHOC, getImageUrl } from 'educoder';
import { SnackbarHOC } from 'educoder';
import LoginRegisterComponent from './LoginRegisterComponent';
import FindPasswordComponent from './FindPasswordComponent';
@ -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 { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip, Menu, Pagination, Spin, Dropdown} from 'antd';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import { Tooltip, Menu, Pagination, Spin, Dropdown } from 'antd';
import axios from 'axios';
import NoneData from '../../courses/coursesPublic/NoneData'
import {getImageUrl} from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC'
import { getImageUrl } from 'educoder';
import "./usersInfo.css"
import Create from './publicCreatNew'
class InfosCourse extends Component{
constructor(props){
class InfosCourse extends Component {
constructor(props) {
super(props);
this.state={
category:undefined,
status:undefined,
page:1,
per_page:16,
this.state = {
category: undefined,
status: undefined,
page: 1,
per_page: 16,
sort_by: "updated_at",
sort_direction: "desc",
totalCount:undefined,
data:undefined,
isSpin:false
totalCount: undefined,
data: undefined,
isSpin: false
}
}
componentDidMount=()=>{
componentDidMount = () => {
this.setState({
isSpin:true
isSpin: true
})
let {category, status, page, sort_by, sort_direction} = this.state;
let { category, status, page, sort_by, sort_direction } = this.state;
this.getCourses(category, status, page, sort_by, sort_direction);
}
getCourses = (category, status, page, sort_by, sort_direction) => {
let url=`/users/${this.props.match.params.username}/courses.json`;
axios.get((url),{params:{
let url = `/users/${this.props.match.params.username}/courses.json`;
axios.get((url), {
params: {
category,
status,
page,
sort_by,
sort_direction,
per_page: this.props.is_current && category && page ==1?17:16
}}).then((result)=>{
if(result){
per_page: this.props.is_current && category && page == 1 ? 17 : 16
}
}).then((result) => {
if (result) {
console.log("请求成功");
this.setState({
totalCount:result.data.count,
data:result.data,
totalCount: result.data.count,
data: result.data,
sort_direction: sort_direction,
sort_by: sort_by,
isSpin:false
isSpin: false
})
}
}).catch((error)=>{
}).catch((error) => {
console.log(error);
this.setState({
isSpin: false
@ -65,38 +61,38 @@ class InfosCourse extends Component{
}
//切换种类
changeCategory=(cate)=>{
changeCategory = (cate) => {
this.setState({
category:cate,
page:1,
isSpin:true
category: cate,
page: 1,
isSpin: true
})
let {status, sort_by, sort_direction} = this.state;
let { status, sort_by, sort_direction } = this.state;
this.getCourses(cate, status, 1, sort_by, sort_direction);
}
//切换状态
changeStatus=(status)=>{
changeStatus = (status) => {
this.setState({
status:status,
page:1,
isSpin:true
status: status,
page: 1,
isSpin: true
})
let {category, sort_by, sort_direction} = this.state;
let { category, sort_by, sort_direction } = this.state;
this.getCourses(category, status, 1, sort_by, sort_direction);
}
//切换页数
changePage=(page)=>{
changePage = (page) => {
this.setState({
page,
isSpin:true
isSpin: true
})
let {category, status, sort_by, sort_direction} = this.state;
let { category, status, sort_by, sort_direction } = this.state;
this.getCourses(category, status, page, sort_by, sort_direction);
}
// 进入课堂
turnToCourses=(url,flag)=>{
if(flag){
turnToCourses = (url, flag) => {
if (flag) {
this.props.history.push(url);
}
}
@ -106,7 +102,7 @@ class InfosCourse extends Component{
this.setState({
isSpin: true
});
let {category, status, page, sort_direction} = this.state;
let { category, status, page, sort_direction } = this.state;
this.getCourses(category, status, 1, sort_by, "desc");
}
@ -119,7 +115,7 @@ class InfosCourse extends Component{
isSpin: true
});
let {category, status, page, sort_by, sort_direction} = this.state;
let { category, status, page, sort_by, sort_direction } = this.state;
let sort_directiony = sort_directions;
if (sort_directions === "asc") {
if (sort_directions === sort_direction) {
@ -134,8 +130,8 @@ class InfosCourse extends Component{
this.getCourses(category, status, page, sort_by, sort_directiony);
}
render(){
let{
render() {
let {
category,
status,
page,
@ -145,7 +141,7 @@ class InfosCourse extends Component{
sort_by,
sort_direction
} = this.state;
let is_current=this.props.is_current;
let is_current = this.props.is_current;
// console.log(this.props.current_user&&this.props.current_user.user_identity==="学生")
const menu = (
@ -161,7 +157,7 @@ class InfosCourse extends Component{
);
console.log("InfosCourse");
console.log(status);
return(
return (
<div className="educontent">
<Spin size="large" spinning={isSpin}>
<style>
@ -252,7 +248,7 @@ class InfosCourse extends Component{
lineHeight: "41px",
marginTop: "10px",
}}>
<span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"课堂"}</span>
<span className="fl color-grey-9">共参与{totalCount}{category ? category == "manage" ? "发布" : "学习" : "课堂"}</span>
<sapn className="relativef color-grey-9 fr"
style={{
display: "flex",
@ -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.courses && data.courses.map((item,key)=>{
return(
<div className="square-Item" onClick={()=>this.turnToCourses(`${item.first_category_url}`,item.can_visited)} style={{"cursor": "pointer",height:"289px"}}>
data && data.courses && data.courses.map((item, key) => {
return (
<div className="square-Item" onClick={() => this.turnToCourses(`${item.first_category_url}`, item.can_visited)} style={{ "cursor": "pointer", height: "289px" }}>
{
item.is_public == 1 &&
<React.Fragment>
<div className={key == 0 ?"publicpart orangeBlack":"publicpart"}></div>
<div className={key == 0 ? "publicpart orangeBlack" : "publicpart"}></div>
<span className="smalltrangle"></span>
<span className="publicword">公开</span>
</React.Fragment>
}
{
item.can_visited ==false?
item.can_visited == false ?
<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>
</div>:""
</div> : ""
}
<div className="substance">
<p className="subName font-16">
<span>{item.name}</span>
</p>
<span><img alt="用户" className="radius mt15" height="60" src={getImageUrl('images/'+`${item.teacher && item.teacher.avatar_url}`)} width="60"/></span>
<span><img alt="用户" className="radius mt15" height="60" src={getImageUrl('images/' + `${item.teacher && item.teacher.avatar_url}`)} width="60" /></span>
<p className="font-14 mt10 task-hide"><span>{item.teacher && item.teacher.real_name}</span></p>
<p className="font-16 mb15 task-hide mt10"><span className="color-grey-98">{item&&item.school}</span></p>
<p className="font-16 mb15 task-hide mt10"><span className="color-grey-98">{item && item.school}</span></p>
</div>
<div className="edu-txt-center course-bottom">
<div className="inline color-grey-6">
{item.visits>0?<span className="fl ml10 mr10 squareIconSpan">
{item.visits > 0 ? <span className="fl ml10 mr10 squareIconSpan">
<Tooltip placement="bottom" title="访问量">
<i className="iconfont icon-liulanyan fl mr3"></i>{item.visits}
</Tooltip>
</span>:""}
</span> : ""}
{
item.members_count > 0 &&
@ -387,7 +383,7 @@ class InfosCourse extends Component{
{
totalCount > 15 &&
<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>
}
</Spin>

@ -1,10 +1,9 @@
import React, { Component } from 'react';
import {Link} from 'react-router-dom';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import { Route, Switch } from 'react-router-dom';
import { SnackbarHOC } from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC'
import TPMIndexHOC from '../../tpm/TPMIndexHOC';
import CNotificationHOC from '../../courses/common/CNotificationHOC'
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
@ -29,27 +28,27 @@ const VideoProtocol = Loadable({
})
const $ = window.$;
class InfosIndex extends Component{
constructor(props){
class InfosIndex extends Component {
constructor(props) {
super(props);
this.state={
data:undefined,
this.state = {
data: undefined,
}
}
componentDidMount =()=>{
componentDidMount = () => {
}
//判断是否看的是当前用户的个人主页
componentDidUpdate =(prevProps)=> {
componentDidUpdate = (prevProps) => {
}
render(){
render() {
let {
data ,
}=this.state;
return(
data,
} = this.state;
return (
<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 { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip, Menu, Pagination, Spin, Dropdown} from 'antd';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import { Tooltip, Menu, Pagination, Spin, Dropdown } from 'antd';
import NoneData from '../../courses/coursesPublic/NoneData'
import axios from 'axios';
import {getImageUrl,setImagesUrl} from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC'
import { getImageUrl } from 'educoder';
import "./usersInfo.css"
import Create from './publicCreatNew'
class InfosPath extends Component{
constructor(props){
class InfosPath extends Component {
constructor(props) {
super(props);
this.state={
category:undefined,
page:1,
status:undefined,
per_page:16,
isSpin:false,
this.state = {
category: undefined,
page: 1,
status: undefined,
per_page: 16,
isSpin: false,
sort_by: "updated_at",
sort_direction: "desc",
totalCount:undefined,
data:undefined
totalCount: undefined,
data: undefined
}
}
componentDidMount=()=>{
componentDidMount = () => {
this.setState({
isSpin:true
isSpin: true
})
let {category, status, sort_by, page, per_page, sort_direction} = this.state;
let { category, status, sort_by, page, per_page, sort_direction } = this.state;
this.getCourses(category, status, sort_by, page, sort_direction);
}
getCourses = (category, status, sort_by, page, sort_direction) => {
let url=`/users/${this.props.match.params.username}/subjects.json`;
axios.get((url),{params:{
let url = `/users/${this.props.match.params.username}/subjects.json`;
axios.get((url), {
params: {
category,
status,
sort_by,
page,
sort_direction,
per_page:this.props.is_current && category && page ==1?17:16
}}).then((result)=>{
if(result){
per_page: this.props.is_current && category && page == 1 ? 17 : 16
}
}).then((result) => {
if (result) {
this.setState({
totalCount:result.data.count,
data:result.data,
totalCount: result.data.count,
data: result.data,
sort_by: sort_by,
sort_direction: sort_direction,
isSpin:false
isSpin: false
})
}
}).catch((error)=>{
}).catch((error) => {
console.log(error);
this.setState({
isSpin: false
@ -65,49 +61,49 @@ class InfosPath extends Component{
}
//切换种类
changeCategory=(cate)=>{
changeCategory = (cate) => {
this.setState({
category:cate,
status:undefined,
page:1,
isSpin:true
category: cate,
status: undefined,
page: 1,
isSpin: true
})
let {sort_by, sort_direction} = this.state;
let { sort_by, sort_direction } = this.state;
this.getCourses(cate, undefined, sort_by, 1, sort_direction);
}
// 切换状态
changeStatus=(status)=>{
let {category, sort_by, sort_direction} = this.state;
changeStatus = (status) => {
let { category, sort_by, sort_direction } = this.state;
this.setState({
status,
page:1,
isSpin:true
page: 1,
isSpin: true
})
this.getCourses(category, status, sort_by, 1, sort_direction);
}
//切换页数
changePage=(page)=>{
changePage = (page) => {
this.setState({
page,
isSpin:true
isSpin: true
})
let {category, sort_by, status, sort_direction} = this.state;
let { category, sort_by, status, sort_direction } = this.state;
this.getCourses(category, status, sort_by, page, sort_direction);
}
// 进入课堂
turnToCourses=(url)=>{
turnToCourses = (url) => {
this.props.history.push(url);
}
// 切换排序方式
changeOrder= (sort)=>{
changeOrder = (sort) => {
this.setState({
sort_by:sort,
isSpin:true
sort_by: sort,
isSpin: true
})
let {category, status, page, sort_direction} = this.state;
let { category, status, page, sort_direction } = this.state;
this.getCourses(category, status, sort, page, sort_direction);
}
@ -118,7 +114,7 @@ class InfosPath extends Component{
this.setState({
isSpin: true
});
let {category, status, page, sort_direction} = this.state;
let { category, status, page, sort_direction } = this.state;
this.getCourses(category, status, sort_by, 1, "desc");
}
@ -128,7 +124,7 @@ class InfosPath extends Component{
this.setState({
isSpin: true
});
let {category, status, page, sort_by, sort_direction} = this.state;
let { category, status, page, sort_by, sort_direction } = this.state;
let sort_directiony = sort_directions;
if (sort_directions === "asc") {
if (sort_directions === sort_direction) {
@ -144,8 +140,8 @@ class InfosPath extends Component{
}
render(){
let{
render() {
let {
category,
status,
sort_by,
@ -156,7 +152,7 @@ class InfosPath extends Component{
isSpin
} = this.state;
let isStudent = this.props.isStudent();
let is_current=this.props.is_current;
let is_current = this.props.is_current;
const menu = (
<Menu>
<Menu.Item onClick={() => this.updatedlist("updated_at")}>
@ -170,7 +166,7 @@ class InfosPath extends Component{
);
// console.log(this.props.user&&this.props.user.main_site)
return(
return (
<div className="educontent">
<Spin size="large" spinning={isSpin}>
<style>
@ -272,7 +268,7 @@ class InfosPath extends Component{
lineHeight: "41px",
marginTop: "10px",
}}>
<span className="fl color-grey-9">共参与{totalCount}{category?category=="manage"?"发布":"学习":"实践课程"}</span>
<span className="fl color-grey-9">共参与{totalCount}{category ? category == "manage" ? "发布" : "学习" : "实践课程"}</span>
<sapn className="relativef color-grey-9 fr"
style={{
display: "flex",
@ -331,24 +327,24 @@ class InfosPath extends Component{
<div className="square-list clearfix">
{/* 295 */}
{
this.props.user&&this.props.user.main_site===true?page == 1 && is_current && !category ? <Create href={"/paths/new"} name={"新建实践课程"} index="3"></Create>:"":""
this.props.user && this.props.user.main_site === 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)=>{
return(
<div className="square-Item" style={{height:"295px"}} onClick={()=>this.turnToCourses(`/paths/${item.id}`)}>
data && data.subjects && data.subjects.map((item, key) => {
return (
<div className="square-Item" style={{ height: "295px" }} onClick={() => this.turnToCourses(`/paths/${item.id}`)}>
{
item.tag && <div className="tag-green"><span className="tag-name">{item.tag}</span>
{/*<img src={setImagesUrl("images/educoder/tag2.png")} className="fl"/>*/}
</div>
}
<a href="javascript:void(0)" className="square-img"><img alt="Subject12" src={getImageUrl(`${item.image_url}`)}/></a>
<a href="javascript:void(0)" className="square-img"><img alt="Subject12" src={getImageUrl(`${item.image_url}`)} /></a>
<div className="square-main">
<p className="task-hide">
<a href="javascript:void(0)" className="justify color-grey-name "
@ -357,7 +353,7 @@ class InfosPath extends Component{
<div className="mt10">
<p className="color-grey-6 clearfix">
<a href="javascript:void(0)" className="fl color-grey-9 overflowHidden1"
title={item.owner_name.length > 12 ? item.owner_name : ''} style={{ maxWidth: '175px'}}
title={item.owner_name.length > 12 ? item.owner_name : ''} style={{ maxWidth: '175px' }}
>{item.owner_name}</a>
<span className="fr squareIconSpan">
<Tooltip placement='bottom' title="访问量">
@ -376,7 +372,7 @@ class InfosPath extends Component{
{
totalCount > 15 &&
<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>
}
</Spin>

@ -1,11 +1,10 @@
import React, { Component } from 'react';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import { Route, Switch } from 'react-router-dom';
import { Breadcrumb } from 'antd';
import { SnackbarHOC } from 'educoder';
import { TPMIndexHOC } from '../../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../../courses/common/CNotificationHOC'
import TPMIndexHOC from '../../../tpm/TPMIndexHOC';
import CNotificationHOC from '../../../courses/common/CNotificationHOC'
import "../usersInfo.css"
import "../../../courses/css/members.css"
@ -38,27 +37,27 @@ const ExerciseBanksEdit = Loadable({
});
//普通作业题库详情
const Generaljobbankdetails =Loadable({
const Generaljobbankdetails = Loadable({
loader: () => import('../../../courses/questionbank/Generaljobbankdetails'),
loading: Loading,
});
//分组作业题库详情
const GroupjobbankPage =Loadable({
const GroupjobbankPage = Loadable({
loader: () => import('../../../courses/groupjobbank/GroupjobbankPage'),
loading: Loading,
});
//毕设选题详情
const CompletetopicdePage =Loadable({
const CompletetopicdePage = Loadable({
loader: () => import('../../../courses/comtopicdetails/CompletetopicdePage'),
loading: Loading,
});
//毕设任务详情
const Completetaskpage =Loadable({
const Completetaskpage = Loadable({
loader: () => import('../../../courses/completetaskdetails/Completetaskpage'),
loading: Loading,
});
//问卷编辑
const PollNewQuestbank =Loadable({
const PollNewQuestbank = Loadable({
loader: () => import('../../../courses/poll/PollNewQuestbank'),
loading: Loading,
});
@ -68,16 +67,16 @@ const GtaskBanksEdit = Loadable({
loading: Loading,
})
class BanksIndex extends Component{
constructor(props){
class BanksIndex extends Component {
constructor(props) {
super(props);
this.state={
crumbData:undefined,
publicly:undefined
this.state = {
crumbData: undefined,
publicly: undefined
}
}
componentDidMount = () =>{
componentDidMount = () => {
// let pathname = this.props.location.pathname;
// this.setState({
// publicly:pathname.indexOf("/publicly") > -1
@ -85,8 +84,8 @@ class BanksIndex extends Component{
}
initPublic = (crumbData,data) =>{
if(data && data.status && data.status == -2){
initPublic = (crumbData, data) => {
if (data && data.status && data.status == -2) {
this.props.history.push(`/topicbank/publicly`);
}
this.setState({
@ -116,21 +115,21 @@ class BanksIndex extends Component{
// }
}
render(){
let { crumbData }=this.state
render() {
let { crumbData } = this.state
const common = {
initPublic:this.initPublic
initPublic: this.initPublic
}
return(
return (
<div className="newMain">
<div className="educontent">
{
crumbData &&
<Breadcrumb separator=">" className="breadcrumb mt22">
<Breadcrumb.Item href={crumbData && crumbData.is_public == true ?`/topicbank/publicly`:`/users/${this.props.current_user && this.props.current_user.login}/topics/personal`}>{ crumbData && crumbData.is_public == true ? '公共' : '我的' }题库</Breadcrumb.Item>
<Breadcrumb.Item href={crumbData && crumbData.is_public == true ? `/topicbank/publicly` : `/users/${this.props.current_user && this.props.current_user.login}/topics/personal`}>{crumbData && crumbData.is_public == true ? '公共' : '我的'}题库</Breadcrumb.Item>
{
crumbData.crumbArray && crumbData.crumbArray.map((item,key)=>{
return(
crumbData.crumbArray && crumbData.crumbArray.map((item, key) => {
return (
<Breadcrumb.Item key={key} href={item.to || ""}>{item.content}</Breadcrumb.Item>
)
})
@ -139,22 +138,22 @@ class BanksIndex extends Component{
}
{
crumbData &&<p className="clearfix mt15 mb10 ">
<span className="fl font-24 color-grey-3 task-hide lineh-30" style={{maxWidth:'800px'}}>{crumbData && crumbData.title}</span>
{ crumbData.is_public == true ?
crumbData && <p className="clearfix mt15 mb10 ">
<span className="fl font-24 color-grey-3 task-hide lineh-30" style={{ maxWidth: '800px' }}>{crumbData && crumbData.title}</span>
{crumbData.is_public == true ?
<span className="bank_is_public">公开</span>
:
<span className="bank_is_private">私有</span>
}
</p> }
</p>}
<Switch {...this.props}>
{/*毕设任务编辑*/}
<Route path='/banks/gtask/:workId/edit/:type'
render={
(props) => {
return (<GtaskBanksEdit {...this.props} {...props} {...this.state} {...common}/>)
return (<GtaskBanksEdit {...this.props} {...props} {...this.state} {...common} />)
}
}></Route>
@ -188,7 +187,7 @@ class BanksIndex extends Component{
<Route path='/banks/gtopic/:bankId/edit/:type'
render={
(props) => {
return (<GtopicBanksEdit {...this.props} {...props} {...this.state} {...common}/>)
return (<GtopicBanksEdit {...this.props} {...props} {...this.state} {...common} />)
}
}></Route>
@ -223,7 +222,7 @@ class BanksIndex extends Component{
{/*毕设内容题库详情*/}
<Route path="/banks/gtopic/:workid/:type"
render={
(props) => (<CompletetopicdePage {...this.props} {...props} {...this.state} {...common}/>)
(props) => (<CompletetopicdePage {...this.props} {...props} {...this.state} {...common} />)
}
></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 { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import {Tooltip,Menu,Pagination} from 'antd';
import Loadable from 'react-loadable';
import Loading from '../../../Loading';
import axios from 'axios';
import {getImageUrl} from 'educoder';
import { TPMIndexHOC } from '../../tpm/TPMIndexHOC';
import { CNotificationHOC } from '../../courses/common/CNotificationHOC';
import GotoQQgroup from '../../../modal/GotoQQgroup';
import "./usersInfo.css"
class publicCreateNew extends Component{
constructor(props){
class publicCreateNew extends Component {
constructor(props) {
super(props);
this.state={
this.state = {
}
}
//头部获取是否已经登录了
getUser=(url,name)=> {
if (this.props.user&&this.props.user.email===undefined||this.props.user&&this.props.user.email===null||this.props.user&&this.props.user.email==="") {
getUser = (url, name) => {
if (this.props.user && this.props.user.email === undefined || this.props.user && this.props.user.email === null || this.props.user && this.props.user.email === "") {
this.props.showNotification("请先绑定邮箱,谢谢");
return
}
if(name==="新建实训"){
if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){
if (name === "新建实训") {
if (this.props && this.props.current_user && this.props.current_user.is_shixun_marker === false) {
this.props.setgoshowqqgtounp(true);
return;
}
}
if(url !== undefined || url!==""){
if (url !== undefined || url !== "") {
window.location.href = url;
}
}
getUsers=(url,name)=> {
getUsers = (url, name) => {
if(name==="新建实训"){
if(this.props&&this.props.current_user&&this.props.current_user.is_shixun_marker===false){
if (name === "新建实训") {
if (this.props && this.props.current_user && this.props.current_user.is_shixun_marker === false) {
this.props.setgoshowqqgtounp(true);
return;
}
}
if(url !== undefined || url!==""){
if (url !== undefined || url !== "") {
window.location.href = url;
}
}
@ -54,18 +44,18 @@ class publicCreateNew extends Component{
render() {
let {href,name,index}=this.props;
let { href, name, index } = this.props;
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">
{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="leftten"></div>
<div className="topten"></div>
</div>
</a>: <a onClick={()=>this.getUsers(href,name)}>
</a> : <a onClick={() => this.getUsers(href, name)}>
<div className="substancenenew">
<div className="leftten"></div>
<div className="topten"></div>

@ -1,14 +1,12 @@
import React, { useState, useEffect, useContext, useRef, memo } from 'react';
import {Link} from 'react-router-dom';
import {Pagination, Input, Button} from 'antd'
import { getUrl2, isDev, ThemeContext, ActionBtn, NoneData } from 'educoder'
import { Pagination, Input, Button } from 'antd'
import { ThemeContext, ActionBtn, NoneData } from 'educoder'
import axios from 'axios'
import VideoInReviewItem from './VideoInReviewItem'
import EditVideoModal from './EditVideoModal'
import './InfosVideo.css'
import InfoTab from '../common/InfoTab'
import HeadlessModal from '../common/HeadlessModal'
import CRoundSelect from '../common/CRoundSelect'
import ClipboardJS from 'clipboard'
@ -45,11 +43,11 @@ const DEFAULT_VIDEO_WIDTH_IN_MD = "90%" // 400
const DEFAULT_VIDEO_HEIGHT_IN_MD = "55%" // 400
let videoId = {};
let _clipboard = null;
const _items=[
{key: 'published_at-desc', name: '最新上传'},
{key: 'published_at-asc', name: '最早上传'},
const _items = [
{ key: 'published_at-desc', name: '最新上传' },
{ key: 'published_at-asc', name: '最早上传' },
]
function InfoVideo (props) {
function InfoVideo(props) {
const [videos, setvideos] = useState(undefined)
const [reviewvideos, setReviewvideos] = useState(undefined)
const [count, setCount] = useState(0)
@ -140,7 +138,7 @@ function InfoVideo (props) {
} else {
fetchReviewvideos()
}
}, [ pageObj.current, sortKey ])
}, [pageObj.current, sortKey])
useEffect(() => {
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>`
}
@ -329,7 +327,7 @@ function InfoVideo (props) {
}}>
<span>
<span style={{color: theme.foreground_orange1}}> {count} </span>
<span style={{ color: theme.foreground_orange1 }}> {count} </span>
个视频
</span>
@ -340,7 +338,7 @@ function InfoVideo (props) {
{/*sortKey={sortKey }*/}
{/*></CRoundSelect>}*/}
{categoryObj.category == 'all' &&<div className="fr">
{categoryObj.category == 'all' && <div className="fr">
<li className="drop_down">
<span className="color-grey-9 font-12" style={{
marginRight: " 5px",
@ -407,7 +405,7 @@ function InfoVideo (props) {
>
</VideoInReviewItem>)
})
: <NoneData style={{width: '100%'}}></NoneData>
: <NoneData style={{ width: '100%' }}></NoneData>
}
</div>
:
@ -425,7 +423,7 @@ function InfoVideo (props) {
>
</VideoInReviewItem>)
})
: <NoneData style={{width: '100%'}}></NoneData>
: <NoneData style={{ width: '100%' }}></NoneData>
}
</div>
}

@ -1,122 +1,122 @@
import React,{ Component } from "react";
import {Checkbox,Input,Table, Pagination,Menu,Icon} from "antd";
import {TPMIndexHOC} from "../modules/tpm/TPMIndexHOC";
import {Link,NavLink} from 'react-router-dom';
import { WordsBtn ,ActionBtn,SnackbarHOC,markdownToHTML,getImageUrl} from 'educoder';
import React, { Component } from "react";
import { Input, Pagination, Menu, Icon } from "antd";
import TPMIndexHOC from "../modules/tpm/TPMIndexHOC";
import { SnackbarHOC, getImageUrl } from 'educoder';
import axios from 'axios';
import './searchc.css'
const Search = Input.Search;
class SearchPage extends Component{
class SearchPage extends Component {
constructor(props) {
super(props);
this.state={
tab:"1",
count:0,
keywords:undefined,
type:"subject",
page:1,
perpages:20,
data:[],
jupyterbool:false,
this.state = {
tab: "1",
count: 0,
keywords: undefined,
type: "subject",
page: 1,
perpages: 20,
data: [],
jupyterbool: false,
}
}
//切换tab
changeTab=(e)=>{
changeTab = (e) => {
// course 2 课堂, shixun 0 实训项目 subject 1 实践课程 memo 3交流问答
let types ="";
if(parseInt(e.key)===0){
types="shixun";
let types = "";
if (parseInt(e.key) === 0) {
types = "shixun";
}
if(parseInt(e.key)===1){
types="subject";
if (parseInt(e.key) === 1) {
types = "subject";
}
if(parseInt(e.key)===2){
types="course";
if (parseInt(e.key) === 2) {
types = "course";
}
if(parseInt(e.key)===3){
types="memo";
if (parseInt(e.key) === 3) {
types = "memo";
}
this.setState({
tab:e.key,
type:types,
page:1,
tab: e.key,
type: types,
page: 1,
})
this.getdata(1,types,this.state.keywords);
this.getdata(1, types, this.state.keywords);
}
componentDidMount(){
let courstype=decodeURI(decodeURI(this.props.location.search));
componentDidMount() {
let courstype = decodeURI(decodeURI(this.props.location.search));
courstype = courstype.split('?value=');
this.setState({
keywords:courstype[1]
keywords: courstype[1]
})
this.getdata(this.state.page,this.state.type,courstype[1]);
this.getdata(this.state.page, this.state.type, courstype[1]);
}
componentDidUpdate(prevProps) {
if(prevProps.location.search!=this.props.location.search){
let courstype=decodeURI(decodeURI(this.props.location.search));
if (prevProps.location.search != this.props.location.search) {
let courstype = decodeURI(decodeURI(this.props.location.search));
courstype = courstype.split('?value=');
this.setState({
keywords:courstype[1]
keywords: courstype[1]
})
this.getdata(this.state.page,this.state.type,courstype[1]);
this.getdata(this.state.page, this.state.type, courstype[1]);
}
}
setdatafunsval=(e)=>{
setdatafunsval = (e) => {
this.setState({
keywords:e.target.value
keywords: e.target.value
})
}
setdatafuns =(value)=>{
setdatafuns = (value) => {
this.setState({
keywords:value,
page:1
keywords: value,
page: 1
})
this.props.history.replace(`/search?value=${value}`)
this.getdata(1,this.state.type,value);
this.getdata(1, this.state.type, value);
}
paginationonChanges = (pageNumber) => {
this.setState({
page: pageNumber,
loadingstate: true,
})
this.getdata(pageNumber,this.state.type,this.state.keywords);
this.getdata(pageNumber, this.state.type, this.state.keywords);
}
//获取数据
getdata=(pages,type,keywords)=>{
getdata = (pages, type, keywords) => {
let url = "/search.json";
this.setState({ loading: true })
axios.get(url,{params:{
keyword:keywords,
type:type,
page:pages,
per_page:this.state.perpages,
axios.get(url, {
params: {
keyword: keywords,
type: type,
page: pages,
per_page: this.state.perpages,
}
}).then((response) => {
this.setState({ loading: false })
if(response === undefined){
if (response === undefined) {
return
}
this.setState({
count:response.data.count,
data:response.data.results,
count: response.data.count,
data: response.data.results,
})
}).catch((error) => {
@ -124,11 +124,11 @@ class SearchPage extends Component{
});
}
render(){
let {tab,count,data,page,perpages, type }=this.state;
render() {
let { tab, count, data, page, perpages, type } = this.state;
return(
return (
<div className="newMain clearfix">
<style>{`
.ziticor.iconfont {
@ -142,14 +142,14 @@ class SearchPage extends Component{
`}</style>
<div className="shixunDetail_top shixundetailtopcss" >
{/*<div style={{height:"53px"}}></div>*/}
<div className="intermediatecenter" style={{ width: "100%"}}>
<div className="intermediatecenter" style={{ width: "100%" }}>
<Search
style={{ width: "800px", marginTop:"53px"}}
style={{ width: "800px", marginTop: "53px" }}
className="packinput"
value={this.state.keywords}
enterButton={<span><Icon type="search" className="mr5"/> 搜索</span>}
onInput={(e)=>this.setdatafunsval(e)}
onSearch={ (value)=>this.setdatafuns(value)} />
enterButton={<span><Icon type="search" className="mr5" /> 搜索</span>}
onInput={(e) => this.setdatafunsval(e)}
onSearch={(value) => this.setdatafuns(value)} />
</div>
</div>
@ -170,7 +170,7 @@ class SearchPage extends Component{
<div id="forum_list" className="forum_table">
<div className="mh650 bjyss">
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")} />
<p className="edu-nodata-p mb30">暂时还没有相关数据哦</p>
</div>
</div>
@ -202,28 +202,28 @@ class SearchPage extends Component{
return (
<a key={key}
href={
item.type==="shixun"?`/shixuns/${item.identifier}/challenges`:item.type==="course"?`${item.first_category_url}`:item.type==="subject"?`/paths/${item.id}`:item.type==="memo"?`/forums/${item.id}`:""
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"
>
<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"}
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>
@ -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 (
<span className={"markdown-body magr11 fontextcolor"}
dangerouslySetInnerHTML={{__html: item4}} />
dangerouslySetInnerHTML={{ __html: item4 }} />
)
})
}
@ -244,10 +244,10 @@ class SearchPage extends Component{
<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 (
<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 (
<div className={"df"}>
<span style={{flex: '0 0 82px'}}>关卡名称</span>
<span style={{ flex: '0 0 82px' }}>关卡名称</span>
<span className={""}
dangerouslySetInnerHTML={{__html: item5}} />
dangerouslySetInnerHTML={{ __html: item5 }} />
</div>
)
})
@ -273,14 +273,14 @@ class SearchPage extends Component{
<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 (
<div className={"df"}>
<span style={{flex: '0 0 82px'}}>关卡标签</span>
<span className={key6>1?" tzbq ":" tzbqx"} style={{
width:"100%"
<span style={{ flex: '0 0 82px' }}>关卡标签</span>
<span className={key6 > 1 ? " tzbq " : " tzbqx"} style={{
width: "100%"
}}
dangerouslySetInnerHTML={{__html:item6}} />
dangerouslySetInnerHTML={{ __html: item6 }} />
</div>
)
})
@ -288,12 +288,12 @@ class SearchPage extends Component{
</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 (
<div className={"df"}>
<span style={{flex: '0 0 82px'}}>合作团队</span>
<span className={key7>1?" tzbq ":" tzbqx"}
dangerouslySetInnerHTML={{__html:item7}} />
<span style={{ flex: '0 0 82px' }}>合作团队</span>
<span className={key7 > 1 ? " tzbq " : " tzbqx"}
dangerouslySetInnerHTML={{ __html: item7 }} />
</div>
)
})
@ -329,7 +329,7 @@ class SearchPage extends Component{
<span>任务:
<span className="ml10 ziticor">{item.challenges_count}</span>
</span>
</span> }
</span>}
{!!item.study_count && <span className="ml20 ziticor">
{/* <i className="iconfont icon-chengyuan ziticor"></i> */}
<span>学习人数:
@ -360,7 +360,7 @@ class SearchPage extends Component{
{!!item.all_replies_count && <span className="ml20 ziticor">
{/* <i className="iconfont icon-huifu1 ziticor"></i> */}
<span>回复数:<span className="ml10 ziticor">{item.all_replies_count}</span></span>
</span> }
</span>}
{/* <span className="ml20 ziticor">
<i className="iconfont icon-chengyuan ziticor"></i>
@ -389,8 +389,8 @@ class SearchPage extends Component{
{
count && count && count> perpages ?
<div className="edu-txt-center" style={{marginBottom:"30px",paddingBottom:"30px"}}>
count && count && count > perpages ?
<div className="edu-txt-center" style={{ marginBottom: "30px", paddingBottom: "30px" }}>
<Pagination showQuickJumper current={page}
onChange={this.paginationonChanges} pageSize={perpages}
total={count}></Pagination>
@ -404,4 +404,4 @@ class SearchPage extends Component{
}
}
export default SnackbarHOC() (TPMIndexHOC ( SearchPage ));
export default SnackbarHOC()(TPMIndexHOC(SearchPage));

Loading…
Cancel
Save