From d3885bfd95a23df975927de97d4d9f80c123b1ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 19 Mar 2020 20:34:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=BE=E5=A0=82=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E5=88=97=E8=A1=A8=E7=AD=9B=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/Resource/index.js | 12 ++-- .../react/src/modules/courses/boards/index.js | 61 +++++++++++-------- .../modules/courses/busyWork/commonWork.js | 23 +++++-- .../courses/coursesHome/CoursesHome.js | 2 +- .../courses/graduation/topics/index.js | 2 +- public/react/src/modules/courses/poll/Poll.js | 19 ++++-- .../courses/shixunHomework/shixunHomework.js | 19 ++++-- .../shixunchild/Challenges/Showmarkdown.js | 6 +- 8 files changed, 91 insertions(+), 53 deletions(-) diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index 1248f6138..4f12bce66 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -567,7 +567,7 @@ class Fileslists extends Component{ let {search,order,selectpage,checkAllValue,checkBoxValues}=this.state; let selectpagetype=selectpage===page&&checkBoxValues.length===15?true:false - console.log(selectpagetype) + this.setState({ page:page, @@ -1054,18 +1054,18 @@ class Fileslists extends Component{ {/*
this.moveTos(itm.value )} style={{marginLeft:15,width:itm.title.length>13?200:undefined,color:'#000000',overflow: 'hidden',textOverflow:'ellipsis',whiteSpace: 'nowrap'}}>{itm.title}
*/} {itm.children.length===0?'': this.istowshow(itm,filesId)} className="iconfont icon-xiajiantou font-12 ml2">} - + { this.state.istowshowid===itm.value? itm.children.map((tt,ti) => { return( filesId&&filesId===itm.id?"":
- -
  • 13?200:undefined,overflow: 'hidden',textOverflow:'ellipsis',whiteSpace: 'nowrap'}} key={ti} id={tt.value} onClick={() => this.moveTos(tt.value )} title={tt.title}>{tt.title}
  • - + +
  • 13?200:undefined,overflow: 'hidden',textOverflow:'ellipsis',whiteSpace: 'nowrap'}} key={ti} id={tt.value} onClick={() => this.moveTos(tt.value )} title={tt.title}>{tt.title}
  • +
    - + ) }) :''} diff --git a/public/react/src/modules/courses/boards/index.js b/public/react/src/modules/courses/boards/index.js index 9c18313fe..421faf93b 100644 --- a/public/react/src/modules/courses/boards/index.js +++ b/public/react/src/modules/courses/boards/index.js @@ -42,11 +42,11 @@ class Boards extends Component{ }) const _serachText = searchText || this.state.searchValue const _page = page || this.state.pagination.page - + const cid = this.props.match.params.coursesId const bid = this.props.match.params.boardId - // + // // hot const sort_type = this.state.sort_type // page_size @@ -131,7 +131,7 @@ class Boards extends Component{ const checkBoxValues = this.state.checkBoxValues const url = `/boards/${bid}/messages/bulk_move.json` - axios.put(url, { + axios.put(url, { ids: checkBoxValues, to_board_id: board.id }) @@ -147,7 +147,7 @@ class Boards extends Component{ }) .catch(function (error) { console.log(error); - }); + }); } onDelete = () => { const len = this.state.checkBoxValues.length @@ -179,16 +179,16 @@ class Boards extends Component{ }) .catch(function (error) { console.log(error); - }); + }); } }) - + } onSticky = (message) => { - const cid = this.props.match.params.coursesId + const cid = this.props.match.params.coursesId const url = `/messages/${message.id}/sticky_top.json` - axios.put(url, { + axios.put(url, { course_id: cid, }) .then((response) => { @@ -203,7 +203,7 @@ class Boards extends Component{ }) .catch(function (error) { console.log(error); - }); + }); } onItemClick = (item) => { const checkBoxValues = this.state.checkBoxValues.slice(0); @@ -219,7 +219,7 @@ class Boards extends Component{ onPressEnter = (e) => { clearTimeout(this.timeoutHandler) this.timeoutHandler = null; - + this.fetchAll(this.state.searchValue, 1) } onInputSearchChange = (e) => { @@ -240,12 +240,12 @@ class Boards extends Component{ trigger('boardAdd', parseInt(boardid)) } renameDir = () => { - const boardId = this.props.match.params.boardId + const boardId = this.props.match.params.boardId trigger('boardRename', { category_id: parseInt(boardId), category_name: this.state.boardName}) } onToBoardsNew = () => { - const courseId = this.state.course_id - const boardId = this.props.match.params.boardId + const courseId = this.state.course_id + const boardId = this.props.match.params.boardId this.props.toNewPage(courseId, boardId) } @@ -282,9 +282,18 @@ class Boards extends Component{ console.log('checked = ', checkedValues); } onPageChange = (pageNumber) => { - this.setState({ - checkBoxValues:[] - }) + let {checkAllValue}=this.state; + if(checkAllValue===true){ + this.setState({ + checkBoxValues:[], + checkAllValue:false + }) + }else{ + this.setState({ + checkBoxValues:[] + }) + } + this.fetchAll(null, pageNumber) } @@ -304,25 +313,25 @@ class Boards extends Component{ } const boardId = this.props.match.params.boardId const url = `/boards/${boardId}/messages/bulk_public.json` - axios.put(url, { + axios.put(url, { ids: checkBoxValues }) .then((response) => { if (response.data.status == 0) { - this.props.showNotification('操作成功') + this.props.showNotification('操作成功') this.fetchAll() } }) .catch(function (error) { console.log(error); }); - + } onSortTypeChange = (sort_type) => { this.setState({ sort_type }, () => { this.fetchAll() }) - + } render(){ const isAdmin = this.props.isAdmin() @@ -362,7 +371,7 @@ class Boards extends Component{ onPressEnter={this.onPressEnter} > - + {/* */} @@ -371,7 +380,7 @@ class Boards extends Component{
    {isAdmin&&已选 {checkBoxValues.length} 个 (不支持跨页勾选)}
    - { !!isAdmin && + { !!isAdmin &&
  • 删除
  • 发送
  • @@ -379,7 +388,7 @@ class Boards extends Component{
  • 移动到... -
      { boards && boards.length > 10 &&

      {this.setState({dirSearchValue: e.target.value})}}/> @@ -429,7 +438,7 @@ class Boards extends Component{ { messages.map((item, index) => { return (

      - : ''} @@ -455,10 +464,10 @@ class Boards extends Component{

      } */} - {pagination.total_count > 15 && 15 && } - + ) } diff --git a/public/react/src/modules/courses/busyWork/commonWork.js b/public/react/src/modules/courses/busyWork/commonWork.js index c5db27252..aa3ab2310 100644 --- a/public/react/src/modules/courses/busyWork/commonWork.js +++ b/public/react/src/modules/courses/busyWork/commonWork.js @@ -73,6 +73,9 @@ class commonWork extends Component{ componentDidUpdate(prevProps, prevState) { if (prevProps.coursesidtype != this.props.coursesidtype||prevProps.match.params.category_id!=this.props.match.params.category_id) { + this.setState({ + page:1 + }) if (this.props.match.path === "/classrooms/:coursesId/common_homeworks/:category_id" || this.props.match.path === "/classrooms/:coursesId/common_homework/:category_id"|| this.props.match.path === "/classrooms/:coursesId/group_homeworks/:category_id" || this.props.match.path === "/classrooms/:coursesId/group_homework/:category_id" ) { @@ -220,11 +223,21 @@ class commonWork extends Component{ } onPageChange=(pageNumber)=>{ - this.setState({ - page:pageNumber, - checkBoxValues:[] - }) - let {search,order,category_id}=this.state; + let {search,order,category_id,checkAll}=this.state; + + if(checkAll===true){ + this.setState({ + page:pageNumber, + checkBoxValues:[], + checkAll:false + }) + }else{ + this.setState({ + page:pageNumber, + checkBoxValues:[] + }) + } + this.getList(pageNumber,search,order,category_id); } diff --git a/public/react/src/modules/courses/coursesHome/CoursesHome.js b/public/react/src/modules/courses/coursesHome/CoursesHome.js index 965159832..cf84dcd1c 100644 --- a/public/react/src/modules/courses/coursesHome/CoursesHome.js +++ b/public/react/src/modules/courses/coursesHome/CoursesHome.js @@ -121,7 +121,7 @@ class CoursesHome extends Component { const { order, page, coursesHomelist } = this.state; const { user, tojoinclass } = this.props - console.log(tojoinclass, '--------------s') + return (
      {this.state.updata === undefined ? "" : { + let{type,StudentList_value,checkAllValue}=this.state; + + if(checkAllValue===true){ + this.setState({ + page:pageNumber, + checkBoxValues:[], + checkAllValue:false + }) + }else{ + this.setState({ + page:pageNumber, + checkBoxValues:[] + }) + } - this.setState({ - page:pageNumber, - checkBoxValues:[] - }) - let{type,StudentList_value}=this.state this.InitList(type,StudentList_value,pageNumber); } // 搜索 diff --git a/public/react/src/modules/courses/shixunHomework/shixunHomework.js b/public/react/src/modules/courses/shixunHomework/shixunHomework.js index 5b6eda89f..cb0d40c32 100644 --- a/public/react/src/modules/courses/shixunHomework/shixunHomework.js +++ b/public/react/src/modules/courses/shixunHomework/shixunHomework.js @@ -637,12 +637,19 @@ class ShixunHomework extends Component{ // } PaginationCourse=(pageNumber)=>{ - let {Coursename,order}=this.state; - - this.setState({ - page:pageNumber, - checkBoxValues:[] - }) + let {Coursename,order,checkedtype}=this.state; + if(checkedtype===true){ + this.setState({ + page:pageNumber, + checkBoxValues:[], + checkedtype:false + }) + }else{ + this.setState({ + page:pageNumber, + checkBoxValues:[], + }) + } this.homeworkupdatalist(Coursename,pageNumber,order); diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Showmarkdown.js b/public/react/src/modules/tpm/shixunchild/Challenges/Showmarkdown.js index f0ad12cfa..eaba9cb5f 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Showmarkdown.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Showmarkdown.js @@ -11,15 +11,15 @@ class Showmarkdown extends Component { componentDidMount() { if (this.props.descriptions) { - setTimeout(()=>{ - var shixunDescr = window.editormd.markdownToHTML("memo_content_editorMd", { + + window.editormd.markdownToHTML("memo_content_editorMd", { htmlDecode: "style,script,iframe", // you can filter tags decode taskList: true, tex: true, // 默认不解析 flowChart: true, // 默认不解析 sequenceDiagram: true // 默认不解析 }); - }, 200) + } }