From ee4ec2a2371509e5d4b8d174e39a5c9feebdfe3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Sat, 24 Aug 2019 22:03:17 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=B0=83=E6=95=B4=20=E5=85=AC=E5=91=8A?= =?UTF-8?q?=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/gradinforms/Bullsubdirectory.js | 45 +++++++---- .../modules/courses/gradinforms/Eduinforms.js | 78 +++++++++++++++---- 2 files changed, 92 insertions(+), 31 deletions(-) diff --git a/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js b/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js index c0f66d55a..c7f773190 100644 --- a/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js +++ b/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js @@ -60,20 +60,25 @@ class Bullsubdirectory extends Component{ }; changeTopicName = (e) => { console.log("调用了changeTopicName"); - let num = parseInt(e.target.value.length); + let num = e.target.value.length; + if(num>60){ return; } this.setState({ addonAfter: num < 0 ? 0 : num }); - this.setState({ - eduintits: e.target.value - }) + if(num<=60){ + this.setState({ + eduintits: e.target.value + }) + + this.props.form.setFieldsValue({ + eduintits: e.target.value, + }); + } + - this.props.form.setFieldsValue({ - eduintits: e.target.value, - }); } handleSubmit=(e) => { e.preventDefault(); @@ -91,11 +96,25 @@ class Bullsubdirectory extends Component{ } var id=this.props.match.params.coursesId - + var titname=""; + try { + if(values.eduintits.length>0){ + if( values.eduintits.length>60){ + var str=values.eduintits; + titname=str.substring(0,60); + }else { + titname=values.eduintits; + } + }else { + titname=values.eduintits; + } + }catch (e) { + titname=values.eduintits; + } var url = `/courses/${id}/update_informs.json`; axios.post(url,{ inform_id:this.state.id, - name:values.eduintits, + name:titname, description:values.description, }).then((result) => { if(result){ @@ -103,13 +122,13 @@ class Bullsubdirectory extends Component{ if(result.data.status === 0){ this.props.form.setFieldsValue({ id:this.state.id, - eduintits:values.eduintits, + eduintits:titname, description:values.description, }); this.setState({ whethertoeditysl:false, id:this.state.id, - eduintits:values.eduintits, + eduintits:titname, description:values.description, }); this.props.getinputdata(); @@ -192,8 +211,6 @@ class Bullsubdirectory extends Component{ {getFieldDecorator('eduintits',{ initialValue: this.state.eduintits }, { rules: [{ required: true, message: '请在此输入标题,最多60个字符', - }, { - max: 60, message: '最大限制为60个字符', }], })(
@@ -275,7 +292,7 @@ class Bullsubdirectory extends Component{ rules: [{ required: true, message: '请在此输入内容,最多5000个字符', }, { - max: 5000, message: '最大限制为5000个字符', + len: 5000, message: '最大限制为5000个字符', }], })( { console.log("调用了changeTopicName"); - let num = parseInt(e.target.value.length); + let num = e.target.value.length; if(num>60){ return; } this.setState({ addonAfter: num < 0 ? 0 : num }); - this.setState({ - eduintit: e.target.value - }) + if(num<=60){ + this.setState({ + eduintits: e.target.value + }) - this.props.form.setFieldsValue({ - eduintits: e.target.value, - }); - } + this.props.form.setFieldsValue({ + eduintits: e.target.value, + }); + } + }; + // handleComposition=(e)=>{ + // if (e.type === 'compositionend') { + // // composition is end + // isOnComposition = false + // + // if (!isOnComposition && isChrome) { + // // fire onChange + // console.log(!isOnComposition); + // this.changeTopicName(e); + // } + // } else { + // // in composition + // isOnComposition = true + // } + // }; + // handleComposition = (e) => { + // console.log(e.type + ": " + e.target.value); + // if (e.type === 'compositionend') { + // // composition is end + // const value = e.target.value; + // this.setState({ isOnComposition: false },()=>{ + // // this.handleFixedChange(value); + // }); + // } else { + // // in composition + // this.setState({ isOnComposition: true }); + // } + // } handleSubmit=(e) => { e.preventDefault(); this.props.form.validateFields((err, values) => { @@ -137,10 +169,24 @@ class Eduinforms extends Component{ } var id=this.props.match.params.coursesId - + var titname=""; + try { + if(values.eduintits.length>0){ + if( values.eduintits.length>60){ + var str=values.eduintits; + titname=str.substring(0,60); + }else { + titname=values.eduintits; + } + }else { + titname=values.eduintits; + } + }catch (e) { + titname=values.eduintits; + } var url = `/courses/${id}/new_informs.json`; axios.post(url,{ - name:values.eduintits, + name:titname, description:values.description, }).then((result) => { if(result){ @@ -172,7 +218,7 @@ class Eduinforms extends Component{ render(){ - let{description,whethertoedit,addonAfter,eduintit,informs,yslbool} =this.state; + let{description,whethertoedit,addonAfter,eduintits,informs,yslbool} =this.state; const {getFieldDecorator} = this.props.form; return( @@ -234,8 +280,6 @@ class Eduinforms extends Component{ {getFieldDecorator('eduintits', { rules: [{ required: true, message: '请在此输入标题,最多60个字符', - }, { - max: 60, message: '最大限制为60个字符', }], })(
@@ -243,12 +287,12 @@ class Eduinforms extends Component{ *
-
From c59d10a4297054d0649be84e139333268ccf99f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sun, 25 Aug 2019 18:45:48 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E6=96=87=E5=AD=97?= =?UTF-8?q?=E8=AF=B4=E6=98=8E=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/home/shixunsHome.js | 2 +- public/react/src/modules/tpm/NewHeader.js | 18 +- public/react/src/modules/tpm/TPMIndexHOC.js | 2 +- .../src/modules/user/usersInfo/InfosBanner.js | 228 +++++------ .../modules/user/usersInfo/InfosProject.js | 2 +- .../src/modules/user/usersInfo/banner_out.js | 378 +++++++++--------- .../user/usersInfo/video/VideoUploadList.js | 2 +- public/react/src/search/SearchPage.js | 2 +- 8 files changed, 317 insertions(+), 317 deletions(-) diff --git a/public/react/src/modules/home/shixunsHome.js b/public/react/src/modules/home/shixunsHome.js index d366426c8..690baf28b 100644 --- a/public/react/src/modules/home/shixunsHome.js +++ b/public/react/src/modules/home/shixunsHome.js @@ -294,7 +294,7 @@ class ShixunsHome extends Component { {/*精选实训 改为 开发社区*/}
-

开发社区

+

实训项目

DEVELOPMENT COMMUNITY

更多 diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 0e0bd16bd..2a7b1b65c 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -734,7 +734,7 @@ submittojoinclass=(value)=>{
  • - 开发社区 + 实训项目
  • @@ -814,7 +814,7 @@ submittojoinclass=(value)=>{ onBlur={(e)=>this.hideshowSearchOpen(e)} onMouseLeave={()=>this.setevaluatinghides()}> this.onKeywordSearchKeyDowns()} onSearch={(value) => this.onKeywordSearchKeyDown(value)} // onPressEnter={this.onKeywordSearchKeyDown} @@ -862,13 +862,13 @@ submittojoinclass=(value)=>{ {user.username}
  • 我的课堂
  • {/* p 老师 l 学生 */} -
  • 我的实训
  • +
  • 我的实训项目
  • 我的实践课程
  • +
  • 我的开发项目
  • +
  • 我的众包
  • 客户管理
  • -
  • 我的项目
  • -
  • 我的众包
  • 账号管理
  • {/*
  • this.educoderlogin()} >登入测试接口
  • */} {/*
  • this.trialapplications()} >试用申请
  • */} @@ -903,11 +903,11 @@ submittojoinclass=(value)=>{
      @@ -925,7 +925,7 @@ submittojoinclass=(value)=>{ {/* /courses/join_course_multi_role */}
    • - 加入项目 + 加入开发项目
    • {tojoinitemtype===true?{ + placeholder="请输入6位开发项目邀请码" value={tojoinclasstitle} onInput={this.inputjoinclassvalue}/>

      -

      -
      -

      头像

      -
      -

      - {data && data.name} - { - data && is_current == false && data.identity =="学生" ? "" : - - } -

      -

      - - - - - - -

      -
      -
      -
      - {is_current ? "我":"TA"}的经验值 - {data && data.experience} -
      -
      - {is_current ? "我":"TA"}的金币 - {data && data.grade} -
      - { - is_current ? - - { - data && data.attendance_signed ? - 已签到 - : - 签到 - } - - : - - 私信 - - } -
      -
      -
      -
    • - this.setState({moduleName: 'courses'})} - to={`/users/${username}/courses`}>翻转课堂 -
    • -
    • - this.setState({moduleName: 'shixuns'})} - to={`/users/${username}/shixuns`}>开发社区 -
    • -
    • - this.setState({moduleName: 'paths'})} - to={`/users/${username}/paths`}>实践课程 -
    • -
    • - this.setState({moduleName: 'projects'})} - to={`/users/${username}/projects`}>项目 -
    • -
    • - this.setState({moduleName: 'package'})} - to={`/users/${username}/package`}>众包 -
    • - {((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin) - &&
    • - this.setState({moduleName: 'videos'})} - to={`/users/${username}/videos`}>视频 -
    • } -
      -
      -
    - ) - } -} +import React, { Component } from 'react'; + +import {Link} from 'react-router-dom'; +import {Tooltip,Menu} from 'antd'; +import {getImageUrl} from 'educoder'; + +import "./usersInfo.css" +import "../../courses/css/members.css" +import "../../courses/css/Courses.css" + +import banner from '../../../images/account/infobanner.png' + +class InfosBanner extends Component{ + constructor(props){ + super(props); + } + render(){ + let { + data , + id, + login, + moduleName, + current_user, + }=this.props; + let is_current=this.props.is_current; + let {username}= this.props.match.params; + let {pathname}=this.props.location; + moduleName=pathname.split("/")[3]; + return( +
    +
    +
    +

    头像

    +
    +

    + {data && data.name} + { + data && is_current == false && data.identity =="学生" ? "" : + + } +

    +

    + + + + + + +

    +
    +
    +
    + {is_current ? "我":"TA"}的经验值 + {data && data.experience} +
    +
    + {is_current ? "我":"TA"}的金币 + {data && data.grade} +
    + { + is_current ? + + { + data && data.attendance_signed ? + 已签到 + : + 签到 + } + + : + + 私信 + + } +
    +
    +
    +
  • + this.setState({moduleName: 'courses'})} + to={`/users/${username}/courses`}>翻转课堂 +
  • +
  • + this.setState({moduleName: 'shixuns'})} + to={`/users/${username}/shixuns`}>实训项目 +
  • +
  • + this.setState({moduleName: 'paths'})} + to={`/users/${username}/paths`}>实践课程 +
  • +
  • + this.setState({moduleName: 'projects'})} + to={`/users/${username}/projects`}>开发项目 +
  • +
  • + this.setState({moduleName: 'package'})} + to={`/users/${username}/package`}>众包 +
  • + {((is_current && current_user && current_user.is_teacher ) || current_user && current_user.admin) + &&
  • + this.setState({moduleName: 'videos'})} + to={`/users/${username}/videos`}>视频 +
  • } +
    +
    +
    + ) + } +} export default InfosBanner; \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/InfosProject.js b/public/react/src/modules/user/usersInfo/InfosProject.js index 082c18a71..2018f7b73 100644 --- a/public/react/src/modules/user/usersInfo/InfosProject.js +++ b/public/react/src/modules/user/usersInfo/InfosProject.js @@ -122,7 +122,7 @@ class InfosProject extends Component{
    { page == 1 && is_current && this.props.current_user && !category && this.props.current_user.user_identity != "学生" ? - :"" + :"" } { (!data || data.projects.length==0) && (!is_current || (this.props.current_user && this.props.current_user.user_identity === "学生" )) && diff --git a/public/react/src/modules/user/usersInfo/banner_out.js b/public/react/src/modules/user/usersInfo/banner_out.js index 644c9e02a..7afcf50fb 100644 --- a/public/react/src/modules/user/usersInfo/banner_out.js +++ b/public/react/src/modules/user/usersInfo/banner_out.js @@ -1,190 +1,190 @@ -import React, { Component } from 'react'; - -import {Link} from 'react-router-dom'; -import {Tooltip,Menu} from 'antd'; -import {getImageUrl} from 'educoder'; - -import "./usersInfo.css" -import "../../courses/css/members.css" -import "../../courses/css/Courses.css" -class banner_out extends Component{ - constructor(props){ - super(props); - } - render(){ - let { - data , - is_current, - is_edit, - sign, - type, - followed, - id, - login, - moduleName, - next_gold - }=this.props; - let {username}= this.props.match.params; - return( -
    -
    -
    -
    -
    -
    -
    - {is_current ? "我":"TA"}的经验值 - {data && data.experience} -
    - -
    - {is_current ? "我":"TA"}的金币 - {data && data.grade} -
    -
    - 头像 -
    -
    - {is_current ? "我":"TA"}的粉丝 - {data && data.fan_count} -
    - -
    - {is_current ? "我":"TA"}的关注 - {data && data.follow_count} -
    - - {data && data.name} -
    -
    -
    -
    - { - data && is_current == false && data.identity =="学生" ? "" : {data && data.identity} - } - - - - - - - - - - - - - - - - - - - - - {/* */} - { - data && data.college_identifier && - - - - - - } -
    -
    -
    -

    - { - is_edit && is_current ? - - : - is_current ? - {sign || "这家伙很懒,什么都没留下~"} - : - {sign || "这家伙很懒,什么都没留下~"} - } -

    - { - is_current ? -
    - { - data && data.attendance_signed ? - - 已签到 -

    明日签到 +{next_gold} 金币

    -
    - : - 签到 - // 试用申请 - } -
    - : - - } -
    -
    -
    -
  • - this.setState({moduleName: 'courses'})} - to={`/users/${username}/courses`}>课堂 -
  • -
  • - this.setState({moduleName: 'shixuns'})} - to={`/users/${username}/shixuns`}>实训 -
  • -
  • - this.setState({moduleName: 'paths'})} - to={`/users/${username}/paths`}>实践课程 -
  • -
  • - this.setState({moduleName: 'projects'})} - to={`/users/${username}/projects`}>项目 -
  • - -
  • - this.setState({moduleName: 'package'})} - to={`/users/${username}/package`}>众包 -
  • - - {/*{ data && data.identity!="学生" &&
  • 题库
  • }*/} - -
    -
    -
    -
    -
    - ) - } -} +import React, { Component } from 'react'; + +import {Link} from 'react-router-dom'; +import {Tooltip,Menu} from 'antd'; +import {getImageUrl} from 'educoder'; + +import "./usersInfo.css" +import "../../courses/css/members.css" +import "../../courses/css/Courses.css" +class banner_out extends Component{ + constructor(props){ + super(props); + } + render(){ + let { + data , + is_current, + is_edit, + sign, + type, + followed, + id, + login, + moduleName, + next_gold + }=this.props; + let {username}= this.props.match.params; + return( +
    +
    +
    +
    +
    +
    +
    + {is_current ? "我":"TA"}的经验值 + {data && data.experience} +
    + +
    + {is_current ? "我":"TA"}的金币 + {data && data.grade} +
    +
    + 头像 +
    +
    + {is_current ? "我":"TA"}的粉丝 + {data && data.fan_count} +
    + +
    + {is_current ? "我":"TA"}的关注 + {data && data.follow_count} +
    + + {data && data.name} +
    +
    +
    +
    + { + data && is_current == false && data.identity =="学生" ? "" : {data && data.identity} + } + + + + + + + + + + + + + + + + + + + + + {/* */} + { + data && data.college_identifier && + + + + + + } +
    +
    +
    +

    + { + is_edit && is_current ? + + : + is_current ? + {sign || "这家伙很懒,什么都没留下~"} + : + {sign || "这家伙很懒,什么都没留下~"} + } +

    + { + is_current ? +
    + { + data && data.attendance_signed ? + + 已签到 +

    明日签到 +{next_gold} 金币

    +
    + : + 签到 + // 试用申请 + } +
    + : + + } +
    +
    +
    +
  • + this.setState({moduleName: 'courses'})} + to={`/users/${username}/courses`}>课堂 +
  • +
  • + this.setState({moduleName: 'shixuns'})} + to={`/users/${username}/shixuns`}>实训 +
  • +
  • + this.setState({moduleName: 'paths'})} + to={`/users/${username}/paths`}>实践课程 +
  • +
  • + this.setState({moduleName: 'projects'})} + to={`/users/${username}/projects`}>开发项目 +
  • + +
  • + this.setState({moduleName: 'package'})} + to={`/users/${username}/package`}>众包 +
  • + + {/*{ data && data.identity!="学生" &&
  • 题库
  • }*/} + +
    +
    +
    +
    +
    + ) + } +} export default banner_out; \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/video/VideoUploadList.js b/public/react/src/modules/user/usersInfo/video/VideoUploadList.js index f3d6b4f7a..cb6c2f382 100644 --- a/public/react/src/modules/user/usersInfo/video/VideoUploadList.js +++ b/public/react/src/modules/user/usersInfo/video/VideoUploadList.js @@ -412,7 +412,7 @@ function VideoUploadList (props) {
    视频大小:不支持断点续传,单个视频文件最大200M;单次最多支持3个视频文件上传
    视频规格:avi、flv、f4v、m4v、mov、mp4、rmvb、swf、webm
    -
    温馨提示:请勿上传违法视频。平台将为每一个视频分配一个地址,您可以通过引用该地址将视频使用在开发社区等模块
    +
    温馨提示:请勿上传违法视频。平台将为每一个视频分配一个地址,您可以通过引用该地址将视频使用在实训项目等模块
    {!noUploads && diff --git a/public/react/src/search/SearchPage.js b/public/react/src/search/SearchPage.js index 499eb2f68..c2afca884 100644 --- a/public/react/src/search/SearchPage.js +++ b/public/react/src/search/SearchPage.js @@ -152,7 +152,7 @@ class SearchPage extends Component{ 实践课程 翻转课堂 - 开发社区 + 实训项目 交流问答