From b2bc0dee0f20ec65f746b33452591f67b728909c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 16 Oct 2019 10:38:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=95=E5=8D=B7=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesPublic/SelectSetting.js | 56 ++++++++++++++----- .../exercise/Exercisestatisticalresult.js | 29 ++++++---- 2 files changed, 62 insertions(+), 23 deletions(-) diff --git a/public/react/src/modules/courses/coursesPublic/SelectSetting.js b/public/react/src/modules/courses/coursesPublic/SelectSetting.js index ff5751cc6..5dab77ca6 100644 --- a/public/react/src/modules/courses/coursesPublic/SelectSetting.js +++ b/public/react/src/modules/courses/coursesPublic/SelectSetting.js @@ -45,6 +45,12 @@ class Selectsetting extends Component{ componentDidMount() { + this.getalldata(); + } + + + + getalldata=()=>{ let {discussMessageid} =this.props; let course_id=this.props.course_id; let url="/files/"+discussMessageid+".json"; @@ -70,19 +76,10 @@ class Selectsetting extends Component{ console.log(error); }); - - } - - - - getalldata=()=>{ - } componentDidUpdate = (prevProps) => { if ( prevProps.visible != this.props.visible ) { - console.log(prevProps) - console.log(this.props) this.setState({ visible:this.props.visible }) @@ -233,6 +230,38 @@ class Selectsetting extends Component{ Radiovalue: e.target.value, }); } + + delectfils=(id)=>{ + this.setState({ + Modalstype:true, + Modalstopval:"是否确定删除该历史资源?", + ModalSave:()=>this.delectcousedelectfils(id), + ModalCancel:this.hidecouseShixunModal, + loadtype:false + }) + } + + delectcousedelectfils=(id)=>{ + let course_id=this.props.course_id; + const url = `/files/bulk_delete.json`; + + console.log(id) + axios.delete(url, { data: { + course_id: course_id, + ids:[id] + }}) + .then((response) => { + if (response.data.status == 0) { + // {"status":1,"message":"删除成功"} + this.props.showNotification(response.data.message); + this.getalldata + this.hidecouseShixunModal + } + }) + .catch(function (error) { + console.log(error); + }); + } render(){ let {datatime,description,datalist}=this.state; @@ -256,7 +285,7 @@ class Selectsetting extends Component{ lineHeight: '30px', }; - console.log(this.state.Radiovalue) + return(
-
  • +
  • {datalist&&datalist.title} {datalist&&datalist.attachment_histories.length===0?"":当前版本}
  • @@ -358,7 +387,7 @@ class Selectsetting extends Component{ {datalist&&datalist.attachment_histories.map((item,key)=>{ return(
    -
  • +
  • {item.title} {/*当前版本*/}
  • @@ -368,6 +397,7 @@ class Selectsetting extends Component{
  • {moment(item.created_on).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(item.created_on).format('YYYY-MM-DD HH:mm')}
  • + this.delectfils(item.id)}>
    ) })} diff --git a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js index 85ea6c902..13f384b79 100644 --- a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js +++ b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js @@ -60,12 +60,9 @@ class Exercisestatisticalresult extends Component { limit:limit } }).then((result) => { - // console.log(result) - this.setState({ data:result.data }) - }).catch((error) => { console.log(error) }) @@ -172,17 +169,29 @@ class Exercisestatisticalresult extends Component { .mr33{ margin-right: 33px; } + .fiilssort{ + position: absolute; + top: -9px; + } `}
    -
  • - {sort==="percent"?"正确率":sort==="type"?"题型":sort==="position"?"题序":""} -
      - {sort==='percent'?"":
    • this.onSortTypeChange('percent')}>正确率
    • } - {sort==='type'?"":
    • this.onSortTypeChange('type')}>题型
    • } - {sort==='position'?"":
    • this.onSortTypeChange('position')}>题序
    • } -
    +
  • this.onSortTypeChange('percent')}> + {/*{sort==="percent"?"正确率":sort==="type"?"题型":sort==="position"?"题序":""}*/} + {/**/} + {/*
      */} + {/*{sort==='percent'?"":
    • this.onSortTypeChange('percent')}>正确率
    • }*/} + {/*{sort==='type'?"":
    • this.onSortTypeChange('type')}>题型
    • }*/} + {/*{sort==='position'?"":
    • this.onSortTypeChange('position')}>题序
    • }*/} + {/*
    */} + 正确率 + + + +