caishi 6 years ago
commit e253218735

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

@ -40,11 +40,15 @@ function getScoreTip(score, dom) {
} }
function buildColumns(that, student_works) { function buildColumns(that, student_works) {
let gotWorkGroup = false; let gotWorkGroup = false;
let gotProjectInfo = false;
if (student_works) { if (student_works) {
student_works.forEach(item => { student_works.forEach(item => {
if (item.work_group) { if (item.work_group) {
gotWorkGroup = true gotWorkGroup = true
} }
if (item.project_info && item.project_info.name) {
gotProjectInfo = true;
}
}) })
} }
let courseId= that.props.match.params.coursesId; let courseId= that.props.match.params.coursesId;
@ -136,6 +140,22 @@ function buildColumns(that, student_works) {
), ),
}) })
} }
if (gotProjectInfo) {
columns.push({
width: 72,
title: '关联项目',
dataIndex: 'project_info',
key: 'project_info',
render: (project_info, record) => (
<span>
{project_info && project_info.name && <a href={`/projects/${project_info.id}`} target="_blank"
className="overflowHidden1" style={{color:'#4CACFF', width: '80px', margin: '0 auto', display: 'block'}} title={project_info.name}
>{project_info.name}</a>}
</span>
),
})
}
columns = columns.concat([{ columns = columns.concat([{
width: 88, width: 88,
title: '提交状态', title: '提交状态',
@ -176,7 +196,7 @@ function buildColumns(that, student_works) {
}]) }])
if (!niPingAndIsStudent) { if (!niPingAndIsStudent) {
columns.push({ columns.push({
width: 72, width: 70,
title: '教师评分', title: '教师评分',
key: 'teacher_score', key: 'teacher_score',
dataIndex: 'teacher_score', dataIndex: 'teacher_score',
@ -192,7 +212,7 @@ function buildColumns(that, student_works) {
}) })
columns.push({ columns.push({
width: 72, width: 70,
title: '助教评分', title: '助教评分',
key: 'teaching_asistant_score', key: 'teaching_asistant_score',
dataIndex: 'teaching_asistant_score', dataIndex: 'teaching_asistant_score',
@ -251,7 +271,7 @@ function buildColumns(that, student_works) {
if (that.state.anonymous_appeal) { if (that.state.anonymous_appeal) {
columns.push({ columns.push({
width: 72, width: 70,
title: '匿评申诉', title: '匿评申诉',
key: 'appeal_all_count', key: 'appeal_all_count',
dataIndex: 'appeal_all_count', dataIndex: 'appeal_all_count',
@ -271,7 +291,7 @@ function buildColumns(that, student_works) {
} }
if (!niPingAndIsStudent) { if (!niPingAndIsStudent) {
columns.push({ columns.push({
width: 72, width: 70,
title: '最终成绩', title: '最终成绩',
key: 'work_score', key: 'work_score',
dataIndex: 'work_score', dataIndex: 'work_score',

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

@ -329,7 +329,7 @@ class CCommentItem extends Component{
<div className="cl"></div> <div className="cl"></div>
</div> </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"> <div className="mt6">
{attachments && attachments.map((attaItem, key)=>{ {attachments && attachments.map((attaItem, key)=>{
return( return(

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

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

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

@ -193,9 +193,9 @@ class ExerciseListItem extends Component{
{ {
IsStudent && IsStudent &&
<div className="homepagePostSetting" style={{"right":"0px","top":"62px","position":"absolute","display":"block"}}> <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 ===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" 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" onClick={()=>this.setgameexercise(`/courses/${coursesId}/exercises/${item.id}/users/${this.props.current_user.login}`)}>开始答题</a></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>
} }
</div> </div>

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

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

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

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

@ -55,7 +55,7 @@ class GraduationTasksnew extends Component {
for (var list of fileList) { for (var list of fileList) {
listid.push(list.response.id) listid.push(list.response.id)
} }
if (GraduationTasksnewtype === true) { // if (GraduationTasksnewtype === true) {
this.props.form.validateFields((err, values) => { this.props.form.validateFields((err, values) => {
if (!err) { if (!err) {
if (values.tasktype === undefined) { if (values.tasktype === undefined) {
@ -87,18 +87,20 @@ class GraduationTasksnew extends Component {
attachment_ids: listid, attachment_ids: listid,
} }
).then((response) => { ).then((response) => {
if (response.status === 200) { // if (response.status === 200) {
GraduationTasksnewtype = false; // GraduationTasksnewtype = false;
// this.goback(); // this.goback();
if(response!==undefined){
this.props.history.push("/courses/" + this.props.match.params.coursesId + "/graduation_tasks/" + this.props.match.params.category_id + "/" + response.data.task_id + "/setting"); this.props.history.push("/courses/" + this.props.match.params.coursesId + "/graduation_tasks/" + this.props.match.params.category_id + "/" + response.data.task_id + "/setting");
} }
// }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}) })
} }
}); });
} // }
} }
@ -392,7 +394,7 @@ class GraduationTasksnew extends Component {
> >
{getFieldDecorator('description', { {getFieldDecorator('description', {
rules: [{ rules: [{
required: true, message: '请输入帖子内容', required: true, message: '请输入内容',
}, { }, {
max: 5000, message: '最大限制为5000个字符', max: 5000, message: '最大限制为5000个字符',
}], }],

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

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

@ -151,7 +151,8 @@ class CommitSummary extends Component{
<Form labelCol={{span: 5}}layout='vertical' onSubmit={this.handleSubmit} wrapperCol={{span: 12}}> <Form labelCol={{span: 5}}layout='vertical' onSubmit={this.handleSubmit} wrapperCol={{span: 12}}>
<Form.Item <Form.Item
> >
<div style={{ "background": "#fff","padding-bottom":"20px","padding-left":"20px","padding-right":"20px"}}> <div style={{ "background": "#fff","padding-bottom":"20px","padding-left":"20px","padding-right":"20px"}}
className="mdInForm">
{getFieldDecorator('description', { {getFieldDecorator('description', {
rules: [{ rules: [{
required: true, message: '请输入帖子内容', required: true, message: '请输入帖子内容',

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

Loading…
Cancel
Save