From 8256ede4958340073cc9b0a3fc28bb71da9bb4a1 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Mon, 5 Aug 2019 17:21:35 +0800
Subject: [PATCH 07/18] =?UTF-8?q?=E5=A4=A7=E5=B0=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/forums/MemoNew.js | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/public/react/src/modules/forums/MemoNew.js b/public/react/src/modules/forums/MemoNew.js
index a7b483c77..48c789eae 100644
--- a/public/react/src/modules/forums/MemoNew.js
+++ b/public/react/src/modules/forums/MemoNew.js
@@ -553,10 +553,12 @@ class MemoNew extends Component {
return attachments;
}
handleChange = (info) => {
- let fileList = info.fileList;
- this.setState({
- fileList: appendFileSizeToUploadFileAll(fileList)
- });
+ if (info.file.status === 'uploading' || info.file.status === 'done') {
+ let fileList = info.fileList;
+ this.setState({
+ fileList: appendFileSizeToUploadFileAll(fileList)
+ });
+ }
}
onAttachmentRemove = (file) => {
this.props.confirm({
@@ -624,7 +626,7 @@ class MemoNew extends Component {
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
- // message.error('文件大小必须小于150MB!');
+ this.props.showNotification('文件大小必须小于150MB!');
}
return isLt150M;
},
From 6ecd439ce5907d0e8c755260d0cb112abdae2bf3 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Mon, 5 Aug 2019 17:43:32 +0800
Subject: [PATCH 08/18] =?UTF-8?q?=E8=AF=B7=E8=BE=93=E5=85=A5=E7=9C=9F?=
=?UTF-8?q?=E5=AE=9E=E5=A7=93=E5=90=8D=EF=BC=8C=E6=9C=80=E5=A4=A7=E9=99=90?=
=?UTF-8?q?=E5=88=B610=E4=B8=AA=E5=AD=97=E7=AC=A6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/user/account/AccountBasicEdit.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js
index aa7f9dec1..824e39438 100644
--- a/public/react/src/modules/user/account/AccountBasicEdit.js
+++ b/public/react/src/modules/user/account/AccountBasicEdit.js
@@ -398,7 +398,7 @@ class AccountBasic extends Component {
callback();
return;
}
- callback('请输入您的姓名,最大限制10个字符');
+ callback('请输入真实姓名,最大限制10个字符');
}
render() {
@@ -512,11 +512,11 @@ class AccountBasic extends Component {
rules: [{
// initialValue: this.state.cityDefaultValue,
required: true,
- message: '请输入您的姓名,最大限制10个字符',
+ message: '请输入真实姓名,最大限制10个字符',
validator: this.checkNameLength
}],
})(
- this.showOrHide(showRealName)}>
}>
From c0359dc57d1a4046176a9f92442fb55b839014eb Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Mon, 5 Aug 2019 18:01:44 +0800
Subject: [PATCH 09/18] 30
---
public/react/src/modules/paths/PathNew.js | 2 +-
.../src/modules/user/account/AccountBasicEdit.js | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/public/react/src/modules/paths/PathNew.js b/public/react/src/modules/paths/PathNew.js
index 3acad7eed..04e391732 100644
--- a/public/react/src/modules/paths/PathNew.js
+++ b/public/react/src/modules/paths/PathNew.js
@@ -71,7 +71,7 @@ function create_editorMD(id, width, high, placeholder, imageUrl,initValue, callb
}
});
// 一个页面有多个md时,onload方法只执行了一次
- window.md_elocalStorage(editorName, `MemoQuestion_${id}`, `${id}`);
+ // window.md_elocalStorage(editorName, `MemoQuestion_${id}`, `${id}`);
return editorName;
}
diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js
index 824e39438..ed55942c0 100644
--- a/public/react/src/modules/user/account/AccountBasicEdit.js
+++ b/public/react/src/modules/user/account/AccountBasicEdit.js
@@ -126,7 +126,7 @@ class AccountBasic extends Component {
// 输入昵称时change剩余的字数
changeNickName=(e)=>{
- let num= 20 - parseInt(e.target.value.length);
+ let num= 30 - parseInt(e.target.value.length);
this.setState({
nameLength:num < 0 ? 0 : num
})
@@ -394,11 +394,11 @@ class AccountBasic extends Component {
}
}
checkNameLength = (rule, value, callback) => {
- if (value && value.length <= 10) {
+ if (value && value.length <= 30) {
callback();
return;
}
- callback('请输入真实姓名,最大限制10个字符');
+ callback('请输入真实姓名,最大限制30个字符');
}
render() {
@@ -498,8 +498,8 @@ class AccountBasic extends Component {
message: '请输入您的昵称',
}],
})(
- {String(nameLength)}/20
+ {String(nameLength)}/30
}>
)}
@@ -512,11 +512,11 @@ class AccountBasic extends Component {
rules: [{
// initialValue: this.state.cityDefaultValue,
required: true,
- message: '请输入真实姓名,最大限制10个字符',
+ message: '请输入真实姓名,最大限制30个字符',
validator: this.checkNameLength
}],
})(
- this.showOrHide(showRealName)}>
}>
From c414beaa5b465c6d6b96e05151708733ef79a5e5 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Tue, 6 Aug 2019 10:33:50 +0800
Subject: [PATCH 10/18] https://www.trustie.net/issues/22810
---
.../courses/coursesPublic/Startshixuntask.js | 35 +++++++++++++++----
.../courses/shixunHomework/CommitSummary.js | 3 +-
2 files changed, 31 insertions(+), 7 deletions(-)
diff --git a/public/react/src/modules/courses/coursesPublic/Startshixuntask.js b/public/react/src/modules/courses/coursesPublic/Startshixuntask.js
index d146b5ef4..4075eff03 100644
--- a/public/react/src/modules/courses/coursesPublic/Startshixuntask.js
+++ b/public/react/src/modules/courses/coursesPublic/Startshixuntask.js
@@ -1,5 +1,5 @@
import React,{ Component } from "react";
-import { WordsBtn } from 'educoder';
+import { WordsBtn, getTaskUrlById } from 'educoder';
import {Tooltip,message,Modal,Spin} from 'antd';
import {Link} from 'react-router-dom';
import axios from 'axios';
@@ -44,6 +44,11 @@ class Startshixuntask extends Component{
startbtn:false
})
}else{
+ setTimeout(() => {
+ this.setState({
+ startbtn: false,
+ })
+ }, 1000)
if(response.data.status!=401&&response.data.status!=403){
const w=window.open('about:blank');
@@ -156,13 +161,31 @@ class Startshixuntask extends Component{
{/*知道了*/}
{/**/}
-
+
+ {/* 如果是继续实战和查看实战,实训作业这边,后台会直接返回identity,直接写成a标签 */}
{this.props.isStudent?
- {this.props.data&&this.props.data.task_operation&&this.props.data.task_operation?startbtn===false?this.taskoperationId( this.props.data&&this.props.data.task_operation[1])}>
- {this.props.data&&this.props.data.task_operation[0]}
- :"开启中":""}
- :""
+ {this.props.data&&this.props.data.task_operation&&this.props.data.task_operation?startbtn===false
+ ?
+ ((this.props.data && this.props.data.task_operation[1] && this.props.data.task_operation[1].indexOf('/') == -1) ?
+
+ {this.props.data.task_operation[0]}
+
+ :
+ this.taskoperationId( this.props.data&&this.props.data.task_operation[1])}>
+ {this.props.data&&this.props.data.task_operation[0]}
+ )
+ :"开启中":""}
+
+ :""
}
diff --git a/public/react/src/modules/courses/shixunHomework/CommitSummary.js b/public/react/src/modules/courses/shixunHomework/CommitSummary.js
index 728d86f96..db6180a5c 100644
--- a/public/react/src/modules/courses/shixunHomework/CommitSummary.js
+++ b/public/react/src/modules/courses/shixunHomework/CommitSummary.js
@@ -133,7 +133,8 @@ class CommitSummary extends Component{
this.gotohome()}>{data === undefined ? "" :data.course_name===undefined?"": data.course_name}
>
- {data === undefined ? "" :data.category===undefined?"":data.category.category_name}
>
作业详情
From 553c13a647f3fa960f85a91994afac7c989bcaae Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Tue, 6 Aug 2019 10:33:58 +0800
Subject: [PATCH 11/18] length
---
.../src/modules/user/account/AccountBasicEdit.js | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/public/react/src/modules/user/account/AccountBasicEdit.js b/public/react/src/modules/user/account/AccountBasicEdit.js
index ed55942c0..d2e5b0670 100644
--- a/public/react/src/modules/user/account/AccountBasicEdit.js
+++ b/public/react/src/modules/user/account/AccountBasicEdit.js
@@ -18,6 +18,8 @@ export function getHiddenName(name) {
const newName = name.substr(0,1)+str;
return newName
}
+const MAX_NAME_LENGTH = 10
+const MAX_NICKNAME_LENGTH = 20
class AccountBasic extends Component {
constructor(props){
super(props);
@@ -126,7 +128,7 @@ class AccountBasic extends Component {
// 输入昵称时change剩余的字数
changeNickName=(e)=>{
- let num= 30 - parseInt(e.target.value.length);
+ let num= MAX_NICKNAME_LENGTH - parseInt(e.target.value.length);
this.setState({
nameLength:num < 0 ? 0 : num
})
@@ -394,11 +396,11 @@ class AccountBasic extends Component {
}
}
checkNameLength = (rule, value, callback) => {
- if (value && value.length <= 30) {
+ if (value && value.length <= MAX_NAME_LENGTH) {
callback();
return;
}
- callback('请输入真实姓名,最大限制30个字符');
+ callback(`请输入真实姓名,最大限制${MAX_NAME_LENGTH}个字符`);
}
render() {
@@ -498,8 +500,8 @@ class AccountBasic extends Component {
message: '请输入您的昵称',
}],
})(
- {String(nameLength)}/30
+ {String(nameLength)}/{MAX_NICKNAME_LENGTH}
}>
)}
@@ -512,11 +514,11 @@ class AccountBasic extends Component {
rules: [{
// initialValue: this.state.cityDefaultValue,
required: true,
- message: '请输入真实姓名,最大限制30个字符',
+ message: `请输入真实姓名,最大限制${MAX_NAME_LENGTH}个字符`,
validator: this.checkNameLength
}],
})(
- this.showOrHide(showRealName)}>
}>
From 90dd68e5b48c5f58e925dbe7a0e7ac360c00cb29 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Tue, 6 Aug 2019 11:08:04 +0800
Subject: [PATCH 12/18] =?UTF-8?q?=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../react/src/modules/courses/shixunHomework/CommitSummary.js | 4 ++--
public/react/src/modules/forums/RecommendShixun.js | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/public/react/src/modules/courses/shixunHomework/CommitSummary.js b/public/react/src/modules/courses/shixunHomework/CommitSummary.js
index db6180a5c..69c88eb38 100644
--- a/public/react/src/modules/courses/shixunHomework/CommitSummary.js
+++ b/public/react/src/modules/courses/shixunHomework/CommitSummary.js
@@ -130,7 +130,7 @@ class CommitSummary extends Component{
height:'20px'
}} >
{/*educontentbox*/}
diff --git a/public/react/src/modules/forums/RecommendShixun.js b/public/react/src/modules/forums/RecommendShixun.js
index af0ca0007..535b027cc 100644
--- a/public/react/src/modules/forums/RecommendShixun.js
+++ b/public/react/src/modules/forums/RecommendShixun.js
@@ -32,7 +32,7 @@ class RecommendShixun extends Component {
-
9 ? _shixun.name : ''}
className="color-grey-6 task-hide mb10 recomment-name" style={{maxWidth:'147px'}}>
{_shixun.name}
From e0004e029d16d68ca53700f7d2c4e37697a5e3b3 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Tue, 6 Aug 2019 14:28:59 +0800
Subject: [PATCH 13/18] title
---
public/react/src/modules/forums/MemoDetail.js | 2 +-
public/react/src/modules/forums/PostItem.js | 2 +-
public/react/src/modules/forums/RightHotQuestion.js | 4 +++-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/public/react/src/modules/forums/MemoDetail.js b/public/react/src/modules/forums/MemoDetail.js
index fb435fdf3..5a042a173 100644
--- a/public/react/src/modules/forums/MemoDetail.js
+++ b/public/react/src/modules/forums/MemoDetail.js
@@ -693,7 +693,7 @@ class MemoDetail extends Component {
{/* overflowHidden1 */}
- {memo.subject + memo.subject}
+ {memo.subject}
{ memo.sticky && 置顶}
diff --git a/public/react/src/modules/forums/PostItem.js b/public/react/src/modules/forums/PostItem.js
index 43b63c3fa..99dcab46d 100644
--- a/public/react/src/modules/forums/PostItem.js
+++ b/public/react/src/modules/forums/PostItem.js
@@ -79,7 +79,7 @@ class PostItem extends Component {
- { user && (user.admin === true || user.user_id === memo.author_id) &&
+ { user && (user.admin === true || user.login === memo.login) &&
diff --git a/public/react/src/modules/forums/RightHotQuestion.js b/public/react/src/modules/forums/RightHotQuestion.js
index 35ab37644..d5e7ce713 100644
--- a/public/react/src/modules/forums/RightHotQuestion.js
+++ b/public/react/src/modules/forums/RightHotQuestion.js
@@ -24,7 +24,9 @@ class RightHotQuestion extends Component {
}
return hot_memos.map((item, index) => {
return
-
+
15 ? item.subject : '' }
+ >
{item.subject}
From d77d873787a776df0151bd9fbc388295ce024512 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Tue, 6 Aug 2019 14:49:36 +0800
Subject: [PATCH 14/18] index
---
public/react/src/modules/page/tpiPage.css | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/public/react/src/modules/page/tpiPage.css b/public/react/src/modules/page/tpiPage.css
index 55e75059d..fe71de64f 100644
--- a/public/react/src/modules/page/tpiPage.css
+++ b/public/react/src/modules/page/tpiPage.css
@@ -13,9 +13,11 @@
margin-top: -20px;
margin-left: -17px;
left: 50%;
- top: 50%;
+ top: 50%;
+ /* .editormd-preview 有个 z-index 99 某些情况下,被cm盖住了 */
z-index: 50;
}
+
.b-label>.resize-helper button{
width: 24px;
height: 24px;
@@ -64,6 +66,7 @@
,#game_show_content #tab_con_5 .editormd-preview {
width: 100% !important;
height: 100% !important;
+ z-index: 20;
}
/* tab 样式覆盖 */
From 8960cc62164451b05d38c770e98f0c0e3e26d282 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Tue, 6 Aug 2019 14:52:51 +0800
Subject: [PATCH 15/18]
showHiddenButton={true}
---
public/react/src/modules/comment/CommentContainer.js | 1 +
public/react/src/modules/comment/Comments.js | 6 +++++-
public/react/src/modules/tpm/TPMShixunDiscuss.js | 1 +
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/public/react/src/modules/comment/CommentContainer.js b/public/react/src/modules/comment/CommentContainer.js
index 0e12d0e7d..b02f4094f 100644
--- a/public/react/src/modules/comment/CommentContainer.js
+++ b/public/react/src/modules/comment/CommentContainer.js
@@ -15,6 +15,7 @@ class CommentContainer extends Component {
diff --git a/public/react/src/modules/comment/Comments.js b/public/react/src/modules/comment/Comments.js
index 380b90bd9..ae246197c 100644
--- a/public/react/src/modules/comment/Comments.js
+++ b/public/react/src/modules/comment/Comments.js
@@ -58,6 +58,9 @@ const _origin = window.location.origin;
comment_count_without_reply
currentPage
comments
+
+ showRewardButton 是否显示奖励按钮
+ showHiddenButton 是否显示隐藏按钮
接口
deleteComment 删除
@@ -360,7 +363,8 @@ class Comments extends Component {
:""}
- { (this.props.onlySuperAdminCouldHide && item.isSuperAdmin || !this.props.onlySuperAdminCouldHide && item.admin === true) ?
+ { this.props.showHiddenButton == true
+ && (this.props.onlySuperAdminCouldHide && item.isSuperAdmin || !this.props.onlySuperAdminCouldHide && item.admin === true) ?
this.onCommentBtnClick(item, '', item.hidden ? 'hiddenCancel' : 'hidden') }>
diff --git a/public/react/src/modules/tpm/TPMShixunDiscuss.js b/public/react/src/modules/tpm/TPMShixunDiscuss.js
index 58830620a..9350060cc 100644
--- a/public/react/src/modules/tpm/TPMShixunDiscuss.js
+++ b/public/react/src/modules/tpm/TPMShixunDiscuss.js
@@ -50,6 +50,7 @@ class TPMShixunDiscuss extends Component {
// onPaginationChange={this.onPaginationChange}
//
Date: Tue, 6 Aug 2019 16:12:37 +0800
Subject: [PATCH 16/18] LinkAfterLogin
---
.../src/common/components/LinkAfterLogin.js | 23 +++++++++++++++
public/react/src/common/educoder.js | 1 +
.../src/modules/forums/RightMyPublish.js | 4 +--
public/react/src/modules/tpm/TPMIndexHOC.js | 29 +++++++++++++++++--
4 files changed, 52 insertions(+), 5 deletions(-)
create mode 100644 public/react/src/common/components/LinkAfterLogin.js
diff --git a/public/react/src/common/components/LinkAfterLogin.js b/public/react/src/common/components/LinkAfterLogin.js
new file mode 100644
index 000000000..d0df08f0a
--- /dev/null
+++ b/public/react/src/common/components/LinkAfterLogin.js
@@ -0,0 +1,23 @@
+import React, { Component } from 'react';
+
+// 登录后才能跳转
+class LinkAfterLogin extends Component {
+
+ constructor(props) {
+ super(props);
+ }
+ checkAuth = () => {
+ if (this.props.checkIfLogin()) {
+ this.props.history.push(this.props.to)
+ } else {
+ this.props.showLoginDialog()
+ }
+ }
+ render() {
+ return(
+ {this.props.children}
+ )
+ }
+}
+
+export default LinkAfterLogin;
\ No newline at end of file
diff --git a/public/react/src/common/educoder.js b/public/react/src/common/educoder.js
index 2afbca8d1..2074e495a 100644
--- a/public/react/src/common/educoder.js
+++ b/public/react/src/common/educoder.js
@@ -36,6 +36,7 @@ export { ModalHOC } from './components/ModalHOC'
export { SetAppModel } from './components/SetAppModel'
+export { default as LinkAfterLogin } from './components/LinkAfterLogin'
export { default as Cropper } from './components/Cropper'
export { default as ConditionToolTip } from './components/ConditionToolTip'
export { default as DragValidator } from './components/DragValidator'
diff --git a/public/react/src/modules/forums/RightMyPublish.js b/public/react/src/modules/forums/RightMyPublish.js
index 94a09f7d9..fc101ae30 100644
--- a/public/react/src/modules/forums/RightMyPublish.js
+++ b/public/react/src/modules/forums/RightMyPublish.js
@@ -7,7 +7,7 @@ import PropTypes from 'prop-types';
import classNames from 'classnames'
-import { getImageUrl, toPath } from 'educoder'
+import { getImageUrl, toPath, LinkAfterLogin } from 'educoder'
import match_adImg from '../../images/ad/match_ad.jpg'
const $ = window.$
@@ -58,7 +58,7 @@ class RightMyPublish extends Component {
- 发布话题
+ 发布话题
{/*
我的发布
{my_memos_count}
diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js
index bbb2eb97d..0361b090f 100644
--- a/public/react/src/modules/tpm/TPMIndexHOC.js
+++ b/public/react/src/modules/tpm/TPMIndexHOC.js
@@ -9,6 +9,7 @@ import { getUrl } from 'educoder'
import axios from 'axios';
import './TPMIndex.css'
+import LoginDialog from '../login/LoginDialog';
import Trialapplication from "../login/Trialapplication";
// import "antd/dist/antd.css";
// import '../../css/educoder/edu-common.css'
@@ -74,6 +75,8 @@ export function TPMIndexHOC(WrappedComponent) {
Headertop:undefined,
Footerdown:undefined,
coursedata: {},
+
+ isRender: false
}
}
@@ -286,9 +289,22 @@ export function TPMIndexHOC(WrappedComponent) {
}).catch((error) => {
console.log(error)
})
+ }
+ hideLoginDialog = () => {
+ this.setState({
+ isRender: false
+ })
+ }
+ showLoginDialog = () => {
+ this.setState({
+ isRender: true
+ })
+ }
+ checkIfLogin = () => {
+ return this.state.current_user && this.state.current_user.login != ''
}
render() {
- let{Headertop,Footerdown}=this.state;
+ let{Headertop,Footerdown, isRender}=this.state;
const common = {
isSuperAdmin:this.isSuperAdmin,
isAdminOrCreator:this.isAdminOrCreator,
@@ -299,11 +315,18 @@ export function TPMIndexHOC(WrappedComponent) {
isAdminOrStudent: this.isAdminOrStudent,
isNotMember: this.isNotMember,
isUserid:this.state.coursedata&&this.state.coursedata.userid,
- fetchUser: this.fetchUser
+ fetchUser: this.fetchUser,
+
+ showLoginDialog: this.showLoginDialog,
+ checkIfLogin: this.checkIfLogin,
}
return (
-
+ {isRender===true ? this.hideLoginDialog()}
+ {...this.state}
+ {...this.props}
+ /> : ""}
{/* 注释掉了1440 影响到了手机屏幕的展示 */}