Merge remote-tracking branch 'origin/master'

dev_forum
杨树明 6 years ago
commit 027598710a

@ -57,7 +57,8 @@ module.exports = {
// We generate sourcemaps in production. This is slow but gives good results. // We generate sourcemaps in production. This is slow but gives good results.
// You can exclude the *.map files from the build during deployment. // You can exclude the *.map files from the build during deployment.
// devtool: shouldUseSourceMap ? 'nosources-source-map' : false, //正式版 // devtool: shouldUseSourceMap ? 'nosources-source-map' : false, //正式版
devtool: shouldUseSourceMap ? 'source-map' : false,//测试版 // devtool: shouldUseSourceMap ? 'source-map' : false,//测试版
devtool:false,//正式版
// In production, we only want to load the polyfills and the app code. // In production, we only want to load the polyfills and the app code.
entry: [require.resolve('./polyfills'), paths.appIndexJs], entry: [require.resolve('./polyfills'), paths.appIndexJs],
output: { output: {

@ -26,7 +26,8 @@ class BoardsNew extends Component{
this.state = { this.state = {
fileList: [], fileList: [],
boards: [] boards: [],
title_num: 60
} }
} }
addSuccess = () => { addSuccess = () => {
@ -93,7 +94,8 @@ class BoardsNew extends Component{
status: 'done' status: 'done'
} }
}) })
this.setState({ fileList: _fileList, board_name: data.board_name })
this.setState({ fileList: _fileList, board_name: data.board_name, title_num: 60 - parseInt(data.subject.length) })
} }
} }
}) })
@ -228,8 +230,14 @@ class BoardsNew extends Component{
}); });
} }
// 附件相关 ------------ END // 附件相关 ------------ END
changeTitle=(e)=>{
console.log(e.target.value.length);
this.setState({
title_num: 60 - parseInt(e.target.value.length)
})
}
render() { render() {
let { addGroup, fileList, course_id } = this.state; let { addGroup, fileList, course_id, title_num } = this.state;
const { getFieldDecorator } = this.props.form; const { getFieldDecorator } = this.props.form;
const formItemLayout = { const formItemLayout = {
@ -303,21 +311,27 @@ class BoardsNew extends Component{
返回 返回
</a> </a>
</p> </p>
{/* notRequired */}
<Form {...formItemLayout} onSubmit={this.handleSubmit}> <Form {...formItemLayout} onSubmit={this.handleSubmit}>
<div className="formBlock" style={{paddingBottom: '0px'}}> <div className="formBlock" style={{paddingBottom: '0px'}}>
<Form.Item <Form.Item
label="标题" label="标题"
className="topicTitle " className="topicTitle "
> >
{getFieldDecorator('sticky', { { isAdmin &&
valuePropName: 'checked', <React.Fragment>
})( {getFieldDecorator('sticky', {
<Checkbox style={{ right: '0px', valuePropName: 'checked',
top: '-50px', })(
position: 'absolute' isAdmin && <Checkbox style={{ right: '0px',
}}>置顶</Checkbox> top: '-50px',
)} position: 'absolute'
}}>置顶</Checkbox>
)}
{/* checkbox 有个边距样式 .ant-checkbox-wrapper + span, */}
<span style={{ "padding-left": 0, "padding-right": 0 }}></span>
</React.Fragment>
}
{getFieldDecorator('subject', { {getFieldDecorator('subject', {
rules: [{ rules: [{
required: true, message: '请输入标题', required: true, message: '请输入标题',
@ -325,7 +339,8 @@ class BoardsNew extends Component{
max: 60, message: '最大限制为60个字符', max: 60, message: '最大限制为60个字符',
}], }],
})( })(
<Input placeholder="请输入帖子标题最大限制60个字符" className="searchViewAfter"/> <Input placeholder="请输入帖子标题最大限制60个字符" className="searchViewAfter" maxLength="60"
onInput={this.changeTitle} addonAfter={String(title_num)} />
)} )}
</Form.Item> </Form.Item>

@ -237,16 +237,16 @@ class TopicDetail extends Component {
// </a> // </a>
// </p> // </p>
<div className="color-grey" key={index}> <div className="color-grey df" key={index}>
<a className="color-grey ml20"> <a className="color-grey ">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i> <i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a> </a>
{fileName && <ConditionToolTip title={fileName} condition={fileName.length > 30 }> {/* {fileName && <ConditionToolTip title={fileName} condition={fileName.length > 30 }> </ConditionToolTip>} */}
<a href={item.url} <a href={item.url} title={fileName.length > 30 ? fileName : ''}
className="mr12 color9B9B" length="58"> className="mr12 color9B9B overflowHidden1" length="58" style={{maxWidth: '480px'}}>
{fileName} {fileName}
</a> </a>
</ConditionToolTip>}
<span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span> <span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span>
@ -416,7 +416,7 @@ class TopicDetail extends Component {
const user = this._getUser(); const user = this._getUser();
this.setState({ this.setState({
comments: addNewComment(comments, _id, content, user, this) comments: addNewComment(comments, _id, content, user, this.props.isSuperAdmin(), this)
}) })
const newMemo2 = Object.assign({}, this.state.memo); const newMemo2 = Object.assign({}, this.state.memo);
newMemo2.total_replies_count = newMemo2.total_replies_count + 1; newMemo2.total_replies_count = newMemo2.total_replies_count + 1;
@ -540,6 +540,10 @@ class TopicDetail extends Component {
padding-bottom: 20px; padding-bottom: 20px;
margin-bottom: 0px !important; margin-bottom: 0px !important;
} }
.course-message.topicDetail .panel-comment_item .comment_orig_content {
width: 1072px;
}
`}</style> `}</style>
<CBreadcrumb className={'independent'} items={[ <CBreadcrumb className={'independent'} items={[
{ to: `/courses/${courseId}`, name: this.props.coursedata.name}, { to: `/courses/${courseId}`, name: this.props.coursedata.name},
@ -646,7 +650,7 @@ class TopicDetail extends Component {
<div className="padding30 memoContent new_li" style={{ paddingBottom: '10px'}}> <div className="padding30 memoContent new_li" style={{ paddingBottom: '10px'}}>
<MarkdownToHtml content={memo.content}></MarkdownToHtml> <MarkdownToHtml content={memo.content}></MarkdownToHtml>
</div> </div>
<div className="padding40 bor-bottom-greyE" style={{paddingTop: '2px'}}> <div className="padding30 bor-bottom-greyE" style={{paddingTop: '2px'}}>
<div className="mt10 mb20"> <div className="mt10 mb20">
{/* ${memo.user_praise ? '' : ''} */} {/* ${memo.user_praise ? '' : ''} */}
<Tooltip title={`${memo.liked ? '取消点赞' : '点赞'}`}> <Tooltip title={`${memo.liked ? '取消点赞' : '点赞'}`}>
@ -701,11 +705,13 @@ class TopicDetail extends Component {
</div>} */} </div>} */}
</div> </div>
{ total_count > REPLY_PAGE_COUNT &&
<div className="memoMore"> <div className="memoMore" style={{'margin-top': '20px'}}>
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10}/> { total_count > REPLY_PAGE_COUNT &&
<Pagination showQuickJumper onChange={this.onPaginationChange} current={pageCount} total={total_count} pageSize={10}/>
}
<div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div> <div className="writeCommentBtn" onClick={this.showCommentInput}>写评论</div>
</div> } </div>
</div> </div>
</div> </div>

@ -218,6 +218,9 @@ class Boards extends Component{
} }
onPressEnter = (e) => { onPressEnter = (e) => {
clearTimeout(this.timeoutHandler)
this.timeoutHandler = null;
this.fetchAll(this.state.searchValue, 1) this.fetchAll(this.state.searchValue, 1)
} }
onInputSearchChange = (e) => { onInputSearchChange = (e) => {
@ -227,6 +230,7 @@ class Boards extends Component{
if (this.timeoutHandler) { if (this.timeoutHandler) {
clearTimeout(this.timeoutHandler) clearTimeout(this.timeoutHandler)
this.timeoutHandler = null;
} }
this.timeoutHandler = setTimeout(() => { this.timeoutHandler = setTimeout(() => {
this.fetchAll(this.state.searchValue, 1) this.fetchAll(this.state.searchValue, 1)

@ -18,6 +18,10 @@
.courseForm .ant-form-item-label { .courseForm .ant-form-item-label {
margin-left: -10px; margin-left: -10px;
} }
.courseForm .notRequired .ant-form-item-label {
margin-left: 0px;
}
/* 不知道被哪个样式影响,这里需要重置 */ /* 不知道被哪个样式影响,这里需要重置 */
.courseForm .ant-input:focus { .courseForm .ant-input:focus {

@ -500,8 +500,8 @@ class studentsList extends Component{
firstRowRight={ firstRowRight={
<React.Fragment> <React.Fragment>
{ isSuperAdmin && <React.Fragment> { isSuperAdmin && <React.Fragment>
{/* <CreateGroupByImportModal ref="createGroupByImportModal" {...this.props}></CreateGroupByImportModal> */} <CreateGroupByImportModal ref="createGroupByImportModal" {...this.props}></CreateGroupByImportModal>
{/* <WordsBtn style="blue" className="mr30" onClick={()=> this.refs['createGroupByImportModal'].setVisible(true)}>导入创建分班</WordsBtn> */} <WordsBtn style="blue" className="mr30" onClick={()=> this.refs['createGroupByImportModal'].setVisible(true)}>导入创建分班</WordsBtn>
</React.Fragment> } </React.Fragment> }
{ isAdmin && isParent && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>新建分班</WordsBtn> } { isAdmin && isParent && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>新建分班</WordsBtn> }
{ isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.deleteDir()}>删除分班</WordsBtn> } { isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.deleteDir()}>删除分班</WordsBtn> }

@ -32,6 +32,7 @@ class MemoDetailMDEditor extends Component {
} }
initMDEditor = () => { initMDEditor = () => {
// 因为props.memo不存在时本组件不会被加载这里直接在didMount里初始化即可 // 因为props.memo不存在时本组件不会被加载这里直接在didMount里初始化即可
const placeholder = '我要回复...' const placeholder = '我要回复...'
// const imageUrl = `/upload_with_markdown?container_id=${this.props.memo.id}&container_type=Memo`; // const imageUrl = `/upload_with_markdown?container_id=${this.props.memo.id}&container_type=Memo`;
@ -42,7 +43,7 @@ class MemoDetailMDEditor extends Component {
setTimeout(() => { setTimeout(() => {
var commentMDEditor = window.create_editorMD_4comment("memo_comment_editorMd", '', this.props.height || 240, placeholder, imageUrl, () => { var commentMDEditor = window.create_editorMD_4comment("memo_comment_editorMd", '', this.props.height || 240, placeholder, imageUrl, () => {
commentMDEditor.focus() commentMDEditor.focus()
this.isMDInited = true
this.initDrag() this.initDrag()
commentMDEditor.cm.on("change", (_cm, changeObj) => { commentMDEditor.cm.on("change", (_cm, changeObj) => {
@ -114,7 +115,13 @@ class MemoDetailMDEditor extends Component {
} }
onMockInputClick = () => { onMockInputClick = () => {
this.setState({isInited: true}) this.setState({isInited: true})
this.initMDEditor() if (!this.isMDInited) {
this.initMDEditor()
} else {
setTimeout(() => {
this.commentMDEditor.focus()
}, 10)
}
} }
render() { render() {
const { match, history, memo, placeholder, className } = this.props const { match, history, memo, placeholder, className } = this.props

Loading…
Cancel
Save