From f3a744b7121435ba95cdd9223ea6bf36df21327d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 31 Jul 2019 21:19:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/App.js | 7 +- public/react/src/AppConfig.js | 1 - .../modules/forums/MemoDetailMDEditortwo.js | 346 ++++++++--------- .../src/modules/message/css/messagemy.css | 65 +++- .../src/modules/message/js/MessagChat.js | 215 ++++++++++- .../react/src/modules/message/js/MessagSub.js | 109 ++++-- .../src/modules/message/js/MessagePrivate.js | 142 ++++++- .../src/modules/message/js/Messagerouting.js | 76 +++- .../messagemodal/WriteaprivateletterModal.js | 354 ++++++++++++++++++ 9 files changed, 1090 insertions(+), 225 deletions(-) create mode 100644 public/react/src/modules/message/messagemodal/WriteaprivateletterModal.js diff --git a/public/react/src/App.js b/public/react/src/App.js index e7ff43e79..156651b3b 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -19,8 +19,6 @@ import Trialapplicationysl from './modules/login/Trialapplicationysl'; import Trialapplicationreview from './modules/user/Trialapplicationreview'; import Addcourses from "./modules/courses/coursesPublic/Addcourses"; import AccountProfile from "./modules/user/AccountProfile"; - -import Messagerouting from "./modules/message/js/Messagerouting"; import Trialapplication from './modules/login/Trialapplication' import NotFoundPage from './NotFoundPage' @@ -225,7 +223,10 @@ const Interestpage = Loadable({ loader: () => import('./modules/login/EducoderInteresse'), loading: Loading, }) - +const Messagerouting= Loadable({ + loader: () => import('./modules/message/js/Messagerouting'), + loading: Loading, +}) class App extends Component { constructor(props) { super(props) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 2ad7df0d5..e89d59d69 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -43,7 +43,6 @@ export function initAxiosInterceptors(props) { // proxy = "https://testeduplus2.educoder.net" proxy="http://47.96.87.25:48080/" - // 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求; // 如果需要支持重复的请求,考虑config里面自定义一个allowRepeat参考来控制 const requestMap = {}; diff --git a/public/react/src/modules/forums/MemoDetailMDEditortwo.js b/public/react/src/modules/forums/MemoDetailMDEditortwo.js index 5eae90400..cc3a2b1af 100644 --- a/public/react/src/modules/forums/MemoDetailMDEditortwo.js +++ b/public/react/src/modules/forums/MemoDetailMDEditortwo.js @@ -1,173 +1,173 @@ -import React, { Component } from 'react'; -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames' - -import { isDev } from 'educoder' - -import './MemoDetailEditor.css' - -require('codemirror/lib/codemirror.css'); - -const $ = window.$; -///作业回答 专用 -class MemoDetailMDEditortwo extends Component { - constructor(props) { - super(props) - this.state = { - isInited: this.props.usingMockInput ? false : true, - isError: false, - errorMsg: '' - } - } - componentDidUpdate(prevProps, prevState, snapshot) { - if (this.props.memo && (!prevProps.memo || this.props.memo.id != prevProps.memo.id)) { - // this.keEditor = window.sd_create_editor_from_data(this.props.memo.id, null, "100%", "Memo"); - // window._kk = this.keEditor - } - } - - initMDEditor = () => { - // 因为props.memo不存在时,本组件不会被加载,这里直接在didMount里初始化即可 - const placeholder = '我要回复...' - // const imageUrl = `/upload_with_markdown?container_id=${this.props.memo.id}&container_type=Memo`; - const imageUrl = `/api/attachments.json`; - - // 执行太快了,样式不正常 - window.__tt = 400; - setTimeout(() => { - var commentMDEditor = window.create_editorMD_4comment("memo_comment_editorMd", '', this.props.height || 240, placeholder, imageUrl, () => { - commentMDEditor.focus() - - this.initDrag() - - commentMDEditor.cm.on("change", (_cm, changeObj) => { - this.setState({ - isError: false, - errorMsg: '' - }) - }) - }, { - watch: false, - dialogLockScreen: false, - }); - this.commentMDEditor = commentMDEditor; - window.commentMDEditor = commentMDEditor; - - }, window.__tt) - } - componentDidMount() { - !this.props.usingMockInput && this.initMDEditor() - } - initDrag = () => { - window.initMDEditorDragResize(".editor__resize", this.commentMDEditor) - } - - onCommit = () => { - const content = this.commentMDEditor.getValue(); - // this.props.showError == - if (this.props.showError == true) { - if (!content || content.trim() == "") { - this.setState({ - isError: true, - errorMsg: '不能为空' - }) - return; - } else if (content.length > 2000) { - this.setState({ - isError: true, - errorMsg: '不能超过2000个字符' - }) - return; - } - - this.setState({ - isError: false, - errorMsg: '' - }) - } - window.$(document).trigger("onReply", { commentContent: content - , id: this.props.memo.id, editor: this.commentMDEditor } ); - - } - - showEditor() { - $("html, body").animate({ scrollTop: $('#commentInput').offset().top - 100 }, 1000, () => { - if (this.commentMDEditor) { - this.commentMDEditor.cm.focus() - } else { - $('#commentInput input')[0].click() - } - }); - } - onMockInputClick = () => { - this.setState({isInited: true}) - this.initMDEditor() - } - render() { - const { match, history, memo, placeholder } = this.props - const { isInited, errorMsg } = this.state - if (!memo) { - return
- } - - return ( -+ this.smyJump(2)}> + 117llj与你的私信 +
+ {/*聊天页面*/} +2019/07/20
+ {/*右边*/} + + +私信列表
++ + {item.target.name} + {item.unread === true? + + :""} + + {(time)=>this.FormatTime(item.send_time)} +
+ +暂无数据哦~
++ {item.trigger_user.name} + {item.time} + {this.state.typeysl==="apply"?( + item.status===0? + 待处理:"" + ):""} + {this.state.typeysl==="apply"?( + item.status===1? + 已处理:"" + ):""} + +
++ { + item.content + } +
+ ++ 全部私信 + this.okmodalsType()}>写私信 +
+暂无数据哦~
++ this.smyJump()} className="mr20 private_message_a">{item.target.name} + 与你的私信 + [{item.message_count}{"条"}] + {item.send_time} +
+ + +杨树林
-工程师
+{this.props.current_user&&this.props.current_user.username}
+{this.props.current_user&&this.props.current_user.user_identity}
{Recentcontacts===false?"最近联系人":"搜索结果"}
+ + { + users.map((item,key)=>{ + return( +this.Getuserinformation(item)}> + + {item.name} +
+ ) + }) + } +*/} + {/* */} + {/* 实践教学*/} + {/*
*/} + {/**/} + {/* */} + {/* innov*/} + {/*
*/} + +请选择发送对象
+ :(floatingboxdisplays ===false?:"") + } + { + floatingboxdisplays===true? +请输入发送内容
+ : "" + } + {/*确认事件*/} ++ this.HideModal()} className="pop_close task-btn mr30">取消 + this.OKModal()} id="submit_send_letter">确定 +
+ {/*完善您的资料,将获得更多的使用权限