dev_newshixunModel
杨树林 5 years ago
parent bbf04f17f2
commit 56665203d5

@ -21,16 +21,16 @@ let hashTimeout
// TODO 开发期多个身份切换
let debugType =""
if (isDev) {
const _search = window.location.search;
let parsed = {};
if (_search) {
parsed = queryString.parse(_search);
}
debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
window.location.search.indexOf('debug=s') != -1 ? 'student' :
window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin'
}
// if (isDev) {
// const _search = window.location.search;
// let parsed = {};
// if (_search) {
// parsed = queryString.parse(_search);
// }
// debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
// window.location.search.indexOf('debug=s') != -1 ? 'student' :
// window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin'
// }
window._debugType = debugType;
export function initAxiosInterceptors(props) {
@ -44,7 +44,7 @@ export function initAxiosInterceptors(props) {
// proxy = "https://testeduplus2.educoder.net"
//proxy="http://47.96.87.25:48080"
proxy="https://pre-newweb.educoder.net"
proxy="https://test-newweb.educoder.net"
// proxy="https://test-newweb.educoder.net"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求
// 如果需要支持重复的请求考虑config里面自定义一个allowRepeat参考来控制

@ -7,22 +7,41 @@ import CoursesListType from '../coursesPublic/CoursesListType'
import { WordsBtn } from 'educoder'
import AccessoryModal2 from '../coursesPublic/AccessoryModal2'
import AccessoryModal from '../coursesPublic/AccessoryModal'
import LoginDialog from '../../login/LoginDialog';
import axios from 'axios'
class CommonWorkItem extends Component{
constructor(props){
super(props);
this.state = {
aModalVisible: false
aModalVisible: false,
isRender:false,
}
}
onItemClick = (item) => {
// console.log("onItemClick");
// console.log(this.props);
try {
if(this.props.current_user.username==="游客"){
this.setState({
isRender:true,
match:"",
});
return
}
}catch (e) {
}
const isStudent = this.props.isStudent()
if (isStudent) {
this.props.toWorkQuestionPage(this.props.match.params, item.homework_id)
} else {
this.props.toWorkListPage(this.props.match.params, item.homework_id)
}
}
};
Modifyloginvalue=()=>{
this.setState({
isRender:false,
})
};
sendMoreAttachment = (item) => {
this.handleItem = item;
const url = `/student_works/${item.work_id}/supply_attachments.json`
@ -104,7 +123,7 @@ class CommonWorkItem extends Component{
render(){
let { mainList,workType }=this.props;
const { aModalVisible, fileList, revise_reason } = this.state
const { aModalVisible, fileList, revise_reason,isRender } = this.state
let coursesId = this.props.match.params.coursesId;
const isStudent = this.props.isStudent()
@ -119,6 +138,11 @@ class CommonWorkItem extends Component{
fileList={fileList}
description={revise_reason}
></AccessoryModal2> */}
{isRender===true?<LoginDialog
Modifyloginvalue={()=>this.Modifyloginvalue()}
{...this.props}
{...this.state}
/>:""}
<style>
{
`
@ -128,6 +152,9 @@ class CommonWorkItem extends Component{
text-overflow: ellipsis;
white-space: nowrap;
}
.commonworkitemA{
}
`
}
</style>
@ -144,6 +171,14 @@ class CommonWorkItem extends Component{
}
<div className="flex1" onClick={() => this.props.onItemClick(Object.assign({}, item, {id: item.homework_id})) }>
<p className="clearfix mb20">
<style>
{
`
.commonworkitemA{
}
`
}
</style>
<a title={item.name}
className="fl font-16 font-bd mt2 comnonwidth580" style={{cursor: canNotLink ? 'default' : 'poninter'}}
onClick={ canNotLink ? () => {} : () => this.onItemClick(item)}

@ -7,14 +7,15 @@ import axios from 'axios';
import Modals from '../../../modals/Modals';
import Associationmodel from '../../coursesPublic/Associationmodel';
import AccessoryModal from "../../coursesPublic/AccessoryModal";
import LoginDialog from "../../../login/LoginDialog";
class GraduateTaskItem extends Component{
constructor(props){
super(props);
this.state = {
modalname:"关联项目",
visible:false
visible:false,
isRender:false,
}
}
@ -32,6 +33,11 @@ class GraduateTaskItem extends Component{
// isrelate:is_relate
// })
}
Modifyloginvalue=()=>{
this.setState({
isRender:false,
})
};
cannelAssociation=()=>{
@ -132,7 +138,24 @@ class GraduateTaskItem extends Component{
setupdate=()=>{
this.props.funlist
}
};
showfiles =(url)=>{
// console.log("ShixunhomeWorkItemshowfiles");
// console.log( this.props.current_user.username);
try {
if(this.props.current_user.username==="游客"){
this.setState({
isRender:true,
match:"",
});
return
}
}catch (e) {
}
this.props.history.push(url);
// this.props.current_user
};
render(){
let {
Modalstype,
@ -142,7 +165,8 @@ class GraduateTaskItem extends Component{
cardsModalsavetype,
loadtype,
modalname,
visible
visible,
isRender
} = this.state;
const { checkBox,
@ -165,7 +189,11 @@ class GraduateTaskItem extends Component{
modalSave={cardsModalsavetype}
loadtype={loadtype}
/>
{isRender===true?<LoginDialog
Modifyloginvalue={()=>this.Modifyloginvalue()}
{...this.props}
{...this.state}
/>:""}
{visible===true?<Associationmodel
modalname={modalname}
visible={visible}
@ -218,13 +246,13 @@ class GraduateTaskItem extends Component{
{
this.props.isAdmin?<Link
to={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list"}
onClick={()=>this.showfiles("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list")}
title={discussMessage.name}
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
}
{
this.props.isStudent? <Link
to={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list"}
onClick={()=>this.showfiles("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/detail/"+taskid+"/list")}
title={discussMessage.name}
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
}
@ -232,8 +260,7 @@ class GraduateTaskItem extends Component{
{
this.props.isNotMember===true?this.props.discussMessage.private_icon===true?
<span className=" fl mt3 font-16 font-bd color-dark maxwidth580" title={discussMessage.name}>{discussMessage.name}</span>
:<a
href={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list"}
:<a onClick={()=>this.showfiles("/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list")}
title={discussMessage.name}
className=" fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
}

@ -744,6 +744,8 @@ class GraduationTasks extends Component{
<div className="mt20 edu-back-white pt10 pl30 pr30" key={index}>
<div className="clearfix">
<GraduateTaskItem
{...this.state}
{...this.props}
discussMessage={item}
isAdmin={this.props.isAdmin()}
isStudent={this.props.isStudent()}

@ -4,26 +4,50 @@ import CoursesListType from '../../coursesPublic/CoursesListType';
import { WordsBtn } from 'educoder'
import {Tooltip} from 'antd'
import axios from 'axios'
import LoginDialog from "../../../login/LoginDialog";
const map={0:"待选中",1:"待确认",2:"已确认"}
class GraduateTopicItem extends Component{
constructor(props){
super(props);
this.state = {
isRender:false,
}
}
editTopic=(topicId)=>{
editTopic=(topicId)=>{
let courseId=this.props.match.params.coursesId;
this.props.history.push(`/courses/${courseId}/graduation_topics/${topicId}/edit`);
}
toDetailPage=(topicId)=>{
// console.log("toDetailPage");
// console.log(this.props);
try {
if(this.props.current_user.username==="游客"){
this.setState({
isRender:true,
match:"",
});
return
}
}catch (e) {
}
let courseId=this.props.match.params.coursesId;
this.props.history.push(`/courses/${courseId}/graduation_topics/${topicId}/detail`);
}
};
Modifyloginvalue=()=>{
this.setState({
isRender:false,
})
};
render(){
const { checkBox, discussMessage, index,chooseTopic,
data,
courseId
} = this.props;
const {
isRender
}=this.state;
const isAdmin = this.props.isAdmin();
const isStudent=this.props.isStudent();
const isNotMember=this.props.isNotMember();
@ -32,6 +56,11 @@ class GraduateTopicItem extends Component{
}
return(
<div>
{isRender===true?<LoginDialog
Modifyloginvalue={()=>this.Modifyloginvalue()}
{...this.props}
{...this.state}
/>:""}
<style>
{
`
@ -67,7 +96,7 @@ class GraduateTopicItem extends Component{
text-overflow:ellipsis;
white-space:nowrap
}
.GraduateTopicItemA{
.GraduateTopicItemA {
}
`}</style>
<h6>

Loading…
Cancel
Save