window.$(`.topicItem${index} input`).click() }>
- { isAdmin ? checkBox : ""}
+ { isAdmin ?
{checkBox} : ""}
+
)}
diff --git a/public/react/src/modules/courses/members/modal/AddStudentModal.js b/public/react/src/modules/courses/members/modal/AddStudentModal.js
index 217bc8332..de95bc741 100644
--- a/public/react/src/modules/courses/members/modal/AddStudentModal.js
+++ b/public/react/src/modules/courses/members/modal/AddStudentModal.js
@@ -1,288 +1,288 @@
-import React, { Component } from "react";
-import { Modal, Checkbox, Input, Spin, Select, Divider } from "antd";
-import axios from 'axios'
-import ModalWrapper from "../../common/ModalWrapper"
-import InfiniteScroll from 'react-infinite-scroller';
-import { ROLE_TEACHER_NUM, ROLE_ASSISTANT_NUM } from '../common'
-import NoneData from '../../coursesPublic/NoneData'
-import { ConditionToolTip, ThemeContext } from 'educoder'
-import SchoolSelect from '../../coursesPublic/form/SchoolSelect'
-
-const Option = Select.Option;
-const pageCount = 15;
-class AddStudentModal extends Component{
- constructor(props){
- super(props);
- this.state={
- checkBoxValues: [],
- users: [],
- hasMore: true,
- loading: false,
- courseGroup: '',
- page: 1,
- isSpin:false
- }
- }
- fetchMemberList = (arg_page) => {
- const courseId = this.props.match.params.coursesId
- const page = arg_page || this.state.page;
- const { name, school_name } = this.state
- let url = `/courses/${courseId}/search_users.json?page=${page}&limit=${pageCount}&school_name=${school_name || ''}&name=${name || ''}`
- this.setState({ loading: true })
- axios.get(url)
- .then((response) => {
- if (!response.data.users || response.data.users.length == 0) {
- this.setState({
- users: page == 1 ? response.data.users : this.state.users,
- page,
- loading: false,
- hasMore: false,
- })
- } else {
- this.setState({
- users: page == 1 ? response.data.users : this.state.users.concat(response.data.users),
- page,
- loading: false,
- hasMore: response.data.users.length == pageCount
- })
- }
-
- })
- .catch(function (error) {
- console.log(error);
- });
- }
- componentDidMount() {
-
-
- }
- fetchOptions = () => {
- // add_teacher_popup
- const courseId = this.props.match.params.coursesId
-
- let url = `/courses/${courseId}/all_course_groups.json`
-
- axios.get(url, {
- })
- .then((response) => {
- if (response.data.course_groups && response.data.course_groups.length) {
- this.setState({
- course_groups: response.data.course_groups,
- courseGroup: response.data.course_groups[0].id
- })
- } else {
- // showNotification('')
- }
- })
- .catch(function (error) {
- console.log(error);
- });
- }
- setVisible = (visible) => {
- if (visible) {
- this.setState({school_name: this.props.user.user_school})
- this.fetchMemberList()
- this.fetchOptions()
- }
- this.refs.modalWrapper.setVisible(visible)
- if (visible == false) {
- this.setState({
- checkBoxValues: []
- })
- }
- }
-
- onSendOk = () => {
-
- if(!this.state.checkBoxValues || this.state.checkBoxValues.length == 0) {
- this.props.showNotification('请从列表中先选择用户。')
- return;
- }
- this.setState({
- isSpin:true
- })
- const courseId = this.props.match.params.coursesId
- const url = `/courses/${courseId}/add_students_by_search.json`
- const params = {
- "user_ids": this.state.checkBoxValues
- }
- const { courseGroup } = this.state
- if (courseGroup) {
- params.course_group_id = courseGroup
- }
- axios.post(url, params)
- .then((response) => {
- if (response.data.status == 0) {
- this.setVisible(false)
- this.props.showNotification('添加成功')
- this.props.addStudentSuccess && this.props.addStudentSuccess(params)
- this.setState({
- isSpin:false
- })
- }
- })
- .catch(function (error) {
- console.log(error);
- });
- }
-
- onOk = () => {
- this.onSendOk()
- }
-
- onCheckBoxChange = (checkBoxValues) => {
- this.setState({
- checkBoxValues: checkBoxValues
- })
- }
-
- handleInfiniteOnLoad = () => {
- this.fetchMemberList(this.state.page + 1)
- }
-
- onSearch = () => {
- this.fetchMemberList(1)
- }
- handleCourseGroupChange = (value) => {
- this.setState({
- courseGroup: value
- })
- }
- render(){
- const { users, checkBoxValues, loading, hasMore, name, school_name
- , courseGroup, course_groups,isSpin } = this.state
- const { moduleName } = this.props
- let theme = this.context;
- return(
-
-
-
- {/* */}
-
-
-
-
- {'姓名'}
- {'学号'}
- {'单位'}
- {''}
-
-
-
- { loading || users.length ?
- {/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
-
-
-
-
- { users.map( candidate => {
- return (
-
-
-
- 12 }>
-
- { candidate.name ?
-
- { candidate.name }
- : }
-
-
-
-
- 12 }>
- {candidate.student_id || ' '}
-
-
- {candidate.school_name}
- {candidate.added ? '已加入' : ''}
-
-
- )
- }) }
-
- {loading && hasMore && (
-
-
-
- )}
-
-
-
- {course_groups && course_groups.length &&
- 所选学生分班至(选填):
-
- { course_groups.map((item) => {
- return {item.name}
- })}
-
-
}
-
: }
-
-
- )
- }
-}
-
-AddStudentModal.contextType = ThemeContext;
-export default AddStudentModal;
+import React, { Component } from "react";
+import { Modal, Checkbox, Input, Spin, Select, Divider } from "antd";
+import axios from 'axios'
+import ModalWrapper from "../../common/ModalWrapper"
+import InfiniteScroll from 'react-infinite-scroller';
+import { ROLE_TEACHER_NUM, ROLE_ASSISTANT_NUM } from '../common'
+import NoneData from '../../coursesPublic/NoneData'
+import { ConditionToolTip, ThemeContext } from 'educoder'
+import SchoolSelect from '../../coursesPublic/form/SchoolSelect'
+
+const Option = Select.Option;
+const pageCount = 15;
+class AddStudentModal extends Component{
+ constructor(props){
+ super(props);
+ this.state={
+ checkBoxValues: [],
+ users: [],
+ hasMore: true,
+ loading: false,
+ courseGroup: '',
+ page: 1,
+ isSpin:false
+ }
+ }
+ fetchMemberList = (arg_page) => {
+ const courseId = this.props.match.params.coursesId
+ const page = arg_page || this.state.page;
+ const { name, school_name } = this.state
+ let url = `/courses/${courseId}/search_users.json?page=${page}&limit=${pageCount}&school_name=${school_name || ''}&name=${name || ''}`
+ this.setState({ loading: true })
+ axios.get(url)
+ .then((response) => {
+ if (!response.data.users || response.data.users.length == 0) {
+ this.setState({
+ users: page == 1 ? response.data.users : this.state.users,
+ page,
+ loading: false,
+ hasMore: false,
+ })
+ } else {
+ this.setState({
+ users: page == 1 ? response.data.users : this.state.users.concat(response.data.users),
+ page,
+ loading: false,
+ hasMore: response.data.users.length == pageCount
+ })
+ }
+
+ })
+ .catch(function (error) {
+ console.log(error);
+ });
+ }
+ componentDidMount() {
+
+
+ }
+ fetchOptions = () => {
+ // add_teacher_popup
+ const courseId = this.props.match.params.coursesId
+
+ let url = `/courses/${courseId}/all_course_groups.json`
+
+ axios.get(url, {
+ })
+ .then((response) => {
+ if (response.data.course_groups && response.data.course_groups.length) {
+ this.setState({
+ course_groups: response.data.course_groups,
+ courseGroup: response.data.course_groups[0].id
+ })
+ } else {
+ // showNotification('')
+ }
+ })
+ .catch(function (error) {
+ console.log(error);
+ });
+ }
+ setVisible = (visible) => {
+ if (visible) {
+ this.setState({school_name: this.props.user.user_school})
+ this.fetchMemberList()
+ this.fetchOptions()
+ }
+ this.refs.modalWrapper.setVisible(visible)
+ if (visible == false) {
+ this.setState({
+ checkBoxValues: []
+ })
+ }
+ }
+
+ onSendOk = () => {
+
+ if(!this.state.checkBoxValues || this.state.checkBoxValues.length == 0) {
+ this.props.showNotification('请从列表中先选择用户。')
+ return;
+ }
+ this.setState({
+ isSpin:true
+ })
+ const courseId = this.props.match.params.coursesId
+ const url = `/courses/${courseId}/add_students_by_search.json`
+ const params = {
+ "user_ids": this.state.checkBoxValues
+ }
+ const { courseGroup } = this.state
+ if (courseGroup) {
+ params.course_group_id = courseGroup
+ }
+ axios.post(url, params)
+ .then((response) => {
+ if (response.data.status == 0) {
+ this.setVisible(false)
+ this.props.showNotification('添加成功')
+ this.props.addStudentSuccess && this.props.addStudentSuccess(params)
+ this.setState({
+ isSpin:false
+ })
+ }
+ })
+ .catch(function (error) {
+ console.log(error);
+ });
+ }
+
+ onOk = () => {
+ this.onSendOk()
+ }
+
+ onCheckBoxChange = (checkBoxValues) => {
+ this.setState({
+ checkBoxValues: checkBoxValues
+ })
+ }
+
+ handleInfiniteOnLoad = () => {
+ this.fetchMemberList(this.state.page + 1)
+ }
+
+ onSearch = () => {
+ this.fetchMemberList(1)
+ }
+ handleCourseGroupChange = (value) => {
+ this.setState({
+ courseGroup: value
+ })
+ }
+ render(){
+ const { users, checkBoxValues, loading, hasMore, name, school_name
+ , courseGroup, course_groups,isSpin } = this.state
+ const { moduleName } = this.props
+ let theme = this.context;
+ return(
+
+
+
+ {/* */}
+
+
+
+
+ {'姓名'}
+ {'学号'}
+ {'单位'}
+ {''}
+
+
+
+ { loading || users.length ?
+ {/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
+
+
+
+
+ { users.map( candidate => {
+ return (
+
+
+
+ 12 }>
+
+ { candidate.name ?
+
+ { candidate.name }
+ : }
+
+
+
+
+ 12 }>
+ {candidate.student_id || ' '}
+
+
+ {candidate.school_name}
+ {candidate.added ? '已加入' : ''}
+
+
+ )
+ }) }
+
+ {loading && hasMore && (
+
+
+
+ )}
+
+
+
+ {course_groups && course_groups.length &&
+ 所选学生分班至(选填):
+
+ { course_groups.map((item) => {
+ return {item.name}
+ })}
+
+
}
+
: }
+
+
+ )
+ }
+}
+
+AddStudentModal.contextType = ThemeContext;
+export default AddStudentModal;
diff --git a/public/react/src/modules/courses/members/modal/AddTeacherModal.js b/public/react/src/modules/courses/members/modal/AddTeacherModal.js
index 21902a782..b397f7838 100644
--- a/public/react/src/modules/courses/members/modal/AddTeacherModal.js
+++ b/public/react/src/modules/courses/members/modal/AddTeacherModal.js
@@ -1,355 +1,355 @@
-import React, { Component } from "react";
-import { Modal, Checkbox, Input, Spin, Select, Divider, Icon } from "antd";
-import axios from 'axios'
-import ModalWrapper from "../../common/ModalWrapper"
-import InfiniteScroll from 'react-infinite-scroller';
-import { ROLE_TEACHER_NUM, ROLE_ASSISTANT_NUM } from '../common'
-import { ConditionToolTip, ActionBtn } from 'educoder'
-import NoneData from '../../coursesPublic/NoneData'
-import AddGraduationGroupModal from './AddGraduationGroupModal'
-import SchoolSelect from '../../coursesPublic/form/SchoolSelect'
-
-const Option = Select.Option;
-const pageCount = 15;
-let timeout, currentValue
-class AddTeacherModal extends Component{
- constructor(props){
- super(props);
- this.state={
- school_names: [],
- checkBoxValues: [],
- candidates: [],
- hasMore: true,
- loading: false,
- page: 1
- }
- }
- fetchMemberList = (arg_page) => {
- const courseId = this.props.match.params.coursesId
- const page = arg_page || this.state.page;
- const { name, school_name } = this.state
- let url = `/courses/${courseId}/search_teacher_candidate.json`
- this.setState({ loading: true })
- axios.post(url, {
- page: page,
- limit: pageCount,
- school_name: school_name || '',
- name: name || ''
- })
- .then((response) => {
- if (!response.data.candidates || response.data.candidates.length == 0) {
- this.setState({
- candidates: page == 1 ? response.data.candidates : this.state.candidates,
- page,
- loading: false,
- hasMore: false,
- })
- } else {
- this.setState({
- candidates: page == 1 ? response.data.candidates : this.state.candidates.concat(response.data.candidates),
- page,
- loading: false,
- hasMore: response.data.candidates.length == pageCount
- })
- }
-
- })
- .catch(function (error) {
- console.log(error);
- });
- }
- componentDidMount() {
-
-
- }
- onAddGraduationGroupOk = () => {
- this.fetchOptions()
- }
- fetchOptions = () => {
- // add_teacher_popup
- const courseId = this.props.match.params.coursesId
-
- let url = `/courses/${courseId}/add_teacher_popup.json`
-
- axios.get(url, {
- })
- .then((response) => {
-
- if (response.data.school_name) {
- this.setState({
- school_name: response.data.school_name
- }, () => this.fetchMemberList())
- } else {
- this.fetchMemberList()
-
- }
- if (response.data.graduation_groups) {
- this.setState({
- graduation_groups: response.data.graduation_groups
- })
- }
- if (response.data.course_groups) {
- this.setState({
- course_groups: response.data.course_groups
- })
- }
-
- })
- .catch(function (error) {
- console.log(error);
- });
- }
- setVisible = (visible) => {
- if (visible) {
- this.fetchOptions()
- }
- this.refs.modalWrapper.setVisible(visible)
- if (visible == false) {
- this.setState({
- checkBoxValues: []
- })
- }
- }
-
- onSendOk = () => {
- const courseId = this.props.match.params.coursesId
- const url = `/courses/${courseId}/add_teacher.json`
- if (this.state.checkBoxValues.length == 0) {
- this.props.showNotification('请先在下面列表中选择要添加教师的成员')
- return
- }
- const params = {
- "user_list": this.state.checkBoxValues.map (item => { return { 'user_id': item }}) ,
- // "graduation_group_id": "2",
- // "course_group_id": "820",
- "role": this.props.isTeacher ? ROLE_TEACHER_NUM : ROLE_ASSISTANT_NUM
- }
- const { graduationGroup, courseGroup } = this.state
- if (graduationGroup) {
- params.graduation_group_id = graduationGroup
- }
- if (courseGroup) {
- params.course_group_id = courseGroup
- }
- axios.post(url, params)
- .then((response) => {
- if (response.data.status == 0) {
- this.setVisible(false)
- this.props.showNotification('添加成功')
- this.props.addTeacherSuccess && this.props.addTeacherSuccess(params)
- }
- })
- .catch(function (error) {
- console.log(error);
- });
- }
-
- onOk = () => {
- this.onSendOk()
- }
-
- onCheckBoxChange = (checkBoxValues) => {
- this.setState({
- checkBoxValues: checkBoxValues
- })
- }
-
- handleInfiniteOnLoad = () => {
- this.fetchMemberList(this.state.page + 1)
- }
-
- onSearch = () => {
- this.fetchMemberList(1)
- }
- handleGradationGroupChange = (value) => {
- this.setState({
- graduationGroup: value
- })
- }
- handleCourseGroupChange = (value) => {
- this.setState({
- courseGroup: value
- })
- }
- onOrgNameChange = (value) => {
- // console.log('school_name: ', value)
- this.setState({ school_name: value })
- }
-
- hasGraduationModule = () => {
- const { course_modules } = this.props;
- const result = course_modules && course_modules.filter( item => {
- return item.type == 'graduation'
- })
- return result && result.length > 0
- }
-
- render(){
- const { candidates, checkBoxValues, loading, hasMore, name, school_name, school_names
- , graduationGroup, graduation_groups, courseGroup, course_groups } = this.state
- const { moduleName } = this.props
-
- return(
-
-
-
-
- {/* graduation_groups && !!graduation_groups.length */}
-
-
-
-
- {'姓名'}
- {'昵称'}
- {'单位'}
- {''}
-
-
- { loading || candidates.length ?
- {/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
-
-
-
-
- { candidates && candidates.map( candidate => {
- return (
-
-
-
- {/* "color":"#4c4c4c" */}
- 12 }>
-
- {candidate.name}
-
-
-
-
- 12 }>
- {candidate.nickname || ' '}
-
-
- {candidate.school_name}
- {candidate.added ? '已加入' : ''}
-
-
- )
- }) }
-
- {loading && hasMore && (
-
-
-
- )}
-
-
-
-
: }
-
- { this.hasGraduationModule() &&
-
添加至答辩组:
-
(
-
- {menu}
-
- {/*
{ debugger; this.refs['addGraduationGroupModal'].setVisible(true) }}
- >添加答辩组 */}
-
{ debugger; this.refs['addGraduationGroupModal'].setVisible(true) }}
- >
- 添加答辩组
-
-
- )}
- >
- { graduation_groups && graduation_groups.map((item) => {
- return {item.name}
- })}
-
-
}
-
- { course_groups && !!course_groups.length &&
- 管理权限:
-
- { course_groups && course_groups.map((item) => {
- return {item.name}
- })}
-
-
}
-
-
- )
- }
-}
-export default AddTeacherModal;
+import React, { Component } from "react";
+import { Modal, Checkbox, Input, Spin, Select, Divider, Icon } from "antd";
+import axios from 'axios'
+import ModalWrapper from "../../common/ModalWrapper"
+import InfiniteScroll from 'react-infinite-scroller';
+import { ROLE_TEACHER_NUM, ROLE_ASSISTANT_NUM } from '../common'
+import { ConditionToolTip, ActionBtn } from 'educoder'
+import NoneData from '../../coursesPublic/NoneData'
+import AddGraduationGroupModal from './AddGraduationGroupModal'
+import SchoolSelect from '../../coursesPublic/form/SchoolSelect'
+
+const Option = Select.Option;
+const pageCount = 15;
+let timeout, currentValue
+class AddTeacherModal extends Component{
+ constructor(props){
+ super(props);
+ this.state={
+ school_names: [],
+ checkBoxValues: [],
+ candidates: [],
+ hasMore: true,
+ loading: false,
+ page: 1
+ }
+ }
+ fetchMemberList = (arg_page) => {
+ const courseId = this.props.match.params.coursesId
+ const page = arg_page || this.state.page;
+ const { name, school_name } = this.state
+ let url = `/courses/${courseId}/search_teacher_candidate.json`
+ this.setState({ loading: true })
+ axios.post(url, {
+ page: page,
+ limit: pageCount,
+ school_name: school_name || '',
+ name: name || ''
+ })
+ .then((response) => {
+ if (!response.data.candidates || response.data.candidates.length == 0) {
+ this.setState({
+ candidates: page == 1 ? response.data.candidates : this.state.candidates,
+ page,
+ loading: false,
+ hasMore: false,
+ })
+ } else {
+ this.setState({
+ candidates: page == 1 ? response.data.candidates : this.state.candidates.concat(response.data.candidates),
+ page,
+ loading: false,
+ hasMore: response.data.candidates.length == pageCount
+ })
+ }
+
+ })
+ .catch(function (error) {
+ console.log(error);
+ });
+ }
+ componentDidMount() {
+
+
+ }
+ onAddGraduationGroupOk = () => {
+ this.fetchOptions()
+ }
+ fetchOptions = () => {
+ // add_teacher_popup
+ const courseId = this.props.match.params.coursesId
+
+ let url = `/courses/${courseId}/add_teacher_popup.json`
+
+ axios.get(url, {
+ })
+ .then((response) => {
+
+ if (response.data.school_name) {
+ this.setState({
+ school_name: response.data.school_name
+ }, () => this.fetchMemberList())
+ } else {
+ this.fetchMemberList()
+
+ }
+ if (response.data.graduation_groups) {
+ this.setState({
+ graduation_groups: response.data.graduation_groups
+ })
+ }
+ if (response.data.course_groups) {
+ this.setState({
+ course_groups: response.data.course_groups
+ })
+ }
+
+ })
+ .catch(function (error) {
+ console.log(error);
+ });
+ }
+ setVisible = (visible) => {
+ if (visible) {
+ this.fetchOptions()
+ }
+ this.refs.modalWrapper.setVisible(visible)
+ if (visible == false) {
+ this.setState({
+ checkBoxValues: []
+ })
+ }
+ }
+
+ onSendOk = () => {
+ const courseId = this.props.match.params.coursesId
+ const url = `/courses/${courseId}/add_teacher.json`
+ if (this.state.checkBoxValues.length == 0) {
+ this.props.showNotification('请先在下面列表中选择要添加教师的成员')
+ return
+ }
+ const params = {
+ "user_list": this.state.checkBoxValues.map (item => { return { 'user_id': item }}) ,
+ // "graduation_group_id": "2",
+ // "course_group_id": "820",
+ "role": this.props.isTeacher ? ROLE_TEACHER_NUM : ROLE_ASSISTANT_NUM
+ }
+ const { graduationGroup, courseGroup } = this.state
+ if (graduationGroup) {
+ params.graduation_group_id = graduationGroup
+ }
+ if (courseGroup) {
+ params.course_group_id = courseGroup
+ }
+ axios.post(url, params)
+ .then((response) => {
+ if (response.data.status == 0) {
+ this.setVisible(false)
+ this.props.showNotification('添加成功')
+ this.props.addTeacherSuccess && this.props.addTeacherSuccess(params)
+ }
+ })
+ .catch(function (error) {
+ console.log(error);
+ });
+ }
+
+ onOk = () => {
+ this.onSendOk()
+ }
+
+ onCheckBoxChange = (checkBoxValues) => {
+ this.setState({
+ checkBoxValues: checkBoxValues
+ })
+ }
+
+ handleInfiniteOnLoad = () => {
+ this.fetchMemberList(this.state.page + 1)
+ }
+
+ onSearch = () => {
+ this.fetchMemberList(1)
+ }
+ handleGradationGroupChange = (value) => {
+ this.setState({
+ graduationGroup: value
+ })
+ }
+ handleCourseGroupChange = (value) => {
+ this.setState({
+ courseGroup: value
+ })
+ }
+ onOrgNameChange = (value) => {
+ // console.log('school_name: ', value)
+ this.setState({ school_name: value })
+ }
+
+ hasGraduationModule = () => {
+ const { course_modules } = this.props;
+ const result = course_modules && course_modules.filter( item => {
+ return item.type == 'graduation'
+ })
+ return result && result.length > 0
+ }
+
+ render(){
+ const { candidates, checkBoxValues, loading, hasMore, name, school_name, school_names
+ , graduationGroup, graduation_groups, courseGroup, course_groups } = this.state
+ const { moduleName } = this.props
+
+ return(
+
+
+
+
+ {/* graduation_groups && !!graduation_groups.length */}
+
+
+
+
+ {'姓名'}
+ {'昵称'}
+ {'单位'}
+ {''}
+
+
+ { loading || candidates.length ?
+ {/* https://github.com/CassetteRocks/react-infinite-scroller/issues/70 */}
+
+
+
+
+ { candidates && candidates.map( candidate => {
+ return (
+
+
+
+ {/* "color":"#4c4c4c" */}
+ 12 }>
+
+ {candidate.name}
+
+
+
+
+ 12 }>
+ {candidate.nickname || ' '}
+
+
+ {candidate.school_name}
+ {candidate.added ? '已加入' : ''}
+
+
+ )
+ }) }
+
+ {loading && hasMore && (
+
+
+
+ )}
+
+
+
+
: }
+
+ { this.hasGraduationModule() &&
+
添加至答辩组:
+
(
+
+ {menu}
+
+ {/*
{ debugger; this.refs['addGraduationGroupModal'].setVisible(true) }}
+ >添加答辩组 */}
+
{ debugger; this.refs['addGraduationGroupModal'].setVisible(true) }}
+ >
+ 添加答辩组
+
+
+ )}
+ >
+ { graduation_groups && graduation_groups.map((item) => {
+ return {item.name}
+ })}
+
+
}
+
+ { course_groups && !!course_groups.length &&
+ 管理权限:
+
+ { course_groups && course_groups.map((item) => {
+ return {item.name}
+ })}
+
+
}
+
+
+ )
+ }
+}
+export default AddTeacherModal;
diff --git a/public/react/src/modules/courses/members/modal/CreateGroupByImportModal.js b/public/react/src/modules/courses/members/modal/CreateGroupByImportModal.js
index fe2a88dce..d5e77da9d 100644
--- a/public/react/src/modules/courses/members/modal/CreateGroupByImportModal.js
+++ b/public/react/src/modules/courses/members/modal/CreateGroupByImportModal.js
@@ -112,12 +112,13 @@ class CreateGroupByImportModal extends Component{
render(){
const { candidates, checkBoxValues, loading, hasMore, name, school_name, school_names
- , graduationGroup, graduation_groups, courseGroup, course_groups } = this.state
+ , graduationGroup, graduation_groups, courseGroup, course_groups , fileList } = this.state
const { moduleName } = this.props
const props = {
name: 'file',
multiple: true,
+ fileList:fileList,
action: getUploadActionUrl(),
onRemove: this.onAttachmentRemove,
onChange: this.handleChange
@@ -131,26 +132,15 @@ class CreateGroupByImportModal extends Component{
onOk={this.onOk}
className="createGroupByImport"
>
-
-
-
-
-
-
-
-
-
-
-
- 点击或拖拽文件到这里上传
-
- 单个文件最大150MB
-
-
+
+
+
+
+ 点击或拖拽文件到这里上传
+
+ 单个文件最大150MB
+
+
)
}
diff --git a/public/react/src/modules/courses/members/studentsList.js b/public/react/src/modules/courses/members/studentsList.js
index 2a510789e..cc7485101 100644
--- a/public/react/src/modules/courses/members/studentsList.js
+++ b/public/react/src/modules/courses/members/studentsList.js
@@ -35,6 +35,7 @@ const buildColumns = (that) => {
dataIndex: 'login',
key: 'login',
align:'center',
+ width:"10%",
className:"color-grey-6",
render: (login, record) => {
return
{
dataIndex: 'student_id',
key: 'student_id',
align:'center',
+ width:"10%",
className:"color-grey-6",
render: (student_id, record) => {
- return 10 ? student_id : ''}
+ return 10 ? student_id : ''}
style={{maxWidth: '160px'}} >{student_id}
}
}];
@@ -69,7 +71,7 @@ const buildColumns = (that) => {
dataIndex: 'course_group_name',
key: 'course_group_name',
align:'center',
- width:"50%",
+ width:"40%",
className:"color-grey-6"
})
}
diff --git a/public/react/src/modules/courses/new/CoursesNew.js b/public/react/src/modules/courses/new/CoursesNew.js
index b87b4e81d..edee26a27 100644
--- a/public/react/src/modules/courses/new/CoursesNew.js
+++ b/public/react/src/modules/courses/new/CoursesNew.js
@@ -1,11 +1,12 @@
import React, {Component} from "React";
-import {Form, Select, Input, Button, Checkbox, DatePicker,Spin,Icon,AutoComplete,InputNumber} from "antd";
+import {Form, Select, Input, Button, Checkbox, DatePicker,Spin,Icon,AutoComplete,InputNumber,Breadcrumb} from "antd";
import ApplyForAddOrgModal from '../../user/modal/ApplyForAddOrgModal';
import axios from 'axios';
import "../css/Courses.css";
import locale from 'antd/lib/date-picker/locale/zh_CN';
import moment from 'moment';
import Modals from '../../modals/Modals';
+import {WordsBtn, ActionBtn} from 'educoder';
@@ -44,7 +45,9 @@ class CoursesNew extends Component {
fetching:false,
boolxinjian:false,
checkboxgroup:undefined,
- checkbofrup:["shixun_homework","common_homework","group_homework","exercise","attachment","course_group","graduation","poll","board"],
+ checkbofrup:[{module_type:"shixun_homework",module_name:"实训作业"},{module_type:"common_homework",module_name:"普通作业"},{module_type:"group_homework",module_name:"分组作业"}
+ ,{module_type:"exercise",module_name:"试卷"},{module_type:"poll",module_name:"问卷"},{module_type:"graduation",module_name:"毕业设计"}
+ ,{module_type:"board",module_name:"讨论"},{module_type:"attachment",module_name:"资源"},{module_type:"course_group",module_name:"分班"}],
checkbofrups:[],
}
}
@@ -78,32 +81,19 @@ class CoursesNew extends Component {
is_public: data.is_public === 1 ? true : false,
Realnamecertification: data.authentication,
Professionalcertification:data.professional_certification,
-
+ // checkbofrups:data.course_modules,
});
- try {
- var datasysl=[];
- var dataysl2=[];
- var dataysl3=[];
- var checkbofrup =this.state.checkbofrup;
- dataysl2=data.course_module_types;
- datasysl=checkbofrup;
- for (var k=0;k {
console.log(error);
@@ -450,6 +440,7 @@ class CoursesNew extends Component {
search: value
}
}).then((result)=>{
+ if(result){
if (result.data.status===0) {
this.setState({
searchlistscholl: result.data.school_names,
@@ -461,6 +452,7 @@ class CoursesNew extends Component {
})
}
}
+ }
}).catch((error)=>{
console.log(error)
})
@@ -469,7 +461,7 @@ class CoursesNew extends Component {
this.applyForAddOrgForm.setVisible(true)
}
render() {
- let {datatime,school,searchlistscholl,checkboxgroup} = this.state;
+ let {datatime,school,searchlistscholl} = this.state;
const {getFieldDecorator} = this.props.form;
const propsWithoutForm = Object.assign({}, this.props)
delete propsWithoutForm.form
@@ -509,8 +501,22 @@ class CoursesNew extends Component {
/>
+ {/*
*/}
+ {/* */}
+ {/* 翻转课堂 */}
+ {/* */}
+ {/* {this.props.match.params.coursesId === undefined ?"新建课堂":"编辑课堂"} */}
+ {/* */}
+
+
+ 翻转课堂
+ >
+ {this.props.match.params.coursesId === undefined ?"新建课堂":"编辑课堂"}
+
+
+
-
{this.props.match.params.coursesId === undefined ? "新建课堂" : "编辑课堂"}
+
{this.props.match.params.coursesId === undefined ? "新建课堂" : "编辑课堂"}
返回
+ className="searchViewAfter yslpollls">
--
:
-
this.Viewstudenttraininginformation(record)}>{record.operating}
+ onClick={() => this.Viewstudenttraininginformation(record)}>{record.operating}
}
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js
index f46d3f6b1..dddd39989 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js
@@ -113,21 +113,19 @@ class ShixunHomeworkPage extends Component {
bindRef = ref => { this.child = ref }
///////////////教师截止
gotohome=()=>{
- // 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()
+ // console.log(this.props)
+ let {jobsettingsdatapage}=this.state
+
+ this.props.history.replace(`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`);
}
render() {
let {tab, teacherdatapage, jobsettingsdatapage} = this.state;
const isAdmin = this.props.isAdmin();
// console.log(119)
- // console.log(jobsettingsdatapage);
- // console.log(teacherdatapage);
+ console.log(jobsettingsdatapage);
+
+
return (
@@ -136,11 +134,11 @@ class ShixunHomeworkPage extends Component {
- this.gotohome()}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.course_name}
+ {jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.course_name}
>
{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_name}
+ href={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`}>{jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_name}
>
作业详情
@@ -240,14 +238,14 @@ class ShixunHomeworkPage extends Component {
this.workshowmodels(this.child)}>代码查重
: "" : ""}
{this.state.view_report === true ?
+ to={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage&&teacherdatapage.work_id}/shixun_work_report`}>
查看实训报告
: ""}
{
teacherdatapage === undefined ? ""
: teacherdatapage.commit_des === null || teacherdatapage.commit_des === undefined ? "" :
{teacherdatapage.commit_des}
+ href={`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${teacherdatapage === undefined ? "" : teacherdatapage.id}/commitsummary/${this.props.match.params.homeworkid}`}>{teacherdatapage.commit_des}
}
{teacherdatapage === undefined ? "" :
{
-
- this.props.history.goBack()
+ this.props.history.replace(`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${this.state.data.homework_common_id}/list?tab=0`);
}
render() {
let{data} =this.state;
@@ -159,7 +158,7 @@ class ShixunWorkReport extends Component {
{/*className="fr color-blue font-16"*/}
{/*onClick={()=>this.confirmysl(`/student_works/${homeworkid}/export_shixun_work_report.pdf`)}*/}
{/*>导出实训报告数据 : ""}*/}
- {/*返回 */}
+ 返回
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js
index 38ab63a4f..942c06800 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js
@@ -124,13 +124,19 @@ class ShixunhomeWorkItem extends Component{
})
}
- editname = (name,id) => {
+ // 实训详情,阻止冒泡
+ stopPro = (event) => {
+ event.stopPropagation()
+ }
+
+ editname = (name,id,event) => {
this.setState({
ModalsRenametype:true,
NavmodalValue:name,
Navmodalname:"重命名",
url:`/homework_commons/${id}/alter_name.json`
})
+ event.stopPropagation()
}
cannerNavmoda=()=>{
this.setState({
@@ -157,88 +163,74 @@ class ShixunhomeWorkItem extends Component{
const { checkBox,
discussMessage,
- taskid,
+ taskid,index
} = this.props;
- //
-
- // allow_late: true //是否开启补交
-
- // homework_id: 9250
-
- // shixun_identifier: "25ykhpvl"
-
- //
- // console.log("this.props.isAdmin");
-
-
return(
-
- {this.state.ModalsRenametype===true?
-
this.cannerNavmoda()}
- />
- :""}
-
-
-
- {visible===true? :""}
-
-
-
-
-
-
-
-
-
本实训的开启时间:{shixunsmessage} 开启时间之前不能挑战
-
-
-
- {/**/}
- {/*知道了 */}
- {/*
*/}
-
-
+
+ {
+ this.state.ModalsRenametype===true?
+ this.cannerNavmoda()}
+ />
+ :""}
+
+ {visible===true? :""}
+
+
+
+
+
+
+
+
本实训的开启时间:{shixunsmessage} 开启时间之前不能挑战
+
+
+
+ {/**/}
+ {/*知道了 */}
+ {/*
*/}
+
+ window.$(`.shixunitem${index} input`).click() } >
- {this.props.isAdmin?checkBox:""}
+ {this.props.isAdmin?
+
{checkBox}
+ :
+ ""
+ }
+
)
}
}
diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js
index 74d142129..c7fa2e70a 100644
--- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js
+++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js
@@ -587,6 +587,8 @@ class ShixunHomework extends Component{
let {Coursename,page}=this.state;
this.setState({
order: e.key,
+ checkBoxValues:[],
+ checkedtype:false,
isSpin:true
});
let newkey=e.key;
@@ -655,6 +657,7 @@ class ShixunHomework extends Component{
}
+
savedelete=()=>{
let {Coursename,page,order,checkBoxValues,datas}=this.state;
let category_id=this.props.match.params.category_id;
@@ -966,7 +969,7 @@ class ShixunHomework extends Component{
category_id={this.props.match.params.category_id}
visible={shixunmodal}
shixunmodallist={shixunmodallist}
- // funshixunmodallist={(search,type,loading,page)=>this.funshixunmodallist(search,type,loading,page)}
+ homeworkupdatalists={(Coursename,page,order)=>this.homeworkupdatalist(Coursename,page,order)}
hometypepvisible={hometypepvisible}
hidecouseShixunModal={this.hidecouseShixunModal}
newshixunmodallist={newshixunmodallist}
@@ -1019,8 +1022,8 @@ class ShixunHomework extends Component{
- {datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"}
- {/* 实训作业 */}
+ {/*{datas&&datas.category_name===undefined||datas&&datas.category_name===null?datas&&datas.main_category_name:datas&&datas.category_name+" 作业列表"} */}
+ 实训作业
{this.props.isAdmin()===true?datas&&datas.category_name===undefined||datas&&datas.category_name===null?
@@ -1035,7 +1038,7 @@ class ShixunHomework extends Component{
-
+
共 {datas&&datas.all_count}个实训作业
已发布:{datas&&datas.published_count}个
@@ -1062,7 +1065,9 @@ class ShixunHomework extends Component{
- {this.props.isAdmin()===true?
+ {this.props.isAdmin()===true?
+ datas===undefined?'' :datas.homeworks.length===0?"":
+
已选 {checkBoxValues&&checkBoxValues.length} 个
@@ -1152,7 +1157,7 @@ class ShixunHomework extends Component{
// console.log("++++++++++++++++++++++++++++++++++++++++++")
// console.log(JSON.stringify(this.props))
return (
-
+
:""}
match={this.props.match}
+ index={index}
coursedata={this.props.coursedata}
coursupdata={()=>this.homeworkupdatalist(Coursename,page,order)}
course_identity={datas.course_identity}
@@ -1203,18 +1209,10 @@ class ShixunHomework extends Component{
+ {
+ datas===undefined?'' :datas.homeworks.length===0?
:""
+ }
-
-
-
暂时还没有相关数据哦!
-
@@ -1223,3 +1221,14 @@ class ShixunHomework extends Component{
}
}
export default ShixunHomework;
+// {/*
*/}
+// {/*
*/}
+// {/*
*/}
+// {/*
暂时还没有相关数据哦!
*/}
+// {/*
*/}
\ No newline at end of file
diff --git a/public/react/src/modules/home/shixunsHome.js b/public/react/src/modules/home/shixunsHome.js
index d366426c8..690baf28b 100644
--- a/public/react/src/modules/home/shixunsHome.js
+++ b/public/react/src/modules/home/shixunsHome.js
@@ -294,7 +294,7 @@ class ShixunsHome extends Component {
{/*精选实训 改为 开发社区*/}
-
开发社区
+
实训项目
DEVELOPMENT COMMUNITY
更多
diff --git a/public/react/src/modules/modals/WordNumberTextarea.css b/public/react/src/modules/modals/WordNumberTextarea.css
new file mode 100644
index 000000000..9bd8c820c
--- /dev/null
+++ b/public/react/src/modules/modals/WordNumberTextarea.css
@@ -0,0 +1,42 @@
+.WordNumberTextarea {
+ outline: none; /* 去掉输入字符时的默认样式 */
+ appearance:none;
+ -webkit-appearance:none;
+ -moz-appearance:none;
+ background-color: white;
+ text-shadow: none;
+ -webkit-writing-mode: horizontal-tb !important;
+ -webkit-tap-highlight-color:rgba(0,0,0,0);
+ resize:none; /*禁止拉伸*/
+ border: none; /*去掉默认边框*/
+ width: 100%;
+ height:150px;
+ border:none;
+ padding: 10px;
+ display: block;
+}
+
+.WordNumbernote {
+ padding: 0;
+ margin: 0;
+ list-style: none;
+ text-decoration: none;
+ box-sizing: border-box;
+ overflow: hidden;
+ height: auto;
+ border: 1px solid rgba(234,234,234,1);
+ border-radius: 0.125rem;
+ margin: 0.31rem;
+ padding: 0.19rem;
+ backgroud:rgba(234,234,234,1);
+ padding-bottom: 10px;
+ padding-right: 10px;
+
+}
+.WordNumberTextarea-count {
+ display: inline-block;
+ float: right;
+ font-size: 0.28rem;
+ color: #adadad;
+ padding-right: 0.25rem;
+}
diff --git a/public/react/src/modules/modals/WordNumberTextarea.js b/public/react/src/modules/modals/WordNumberTextarea.js
new file mode 100644
index 000000000..52711de2c
--- /dev/null
+++ b/public/react/src/modules/modals/WordNumberTextarea.js
@@ -0,0 +1,23 @@
+import React, { Component } from 'react';
+import './WordNumberTextarea.css';
+class WordNumberTextarea extends Component {
+ constructor(props) {
+ super(props);
+ }
+render() {
+ return(
+
+ )
+ }
+}
+
+export default WordNumberTextarea;
\ No newline at end of file
diff --git a/public/react/src/modules/page/MainContentContainer.js b/public/react/src/modules/page/MainContentContainer.js
index 3214fe5d5..f50ec9d21 100644
--- a/public/react/src/modules/page/MainContentContainer.js
+++ b/public/react/src/modules/page/MainContentContainer.js
@@ -224,12 +224,15 @@ class MainContentContainer extends Component {
}
componentDidUpdate(prevProps, prevState, snapshot) {
- const { game } = this.props
+ const { game, challenge } = this.props
if (game && prevProps.game
&& prevProps.game.identifier !== game.identifier) {
// 切换关卡时,停止轮训
this.oldGameIdentifier = prevProps.game.identifier;
+ this.doFileUpdateRequestOnCodeMirrorBlur(prevProps)
+ } else if (challenge && (challenge.pathIndex || prevProps.challenge.pathIndex) && challenge.pathIndex != prevProps.challenge.pathIndex) {
+ this.doFileUpdateRequestOnCodeMirrorBlur(prevProps)
}
}
@@ -386,8 +389,8 @@ class MainContentContainer extends Component {
}
- doFileUpdateRequestOnCodeMirrorBlur = () => {
- var fileUpdatePromise = this.doFileUpdateRequest(true)
+ doFileUpdateRequestOnCodeMirrorBlur = (props) => {
+ var fileUpdatePromise = this.doFileUpdateRequest(true, undefined, props)
if (fileUpdatePromise) {
fileUpdatePromise.then((resData) => {
if (resData.status === -1) { // 保存文件出现异常
@@ -496,7 +499,8 @@ class MainContentContainer extends Component {
}
// forTest true 是评测时触发的file_update
- doFileUpdateRequest(checkIfCodeChanged, forTest) {
+ doFileUpdateRequest(checkIfCodeChanged, forTest, props) {
+ const _props = props || this.props;
const { codeStatus } = this.state;
if (!forTest && codeStatus !== UPDATED) { // 已修改状态才能保存
return;
@@ -521,7 +525,7 @@ class MainContentContainer extends Component {
})
return null;
}
- const { challenge, output_sets, onRunCodeTestFinish, myshixun } = this.props
+ const { challenge, output_sets, onRunCodeTestFinish, myshixun } = _props
// var url = `${locationPath}/file_update?path=${encodeURIComponent(challenge.path)}`
var url = `/myshixuns/${myshixun.identifier}/update_file.json`
diff --git a/public/react/src/modules/page/component/monaco/TPIMonaco.js b/public/react/src/modules/page/component/monaco/TPIMonaco.js
index ee19e483d..c16889db2 100644
--- a/public/react/src/modules/page/component/monaco/TPIMonaco.js
+++ b/public/react/src/modules/page/component/monaco/TPIMonaco.js
@@ -46,7 +46,7 @@ function loadMonacoResouce(callback) {
prefix = ''
} else {
// _url_origin = `https://testeduplus2.educoder.net/`;
- _url_origin = 'https://pre-newweb.educoder.net';
+ _url_origin = 'http://pre-newweb.educoder.net';
}
const $ = window.$;
diff --git a/public/react/src/modules/page/main/ActionView.js b/public/react/src/modules/page/main/ActionView.js
index 1a887fa75..6a38ad6aa 100644
--- a/public/react/src/modules/page/main/ActionView.js
+++ b/public/react/src/modules/page/main/ActionView.js
@@ -52,9 +52,16 @@ class ActionView extends Component {
componentDidMount() {
// request
window._tpiWidthResize = () => {
- if (window.$('#actionView').width() < 580) {
+ const _w = window.$('#actionView').width();
+ if (_w < 446) {
+ window.$('#time-consuming').hide()
+ // window.$('#time-consuming').hide()
+ } else if (_w < 746) {
+ // 文字放出来之前是 580
+ window.$('#time-consuming').show()
window.$('.time_limit').hide()
} else {
+ window.$('#time-consuming').show()
window.$('.time_limit').show()
}
}
@@ -71,16 +78,27 @@ class ActionView extends Component {
{!!time_limit &&
- {`本关最大执行时间:${real_time_limit}秒`} }
+ {`本关最大执行时间:${real_time_limit}秒`}
+
+ }
{!gameBuilding && record ?
-
- { record } 秒
-
+ //
+ 本次评测耗时(编译、运行总时间):{ record } 秒
+
: ""}
diff --git a/public/react/src/modules/page/tpiPageForMobile.css b/public/react/src/modules/page/tpiPageForMobile.css
index c30f40636..a2d903823 100644
--- a/public/react/src/modules/page/tpiPageForMobile.css
+++ b/public/react/src/modules/page/tpiPageForMobile.css
@@ -14,13 +14,16 @@
min-width: 280px;
}
- #time-consuming .time_limit {
- display: none;
- }
+
.actionViewfirstButton {
display: none !important;
}
}
+@media (max-width: 800px) {
+ #time-consuming .time_limit {
+ display: none;
+ }
+}
@media (max-width: 628px) {
.-header-right { display: none }
.exitBtn span { display: none }
diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js
index e9770e969..9f4d49a04 100644
--- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js
+++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js
@@ -297,43 +297,49 @@ class DetailCardsEditAndAdd extends Component{
contentViewScrolladd=(e)=>{
+ const {ChooseShixunList}=this.state;
//滑动到底判断
if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){
- // console.log("到达底部");
- this.setState({
- hometypepvisible:true
- })
- let pathId=this.props.pathid;
- let {search,page,type,ChooseShixunListshixun_list}=this.state;
- let newpage=page+1;
- let newChooseShixunListshixun_list=ChooseShixunListshixun_list;
- let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage
- if(search!="" && search!=undefined){
- url+="&search="+search;
- }
- if(type!=0){
- url+="&type="+type;
- }
- axios.get(url).then((result)=>{
- if(result.status===200){
- let list =result.data.shixun_list;
-
- for(var i=0; i
{
- console.log(error);
- })
+ if(ChooseShixunList.shixun_list.length===0){
+ return
+ }else{
+ // console.log("到达底部");
+ this.setState({
+ hometypepvisible:true
+ })
+ let pathId=this.props.pathid;
+ let {search,page,type,ChooseShixunListshixun_list}=this.state;
+ let newpage=page+1;
+ let newChooseShixunListshixun_list=ChooseShixunListshixun_list;
+ let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage
+ if(search!="" && search!=undefined){
+ url+="&search="+search;
+ }
+ if(type!=0){
+ url+="&type="+type;
+ }
+ axios.get(url).then((result)=>{
+ if(result.status===200){
+ let list =result.data.shixun_list;
+
+ for(var i=0; i{
+ console.log(error);
+ })
+
+ }
}
diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js
index 719994fdf..b6c7e53b2 100644
--- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js
+++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndEdit.js
@@ -338,50 +338,59 @@ class DetailCardsEditAndEdit extends Component{
contentViewScrolledit=(e)=>{
//滑动到底判断
-
+ const {ChooseShixunList}=this.state;
if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){
- this.setState({
- hometypepvisible:true
- })
- // console.log("到达底部");
- let {page,type,search,ChooseShixunListshixun_list}=this.state;
+ if(ChooseShixunList.shixun_list.length===0){
+ return
+ }else{
+ this.setState({
+ hometypepvisible:true
+ })
+ // console.log("到达底部");
- let newpage=page+1;
+ let {page,type,search,ChooseShixunListshixun_list}=this.state;
- let pathId=this.props.pathid;
+ let newpage=page+1;
- let newChooseShixunListshixun_list=ChooseShixunListshixun_list;
+ let pathId=this.props.pathid;
- let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage
+ let newChooseShixunListshixun_list=ChooseShixunListshixun_list;
- if(search!="" && search!=undefined){
- url+="&search="+search;
- }
+ let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage
- if(type!=0){
- url+="&type="+type;
- }
- axios.get(url).then((result)=>{
- if(result.status===200){
+ if(search!="" && search!=undefined){
+ url+="&search="+search;
+ }
+
+ if(type!=0){
+ url+="&type="+type;
+ }
+ axios.get(url).then((result)=>{
+ if(result.status===200){
+
+ let list =result.data.shixun_list;
+
+ for(var i=0; i{
+ console.log(error);
+ })
+
+
+ }
- let list =result.data.shixun_list;
- for(var i=0; i{
- console.log(error);
- })
}
diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.js b/public/react/src/modules/paths/PathDetail/DetailTop.js
index 0777718b8..4506f8700 100644
--- a/public/react/src/modules/paths/PathDetail/DetailTop.js
+++ b/public/react/src/modules/paths/PathDetail/DetailTop.js
@@ -30,38 +30,41 @@ class DetailTop extends Component{
}
}
componentDidMount(){
- let courseslist=[]
-
+ this.getdatalist();
+ }
+ getdatalist=()=>{
+ let courseslist=[];
+ let keys=1;
if(this.props.courses!=undefined&&this.props.courses.length!=0){
- this.props.courses.map((item,key)=>{
- if(this.props.pathtopskey===key+1){
- return(
- courseslist.push(item)
- )
- }
- })
+ if(this.props.detailInfoList.has_start===true){
+ this.props.courses.map((item,key)=>{
+ if(item.course_status.status===1){
+ keys=key+1
+ return(
+ courseslist.push(item)
+ )
+ }
+ })
+
+ }else{
+ this.props.courses.map((item,key)=>{
+ if(this.props.pathtopskey===key+1){
+ keys=key+1
+ return(
+ courseslist.push(item)
+ )
+ }
+ })
+ }
}
this.setState({
- courseslist:courseslist
+ courseslist:courseslist,
+ MenuItemskey:keys,
})
}
-
componentDidUpdate=(prevProps)=> {
if(prevProps.courses!=this.props.courses){
- let courseslist=[]
-
- if(this.props.courses!=undefined&&this.props.courses.length!=0){
- this.props.courses.map((item,key)=>{
- if(this.props.pathtopskey===key+1){
- return(
- courseslist.push(item)
- )
- }
- })
- }
- this.setState({
- courseslist:courseslist
- })
+ this.getdatalist();
}
}
@@ -451,7 +454,7 @@ class DetailTop extends Component{
onVisibleChange={this.onVisibleChanges}
>
- 第{this.state.MenuItemskey} 次开课
+ 第 {this.state.MenuItemskey} 次开课
@@ -509,7 +512,7 @@ class DetailTop extends Component{
报名人数:
- {item.student_count}人
+ {item.student_count} 人
diff --git a/public/react/src/modules/paths/PathDetail/addCollaborators.js b/public/react/src/modules/paths/PathDetail/addCollaborators.js
index 0b99fd467..056e69b31 100644
--- a/public/react/src/modules/paths/PathDetail/addCollaborators.js
+++ b/public/react/src/modules/paths/PathDetail/addCollaborators.js
@@ -14,7 +14,8 @@ class addCollaborators extends Component{
search:'',
partnerListid:[],
checkAll: false,
- optionss:[]
+ optionss:[],
+ useristrue:false
}
}
addBox=()=>{
@@ -70,6 +71,13 @@ class addCollaborators extends Component{
let {partnerListid} =this.state;
let id=this.props.match.params.pathId;
let url="/paths/"+id+"/add_subject_members.json"
+
+ if(partnerListid.length===0){
+ this.setState({
+ useristrue:true
+ })
+ return
+ }
axios.post(url,{
user_ids:partnerListid
}).then((response) => {
@@ -87,9 +95,17 @@ class addCollaborators extends Component{
}
addCollaboratorsid=(id)=>{
- this.setState({
- partnerListid:id
- })
+ if(id.length===0){
+ this.setState({
+ partnerListid:id,
+ })
+ }else{
+ this.setState({
+ partnerListid:id,
+ useristrue:false
+ })
+ }
+
}
onCheckAllChange = (e) => {
@@ -145,7 +161,7 @@ class addCollaborators extends Component{
}
render(){
- let {addPartner,search,partnerList,optionss,checkAll,partnerListid} = this.state;
+ let {addPartner,search,partnerList,optionss,checkAll,partnerListid,useristrue} = this.state;
return(
this.props.detailInfoList===undefined?"":this.props.detailInfoList.allow_add_member===true?
@@ -199,6 +215,7 @@ class addCollaborators extends Component{
}
+ {useristrue===true?
请先选择用户 :""}
取消
确定
diff --git a/public/react/src/modules/paths/PathNew.js b/public/react/src/modules/paths/PathNew.js
index 4616660f0..95e343b13 100644
--- a/public/react/src/modules/paths/PathNew.js
+++ b/public/react/src/modules/paths/PathNew.js
@@ -107,8 +107,8 @@ class PathNew extends Component{
window.location.href="#part_Des";
return;
}
- if (des.length > 5000) {
- this.props.showSnackbar("实践课程的简介最大限制5000个字符");
+ if (des.length > 8000) {
+ this.props.showSnackbar("实践课程的简介最大限制8000个字符");
window.location.href="#part_Des";
return;
}
@@ -118,8 +118,8 @@ class PathNew extends Component{
window.location.href="#part_point";
return;
}
- if(point.length > 500){
- this.props.showSnackbar("实践课程的学习须知最大限制500个字符");
+ if(point.length > 2000){
+ this.props.showSnackbar("实践课程的学习须知最大限制2000个字符");
window.location.href="#part_point";
return;
}
@@ -186,10 +186,10 @@ class PathNew extends Component{
})
const Des_editMD = create_editorMD("shixun_introduction","100%","490px"
- ,"请在此输入实践课程的简介,最大限制5000个字符","/api/attachments.json", response.data.description,"");
+ ,"请在此输入实践课程的简介,最大限制8000个字符","/api/attachments.json", response.data.description,"");
this.Des_editMD=Des_editMD;
const Point_editMD = create_editorMD("shixun_propaedeutics","100%","260px"
- ,"请在此输入实践课程的学习须知,最大限制500个字符","/api/attachments.json",response.data.learning_notes,"");
+ ,"请在此输入实践课程的学习须知,最大限制2000个字符","/api/attachments.json",response.data.learning_notes,"");
this.Point_editMD=Point_editMD;
}
}).catch((error)=>{
@@ -198,9 +198,9 @@ class PathNew extends Component{
} else {
this.isEditPage = false
- const Des_editMD = create_editorMD("shixun_introduction","100%","490px","请在此输入实践课程的简介,最大限制5000个字符","/api/attachments.json","","");
+ const Des_editMD = create_editorMD("shixun_introduction","100%","490px","请在此输入实践课程的简介,最大限制8000个字符","/api/attachments.json","","");
this.Des_editMD=Des_editMD;
- const Point_editMD = create_editorMD("shixun_propaedeutics","100%","260px","请在此输入实践课程的学习须知,最大限制500个字符","/api/attachments.json","","");
+ const Point_editMD = create_editorMD("shixun_propaedeutics","100%","260px","请在此输入实践课程的学习须知,最大限制2000个字符","/api/attachments.json","","");
this.Point_editMD=Point_editMD;
}
diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js
index 0e0bd16bd..1e1b16615 100644
--- a/public/react/src/modules/tpm/NewHeader.js
+++ b/public/react/src/modules/tpm/NewHeader.js
@@ -734,7 +734,7 @@ submittojoinclass=(value)=>{
- 开发社区
+ 实训项目
@@ -814,7 +814,7 @@ submittojoinclass=(value)=>{
onBlur={(e)=>this.hideshowSearchOpen(e)} onMouseLeave={()=>this.setevaluatinghides()}>
diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css
index a76c8dc19..6ea9d3549 100644
--- a/public/stylesheets/educoder/edu-all.css
+++ b/public/stylesheets/educoder/edu-all.css
@@ -120,12 +120,13 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
bottom: 90px;}
.tag-green .tag-name{display: block;width: auto;
/*background-image: url("/images/educoder/tag1.png");*/
- background: #000000;
- border: 1px solid #fff;
+ background: rgba(000,000,000,0.56);
+ border: 1px solid rgba(255,255,255,0.56);
border-radius: 3px;
font-size: 12px;
- opacity: 0.56;
- background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;}
+ /*opacity: 0.56;*/
+ background-size: 100% 100%;
+ padding: 0px 8px;color: #fff;float: left;}
.tag-orange{position: absolute;right: 0px;top:12px;}
.tag-orange .tag-name{display: block;width: auto;background-color:#FF6800;
background-size: 100% 100%;padding: 0px 8px;color: #fff;float: left;
@@ -447,8 +448,8 @@ table.text-file{}
/*-------------------------------实训路径-------------------------------*/
.path-head{width: 100%;height: 300px;background-image: url("/images/educoder/path.png");
- background-color: #081C4B;
- background-size: cover;
+ background-color: #131b39;
+ /*background-size: cover;*/
background-position: center;
background-repeat: no-repeat;
}
@@ -3751,4 +3752,12 @@ a.singlepublishtwo{
.pointer{
cursor: pointer;
-}
\ No newline at end of file
+}
+
+.has-error .ant-input:focus{
+ border-color: #ff4d4f !important;
+}
+/*.ant-notification{*/
+ /*width: auto !important;*/
+ /*max-width: 600px !important;*/
+/*}*/
\ No newline at end of file
diff --git a/public/stylesheets/educoder/edu-main.css b/public/stylesheets/educoder/edu-main.css
index 4aa426192..f59827f45 100644
--- a/public/stylesheets/educoder/edu-main.css
+++ b/public/stylesheets/educoder/edu-main.css
@@ -761,9 +761,9 @@ html>body #ajax-indicator { position: fixed; }
.paddingLeft28{padding-left:28px;}
-.ant-modal-header{
- border-radius: 10px;
-}
+/*.ant-modal-header{*/
+ /*border-radius: 10px;*/
+/*}*/
.color656565{
color:#656565;