diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js
index ed1249f0d..f6af871dd 100644
--- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js
+++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js
@@ -31,6 +31,30 @@ const Option = Select.Option;
const RadioGroup = Radio.Group;
+// 处理整点 半点
+// 取传入时间往后的第一个半点
+export function handleDateStrings(dateString) {
+ if (!dateString) return dateString;
+ const ar = dateString.split(':')
+ if (ar[1] == '00' || ar[1] == '30') {
+ return dateString
+ }
+ const miniute = parseInt(ar[1]);
+ if (miniute < 30 || miniute == 60) {
+ return [ar[0], '30'].join(':')
+ }
+ if (miniute < 60) {
+ // 加一个小时
+ const tempStr = [ar[0], '00'].join(':');
+ const format = "YYYY-MM-DD HH:mm";
+ const _moment = moment(tempStr, format)
+ _moment.add(1, 'hours')
+ return _moment.format(format)
+ }
+
+ return dateString
+}
+
// 恢复数据
function md_rec_data(k,mdu,id, editor){
if(window.sessionStorage.getItem(k+mdu) !== null){
@@ -1120,7 +1144,7 @@ export default class TPMsettings extends Component {
}
onChangeTimePicker =(value, dateString)=> {
this.setState({
- opening_time:dateString
+ opening_time:moment(handleDateStrings(dateString))
})
}
diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js
index cb0f08c0f..8cb79e9d0 100644
--- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js
+++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js
@@ -2,7 +2,7 @@ import React, {Component} from 'react';
import {TPMIndexHOC} from '../TPMIndexHOC';
-import {SnackbarHOC,handleDateString} from 'educoder';
+import {SnackbarHOC} from 'educoder';
import {Input, Select, Radio, Checkbox, Modal, Icon, DatePicker,Upload,Button,message,Form,notification} from 'antd';
@@ -16,6 +16,7 @@ import './css/Newshixuns.css';
import {getUrl} from 'educoder'
+
let path = getUrl("/editormd/lib/")
const $ = window.$;
@@ -28,6 +29,34 @@ const Option = Select.Option;
const RadioGroup = Radio.Group;
const confirm = Modal.confirm;
+
+
+// 处理整点 半点
+// 取传入时间往后的第一个半点
+export function handleDateStrings(dateString) {
+ if (!dateString) return dateString;
+ const ar = dateString.split(':')
+ if (ar[1] == '00' || ar[1] == '30') {
+ return dateString
+ }
+ const miniute = parseInt(ar[1]);
+ if (miniute < 30 || miniute == 60) {
+ return [ar[0], '30'].join(':')
+ }
+ if (miniute < 60) {
+ // 加一个小时
+ const tempStr = [ar[0], '00'].join(':');
+ const format = "YYYY-MM-DD HH:mm";
+ const _moment = moment(tempStr, format)
+ _moment.add(1, 'hours')
+ return _moment.format(format)
+ }
+
+ return dateString
+}
+
+
+
// 恢复数据
function md_rec_data(k, mdu, id, editor) {
if (window.sessionStorage.getItem(k + mdu) !== null) {
@@ -713,7 +742,7 @@ class Newshixuns extends Component {
onChangeTimePicker = (value, dateString) => {
this.setState({
- TimePickervalue: handleDateString(dateString)
+ TimePickervalue: handleDateStrings(dateString)
})
}
// 附件相关 START
From b350b0f1a61fdecb8eeb489c15f65b9aa5acd00e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Thu, 25 Jul 2019 16:18:31 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../paths/PathDetail/DetailCardsTemp.js | 25 +-
.../src/modules/paths/PathDetail/DetailTop.js | 477 +++++++++---------
.../paths/PathDetail/PathDetailIndex.js | 10 +-
.../tpm/shixunchild/Challenges/Challenges.js | 15 +-
.../Propaedeutics/Propaedeu_tics.js | 8 +-
5 files changed, 280 insertions(+), 255 deletions(-)
diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsTemp.js b/public/react/src/modules/paths/PathDetail/DetailCardsTemp.js
index 4acc28a48..5150d14da 100644
--- a/public/react/src/modules/paths/PathDetail/DetailCardsTemp.js
+++ b/public/react/src/modules/paths/PathDetail/DetailCardsTemp.js
@@ -1,5 +1,6 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
+import { Tooltip } from 'antd';
import '../../paths/ShixunPaths.css';
import DetailCardsEditAndAdd from './DetailCardsEditAndAdd';
import axios from 'axios';
@@ -85,16 +86,26 @@ class DetailCards extends Component{
{item.stage_description}
diff --git a/public/react/src/modules/paths/PathDetail/DetailTop.js b/public/react/src/modules/paths/PathDetail/DetailTop.js
index 50c5c2680..09425df92 100644
--- a/public/react/src/modules/paths/PathDetail/DetailTop.js
+++ b/public/react/src/modules/paths/PathDetail/DetailTop.js
@@ -1,238 +1,241 @@
-import React,{ Component } from "react";
-import { Modal,Radio,Input,Tooltip } from "antd";
-import { BrowserRouter as Router, Route, Link } from "react-router-dom";
-import SendPanel from "./sendPanel.js";
-import { getImageUrl } from 'educoder';
-import axios from 'axios';
-import Modals from '../../modals/Modals';
-import './DetailTop.css';
-
-const Search = Input.Search;
-const RadioGroup = Radio.Group;
-class DetailTop extends Component{
- constructor(props){
- super(props)
- this.state={
- cardsModalcancel:this.cardsModalcancel,
- cardsModalsave:this.cardsModalsave,
- Modalstype:false,
- Modalstopval:"",
- Modalsbottomval:'',
- loadtype:false,
- deletepathtype:false,
- cardsModalsavetype:false
- }
- }
-
- allow_deletepath=()=>{
- this.setState({
- Modalstype:true,
- Modalstopval:"是否删除路径?",
- deletepathtype:true
- })
- }
-
- applyissuePath=()=>{
- this.setState({
- Modalstype:true,
- Modalstopval:"发布申请已提交,请等待管理员的审核",
- Modalsbottomval:"• 我们将在1-2个工作日内完成审核",
- loadtype:true
- })
- }
-
- cancelissuePath=()=>{
- let pathId=this.props.match.params.pathId;
- let url ="/paths/"+pathId+"/cancel_publish.json";
- axios.get(url).then((result)=>{
- if(result.status===200){
- if(result.data.status===0){
-
- }else if(result.data.status===1){
- window.location.href = "/paths/" + result.data.subject_id
- }
- }
- }).catch((error)=>{
- console.log(error);
- })
- }
-
- reovkissuePath=()=>{
-
- this.setState({
- Modalstype:true,
- Modalstopval:"是否确认撤销发布",
- Modalsbottomval:"确认后,回退到编辑状态",
- cardsModalsavetype:true,
- })
-
- }
- reovkissuePaths=()=>{
- let pathId=this.props.match.params.pathId;
- let url ="/paths/"+pathId+"/cancel_has_publish.json";
- axios.get(url).then((result)=>{
- if(result.status===200){
- if(result.data.status===0){
-
- }else if(result.data.status===1){
- this.setState({
- cardsModalsavetype:false,
- loadtype:false,
- deletepathtype:false
- })
- window.location.href = "/paths/" + result.data.subject_id
- }
- }
- }).catch((error)=>{
- console.log(error);
- })
- }
-
- cardsModalcancel=()=>{
- this.setState({
- Modalstype:false,
- Modalsbottomval:'',
- loadtype:false,
- deletepathtype:false
- })
- }
-
- cardsModalsave=()=>{
- let {loadtype,deletepathtype}=this.state;
-
- //删除路径
- if(deletepathtype===true){
- let pathid=this.props.match.params.pathId;
- const deleteUrl = `/paths/`+pathid+`.json`;
- axios.delete(deleteUrl).then((response) => {
- const status = response.data.status
- if (status === 1) {
- window.location.href = "/paths";
- }
- }).catch((error) => {
- console.log(error)
- })
- }
-
- //申请发布
- if(loadtype===true){
-
- let pathid=this.props.match.params.pathId;
- let url ="/paths/"+pathid+"/publish.json";
- axios.get(url).then((result)=>{
- if(result.status===200){
- if(result.data.status===0){
- this.setState({
- Modalstype:true,
- Modalstopval: result.data.message,
- })
- }else if(result.data.status===1){
- window.location.reload();
- }
- }
- }).catch((error)=>{
- console.log(error);
- })
-
- }
- this.setState({
- Modalstype:false,
- Modalsbottomval:''
- })
- }
-
- render(){
- let{detailInfoList}=this.props;
- let{Modalstype,Modalstopval,cardsModalcancel,cardsModalsave,Modalsbottomval,cardsModalsavetype,loadtype}=this.state;
- const radioStyle = {
- display: 'block',
- height: '30px',
- lineHeight: '30px',
- };
-
- return(
-
-
-
- {
- detailInfoList &&
-
-
-
- {detailInfoList.name}
-
-
- {detailInfoList===undefined?"":detailInfoList.allow_statistics===true?
-
-
- :""
- }
-
- {detailInfoList===undefined?"":detailInfoList.allow_statistics===true?
-
- 学习统计
- :""
- }
-
- { detailInfoList.allow_send === true &&
-
- }
-
-
-
- {
- detailInfoList &&
-
- { detailInfoList.stages_count!=0 ? - 章节{detailInfoList.stages_count}
: ""}
- { detailInfoList.stage_shixuns_count!=0 ? - 实训{ detailInfoList.stage_shixuns_count}
: ""}
- { detailInfoList.challenge_choose_count!=0 ? - 选择题任务{detailInfoList.challenge_choose_count}
: ""}
- { detailInfoList.challenges_count!=0 ? - 实践任务{detailInfoList.challenges_count}
: ""}
- { detailInfoList.subject_score!=0 ? - 经验值{detailInfoList.subject_score}
: ""}
- { detailInfoList.member_count!=0 ? - 学习人数{detailInfoList.member_count}
: ""}
-
- }
-
- {detailInfoList===undefined?"":detailInfoList.allow_delete===true?
删除路径:""}
-
- {
- detailInfoList.publish_status===0&&detailInfoList.allow_statistics===true?
-
申请发布:""
- }
-
-
- {
- detailInfoList.publish_status===1 && detailInfoList.allow_statistics===true?
-
撤销申请:""
- }
-
- {
- detailInfoList.publish_status===2 && detailInfoList.allow_statistics===true?
-
撤销发布:""
- }
-
-
-
- }
-
-
- )
- }
-}
+import React,{ Component } from "react";
+import { Modal,Radio,Input,Tooltip } from "antd";
+import { BrowserRouter as Router, Route, Link } from "react-router-dom";
+import SendPanel from "./sendPanel.js";
+import { getImageUrl } from 'educoder';
+import axios from 'axios';
+import Modals from '../../modals/Modals';
+import './DetailTop.css';
+
+const Search = Input.Search;
+const RadioGroup = Radio.Group;
+class DetailTop extends Component{
+ constructor(props){
+ super(props)
+ this.state={
+ cardsModalcancel:this.cardsModalcancel,
+ cardsModalsave:this.cardsModalsave,
+ Modalstype:false,
+ Modalstopval:"",
+ Modalsbottomval:'',
+ loadtype:false,
+ deletepathtype:false,
+ cardsModalsavetype:false
+ }
+ }
+
+ allow_deletepath=()=>{
+ this.setState({
+ Modalstype:true,
+ Modalstopval:"是否删除路径?",
+ deletepathtype:true
+ })
+ }
+
+ applyissuePath=()=>{
+ this.setState({
+ Modalstype:true,
+ Modalstopval:"发布申请已提交,请等待管理员的审核",
+ Modalsbottomval:"• 我们将在1-2个工作日内完成审核",
+ loadtype:true
+ })
+ }
+
+ cancelissuePath=()=>{
+ let pathId=this.props.match.params.pathId;
+ let url ="/paths/"+pathId+"/cancel_publish.json";
+ axios.get(url).then((result)=>{
+ if(result.status===200){
+ if(result.data.status===0){
+
+ }else if(result.data.status===1){
+ window.location.href = "/paths/" + result.data.subject_id
+ }
+ }
+ }).catch((error)=>{
+ console.log(error);
+ })
+ }
+
+ reovkissuePath=()=>{
+
+ this.setState({
+ Modalstype:true,
+ Modalstopval:"是否确认撤销发布",
+ Modalsbottomval:"确认后,回退到编辑状态",
+ cardsModalsavetype:true,
+ })
+
+ }
+ reovkissuePaths=()=>{
+ let pathId=this.props.match.params.pathId;
+ let url ="/paths/"+pathId+"/cancel_has_publish.json";
+ axios.get(url).then((result)=>{
+ if(result.status===200){
+ if(result.data.status===0){
+
+ }else if(result.data.status===1){
+ this.setState({
+ cardsModalsavetype:false,
+ loadtype:false,
+ deletepathtype:false
+ })
+ window.location.href = "/paths/" + result.data.subject_id
+ }
+ }
+ }).catch((error)=>{
+ console.log(error);
+ })
+ }
+
+ cardsModalcancel=()=>{
+ this.setState({
+ Modalstype:false,
+ Modalsbottomval:'',
+ loadtype:false,
+ deletepathtype:false
+ })
+ }
+
+ cardsModalsave=()=>{
+ let {loadtype,deletepathtype}=this.state;
+
+ //删除路径
+ if(deletepathtype===true){
+ let pathid=this.props.match.params.pathId;
+ const deleteUrl = `/paths/`+pathid+`.json`;
+ axios.delete(deleteUrl).then((response) => {
+ const status = response.data.status
+ if (status === 1) {
+ window.location.href = "/paths";
+ }
+ }).catch((error) => {
+ console.log(error)
+ })
+ }
+
+ //申请发布
+ if(loadtype===true){
+
+ let pathid=this.props.match.params.pathId;
+ let url ="/paths/"+pathid+"/publish.json";
+ axios.get(url).then((result)=>{
+ if(result.status===200){
+ if(result.data.status===0){
+ this.setState({
+ Modalstype:true,
+ Modalstopval: result.data.message,
+ })
+ }else if(result.data.status===1){
+ window.location.reload();
+ }
+ }
+ }).catch((error)=>{
+ console.log(error);
+ })
+
+ }
+ this.setState({
+ Modalstype:false,
+ Modalsbottomval:''
+ })
+ }
+
+ render(){
+ let{detailInfoList}=this.props;
+ let{Modalstype,Modalstopval,cardsModalcancel,cardsModalsave,Modalsbottomval,cardsModalsavetype,loadtype}=this.state;
+ const radioStyle = {
+ display: 'block',
+ height: '30px',
+ lineHeight: '30px',
+ };
+
+ return(
+
+
+
+ {
+ detailInfoList &&
+
+
+
+ {detailInfoList.name}
+
+
+ {detailInfoList===undefined?"":detailInfoList.allow_statistics===true?
+
+
+
+
+
+ :""
+ }
+
+ {detailInfoList===undefined?"":detailInfoList.allow_statistics===true?
+
+ 学习统计
+ :""
+ }
+
+ { detailInfoList.allow_send === true &&
+
+ }
+
+
+
+ {
+ detailInfoList &&
+
+ { detailInfoList.stages_count!=0 ? - 章节{detailInfoList.stages_count}
: ""}
+ { detailInfoList.stage_shixuns_count!=0 ? - 实训{ detailInfoList.stage_shixuns_count}
: ""}
+ { detailInfoList.challenge_choose_count!=0 ? - 选择题任务{detailInfoList.challenge_choose_count}
: ""}
+ { detailInfoList.challenges_count!=0 ? - 实践任务{detailInfoList.challenges_count}
: ""}
+ { detailInfoList.subject_score!=0 ? - 经验值{detailInfoList.subject_score}
: ""}
+ { detailInfoList.member_count!=0 ? - 学习人数{detailInfoList.member_count}
: ""}
+
+ }
+
+ {detailInfoList===undefined?"":detailInfoList.allow_delete===true?
删除路径:""}
+
+ {
+ detailInfoList.publish_status===0&&detailInfoList.allow_statistics===true?
+
申请发布:""
+ }
+
+
+ {
+ detailInfoList.publish_status===1 && detailInfoList.allow_statistics===true?
+
撤销申请:""
+ }
+
+ {
+ detailInfoList.publish_status===2 && detailInfoList.allow_statistics===true?
+
撤销发布:""
+ }
+
+
+
+ }
+
+
+ )
+ }
+}
export default DetailTop;
\ No newline at end of file
diff --git a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
index 61933b765..a72771c39 100644
--- a/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
+++ b/public/react/src/modules/paths/PathDetail/PathDetailIndex.js
@@ -369,9 +369,11 @@ class PathDetailIndex extends Component{
课程须知
{detailInfoList===undefined?"":detailInfoList.allow_statistics===true?
+
-
+
+
:""
}
@@ -397,16 +399,18 @@ class PathDetailIndex extends Component{