杨树林 5 years ago
commit 146bbca22e

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

@ -114,21 +114,21 @@ module.exports = {
// First, run the linter.
// It's important to do this before Babel processes the JS.
// 上线然后要注释回来
// {
// test: /\.(js|jsx|mjs)$/,
// enforce: 'pre',
// use: [
// {
// options: {
// formatter: eslintFormatter,
// eslintPath: require.resolve('eslint'),
//
// },
// loader: require.resolve('eslint-loader'),
// },
// ],
// include: paths.appSrc,
// },
{
test: /\.(js|jsx|mjs)$/,
enforce: 'pre',
use: [
{
options: {
formatter: eslintFormatter,
eslintPath: require.resolve('eslint'),
},
loader: require.resolve('eslint-loader'),
},
],
include: paths.appSrc,
},
{
// "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall

@ -263,7 +263,7 @@ class App extends Component {
<Switch>
{/*<Route path="/login" component={LoginRegisterPage}/>*/}
{/*认证*/}
{/*<Route path="/account" component={AccountPage}/>*/}
<Route path="/account" component={AccountPage}/>
{/*403*/}
<Route path="/403" component={Shixunauthority}/>

@ -271,7 +271,7 @@ class Fileslistitem extends Component{
return(
<div className="mr50">
<span className="mr15 color-dark">{item.course_group_name}</span>
<span className="mr15 color-grey9 ">将发布于 { moment(item.course_group_publish_time).format('YYYY-MM-DD hh:mm')}</span>
<span className="mr15 color-grey9 ">将发布于 { moment(item.course_group_publish_time).format('YYYY-MM-DD HH:mm')}</span>
</div>
)
})}
@ -289,7 +289,7 @@ class Fileslistitem extends Component{
{/*{moment(discussMessage.publish_time).fromNow()}*/}
{ discussMessage.publish_time===null?"":
discussMessage.is_publish===true?"":"发布于"}
{ discussMessage.publish_time===null?"":discussMessage.is_publish===true?moment(discussMessage.publish_time).fromNow():moment(discussMessage.publish_time).format('YYYY-MM-DD hh:mm')}
{ discussMessage.publish_time===null?"":discussMessage.is_publish===true?moment(discussMessage.publish_time).fromNow():moment(discussMessage.publish_time).format('YYYY-MM-DD HH:mm')}
</span>
</span>
{this.props.isAdmin ||this.props.current_user.login===discussMessage.author.login?

@ -190,7 +190,7 @@ function buildColumns(that, student_works) {
render: (update_time, record) => (
<span>
<a href="javascript:;" style={{color:'#989898'}}>{update_time ? moment(update_time).format('YYYY-MM-DD hh:mm') : '--'}</a>
<a href="javascript:;" style={{color:'#989898'}}>{update_time ? moment(update_time).format('YYYY-MM-DD HH:mm') : '--'}</a>
</span>
),
}])

@ -205,6 +205,7 @@ class CommonWorkAppraiseReply extends Component{
const isAdmin = this.props.isAdmin()
const isNiPing = homework_status && homework_status.indexOf('匿评中') != -1
const isGroup = this.props.isGroup()
/**
isAdmin || 评阅入口超级管理员老师和助教显示 - 改成admin也不显示
匿评人匿评期间显示
@ -276,6 +277,7 @@ class CommonWorkAppraiseReply extends Component{
showModulationtype={this.showModulationtype}
addSuccess={this.addSuccess} ref={this.editorRef} totalCount={comment_scores.length}
onReply={this.onReply} placeholder={"请在此输入对本作品的评语最大限制2000个字符"}
showSameScore={isGroup}
></GraduationTasksappraiseMainEditor> }
</div>
{/* ${!!comment_scores.length ? 'bor-bottom-greyE' : ''} */}

@ -329,7 +329,7 @@ class CCommentItem extends Component{
<div className="cl"></div>
</div>
</div>}
{!_content && <span className="color656565 mt2 color-grey-9 font-12 mr8">{"暂未写评语"}</span>}
{!_content && <span className="color656565 mt2 color-grey-9 font-12 mr8" style={{ display: 'inline-block'}}>{"暂未写评语"}</span>}
<div className="mt6">
{attachments && attachments.map((attaItem, key)=>{
return(

@ -458,7 +458,7 @@ class CoursesBanner extends Component {
{
`
.teachersbox{
margin-right:28px !important;
margin-right:22px !important;
}
`
}

@ -1,5 +1,5 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Upload,Button,Icon,message} from "antd";
import { Modal,Checkbox,Upload,Button,Icon,message,notification} from "antd";
import { WordsBtn,getUrl, getUploadActionUrl} from 'educoder';
import axios from 'axios';
import Modals from '../../modals/Modals';
@ -110,6 +110,7 @@ class AccessoryModal extends Component{
this.props.Cancel()
}
Saves=()=>{
let id=this.props.categoryid;
let {fileList,description} =this.state;
@ -131,10 +132,12 @@ class AccessoryModal extends Component{
description:description,
attachment_ids:newfileList
}).then((result)=>{
console.log(result)
if(result !== undefined){
this.props.setupdate()
this.props.showNotification('提交成功')
if(result.data.status===0){
debugger
this.props.Cancel()
this.props.setupdate()
// this.setState({
// Modalstype:true,
// Modalstopval:result.data.message,
@ -142,9 +145,16 @@ class AccessoryModal extends Component{
// loadtype:true
// })
this.ModalCancelModalCancel()
notification.open({
message: '提示',
description:
'提交成功'
});
if(this.props.seeworks!=undefined){
this.props.history.push(this.props.seeworks);
}
}
}).catch((error)=>{
@ -170,10 +180,12 @@ class AccessoryModal extends Component{
description:description,
attachment_ids:newfileList
}).then((result)=>{
console.log(result)
if(result.data.status===0){
debugger
this.props.Cancel()
this.props.setupdate()
this.props.showNotification('提交成功')
// this.setState({
// Modalstype:true,
// Modalstopval:result.data.message,
@ -182,9 +194,15 @@ class AccessoryModal extends Component{
// })
this.ModalCancelModalCancel()
notification.open({
message: '提示',
description:
'提交成功'
});
if(this.props.seeworks!=undefined){
this.props.history.push(this.props.seeworks);
}
}
}).catch((error)=>{

@ -1,262 +1,263 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Upload,Button,Icon,message} from "antd";
import { WordsBtn, getUploadActionUrl} from 'educoder';
import axios from 'axios';
import Modals from '../../modals/Modals';
const CheckboxGroup = Checkbox.Group;
class AccessoryModal2 extends Component{
constructor(props){
super(props);
this.state={
group_ids:[],
fileList:[],
Modalstype:false,
Modalstopval:"",
ModalCancel:"",
ModalSave:"",
loadtype:false
}
}
componentDidMount() {
}
//勾选实训
shixunhomeworkedit=(list)=>{
this.setState({
group_ids:list
})
}
// 附件相关 START
handleChange = (info) => {
let fileList = info.fileList;
console.log(fileList)
// for(var list of fileList ){
// console.log(fileList)
// }
this.setState({ fileList });
}
onAttachmentRemove = (file) => {
// confirm({
// title: '确定要删除这个附件吗?',
// okText: '确定',
// cancelText: '取消',
// // content: 'Some descriptions',
// onOk: () => {
// this.deleteAttachment(file)
// },
// onCancel() {
// console.log('Cancel');
// },
// });
// return false;
// this.setState({
// Modalstype:true,
// Modalstopval:'确定要删除这个附件吗?',
// ModalSave: ()=>this.deleteAttachment(file),
// ModalCancel:this.cancelAttachment
// })
// return false;
this.deleteAttachment(file);
}
deleteAttachment = (file) => {
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, {
})
.then((response) => {
if (response.data) {
const { status } = response.data;
if (status == 0) {
console.log('--- success')
this.setState((state) => {
const index = state.fileList.indexOf(file);
const newFileList = state.fileList.slice();
newFileList.splice(index, 1);
return {
fileList: newFileList,
};
});
}
}
})
.catch(function (error) {
console.log(error);
});
}
ModalCancelModalCancel=()=>{
this.setState({
Modalstype:false,
Modalstopval:"",
ModalSave:this.ModalCancelModalCancel,
loadtype:false
})
this.props.Cancel()
}
componentDidUpdate = (prevProps) => {
if (JSON.stringify(prevProps.fileList) != JSON.stringify(this.props.fileList)) {
this.setState({
fileList: this.props.fileList
})
}
if (prevProps.description != this.props.description) {
this.setState({
description: this.props.description
})
}
}
Saves=()=>{
let {fileList,description} =this.state;
let newfileList=[];
for(var list of fileList){
newfileList.push(list.response.id)
}
this.props.Saves && this.props.Saves(newfileList, description)
return;
let id=this.props.categoryid;
console.log(newfileList)
let url="/graduation_works/"+id+"/revise_attachment.json"
axios.post(url,{
description:description,
attachment_ids:newfileList
}).then((result)=>{
console.log(result)
if(result.data.status===0){
this.props.setupdate()
this.setState({
Modalstype:true,
Modalstopval:result.data.message,
ModalSave:this.ModalCancelModalCancel,
loadtype:true
})
}
}).catch((error)=>{
})
}
settextarea=(e)=>{
this.setState({
description:e.target.value
})
}
render(){
let {description,fileList,
Modalstype,
Modalstopval,
ModalCancel,
ModalSave,
loadtype,
}=this.state;
let {course_groups}=this.props;
const uploadProps = {
width: 600,
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false,
action: getUploadActionUrl(),
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
beforeUpload: (file) => {
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
message.error('文件大小必须小于150MB!');
}
return isLt150M;
},
};
return(
<div>
{/*提示*/}
<Modals
modalsType={Modalstype}
modalsTopval={Modalstopval}
modalCancel={ModalCancel}
modalSave={ModalSave}
loadtype= {loadtype}
/>
<Modal
className={"HomeworkModal"}
title={this.props.modalname || "补交附件"}
visible={this.props.visible}
closable={false}
footer={null}
destroyOnClose={true}
keyboard={false}
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16">
<span className={"color-blue underline"}> </span>
</p>
<style>{`
.uploadBtn.ant-btn {
border: none;
color: #4CACFF;
box-shadow: none;
background: transparent;
padding: 0 6px;
}
.ant-upload-list-item:hover .ant-upload-list-item-info{
background-color:#fff;
}
.upload_1 .ant-upload-list {
width: 350px;
}
.ant-upload-select{
float: left;
}
.ant-upload-list :nth-child(1).ant-upload-list-item {
margin-top:31px;
}
`}</style>
<p >
<Upload {...uploadProps} fileList={this.state.fileList} className="upload_1">
<Button className="uploadBtn">
<Icon type="upload" /> 选择文件
</Button>
(单个文件最大150M)
</Upload>
</p>
<textarea placeholder="请在此输入补交附件的原因最大限制100个字符" className={"mt20"} value={description} onInput={this.settextarea} style={{
width: '100%',
height:'150px',
border:'1px solid rgba(234,234,234,1)',
padding: '10px'
}}></textarea>
<div className="clearfix mt30 edu-txt-center mb10">
<a className="task-btn color-white mr70" onClick={this.props.Cancel}>{this.props.Cancelname || '取消'}</a>
<a className="task-btn task-btn-orange" onClick={()=>this.Saves()}>{this.props.Savesname || '确认'}</a>
</div>
</div>
</Modal>
</div>
)
}
}
import React,{ Component } from "react";
import { Modal,Checkbox,Upload,Button,Icon,message} from "antd";
import { WordsBtn, getUploadActionUrl} from 'educoder';
import axios from 'axios';
import Modals from '../../modals/Modals';
const CheckboxGroup = Checkbox.Group;
class AccessoryModal2 extends Component{
constructor(props){
super(props);
this.state={
group_ids:[],
fileList:[],
Modalstype:false,
Modalstopval:"",
ModalCancel:"",
ModalSave:"",
loadtype:false
}
}
componentDidMount() {
}
//勾选实训
shixunhomeworkedit=(list)=>{
this.setState({
group_ids:list
})
}
// 附件相关 START
handleChange = (info) => {
let fileList = info.fileList;
console.log(fileList)
// for(var list of fileList ){
// console.log(fileList)
// }
this.setState({ fileList });
}
onAttachmentRemove = (file) => {
// confirm({
// title: '确定要删除这个附件吗?',
// okText: '确定',
// cancelText: '取消',
// // content: 'Some descriptions',
// onOk: () => {
// this.deleteAttachment(file)
// },
// onCancel() {
// console.log('Cancel');
// },
// });
// return false;
// this.setState({
// Modalstype:true,
// Modalstopval:'确定要删除这个附件吗?',
// ModalSave: ()=>this.deleteAttachment(file),
// ModalCancel:this.cancelAttachment
// })
// return false;
this.deleteAttachment(file);
}
deleteAttachment = (file) => {
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, {
})
.then((response) => {
if (response.data) {
const { status } = response.data;
if (status == 0) {
console.log('--- success')
this.setState((state) => {
const index = state.fileList.indexOf(file);
const newFileList = state.fileList.slice();
newFileList.splice(index, 1);
return {
fileList: newFileList,
};
});
}
}
})
.catch(function (error) {
console.log(error);
});
}
ModalCancelModalCancel=()=>{
this.setState({
Modalstype:false,
Modalstopval:"",
ModalSave:this.ModalCancelModalCancel,
loadtype:false
})
this.props.Cancel()
}
componentDidUpdate = (prevProps) => {
if (JSON.stringify(prevProps.fileList) != JSON.stringify(this.props.fileList)) {
this.setState({
fileList: this.props.fileList
})
}
if (prevProps.description != this.props.description) {
this.setState({
description: this.props.description
})
}
}
Saves=()=>{
debugger
let {fileList,description} =this.state;
let newfileList=[];
for(var list of fileList){
newfileList.push(list.response.id)
}
this.props.Saves && this.props.Saves(newfileList, description)
return;
let id=this.props.categoryid;
console.log(newfileList)
let url="/graduation_works/"+id+"/revise_attachment.json"
axios.post(url,{
description:description,
attachment_ids:newfileList
}).then((result)=>{
console.log(result)
if(result.data.status===0){
this.props.setupdate()
this.setState({
Modalstype:true,
Modalstopval:result.data.message,
ModalSave:this.ModalCancelModalCancel,
loadtype:true
})
}
}).catch((error)=>{
})
}
settextarea=(e)=>{
this.setState({
description:e.target.value
})
}
render(){
let {description,fileList,
Modalstype,
Modalstopval,
ModalCancel,
ModalSave,
loadtype,
}=this.state;
let {course_groups}=this.props;
const uploadProps = {
width: 600,
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
// showUploadList: false,
action: getUploadActionUrl(),
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
beforeUpload: (file) => {
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
message.error('文件大小必须小于150MB!');
}
return isLt150M;
},
};
return(
<div>
{/*提示*/}
<Modals
modalsType={Modalstype}
modalsTopval={Modalstopval}
modalCancel={ModalCancel}
modalSave={ModalSave}
loadtype= {loadtype}
/>
<Modal
className={"HomeworkModal"}
title={this.props.modalname || "补交附件"}
visible={this.props.visible}
closable={false}
footer={null}
destroyOnClose={true}
keyboard={false}
>
<div className="task-popup-content">
<p className="task-popup-text-center font-16">
<span className={"color-blue underline"}> </span>
</p>
<style>{`
.uploadBtn.ant-btn {
border: none;
color: #4CACFF;
box-shadow: none;
background: transparent;
padding: 0 6px;
}
.ant-upload-list-item:hover .ant-upload-list-item-info{
background-color:#fff;
}
.upload_1 .ant-upload-list {
width: 350px;
}
.ant-upload-select{
float: left;
}
.ant-upload-list :nth-child(1).ant-upload-list-item {
margin-top:31px;
}
`}</style>
<p >
<Upload {...uploadProps} fileList={this.state.fileList} className="upload_1">
<Button className="uploadBtn">
<Icon type="upload" /> 选择文件
</Button>
(单个文件最大150M)
</Upload>
</p>
<textarea placeholder="请在此输入补交附件的原因最大限制100个字符" className={"mt20"} value={description} onInput={this.settextarea} style={{
width: '100%',
height:'150px',
border:'1px solid rgba(234,234,234,1)',
padding: '10px'
}}></textarea>
<div className="clearfix mt30 edu-txt-center mb10">
<a className="task-btn color-white mr70" onClick={this.props.Cancel}>{this.props.Cancelname || '取消'}</a>
<a className="task-btn task-btn-orange" onClick={()=>this.Saves()}>{this.props.Savesname || '确认'}</a>
</div>
</div>
</Modal>
</div>
)
}
}
export default AccessoryModal2;

@ -193,9 +193,9 @@ class ExerciseListItem extends Component{
{
IsStudent &&
<div className="homepagePostSetting" style={{"right":"0px","top":"62px","position":"absolute","display":"block"}}>
{item.current_status ===0&&item.exercise_status>1? <li> <Link className="btn colorblue" to={`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`}>继续答题</Link></li>:
item.current_status ===1&&item.exercise_status>1? <li> <Link className="btn colorblue" to={`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`}>查看答题</Link></li>:
item.current_status ===2&&item.exercise_status>1? <li> <a className="btn colorblue ml20" onClick={()=>this.setgameexercise(`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`)}>开始答题</a></li>:""}
{item.current_status ===0&&item.exercise_status>1? <li> <Link className="btn colorblue font-16" to={`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`}>继续答题</Link></li>:
item.current_status ===1&&item.exercise_status>1? <li> <Link className="btn colorblue font-16" to={`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`}>查看答题</Link></li>:
item.current_status ===2&&item.exercise_status>1? <li> <a className="btn colorblue ml20 font-16" onClick={()=>this.setgameexercise(`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`)}>开始答题</a></li>:""}
</div>
}
</div>

@ -690,7 +690,7 @@ class ExerciseReviewAndAnswer extends Component{
}
{
//(老师身份且除实训题外) || (学生身份且试卷已经截止)就显示用户当前题目所得分数
( isAdmin || (isStudent && exercise.exercise_status == 3)) && item.question_type != 5 ?
( isAdmin || (isStudent && exercise.exercise_status == 3)) && item.question_type != 5 && item.user_score ?
<span className="font-16 ml20">
<i className={parseInt(item.answer_status) ==0 ? "iconfont icon-htmal5icon19 color-red font-20 fl":parseInt(item.answer_status) ==1 ? "fl iconfont icon-wancheng font-20 color-green" :"iconfont icon-htmal5icon19 color-orange-tip font-20 fl"}></i>
<span><span className={parseInt(item.answer_status) == 0 ?"color-red":parseInt(item.answer_status) == 1 ?"color-green":"color-orange-tip"}>{item.user_score}</span> </span>

@ -189,8 +189,9 @@ class SingleEditor extends Component{
<div>
<RadioGroup onChange={this.onOptionClick} value={standard_answers[0]}>
<Radio value={true} disabled={exerciseIsPublish}></Radio>
<Radio value={false} disabled={exerciseIsPublish}></Radio>
{/* disabled={exerciseIsPublish} */}
<Radio value={true} ></Radio>
<Radio value={false} ></Radio>
</RadioGroup>
{/* not work */}
{/* <Radio value={standard_answers[0]} onClick={() => this.onOptionClick(0)} disabled={exerciseIsPublish}></Radio>

@ -86,7 +86,7 @@ class NullDisplay extends Component{
padding:12px 10px;
margin-bottom:10px;
border-radius:2px;
max-width: 1024px;
width: 1024px;
word-break: break-all;
}
.answerRow {

@ -165,9 +165,9 @@ class SingleEditor extends Component{
}
onOptionClick = (index) => {
if (this.props.exerciseIsPublish) {
return;
}
// if (this.props.exerciseIsPublish) {
// return;
// }
let standard_answers = this.state.standard_answers.slice(0)
standard_answers[index] = !standard_answers[index]
this.setState({ standard_answers })
@ -247,7 +247,7 @@ class SingleEditor extends Component{
{/* <Tooltip title={standard_answers[index] ? '点击取消标准答案设置' : '点击设置为标准答案'}> */}
<span class={`option-item fr mr10 color-grey select-choice ${bg} `}
name="option_span" onClick={() => this.onOptionClick(index)} style={{flex: '0 0 38px'}}>
<ConditionToolTip title={standard_answers[index] ? '点击取消标准答案设置' : '点击设置为标准答案'} placement="left" condition={!exerciseIsPublish}>
<ConditionToolTip title={standard_answers[index] ? '点击取消标准答案设置' : '点击设置为标准答案'} placement="left" condition={true}>
<div style={{width: '100%', height: '100%'}}>{tagArray[index]}</div>
</ConditionToolTip>
</span>

@ -46,9 +46,9 @@ class Multiple extends Component{
{
questionType.question_choices && questionType.question_choices.map((item,key)=>{
return(
<p className="clearfix mb15">
<p className="clearfix mb15 df">
<Checkbox className="fl lineh-20 " value={item.choice_id}></Checkbox>
<span class="fl lineh-20">{tagArray[key]}.</span><span style={{display:"inline-block"}} className="markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span>
<span class="fl lineh-20 mt1">{tagArray[key]}.</span><span style={{display:"inline-block"}} className="markdown-body mt1" dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span>
</p>
)
})

@ -54,7 +54,7 @@ class simpleAnswer extends Component{
<li className="with100">
{
user_exercise_status == 1 ?
<div className="markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(questionType.user_answer.length>0 ? questionType.user_answer[0]:"")}}></div>
<div className="markdown-body answerStyle" dangerouslySetInnerHTML={{__html: markdownToHTML(questionType.user_answer.length>0 ? questionType.user_answer[0]:"")}}></div>
:
<div>
<TPMMDEditor ref={this.mdRef} initValue={questionType.user_answer.length > 0 ? questionType.user_answer[0]:''} mdID={'simpleEditor'+questionType.question_id} placeholder="请输入你的答案"
@ -69,9 +69,9 @@ class simpleAnswer extends Component{
{
exercise.answer_status == 1 || questionType.a_flag ?
<div className="standardAnswer">
<p className="mb10">参考答案</p>
<li className="markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(questionType.standard_answer && questionType.standard_answer[0])}}></li>
<p className="mt15"><a className="color-blue" onClick={()=>this.showAndHide(false)}>隐藏参考答案</a></p>
<p className="mb10 font-16">参考答案</p>
<li className="markdown-body answerStyle" dangerouslySetInnerHTML={{__html: markdownToHTML(questionType.standard_answer && questionType.standard_answer[0])}}></li>
<p className="mt15"><a className="color-blue font-16" onClick={()=>this.showAndHide(false)}>隐藏参考答案</a></p>
</div>
:
<a className="color-blue font-16" onClick={()=>this.showAndHide(true)}>显示参考答案</a>
@ -82,7 +82,7 @@ class simpleAnswer extends Component{
isStudent && exercise.answer_open==true && exercise.exercise_status == 3 ?
<div className="bor-top-greyE pt20 mt20 standardAnswer">
<p>参考答案</p>
<li className="markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(questionType.standard_answer && questionType.standard_answer[0])}}></li>
<li className="markdown-body answerStyle" dangerouslySetInnerHTML={{__html: markdownToHTML(questionType.standard_answer && questionType.standard_answer[0])}}></li>
</div>:""
}
</div>

@ -41,9 +41,9 @@ class single extends Component{
{
questionType.question_choices && questionType.question_choices.map((item,key)=>{
return(
<p className={parseInt(questionType.question_type) == 0 ? "clearfix mb15" : "fl mr40"}>
<p className={parseInt(questionType.question_type) == 0 ? "clearfix mb15 df" : "fl mr40"}>
<Radio className="fl lineh-20" value={item.choice_id}></Radio>
<span className="fl lineh-20 mr3">{tagArray[key]}.</span><span style={{display:"inline-block"}} className="markdown-body fl" dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span>
<span className="fl lineh-20 mr3 mt1">{tagArray[key]}.</span><span style={{display:"inline-block"}} className="markdown-body fl mt1" dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span>
</p>
)
})

@ -178,6 +178,7 @@ class GraduateTaskItem extends Component{
funlist={this.props.funlist}
/>:""}
{this.state.visibles===true?<AccessoryModal
{...this.props}
modalname={"补交附件"}
visible={this.state.visibles}
Cancelname={"取消"}

@ -151,6 +151,7 @@ class GraduationTasksappraise extends Component{
<AccessoryModal
{...this.props}
modalname={"补交附件"}
visible={visible}
Cancelname={"取消"}

@ -26,7 +26,7 @@ class GraduationTasksappraiseMainEditor extends Component{
onSubmit = () => {
const { score, same_score } = this.state
let category_id= this.props.match.params.category_id;
const url = this.props.replyUrl || `/graduation_works/${category_id}/add_score.json`
const url = `/graduation_works/${category_id}/add_score.json`
const attachment_ids = this.state.fileList.map(item => {
return item.response ? item.response.id : item.id
})
@ -153,7 +153,7 @@ class GraduationTasksappraiseMainEditor extends Component{
}
render(){
let { total_count, comments, pageCount, fileList, score, same_score, errorMessage, numberErrorMessage } = this.state
const { current_user, memo, task_type, placeholder } = this.props
const { current_user, memo, showSameScore, placeholder } = this.props
const isAdmin = this.props.isAdmin()
const commentUploadProp = {
width: 600,
@ -205,7 +205,7 @@ class GraduationTasksappraiseMainEditor extends Component{
{this.props.title && <span className="mainEditorTitle color-grey-6">{this.props.title}</span>}
<TPMMDEditor ref={this.mdRef} mdID={'appraiseEditor'} placeholder={placeholder || "请在此输入对本作品的评语最大限制2000个字符"}
watch={false} height={160} className={errorMessage ? 'editorInputError' : ''}></TPMMDEditor>
{ task_type == 2 && <div>
{ showSameScore == true && <div>
<Checkbox value={same_score} onChange={this.same_score_change}>整组同评</Checkbox>
<span className={"font-14 color-grey-9"}>(选中则本次评阅对象指小组全部成员否则仅评阅此成员1人 )</span>
</div> }

@ -76,7 +76,8 @@ class GraduationTasksappraiseReplyChild extends Component{
</div>}
{this.props.ultimate===true ? "": isAdmin && <GraduationTasksappraiseMainEditor {...this.props}
addSuccess={() => this.props.addSuccess()}
addSuccess={() => this.props.addSuccess()}
showSameScore={true}
></GraduationTasksappraiseMainEditor> }
</div>

@ -342,8 +342,17 @@ class GraduationTasksnew extends Component {
</style>
{/*内容*/}
<div className="stud-class-set bor-bottom-greyE pt20 pl20 pr20 pb25 edu-back-white">
<Form.Item label="类型" >
<style>
{
`
.tasktype .ant-form-explain{
margin-top: -20px;
margin-bottom: 15px;
}
`
}
</style>
<Form.Item label="类型" className={"tasktype"}>
{getFieldDecorator('tasktype', {
rules: [{required: true, message: "请选择任务类型"}],
})(<Select className={"greyInput mb20"}
@ -355,8 +364,17 @@ class GraduationTasksnew extends Component {
<input type="hidden" id='tasktypes'/>
<span className={"newcoursestitle"}>选择确认后无法修改</span>
</Form.Item>
<Form.Item label="任务标题" >
<style>
{
`
.taskname .ant-form-explain{
margin-top: 0px;
margin-bottom: 0px;
}
`
}
</style>
<Form.Item label="任务标题" className={"taskname"} >
{getFieldDecorator('name', {
rules: [{required: true, message: "不能为空"}],
})(<Input placeholder="请输入任务名称最大限制60个字符" value={title_value} onInput={this.changeTitle}

@ -944,6 +944,7 @@ class GraduationTaskssettinglist extends Component{
:""}
{this.state.avisible===true?<AccessoryModal
{...this.props}
modalname={"补交附件"}
visible={this.state.avisible}
Cancelname={"取消"}

@ -15,7 +15,7 @@ class Graduationtaskitem extends Component{
}
render(){
let { item }=this.props;
const _content = this.parseCommentContent(item.content)
const _content = item.content && this.parseCommentContent(item.content)
return(
<div className="comment_item_cont df clearfix" key={item.id}>
<div className="J_Comment_Face fl">
@ -48,12 +48,14 @@ class Graduationtaskitem extends Component{
</div>
</div>
<div className="comment_content clearfix" id={`reply_content_${item.id}`}>
{!!_content && <div className="comment_content clearfix" id={`reply_content_${item.id}`}>
<div className="color-grey-3" id={`reply_content_${item.id}`}>
<div className={"break_word_comments"} dangerouslySetInnerHTML={{__html: _content}}></div>
<div className="cl"></div>
</div>
</div>
</div>}
{!_content && <span className="color656565 mt2 color-grey-9 font-12 mr8" style={{ display: 'inline-block'}}>{"暂未写评语"}</span>}
<div className="childrenCommentsView">
{(item && item.children && item.children.length) ? <div className="trangle"></div>: ''}
{this.renderChildenComments(item)}

@ -0,0 +1,158 @@
import React, { Component } from "react";
import { Modal, Checkbox, Input, Spin, Upload, Divider, Icon } from "antd";
import axios from 'axios'
import ModalWrapper from "../../common/ModalWrapper"
import { ConditionToolTip, getUploadActionUrl } from 'educoder'
const { Dragger } = Upload;
class CreateGroupByImportModal extends Component{
constructor(props){
super(props);
this.state={
}
}
fetchMemberList = (arg_page) => {
}
componentDidMount() {
}
onSendOk = () => {
const courseId = this.props.match.params.coursesId
let url = `/courses/${courseId}/create_group_by_importing_file.json`
let { fileList } =this.state;
if (!fileList || fileList.length == 0) {
// this.props.showNotification('请先上传附件')
this.setState({
errorTip :'请先上传附件',
})
return;
}
let newfileList=[];
for(var list of fileList){
newfileList.push(list.response.id)
}
axios.post(url, {
attachment_ids: newfileList
})
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification(response.data.message)
this.setVisible(false)
} else {
}
})
.catch(function (error) {
console.log(error);
});
}
setVisible = (visible) => {
if (visible) {
this.setState({ fileList: [] });
}
this.refs.modalWrapper.setVisible(visible)
}
handleChange = (info) => {
let fileList = info.fileList;
console.log(fileList)
this.setState({ fileList });
}
onOk = () => {
this.onSendOk()
}
onAttachmentRemove = (file) => {
this.props.confirm({
content: '是否确认删除?',
onOk: () => {
this.deleteAttachment(file)
},
onCancel() {
console.log('Cancel');
},
});
return false;
}
deleteAttachment = (file) => {
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, {
})
.then((response) => {
if (response.data) {
// const { status } = response.data;
if (response.data.status === 0) {
this.setState((state) => {
const index = state.fileList.indexOf(file);
const newFileList = state.fileList.slice();
newFileList.splice(index, 1);
return {
fileList: newFileList,
};
});
}
}
})
.catch(function (error) {
console.log(error);
});
}
render(){
const { candidates, checkBoxValues, loading, hasMore, name, school_name, school_names
, graduationGroup, graduation_groups, courseGroup, course_groups } = this.state
const { moduleName } = this.props
const props = {
name: 'file',
multiple: true,
action: getUploadActionUrl(),
onRemove: this.onAttachmentRemove,
onChange: this.handleChange
};
return(
<ModalWrapper
ref="modalWrapper"
width="700px"
title={`导入创建分班`}
{...this.props }
onOk={this.onOk}
className="createGroupByImport"
>
<style>
{`
`}
</style>
<div className="df">
</div>
<Dragger {...props}>
<p className="ant-upload-drag-icon">
<Icon type="inbox" />
</p>
<p className="ant-upload-text">点击或拖拽文件到这里上传</p>
<p className="ant-upload-hint">
单个文件最大150MB
</p>
</Dragger>
</ModalWrapper>
)
}
}
export default CreateGroupByImportModal;

@ -14,6 +14,8 @@ import axios from 'axios'
import _ from 'lodash'
import NoneData from "../coursesPublic/NoneData"
import CreateGroupByImportModal from './modal/CreateGroupByImportModal'
const Search =Input.Search;
const dataSource = [{
check:<Checkbox></Checkbox>,
@ -488,7 +490,10 @@ class studentsList extends Component{
searchPlaceholder={ '请输入姓名、学号进行搜索' }
firstRowRight={
<React.Fragment>
{/* { isSuperAdmin && <WordsBtn style="blue" className="mr30" onClick={()=>this.addTeacher()}>导入创建分班</WordsBtn> } */}
{ isSuperAdmin && <React.Fragment>
{/* <CreateGroupByImportModal ref="createGroupByImportModal" {...this.props}></CreateGroupByImportModal> */}
{/* <WordsBtn style="blue" className="mr30" onClick={()=> this.refs['createGroupByImportModal'].setVisible(true)}>导入创建分班</WordsBtn> */}
</React.Fragment> }
{ isAdmin && isParent && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>新建分班</WordsBtn> }
{ isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.deleteDir()}>删除分班</WordsBtn> }
{ isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.renameDir()}>分班重命名</WordsBtn> }
@ -582,11 +587,13 @@ class studentsList extends Component{
)
}) }
{ isAdmin &&
<p className="drop_down_btn">
<a href="javascript:void(0)" className="color-grey-6"
onClick={()=>this.addDir()}
>添加分班...</a>
</p>
}
</ul>
</li>}

@ -323,7 +323,6 @@ textarea:read-only{
}
.standardAnswer p{
line-height: 20px!important;
font-size: 16px;
}
/* 倒计时 */
.remainingTime li{

@ -2464,7 +2464,7 @@ class Listofworks extends Component {
<Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/questions`}>作业问答</Link>
{this.props.isAdmin() ?
this.state.code_review === false ? "" : <Link
this.state.code_review === true ? "" : <Link
// to={`/courses/${this.state.props.match.params.coursesId}/${this.state.props.match.params.homeworkid}/student_work`}
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/student_work`}>
代码查重</Link> : ""}

@ -1676,7 +1676,7 @@ class Trainingjobsetting extends Component {
}
<Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/questions`}>作业问答</Link>
{this.props.isAdmin()?this.state.code_review===false?"": <Link
{this.props.isAdmin()?this.state.code_review===true?"": <Link
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/student_work`}>代码查重</Link> : ""}
<style>{
@ -1708,7 +1708,7 @@ class Trainingjobsetting extends Component {
<a className="fr color-blue font-16" onClick={this.homeworkstart}>立即发布</a> : "": ""}
{this.props.isAdmin()?
this.state.code_review===false?<a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a>
this.state.code_review===true?<a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a>
: "":""}
</div>
</div>

@ -401,7 +401,7 @@ class Workquestionandanswer extends Component {
className="active"
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/questions`}>作业问答</Link>
{this.props.isAdmin()?
this.state.code_review===false?"":<Link
this.state.code_review===true?"":<Link
// to={`/courses/${this.state.props.match.params.coursesId}/${this.state.props.match.params.homeworkid}/student_work`}
to={`/courses/${this.state.props.match.params.coursesId}/${this.state.shixuntypes}/${this.state.props.match.params.homeworkid}/student_work`}>
代码查重</Link>:""}
@ -421,7 +421,7 @@ class Workquestionandanswer extends Component {
{this.props.isAdmin()?
this.state.code_review===false?
this.state.code_review===true?
<a className="fr color-blue font-16" onClick={this.workshowmodel}>代码查重</a>
:"":""}

@ -28,7 +28,7 @@ class CodeEvaluateMultiLevelAnswerUnlock extends Component {
}
render() {
const { shixun, challenge, lockedAnswers } = this.props;
const { shixun, challenge, lockedAnswers, unlockedAnswers } = this.props;
const { currentLevel } = this.state;
return (
<div className="answerMultiLevelUnlock">
@ -85,7 +85,7 @@ class CodeEvaluateMultiLevelAnswerUnlock extends Component {
<Radio onClick={() => this.onLevelClick(item, index)}
checked={currentLevel>=index}></Radio>
</div>
<div className="twoSpanCol">{index + 1}</div>
<div className="twoSpanCol">{index + 1 + (unlockedAnswers && unlockedAnswers.length || 0) }</div>
<div className="autoCol">{item.name}</div>
<div className="fourSpanCol">{item.score}%</div>
<div className="fourSpanCol goldColor">{challenge.score * item.score / 100}</div>

@ -1,128 +1,128 @@
import React, { Component } from 'react';
import { getImageUrl} from 'educoder';
import './TPMIndex.css';
const $ = window.$;
$(window).resize(function(){
rightSlider();
});
$(window).scroll(function(){
if($(".gotop").length>0){
if($(document).scrollTop()>0){
$(".-task-sidebar .gotop").show();
$(".gotop").click(function(){
$("html,body").scrollTop(0);
});
}
if($(document).scrollTop()==0){
$(".-task-sidebar .gotop").hide();
}
}
});
function rightSlider(){
var poi=parseInt((parseInt($(window).width())- 1200 )/2)-60;
// console.log(parseInt($(window).width())+" "+poi);
if(poi>0){
$(".-task-sidebar").css("right",poi);
}else{
$(".-task-sidebar").css("right","0px");
}
$(".-task-sidebar").show();
}
function _initSider() {
var $descSide = $("<div class='-task-desc'></div>").appendTo("body");
$(".-task-sidebar>div").hover(function(){
//移入显示二维码
if($(this).hasClass("scan")){
$(".scan_ewm").show().css({right:"75px",opacity:0}).stop().animate({
right:"45px",opacity:1
})
return;
}
var $tool = $(this).attr("tooltips");
$descSide.html($tool+"<div><img src='https://www.educoder.net/images/edu_user/jt.png'></div>");
$descSide.data('_dom', this)
$descSide.show().css({
left:$(this).offset().left - $descSide.width()-30,
opacity:0,
top:$(this).offset().top
}).stop().animate({
left:$(this).offset().left - $descSide.width()-5,
opacity:1
},400);
},function(){
if($(this).hasClass("scan")){
$(".scan_ewm").stop().animate({right:"75px",opacity:0},200).hide();
}
$descSide.stop().animate({
left:$(this).offset().left - $descSide.width()-30,
opacity:0
},200).hide();
});
rightSlider();
$(window).scroll(function() {
if ($descSide.height()) {
var hoverIcon = $descSide.data('_dom')
$descSide.css('top', $(hoverIcon).offset().top)
}
})
}
class SiderBar extends Component {
constructor(props) {
super(props)
}
componentDidMount() {
_initSider();
}
render() {
return (
<div className="-task-sidebar">
<div className="gotop" tooltips="返回顶部">
<a>
<i className="iconfont icon-shangjiantou color-white"></i>
</a>
</div>
<div className="feedback" tooltips="意见反馈">
<a target="_blank" className="color_white" href="https://www.educoder.net/help?index=6">
<i className="iconfont icon-yijianfankui color-white font-22"></i>
</a>
</div>
<div className="scan pr">
<span className="inline"><i className="iconfont icon-erweima color-white font-22 fl"></i></span>
<p className="scan_ewm" style={{display: 'none', right:' 75px',opacity: '0'}}>
<p className="pr padding10">
<img src={getImageUrl("images/edu_user/EWM.jpg")} width="158px" height="158px" />
<p>微信扫一扫</p>
<p>关注公众号</p>
<span className="trangle_right"></span>
</p>
</p>
</div>
<div className="consult" tooltips="在线咨询">
<a target="_blank" className="color_white" href="//shang.qq.com/wpa/qunwpa?idkey=2f2043d88c1bd61d182b98bf1e061c6185e23055bec832c07d8148fe11c5a6cd">
<i className="iconfont icon-qqzaixianzixun color-white font-22"></i>
</a>
</div>
</div>
);
}
}
export default SiderBar;
import React, { Component } from 'react';
import { getImageUrl} from 'educoder';
import './TPMIndex.css';
const $ = window.$;
$(window).resize(function(){
rightSlider();
});
$(window).scroll(function(){
if($(".gotop").length>0){
if($(document).scrollTop()>0){
$(".-task-sidebar .gotop").show();
$(".gotop").click(function(){
$("html,body").scrollTop(0);
});
}
if($(document).scrollTop()==0){
$(".-task-sidebar .gotop").hide();
}
}
});
function rightSlider(){
var poi=parseInt((parseInt($(window).width())- 1200 )/2)-60;
// console.log(parseInt($(window).width())+" "+poi);
if(poi>0){
$(".-task-sidebar").css("right",poi);
}else{
$(".-task-sidebar").css("right","0px");
}
$(".-task-sidebar").show();
}
function _initSider() {
var $descSide = $("<div class='-task-desc'></div>").appendTo("body");
$(".-task-sidebar>div").hover(function(){
//移入显示二维码
if($(this).hasClass("scan")){
$(".scan_ewm").show().css({right:"75px",opacity:0}).stop().animate({
right:"45px",opacity:1
})
return;
}
var $tool = $(this).attr("tooltips");
$descSide.html($tool+"<div><img src='https://www.educoder.net/images/edu_user/jt.png'></div>");
$descSide.data('_dom', this)
$descSide.show().css({
left:$(this).offset().left - $descSide.width()-30,
opacity:0,
top:$(this).offset().top
}).stop().animate({
left:$(this).offset().left - $descSide.width()-5,
opacity:1
},400);
},function(){
if($(this).hasClass("scan")){
$(".scan_ewm").stop().animate({right:"75px",opacity:0},200).hide();
}
$descSide.stop().animate({
left:$(this).offset().left - $descSide.width()-30,
opacity:0
},200).hide();
});
rightSlider();
$(window).scroll(function() {
if ($descSide.height()) {
var hoverIcon = $descSide.data('_dom')
$descSide.css('top', $(hoverIcon).offset().top)
}
})
}
class SiderBar extends Component {
constructor(props) {
super(props)
}
componentDidMount() {
_initSider();
}
render() {
return (
<div className="-task-sidebar">
<div className="gotop" tooltips="返回顶部">
<a>
<i className="iconfont icon-shangjiantou color-white"></i>
</a>
</div>
<div className="feedback" tooltips="意见反馈">
<a target="_blank" className="color_white" href="https://www.educoder.net/help?index=6">
<i className="iconfont icon-yijianfankui color-white font-22"></i>
</a>
</div>
<div className="scan pr">
<span className="inline"><i className="iconfont icon-erweima color-white font-22 fl"></i></span>
<p className="scan_ewm" style={{display: 'none', right:' 75px',opacity: '0'}}>
<p className="pr padding10">
<img src={getImageUrl("images/educoder/EWM.jpg")} width="158px" height="158px" />
<p>微信扫一扫</p>
<p>关注公众号</p>
<span className="trangle_right"></span>
</p>
</p>
</div>
<div className="consult" tooltips="在线咨询">
<a target="_blank" className="color_white" href="//shang.qq.com/wpa/qunwpa?idkey=2f2043d88c1bd61d182b98bf1e061c6185e23055bec832c07d8148fe11c5a6cd">
<i className="iconfont icon-qqzaixianzixun color-white font-22"></i>
</a>
</div>
</div>
);
}
}
export default SiderBar;

@ -1195,7 +1195,7 @@ export default class TPMsettings extends Component {
}
</Select>
<p
className="edu-txt-right font-12"
className="edu-txt-left font-12"
style={{display:operateauthority?"block":'none'}}
>
列表中没有
@ -1214,6 +1214,7 @@ export default class TPMsettings extends Component {
<label className="panel-form-label fl"><span
className="color-red fl mt3">*</span>&nbsp;&nbsp;</label>
<textarea className="fl task-form-80 task-height-150"
style={{width:'100%'}}
onInput={this.sendsure_applyvalues}
value={sendsure_applyvalue}
placeholder="请输入新增镜像需要安装的软件及版本等信息" id="demand_info"></textarea>
@ -1354,10 +1355,11 @@ export default class TPMsettings extends Component {
<textarea className="task-form-80 task-height-150 panel-box-sizing fl mt10"
onInput={this.Executiveorder}
value={Executiveordervalue}
style={{width:'100%'}}
id="executive_command"
>
</textarea>
<p className="-text-danger fl mt10 ml95"
<p className="-text-danger fl mt5"
id="executive_command_notice"
style={{display: Executivetyoe === false ? "none" : "block"}}
>执行命令不能为空</p>
@ -1369,6 +1371,7 @@ export default class TPMsettings extends Component {
value={Compilecommandvalue}
onInput={this.Compilecommand}
id="compile_command"
style={{width:'100%'}}
>
</textarea>
</li>

@ -381,7 +381,7 @@ export default class TPMevaluation extends Component {
// })
// }
savegetfilepath=(value)=>{
let {selectpath} = this.state
let {selectpath,saveshixunfilepath} = this.state
// let newarr =selectpatharr;
// let arrtype=false;
// let arrsum=0;
@ -403,9 +403,28 @@ export default class TPMevaluation extends Component {
// newselectpath=newselectpath+newarr[z]+ ""
// }
// let newselectpath=selectpath+value+ ""
let newselectpath=value
let newselectpath;
if(saveshixunfilepath==="shixunfilepathplay"){
newselectpath=value
}else{
const type = selectpath.split('');
let types=false;
for(var i=0; i<type.length; i++){
if(type[i]===value){
types=true
return
}
}
if(types===false){
newselectpath=selectpath+value+ ""
}else{
newselectpath=selectpath
}
}
this.setState({
// selectpatharr:newarr,
selectpath: newselectpath,

@ -4,7 +4,7 @@ import {TPMIndexHOC} from '../TPMIndexHOC';
import {SnackbarHOC} from 'educoder';
import {Input, Select, Radio, Checkbox, Modal, Icon, DatePicker,Upload,Button,message,Form} from 'antd';
import {Input, Select, Radio, Checkbox, Modal, Icon, DatePicker,Upload,Button,message,Form,notification} from 'antd';
// import "antd/dist/antd.css";
@ -523,9 +523,17 @@ class Newshixuns extends Component {
return item.response ? item.response.id : item.id
})
}
debugger
if( attachment_ids === undefined || attachment_ids.length===0){
this.props.showNotification(`请上传附件`);
notification.open(
{
message: '提示',
description:
'请上传附件!',
}
)
return;
}
// console.log("attachment_ids"+attachment_ids);
@ -563,7 +571,16 @@ class Newshixuns extends Component {
testcoderunmode:"",
})
}
this.props.showNotification('提交成功!');
// this.props.showNotification('提交成功!');
notification.open(
{
message: '提示',
description:
'提交成功!',
}
)
this.sendhideModaly()
// this.props.history.push(`/courses/${cid}/graduation_topics`);
// }
}
@ -763,8 +780,15 @@ class Newshixuns extends Component {
// console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 50;
if (!isLt150M) {
this.props.showNotification(`文件大小必须小于50MB`);
// this.props.showNotification(`文件大小必须小于50MB`);
notification.open(
{
message: '提示',
description:
'文件大小必须小于50MB',
}
)
}
if(thiss.state.file !== undefined){
console.log("763")
@ -881,7 +905,7 @@ class Newshixuns extends Component {
})
}
</Select>
<p className="edu-txt-right font-12">
<p className="edu-txt-left font-12">
列表中没有
<a className="color-blue" onClick={this.post_apply}> 申请新建</a>
</p>

@ -33,6 +33,7 @@ class Collaborators extends Component {
Collaboratorsvisible: false,
Collaboratorsvisibleadmin: false,
value: 1,
page: 1,
Searchadmin: [],
allChangechecked: false,
Collaboratorslist: [],
@ -155,6 +156,9 @@ class Collaborators extends Component {
}
onSearchadmin = (value) => {
let {collaboratorList,user_name,school_name} = this.state;
this.setState({
Searchadmin: [],
})
// if (value === "") {
// this.setState({
// Searchadmin: [],
@ -172,7 +176,7 @@ class Collaborators extends Component {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
}else{
let newlist = response.data;
let newlist = response.data.users;
for (var i = 0; i < newlist.length; i++) {
newlist[i].checked = false
}
@ -336,7 +340,48 @@ class Collaborators extends Component {
collaboratorListsumtype:false
})
}
render() {
contentViewScrolledit=(e)=>{
//滑动到底判断
if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){
let {page,collaboratorList,user_name,school_name,Searchadmin} = this.state;
let newpage=page+1;
let newSearchadmin=Searchadmin
let id = this.props.match.params.shixunId;
let url = "/shixuns/" + id + "/add_collaborators.json";
axios.get(url,{params:{
user_name:user_name ,
school_name:school_name,
page:newpage
}}).then((response) => {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
}else{
let newlist = response.data.users;
for (var i = 0; i < newlist.length; i++) {
newlist[i].checked = false
newSearchadmin.push(newlist[i])
}
console.log(newSearchadmin)
this.setState({
Searchadmin: newSearchadmin,
collaboratorList: collaboratorList,
page:newpage
})
}
}).catch((error) => {
console.log(error)
});
}
}
render() {
let {
collaboratorList,
Collaboratorsvisible,
@ -445,13 +490,13 @@ class Collaborators extends Component {
>搜索</a>
<p className="clearfix pl35 mt20">
<span className="fl edu-txt-w80 task-hide font-bd ml10 edu-txt-left">姓名</span>
<span className="fl edu-txt-w80 task-hide font-bd">呢称</span>
<span className="fl edu-txt-w80 task-hide font-bd">职业</span>
<span className="fl edu-txt-w180 task-hide font-bd ml50">单位</span>
</p>
<div className="mt5" style={{background: '#f7f9fd'}}>
<div className="clearfix">
<ul className="upload_select_box fl" id="search_not_teachers_list">
<ul className="upload_select_box fl" id="search_not_teachers_list" onScroll={this.contentViewScrolledit}>
{Searchadmin.length === 0 ? <li style={{textAlign: 'center'}}>
<span>请试试搜索一下</span>
</li> : Searchadmin.map((item, key) => {
@ -460,10 +505,12 @@ class Collaborators extends Component {
<Checkbox className="fl mr20" checked={item.checked}
onChange={(e) => this.selectChangenickname(e, key)}
id={item.user_id}></Checkbox>
<a className="task-hide color-grey3 ml20 fl span1 edu-txt-w80">{item.nickname}</a>
<a className="task-hide color-grey3 fl span1 edu-txt-w80 edu-txt-left">{item.nickname}</a>
<span className="task-hide fl color-grey edu-txt-w80 span2">{item.identify}</span>
<span
className="span3 color-grey fl edu-txt-w260 task-hide">{item.school_name}</span>
title={item.school_name}
style={{width: '150px'}}
className="span3 color-grey fl edu-txt-w260 task-hide ml50 task-hide" >{item.school_name}</span>
</li>
)
})

Loading…
Cancel
Save