Merge branch 'dev_hjm_return' into dev_aliyun

dev_hs
hjm 6 years ago
commit d2fd0b1b1f

@ -17,6 +17,7 @@ import {getUploadActionUrl, bytesToSize, uploadNameSizeSeperator, appendFileSize
const confirm = Modal.confirm;
const $ = window.$
const { Option } = Select;
const MAX_TITLE_LENGTH = 60
// https://lanhuapp.com/web/#/item/project/board/detail?pid=a3bcd4b1-99ce-4e43-8ead-5b8b0a410807&project_id=a3bcd4b1-99ce-4e43-8ead-5b8b0a410807&image_id=71072679-b925-4824-aceb-4649535e3652
class BoardsNew extends Component{
constructor(props){
@ -27,7 +28,7 @@ class BoardsNew extends Component{
this.state = {
fileList: [],
boards: [],
title_num: 60
title_num: 0
}
}
addSuccess = () => {
@ -95,7 +96,7 @@ class BoardsNew extends Component{
}
})
this.setState({ fileList: _fileList, board_name: data.board_name, title_num: 60 - parseInt(data.subject.length) })
this.setState({ fileList: _fileList, board_name: data.board_name, title_num: parseInt(data.subject.length) })
}
}
})
@ -233,9 +234,15 @@ class BoardsNew extends Component{
changeTitle=(e)=>{
console.log(e.target.value.length);
this.setState({
title_num: 60 - parseInt(e.target.value.length)
title_num: parseInt(e.target.value.length)
})
}
goBack = () => {
// this.props.history.goBack()
const courseId=this.props.match.params.coursesId;
const boardId = this.props.match.params.boardId
this.props.toListPage(courseId, boardId)
}
render() {
let { addGroup, fileList, course_id, title_num } = this.state;
const { getFieldDecorator } = this.props.form;
@ -309,8 +316,8 @@ class BoardsNew extends Component{
<p className="clearfix mt20 mb20">
<span className="fl font-24 color-grey-3">{this.isEdit ? "编辑" : "新建"}帖子</span>
<a href="javascript:void(0)" className="color-grey-6 fr font-16 mr2"
onClick={() => this.props.history.goBack()}>
{/*返回*/}
onClick={this.goBack}>
返回
</a>
</p>
{/* notRequired */}
@ -339,11 +346,11 @@ class BoardsNew extends Component{
rules: [{
required: true, message: '请输入标题',
}, {
max: 60, message: '最大限制为60个字符',
max: MAX_TITLE_LENGTH, message: `最大限制为${MAX_TITLE_LENGTH}个字符`,
}],
})(
<Input placeholder="请输入帖子标题最大限制60个字符" className="searchViewAfter" maxLength="60"
onInput={this.changeTitle} addonAfter={String(title_num)} />
<Input placeholder={`请输入帖子标题,最大限制${MAX_TITLE_LENGTH}个字符 `}className="searchViewAfter" maxLength={MAX_TITLE_LENGTH}
onInput={this.changeTitle} addonAfter={`${title_num}/${MAX_TITLE_LENGTH}`} />
)}
</Form.Item>

@ -75,15 +75,15 @@ class CommonWorkDetailIndex extends Component{
})
}
goback = () => {
// let workId=this.props.match.params.workId;
let workId=this.props.match.params.workId;
//
// if ( window.location.pathname.indexOf('appraise') == -1) {
// let category_id= this.state.category.category_id;
// this.props.toListPage(this.props.match.params, category_id)
// } else {
// this.props.toWorkListPage(this.props.match.params, workId)
// }
this.props.history.goBack()
if ( window.location.pathname.indexOf('appraise') == -1) {
let category_id= this.state.category.category_id;
this.props.toListPage(this.props.match.params, category_id)
} else {
this.props.toWorkListPage(this.props.match.params, workId)
}
// this.props.history.goBack()
}
// 补交附件

@ -9,6 +9,7 @@ import CBreadcrumb from '../common/CBreadcrumb'
const confirm = Modal.confirm;
const $ = window.$
const MAX_TITLE_LENGTH = 60;
class NewWork extends Component{
constructor(props){
super(props);
@ -17,7 +18,7 @@ class NewWork extends Component{
this.state={
title_value:"",
title_num:60,
title_num: 0,
contentFileList: [],
answerFileList: [],
workLoaded: false,
@ -91,7 +92,7 @@ class NewWork extends Component{
// course_id: data.course_id,
// course_name: data.course_name,
// category: data.category,
title_num: 60 - parseInt(data.name.length),
title_num: parseInt(data.name.length),
workLoaded: true,
init_min_num: data.min_num,
init_max_num: data.max_num,
@ -125,7 +126,7 @@ class NewWork extends Component{
changeTitle=(e)=>{
console.log(e.target.value.length);
this.setState({
title_num: 60 - parseInt(e.target.value.length)
title_num: parseInt(e.target.value.length)
})
}
handleSubmit = () => {
@ -398,7 +399,7 @@ class NewWork extends Component{
required: true, message: '请输入标题'
}],
})(
<Input placeholder="请输入作业标题最大限制60个字符" onInput={this.changeTitle} className="searchView searchViewAfter" style={{"width":"100%"}} maxLength="60" addonAfter={String(title_num)}/>
<Input placeholder="请输入作业标题最大限制60个字符" onInput={this.changeTitle} className="searchView searchViewAfter" style={{"width":"100%"}} maxLength={MAX_TITLE_LENGTH} addonAfter={`${String(title_num)}/${MAX_TITLE_LENGTH}`}/>
)}
</Form.Item>
<style>{`

@ -34,7 +34,7 @@ const { TextArea } = Input;
const confirm = Modal.confirm;
const $ = window.$
const { Option } = Select;
const TITLE_MAX_LENGTH = 60;
class ExerciceNew extends Component{
constructor(props){
super(props);
@ -418,7 +418,8 @@ class ExerciceNew extends Component{
<p className="clearfix mt20 mb20">
<span className="fl font-24 color-grey-3">{this.isEdit ? "编辑" : "新建"}试卷</span>
<a href="javascript:void(0)" className="color-grey-6 fr font-16 mr2"
onClick={() => this.props.history.length == 1 ? this.props.history.push(`/courses/${courseId}/exercises/${left_banner_id}`): this.props.history.goBack()}>
// () => this.props.history.length == 1 ? : this.props.history.goBack()
onClick={() => this.props.history.push(`/courses/${courseId}/exercises/${left_banner_id}`)}>
返回
</a>
</p>
@ -449,7 +450,9 @@ class ExerciceNew extends Component{
max: 20, message: '最大限制为20个字符',
}],
})( */}
<Input placeholder="请输入试卷标题最大限制60个字符" maxLength="60" className="input-100-40 mt5" value={exercise_name} onChange={this.exercise_name_change}/>
<Input placeholder={`请输入试卷标题,最大限制${TITLE_MAX_LENGTH}个字符`} maxLength={TITLE_MAX_LENGTH} className="input-100-40 mt5" value={exercise_name}
onChange={this.exercise_name_change} addonAfter={`${exercise_name ? exercise_name.length : 0}/${TITLE_MAX_LENGTH}`}
/>
{/* )} */}
</Form.Item>

Loading…
Cancel
Save