diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 05a4463cd..6c4a20fa9 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -31,7 +31,7 @@ export function initAxiosInterceptors(props) { // proxy = "http://testbdweb.trustie.net" // proxy = "http://testbdweb.educoder.net" proxy = "https://testeduplus2.educoder.net" - // proxy="http://47.96.87.25:48080" + proxy="http://47.96.87.25:48080" // 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求; // 如果需要支持重复的请求,考虑config里面自定义一个allowRepeat参考来控制 diff --git a/public/react/src/modules/courses/busyWork/CommonWorkItem.js b/public/react/src/modules/courses/busyWork/CommonWorkItem.js index ad755338c..7f5bea2da 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkItem.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkItem.js @@ -8,7 +8,6 @@ import { WordsBtn } from 'educoder' import AccessoryModal2 from '../coursesPublic/AccessoryModal2' import AccessoryModal from '../coursesPublic/AccessoryModal' import axios from 'axios' -import ConnectProject from './ConnectProject' class CommonWorkItem extends Component{ constructor(props){ super(props); @@ -128,7 +127,7 @@ class CommonWorkItem extends Component{ } { - mainList && mainList.homeworks.length>0 && mainList.homeworks.map((item,index)=>{ + mainList && mainList.homeworks && mainList.homeworks.length>0 && mainList.homeworks.map((item,index)=>{ let canNotLink = !isAdminOrStudent && item.private_icon == true return(
@@ -196,7 +195,7 @@ class CommonWorkItem extends Component{
  • { // item.work_status && item.work_status.indexOf('关联项目') != -1 && - + this.props.openConnectionProject(item)}>关联项目 } { // item.work_status && item.work_status.indexOf('提交作品') != -1 && diff --git a/public/react/src/modules/courses/busyWork/CommonWorkList.js b/public/react/src/modules/courses/busyWork/CommonWorkList.js index 7142d3d00..6abfcd777 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkList.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkList.js @@ -47,9 +47,14 @@ function buildColumns(that, student_works) { } let courseId= that.props.match.params.coursesId; let workId= that.props.match.params.workId; - const { course_group_count } = that.state; + const { course_group_count, homework_status } = that.state; const isAdmin = that.props.isAdmin() const isAdminOrStudent = that.props.isAdminOrStudent() + const isStudent = that.props.isStudent() + const isNiPing = homework_status.indexOf('匿评中') != -1 + // https://www.trustie.net/issues/21450 分组作业作品列表 学时视角,匿评阶段的列表显示信息不正确 + const niPingAndIsStudent = isStudent && isNiPing + let columns = [{ width: 60, title: '序号', @@ -76,21 +81,24 @@ function buildColumns(that, student_works) { {text}
  • ), - }, { - width: 180, - title: '学号', - dataIndex: 'student_id', - key: 'student_id', - - render: (text, record) => ( - - {record.student_id} - - ), }] + if (!niPingAndIsStudent) { + columns.push({ + width: 180, + title: '学号', + dataIndex: 'student_id', + key: 'student_id', + + render: (text, record) => ( + + {record.student_id} + + ), + }) + } // TODO 只有有分班时才显示分班列 - if (course_group_count != 0) { + if (course_group_count != 0 && !niPingAndIsStudent) { columns.push( { title: '分班', key: 'group_name', @@ -103,7 +111,7 @@ function buildColumns(that, student_works) { ), } ) } - if (gotWorkGroup) { + if (gotWorkGroup && !niPingAndIsStudent) { columns.push({ width: 72, title: '分组', @@ -154,45 +162,52 @@ function buildColumns(that, student_works) { {update_time ? moment(update_time).format('YYYY-MM-DD hh:mm') : '--'} ), - }, { - width: 72, - title: '教师评分', - key: 'teacher_score', - dataIndex: 'teacher_score', - - render: (teacher_score, record) => ( - - + }]) + if (!niPingAndIsStudent) { + columns.push({ + width: 72, + title: '教师评分', + key: 'teacher_score', + dataIndex: 'teacher_score', + + render: (teacher_score, record) => ( + + + + { renderScore(teacher_score) } + + + ), + }) + + columns.push({ + width: 72, + title: '助教评分', + key: 'teaching_asistant_score', + dataIndex: 'teaching_asistant_score', + /** + * 2名助教进行了评分 + 平均分:85.0分 + * + */ + render: (teaching_asistant_score, record) => ( - { renderScore(teacher_score) } - - - ), - }, { - width: 72, - title: '助教评分', - key: 'teaching_asistant_score', - dataIndex: 'teaching_asistant_score', -/** - * 2名助教进行了评分 -平均分:85.0分 - * - */ - render: (teaching_asistant_score, record) => ( - - { -
    {record.ta_comment_count}名助教进行了评分
    -
    {that.state.ta_mode == 1 ? '平均分': '复审分'}:{teaching_asistant_score}分
    - ) } - > - - {renderScore(teaching_asistant_score) } -
    } -
    - ), - }]) + { +
    {record.ta_comment_count}名助教进行了评分
    +
    {that.state.ta_mode == 1 ? '平均分': '复审分'}:{teaching_asistant_score}分
    + ) } + > + + {renderScore(teaching_asistant_score) } +
    } + + ), + }) + } + + if (that.state.anonymous_comment) { /** @@ -242,36 +257,37 @@ function buildColumns(that, student_works) { ), }) } - - columns.push({ - width: 72, - title: '最终成绩', - key: 'work_score', - dataIndex: 'work_score', - render: (work_score, record) => { - return ( - - -
    {`${record.user_name}(${record.user_login})`}
    - { record.ultimate_score ? -
    最终调整成绩:{record.work_score}分
    : + if (!niPingAndIsStudent) { + columns.push({ + width: 72, + title: '最终成绩', + key: 'work_score', + dataIndex: 'work_score', + render: (work_score, record) => { + return ( + + - { record.final_score &&
    作业评分:{record.final_score}分
    } - { record.late_penalty >= 0 &&
    迟交扣分:{record.late_penalty}分
    } - { record.absence_penalty >= 0 &&
    缺评扣分:{record.absence_penalty}分
    } - { record.appeal_penalty >= 0 &&
    违规匿评扣分:{record.appeal_penalty}分
    } -
    最终成绩:{record.work_score}分
    - } - ) - }> - { renderScore(work_score) } -
    -
    - ) - }, - }) +
    {`${record.user_name}(${record.user_login})`}
    + { record.ultimate_score ? +
    最终调整成绩:{record.work_score}分
    : +
    + { record.final_score &&
    作业评分:{record.final_score}分
    } + { record.late_penalty >= 0 &&
    迟交扣分:{record.late_penalty}分
    } + { record.absence_penalty >= 0 &&
    缺评扣分:{record.absence_penalty}分
    } + { record.appeal_penalty >= 0 &&
    违规匿评扣分:{record.appeal_penalty}分
    } +
    最终成绩:{record.work_score}分
    +
    } + ) + }> + { renderScore(work_score) } +
    +
    + ) + }, + }) + } if (isAdminOrStudent || that.props.work_public == true) { columns.push({ width: 92, diff --git a/public/react/src/modules/courses/busyWork/ConnectProject.js b/public/react/src/modules/courses/busyWork/ConnectProject.js index 9d201009d..4e359651b 100644 --- a/public/react/src/modules/courses/busyWork/ConnectProject.js +++ b/public/react/src/modules/courses/busyWork/ConnectProject.js @@ -5,6 +5,7 @@ import '../css/members.css' import { WordsBtn } from 'educoder' import axios from 'axios' import InfiniteScroll from 'react-infinite-scroller'; +import NoneData from "../coursesPublic/NoneData" const Search =Input.Search; const LIMIT = 15 @@ -36,7 +37,7 @@ class ConnectProject extends Component{ this.connectProject(radioValue) } connectProject = (project_id) => { - let workId=this.props.work.homework_id; + let workId=this.work.homework_id; const url = `/homework_commons/${workId}/student_works/relate_project.json` axios.post(url, { project_id: project_id @@ -75,6 +76,9 @@ class ConnectProject extends Component{ loading: false, hasMore: result.data.projects.length != 0 }) + if (page == 1) { + this.setState({ haveProjects: result.data.projects.length > 0 }) + } } }).catch((error)=>{ console.log(error); @@ -84,11 +88,12 @@ class ConnectProject extends Component{ if (window.location.port == 3007) { window.location.href = '/testbdweb.educoder.net/projects/new' } else { - window.location.href = '/educoder.net/projects/new' + window.location.href = '/projects/new' } } //关联项目 - openConnectionProject=()=>{ + openConnectionProject=(work)=>{ + this.work = work; this.fetchData() this.setState({ project_flag:true @@ -104,10 +109,9 @@ class ConnectProject extends Component{ } render(){ - let {project_flag, projects, loading, hasMore }=this.state; + let {project_flag, projects, loading, hasMore, haveProjects }=this.state; return( - 关联项目
    { - projects && !!projects.length && + (projects && !!projects.length || this.state.keyword) &&
    {this.setState({keyword: e.target.value})}} @@ -145,7 +149,11 @@ class ConnectProject extends Component{
    } { - (!projects || projects.length == 0) && + haveProjects && projects.length == 0 && + + } + { + (!haveProjects) &&
    您当前尚未管理任何项目,请先创建项目再关联
    diff --git a/public/react/src/modules/courses/busyWork/commonWork.js b/public/react/src/modules/courses/busyWork/commonWork.js index 9f3d8dda0..b0b80d147 100644 --- a/public/react/src/modules/courses/busyWork/commonWork.js +++ b/public/react/src/modules/courses/busyWork/commonWork.js @@ -9,6 +9,7 @@ import '../css/busyWork.css' import CoursesListType from '../coursesPublic/CoursesListType' import CommonWorkItem from './CommonWorkItem' import PublishRightnow from './PublishRightnow' +import ConnectProject from './ConnectProject' import { WordsBtn } from 'educoder' import Modals from '../../modals/Modals' @@ -53,7 +54,9 @@ class commonWork extends Component{ let {page,search,order}=this.state; this.getList(page,search,order); } - + openConnectionProject = (work) => { + this.refs['connectProject'].openConnectionProject(work) + } // 新建 createCommonWork=(type)=>{ @@ -338,6 +341,8 @@ class commonWork extends Component{
    */} + + - + { - mainList && mainList.homeworks.length==0 && + mainList && mainList.homeworks && mainList.homeworks.length==0 && } { diff --git a/public/react/src/modules/courses/common/comments/CCommentItem.js b/public/react/src/modules/courses/common/comments/CCommentItem.js index d02c76f5d..45ebb364b 100644 --- a/public/react/src/modules/courses/common/comments/CCommentItem.js +++ b/public/react/src/modules/courses/common/comments/CCommentItem.js @@ -46,9 +46,9 @@ class CCommentItem extends Component{ let { item, commentIndex }=this.props; const url = `/student_works/${studentWorkId}/cancel_appeal.json` - axios.post(url, { data: { + axios.post(url, { score_id: item.id - }}) + }) .then((response) => { if (response.data.status == 0) { this.showNotification('撤销成功') @@ -262,9 +262,21 @@ class CCommentItem extends Component{ return(
    - + + {item.image_url == '--' ? + + 用户头像 + + : + 用户头像 + } + + {/* 用户头像 - + */}
    diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index d1b077bbf..74e79b172 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -9,7 +9,6 @@ import '../css/Courses.css'; import Modals from "../../modals/Modals"; import AddStudentModal from '../members/modal/AddStudentModal' import AddTeacherModal from '../members/modal/AddTeacherModal' -import Trialapplication from "../../login/Trialapplication"; // 点击按钮复制功能 // function jsCopy(){ @@ -44,35 +43,14 @@ class CoursesBanner extends Component { modalsBottomval: "", antIcon:false, coursedata:undefined, - user_phone_binded:false, - isRenders:false, - showTrial:false, } } componentDidMount() { this.onloadupdatabanner() - try { - if(this.props.current_user!==undefined){ - this.setState({ - user_phone_binded :this.props.current_user.user_phone_binded, - }) - } - }catch (e) { - console.log("CoursesBanner 60") - console.log(e) - } } - componentDidUpdate = (prevProps) => { - if(prevProps.current_user!=this.props.current_user){ - if(this.props.current_user!==undefined){ - this.setState({ - user_phone_binded :this.props.current_user.user_phone_binded, - }) - } - } - } + onloadupdatabanner=()=>{ this.updatabanner() } @@ -82,19 +60,10 @@ class CoursesBanner extends Component { axios.get(url).then((result) => { if( result!=undefined){ let data = result.data; - if(result.data.status === 407){ - this.setState({ - isRenders:true, - coursedata: data, - showTrial:false, - }) - }else{ this.setState({ coursedata: data, - showTrial:true, }) - } }else{ this.onloadupdatabanner() } @@ -352,11 +321,10 @@ class CoursesBanner extends Component { } render() { - let { Addcoursestypes, coursedata, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon,user_phone_binded} = this.state; + let { Addcoursestypes, coursedata, modalsType, modalsTopval, loadtype,modalsBottomval,antIcon} = this.state; return (
    - { coursedata === undefined || coursedata.status===401?
    :
    @@ -390,7 +358,7 @@ class CoursesBanner extends Component { { coursedata===undefined || coursedata.status===401 || coursedata.status===407?"": - + {coursedata.name} diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js index 7421170d6..b68458e3f 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js @@ -83,7 +83,7 @@ class GraduationTasksSubmitnew extends Component{ } handleSubmit=(e) => { - + console.log("86"); let {fileList,selectmemberslist,workslist}=this.state; if(fileList.length === 0){ @@ -91,7 +91,7 @@ class GraduationTasksSubmitnew extends Component{ Modalstype:true, Modalstopval:'请上传附件!', Loadtype:true, - ModalCancel:this.cancelAttachment + ModalSave:this.cancelAttachment, }) @@ -119,7 +119,7 @@ class GraduationTasksSubmitnew extends Component{ listid.push(list.response.id) } - e.preventDefault(); + // e.preventDefault(); if( GraduationTasksnewtype===true){ this.props.form.validateFields((err, values) => { if (!err) { @@ -408,7 +408,27 @@ class GraduationTasksSubmitnew extends Component{ selectmemberslist:selects }) } + onSearchKeywordKeyUp = (e) => { + if (e.keyCode === 13) { + } + } + onSearckeyd=(e)=>{ + if(e.keyCode){ + + let {search} = this.state; + this.searchList(search,1,10) + } + } + onSearchKeywordKeyUps= (e)=>{ + if(e.keyCode=== 13){ + } + } + onKeywordSearchKeyDown = (e) => { + if(e.keyCode == 13) { + return false; + } + } gocannel=()=>{ window.history.go(-1) } @@ -483,7 +503,8 @@ render(){ 返回
    -
    + {/**/}
    - 已选 {checkBoxValues.length} 个 + { isAdmin && hasGraduationModule && 已选 {checkBoxValues.length} 个 } {
    - { this.hasGraduationModule() && isAdminOrTeacher &&
  • + { hasGraduationModule && isAdminOrTeacher &&
  • 加入答辩组
      diff --git a/public/react/src/modules/login/EducoderLogin.js b/public/react/src/modules/login/EducoderLogin.js index 91e8fac3d..f084dec66 100644 --- a/public/react/src/modules/login/EducoderLogin.js +++ b/public/react/src/modules/login/EducoderLogin.js @@ -177,9 +177,7 @@ class EducoderLogin extends Component { "align-items": "center", "width": "100%", }}> -
      © 2019 EduCoder 湘ICP备17009477号 Trustie & IntelliDE inside
      - - +
      © 2019 EduCoder湘ICP备17009477号Trustie   &   IntelliDE inside.
  • diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 17061f530..ef629e27c 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -170,6 +170,7 @@ class NewHeader extends Component { submitapplications:false, isRender:false, isRenders:false, + user_phone_binded:false, showTrial:false, } console.log("176") @@ -207,7 +208,20 @@ class NewHeader extends Component { } + componentDidUpdate = (prevProps) => { + if(prevProps.user!=this.props.user){ + // console.log("216") + // console.log(prevProps.user); + // console.log(this.props.user); + if(this.props.user !== undefined){ + this.setState({ + user_phone_binded :this.props.user.user_phone_binded, + }) + } + + } + } componentWillReceiveProps(newProps, oldProps) { this.setState({ user:newProps.user @@ -567,6 +581,7 @@ submittojoinclass=(value)=>{ user, isRender, isRenders, + user_phone_binded, }=this.state; /* 用户名称 用户头像url @@ -588,11 +603,11 @@ submittojoinclass=(value)=>{ }else { activeIndex = true; } - // join_course_url: "https://www.educoder.net/courses/join_course_multi_role" // join_project_url: "https://www.educoder.net/applied_project/applied_project_info" // rolearr:["",""], - // console.log() + console.log("618"); + console.log(user_phone_binded); return (