dev_forum
杨树明 5 years ago
parent 1aec807d6b
commit 5bfb41ad37

@ -408,7 +408,7 @@ class Coursesleftnav extends Component{
this.setState({
Navmodalname:id===2?"新建分班":"添加目录",
Navtitles:id===2?"分班名称":"目录名称",
Navplaceholder:id===2?"示例分班最佳4个字符":"示例第一阶段最佳4个字符",
Navplaceholder:"请输入名称最大限制60个字符",
Navmodalnametype:true,
Navmodaltypename:id,
setnavid:setnavid,
@ -419,7 +419,7 @@ class Coursesleftnav extends Component{
this.setState({
Navmodalname:id===5?"分班重命名":"目录重命名",
Navtitles:id===5?"分班名称":"目录名称",
Navplaceholder:id===5?"示例分班最佳4个字符":"示例第一阶段最佳4个字符",
Navplaceholder:"请输入名称最大限制60个字符",
Navmodalnametype:true,
Navmodaltypename:id,
setnavid:setnavid,

@ -1,74 +1,74 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Input,Select} from "antd";
const Option = Select.Option;
class AddcoursesNav extends Component{
constructor(props){
super(props);
this.state={
StudentList_value:""
}
}
render(){
// let {StudentList_value}=this.state;
// let {child}=this.props;
//
return(
<div>
<Modal
title={this.props.addname}
visible={this.props.addnametype}
keyboard={false}
className={"Navmodal"}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
width={"600px"}
>
{this.props.addnametab===2?
<div>
<div className={"fl mt5"}>目录名称</div>
<Input placeholder="示例:第一阶段"
className={"inputNav greyInput fl mb40"}
maxLength="60"
style={{width:'450px'}}
// value={NavmodalValue}
// onInput={this.setNavmodalValue}
/>
<div className="clearfix mt70 edu-txt-center">
<a className="task-btn mr30" onClick={this.props.addcanner}>取消</a>
<a className="task-btn task-btn-orange" onClick={this.props.addsave}>确定</a>
</div>
</div>
: this.props.addnametab===4?
<div>
<div className={"fl mt5"}>选择目录名称</div>
<Select placeholder="请选择目录" className={"inputNav greyInput fl mb40"} style={{width:'420px'}} >
<Option value="jack">一级</Option>
<Option value="lucy">一级</Option>
<Option value="disabled">一级</Option>
<Option value="Yiminghe">一级</Option>
</Select>
<div className="clearfix mt70 edu-txt-center">
<a className="task-btn mr30" onClick={this.props.addcanner}>取消</a>
<a className="task-btn task-btn-orange" onClick={this.props.addsave}>确定</a>
</div>
</div>
:""}
</Modal>
</div>
)
}
}
export default AddcoursesNav;
import React,{ Component } from "react";
import { Modal,Checkbox,Input,Select} from "antd";
const Option = Select.Option;
class AddcoursesNav extends Component{
constructor(props){
super(props);
this.state={
StudentList_value:""
}
}
render(){
// let {StudentList_value}=this.state;
// let {child}=this.props;
//
return(
<div>
<Modal
title={this.props.addname}
visible={this.props.addnametype}
keyboard={false}
className={"Navmodal"}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
width={"600px"}
>
{this.props.addnametab===2?
<div>
<div className={"fl mt5"}>目录名称</div>
<Input placeholder="请输入名称最大限制60个字符"
className={"inputNav greyInput fl mb40"}
maxLength="60"
style={{width:'450px'}}
// value={NavmodalValue}
// onInput={this.setNavmodalValue}
/>
<div className="clearfix mt70 edu-txt-center">
<a className="task-btn mr30" onClick={this.props.addcanner}>取消</a>
<a className="task-btn task-btn-orange" onClick={this.props.addsave}>确定</a>
</div>
</div>
: this.props.addnametab===4?
<div>
<div className={"fl mt5"}>选择目录名称</div>
<Select placeholder="请选择目录" className={"inputNav greyInput fl mb40"} style={{width:'420px'}} >
<Option value="jack">一级</Option>
<Option value="lucy">一级</Option>
<Option value="disabled">一级</Option>
<Option value="Yiminghe">一级</Option>
</Select>
<div className="clearfix mt70 edu-txt-center">
<a className="task-btn mr30" onClick={this.props.addcanner}>取消</a>
<a className="task-btn task-btn-orange" onClick={this.props.addsave}>确定</a>
</div>
</div>
:""}
</Modal>
</div>
)
}
}
export default AddcoursesNav;

@ -1,63 +1,63 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Upload,Button,Icon,message,Input} from "antd";
import axios from 'axios';
class ModalsRename extends Component{
constructor(props){
super(props);
this.state={
name:this.props.NavmodalValue
}
}
saveNavmoda=()=>{
let{url}=this.props;
let{name}=this.state;
axios.post(url, {name:name}).then((result) => {
if(result.data.status===0){
this.props.showNotification(result.data.message);
this.props.cannerNavmoda();
this.props.coursupdata();
}}
)
}
setNavmodalValue=(e)=>{
console.log(e.target.value)
this.setState({
name:e.target.value
})
}
render(){
return(
<div>
<Modal
keyboard={false}
title={this.props.Navmodalname}
visible={this.props.Navmodalnametype===undefined?false:this.props.Navmodalnametype}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
className={"Navmodal"}
>
<div className={"fl mt5"}>{this.props.Navname}名称</div>
<Input placeholder={"示例:第一阶段"}
className={"inputNav greyInput fl"}
maxLength="60"
style={{width:'450px'}}
value={this.state.name}
onInput={this.setNavmodalValue}
/>
<div className="clearfix mt70 edu-txt-center">
<a className="task-btn mr30" onClick={()=>this.props.cannerNavmoda()}>取消</a>
<a className="task-btn task-btn-orange" onClick={()=>this.saveNavmoda()}>确定</a>
</div>
</Modal>
</div>
)
}
}
import React,{ Component } from "react";
import { Modal,Checkbox,Upload,Button,Icon,message,Input} from "antd";
import axios from 'axios';
class ModalsRename extends Component{
constructor(props){
super(props);
this.state={
name:this.props.NavmodalValue
}
}
saveNavmoda=()=>{
let{url}=this.props;
let{name}=this.state;
axios.post(url, {name:name}).then((result) => {
if(result.data.status===0){
this.props.showNotification(result.data.message);
this.props.cannerNavmoda();
this.props.coursupdata();
}}
)
}
setNavmodalValue=(e)=>{
console.log(e.target.value)
this.setState({
name:e.target.value
})
}
render(){
return(
<div>
<Modal
keyboard={false}
title={this.props.Navmodalname}
visible={this.props.Navmodalnametype===undefined?false:this.props.Navmodalnametype}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
className={"Navmodal"}
>
<div className={"fl mt5"}>{this.props.Navname}名称</div>
<Input placeholder={"请输入名称最大限制60个字符"}
className={"inputNav greyInput fl"}
maxLength="60"
style={{width:'450px'}}
value={this.state.name}
onInput={this.setNavmodalValue}
/>
<div className="clearfix mt70 edu-txt-center">
<a className="task-btn mr30" onClick={()=>this.props.cannerNavmoda()}>取消</a>
<a className="task-btn task-btn-orange" onClick={()=>this.saveNavmoda()}>确定</a>
</div>
</Modal>
</div>
)
}
}
export default ModalsRename;

@ -1,52 +1,58 @@
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import Loadable from 'react-loadable';
import Loading from '../../Loading';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
const PathsDetail = Loadable({
loader: () => import('./PathDetail/PathDetailIndex'),
loading:Loading,
})
const PathsNew = Loadable({
loader: () => import('./PathNew'),
loading:Loading,
})
const Statistics = Loadable({
loader: () => import('./SchoolStatistics/Statistics'),
loading:Loading
})
const ShixunPaths = Loadable({
loader: () => import('./ShixunPaths'),
loading:Loading,
})
class Index extends Component{
constructor(props) {
super(props)
}
render() {
return (
<div>
<Switch {...this.props}>
<Route path="/paths/:pathId/statistics" component = {Statistics} {...this.props} {...this.state}></Route>
<Route path="/paths/new" exact
render={(props)=>(<PathsNew {...this.props} {...this.state} {...props}/>)}
></Route>
<Route path="/paths/:pathId/edit" exact
render={(props)=>(<PathsNew {...this.props} {...this.state} {...props}/>)}
></Route>
<Route path="/paths/:pathId" exact component = {PathsDetail} {...this.props} {...this.state}></Route>
<Route exact path="/paths" exact component={ShixunPaths} {...this.props} {...this.state}></Route>
</Switch>
</div>
)
}
}
import React, { Component } from 'react';
import { SnackbarHOC } from 'educoder';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import Loadable from 'react-loadable';
import Loading from '../../Loading';
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
const PathsDetail = Loadable({
loader: () => import('./PathDetail/PathDetailIndex'),
loading:Loading,
})
const PathsNew = Loadable({
loader: () => import('./PathNew'),
loading:Loading,
})
const Statistics = Loadable({
loader: () => import('./SchoolStatistics/Statistics'),
loading:Loading
})
const ShixunPaths = Loadable({
loader: () => import('./ShixunPaths'),
loading:Loading,
})
class Index extends Component{
constructor(props) {
super(props)
}
render() {
return (
<div>
<Switch {...this.props}>
<Route path="/paths/:pathId/statistics" component = {Statistics} {...this.props} {...this.state}></Route>
<Route path="/paths/new" exact
render={(props)=>(<PathsNew {...this.props} {...this.state} {...props}/>)}
></Route>
<Route path="/paths/:pathId/edit" exact
render={(props)=>(<PathsNew {...this.props} {...this.state} {...props}/>)}
></Route>
<Route path="/paths/:pathId" exact
render={(props)=>(<PathsDetail {...this.props} {...this.state} {...props}/>)}
></Route>
{/*<Route path="/paths/:pathId" exact component = {PathsDetail} {...this.props} {...this.state}></Route>*/}
<Route exact path="/paths" exact component={ShixunPaths} {...this.props} {...this.state}></Route>
</Switch>
</div>
)
}
}
export default SnackbarHOC() ( TPMIndexHOC(Index) );

@ -314,6 +314,7 @@ class DetailCards extends Component{
showparagraphindex
}=this.state;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return(
<div>
<Modals
@ -363,6 +364,19 @@ class DetailCards extends Component{
</div>
</Spin>
</Modal>
<style>
{
`
.lessonvalue{
max-width: 556px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: inline-block;
}
`
}
</style>
<div className="lesson-saved-list">
{
pathCardsList && pathCardsList.map((item,key)=>{
@ -374,7 +388,7 @@ class DetailCards extends Component{
<a className="fl ring-blue mr10 mt2">
<img src={getImageUrl("images/educoder/icon/charpter-white.svg")} className="fl ml3 mt3"/>
</a>
<span className="font-18 font-bd">{item.stage_name}</span>
<span className="font-18 font-bd lessonvalue" title={item.stage_name}>{item.stage_name}</span>
{
idsum===key&&pathCardsedittype===true?'':
@ -442,13 +456,13 @@ class DetailCards extends Component{
:<i className="iconfont icon-bofang progressRing-part font-18 mt10"></i>
}
</span>
<span className={line.shixun_status==="暂未公开"?"paragraph_name color204":"paragraph_name color-grey3"}>
<span className={this.props.current_user&&this.props.current_user.admin===false&&line.shixun_status==="暂未公开"?"paragraph_name color204":"paragraph_name color-grey3"}>
<span className="subject_stage_shixun_index">{key+1}</span>-{index+1}&nbsp;&nbsp;{line.shixun_name}
</span>
</li>
{
line.shixun_status==="暂未公开"?
this.props.current_user&&this.props.current_user.admin===false&&line.shixun_status==="暂未公开"?
<li className="fr status_li"><span className="fr color204">暂未公开</span></li>
:
<li className={showparagraph===false?"none":"fr status_li"}>

@ -402,7 +402,7 @@ class DetailCardsEditAndAdd extends Component{
<div className="df mb30">
<span className="mr30 color-orange pt10">*</span>
<div className="flex1 mr20">
<input maxLength="60" type="text" style={{width:'670px'}} className={stage_nametype===false?"input-100-45 greyInput":"input-100-45 greyInput bor-red"} name="stage_name" value={stage_names} onInput={this.updatastage_names} placeholder={"请输入第"+this.props.sum+"阶段名称"}/>
<input maxLength="60" type="text" style={{width:'670px'}} className={stage_nametype===false?"input-100-45 greyInput":"input-100-45 greyInput bor-red"} name="stage_name" value={stage_names} onInput={this.updatastage_names} placeholder={"请输入第"+this.props.sum+"阶段名称,最大限制60个字符"}/>
<div className={stage_nametype===true?"red":'none'}>名称不能为空</div>
</div>
<div style={{"width":"60px"}}><span className="color-orange fl mt8 none" id="stage_name_notice"><i className="iconfont icon-tishi font-14 mr3"></i></span></div>

@ -435,7 +435,7 @@ class DetailCardsEditAndEdit extends Component{
<div className="df mb30">
<span className="mr30 color-orange pt10">*</span>
<div className="flex1 mr20">
<input type="text" style={{width: '670px'}} className={stage_nametype===false?"input-100-45 greyInput":"input-100-45 greyInput bor-red"} name="stage_name" value={stage_name} onInput={this.updatastage_name} placeholder={"请输入第"+(this.props.keys+1)+"阶段名称"}/>
<input maxLength="60" type="text" style={{width: '670px'}} className={stage_nametype===false?"input-100-45 greyInput":"input-100-45 greyInput bor-red"} name="stage_name" value={stage_name} onInput={this.updatastage_name} placeholder={"请输入第"+(this.props.keys+1)+"阶段名称,最大限制60个字符"}/>
<div className={stage_nametype===true?"red":'none'}>名称不能为空</div>
</div>
<div style={{"width":"60px"}}><span className="color-orange fl mt8 none" id="stage_name_notice"><i className="iconfont icon-tishi font-14 mr3"></i></span></div>

@ -140,10 +140,13 @@ class PathDetailIndex extends Component{
let url="/paths/"+pathid+".json";
axios.get(url).then((result)=>{
if (result.data.status === 407 || result.data.status === 401) {
debugger
return;
}
if (result.data.status === 403) {
debugger
window.location.href = "/403";
return;
}
@ -165,9 +168,12 @@ class PathDetailIndex extends Component{
axios.get(url).then((result)=>{
// TODO 403 让后台返回status 403 比较好
if (result.data.status == 407 || result.data.status == 401) {
debugger
return;
}
if (result.data.status === 403 ) {
debugger
window.location.href = "/403";
return;
}

Loading…
Cancel
Save