From f58d1e1b845147919b071504021f55ea78b5c755 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 5 Aug 2019 16:06:11 +0800 Subject: [PATCH 01/18] =?UTF-8?q?=E5=8E=BB=20is=5Fmd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/boards/TopicDetail.js | 7 +++++-- public/react/src/modules/forums/MemoDetail.js | 9 +++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/courses/boards/TopicDetail.js b/public/react/src/modules/courses/boards/TopicDetail.js index 970cf798a..58bb0c662 100644 --- a/public/react/src/modules/courses/boards/TopicDetail.js +++ b/public/react/src/modules/courses/boards/TopicDetail.js @@ -648,9 +648,12 @@ class TopicDetail extends Component {
- {memo.is_md == true ? : + + {/* {memo.is_md == true ? + + :
- } + } */}
diff --git a/public/react/src/modules/forums/MemoDetail.js b/public/react/src/modules/forums/MemoDetail.js index 8441a8ac9..3e92d7391 100644 --- a/public/react/src/modules/forums/MemoDetail.js +++ b/public/react/src/modules/forums/MemoDetail.js @@ -145,7 +145,7 @@ class MemoDetail extends Component { // && (!prevProps.memo || prevProps.memo.content != this.props.memo.content) ) { if (this.props.memo && this.props.memo.content && prevState.memoLoading === true && this.state.memoLoading === false) { // md渲染content,等xhr执行完(即memoLoading变化),memo.content更新后初始化md - if (this.props.memo.is_md) { + // if (this.props.memo.is_md) { setTimeout(()=>{ var shixunDescr = window.editormd.markdownToHTML("memo_content_editorMd", { htmlDecode: "style,script,iframe", // you can filter tags decode @@ -155,7 +155,7 @@ class MemoDetail extends Component { sequenceDiagram: true // 默认不解析 }); }, 200) - } + // } } } @@ -766,14 +766,15 @@ class MemoDetail extends Component {
- { !memo.is_md ? + {/* { !memo.is_md ?
: + } */}
- } +
From 5b32c98abd84993bd40363bf72e68e53d84362d3 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 5 Aug 2019 16:28:50 +0800 Subject: [PATCH 02/18] h --- public/react/src/modules/forums/shixun/ShiXunPostItem.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/forums/shixun/ShiXunPostItem.js b/public/react/src/modules/forums/shixun/ShiXunPostItem.js index 961e16ff1..9ae343641 100644 --- a/public/react/src/modules/forums/shixun/ShiXunPostItem.js +++ b/public/react/src/modules/forums/shixun/ShiXunPostItem.js @@ -44,7 +44,9 @@ class ShiXunPostItem extends Component {memo.subject}

{ memo.reward && - + {memo.reward} } From 3046237a56898f6289c3b7afe09ebc124b32b804 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 5 Aug 2019 16:43:36 +0800 Subject: [PATCH 03/18] =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20//=20=E8=A7=A3=E5=86=B3=E6=9C=89=E6=97=B6=E5=80=99?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=97=B6=E5=86=85=E5=AE=B9=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/App.css | 3 +++ public/react/src/modules/forums/MemoNew.js | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/public/react/src/App.css b/public/react/src/App.css index 7b0455bea..c54d8b905 100644 --- a/public/react/src/App.css +++ b/public/react/src/App.css @@ -58,4 +58,7 @@ html, body { /* resize */ .editormd .CodeMirror { border-right: none !important; +} +.editormd-preview { + border-left: 1px solid rgb(221, 221, 221); } \ No newline at end of file diff --git a/public/react/src/modules/forums/MemoNew.js b/public/react/src/modules/forums/MemoNew.js index e6482b8b6..a7b483c77 100644 --- a/public/react/src/modules/forums/MemoNew.js +++ b/public/react/src/modules/forums/MemoNew.js @@ -387,6 +387,11 @@ class MemoNew extends Component { // repertoires: [], // currentSelectRepertoiresIndex: -1, }, ()=> { + // 解决有时候编辑时内容不显示的问题 + setTimeout(() => { + this.mdRef.current && this.mdRef.current.setValue(content || '') + }, 2000) + $('.upload_filename').each((index, item) => { var width = window._textWidth($(item), '14px'); console.log(width) From a0e7afaf22a4a3a47672dcfa4740698cf27f8418 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 5 Aug 2019 16:50:49 +0800 Subject: [PATCH 04/18] md --- public/react/src/modules/courses/boards/TopicDetail.js | 8 ++++---- public/react/src/modules/forums/MemoDetail.js | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/courses/boards/TopicDetail.js b/public/react/src/modules/courses/boards/TopicDetail.js index 58bb0c662..d60c34461 100644 --- a/public/react/src/modules/courses/boards/TopicDetail.js +++ b/public/react/src/modules/courses/boards/TopicDetail.js @@ -648,12 +648,12 @@ class TopicDetail extends Component {
- - {/* {memo.is_md == true ? - + {/* */} + {memo.is_md == true ? + :
- } */} + }
diff --git a/public/react/src/modules/forums/MemoDetail.js b/public/react/src/modules/forums/MemoDetail.js index 3e92d7391..fb435fdf3 100644 --- a/public/react/src/modules/forums/MemoDetail.js +++ b/public/react/src/modules/forums/MemoDetail.js @@ -145,7 +145,7 @@ class MemoDetail extends Component { // && (!prevProps.memo || prevProps.memo.content != this.props.memo.content) ) { if (this.props.memo && this.props.memo.content && prevState.memoLoading === true && this.state.memoLoading === false) { // md渲染content,等xhr执行完(即memoLoading变化),memo.content更新后初始化md - // if (this.props.memo.is_md) { + if (this.props.memo.is_md) { setTimeout(()=>{ var shixunDescr = window.editormd.markdownToHTML("memo_content_editorMd", { htmlDecode: "style,script,iframe", // you can filter tags decode @@ -155,7 +155,7 @@ class MemoDetail extends Component { sequenceDiagram: true // 默认不解析 }); }, 200) - // } + } } } @@ -766,15 +766,15 @@ class MemoDetail extends Component {
- {/* { !memo.is_md ? + { !memo.is_md ?
: - } */} +
- + }
From 099e5bfbfc92f8dac720108e06105464a2c4d630 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 5 Aug 2019 16:55:22 +0800 Subject: [PATCH 05/18] =?UTF-8?q?=20=20/*=20=E6=9F=90=E4=BA=9B=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=EF=BC=8C=E8=A2=ABcm=E7=9B=96=E4=BD=8F?= =?UTF-8?q?=E4=BA=86=20*/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/App.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/react/src/App.css b/public/react/src/App.css index c54d8b905..50bccfb60 100644 --- a/public/react/src/App.css +++ b/public/react/src/App.css @@ -61,4 +61,6 @@ html, body { } .editormd-preview { border-left: 1px solid rgb(221, 221, 221); + /* 某些情况下,被cm盖住了 */ + z-index: 99; } \ No newline at end of file From ffe398bd528d7b8d7cc9788ab0b6b3ece9ba6b0c Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 5 Aug 2019 17:01:04 +0800 Subject: [PATCH 06/18] /moop_cases/new --- public/react/src/modules/moop_cases/CaseList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/moop_cases/CaseList.js b/public/react/src/modules/moop_cases/CaseList.js index b968cc930..bfb453dd8 100644 --- a/public/react/src/modules/moop_cases/CaseList.js +++ b/public/react/src/modules/moop_cases/CaseList.js @@ -93,7 +93,7 @@ class CaseList extends Component{

教学案例 - this.addQuestion(null, Q_TYPE_SINGLE)}>发布案例 + 发布案例

    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' }} >

    -

    +

    this.gotohome()}>{data === undefined ? "" :data.course_name===undefined?"": data.course_name} > {/* style="grey" */} @@ -143,7 +143,7 @@ class CommitSummary extends Component{

    -

    修改总结

    +

    {this.state.description ? '修改总结' : '提交总结'}

    this.gotohome()} className="color-grey-6 fr font-16 ml30 mt10">返回
    {/*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 影响到了手机屏幕的展示 */}