From 66e65946fbf32ad17d7ce4bba58d9d262dc6cd82 Mon Sep 17 00:00:00 2001 From: ysl <904079904@qq.com> Date: Fri, 21 Jun 2019 16:25:51 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/HomeworkModal.js | 2 -- .../src/modules/login/Trialapplication.js | 27 +++++++++++-------- public/react/src/modules/tpm/NewHeader.js | 2 ++ 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/HomeworkModal.js b/public/react/src/modules/courses/coursesPublic/HomeworkModal.js index 66bca0023..f448483d2 100644 --- a/public/react/src/modules/courses/coursesPublic/HomeworkModal.js +++ b/public/react/src/modules/courses/coursesPublic/HomeworkModal.js @@ -27,8 +27,6 @@ class HomeworkModal extends Component{ group_ids:[], endtime:"" } - console.log("30"); - console.log(props); } componentDidMount() { diff --git a/public/react/src/modules/login/Trialapplication.js b/public/react/src/modules/login/Trialapplication.js index 9626a1475..b86b68930 100644 --- a/public/react/src/modules/login/Trialapplication.js +++ b/public/react/src/modules/login/Trialapplication.js @@ -69,6 +69,22 @@ class Trialapplication extends Component { }) } + // 是否不显示手机栏 + let url = `/users/get_user_info.json` + axios.get(url,{params:{ + school:1 + } + }, + ).then((response) => { + if(response !==undefined){ + this.setState({ + user_phone_binded:response.data.user_phone_binded + }) + } + }).catch((error) => { + console.log(error) + }) + axios.interceptors.response.use((response) => { if (response != undefined) if (response && response.data.status === 407) { @@ -81,18 +97,7 @@ class Trialapplication extends Component { // // // TODO 这里如果样式变了会出现css不加载的情况 }); // console.log("89"); - try { - // console.log(this.state.props.user && this.state.props.user.user_phone_binded); - if (this.state.props.user !== undefined) { - this.setState({ - user_phone_binded: this.state.props.user.user_phone_binded, - }) - } - } catch (e) { - console.log(e); - - } } diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index e97a728d4..956e9afc4 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -173,6 +173,8 @@ class NewHeader extends Component { showTrial:false, user:undefined, } + console.log("176") + console.log(props); } componentDidMount() { From 8791b8edf10412ab398fb267895ba8e6749288a9 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 21 Jun 2019 16:39:24 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=88=86=E7=8F=AD=E8=AE=BE=E7=BD=AE=20?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/busyWork/CommonWorkSetting.js | 64 +++++++++++-------- .../modules/courses/members/teacherList.js | 2 +- 2 files changed, 39 insertions(+), 27 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js index 5ce5a5df3..ab00f3c00 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js @@ -271,8 +271,8 @@ class CommonWorkSetting extends Component{ absence_penalty = 2 } } else { - evaluation_start = '' - evaluation_end = '' + evaluation_start = null + evaluation_end = null evaluation_num = 0 absence_penalty = 0 } @@ -484,6 +484,7 @@ class CommonWorkSetting extends Component{ publish_time_type, end_time_type } = this.state; let group_settings_param = [] + let max_un_unified_setting_end_time = null if (!unified_setting) { const result = this.refs.pollDetailTabForthRules.notUnifiedSettingCheck(this.state.rules); this.setState({ @@ -494,6 +495,9 @@ class CommonWorkSetting extends Component{ return false; } group_settings_param = result.rules.map(item => { + if (!max_un_unified_setting_end_time || moment(item.end_time) > moment(max_un_unified_setting_end_time)) { + max_un_unified_setting_end_time = item.end_time; + } return { group_id: item.course_group_id, publish_time: item.publish_time, @@ -517,16 +521,22 @@ class CommonWorkSetting extends Component{ return false } - - let temp_publish_time = publish_time - let temp_end_time = end_time - if (!temp_publish_time) { - const publish_time_moment = getNextHalfHourOfMoment(moment()); - temp_publish_time = publish_time_moment.format(dateFormat); - } - if (!temp_end_time) { - temp_end_time = moment(handleDateString(temp_publish_time)).add(1, 'months').format(dateFormat) + let temp_publish_time + let temp_end_time + if (unified_setting) { + let temp_publish_time = publish_time + let temp_end_time = end_time + if (!temp_publish_time) { + const publish_time_moment = getNextHalfHourOfMoment(moment()); + temp_publish_time = publish_time_moment.format(dateFormat); + } + if (!temp_end_time) { + temp_end_time = moment(handleDateString(temp_publish_time)).add(1, 'months').format(dateFormat) + } + } else { + temp_end_time = max_un_unified_setting_end_time } + // 已发布的不检查 const isUnPublish= homework_status.indexOf(STATUS_UN_PUBLISH) != -1 const isAdmin = this.props.isAdmin() @@ -534,20 +544,22 @@ class CommonWorkSetting extends Component{ const publish_time_editable = isUnPublish; const end_time_editable = isAdmin || !end_time || moment(end_time) > current; - if (publish_time_editable && temp_publish_time && moment(temp_publish_time) < moment()) { - this.setState({ - publicTimeTip: '发布时间不能小于当前时间' - }) - scrollTo('.publicTimeTip') - return false - } - // 已截止的不检查 - if (end_time_editable && temp_end_time && moment(temp_end_time) <= moment(temp_publish_time)) { - this.setState({ - publicTimeTip: '截止时间必须晚于发布时间' - }) - scrollTo('.publicTimeTip') - return false + if (unified_setting) { + if (publish_time_editable && temp_publish_time && moment(temp_publish_time) < moment()) { + this.setState({ + publicTimeTip: '发布时间不能小于当前时间' + }) + scrollTo('.publicTimeTip') + return false + } + // 已截止的不检查 + if (end_time_editable && temp_end_time && moment(temp_end_time) <= moment(temp_publish_time)) { + this.setState({ + publicTimeTip: '截止时间必须晚于发布时间' + }) + scrollTo('.publicTimeTip') + return false + } } this.setState({ publicTimeTip: '' @@ -1201,7 +1213,7 @@ class CommonWorkSetting extends Component{ - {anonymous_comment_time_tip &&
- {parseInt(key+1)}、{type[item.question_type]}({item.question_score}分)
+ {exercise_questions.q_position}、{type[item.question_type]}({item.question_score}分)
{
// 填空(一直都有调分),和简答题调分:老师身份 已经评分的才能出现调分按钮
diff --git a/public/react/src/modules/courses/graduation/tasks/index.js b/public/react/src/modules/courses/graduation/tasks/index.js
index d28b8f697..acb8508b2 100644
--- a/public/react/src/modules/courses/graduation/tasks/index.js
+++ b/public/react/src/modules/courses/graduation/tasks/index.js
@@ -13,6 +13,7 @@ import Modals from '../../../modals/Modals';
import UseBank from "../../busyWork/UseBank";
import '../../css/members.css';
import '../style.css';
+import moment from 'moment'
class GraduationTasks extends Component{
@@ -413,7 +414,7 @@ class GraduationTasks extends Component{
Topval:"本操作只对“未发布”的对象生效",
Botvalleft:"暂不发布",
Botval:"则通过后续手动设置,定时发布",
- starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
+ starttime:"发布时间:"+moment(new Date()).format("YYYY-MM-DD HH:mm"),
starttimes:this.props.getNowFormatDates(1),
typs:"start",
endtime:"截止时间:"+endtime,
diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js
index 25d290fac..e2ef85907 100644
--- a/public/react/src/modules/tpm/NewHeader.js
+++ b/public/react/src/modules/tpm/NewHeader.js
@@ -570,7 +570,7 @@ submittojoinclass=(value)=>{
// 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(this.props)
return (
{user.username}
-