Merge branch 'topic_bank' of https://bdgit.educoder.net/Hjqreturn/educoder into topic_bank

dev_aliyun_beta
caicai8 6 years ago
commit 205e2d31b7

@ -85,45 +85,47 @@ class ExerciseBanksController < ApplicationController
end
def get_exercise_question_count
@exercise_ques_count = @exercise_questions.size # 全部的题目数
@exercise_ques_scores = @exercise_questions.pluck(:question_score).sum
exercise_questions = @bank.exercise_bank_questions
@exercise_ques_count = exercise_questions.size # 全部的题目数
@exercise_ques_scores = exercise_questions.pluck(:question_score).sum
#单选题的数量及分数
exercise_single_ques = @exercise_questions.find_by_custom("question_type", Exercise::SINGLE)
exercise_single_ques = exercise_questions.find_by_custom("question_type", Exercise::SINGLE)
@exercise_single_ques_count = exercise_single_ques.size
@exercise_single_ques_scores = exercise_single_ques.pluck(:question_score).sum
#多选题的数量及分数
exercise_double_ques = @exercise_questions.find_by_custom("question_type", Exercise::MULTIPLE)
exercise_double_ques = exercise_questions.find_by_custom("question_type", Exercise::MULTIPLE)
@exercise_double_ques_count = exercise_double_ques.size
@exercise_double_ques_scores = exercise_double_ques.pluck(:question_score).sum
# 判断题数量及分数
exercise_ques_judge = @exercise_questions.find_by_custom("question_type", Exercise::JUDGMENT)
exercise_ques_judge = exercise_questions.find_by_custom("question_type", Exercise::JUDGMENT)
@exercise_ques_judge_count = exercise_ques_judge.size
@exercise_ques_judge_scores = exercise_ques_judge.pluck(:question_score).sum
#填空题数量及分数
exercise_ques_null = @exercise_questions.find_by_custom("question_type", Exercise::COMPLETION)
exercise_ques_null = exercise_questions.find_by_custom("question_type", Exercise::COMPLETION)
@exercise_ques_null_count = exercise_ques_null.size
@exercise_ques_null_scores = exercise_ques_null.pluck(:question_score).sum
#简答题数量及分数
exercise_ques_main = @exercise_questions.find_by_custom("question_type", Exercise::SUBJECTIVE)
exercise_ques_main = exercise_questions.find_by_custom("question_type", Exercise::SUBJECTIVE)
@exercise_ques_main_count = exercise_ques_main.size
@exercise_ques_main_scores = exercise_ques_main.pluck(:question_score).sum
#实训题数量及分数
exercise_ques_shixun = @exercise_questions.find_by_custom("question_type", Exercise::PRACTICAL)
exercise_ques_shixun = exercise_questions.find_by_custom("question_type", Exercise::PRACTICAL)
@exercise_ques_shixun_count = exercise_ques_shixun.size
@exercise_ques_shixun_scores = exercise_ques_shixun.pluck(:question_score).sum
end
def get_poll_question_count
@poll_questions_count = @exercise_questions&.size # 全部的题目数
@poll_question_singles = @exercise_questions.find_by_custom("question_type", 1).size # 单选题
@poll_question_doubles = @exercise_questions.find_by_custom("question_type", 2).size # 多选题
@poll_question_mains = @exercise_questions.find_by_custom("question_type", 3).size #主观题
exercise_questions = @bank.exercise_bank_questions
@poll_questions_count = exercise_questions&.size # 全部的题目数
@poll_question_singles = exercise_questions.find_by_custom("question_type", 1).size # 单选题
@poll_question_doubles = exercise_questions.find_by_custom("question_type", 2).size # 多选题
@poll_question_mains = exercise_questions.find_by_custom("question_type", 3).size #主观题
end
end

@ -475,7 +475,7 @@ class StudentWorksController < ApplicationController
# 实训作品的评阅
def shixun_work_comment
tip_exception("评阅不能为空") if params[:comment].blank?
tip_exception("缺少is_hidden参数") if params[:is_hidden].blank? || ![true, false].include?(params[:is_hidden])
tip_exception("缺少is_hidden参数") if params[:is_hidden].blank? || ![1, 0].include?(params[:is_hidden])
comment = @work.student_works_scores.shixun_comment.first || StudentWorksScore.new(student_work_id: @work.id, user_id: current_user.id)
comment.comment = params[:comment]
comment.is_hidden = params[:is_hidden]

@ -113,7 +113,7 @@ module ExportHelper
end
else #实训题
shixun = homework.shixuns.first
shixun_head_cells = %w(完成情况 通关时间 总耗时 总评测次数 获得经验值 关卡得分)
shixun_head_cells = %w(完成情况 通关时间 学员在EduCoder做实训花费的时间 总评测次数 获得经验值 关卡得分)
eff_boolean = homework.work_efficiency
if eff_boolean
eff_score_cell = ["效率分"]
@ -123,7 +123,7 @@ module ExportHelper
if allow_late_boolean #允许迟交
eff_score_cell.push("迟交扣分")
end
shixun_time_cells = %w(最终成绩 更新时间 提交耗时 评语)
shixun_time_cells = %w(最终成绩 更新时间 作业发布到学员完成作业所耗的时间 评语)
@work_head_cells = (head_cells_format + shixun_head_cells + eff_score_cell + shixun_time_cells).reject(&:blank?)
works.includes(:student_works_scores, user: :user_extension, myshixun: :games).each_with_index do |w, index|
myshixun = w.try(:myshixun)
@ -163,7 +163,8 @@ module ExportHelper
end
w_15 = w.work_score.nil? ? "--" : w.work_score.round(1)
w_16 = w.update_time ? format_time(w.update_time) : "--" "更新时间"
w_17 = w.cost_time ? (game_spend_time w.cost_time) : "--"
myshixun_complete = myshixun && myshixun.status == 1
w_17 = myshixun_complete && w.cost_time ? (game_spend_time w.cost_time) : "未完成"
teacher_comments = w.student_works_scores
if teacher_comments.present?
w_18 = ""

@ -53,7 +53,7 @@ class Users::UpdateAccountService < ApplicationService
RewardGradeService.call(user, container_id: user.id, container_type: 'Account', score: 500)
if user.user_extension.teacher?
join_course(user.id,1309, 2)
sms_notify_admin(user.lastname)
# sms_notify_admin(user.lastname)
end
end

@ -54,7 +54,7 @@ if @shixun
json.passed_time @work.myshixun&.passed_time
# 评阅信息
json.work_comment @user_course_identity < Course::STUDENT ? @comment&.comment : nil
json.work_comment @user_course_identity < Course::STUDENT || !@comment&.is_hidden ? @comment&.comment : nil
json.work_comment_hidden @comment&.is_hidden
# 图形统计

