diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 9cf68503d..3c150c90c 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -21,16 +21,16 @@ let hashTimeout // TODO 开发期多个身份切换 let debugType ="" -if (isDev) { - const _search = window.location.search; - let parsed = {}; - if (_search) { - parsed = queryString.parse(_search); - } - debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : - window.location.search.indexOf('debug=s') != -1 ? 'student' : - window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' -} +// if (isDev) { +// const _search = window.location.search; +// let parsed = {}; +// if (_search) { +// parsed = queryString.parse(_search); +// } +// debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : +// window.location.search.indexOf('debug=s') != -1 ? 'student' : +// window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' +// } window._debugType = debugType; export function initAxiosInterceptors(props) { initOnlineOfflineListener() diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index 46ca129c5..517fe7c66 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -528,20 +528,31 @@ class Coursesleftnav extends Component{ axios.post(url, {name:value}).then((result)=>{ - if(result.data.status===0){ - // window.location.reload() - this.updasaveNavmoda() - // - notification.open({ - message:"提示", - description:result.data.message - }); - trigger('updateNavSuccess') - if(positiontype==="files"){ - window.location.href=`/courses/${coursesId}/file/${result.data.category_id}`; - // this.props.history.push(`/courses/${coursesId}/file/${result.data.category_id}`) + if(result!=undefined){ + if(result.data.status===0){ + // window.location.reload() + this.updasaveNavmoda() + // + notification.open({ + message:"提示", + description:result.data.message + }); + trigger('updateNavSuccess') + + if(positiontype==="files"){ + window.location.href=`/courses/${coursesId}/file/${result.data.category_id}`; + } + + if(positiontype==="boards"){ + window.location.href=`/courses/${coursesId}/boards/${result.data.category_id}`; + } + + if(positiontype==="course_groups"){ + window.location.href=`/courses/${coursesId}/course_groups/${result.data.group_id}`; + } + + } } - } }).catch((error)=>{ console.log(error) }) @@ -549,17 +560,19 @@ class Coursesleftnav extends Component{ saveboardpost=(url,value)=>{ axios.put(url, {name:value}).then((result)=>{ - if(result.data.status===0){ - // window.location.reload() - this.updasaveNavmoda() - trigger('updateNavSuccess') - - // - notification.open({ - message:"提示", - description:result.data.message - }); - } + if(result!=undefined){ + if(result.data.status===0){ + // window.location.reload() + this.updasaveNavmoda() + trigger('updateNavSuccess') + + // + notification.open({ + message:"提示", + description:result.data.message + }); + } + } }).catch((error)=>{ console.log(error) }) @@ -599,7 +612,7 @@ class Coursesleftnav extends Component{ let newid=this.props.match.params.coursesId; let url="/courses/"+newid+"/course_groups.json"; - this.saveNavmodapost(url,NavmodalValue) + this.saveNavmodapost(url,NavmodalValue,this.state.positiontype,this.props.match.params.coursesId) }else if(Navmodaltypename===3){ @@ -620,7 +633,7 @@ class Coursesleftnav extends Component{ let newid=this.props.match.params.coursesId; let url = "/courses/"+newid+"/boards.json"; - this.saveNavmodapost(url,NavmodalValue) + this.saveNavmodapost(url,NavmodalValue,this.state.positiontype,this.props.match.params.coursesId) }else if(Navmodaltypename===7) { @@ -708,13 +721,15 @@ class Coursesleftnav extends Component{ droppablepost=(url,list)=>{ axios.post(url,{position: list}).then((result)=>{ - // this.updasaveNavmoda(result.data.message) - this.updasaveNavmoda() - // - notification.open({ - message:"提示", - description:result.data.message - }); + if(result!=undefined){ + // this.updasaveNavmoda(result.data.message) + this.updasaveNavmoda() + // + notification.open({ + message:"提示", + description:result.data.message + }); + } }).catch((error)=>{ console.log(error) }) diff --git a/public/react/src/modules/courses/coursesPublic/SelectSetting.js b/public/react/src/modules/courses/coursesPublic/SelectSetting.js index ff5751cc6..57106600d 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 }) @@ -105,7 +102,6 @@ class Selectsetting extends Component{ ModalSave:this.hidecouseShixunModal, loadtype:false }) - this.props.Cancel() } savecouseShixunModal=()=>{ @@ -152,9 +148,10 @@ class Selectsetting extends Component{ delay_publish:Radiovalue }).then((result)=>{ if(result.data.status===0){ + this.hidecouseShixunModal() this.props.setupdate(attachmentId) this.props.showNotification("设置资源成功"); - this.hidecouseShixunModal() + this.props.Cancel() } }) @@ -233,6 +230,35 @@ 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)=>{ + const url = `/attachments/${id}.json`; + + axios.delete(url) + .then((response) => { + if (response.data.status == 0) { + // {"status":1,"message":"删除成功"} + this.props.showNotification(response.data.message); + this.getalldata + this.hidecouseShixunModal + }else{ + this.props.showNotification(response.data.message); + } + }) + .catch(function (error) { + console.log(error); + }); + } render(){ let {datatime,description,datalist}=this.state; @@ -256,7 +282,7 @@ class Selectsetting extends Component{ lineHeight: '30px', }; - console.log(this.state.Radiovalue) + return(
-
  • +
  • {datalist&&datalist.title} {datalist&&datalist.attachment_histories.length===0?"":当前版本}
  • @@ -358,7 +384,7 @@ class Selectsetting extends Component{ {datalist&&datalist.attachment_histories.map((item,key)=>{ return(
    -
  • +
  • {item.title} {/*当前版本*/}
  • @@ -368,6 +394,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)}>
    ) })} @@ -537,7 +564,7 @@ class Selectsetting extends Component{
    - 取消 + this.props.Cancel()}>取消 确定
    diff --git a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js index 85ea6c902..b87d34acf 100644 --- a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js +++ b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js @@ -19,7 +19,7 @@ class Exercisestatisticalresult extends Component { super(props); this.state = { data:undefined, - sort:"percent", + sort:"asc", exercise_group_id:[], page:1, limit:10, @@ -60,24 +60,28 @@ class Exercisestatisticalresult extends Component { limit:limit } }).then((result) => { - // console.log(result) - this.setState({ data:result.data }) - }).catch((error) => { console.log(error) }) } - onSortTypeChange=(value)=>{ - let{exercise_group_id,page,limit}=this.state; + onSortTypeChange=()=>{ + let{exercise_group_id,page,limit,sort}=this.state; + let newdesc="asc"; + if(sort==="desc"){ + newdesc="asc" + }else{ + newdesc="desc" + } this.setState({ - sort:value + sort:newdesc }) - this.updatefun(value,exercise_group_id,page,limit) + + this.updatefun(newdesc,exercise_group_id,page,limit) } funtaskstatustwo=(checkedValues,list)=>{ @@ -172,17 +176,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()}> + {/*{sort==="percent"?"正确率":sort==="type"?"题型":sort==="position"?"题序":""}*/} + {/**/} + {/*
      */} + {/*{sort==='percent'?"":
    • this.onSortTypeChange('percent')}>正确率
    • }*/} + {/*{sort==='type'?"":
    • this.onSortTypeChange('type')}>题型
    • }*/} + {/*{sort==='position'?"":
    • this.onSortTypeChange('position')}>题序
    • }*/} + {/*
    */} + 正确率 + + + +
  • diff --git a/public/react/src/modules/login/LoginDialog.css b/public/react/src/modules/login/LoginDialog.css index c791e04b3..9a9373770 100644 --- a/public/react/src/modules/login/LoginDialog.css +++ b/public/react/src/modules/login/LoginDialog.css @@ -111,7 +111,7 @@ } .logincloseIcon{ position: absolute; - top: -100px; + top: -100px !important; right: -27px; z-index: 100000; }