diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js index bc79bdada..dd37c441c 100644 --- a/public/react/src/modules/courses/Resource/Fileslistitem.js +++ b/public/react/src/modules/courses/Resource/Fileslistitem.js @@ -8,6 +8,7 @@ import {getUrl} from 'educoder'; import moment from 'moment'; import CoursesListType from '../coursesPublic/CoursesListType'; import Showoldfiles from "../coursesPublic/Showoldfiles"; +import Modals from '../../modals/Modals'; class Fileslistitem extends Component{ constructor(props){ @@ -74,7 +75,68 @@ class Fileslistitem extends Component{ Showoldfiles:false, }) } - render(){ + + onDelete = (id) => { + + this.setState({ + Modalstype:true, + Modalstopval:"是否确认删除?", + ModalCancel:this.cancelmodel, + ModalSave:()=>this.savedelete(id), + }) + + } + + cancelmodel=()=>{ + + this.setState({ + Modalstype:false, + Loadtype:false, + Modalstopval:"", + ModalCancel:"", + ModalSave:"", + checkBoxValues:[], + }) + + } + + savedelete=(id)=>{ + + this.setState({ + Modalstype:false, + }) + + + const cid = this.props.match.params.coursesId + const url = `/files/bulk_delete.json`; + axios.delete(url, { data: { + course_id:cid, + ids: [id], + }}) + .then((response) => { + if (response.data.status == 0) { + //Modalstopval:response.data.message, + + this.props.updatafiledfun() + this.setState({ + // Modalstype:true, + // Modalstopval:"删除成功", + ModalsBottomval:"", + // ModalSave:this.cancelmodel, + // Loadtype:true, + checkBoxValues:[], + checkAllValue:false + }) + + this.props.showNotification("删除成功"); + } + }) + .catch(function (error) { + console.log(error); + }); + } + + render(){ const { checkBox, discussMessage, @@ -84,6 +146,16 @@ class Fileslistitem extends Component{ return(
+ + {/*提示*/} + {this.state.Modalstype&&this.state.Modalstype===true?:""} - {this.props.isAdmin ||this.props.current_user.username===discussMessage.author.name? - - - this.settingList()}>设置 - - :""} -
+ + {discussMessage.course_groups.length===0?"": -

+

{discussMessage.course_groups.map((item,key)=>{ return(

{item.course_group_name} - 发布于 { moment(item.course_group_publish_time).format('YYYY-MM-DD hh:mm')} + 将发布于 { moment(item.course_group_publish_time).format('YYYY-MM-DD hh:mm')}
) })}

} -

+

- {discussMessage.author.name} + {discussMessage.author.login} 大小 {discussMessage.filesize} 下载 {discussMessage.downloads_count} 引用 {discussMessage.quotes} @@ -220,15 +289,31 @@ class Fileslistitem extends Component{ { discussMessage.publish_time===null?"":discussMessage.is_publish===true?moment(discussMessage.publish_time).fromNow():moment(discussMessage.publish_time).format('YYYY-MM-DD hh:mm')} + {this.props.isAdmin ||this.props.current_user.login===discussMessage.author.login? + + + + this.settingList()}>设置 + + + + this.onDelete(discussMessage.id)}>删除 + + + :""}

- 资源描述 : - {discussMessage.description} - {this.props.isAdmin ?this.settingList()}>:""} + {/**/} + +

资源描述 :{discussMessage.description===null?"暂无描述":discussMessage.description}
+ + {/*{this.props.isAdmin ?this.settingList()}>:""}*/}

diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index ec0f4c280..2cc5dbafb 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -106,6 +106,14 @@ class Fileslists extends Component{ }) } + updatafiled=()=>{ + debugger + if(this.props.match.params.main_id){ + this.seactall(); + }else if(this.props.match.params.Id){ + this.seactall(parseInt(this.props.match.params.Id),1) + } + } seactall=(coursesecondcategoryid,type)=>{ this.setState({ @@ -243,8 +251,7 @@ class Fileslists extends Component{ .then((response) => { if (response.data.status == 0) { //Modalstopval:response.data.message, - - this.seactall(); + this.updatafiled() this.setState({ // Modalstype:true, // Modalstopval:"删除成功", @@ -518,6 +525,7 @@ class Fileslists extends Component{ checkBoxValues:[], // checkAllValue:false }) + this.updatafiled() this.props.showNotification('资源移动成功') } }) @@ -647,8 +655,8 @@ class Fileslists extends Component{ secondRowLeft={
共 {total_count} 个资源 - 公共资源:{public_count}个 - {this.props.isAdmin()||this.props.isStudent()?私有资源:{private_count}个:""} + 已发布:{public_count}个 + {this.props.isAdmin()||this.props.isStudent()?未发布:{private_count}个:""}
} onPressEnter={this.onPressEnter} @@ -656,7 +664,7 @@ class Fileslists extends Component{ showSearchInput={true} > -
+ {this.props.isAdmin()?
{this.props.isAdmin()? 已选 {checkBoxValues.length} 个:""}
@@ -734,7 +742,7 @@ class Fileslists extends Component{ :""}
-
+
:""} { mainList && mainList.homeworks.length>0 && mainList.homeworks.map((item,index)=>{ + let canNotLink = !isAdminOrStudent && item.private_icon == true return(
{ - mainList && mainList.course_identity < 5 && + mainList && isAdmin && }
this.props.onItemClick(Object.assign({}, item, {id: item.homework_id})) }>

this.onItemClick(item)} + className="fl font-16 font-bd mt2 comnonwidth580" style={{cursor: canNotLink ? 'normal' : 'poninter'}} + onClick={canNotLink ? () => {} : () => this.onItemClick(item)} >{item.name} {/* 只有非课堂成员且作业是私有的情况下才会为true */} @@ -155,7 +157,7 @@ class CommonWorkItem extends Component{ { - mainList && mainList.course_identity < 5 && + mainList && isAdmin &&

    • diff --git a/public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js b/public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js index c6530e855..4cb69a8d7 100644 --- a/public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js +++ b/public/react/src/modules/courses/common/titleSearch/TitleSearchSection.js @@ -62,7 +62,7 @@ class Titlesearchsection extends Component{

      {title} -

    • +
    • { firstRowRight }
    • diff --git a/public/react/src/modules/courses/coursesHome/coursesHomeCard.js b/public/react/src/modules/courses/coursesHome/coursesHomeCard.js index 3f6d565cf..c5f6aeca7 100644 --- a/public/react/src/modules/courses/coursesHome/coursesHomeCard.js +++ b/public/react/src/modules/courses/coursesHome/coursesHomeCard.js @@ -1,136 +1,136 @@ -import React, { Component } from 'react'; -import {getImageUrl} from 'educoder'; -import { BrowserRouter as Router, Route, Link } from "react-router-dom"; -import {Tooltip,Spin,Alert} from 'antd'; -import ShowSpin from '../../../common/ShowSpin'; - -class coursesHomeCard extends Component{ - constructor(props) { - super(props) - } - render(){ - let {coursesHomelist}=this.props; - - return( -
      - -
      - - {/**/} - - { - coursesHomelist===undefined?"":coursesHomelist.courses.map((item,key)=>{ - - - return( -
      - -
      - -

      非成员不能访问

      -
      - - { - item.is_public===1&&item.id===1309? -
      -
      - - 公开 -
      - :"" - } - { - item.is_public===1&&item.id!=1309? -
      -
      - - 公开 -
      - :"" - } - {item.is_end===true?

      - -

      已结束
      -

      :""} -
      - -

      - {/*{item.name.length>32?*/} - {/**/} - {/**/} - {/*: {item.name}}*/} - 23?item.name:""}>{item.name} -

      - - - 用户 - - -

      {item.creator} {item.technical_title}

      -

      - - - {item.school} - - -

      -
      - -
      -
      - {item.visits===0?"": - - {item.visits} - - - } - - {item.course_members_count===0?"": - - {item.course_members_count} - - } - - {item.tasks_count===0?"": - - {item.tasks_count} - - } - - {/**/} - - {/**/} - {/*{item.attachment_count}*/} - {/**/} - - {/**/} - -
      -
      - -
      - ) - }) - } - - - - -
      -
      - ) - } - } -export default coursesHomeCard; - +import React, { Component } from 'react'; +import {getImageUrl} from 'educoder'; +import { BrowserRouter as Router, Route, Link } from "react-router-dom"; +import {Tooltip,Spin,Alert} from 'antd'; +import ShowSpin from '../../../common/ShowSpin'; + +class coursesHomeCard extends Component{ + constructor(props) { + super(props) + } + render(){ + let {coursesHomelist}=this.props; + + return( + + ) + } + } +export default coursesHomeCard; + diff --git a/public/react/src/modules/courses/coursesPublic/SelectResource.js b/public/react/src/modules/courses/coursesPublic/SelectResource.js index 5c2ab5780..1b400b800 100644 --- a/public/react/src/modules/courses/coursesPublic/SelectResource.js +++ b/public/react/src/modules/courses/coursesPublic/SelectResource.js @@ -196,6 +196,7 @@ class Selectresource extends Component{ } savecouseShixunModal=()=>{ + let {patheditarry}=this.state; let {coursesId,attachmentId}=this.props; let url="/files/import.json"; diff --git a/public/react/src/modules/courses/coursesPublic/SelectSetting.js b/public/react/src/modules/courses/coursesPublic/SelectSetting.js index a12099f79..541145fbf 100644 --- a/public/react/src/modules/courses/coursesPublic/SelectSetting.js +++ b/public/react/src/modules/courses/coursesPublic/SelectSetting.js @@ -181,6 +181,7 @@ class Selectsetting extends Component{ } savecouseShixunModal=()=>{ + debugger let {fileList,is_public,unified_setting,description,datatime,course_groups}=this.state; let newfileList=[]; @@ -188,7 +189,7 @@ class Selectsetting extends Component{ newfileList.push(list.response.id) } - if(description===undefined){ + if(description===undefined||description===null){ }else if(description.length>100){ this.setState({ @@ -512,7 +513,7 @@ class Selectsetting extends Component{ .popups{ padding-left: 20px; padding-right: 20px; - padding-top: 30px; + padding-top: 20px; } `}
      @@ -696,7 +697,7 @@ class Selectsetting extends Component{ id={"startimes"} className={"Selectleft20"} width={"200px"} - value={item.publish_time===undefined||item.publish_time===""?"":moment(item.publish_time, dateFormat)} + value={item.publish_time===undefined||item.publish_time===""?"":item.publish_time===null?"":moment(item.publish_time, dateFormat)} onChange={(e,index)=>this.onChangeTimepublishs(e,index,key)} // onChange={ this.onChangeTimepublish } disabledTime={disabledDateTime} @@ -739,7 +740,7 @@ class Selectsetting extends Component{ {/*{this.state.course_group_idtypes===true?

      请选择分班

      :""}*/} {/*{course_group_publish_timestype===true?

      请填写完整

      :""}*/} - - {descriptiontype===true?

      描述不能超过最大限制:100个字符

      :""} + {descriptiontype===true?

      请输入资源描述,最大限制100个字符

      :""}
      {this.props.Cancelname} this.Saves()}>{this.props.Savesname} diff --git a/public/react/src/modules/courses/exercise/ExerciseListItem.js b/public/react/src/modules/courses/exercise/ExerciseListItem.js index 43210315d..eb0377022 100644 --- a/public/react/src/modules/courses/exercise/ExerciseListItem.js +++ b/public/react/src/modules/courses/exercise/ExerciseListItem.js @@ -85,11 +85,14 @@ class ExerciseListItem extends Component{ text-overflow: ellipsis; white-space: nowrap; } + .homepagePostSetting { + position: absolute; + } ` }
      -

      +

      {/*{item.exercise_name}*/} { @@ -132,7 +135,7 @@ class ExerciseListItem extends Component{ {/*

    */} {/*
  • */}

    -

    +

    {item.exercise_status===1?"":{item.exercise_answer} 已答} {item.exercise_status===1?"":{item.exercise_unanswer} 未答} {item.unreview_count===null||item.exercise_status===1?"":{item.unreview_count} 未评数 } @@ -161,23 +164,32 @@ class ExerciseListItem extends Component{ {/*item.exercise_status ==2?"":*/} {/* 发布于{moment(item.exercise_left_time).fromNow()} */} {/*}*/} -

    - { - IsAdmin && -
    -
      -
    • - - -
    • -
    -
    - } + + + { IsAdmin &&
    + 编辑 + 设置 +
    } + +

    + {/*{*/} + {/*IsAdmin &&*/} + {/*
    */} + {/*
      */} + {/*
    • */} + {/**/} + {/*
        */} + {/*
      • 编辑
      • */} + {/*
      • 设置
      • */} + {/*
      */} + {/*
    • */} + {/*
    */} + {/*
    */} + {/*}*/} + + { IsStudent &&
    diff --git a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js index 3e3259a72..942fa96ca 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js @@ -185,18 +185,21 @@ class GraduateTaskItem extends Component{ { this.props.isAdmin?{discussMessage.name}:"" } { this.props.isStudent? {discussMessage.name}:"" } { this.props.isNotMember?this.props.discussMessage.private_icon===true? - {discussMessage.name} + {discussMessage.name} : {discussMessage.name}:"" } @@ -234,12 +237,20 @@ class GraduateTaskItem extends Component{

    - + {this.props.isAdmin?
    - + 编辑 diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js index a708939ba..ec1cf4e48 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js @@ -473,7 +473,7 @@ class GraduationTasksSubmitedit extends Component{ {/*{workslist&&workslist.task_name}*/} {/*>*/} {/**/} - {this.props.user.username} 提交作品 + {this.props.user&&this.props.user.username} 提交作品

    diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js index 2a0ffa8fb..e1284832c 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitnew.js @@ -459,7 +459,7 @@ render(){ {/*{workslist&&workslist.task_name}*/} {/*>*/} {/**/} - {this.props.user.username} 提交作品 + {this.props.user&&this.props.user.username} 提交作品

    diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js index a76354481..a45a105fd 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraise.js @@ -1,7 +1,7 @@ import React,{Component} from "React"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag} from "antd"; import {Link} from 'react-router-dom'; -import { WordsBtn } from 'educoder'; +import { WordsBtn,markdownToHTML } from 'educoder'; import axios from 'axios'; import moment from 'moment'; import Modals from '../../../modals/Modals'; @@ -205,7 +205,7 @@ class GraduationTasksappraise extends Component{
    - {datalist&&datalist.description} +
    {/*
    */} @@ -234,11 +234,11 @@ class GraduationTasksappraise extends Component{
    - 更新 - {datalist&&datalist.update_user_name} - - {moment(datalist&&datalist.update_time).format('YYYY-MM-DD HH:mm:ss')==="Invalid date"?"":moment(datalist&&datalist.update_time).format('YYYY-MM-DD HH:mm:ss')} - + {/*更新*/} + {/*{datalist&&datalist.update_user_name}*/} + {/**/} + {/*{moment(datalist&&datalist.update_time).format('YYYY-MM-DD HH:mm:ss')==="Invalid date"?"":moment(datalist&&datalist.update_time).format('YYYY-MM-DD HH:mm:ss')}*/} + {/**/} 提交 {datalist&&datalist.author_name} diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js index 69ab8ba79..1c733868e 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReply.js @@ -124,8 +124,9 @@ class GraduationTasksappraiseReply extends Component{ saveModulationModal=(value,num)=>{ console.log(value,num) let {operationId}=this.state; + let category_id= this.props.match.params.category_id; // console.log(value,num) - let url ="/graduation_works/"+operationId+"/adjust_score.json"; + let url ="/graduation_works/"+category_id+"/adjust_score.json"; axios.post(url,{ score:num, comment:value @@ -138,6 +139,7 @@ class GraduationTasksappraiseReply extends Component{ Modalstopval:result.data.message, ModalSave:this.cancelmodel, }) + this.fetchAllComments() } }).catch((error)=>{ diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReplyChild.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReplyChild.js index 094f8d96f..1279b4907 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReplyChild.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseReplyChild.js @@ -83,7 +83,7 @@ class GraduationTasksappraiseReplyChild extends Component{
    */} {this.props.ultimate===true?"": isAdmin && this.props.addSuccess()} > }
    diff --git a/public/react/src/modules/forums/PostItem.js b/public/react/src/modules/forums/PostItem.js index 2f79e6dc5..aa610184f 100644 --- a/public/react/src/modules/forums/PostItem.js +++ b/public/react/src/modules/forums/PostItem.js @@ -1,104 +1,104 @@ -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 { getImageUrl, toPath } from 'educoder'; - -import moment from 'moment'; - - -class PostItem extends Component { - _toTenThousand(num) { - if (num > 10000) { - return ( (num - 500)/ 10000 ).toFixed(1) + '万' - } - return num - } - - render() { - const { match, history, currentPage, memo, user, setTop, setDown } = this.props - return ( -
    -
    - - 用户头像 - -
    -

    - {/* target="_blank" */} - - {memo.subject} - - - { memo.sticky && 置顶 } - - { memo.reward && - - {memo.reward} - - } -

    - -
    - {memo.username} - {/*最后回复:todo{memo.username} - memo.language && memo.language != 'other' && {memo.language} - */} - {moment(memo.updated_at).fromNow()} - {memo.tag && memo.tag.length ? 来自 {memo.tag.join('/')} : ''} - - {/*C++*/} - -

    - {/* data-tip-down="回复数" {memo.replies_count} - {memo.praise_count}*/} - {memo.replies_count ? - - {memo.replies_count} 回复 - :''} - - {memo.praise_count ? - - {memo.praise_count} 赞 - :''} - - {memo.viewed_count ? - - {this._toTenThousand(memo.viewed_count)} 浏览 - :''} - -

    -
    - { user && (user.admin === true || user.user_id === memo.author_id) && - - } -
    -
    -
    - ); - } -} -export default PostItem +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 { getImageUrl, toPath } from 'educoder'; + +import moment from 'moment'; + + +class PostItem extends Component { + _toTenThousand(num) { + if (num > 10000) { + return ( (num - 500)/ 10000 ).toFixed(1) + '万' + } + return num + } + + render() { + const { match, history, currentPage, memo, user, setTop, setDown } = this.props + return ( +
    +
    + + 用户头像 + +
    +

    + {/* target="_blank" */} + + {memo.subject} + + + { memo.sticky && 置顶 } + + { memo.reward && + + {memo.reward} + + } +

    + +
    + {memo.username} + {/*最后回复:todo{memo.username} + memo.language && memo.language != 'other' && {memo.language} + */} + {moment(memo.updated_at).fromNow()} + {memo.tag && memo.tag.length ? 来自 {memo.tag.join('/')} : ''} + + {/*C++*/} + +

    + {/* data-tip-down="回复数" {memo.replies_count} + {memo.praise_count}*/} + {memo.replies_count ? + + {memo.replies_count} 回复 + :''} + + {memo.praise_count ? + + {memo.praise_count} 赞 + :''} + + {memo.viewed_count ? + + {this._toTenThousand(memo.viewed_count)} 浏览 + :''} + +

    +
    + { user && (user.admin === true || user.user_id === memo.author_id) && + + } +
    +
    +
    + ); + } +} +export default PostItem diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js index c6870c2e9..38584c793 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challenges.js @@ -8,7 +8,7 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; -import { getImageUrl } from 'educoder' +import { getImageUrl ,markdownToHTML} from 'educoder' import { CircularProgress } from 'material-ui/Progress'; @@ -250,9 +250,7 @@ class Challenges extends Component { id="challenge_editorMd_description">

    {ChallengesDataList === undefined ? "" :ChallengesDataList.description===null?"": - +

    }