@ -232,7 +232,7 @@ const GraduationTasksquestions= Loadable({
//毕设任务列表
const GraduationTaskssettinglist= Loadable({
loader: () => import('./graduation/tasks/GraduationTaskssettinglist'),
loader: () => import('./graduation/tasks/GraduationTaskDetail'),
loading: Loading,
})
@ -542,7 +542,7 @@ class CoursesIndex extends Component{
{/* 设置毕设任务 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/setting"
{/* <Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/setting"
render={
(props) => (<GraduationTaskssetting {...this.props} {...props} {...this.state} {...common}/>)
}
@ -551,18 +551,17 @@ class CoursesIndex extends Component{
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/questions"
render={
(props) => (<GraduationTasksquestions {...this.props} {...props} {...this.state} {...common}/>)
}></Route>
(props) => (<GraduationTasksquestions {...this.props} {...props} {...this.state} />)
}></Route> */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/list"
<Route path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id"
render={
(props) => (<GraduationTaskssettinglist {...this.props} {...props} {...this.state} {...common}/>)
}
></Route>
{/* 修改毕设任务 https://www.trustie.net/issues/19981 */}
<Route path="/courses/:coursesId/graduation_tasks/:category_id/edit"
render={

@ -0,0 +1,146 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Upload,Button,Icon,message,Input,Radio} from "antd";
import { WordNumberTextarea } from 'educoder';
import axios from 'axios';
class AppraiseModal extends Component{
constructor(props){
super(props);
this.state={
group_ids:[],
fileList:[],
textareaval:undefined,
Inputsval:undefined,
valuetype:0,
textareavaltype:false
}
}
componentDidMount() {
this.setState({
valuetype:this.props.work_type===undefined?0:this.props.work_type,
textareaval:this.props.work_comment,
})
}
onChanges=(e)=>{
this.setState({
valuetype:e.target.value
})
}
settextarea=(e)=>{
this.setState({
textareaval:e.target.value
})
}
Saves=()=>{
let{textareaval,valuetype}=this.state;
if(textareaval===undefined||textareaval===null||textareaval===""){
this.setState({
textareavaltype:true
})
return
}
let url=`/student_works/${this.props.match.params.homeworkid}/shixun_work_comment.json`
axios.post(url, {
comment:textareaval,
is_hidden:valuetype
}).then((response) => {
if(response.data.status===0){
this.props.showNotification(response.data.message)
this.props.showCancel(textareaval,valuetype)
}else{
this.props.showNotification(response.data.message)
}
}).catch((error) => {
console.log(error)
});
}
render(){
let {textareaval,Inputsval,textareavaltype,Inputsvaltype}=this.state;
const radioStyle = {
display: 'block',
height: '30px',
lineHeight: '30px',
};
return(
<div>
<Modal
keyboard={false}
className={"HomeworkModal"}
title={this.props.work_comment===null||this.props.work_comment===undefined?"评阅":"编辑评阅"}
visible={this.props.visible}
closable={false}
footer={null}
destroyOnClose={true}
>
<div className={"pd015"}>
<style>
{
`
.pd015{
padding: 0px 15px 15px 15px;
}
.font{
width: 48px;
height: 16px;
font-size: 16px;
font-family: PingFangSC;
font-weight: 400;
color: rgba(5,16,26,1);
line-height: 16px;
}
.newfont{
height: 16px;
font-size: 16px;
font-family: PingFangSC;
font-weight: 400;
color: rgba(5,16,26,1);
line-height: 16px;
margin-bottom: 5px;
}
`
}
</style>
<div className="clearfix">
<p className={"font mt10 mb10"}>
权限
</p>
<Radio.Group onChange={this.onChanges} value={this.state.valuetype}>
<Radio value={0} style={radioStyle} className={"newfont"}>可见 (学生查看老师的评阅内容</Radio>
<Radio value={1} style={radioStyle} className={"newfont"}>不可见 (仅对课堂老师可见</Radio>
</Radio.Group>
<p className={"font mt10 mb20"}>
内容
</p>
<WordNumberTextarea
placeholder={"请填写评阅内容"}
onInput={(e)=>this.settextarea(e)}
value={textareaval}
maxlength={500}
/>
<li style={{height:"20px",lineHeight:"20px"}} className={textareavaltype===true?"color-red mt20 mb10":"none"}><span>评阅内容不能为空</span></li>
</div>
<div className={textareavaltype===false?"mt20 clearfix edu-txt-center":"clearfix edu-txt-center"}>
<a className="task-btn color-white mr30" 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 AppraiseModal;

@ -848,7 +848,7 @@ a.white-btn.use_scope-btn:hover{
font-family: MicrosoftYaHei;
font-weight: 400;
color: rgba(51,51,51,1);
cursor: pointer;
/*cursor: pointer;*/
max-width: 825px;
overflow: hidden;
text-overflow: ellipsis;
@ -1220,6 +1220,28 @@ samp {
color: #FE4F4C;
}
/* 毕设任务 */
.graduationTaskMenu a{
display: block;
position: relative;
line-height: 72px;
font-size: 16px;
margin-right: 30px;
float: left;
}
.graduationTaskMenu a.active:after{
position: absolute;
left: 0px;
height: 2px;
width: 100%;
content: '';
background: #4CACFF;
bottom: 0px;
font-weight:400;
}
.graduationTaskMenu a.active{
color: #4CACFF!important;
}
/* end */
/* form表单包含多个item时 */

@ -436,6 +436,7 @@ class ExerciseNewCommon extends Component{
getAddQuestionUrl: this.getAddQuestionUrl,
getEditQuestionUrl: this.getEditQuestionUrl,
exercise_url: this.props.exercise_url,
}
return(
<React.Fragment>

@ -86,7 +86,7 @@ class JudgeDisplay extends Component{
// 单选
return (
<div key={optionIndex} className="fl mr30 df">
<Radio disabled checked={item.standard_boolean}></Radio>
<Radio disabled className="lineh-25" checked={item.standard_boolean}></Radio>
{/* <span>{item.choice_text}</span> */}
<MarkdownToHtml content={item.choice_text} selector={'judge_' + (index + 1) + optionIndex}
className=""

@ -92,6 +92,9 @@ class NullDisplay extends Component{
.answerRow {
padding: 1px 0;
}
.answers .markdown-body > p{
line-height:20px;
}
`}</style>
<QestionDisplayHeader {...this.props}></QestionDisplayHeader>

@ -156,10 +156,10 @@ class ShixunEditor extends Component{
this.props.onEditorCancel()
}
componentDidMount = () => {
const { shixun_id } = this.props;
const { shixun_id, exercise_url } = this.props;
// shixun_id
const Id = this.props.match.params.Id
const url = `/exercises/${Id}/commit_shixun.json`
const url = `/${exercise_url || 'exercises'}/${Id}/commit_shixun.json`
axios.get(url, {
params: {
shixun_id

@ -99,7 +99,7 @@ class SingleDisplay extends Component{
if (question_type == 0) { // 单选
return (
<div className="mb10 clearfix" key={optionIndex}>
<Radio disabled className="fl lineh-20" checked={item.standard_boolean}>{prefix}</Radio>
<Radio disabled className="fl lineh-25" checked={item.standard_boolean}>{prefix}</Radio>
<MarkdownToHtml content={item.choice_text} selector={'single_' + (index + 1) + '' + (optionIndex + 1)} style={{ float: 'left', display: 'inline-block' }}
></MarkdownToHtml>
@ -110,7 +110,7 @@ class SingleDisplay extends Component{
return (
<div className="mb10 clearfix" key={optionIndex}>
<Checkbox disabled className="fl lineh-20" checked={item.standard_boolean}>{prefix}</Checkbox>
<Checkbox disabled className="fl lineh-25 mr8" checked={item.standard_boolean}>{prefix}</Checkbox>
<MarkdownToHtml content={item.choice_text} selector={'single_' + (index + 1)+ '' + (optionIndex + 1)} style={{ float: 'left', display: 'inline-block' }}
></MarkdownToHtml>

@ -215,14 +215,14 @@ class GraduateTaskItem extends Component{
<h6>
{
this.props.isAdmin?<a href={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list"}
this.props.isAdmin?<Link to={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list"}
title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
}
{
this.props.isStudent? <a href={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list"}
this.props.isStudent? <Link to={"/courses/"+coursesId+"/graduation_tasks/"+categoryid+"/"+taskid+"/list"}
title={discussMessage.name}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</a>:""
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.name}</Link>:""
}
{

@ -0,0 +1,449 @@
import React, { Component } from 'react';
import {Link} from 'react-router-dom';
import {Tooltip,Menu} from 'antd';
import Loadable from 'react-loadable';
import Loading from '../../../../Loading';
import {BrowserRouter as Router,Route,Switch} from 'react-router-dom';
import axios from 'axios';
import HomeworkModal from "../../coursesPublic/HomeworkModal";
import AccessoryModal from "../../coursesPublic/AccessoryModal";
import Associationmodel from '../../coursesPublic/Associationmodel';
import CoursesListType from '../../coursesPublic/CoursesListType';
import moment from 'moment';
import "../../css/members.css"
import "../../css/Courses.css"
import Modals from '../../../modals/Modals';
//毕设描述
const GraduationTasksquestions= Loadable({
loader: () => import('./GraduationTaskssettingquestions'),
loading: Loading,
})
//毕设任务设置
const GraduationTaskssetting=Loadable({
loader: () => import('./GraduationTaskssetting'),
loading: Loading,
})
//毕设任务列表
const GraduationTaskslist=Loadable({
loader: () => import('./GraduationTaskssettinglist'),
loading: Loading,
})
class GraduationTaskDetail extends Component{
constructor(props){
super(props);
this.state={
modalname:undefined,
visible:false,
Topval:undefined,
starttime:undefined,
starttimes:undefined,
typs:undefined,
endtime:undefined,
Cancelname:undefined,
Savesname:undefined,
Cancel:undefined,
Saves:undefined,
Topvalright:undefined,
Botvalleft:undefined,
course_groupslist:undefined,
course_groups:undefined,
questionslist:undefined,
tab:"list",
visibles:undefined,
Modalstype:undefined,
Modalstopval:undefined,
ModalCancel:undefined,
ModalSave:undefined
}
}
componentDidMount(){
this.getdatas()
}
getdatas=()=>{
const task_Id = this.props.match.params.task_Id;
let url="/graduation_tasks/"+task_Id+".json";
axios.get(url).then((result)=>{
if(result.status===200){
this.setState({
questionslist:result.data
})
}
}).catch((error)=>{
console.log(error)
})
}
//返回
goback=()=>{
// let courseId=this.props.match.params.coursesId;
// let category_id=this.props.match.params.category_id;
// window.location.href="/courses/"+courseId+"/graduation_tasks/"+category_id;
// let courseId = this.props.match.params.coursesId;
// if(courseId===undefined){
// this.props.history.push("/courses");
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
// this.props.history.goBack()
this.props.history.replace(`/courses/${this.state.questionslist.course_id}/graduation_tasks/${this.state.questionslist.graduation_id}`);
}
//立即发布
publish=()=>{
let starttime= this.props.getNowFormatDates(1,1);
let endtime=this.props.getNowFormatDates(2,1);
// this.homeworkstart()
this.setState({
modalname:"立即发布",
visible:true,
Topval:"学生将立即收到毕设任务",
// Botvalleft:"点击修改",
// Botval:`本操作只对"未发布"的分班有效`,
starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") ,
starttimes:this.props.getNowFormatDates(1),
typs:"start",
endtime:endtime,
Cancelname:"暂不发布",
Savesname:"立即发布",
Cancel:this.cancelmodel,
Saves:this.homepublish,
})
}
// 确定立即发布
homepublish=(ids,endtime)=>{
this.cancelmodel();
let task_Id=this.props.match.params.task_Id;
const cid = this.props.match.params.coursesId;
// let url = `/courses/${cid}/graduation_tasks/publish_task.json`;
let url="/courses/"+cid+"/graduation_tasks/publish_task.json"
axios.post(url,{
task_ids:[task_Id],
group_ids: this.state.course_groupslist,
end_time:endtime,
}).then((response)=>{
if (response.data.status == 0) {
this.getdatas()
this.props.showNotification(response.data.message);
this.setState({
// Modalstopval:response.data.message,
// ModalSave:this.cancelmodel,
// Loadtype:true,
course_groupslist:[],
checkAllValue:false
})
}
}).catch((error)=>{
})
}
// 刷新
resetList=()=>{
this.getdatas();
this.child && this.child.searchValue();
}
// 立即截止
end=()=>{
// this.homeworkstart()
this.setState({
modalname:"立即截止",
visible:true,
Topval:"学生将不能再提交作品",
// Botvalleft:"暂不截止",
// Botval:`本操作只对"提交中"的分班有效`,
Cancelname:"暂不截止",
Savesname:"立即截止",
Cancel:this.cancelmodel,
Saves:this.coursetaskend,
typs:"end",
})
}
// 取消
cancelmodel=()=>{
this.setState({
Modalstype:false,
Loadtype:false,
visible:false,
Modulationtype:false,
Allocationtype:false,
Modalstopval:"",
ModalCancel:"",
ModalSave:"",
})
}
getcourse_groupslist=(id)=>{
this.setState({
course_groupslist:id
})
}
setTab = (tab) =>{
this.setState({
tab
})
}
// 关联项目
AssociationItems=()=>{
this.setState({
visibles:true
})
}
Cancel=()=>{
this.setState({
visibles:false
})
}
// 取消关联
cannelAssociation=()=>{
this.setState({
Modalstype:true,
Modalstopval:"确定要取消该项目关联?",
ModalCancel:this.cannerassocition,
ModalSave:this.savetassociton
})
}
savetassociton=()=>{
this.cannerassocition();
let {questionslist}=this.state;
let url = "/graduation_tasks/"+questionslist.task_id+"/graduation_works/cancel_relate_project.json";
console.log(url)
axios.get(url).then((result)=>{
if(result.data.status===0){
this.resetList();
}
}).catch((error)=>{
console.log(error)
})
}
cannerassocition=()=>{
this.setState({
Modalstype:false,
Modalstopval:"",
ModalCancel:"",
ModalSave:"",
loadtype:false,
visibles:false
})
}
// 补交附件
handaccessory=()=>{
// let {taskslistdata}=this.state;
// let courseId=this.props.match.params.coursesId;
//
// let url="/courses/"+courseId+"/graduation_tasks/"+taskslistdata.work_id+"/appraise"
//
// window.location.href=url;
this.setState({
avisible:true
})
}
Cancelvisible=()=>{
this.setState({
avisible:false
})
}
bindRef = ref => { this.child = ref } ;
render(){
let courseId=this.props.match.params.coursesId;
let category_id=this.props.match.params.category_id;
let task_Id=this.props.match.params.task_Id;
let {
questionslist ,
tab ,
visibles ,
Modalstype,
Modalstopval,
ModalCancel,
ModalSave
} = this.state
const commom = {
setTab:this.setTab
}
return(
<div className="newMain clearfix">
{
questionslist &&
<div className={"educontent mb20"}>
<HomeworkModal
starttimes={this.state.starttimes}
typs={this.state.typs}
modalname={this.state.modalname}
visible={this.state.visible}
Topval={this.state.Topval}
Topvalright={this.state.Topvalright}
Botvalleft={this.state.Botvalleft}
Botval={this.state.Botval}
starttime={this.state.starttime}
endtime={this.state.endtime}
Cancelname={this.state.Cancelname}
Savesname={this.state.Savesname}
Cancel={this.state.Cancel}
Saves={this.state.Saves}
course_groups={this.state.course_groups}
modaltype={this.state.modaltype}
getcourse_groupslist={(id) => this.getcourse_groupslist(id)}
/>
{/*关联项目*/}
{visibles===true?
<Associationmodel
modalname={"关联项目"}
visible={visibles}
Cancel={()=>this.Cancel()}
taskid={ questionslist && questionslist.task_id }
funlist={this.resetList}
/>
:""}
{this.state.avisible===true?<AccessoryModal
{...this.props}
modalname={"补交附件"}
visible={this.state.avisible}
Cancelname={"取消"}
Savesname={"确认"}
Cancel={this.Cancelvisible}
categoryid={questionslist.work_id}
setupdate={this.resetList}
/>:""}
{/*提示*/}
<Modals
modalsType={Modalstype}
modalsTopval={Modalstopval}
modalCancel={ModalCancel}
modalSave={ModalSave}
closable={false}
footer={null}
destroyOnClose={true}
centered={true}
/>
<p className="clearfix mt10">
<a onClick={this.goback} className="color-grey-9 fl">{questionslist.course_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<Link to={`/courses/${courseId}/graduation_tasks/${category_id}`} className="color-grey-9 fl">{questionslist.graduation_name}</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span className="color-grey-6">任务详情</span>
</p>
<div className="clearfix mt20 mb20 lineh-25 linbox">
<p className=" fl color-black summaryname">
<Link to={`/courses/${courseId}/graduation_tasks/${category_id}`} className="color-grey-3">{questionslist.task_name}</Link>
</p>
<CoursesListType
typelist={questionslist.task_status}
/>
<a className="color-grey-3 fr font-16 ml30 mr20" onClick={this.goback}>返回</a>
</div>
<div className="stud-class-set bor-bottom-greyE">
<div className="clearfix edu-back-white pl30 pr30 graduationTaskMenu">
<Link className={tab && tab == "list" ? "active" : ""} to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/list"}>任务列表</Link>
<Link className={tab && tab == "questions" ? "active" : ""} to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/questions"}>毕设描述</Link>
<Link className={tab && tab == "setting" ? "active" : ""} to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/setting?tab=3"}>设置</Link>
{/*<a className={"fr color-blue font-16"}>导出成绩</a>*/}
{/*{this.props.isAdmin()?<a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.xls"} className={"fr color-blue font-16"}>导出成绩</a>:""}*/}
{/*{this.props.isAdmin()?<a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.zip"} className={"fr color-blue font-16"}>导出作品附件</a>:""}*/}
<style>
{ `
.drop_down_menu{
height: 118px;
left:0px;
width: 121px;
}
.drop_down_menu li {
overflow: visible;
width: 121px;
}
.drop_down_menu li a{
padding: 0px;
font-size: 14px;
}
.mt19{
margin-top:19px;
}
.drop_down_menu, .drop_down_normal{
padding-top: 10px;
padding-bottom: 8px;
}
.drop_down_menu li .color-dark{
color: #666 !important;
}
.linbox{
height: 26px;
}
`}
</style>
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mt20" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">导出成绩</a></li>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">导出作品附件</a></li>
</ul>
</li>:""}
{questionslist.work_status===undefined||questionslist.work_status===null||questionslist.work_status.length===0?"":questionslist.work_status.map((item,key)=>{
return(
<span key={key}>
{item==="提交作品"?<a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/works/new"}>提交作品</a>:""}
{item==="补交作品"?<a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/works/new"}>补交作品</a>:""}
{item==="修改作品"?<a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+questionslist.work_id+"/works/edit"}>修改作品</a>:""}
{item==="查看作品"?<a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+questionslist.work_id+"/works/edit"}>查看作品</a> :""}
{item==="创建项目"?<a className={"fr color-blue font-16"} href={'/projects/new'} target="_blank">创建项目</a>:""}
{item==="关联项目"?<a className={"fr color-blue font-16"} onClick={this.AssociationItems}>关联项目</a>:""}
{item==="取消关联"?<a className={"fr color-blue font-16"} onClick={this.cannelAssociation}>取消关联</a>:""}
{item==="补交附件"?<a className={"fr color-blue font-16"} onClick={this.handaccessory}>补交附件</a>:""}
</span>
)
})}
{/*<a className={"fr color-blue font-16"}>项目在线质量检测</a>*/}
{ this.props.isAdmin() ? questionslist.status===1 ? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.end()} }>立即截止</a> : "" : "" }
{ this.props.isAdmin() ? questionslist.status===0 ? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.publish()} }>立即发布</a> : "" : "" }
{ this.props.isAdmin() ? <a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+task_Id+"/edit"}>编辑任务</a> : "" }
</div>
</div>
<Switch {...this.props}>
<Route exact path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/list"
render={
(props) => (<GraduationTaskslist {...this.props} {...props} {...this.state} {...commom} triggerRef={this.bindRef} tab={`list`}/>)
}
></Route>
<Route exact path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/setting"
render={
(props) => (<GraduationTaskssetting {...this.props} {...props} {...this.state} {...commom} tab={`setting`}/>)
}
></Route>
<Route exact path="/courses/:coursesId/graduation_tasks/:category_id/:task_Id/questions"
render={
(props) => (<GraduationTasksquestions {...this.props} {...props} {...this.state} {...commom} tab={`questions`}/>)
}></Route>
</Switch>
</div>
}
</div>
)
}
}
// CNotificationHOC() ( SnackbarHOC() ( TPMIndexHOC))
export default (GraduationTaskDetail) ;

@ -50,6 +50,7 @@ class GraduationTaskssettingapp extends Component{
baseonproject:false,
minnum:2,
maxnum:5,
firstTimes:true,
publish_time:null,
end_time:null,
allowlate:1,
@ -114,6 +115,7 @@ class GraduationTaskssettingapp extends Component{
max_nums: result.data.max_num,
task_type: result.data.task_type,
baseonproject: result.data.base_on_project,
firstTimes:!result.data.publish_time && !result.data.end_time,
publish_time:result.data.publish_time===null||result.data.publish_time=== ""?"":moment(moment(handleDateString(result.data.publish_time))).format("YYYY-MM-DD HH:mm"),
end_time:result.data.end_time===null||result.data.end_time=== ""?"":moment(moment(handleDateString(result.data.end_time))).format("YYYY-MM-DD HH:mm"),
allowlate: result.data.allow_late,
@ -150,6 +152,10 @@ class GraduationTaskssettingapp extends Component{
if(this.props.isAdmin()===true&&isNaN(id)){
this.editSetting()
}
let tab = this.props.tab;
this.props.setTab && this.props.setTab(tab);
}
@ -199,16 +205,11 @@ class GraduationTaskssettingapp extends Component{
maxnum:parseInt(e.target.value)
})
}
}
}
onChangeTimepublish= (date, dateString) => {
let endtime;
if(date===null){
this.setState({
@ -217,23 +218,30 @@ class GraduationTaskssettingapp extends Component{
latetime:null
})
}else{
let { firstTimes } = this.state;
// 判断是否是第一次设置
this.setState({
publish_time:moment(moment(handleDateString(dateString))).format("YYYY-MM-DD HH:mm"),
publishTimetypes:false
})
if(firstTimes){
endtime= moment(moment(handleDateString(dateString))).add(1, 'months').format("YYYY-MM-DD HH:mm")
let {allowlate}=this.state;
this.setState({
firstTimes:undefined
})
if(allowlate===true||allowlate===1){
this.setState({
publish_time:moment(moment(handleDateString(dateString))).format("YYYY-MM-DD HH:mm"),
end_time:endtime,
latetime:moment(moment(handleDateString(endtime))).add(1, 'months').format("YYYY-MM-DD HH:mm"),
})
}else{
this.setState({
publish_time:moment(moment(handleDateString(dateString))).format("YYYY-MM-DD HH:mm"),
end_time:endtime
})
}
}
}
}
@ -245,21 +253,24 @@ class GraduationTaskssettingapp extends Component{
latetime:null
})
}else{
let {allowlate}=this.state;
if(allowlate===true||allowlate===1){
let { firstTimes } = this.state;
this.setState({
end_time:moment(moment(handleDateString(dateString))).format("YYYY-MM-DD HH:mm"),
latetime:moment(moment(handleDateString(dateString))).add(1, 'months').format("YYYY-MM-DD HH:mm"),
endTimetypes:false
})
}else{
// 判断是否是第一次设置
if(firstTimes){
this.setState({
end_time:moment(moment(handleDateString(dateString))).format("YYYY-MM-DD HH:mm"),
firstTimes:undefined
})
let {allowlate}=this.state;
if(allowlate===true||allowlate===1){
this.setState({
latetime:moment(moment(handleDateString(dateString))).add(1, 'months').format("YYYY-MM-DD HH:mm"),
})
}
}
}
}
onChangeTimelatetime=(date, dateString)=>{
@ -399,46 +410,6 @@ class GraduationTaskssettingapp extends Component{
opergrade:e.target.checked
})
}
//立即发布
publish=()=>{
let starttime= this.props.getNowFormatDates(1,1);
let endtime=this.props.getNowFormatDates(2,1);
// this.homeworkstart()
this.setState({
modalname:"立即发布",
visibles:true,
Topval:"学生将立即收到毕设任务",
// Botvalleft:"点击修改",
// Botval:`本操作只对"未发布"的分班有效`,
starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") ,
starttimes:this.props.getNowFormatDates(1),
typs:"start",
endtime:endtime,
Cancelname:"暂不发布",
Savesname:"立即发布",
Cancel:this.cancelmodel,
Saves:this.homepublish,
})
}
//立即发布
homeworkstart=()=>{
let coursesId=this.props.match.params.coursesId;
let url="/courses/"+coursesId+"/all_course_groups.json";
axios.get(url).then((response) => {
if(response.status===200){
this.setState({
modaltype:response.data.course_groups===null||response.data.course_groups.length===0?2:1,
course_groups:response.data.course_groups,
})
}
}).catch((error) => {
console.log(error)
});
}
homepublish=(ids,endtime)=>{
let task_Id=this.props.match.params.task_Id;
@ -764,43 +735,12 @@ class GraduationTaskssettingapp extends Component{
})
}
goback=()=>{
// let courseId=this.props.match.params.coursesId;
// if(courseId===undefined){
// this.props.history.push("/courses");
// }else{
// this.props.history.push(this.props.current_user.first_category_url);
// }
// this.props.history.goBack()
// this.props.history.replace(this.props.current_user.first_category_url);
this.props.history.replace(`/courses/${this.state.settingdata.course_id}/graduation_tasks/${this.state.settingdata.graduation_id}`);
}
isgoback=()=>{
this.getsettings();
this.setState({
flagPageEdit: false,
})
}
end=()=>{
this.setState({
modalname:"立即截止",
visibles:true,
Topval:"学生将不能再提交作品",
// Botvalleft:"暂不截止",
// Botval:`本操作只对"提交中"的分班有效`,
Cancelname:"暂不截止",
Savesname:"立即截止",
Cancel:this.cancelmodel,
Saves:this.coursetaskend,
typs:"end",
})
// this.homeworkstart()
}
cancelmodel=()=>{
this.setState({
@ -998,24 +938,6 @@ class GraduationTaskssettingapp extends Component{
modalSave={ModalSave}
loadtype={Loadtype}
/>
{/*/!*立即发布*!/*/}
{/*<PublishModals*/}
{/*modalname={modalname}*/}
{/*visible={visible}*/}
{/*Topval={Topval}*/}
{/*Topvalright={Topvalright}*/}
{/*Botvalleft={Botvalleft}*/}
{/*Botval={Botval}*/}
{/*starttime={starttime}*/}
{/*endtime={endtime}*/}
{/*Cancelname={Cancelname}*/}
{/*Savesname={Savesname}*/}
{/*Cancel={Cancel}*/}
{/*Saves={Saves}*/}
{/*course_groups={course_groups}*/}
{/*skipTop={this.skipTop}*/}
{/*/>*/}
<DownloadMessageysl
{...this.props}
value={this.state.DownloadMessageval}
@ -1049,97 +971,8 @@ class GraduationTaskssettingapp extends Component{
.ant-input{
height:40px;
}
.linbox{
height: 26px;
}
`
}</style>
<div className="newMain clearfix">
<div className={"educontent mb20"}>
<p className="clearfix mt10">
<a onClick={this.goback} className="color-grey-9 fl">{coursename}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<Link to={"/courses/"+courseId+"/graduation_tasks/"+settingdata.graduation_id} className="color-grey-9 fl">毕设任务</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
{/*{taskname===""?"":*/}
{/*<WordsBtn style="grey" className="fl">*/}
{/*<Link to={"/courses/"+courseId+"/graduation"+"/graduation_tasks/"} className="color-grey-6">{taskname}</Link>*/}
{/*<span className="color-grey-c ml3 mr3">&gt;</span>*/}
{/*</WordsBtn>*/}
{/*}*/}
<span className="color-grey-6">任务详情</span>
</p>
<div className="clearfix mt20 mb20 lineh-25 linbox">
<p className=" fl color-black lineh-25 summaryname">
<Link to={"/courses/"+courseId+"/graduation"+"/graduation_tasks/"} className="color-grey-3">{taskname}</Link>
</p>
<CoursesListType
typelist={task_status}
/>
<a className="color-grey-3 fr font-16 ml30 mr20" onClick={this.goback}>返回</a>
</div>
<div className="stud-class-set bor-bottom-greyE" id={"publishtimestart"}>
<div className="mt10 clearfix edu-back-white poll_list pl20" id={"publishtimeend"}>
<Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/list"}>任务列表</Link>
<Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/questions"}>毕设描述</Link>
<Link className="active"
style={{paddingLeft:'38px'}}
to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/setting?tab=3"}>设置</Link>
{/*<a className={"fr color-blue font-16"}>导出</a>*/}
<style>
{ `
.drop_down_menu{
height: 118px;
left:0px;
width: 121px;
}
.drop_down_menu li {
overflow: visible;
width: 121px;
}
.drop_down_menu li a{
padding: 0px;
font-size: 14px;
}
.mt19{
margin-top:19px;
}
.drop_down_menu, .drop_down_normal{
padding-top: 10px;
padding-bottom: 8px;
}
.drop_down_menu li .color-dark{
color: #666 !important;
}
`}
</style>
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr20 mt20" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">导出成绩</a></li>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">导出作品附件</a></li>
</ul>
</li>:""}
{/*{this.props.isAdmin()?<a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.xls"} className={"fr color-blue font-16"}>导出成绩</a>:""}*/}
{/*{this.props.isAdmin()?<a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.zip"} className={"fr color-blue font-16"}>导出作品附件</a>:""}*/}
{/*<a className={"fr color-blue font-16"}>项目在线质量检测</a>*/}
{this.props.isAdmin()?settingdata.status===1?<a className={"fr color-blue font-16 mr20"} onClick={() => { this.end()} }>立即截止</a>:"":""}
{this.props.isAdmin()?settingdata.status===0?<a className={"fr color-blue font-16 mr20"} onClick={() => { this.publish()} }>立即发布</a>:"":""}
{this.props.isAdmin()?<a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+task_Id+"/edit"}>编辑任务</a>:""}
</div>
</div>
<Form id={"starttime"}>
{
!flagPageEdit && this.props.isAdmin() === true ?
@ -1175,7 +1008,7 @@ class GraduationTaskssettingapp extends Component{
<div className={"h20 mb30 ml30"} >
<div className={"ml30"} >
<span>发布时间</span>
<Tooltip placement="bottom" title={this.props.isAdmin()===true?starttimetype===true?"时间已过,不能再修改":"":""}>
<span>
@ -1213,7 +1046,7 @@ class GraduationTaskssettingapp extends Component{
{this.state.publishTimetypesval}
</div>:""}
<div className={"h20 mb30 ml30"} >
<div className={"mt10 ml30"} >
<span>截止时间</span>
<Tooltip placement="bottom" title={this.props.isSuperAdmin()===true?"":this.props.isAdmin()===true?endtimetype===true?"时间已过,不能再修改":"":""}>
<span>
@ -1306,11 +1139,6 @@ class GraduationTaskssettingapp extends Component{
</div>
{/*<div className="stud-class-set bor-bottom-greyE pd20 edu-back-white pl36">*/}
{/*<div className={" font-16 color-dark h20 mb20"}>项目质量检测 </div>*/}
{/*</div>*/}
<div className="stud-class-set bor-bottom-greyE pd20 edu-back-white pl36">
<div className={" font-16 color-dark h20 mb20"}>评分设置 </div>
@ -1437,14 +1265,8 @@ class GraduationTaskssettingapp extends Component{
{/*<Link to={"/courses/"+courseId+"/graduation_tasks/"+position+"/"+category_id+coursesearch} className="defalutCancelbtn fl">取消</Link>*/}
<a onClick={this.isgoback} className="defalutCancelbtn fl">取消</a>
</div>:"":""}
</div>
</div>
</div>:""}
</React.Fragment>
)

@ -1,7 +1,7 @@
import React,{Component} from "React";
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Pagination, Table, Divider, Tag,Tooltip} from "antd";
import {Link} from 'react-router-dom';
import { getImageUrl,WordsBtn } from 'educoder';
import { getImageUrl , NoneData } from 'educoder';
import axios from 'axios';
import moment from 'moment';
import HomeworkModal from "../../coursesPublic/HomeworkModal";
@ -13,6 +13,7 @@ import AllocationModal from "../../coursesPublic/AllocationModal";
import Associationmodel from '../../coursesPublic/Associationmodel';
import AccessoryModal from "../../coursesPublic/AccessoryModal";
const CheckboxGroup = Checkbox.Group;
const Search = Input.Search;
const qs = require('qs');
@ -54,8 +55,18 @@ class GraduationTaskssettinglist extends Component{
}
componentDidMount(){
let tab = this.props.tab;
this.props.setTab && this.props.setTab(tab);
let{teacher_comment,task_status,course_group,cross_comment,order,b_order,search}=this.state;
this.seacthdata(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,this.state.page);
try{
this.props.triggerRef(this)
}catch(e){
}
}
goback=()=>{
@ -837,36 +848,22 @@ class GraduationTaskssettinglist extends Component{
<div>
{this.props.isAdmin()?operation.map((tag,key) => {
return(
<div key={key}>
{/*<Tooltip placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/>*/}
{/*其它历史评分将全部失效</pre>:""}>*/}
{/*{tag.name==="评阅"?tag.status===0?"--":<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >*/}
{/*{tag.name}*/}
{/*</a>*/}
{/*:*/}
{/*<a style={{color:tag.name==="调分"?"#000":'#4CACFF'}}*/}
{/*onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}>*/}
{/*{tag.status===0?"":tag.name}*/}
{/*</a>*/}
{/*}*/}
{/*</Tooltip>*/}
<Tooltip placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/>
其它历史评分将全部失效</pre>:""}>
{tag.name==="评阅"?<a style={{color:'#4CACFF'}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >
<React.Fragment>
{
tag.name &&
<Tooltip key={key} placement="bottom" title={tag.name==="分配"?"指定该作品的交叉评阅人":tag.name==="调分"?<pre>调整学生最终成绩<br/>其它历史评分将全部失效</pre>:""}>
{tag.name==="评阅"?<a style={{color:'#4CACFF',padding:"0px 5px"}} href={"/courses/"+courseId+"/graduation_tasks/"+tag.id+"/appraise"} >
{tag.name}
</a>
:
<a style={{color:tag.name==="调分"?"#000":'#4CACFF'}}
<a style={{color:tag.name==="调分"?"#000":'#4CACFF',padding:"0px 5px"}}
onClick={tag.name==="调分"?()=>this.showModulationtype(tag.id):tag.name==="分配"?()=>this.showAllocationModal(tag.id):""}>
{tag.name}
</a>
}
</Tooltip>
</div>
}
</React.Fragment>
)
}):""}
{
@ -963,9 +960,6 @@ class GraduationTaskssettinglist extends Component{
text-overflow: ellipsis;
white-space: nowrap;
}
.linbox{
height: 26px;
}
.ant-table-tbody>tr>td, .ant-table-thead>tr>th{
padding: 16px 10px
}
@ -1092,97 +1086,10 @@ class GraduationTaskssettinglist extends Component{
{ taskslistdata && taskslistdata ?
// 教师列表
this.props.isAdmin()?<div className="newMain clearfix">
<div className={"educontent mb20"}>
<p className="clearfix mt10">
<a className="color-grey-9 fl" onClick={this.goback}>{taskslistdata.course_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<Link className="color-grey-9 fl" to={"/courses/"+courseId+"/graduation_tasks/"+taskslistdata.graduation_id}>{taskslistdata.graduation_name}</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span className="color-grey-6 fl">任务详情</span>
</p>
<div className="clearfix lineh-25 mt20 mb20 linbox">
<p className=" fl color-black summaryname lineh-25 "> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id} className="color-grey-3">{taskslistdata.task_name}</Link></p>
<CoursesListType
typelist={taskslistdata.task_status}
/>
<a className="color-grey-3 fr font-16 ml30 mr20" onClick={this.goback}>返回</a>
</div>
<div className="stud-class-set bor-bottom-greyE">
<div className="mt10 clearfix edu-back-white poll_list pl20">
{/*<a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.xls"} className={"fr color-blue font-16"}>导出成绩</a>*/}
{/*<a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.zip"} className={"fr color-blue font-16"}>导出作品附件</a>*/}
<Link className="active" to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/list"}>任务列表</Link>
<Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/questions"}>毕设描述</Link>
<Link style={{paddingLeft:'38px'}}
to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/setting?tab=3"}>设置</Link>
{/*<a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+task_Id+"/edit"}>编辑任务</a>*/}
{/*<a className={"fr color-blue font-16"} onClick={this.end}>立即截止</a>*/}
{/*<a className={"fr color-blue font-16"}>导出作品附件</a>*/}
<style>
{ `
.drop_down_menu{
height: 118px;
left:0px;
width: 121px;
}
.drop_down_menu li {
overflow: visible;
width: 121px;
}
.drop_down_menu li a{
padding: 0px;
font-size: 14px;
}
.mt19{
margin-top:19px;
}
.drop_down_menu, .drop_down_normal{
padding-top: 10px;
padding-bottom: 8px;
}
.drop_down_menu li .color-dark{
color: #666 !important;
}
`}
</style>
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr20 mt20" style={{"paddingLeft":"0px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">学生成绩</a></li>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">作品附件</a></li>
</ul>
</li>:""}
{/*<a className={"fr color-blue font-16"}>项目在线质量检测</a>*/}
{taskslistdata.status===1? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.end()} }>立即截止</a>:""}
{taskslistdata.status===0?<a className={"fr color-blue font-16 mr20"} onClick={() => { this.publish()} }>立即发布</a>:""}
<a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+task_Id+"/edit"}>编辑任务</a>
</div>
</div>
this.props.isAdmin() ?
<div className="stud-class-set">
<div className="clearfix edu-back-white" >
{/*提示*/}
{/*<Modals*/}
{/*modalsType={Modalstype}*/}
{/*modalsTopval={Modalstopval}*/}
{/*modalCancel={ModalCancel}*/}
{/*modalSave={ModalSave}*/}
{/*/>*/}
<ul className="clearfix" style={{padding:'20px 40px 10px 40px'}}>
<ul className="clearfix" style={{padding:'20px 30px 10px 30px'}}>
<li className="clearfix">
<span className="fl mr10 color-grey-8">教师评阅</span>
@ -1201,7 +1108,7 @@ class GraduationTaskssettinglist extends Component{
)
})}
</CheckboxGroup>
<div className="fr mr5 search-new" style={{marginBottom:'1px'}}>
<div className="fr mr5 search-new" style={{marginBottom:'1px',marginRight:"0px"}}>
<Search
placeholder="请输入姓名或学号搜索"
id="subject_search_input"
@ -1284,18 +1191,16 @@ class GraduationTaskssettinglist extends Component{
</ul>
<div id="graduation_work_list" style={{padding:'0px 40px 10px 40px'}}>
<div id="graduation_work_list" style={{padding:'0px 30px 10px 30px'}}>
<style>
{
`
{`
.edu-menu-lists li:hover {
background: #f0f0f0 !important;
}
.edu-menu-lists li:hover a{
color: #666 !important;
}
`
}
`}
</style>
<div className="clearfix">
{this.props.isAdmin()===true?<span className="fl color-grey-6 font-12">
@ -1339,23 +1244,17 @@ class GraduationTaskssettinglist extends Component{
{
JSON.stringify(data)==="[]" ?
<div id="forum_list" className="forum_table">
<div className="mh650 edu-back-white">
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20" src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb30">暂时还没有相关数据哦</p>
</div>
</div>
</div>
<NoneData></NoneData>
:
<div className={"justify break_full_word new_li edu-back-white"} style={{minHeight: "480px"}}>
<style>{`
<style>
{`
.ant-spin-nested-loading > div > .ant-spin .ant-spin-dot {
top: 72%;}
top: 72%;
}
`}</style>
}
`}
</style>
<div className="edu-table edu-back-white ">
{data===undefined?"":<Table
dataSource={data}
@ -1385,73 +1284,15 @@ class GraduationTaskssettinglist extends Component{
: ""
}
</div>
</div>
</div>:
:
// 学生列表
this.props.isStudent()||this.props.isNotMember()?
<div className="newMain clearfix">
<div className={"educontent mb20"}>
<p className="clearfix mt10">
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+taskslistdata.graduation_id}>{taskslistdata.course_name}</Link></WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+taskslistdata.graduation_id}className="color-grey-6">{taskslistdata.graduation_name}</Link></WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span>任务详情</span>
</p>
<div style={{ width:'100%',height:'75px'}} >
<p className=" fl color-black mt25 summaryname"> <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id} className="color-grey-6">{taskslistdata.task_name}</Link></p>
<CoursesListType
typelist={taskslistdata.task_status}
typesylename={"mt22"}
/>
<a className="color-grey-6 fr font-16 ml30 mt10 mr20" onClick={this.goback}>返回</a>
</div>
<div className="stud-class-set bor-bottom-greyE">
<div className="mt10 clearfix edu-back-white poll_list pl20">
<Link className="active" to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/list"}>任务列表</Link>
<Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/questions"}>毕设描述</Link>
<Link style={{paddingLeft:'38px'}}
to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/setting"}>设置</Link>
{taskslistdata.work_status===undefined||taskslistdata.work_status===null||taskslistdata.work_status.length===0?"":taskslistdata.work_status.map((item,key)=>{
return(
<span key={key}>
{item==="提交作品"?<a className={"fr color-blue font-16"} href={"/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+category_id+"/"+task_Id+"/works/new"}>提交作品</a>:""}
{item==="补交作品"?<a className={"fr color-blue font-16"} href={"/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+category_id+"/"+task_Id+"/works/new"}>补交作品</a>:""}
{item==="修改作品"?<a className={"fr color-blue font-16"} href={"/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+category_id+"/"+taskslistdata.work_id+"/works/edit"}>修改作品</a>:""}
{item==="查看作品"?<a className={"fr color-blue font-16"} href={"/courses/"+this.props.match.params.coursesId+"/graduation_tasks/"+category_id+"/"+taskslistdata.work_id+"/works/edit"}>查看作品</a> :""}
{item==="创建项目"?<a className={"fr color-blue font-16"} href={'/projects/new'} target="_blank">创建项目</a>:""}
{item==="关联项目"?<a className={"fr color-blue font-16"} onClick={this.AssociationItems}>关联项目</a>:""}
{item==="取消关联"?<a className={"fr color-blue font-16"} onClick={this.cannelAssociation}>取消关联</a>:""}
{item==="补交附件"?<a className={"fr color-blue font-16"} onClick={this.handaccessory}>补交附件</a>:""}
</span>
)
})}
{/*<a className={"fr color-blue font-16"} onClick={this.handaccessory}>补交附件</a>*/}
{/*<a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation/graduation_tasks/"+task_Id+"/edit"}>编辑任务</a>*/}
{/*<a className={"fr color-blue font-16"}>立即截止</a>*/}
{/*<a className={"fr color-blue font-16"}>导出作品附件</a>*/}
{/*<a className={"fr color-blue font-16"}>导出成绩</a>*/}
</div>
</div>
<div className="stud-class-set ">
<div className="clearfix edu-back-white" >
{this.props.isNotMember()?<ul className="clearfix" style={{padding:'20px 40px 10px 40px'}}>
{this.props.isNotMember()?<ul className="clearfix" style={{padding:'20px 30px 10px 30px'}}>
<li className="clearfix">
<span className="fl mr10 color-grey-8">教师评阅</span>
@ -1554,7 +1395,6 @@ class GraduationTaskssettinglist extends Component{
<div id="graduation_work_list" style={{ padding: '18px 40px 10px',height: '56px'}}>
{this.props.isAdmin()===true?
<div className="clearfix">
<span className="fl color-grey-6 font-12">
@ -1576,8 +1416,6 @@ class GraduationTaskssettinglist extends Component{
</div>
</div>
:""}
{this.props.isStudent()===true?
<div className="clearfix">
<span className="mr15 color-grey9">
@ -1595,12 +1433,7 @@ class GraduationTaskssettinglist extends Component{
</Tooltip>}
</div>
:""}
</div>
{
JSON.stringify(data) === "[]" ?
@ -1652,12 +1485,6 @@ class GraduationTaskssettinglist extends Component{
: ""
}
</div>
</div>
</div>
:""
:""}

@ -32,6 +32,8 @@ class GraduationTasksquestions extends Component{
}
componentDidMount(){
let tab = this.props.tab;
this.props.setTab && this.props.setTab(tab);
this.getdatas()
}
@ -295,19 +297,10 @@ class GraduationTasksquestions extends Component{
modaltype={this.state.modaltype}
getcourse_groupslist={(id) => this.getcourse_groupslist(id)}
/>
<style>
{
`
.linbox{
height: 26px;
}
`
}
</style>
{questionslist&&questionslist?<div className="newMain clearfix">
<div className={"educontent mb20"}>
<p className="clearfix mt10">
{/* <p className="clearfix mt10">
<a onClick={this.goback} className="color-grey-9 fl">{questionslist.course_name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<Link to={"/courses/"+courseId+"/graduation_tasks/"+questionslist.graduation_id} className="color-grey-9 fl">{questionslist.graduation_name}</Link>
@ -323,22 +316,22 @@ class GraduationTasksquestions extends Component{
typelist={questionslist.task_status}
/>
<a className="color-grey-3 fr font-16 ml30 mr20" onClick={this.goback}>返回</a>
</div>
</div> */}
<div className="stud-class-set bor-bottom-greyE">
<div className="mt10 clearfix edu-back-white poll_list pl20">
{/* <div className="stud-class-set bor-bottom-greyE">
<div className="mt10 clearfix edu-back-white poll_list pl20"> */}
<Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/list"}>任务列表</Link>
{/* <Link to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/list"}></Link>
<Link className="active" to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/questions"}>毕设描述</Link>
<Link style={{paddingLeft:'38px'}}
to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/setting?tab=3"}>设置</Link>
to={"/courses/"+courseId+"/graduation_tasks/"+category_id+"/"+task_Id+"/setting?tab=3"}>设置</Link> */}
{/*<a className={"fr color-blue font-16"}>导出成绩</a>*/}
{/*{this.props.isAdmin()?<a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.xls"} className={"fr color-blue font-16"}>导出成绩</a>:""}*/}
{/*{this.props.isAdmin()?<a href={"/api/graduation_tasks/"+task_Id+"/tasks_list.zip"} className={"fr color-blue font-16"}>导出作品附件</a>:""}*/}
<style>
{/* <style>
{ `
.drop_down_menu{
height: 118px;
@ -371,14 +364,14 @@ class GraduationTasksquestions extends Component{
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.xlsx")} className="color-dark">导出成绩</a></li>
<li><a onClick={()=>this.confirmysl("/graduation_tasks/"+task_Id+"/tasks_list.zip")} className="color-dark">导出作品附件</a></li>
</ul>
</li>:""}
</li>:""} */}
{/*<a className={"fr color-blue font-16"}>项目在线质量检测</a>*/}
{this.props.isAdmin()?questionslist.status===1? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.end()} }>立即截止</a>:"":""}
{/* {this.props.isAdmin()?questionslist.status===1? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.end()} }></a>:"":""}
{this.props.isAdmin()?questionslist.status===0? <a className={"fr color-blue font-16 mr20"} onClick={() => { this.publish()} }>立即发布</a>:"":""}
{this.props.isAdmin()?<a className={"fr color-blue font-16"} href={"/courses/"+courseId+"/graduation_tasks/"+task_Id+"/edit"}>编辑任务</a>:""}
</div>
</div>
</div> */}

@ -469,7 +469,9 @@ class GraduationTasks extends Component{
checkAllValue:false
})
this.publishcanner();
this.useBankSuccess();
debugger
let {search,page,order} = this.state
this.fetchAll(search,page,order);
}
}).catch((error)=>{
@ -565,6 +567,12 @@ class GraduationTasks extends Component{
let {search,page,order,all_count} = this.state;
this.fetchAll(search,page,order,all_count)
this.setState({
checkBoxValues:object_ids
})
// 立即发布
this.publish();
}
getcourse_groupslist=(id)=>{

@ -57,7 +57,7 @@ class PollDetailTabForth extends Component{
flagPageEdit:undefined,
unitSetting:true,
flagPublic:true,
flagPublic:false,
flagRealName:undefined,
course_group:undefined,
end_time:undefined,

@ -1077,13 +1077,13 @@ class Listofworksstudentone extends Component {
// debugger
let urll = `/homework_commons/${homeworkid}/works_list.json`;
var datasysl = {
search: "",
order: "",
search: this.state.searchtext,
order: this.state.orders,
b_order: "desc",
page: 1,
limit: 20,
work_status: "",
course_group: "",
page: this.state.page,
limit: this.state.limit,
work_status: this.state.course_groupyslstwo,
course_group: this.state.checkedValuesineinfo,
}
axios.post(urll, datasysl).then((result) => {
console.log("980000000____________________");
@ -1449,7 +1449,9 @@ class Listofworksstudentone extends Component {
this.setState({
userids: e.myid,
})
this.viewtraining(e.myid);
window.open(`/courses/${this.state.props.match.params.coursesId}/shixun_homeworks/${e.myid}/shixun_work_report`, '_blank');
// this.viewtraining(e.myid);
}
viewtraining = (userids) => {
// console.log("viewtraining")
@ -2104,7 +2106,8 @@ class Listofworksstudentone extends Component {
this.setState({
userids: e.myid,
})
this.viewtrainingt(e.myid);
// this.viewtrainingt(e.myid);
window.open(`/courses/${this.state.props.match.params.coursesId}/shixun_homeworks/${e.myid}/shixun_work_report`, '_blank');
}
// 关闭调分
cancelModulationModels = () => {
@ -2601,28 +2604,30 @@ class Listofworksstudentone extends Component {
}
.computeTime {
width: 73px;
height: 24px;
width: 122px;
height: 31px;
display: inline-block;
padding: 5px;
text-align: center;
line-height: 13px;
color: #4CACFF;
border: 1px solid #4CACFF;
line-height: 20px;
color: #FE6B21;
border: 1px solid #FE6B21;
cursor: pointer;
border-radius: 4px;
}
.computeTimes{
width: 73px;
height: 24px;
width: 122px;
height: 31px;
display: inline-block;
padding: 5px;
text-align: center;
line-height: 13px;
line-height: 20px;
color: #C5C5C5;
border: 1px solid #EDEDED;
background:#EDEDED;
cursor: pointer;
border-radius: 4px;
}
.shixunSpin{
color:#FF6801;
@ -2641,19 +2646,21 @@ class Listofworksstudentone extends Component {
<ul className="clearfix" style={{padding: '20px 15px 10px 20px'}}>
<li className="clearfix " >
<span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span>
<div className="fr mr5 search-newysl" style={{marginBottom: '1px'}}>
{course_is_end===true?"":<span>
{teacherdata&&teacherdata.publish_immediately===false&&computeTimetype===true?
(this.props.isNotMember()===false?<div className={"computeTime font-13"} onClick={this.setComputeTimet}>
计算成绩
(this.props.isNotMember()===false?<div className={"computeTime font-16"} onClick={this.setComputeTimet}>
查看最新成绩
</div>:""):
teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":
(this.props.isNotMember()===false?<div className={"computeTimes font-13"}>
计算成绩
(this.props.isNotMember()===false?<div className={"computeTimes font-16"}>
查看最新成绩
</div>:"")
}
</span>}
<div className="fr mr5 search-newysl" style={{marginBottom: '1px'}}>
<span className="search-newyslw fr ml20">
<Search
placeholder="请输入姓名或学号搜索"
id="subject_search_input"
@ -2663,6 +2670,7 @@ class Listofworksstudentone extends Component {
onInput={this.inputSearchValuest}
onSearch={this.searchValuest}
></Search>
</span>
</div>
</li>
@ -2843,28 +2851,30 @@ class Listofworksstudentone extends Component {
color:rgba(255,104,0,1);
}
.computeTime {
width: 73px;
height: 24px;
width: 122px;
height: 31px;
display: inline-block;
padding: 5px;
text-align: center;
line-height: 13px;
color: #4CACFF;
border: 1px solid #4CACFF;
line-height: 20px;
color: #FE6B21;
border: 1px solid #FE6B21;
cursor: pointer;
border-radius: 4px;
}
.computeTimes{
width: 73px;
height: 24px;
width: 122px;
height: 31px;
display: inline-block;
padding: 5px;
text-align: center;
line-height: 13px;
line-height: 20px;
color: #C5C5C5;
border: 1px solid #EDEDED;
background:#EDEDED;
cursor: pointer;
border-radius: 4px;
}
`}
</style>
@ -2928,7 +2938,10 @@ class Listofworksstudentone extends Component {
marginBottom: "10px"
}}>
<div className="clearfix">
<div className="clearfix" style={{
lineHeight: "31px !important;",
textAlign: "center;"
}}>
<span className="fl color-grey-6 font-12">
<span
@ -2949,15 +2962,15 @@ class Listofworksstudentone extends Component {
{ course_is_end===true?"":teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"":<span>
{computeTimetype===true?
(this.props.isNotMember()===false?
<div className={"computeTime font-13"} onClick={this.setComputeTime}>
计算成绩
<div className={"computeTime font-16"} onClick={this.setComputeTime}>
查看最新成绩
</div>
:"")
:
(teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":
this.props.isNotMember()===false?
<div className={"computeTimes font-13"}>
计算成绩
<div className={"computeTimes font-16"}>
查看最新成绩
</div>
:"")
}
@ -3098,7 +3111,10 @@ class Listofworksstudentone extends Component {
padding: '20px 20px 10px 20px',
marginBottom: "10px"
}}>
<div className="clearfix">
<div className="clearfix" style={{
lineHeight: "31px !important;",
textAlign: "center;"
}}>
<span className="fl color-grey-6 font-12">
<span className="color-orange-tip">
{teacherdata === undefined ? "0" : teacherdata.commit_count === undefined ? "0" : teacherdata.commit_count}
@ -3128,28 +3144,30 @@ class Listofworksstudentone extends Component {
color:rgba(255,104,0,1);
}
.computeTime {
width: 73px;
height: 24px;
width: 122px;
height: 31px;
display: inline-block;
padding: 5px;
text-align: center;
line-height: 13px;
color: #4CACFF;
border: 1px solid #4CACFF;
line-height: 20px;
color: #FE6B21;
border: 1px solid #FE6B21;
cursor: pointer;
border-radius: 4px;
}
.computeTimes{
width: 73px;
height: 24px;
width: 122px;
height: 31px;
display: inline-block;
padding: 5px;
text-align: center;
line-height: 13px;
line-height: 20px;
color: #C5C5C5;
border: 1px solid #EDEDED;
background:#EDEDED;
cursor: pointer;
border-radius: 4px;
}
`}
</style>
@ -3158,15 +3176,26 @@ class Listofworksstudentone extends Component {
<span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span>
{ course_is_end===true?"":teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"":<span>
{computeTimetype===true?
(this.props.isNotMember()===false?<div className={"computeTime font-13"} onClick={this.setComputeTime}>
计算成绩
(this.props.isNotMember()===false?<div className={"computeTime font-16"} onClick={this.setComputeTime}>
查看最新成绩
</div>:""):
teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":
(this.props.isNotMember()===false?<div className={"computeTimes font-13"}>
计算成绩
(this.props.isNotMember()===false?<div className={"computeTimes font-16"}>
查看最新成绩
</div>:"")
}
</span>}
{/* {teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"":<span>*/}
{/*{computeTimetype===true?*/}
{/* (this.props.isNotMember()===false?<div className={"computeTime font-16"} onClick={this.setComputeTime}>*/}
{/* 查看最新成绩*/}
{/* </div>:""):*/}
{/* teacherdata&&teacherdata.homework_status!==undefined&&teacherdata.homework_status[0]=== "未发布"? "":*/}
{/* (this.props.isNotMember()===false?<div className="computeTimes font-16">*/}
{/* 查看最新成绩*/}
{/* </div>:"")*/}
{/*}*/}
{/*</span>}*/}
</div>
{/*因为计算按钮占了和这个位置,和设计沟通学生视角取消这个按钮*/}

@ -1,14 +1,16 @@
import React, {Component} from "react";
import {WordsBtn,markdownToHTML,ActionBtn,queryString,downloadFile} from 'educoder';
import {WordsBtn,markdownToHTML,ActionBtn,queryString,downloadFile,getImageUrl} from 'educoder';
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider,InputNumber, Tag,DatePicker,Radio,Tooltip,Spin} from "antd";
import {Link,Switch,Route,Redirect} from 'react-router-dom';
import axios from 'axios';
import moment from 'moment';
import Modals from "../../modals/Modals";
import ConclusionEvaluation from './shixunreport/ConclusionEvaluation';
import OfficialAcademicTranscript from './shixunreport/OfficialAcademicTranscript';
import Coursesshixundetails from './shixunreport/Coursesshixundetails';
import Shixunechart from './shixunreport/Shixunechart';
import DownloadMessageysl from "../../modals/DownloadMessageysl";
import DownloadMessageysl from "../../modals/DownloadMessageysl"
import AppraiseModal from "../coursesPublic/AppraiseModal";
import {UnControlled as CodeMirror} from 'react-codemirror2';
import 'codemirror/mode/cmake/cmake';
import 'codemirror/mode/xml/xml';
@ -20,6 +22,7 @@ import '../css/Courses.css';
import './style.css';
import 'moment/locale/zh-cn';
class ShixunWorkReport extends Component {
constructor(props) {
@ -29,7 +32,11 @@ class ShixunWorkReport extends Component {
spinning:true,
DownloadType:false,
DownloadMessageval:undefined,
isspinning:false
isspinning:false,
showAppraiseModaltype:false,
work_comment_hidden:false,
showAppraiseModalsshow:true,
work_comment:null
}
}
@ -41,8 +48,7 @@ class ShixunWorkReport extends Component {
if(child!=undefined){
params =child._getRequestParams()!==undefined?child._getRequestParams():{};
}
console.log("170");
console.log(params);
const urll=url+`?${queryString.stringify(params)}`;
axios.get(urll+ '&export=true').then((response) => {
if(response===undefined){
@ -72,6 +78,7 @@ class ShixunWorkReport extends Component {
}
}).catch((error) => {
console.log(error)
this.setState({ isspinning: false })
});
}
Downloadcal=()=>{
@ -100,6 +107,8 @@ class ShixunWorkReport extends Component {
}else{
this.setState({
data:result.data,
work_comment_hidden:result.data.work_comment_hidden,
work_comment:result.data.work_comment,
spinning:false
})
}
@ -145,17 +154,113 @@ class ShixunWorkReport extends Component {
data:newdata
})
}
showAppraiseModal=(sum)=>{
// if(sum===undefined){
// this.setState({
// showAppraiseModaltype:true,
// })
// }else{
// this.setState({
// showAppraiseModaltype:true,
// work_comment:undefined,
// work_type:0,
// })
//
// }
this.setState({
showAppraiseModaltype:true,
})
}
hideAppraiseModal=()=>{
let{data,work_comment}=this.state;
this.setState({
showAppraiseModaltype:false,
work_comment_hidden:data&&data.work_comment_hidden===true?true:work_comment!=null?true:false,
})
}
showAppraiseModals=(list,type)=>{
let{data,work_comment}=this.state;
this.setState({
showAppraiseModaltype:false,
work_comment_hidden:data&&data.work_comment_hidden===true?true:work_comment!=null?true:false,
work_comment:list,
work_type:type,
showAppraiseModals:true,
showAppraiseModalsshow:true
})
}
isdeleteModal=()=>{
this.setState({
modalsType: true,
modalsTopval:"是否确认删除?",
modalSave: ()=>this.isdeleteModals(),
modalCancel:()=>this.hideisdeleteModal(),
})
}
hideisdeleteModal=()=>{
this.setState({
modalsType: false,
modalsTopval:"是否确认删除?",
modalSave: ()=>this.isdeleteModals(),
modalCancel:()=>this.hideisdeleteModal(),
})
}
isdeleteModals=()=>{
let url =`/student_works/${this.props.match.params.homeworkid}/destroy_work_comment.json`
axios.delete(url).then((response) => {
// const { status } = response.data;
if(response.data.status===0){
this.props.showNotification(response.data.message)
this.setState({
showAppraiseModalsshow:false,
work_comment_hidden:false,
work_comment:undefined,
work_type:0,
})
this.hideisdeleteModal()
}else{
this.props.showNotification(response.data.message)
}
})
.catch(function (error) {
console.log(error);
});
}
render() {
let{data} =this.state;
console.log(data)
console.log(this.props)
let{data,showAppraiseModaltype,work_comment_hidden,showAppraiseModalsshow,work_comment} =this.state;
let category_id=data===undefined?"":data.category===null?"":data.category.category_id;
let homework_common_id=data===undefined?"":data.homework_common_id;
let homeworkid=this.props.match.params.homeworkid;
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
// let showAppraiseModals=this.props&&this.props.isAdminOrTeacher()===true?work_comment===null||work_comment===undefined?false:true:work_comment===null||work_comment===undefined?false:true;
let showAppraiseModals=work_comment===null||work_comment===undefined?false:true;
console.log(showAppraiseModals)
return (
data===undefined?"":<Spin indicator={antIcon} spinning={this.state.spinning}><div className="newMain clearfix ">
data===undefined?"":<Spin indicator={antIcon} spinning={this.state.spinning}>
<Modals
modalsType={this.state.modalsType}
modalsTopval={this.state.modalsTopval}
loadtype={this.state.loadtype}
modalSave={this.state.modalSave}
modalCancel={this.state.modalCancel}
></Modals>
{showAppraiseModaltype===true?<AppraiseModal
{...this.props}
{...this.state}
visible={showAppraiseModaltype}
Cancel={()=>this.hideAppraiseModal()}
showCancel={(list,type)=>this.showAppraiseModals(list,type)}
work_comment={this.state.work_comment}
work_type={this.state.work_type}
/>:""}
<div className="newMain clearfix ">
<div className={"educontent mb20" }>
<div className="educontent">
<DownloadMessageysl
@ -181,18 +286,122 @@ class ShixunWorkReport extends Component {
<div style={{ width:'100%',height:'75px'}} >
<p className=" fl color-black mt25 summaryname">{data&&data.shixun_name}</p>
{/*{this.props.isAdmin()?<a className=" fr font-14 ml30 mt10 mr20 color-grey-9 ">导出实训报告数据</a>:""}*/}
<a onClick={this.goback} className="color-grey-6 fr font-16 ml30 mt15 mr20">返回</a>
<a onClick={this.goback} className="color-grey-6 fr font-14 ml20 mt15">返回</a>
{this.props.isAdmin() ? <a
className=" color-blue font-16 fr ml30 mt15"
className=" color-blue font-14 fr ml20 mt15"
onClick={()=>this.confirmysl(`/student_works/${homeworkid}/export_shixun_work_report.pdf`)}
> <Spin size="small" spinning={this.state.isspinning}>导出实训报告数据</Spin></a> : ""}
{/*{this.props.isAdmin() ?work_comment_hidden===true? "":<a*/}
{/*className=" color-blue font-14 fr ml20 mt15"*/}
{/*onClick={()=>this.showAppraiseModal(1)}*/}
{/*>评阅</a> : ""}*/}
{this.props.isAdmin() ?<a
className=" color-blue font-14 fr ml20 mt15"
onClick={()=>this.showAppraiseModal(1)}
>评阅</a>:""}
</div>
{/*{work_comment===null||work_comment===undefined?"评阅":"编辑评阅"}*/}
<style>{
`
.shixunreporttitleboxtop {
border-bottom: 2px solid #fafafa;
text-align: justify;
height: 62px;
line-height: 24px;
padding-left: 28px;
}
.shixunreporttitleboxbom {
text-align: justify;
line-height: 24px;
}
.ml39{
margin-left: 39px;
}
.back_font{
height: 18px;
font-size: 18px;
font-family: PingFangSC;
font-weight: 400;
color: rgba(51,51,51,1);
line-height: 18px;
margin-bottom: 19px;
}
.passfont{
// display: inline-block;
margin-right: 72px;
}
.passfontmid{
// display: inline-block;
margin-right: 36px;
}
.passfontbom{
// display: inline-block;
margin-right: 58px;
}
.passfontbommid{
// display: inline-block;
margin-right: 93px;
}
.color999{
color: #999999;
}
.colorCF3B3B{
color:#CF3B3B;
}
.color333{
color:#333333;
}
.mt19{
margin-top:19px;
}
.passbox{
display: inline-block;
height: 50px;
}
`
}</style>
<div className="stud-class-set">
<div className="clearfix edu-back-white poll_list">
<div className="font-16 color-dark-21 shixunreporttitle ml20 pd20">总体评价</div>
<div className="font-16 color-dark-21 shixunreporttitleboxtop pd20">总体评价</div>
<div className="font-16 color-dark-21 shixunreporttitleboxbom pd20">
<div style={{clear:"both",height:'100px'}}>
<div className="fl edu-back-white ml10 ">
<img alt="头像" className="radius" height="91" id="nh_user_logo" name="avatar_image"
src={ getImageUrl(`images/${data&&data.image_url}`)}
width="91"/>
</div>
<div className={"fl edu-back-white ml39 "}>
<p className={"back_font"}>{data&&data.username}</p>
<p className={"mb16"}>
<span className={"passbox"}>
<div className={"passfont"}><span className={"color999"}>通过关卡</span> <span className={"colorCF3B3B"}>{data&&data.complete_count}/{data&&data.challenges_count}</span></div>
<div className={"passfontbom"}><span className={"color999"}>经验值</span> <span className={"color333"}>{data&&data.myself_experience}/{data&&data.total_experience}</span></div>
</span>
<span className={"passbox"}>
<div className={"passfontmid"}><span className={"color999"}>课堂最高完成效率</span> <span className={data&&data.max_efficiency===null?"color999":"color333"}>{data&&data.max_efficiency===null?'--':data&&data.max_efficiency}</span></div>
<div className={"passfontbommid"}><span className={"color999"}>完成效率</span> <span className={data&&data.efficiency===null?"color999":"color333"}>{data&&data.efficiency===null?'--':data&&data.efficiency}</span></div>
</span>
<span className={"passbox"}>
<div><span className={"color999"}>通关时间</span> <span className={data&&data.passed_time===null?"color999":"color333"}>{data&&data.passed_time===null||data&&data.passed_time=== "--"?'--':moment(data&&data.passed_time).format('YYYY-MM-DD HH:mm')}</span></div>
<div><span className={"color999"}>实战耗时</span> <span className={data&&data.efficiency===null?"color999":"color333"}>{data&&data.time_consuming===null?'--':data&&data.time_consuming}</span></div>
</span>
</p>
</div>
</div>
</div>
<ConclusionEvaluation
data={data}
/>
@ -200,7 +409,7 @@ class ShixunWorkReport extends Component {
</div>
</div>
<div className="stud-class-set">
<div className="stud-class-set mt19">
<div className="clearfix edu-back-white poll_list">
<div className="font-16 color-dark-21 shixunreporttitle ml20 pd20">阶段成绩</div>
@ -216,15 +425,10 @@ class ShixunWorkReport extends Component {
</div>
</div>
<div className="stud-class-set bor-bottom-greyE"
style={{display:data&&data.work_description===null?"none":""}}
>
<div className="clearfix edu-back-white poll_list">
<div className="font-16 color-dark-21 shixunreporttitle ml20 pd20">个人总结</div>
<style>
{`
.personalsummary{
border:1px solid rgba(235,235,235,1);
border-radius:2px;
}
.pad040{
@ -241,19 +445,62 @@ class ShixunWorkReport extends Component {
color: #999999!important;
font-size: 16px;
}
.pd30{
padding: 30px;
}
`}
</style>
<div className={"pad040"}>
<div className="stud-class-set mt17"
style={{display:data&&data.work_description===null?"none":""}}
>
<div className="clearfix edu-back-white poll_list">
<div className="font-16 color-dark-21 shixunreporttitleboxtop pd20 color333">
个人总结
</div>
<div className="font-16 color-dark-21 shixunreporttitleboxbom pd30">
<div style={{minHeight:'50px'}}>
<div className={"personalsummary"}>
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(data===undefined?"":data.work_description).replace(/▁/g, "▁▁▁")}}
></div>
</div>
</div>
</div>
</div>
</div>
{showAppraiseModals===true&&showAppraiseModalsshow===true?<div className="stud-class-set mt17">
<div className="clearfix edu-back-white poll_list">
<div className="font-16 color-dark-21 shixunreporttitleboxtop pd20 color333">
老师评阅<span>{work_comment_hidden===true||this.state.work_type===1?"(仅对课堂老师可见)":""}</span>
{this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr ml20"
onClick={()=>this.isdeleteModal()}
>删除</a>:""}
{this.props&&this.props.isAdminOrTeacher()===true?<a className="color-blue font-14 fr"
onClick={()=>this.showAppraiseModal()}
>编辑</a>:""}
</div>
<div className="font-16 color-dark-21 shixunreporttitleboxbom pd30">
<div style={{minHeight:'50px'}}>
<div className={"personalsummary"}>
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(data&&data.work_description).replace(/▁/g, "▁▁▁")}}></div>
dangerouslySetInnerHTML={{__html: markdownToHTML(work_comment).replace(/▁/g, "▁▁▁")}}></div>
</div>
</div>
</div>
</div>
</div>:""}
<div className="stud-class-set bor-bottom-greyE">
<div className="stud-class-set bor-bottom-greyE mt17">
<div className="clearfix edu-back-white poll_list">
<div className="font-16 color-dark-21 shixunreporttitle ml20 pd20">图形统计</div>
<Shixunechart

@ -330,7 +330,7 @@ class ShixunhomeWorkItem extends Component{
<div className="cl"></div>
<p className="color-grey panel-lightgrey mt16 fl">
<span className="mr50">
<span className="mr50 df">
{/* <a href="/users/innov" className="panel-name-small hide fl mr15 mr30 color-grey3">{discussMessage.author.name}</a> */}
{ discussMessage.author && <span className="mr15 color-grey-3">{discussMessage.author}</span> }
{discussMessage.commit_count===undefined?"":<span className="mr15 color-grey9">{discussMessage.commit_count} 已交</span>}
@ -357,6 +357,10 @@ class ShixunhomeWorkItem extends Component{
:
<span className="mr15 color-grey9">{discussMessage.status_time}</span>
}
{
discussMessage.upper_category_name && <span className="mr15 color-grey9 task-hide" style={{"maxWidth":"280px"}}>{discussMessage.upper_category_name}</span>
}
{/* { discussMessage.replies_count != 0 && <span className="mr15 color-grey9">{discussMessage.replies_count} </span> }
{ discussMessage.praise_num != 0 && <span className="mr15 color-grey9">{discussMessage.praise_num} 点赞</span> }
@ -378,7 +382,7 @@ class ShixunhomeWorkItem extends Component{
`
}
</style>
{this.props.isAdmin?<div onClick={(event)=>this.stopPro(event)} className={this.props.isAdminOrCreator()?"homepagePostSetting homepagePostSettingname":"homepagePostSetting homepagePostSettingbox"} style={{"right":"-2px","top":"44px","display":"block"}}>
{this.props.isAdmin?<div onClick={(event)=>this.stopPro(event)} className={this.props.isAdminOrCreator()?"homepagePostSetting homepagePostSettingname":"homepagePostSetting homepagePostSettingbox"} style={{"right":"-2px","top":"46px","display":"block"}}>
<Link className="btn colorblue font-16" to={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</Link>
{this.props.isAdminOrCreator()?<a onClick={(event)=>this.editname(discussMessage.name,discussMessage.homework_id,event)} className={"btn colorblue ml20 font-16"}>重命名</a>:""}
{/*<WordsBtn className="btn colorblue ml20 font-16" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>*/}

@ -144,8 +144,17 @@ class ConclusionEvaluation extends Component {
.ant-table-tbody > tr{
height:64px;
}
// .Tablebox .ant-table-body table .ant-table-tbody > tr > td{
// border: none;
// }
.Tablebox .ant-table-body table .ant-table-thead > tr > th{
background: #fff;
border-bottom: 3px solid #fafafa !important;
}
`}</style>
<Table
className={"Tablebox"}
dataSource={datas}
columns={columns}
pagination={false}

@ -10,9 +10,12 @@
/*margin-right: 35px;*/
}
.search-newysl {
width:237px!important;
height: 30px;
margin-bottom: 30px;
}
.search-newyslw{
width:237px!important;
}
.search-new-input {
padding-left: 16px;

@ -36,7 +36,7 @@
.WordNumberTextarea-count {
display: inline-block;
float: right;
font-size: 0.28rem;
font-size: 16px;
color: #adadad;
padding-right: 0.25rem;
}

@ -14,7 +14,7 @@ render() {
onInput={(e)=>this.props.onInput(e)}
maxlength={this.props.maxlength}
/>
<div className="WordNumberTextarea-count"><span>{this.props.value===undefined?0:this.props.value.length}</span>/{this.props.maxlength}</div>
<div className="WordNumberTextarea-count"><span>{this.props.value===undefined||this.props.value===null?0:this.props.value.length}</span>/{this.props.maxlength}</div>
</div>
)
}

@ -219,6 +219,7 @@ class Index extends Component {
praisePlus={context.praisePlus}
git_url={context.git_url}
mirror_name={context.mirror_name}
challenge={context.challenge}
myshixun={context.myshixun}

@ -13,7 +13,7 @@ import ChooseEvaluateView from './main/ChooseEvaluateView'
import { CircularProgress } from 'material-ui/Progress';
import Button from 'material-ui/Button';
import VNCDisplay from './VNCDisplay'
import VNCContainer from './VNCContainer'
import './tpiPage.css';
import './tpiPageForMobile.css';
@ -94,9 +94,13 @@ class MainContent extends Component {
<div className="fl pr tip-right-con" id="update_game_tip"></div>
</div>*/}
{ showIframeContent && vnc_url ? <VNCDisplay
{ showIframeContent && vnc_url ?
<CodeRepositoryViewContainer { ...this.props } isOnlyContainer={true}>
<VNCContainer
vnc_url={vnc_url}
></VNCDisplay>
{...this.props}
></VNCContainer>
</CodeRepositoryViewContainer>
:
<React.Fragment>

@ -0,0 +1,17 @@
.float_button {
background-image: url(./images/float_switch.jpg);
height: 112px;
width: 38px;
position: absolute;
left: -38px;
top: 32%;
cursor: pointer;
}
.float_button .text {
position: relative;
writing-mode: vertical-rl;
top: 36px;
color: #fff;
left: 13px;
user-select: none;
}

@ -0,0 +1,187 @@
import React, { Component } from 'react';
import axios from 'axios'
import { Spin } from 'antd'
import ClipboardJS from 'clipboard'
import VNCDisplay from './VNCDisplay'
import FloatButton from './component/FloatButton'
import SecondDrawer from './component/SecondDrawer'
import RepoTree from './component/repo/RepoTree'
import TPIMonaco from './component/monaco/TPIMonaco'
import notEditablePathImg from '../../images/tpi/notEditablePath.png'
import './VNC.css'
const $ = window.$;
const firstDrawerWidth = 260;
class VNCContainer extends Component {
constructor(props) {
super(props)
this.state = {
fileTreeSelectedKeys: [],
repositoryCode: ''
}
}
componentDidMount() {
if (!this.clipboard) {
const clipboard = new ClipboardJS('.copybtn');
clipboard.on('success', (e) => {
this.props.showSnackbar('复制成功')
});
this.clipboard = clipboard
}
}
getSecondDrawerWidth = () => {
return $('#game_right_contents').width() - firstDrawerWidth
}
renderSecondDrawerChildren = () => {
const { readingCodeLoading, repositoryCode } = this.state;
const height = $(window).height() - 130
const isEditablePath = false;
return (
<Spin tip="加载中..." spinning={readingCodeLoading}>
<div style={{ height: `${height}px` }}>
<div className="codemirrorBackground"
style={{ backgroundImage: `url('${notEditablePathImg}')`, display: (isEditablePath ? 'none' : 'block') }}></div>
<TPIMonaco
{...this.state}
codeLoading={readingCodeLoading}
repositoryCode={repositoryCode}
isEditablePath={false}
></TPIMonaco>
</div>
</Spin>);
}
fetchReadRepositoryCode = (path) => {
const status = 1
const fetchRepoCodeUrl = `/tasks/${this.props.game.identifier}/rep_content.json?path=${path}&status=${status}`
this.setState({ readingCodeLoading: true });
axios.get(fetchRepoCodeUrl, {
}).then((fetchReadRepositoryCodeResponse) => {
if (fetchReadRepositoryCodeResponse.data.content || fetchReadRepositoryCodeResponse.data.content == "") {
this.setState({
repositoryCode: fetchReadRepositoryCodeResponse.data.content,
readingCodeLoading: false
})
} else {
this.setState({ readingCodeLoading: false });
}
// this.setState({ isEditablePath, currentPath: path });
}).catch(error =>{
console.log(error)
this.setState({ readingCodeLoading: false });
this.props.showSnackbar(`服务端异常,请联系管理员!`);
})
}
onTreeSelect = (selectedKeys, info) => {
const isLeaf = info.node.props.isLeaf;
if (isLeaf) { // 叶子节点
selectedKeys.length && this.setState({
fileTreeSelectedKeys: selectedKeys
})
this.refs["secondDrawer"].showSecondDrawer()
console.log('leaf clicked')
const nodePath = info.node.props.eventKey;
if (nodePath) {
const filetype = nodePath.split('.').pop().toLowerCase();
if (filetype == 'jpg' || filetype == 'png' || filetype == 'gif' || filetype == 'jpeg'
|| filetype == 'jar' || filetype == 'exe'
|| filetype == 'doc' || filetype == 'pdf' || filetype == 'xsl' || filetype == 'ppt') {
this.props.showSnackbar(`不支持加载${filetype}类型的文件。`)
return;
}
this.fetchReadRepositoryCode(nodePath);
} else {
console.error('no eventKey:', info.node)
}
}
}
/*
selectedKeys={fileTreeSelectedKeys}
onSelect={onTreeSelect}
*/
render() {
const { challenge, vnc_url, git_url } = this.props
const secondDrawerChildren = this.renderSecondDrawerChildren();
return (
<React.Fragment>
<SecondDrawer
ref="secondDrawer"
floatText={'版本库'}
maskClosable={false}
secondDrawerChildren={secondDrawerChildren}
firstDrawerWidth={firstDrawerWidth}
getSecondDrawerWidth={this.getSecondDrawerWidth}
firstDrawerClassName="repoFilesDrawer vncDrawer"
secondDrawerClassName="codeInDrawer"
>
<style>{`
.vncDrawer .ant-drawer-body {
padding: 0px;
}
.vncDrawer .rc-tree {
padding: 16px;
max-width: 220px;
color: #CBCBCB;
}
.vncDrawer .ant-drawer-wrapper-body {
background: #242324;
}
.codeInDrawer .ant-drawer-wrapper-body {
background: #1D1C1D;
}
.vncDrawer .ant-drawer-header, .codeInDrawer .ant-drawer-header {
border-bottom: 0;
}
.vncDrawer > div:nth-child(1) {
opacity: 1 !important;
}
.vncDrawer > div:nth-child(2) {
top: 0px !important;
height: 100% !important;
min-width: unset;
}
.codeInDrawer .ant-spin-nested-loading > div > .ant-spin .ant-spin-text {
text-shadow: none;
}
`}</style>
<div style={{ 'padding': '16px', 'border-bottom': '1px solid #3A383A' }}>
<div style={{ color: '#888888' }}>网址克隆</div>
<div>
<input value={git_url} readonly={true} style={{ color: '#BABABA', width: '203px', background: 'transparent', border: 'none' }}></input>
<i class="iconfont icon-fuzhi font-14 ml10 copybtn"
style={{color: '#4CACFF', cursor: 'pointer', verticalAlign: 'baseline'}} data-clipboard-text={git_url} ></i>
</div>
</div>
<RepoTree
{...this.props}
fileTreeSelectedKeys={this.state.fileTreeSelectedKeys}
onTreeSelect={this.onTreeSelect}
></RepoTree>
</SecondDrawer>
<FloatButton></FloatButton>
<VNCDisplay
{...this.props}
></VNCDisplay>
</React.Fragment>
);
}
}
export default VNCContainer;

@ -131,19 +131,19 @@ class VNCDisplay extends Component {
return (
<div className="" style={{height: '100%'}}>
<div className="vncDisply" style={{height: '100%'}}>
<style>{`
#top_bar {
.vncDisply #top_bar {
background-color: #6e84a3;
color: white;
font: bold 12px Helvetica;
padding: 6px 5px 4px 5px;
border-bottom: 1px outset;
}
#status {
.vncDisply #status {
text-align: center;
}
#sendCtrlAltDelButton {
.vncDisply #sendCtrlAltDelButton {
position: fixed;
top: 0px;
right: 0px;
@ -151,10 +151,14 @@ class VNCDisplay extends Component {
padding: 5px 5px 4px 5px;
cursor: pointer;
}
#screen {
.vncDisply #screen {
height: 100%;
flex: 1; /* fill remaining space */
overflow: hidden;
background: #666;
}
.vncDisply #screen > div {
background: #666 !important;
}
`}</style>
<div id="top_bar">

@ -0,0 +1,24 @@
import React, { Component } from 'react';
const $ = window.$;
class FloatButton extends Component {
componentDidMount() {
}
render() {
const { challenge, vnc_url, children } = this.props
return (
<div className="float_button" onClick={this.props.onClick}>
<style>{`
`}</style>
<span class="text">{children || '版本库'}</span>
</div>
);
}
}
export default FloatButton;

@ -0,0 +1,101 @@
import React from "react";
import ReactDOM from "react-dom";
import { Drawer } from "antd";
import FloatButton from './FloatButton'
import PropTypes from 'prop-types';
class SecondDrawer extends React.Component {
state = { visible: false, childrenDrawer: false };
showDrawer = () => {
this.setState({
visible: true
});
};
onClose = () => {
this.setState({
visible: false
});
};
showSecondDrawer = () => {
this.setState({
childrenDrawer: true
});
};
onChildrenDrawerClose = () => {
this.setState({
childrenDrawer: false
});
};
swtichFirstDrawer = () => {
this.setState({
visible: !this.state.visible,
childrenDrawer: false
});
};
componentDidMount() {
this.setState({ visible: true }, () => {
this.setState({ visible: false });
});
}
render() {
const { floatText, maskClosable, children, secondDrawerChildren, firstDrawerWidth, getSecondDrawerWidth
,firstDrawerClassName, secondDrawerClassName
} = this.props
const secondDrawerWidth = getSecondDrawerWidth();
// 180 不知道为什么会偏移 180px
return (
<Drawer
mask={!this.state.visible}
title=" "
width={this.state.childrenDrawer ? secondDrawerWidth + firstDrawerWidth - 180 : firstDrawerWidth}
closable={false}
onClose={this.onClose}
visible={this.state.visible}
maskClosable={maskClosable}
className={firstDrawerClassName}
getContainer={false}
>
{/* <button type="primary" onClick={this.showSecondDrawer}>
Two-level drawer
</button> */}
<FloatButton onClick={this.swtichFirstDrawer}>{floatText}</FloatButton>
{ children }
<Drawer
mask={false}
title=" "
width={secondDrawerWidth}
closable={false}
onClose={this.onChildrenDrawerClose}
visible={this.state.childrenDrawer}
className={secondDrawerClassName}
>
{ secondDrawerChildren }
{/* <button
style={{
marginRight: 8
}}
onClick={this.onChildrenDrawerClose}
>
Cancel
</button> */}
</Drawer>
</Drawer>
);
}
}
SecondDrawer.propTypes = {
floatText: PropTypes.string,
maskClosable: PropTypes.bool,
secondDrawerChildren: PropTypes.element,
};
// firstDrawerWidth={firstDrawerWidth}
// getSecondDrawerWidth={this.getSecondDrawerWidth}
export default SecondDrawer

@ -271,6 +271,7 @@ class TPIMonaco extends Component {
const lang = getLanguageByMirrorName(this.props.mirror_name);
const editor = window.monaco.editor.create(document.getElementById('extend-challenge-file-edit'), {
value: value,
readOnly: !this.props.isEditablePath,
// 属性说明
// http://testeduplus2.educoder.net/react/build/static/node_modules/_monaco-editor@0.15.6@monaco-editor/esm/vs/editor/common/config/commonEditorConfig.js
// https://github.com/Microsoft/monaco-editor/issues/29
@ -303,7 +304,7 @@ class TPIMonaco extends Component {
notCallCodeMirrorOnChangeFlag = false
return;
}
this.props.onRepositoryCodeUpdate(editor.getValue())
this.props.onRepositoryCodeUpdate && this.props.onRepositoryCodeUpdate(editor.getValue())
})
this.props.codemirrorDidMount && this.props.codemirrorDidMount()

@ -0,0 +1,54 @@
import React, { useState, useEffect, useContext, useRef, memo } from 'react';
// import { Tree } from 'antd';
// const { TreeNode } = Tree;
import Tree, { TreeNode } from 'rc-tree';
import 'rc-tree/assets/index.css';
const $ = window.$;
export default function RepoTree(props) {
const { fileTreeData, onLoadData, onTreeSelect, fileTreeSelectedKeys, loadRepoFiles } = props;
const [expandedKeys, setExpandedKeys] = useState([])
useEffect(() => {
loadRepoFiles()
}, [])
if (!fileTreeData || fileTreeData.length === 0) {
return ""
}
const onExpand = (expandedKeys) => {
// console.log('onExpand', arguments);
// if not set autoExpandParent to false, if children expanded, parent can not collapse.
// or, you can remove all expanded children keys.
setExpandedKeys(expandedKeys)
}
const loop = (data) => {
return data.map((item) => {
if (item.children) {
return <TreeNode title={item.name} key={item.key}>{loop(item.children)}</TreeNode>;
}
return (
<TreeNode title={item.name} key={item.key} isLeaf={item.isLeaf} />
);
});
};
const treeNodes = loop(fileTreeData);
// selectable={false}
return (
<Tree
onExpand={onExpand}
expandedKeys={expandedKeys}
// autoExpandParent={this.state.autoExpandParent}
loadData={onLoadData}
selectedKeys={fileTreeSelectedKeys}
onSelect={onTreeSelect}
>
{treeNodes}
</Tree>
)
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

@ -101,6 +101,11 @@ class CodeRepositoryViewContainer extends Component {
drawerOpen: open,
})
}
loadRepoFiles = () => {
if (!this.state.fileTreeData) {
this.fetchRepoFiles();
}
}
componentWillReceiveProps(newProps, oldProps) {
@ -271,16 +276,32 @@ class CodeRepositoryViewContainer extends Component {
render() {
return (
<React.Fragment>
{this.props.isOnlyContainer == true ?
React.Children.map(this.props.children, child => {
if(!child) {
return ''
}
return React.cloneElement(child, Object.assign({...this.state}, {
loadRepoFiles: this.loadRepoFiles,
onTreeSelect: this.onTreeSelect,
onLoadData: this.onLoadData,
}))
})
:
<CodeRepositoryView {...this.props}
{...this.state}
showFilesDrawer={this.showFilesDrawer}
loadRepoFiles={this.loadRepoFiles}
onLoadData={this.onLoadData}
onTreeSelect={ this.onTreeSelect }
onRepositoryViewExpand={this.onRepositoryViewExpand}
tabIndexChange={this.tabIndexChange}
showSettingDrawer={this.showSettingDrawer}
></CodeRepositoryView>
></CodeRepositoryView> }
</React.Fragment>
);
}
}

@ -22,51 +22,49 @@ class ShixunPathCard extends Component{
pathList && pathList.map((item,key)=>{
return(
<div className="square-Item" id={"item_"+key}>
{
item.tag_name === null ? "" :
<div className="squareCard" id={"item_"+key}>
{/* item.tag_name === null ? "" :
<div className="tag-green">
<span className="tag-name">{item.tag_name}</span>
{/*<img src={getImageUrl('images/educoder/tag2.png')}/>*/}
</div>
}
<img src={getImageUrl('images/educoder/tag2.png')}/>
</div> */}
{
item.excellent === false ? "" :
<div className="tag-orange">
<span className="tag-name">开放课程</span>
<div className="tag_open">
<span className="tag_open_name">开放课程</span>
</div>
}
<div className={item.allow_visit=== false ? "closeSquare" : "none"}>
{/* <div className={item.allow_visit=== false ? "closeSquare" : "none"}>
<img src={getImageUrl("images/educoder/icon/lockclose.svg")}
className="mt80 mb25"/>
<p className="font-14 color-white">非试用内容需要授权</p>
</div>
<Link to={"/paths/"+item.id} className="square-img" >
</div> */}
<Link to={"/paths/"+item.id} className="squareImg" >
{/*target="_blank"*/}
<img alt="详情图片" src={"/"+item.image_url} style={{"display":"block"}}/>
<img alt="详情图片" src={getImageUrl("/"+item.image_url)}/>
</Link>
<div className="square-main">
<p className="task-hide">
<Link to={"/paths/"+item.id} className="justify color-grey-name" >{item.name}</Link>
<div className="mt20" style={{marginLeft:"1px"}}>
<p className="task-hide mb10">
<Link to={"/paths/"+item.id} className="justify cardName">{item.name}</Link>
{/*target="_blank"*/}
</p>
<p className="clearfix mt8 font-12 color-grey-B4">
<p className="clearfix squareInfo">
<Tooltip placement="bottom" title={"章节"}>
<span className="mr10 fl squareIconSpan"><i className="iconfont icon-shixun fl mr3"></i>{item.stages_count}</span>
</Tooltip>
{/* <Tooltip placement="bottom" title={"章节"}> */}
{/* <i className="iconfont icon-shixun fl mr3"></i> */}
<span className="fl pr squareLine mr20">章节: {item.stages_count}</span>
{/* </Tooltip> */}
{/*<Tooltip placement="bottom" title={"经验值"}>*/}
{/*<span className="mr10 fl squareIconSpan"><i className="iconfont icon-jingyan fl mr3"></i>{item.shixuns_count}</span>*/}
{/*</Tooltip>*/}
<Tooltip placement="bottom" title={"学习人数"}>
<span className="mr10 fl squareIconSpan"><i className="iconfont icon-chengyuan fl mr3"></i>{item.members_count}</span>
</Tooltip>
{/* <Tooltip placement="bottom" title={"学习人数"}> */}
{/* <i className="iconfont icon-chengyuan fl mr3"></i> */}
<span className="fl">学习人数: {item.members_count}</span>
{/* </Tooltip> */}
</p>
</div>
</div>

@ -7,8 +7,8 @@ import Pagination from '@icedesign/base/lib/pagination';
import '@icedesign/base/lib/pagination/style.js';
import './ShixunPaths.css';
import path from '../../images/path/path.png';
const Search = Input.Search;
class ShixunPathSearch extends Component{
constructor(props) {
@ -122,9 +122,12 @@ class ShixunPathSearch extends Component{
{this.state.updata===undefined?"":<UpgradeModals
{...this.state}
/>}
<div className="path-head pr">
<div className="edu-txt-center pathNavLine">
<div className="inline path-nav">
<div className="pr">
<div className="pathImg">
<img src={path} width="100%"/>
</div>
<div className="edu-back-white padding20 pathIndexNav">
<ul className="educontent clearfix">
<li className={select > 0 ? "" : "active"}><a onClick={()=>this.changeSelect(null)}>全部</a></li>
{
sortList && sortList.map((item,key)=>{
@ -133,14 +136,14 @@ class ShixunPathSearch extends Component{
)
})
}
</ul>
</div>
</div>
</div>
<div className="mt20 educontent mb20 clearfix">
<div className="mt20 educontent mb20 clearfix mainPageArray">
{/*<a href="javascript:void(0)" className={ order == "publish_time" ? "fl mr20 font-16 bestChoose active" : "fl mr20 font-16 bestChoose"} onClick={ () => this.changeStatus("publish_time")}>全部</a>*/}
{/*<a href="javascript:void(0)" className={ order == "mine" ? "fl mr20 font-16 bestChoose active" : "fl mr20 font-16 bestChoose"} onClick={ () => this.changeStatus("mine")}>我的</a>*/}
<span className={ order == "updated_at" ? "fl mr20 font-16 bestChoose active pointer" : "fl mr20 font-16 bestChoose pointer"} onClick={ () => this.changeStatus("updated_at")}>最新</span>
<span className={ order == "myshixun_count" ? "fl mr20 font-16 bestChoose active pointer" : "fl mr20 font-16 bestChoose pointer"} onClick={ () => this.changeStatus("myshixun_count")}>最热</span>
<span className={ order == "updated_at" ? "active" : ""} onClick={ () => this.changeStatus("updated_at")}>最新</span>
<span className={ order == "myshixun_count" ? "active" : ""} onClick={ () => this.changeStatus("myshixun_count")}>最热</span>
{/*<div className="fr mr5 search-new">*/}
{/*/!* <Search*/}
{/*placeholder="请输入路径名称进行搜索"*/}

@ -1,3 +1,123 @@
.pathImg{
background: #4CACFF
}
.pathIndexNav{
box-shadow:0px 4px 8px 0px rgba(0,0,0,0.04);
}
.pathIndexNav ul li{
float: left;
margin-right: 10px;
}
.pathIndexNav ul li a{
display: block;
font-size: 15px;
color: #333333;
padding:0px 20px;
border-radius:18px;
height: 32px;
line-height: 32px;
margin:5px 0px;
}
.pathIndexNav ul li.active a{
background: #DDECF9;
color: #4CACFF
}
/* 首页-最新最热 */
.mainPageArray span{
font-size: 14px;
float: left;
background: #EBEBEB;
padding: 0px 16px;
height: 30px;
line-height: 30px;
color: #666666;
margin-right: 20px;
cursor: pointer;
border-radius: 15px;
}
.mainPageArray span.active{
background: #4CACFF;
color: #fff;
}
/* path-card */
.squareCard{
position: relative;
width: 280px;
margin-right: 26px;
margin-bottom: 40px;
float: left;
border-radius: 6px;
}
.squareCard:nth-child(4n){
margin-right: 0px;
}
.squareCard .squareImg{
height: 175px;
width: 280px;
overflow: hidden;
display: block;
border-radius: 6px;
}
.squareCard .squareImg img{
transition: all 0.6s;
-webkit-transition: all 0.6s;
-o-transition: all 0.6s;
width: 100%;
}
.squareCard .squareImg img:hover{
transform: scale(1.2);
}
/* card info */
.cardName{
font-size: 16px;
font-weight: 600;
height: 20px;
line-height: 20px;
margin-bottom: 10px;
}
.squareLine:after{
position: absolute;
width: 1px;
height: 10px;
background: #adadad;
content: '';
right: -10px;
top:4px;
}
.squareInfo{
color: #777;
font-size: 12px;
font-weight: 400;
height: 18px;
line-height: 18px;
}
/* tag-开放课程 */
.tag_open {
position: absolute;
left: 0px;
top: 12px;
z-index: 1;
}
.tag_open .tag_open_name {
display: block;
width: auto;
background-color: #FF6800;
background-size: 100% 100%;
padding: 0px 8px;
color: #fff;
display: block;
height: 28px;
line-height: 28px;
border-radius: 0px 15px 15px 0px;
}
.paragraph:hover .status_li a{
display: block;
}

@ -2,7 +2,7 @@ import React, { Component } from "react";
import { message, Icon, Input, Form, Upload} from "antd";
import axios from 'axios'
import ModalWrapper from "../../courses/common/ModalWrapper"
import { City, getUploadActionUrl, getImageUrl, ImageLayerHook } from 'educoder'
import { City, getUploadActionUrl, getImageUrl, ImageLayerHook, getUploadActionUrlOfAuth } from 'educoder'
import '../account/common.css'
import authImg from '../../../images/account/auth.png'
@ -125,14 +125,14 @@ class RealNameCertificationModal extends Component{
const { moduleName } = this.props
const { getFieldDecorator } = this.props.form;
let {certification}=this.props;
// /api/users/accounts/${this.props.current_user.login}/auth_attachment.json
const uploadProps2 = {
name: 'image',
data:{type:certification == 1 ? "real_name" : "professional"},
multiple: true,
showUploadList: false,
// https://newweb.educoder.net
action: this.props.current_user ? `/api/users/accounts/${this.props.current_user.login}/auth_attachment.json` : '',
action: this.props.current_user ? `${getUploadActionUrlOfAuth(this.props.current_user.login)}` : '',
className: 'idPic-uploader',
onChange: this.handleChange2,
};

Loading…
Cancel
Save