diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 2993aa841..12e0043d5 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -42,14 +42,14 @@ if (isDev) { // 老师 //debugType="teacher"; // 学生 -debugType="student"; +//debugType="student"; function railsgettimes(proxy) { if(timestamp&&checkSubmitFlg===false){ $.ajax({url:proxy,async:false,success:function(data){ if(data.status===0){ - timestamp=data.data.t; + timestamp=data.message; } }}) checkSubmitFlg=true @@ -59,7 +59,7 @@ debugType="student"; }else if(checkSubmitFlg===false){ $.ajax({url:proxy,async:false,success:function(data){ if(data.status===0){ - timestamp=data.data.t; + timestamp=data.message; } }}) checkSubmitFlg=true @@ -127,7 +127,8 @@ export function initAxiosInterceptors(props) { if (window.location.port === "3007") { // let timestamp=railsgettimes(proxy); // console.log(timestamp) - railsgettimes(`http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp`); + // `https://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp` + railsgettimes( `${proxy}/api/main/first_stamp.json`); let newopens=md5(opens+timestamp) config.url = `${proxy}${url}`; if (config.url.indexOf('?') == -1) { @@ -137,7 +138,9 @@ export function initAxiosInterceptors(props) { } } else { // 加api前缀 - railsgettimes(`http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp`); + // railsgettimes(`http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp`); + + railsgettimes( `/api/main/first_stamp.json`); let newopens=md5(opens+timestamp) config.url = url; if (config.url.indexOf('?') == -1) { diff --git a/public/react/src/common/UrlTool.js b/public/react/src/common/UrlTool.js index d6a39c7ab..f8fe89215 100644 --- a/public/react/src/common/UrlTool.js +++ b/public/react/src/common/UrlTool.js @@ -79,20 +79,26 @@ let newtimestamp; let checkSubmitFlgs = false; function railsgettimess(proxy) { if(checkSubmitFlgs===false){ - $.ajax({url:proxy,async:false,success:function(data){ + $.ajax({url:proxy, + async:false,success:function(data){ if(data.status===0){ - newtimestamp=data.data.t; + newtimestamp=data.message; + checkSubmitFlgs = true; } }}) - checkSubmitFlgs=true + window.setTimeout(function () { checkSubmitFlgs=false; }, 2500); } } + + + export function Railsgettimes() { - railsgettimess(`http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp`); + railsgettimess(`${getUrl()}/api/main/first_stamp.json`); + // railsgettimess(`https://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp`); } export function getUploadActionUrl(path, goTest) { @@ -127,7 +133,7 @@ export function getUploadActionUrlOfAuth(id) { } export function getRandomNumber(type) { - Railsgettimes() + Railsgettimes() let anewopens=md5(newopens+newtimestamp); return type===true?`randomcode=${newtimestamp}&client_key=${anewopens}`:`?randomcode=${newtimestamp}&client_key=${anewopens}` } diff --git a/public/react/src/common/components/attachment/AttachmentList.js b/public/react/src/common/components/attachment/AttachmentList.js index 32c632aa1..1f22b6fcc 100644 --- a/public/react/src/common/components/attachment/AttachmentList.js +++ b/public/react/src/common/components/attachment/AttachmentList.js @@ -1,5 +1,5 @@ import React,{ Component } from "react"; -import { ConditionToolTip } from 'educoder' +import { ConditionToolTip,getRandomNumber } from 'educoder' class AttachmentsList extends Component{ constructor(props){ @@ -15,9 +15,9 @@ class AttachmentsList extends Component{

- + 30 }> - {item.title} + {item.title} {item.filesize}

diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentsChart.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentsChart.js index 420f83ff1..594eb3c5c 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentsChart.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentsChart.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import {Button,Layout,Tabs,Icon, Card, Avatar, Row, Col ,Table,Badge} from 'antd'; -import {markdownToHTML,getImageUrl} from 'educoder'; +import {markdownToHTML,getImageUrl,getRandomNumber} from 'educoder'; import axios from 'axios'; const { Content } = Layout; @@ -69,7 +69,7 @@ class CompetitionContents extends Component{ const operations =
const columns = [ diff --git a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js index 5c55f8894..ab3718b1d 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js @@ -1,10 +1,10 @@ import React, { Component } from 'react'; -import { SnackbarHOC } from 'educoder'; +import { getRandomNumber } from 'educoder'; import {Link} from 'react-router-dom'; import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; import Loadable from 'react-loadable'; import Loading from '../../../Loading'; -import { WordsBtn, MarkdownToHtml, trigger, queryString, downloadFile } from 'educoder'; +import { WordsBtn, MarkdownToHtml, trigger, queryString, getRandomcode } from 'educoder'; import axios from 'axios'; import CoursesListType from '../coursesPublic/CoursesListType'; import AccessoryModal from "../coursesPublic/AccessoryModal"; @@ -125,7 +125,7 @@ class CommonWorkDetailIndex extends Component{ }) } }else { - this.props.slowDownload(url) + this.props.slowDownload(getRandomcode(url)) // this.props.showNotification(`正在下载中`); // this.setState({ donwloading: true }) @@ -206,7 +206,7 @@ class CommonWorkDetailIndex extends Component{ } const isAdmin = this.props.isAdmin() - + let exportParams = {} const isListModule = childModuleName == '作品列表'; // 是列表页 @@ -221,10 +221,10 @@ class CommonWorkDetailIndex extends Component{ // console.log(params); let exportUrl = `/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}` let exportResultUrl = `/homework_commons/${workId}/works_list.xlsx?${queryString.stringify(params)}` - document.title=course_name === undefined ? "" : course_name; + document.title=course_name === undefined ? "" : course_name; return (
- @@ -234,8 +234,8 @@ class CommonWorkDetailIndex extends Component{ modalCancel={this.Downloadcal} modalsType={this.state.DownloadType} /> - +
@@ -266,7 +266,7 @@ class CommonWorkDetailIndex extends Component{ typelist={homework_status} typesylename={"mt12"} /> - + {category && 返回} @@ -293,24 +293,24 @@ class CommonWorkDetailIndex extends Component{ { noTab !== true &&
- this.setState({moduleName: '作品列表'})} className={`${isListModule ? 'active' : '' } `} to={`/courses/${courseId}/${moduleEngName}/${workId}/list`}>作品列表 - this.setState({moduleName: '作业描述'})} className={`${childModuleName == '作业描述' ? 'active' : '' } `} to={`/courses/${courseId}/${moduleEngName}/${workId}/question`}>作业描述 - {view_answer == true && this.setState({moduleName: '参考答案'})} - className={`${childModuleName == '参考答案' ? 'active' : '' } `} + className={`${childModuleName == '参考答案' ? 'active' : '' } `} to={`/courses/${courseId}/${moduleEngName}/${workId}/answer`}>参考答案} this.setState({moduleName: '设置'})} className={`${childModuleName == '设置' ? 'active' : '' } `} style={{paddingLeft:this.props.isAdmin()?'38px':'20px'}} to={`/courses/${courseId}/${moduleEngName}/${workId}/setting`}>{this.props.isAdmin()?"设置":"得分规则"} - + {/* { this.props.tabRightComponents } */} @@ -365,16 +365,16 @@ class CommonWorkDetailIndex extends Component{ {isAdmin && this.props.toEditPage(this.props.match.params, workId)}>编辑作业} { // - work_statuses && work_statuses.indexOf('关联项目') != -1 && + work_statuses && work_statuses.indexOf('关联项目') != -1 && this.openConnectionProject({ homework_id: workId })}>关联项目 this.props.toCreateProject()}>创建项目 } - + { // - work_statuses && work_statuses.indexOf('取消关联') != -1 && + work_statuses && work_statuses.indexOf('取消关联') != -1 && this.cancelConnectionProject( {homework_id: workId} )}>取消关联 } @@ -390,7 +390,7 @@ class CommonWorkDetailIndex extends Component{ {work_statuses && work_statuses.indexOf('修改作品') != -1 && { this.props.toWorkPostPage(this.props.match.params, null, true, work_id)}} >修改作品} - {work_statuses && work_statuses.indexOf('补交附件') != -1 && + {work_statuses && work_statuses.indexOf('补交附件') != -1 && 补交附件 - + } @@ -415,7 +415,7 @@ class CommonWorkDetailIndex extends Component{ {/* 内容区 */} - + {/* --------------------------------------------------------------------- */} {/* 作业设置 */} @@ -474,7 +474,7 @@ class CommonWorkDetailIndex extends Component{
- + ) } } diff --git a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js index 30c418eef..8a8ee0ace 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js @@ -978,10 +978,8 @@ class CommonWorkSetting extends Component{ let exportUrl = `/api/homework_commons/${workId}/works_list.zip` const exportResultUrl = `/api/homework_commons/${workId}/works_list.xlsx` const noAuth = !isAdmin || !startEditFlag; - return( - - + return( 启用匿评 - (作品数量≥2个,可以开启匿评) + {this.state.category&&this.state.category.category_name==="普通作业"?"(作品数量≥2个,可以开启匿评)":"(提交作品的分组数量≥2个,可以开启匿评)"}
{/* 开启时间 */}
diff --git a/public/react/src/modules/courses/busyWork/common/TabRightComponents.js b/public/react/src/modules/courses/busyWork/common/TabRightComponents.js index 41e03d176..ad26e8ca6 100644 --- a/public/react/src/modules/courses/busyWork/common/TabRightComponents.js +++ b/public/react/src/modules/courses/busyWork/common/TabRightComponents.js @@ -1,7 +1,7 @@ import React,{Component} from "react"; import { Form, Select, Input, Button,Checkbox,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip} from "antd"; import {Link} from 'react-router-dom'; -import { WordsBtn, MarkdownToHtml } from 'educoder'; +import { WordsBtn, getRandomcode } from 'educoder'; import axios from 'axios'; import PublishRightnow from '../PublishRightnow' import AccessoryModal from "../../coursesPublic/AccessoryModal"; @@ -44,7 +44,7 @@ class TabRightComponents extends Component{ } /// 确认是否下载 confirmysl(url){ - axios.get(url + '?export=true' ).then((response) => { + axios.get(url + '&export=true' ).then((response) => { if(response.data.status&&response.data.status===-1){ }else if(response.data.status&&response.data.status===-2){ @@ -63,7 +63,7 @@ class TabRightComponents extends Component{ }) } }else { - this.props.slowDownload(url); + this.props.slowDownload(getRandomcode(url)); // this.props.showNotification(`正在下载中`); // window.open("/api"+url, '_blank'); } @@ -108,9 +108,8 @@ class TabRightComponents extends Component{ const isAdmin = this.props.isAdmin() const isSuperAdmin = this.props.isSuperAdmin() - let exportUrl = `/api/homework_commons/${workId}/works_list.zip` - const exportResultUrl = `/api/homework_commons/${workId}/works_list.xlsx` - + let exportUrls = `/api/homework_commons/${workId}/works_list.zip` + const exportResultUrls = `/api/homework_commons/${workId}/works_list.xlsx` return( {isAdmin ? @@ -150,8 +149,8 @@ class TabRightComponents extends Component{ {this.props.isAdmin()?
  • 导出
  • :""} diff --git a/public/react/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentsChart.js b/public/react/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentsChart.js index 420f83ff1..594eb3c5c 100644 --- a/public/react/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentsChart.js +++ b/public/react/src/modules/courses/competitions/Competitioncommon/CompetitionCommonChild/CompetitionContentsChart.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import {Button,Layout,Tabs,Icon, Card, Avatar, Row, Col ,Table,Badge} from 'antd'; -import {markdownToHTML,getImageUrl} from 'educoder'; +import {markdownToHTML,getImageUrl,getRandomNumber} from 'educoder'; import axios from 'axios'; const { Content } = Layout; @@ -69,7 +69,7 @@ class CompetitionContents extends Component{ const operations =
    const columns = [ diff --git a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js index 63bdbd170..ff60b553f 100644 --- a/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js +++ b/public/react/src/modules/courses/exercise/Testpapersettinghomepage.js @@ -1,7 +1,7 @@ import React,{ Component } from "react"; import {Checkbox,Input,Table, Pagination,Menu,Spin} from "antd"; import {Link,NavLink} from 'react-router-dom'; -import { WordsBtn ,ActionBtn,queryString,getRandomcode} from 'educoder'; +import { WordsBtn ,getRandomNumber,queryString,getRandomcode} from 'educoder'; import CoursesListType from '../coursesPublic/CoursesListType'; import '../css/members.css'; import '../css/busyWork.css'; @@ -175,9 +175,9 @@ class Testpapersettinghomepage extends Component{ if(child!=undefined){ params =child._getRequestParams()!==undefined?child._getRequestParams():{}; } - console.log("170"); - console.log(params); - const urll=url+`?${queryString.stringify(params)}`; + + const urll=url+`?${queryString.stringify(params)}`; + axios.get(urll+ '&export=true').then((response) => { if(response===undefined){ return @@ -200,7 +200,7 @@ class Testpapersettinghomepage extends Component{ }) } }else { - this.props.slowDownload(urll) + this.props.slowDownload(getRandomcode(urll)) // this.setState({ donwloading: true }) // downloadFile({ // url: urll, diff --git a/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js b/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js index 8c5561b02..78f56a0f7 100644 --- a/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js +++ b/public/react/src/modules/courses/gradinforms/Bullsubdirectory.js @@ -32,8 +32,8 @@ class Bullsubdirectory extends Component{ } componentDidMount() { - console.log("获取到数据"); - console.log(this.props); + // console.log("获取到数据"); + // console.log(this.props); let{id,myname,mydescription,index,item} =this.props this.props.form.setFieldsValue({ id:id, diff --git a/public/react/src/modules/courses/gradinforms/Eduinforms.js b/public/react/src/modules/courses/gradinforms/Eduinforms.js index 5acfeb4fe..b41c65944 100644 --- a/public/react/src/modules/courses/gradinforms/Eduinforms.js +++ b/public/react/src/modules/courses/gradinforms/Eduinforms.js @@ -30,8 +30,8 @@ class Eduinforms extends Component{ } componentDidMount() { - console.log("Eduinformss"); - console.log("获取到数据"); + // console.log("Eduinformss"); + // console.log("获取到数据"); // console.log(this.props); const query = this.props.location.search; // const type = query.split('?chinaoocTimestamp='); diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js index 3a4890ece..44bcf5777 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskDetail.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import {getRandomNumber,queryString} from 'educoder'; +import {getRandomNumber} from 'educoder'; import {Link} from 'react-router-dom'; import {Tooltip,Menu} from 'antd'; import Loadable from 'react-loadable'; @@ -313,15 +313,18 @@ class GraduationTaskDetail extends Component{ } CodeReview=()=>{ + let newgetRandomNumber=getRandomNumber(true); + console.log(newgetRandomNumber) this.props.showNotification("正在导出中..."); + if(newgetRandomNumber){ const task_Id = this.props.match.params.task_Id; window.open(`/api/graduation_tasks/${task_Id}/sonar? - ${this.state.taskdatas.teacher_comment===undefined||this.state.taskdatas.teacher_comment===null?"":"teacher_comment="+this.state.taskdatas.teacher_comment} - ${this.state.taskdatas.task_status===undefined||this.state.taskdatas.task_status===null?"":"&task_status="+this.state.taskdatas.task_status} - ${this.state.taskdatas.course_group===undefined||this.state.taskdatas.course_group===null?"":"&course_group="+this.state.taskdatas.course_group} - ${this.state.taskdatas.cross_comment===undefined||this.state.taskdatas.cross_comment===null?"":"&cross_comment="+this.state.taskdatas.cross_comment} - ${this.state.taskdatas.search===undefined||this.state.taskdatas.search===null?"":"&search="+this.state.taskdatas.search+"&"}${getRandomNumber(true)}`) - + ${this.state.taskdatas.teacher_comment===undefined||this.state.taskdatas.teacher_comment===null?"":"teacher_comment="+this.state.taskdatas.teacher_comment+"&"} + ${this.state.taskdatas.task_status===undefined||this.state.taskdatas.task_status===null?"":"task_status="+this.state.taskdatas.task_status+"&"} + ${this.state.taskdatas.course_group===undefined||this.state.taskdatas.course_group===null?"":"course_group="+this.state.taskdatas.course_group+"&"} + ${this.state.taskdatas.cross_comment===undefined||this.state.taskdatas.cross_comment===null?"":"cross_comment="+this.state.taskdatas.cross_comment+"&"} + ${this.state.taskdatas.search===undefined||this.state.taskdatas.search===null?"":"search="+this.state.taskdatas.search+"&"}${newgetRandomNumber}`) + } } getsonars=(teacher_comment,task_status,course_group,cross_comment,search)=>{ @@ -519,8 +522,8 @@ class GraduationTaskDetail extends Component{ {this.props.isAdmin()?
  • 导出
  • :""} {questionslist.work_status===undefined||questionslist.work_status===null||questionslist.work_status.length===0?"":questionslist.work_status.map((item,key)=>{ diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js index 5494ba05f..ec6979c19 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksappraiseMainEditor.js @@ -7,7 +7,7 @@ import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor'; import { getUrl, getUploadActionUrl } from 'educoder' const $ = window.$; -/* +/* */ class GraduationTasksappraiseMainEditor extends Component{ @@ -25,17 +25,23 @@ class GraduationTasksappraiseMainEditor extends Component{ } onSubmit = () => { const { score, same_score } = this.state - let category_id= this.props.match.params.category_id; - const url = `/graduation_works/${category_id}/add_score.json` + let category_id= this.props.match.params.category_id; + const url = `/graduation_works/${category_id}/add_score.json` const attachment_ids = this.state.fileList.map(item => { return item.response ? item.response.id : item.id }) const comment = this.mdRef.current.getValue() - if ((!comment || comment.trim() == "") && !score) { + if ((!comment || comment.trim() == "") && !score &&this.props.isAdmin()===true) { this.setState( {errorMessage : '分数和评语不能同时为空' }) // this.props.showNotification('请先输入评阅说明') return; } + if (!score && this.props.isAdmin()===false) { + this.setState( {errorMessage : '分数不能同时为空' }) + // this.props.showNotification('请先输入评阅说明') + return; + } + if (comment.length > 2000) { this.setState( {errorMessage : '不能超过2000个字符' }) // this.props.showNotification('评阅说明文本长度不能超过2000') @@ -63,12 +69,12 @@ class GraduationTasksappraiseMainEditor extends Component{ this.clearInputs() this.props.addSuccess(); } - + }).catch((error)=>{ console.log(error) }) } - + } clearInputs = () => { this.setState({ @@ -79,7 +85,7 @@ class GraduationTasksappraiseMainEditor extends Component{ this.mdRef.current.setValue('') } onCancel = () => { - this.clearInputs() + this.clearInputs() } componentDidMount(){ } @@ -119,7 +125,7 @@ class GraduationTasksappraiseMainEditor extends Component{ const { status } = response.data; if (status == 0) { console.log('--- success') - + this.setState((state) => { const index = state[stateName].indexOf(file); const newFileList = state[stateName].slice(); @@ -235,7 +241,7 @@ class GraduationTasksappraiseMainEditor extends Component{ 提交 - 清空
    diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index f90ca57f1..f87ea475e 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -2,7 +2,7 @@ import React,{Component} from "react"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider, Tag,DatePicker,Radio,Tooltip} from "antd"; import {Link} from 'react-router-dom'; import locale from 'antd/lib/date-picker/locale/zh_CN'; -import { WordsBtn,getUrl ,handleDateString} from 'educoder'; +import { WordsBtn,getRandomcode ,handleDateString} from 'educoder'; import axios from 'axios'; import Modals from '../../../modals/Modals'; import DownloadMessageysl from "../../../modals/DownloadMessageysl"; @@ -870,9 +870,8 @@ class GraduationTaskssettingapp extends Component{ } /// 确认是否下载 - confirmysl(url){ - debugger; - console.log(3); + confirmysl(url,urls){ + axios.get(url + '?export=true' ).then((response) => { if(response === undefined){ return @@ -895,8 +894,10 @@ class GraduationTaskssettingapp extends Component{ }) } }else { - this.props.slowDownload(url) + // this.props.showNotification(`正在下载中`); + this.props.slowDownload(getRandomcode(url)) + // window.open(getRandomcode("/api" + url), '_blank'); // this.props.showNotification(`正在下载中`); // window.open("/api"+url, '_blank'); } diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index c9ef0ec0d..e0ebdf245 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -1,7 +1,7 @@ import React,{Component} from "react"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal,Pagination, Table, Divider, Tag,Tooltip} from "antd"; import {Link} from 'react-router-dom'; -import {getImageUrl, NoneData, sortDirections} from 'educoder'; +import {getImageUrl, NoneData, sortDirections,getRandomcode} from 'educoder'; import axios from 'axios'; import moment from 'moment'; import HomeworkModal from "../../coursesPublic/HomeworkModal"; @@ -759,7 +759,7 @@ class GraduationTaskssettinglist extends Component{ }) } }else { - this.props.slowDownload(url) + this.props.slowDownload(getRandomcode(url)) // this.props.showNotification(`正在下载中`); // window.open("/api"+url, '_blank'); diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js index b15b6fb2f..8d430b93c 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettingquestions.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,markdownToHTML,AttachmentList} from 'educoder'; +import { getRandomcode,markdownToHTML,AttachmentList} from 'educoder'; import axios from 'axios'; import Modals from '../../../modals/Modals'; import DownloadMessageysl from "../../../modals/DownloadMessageysl"; @@ -214,9 +214,8 @@ class GraduationTasksquestions extends Component{ } /// 确认是否下载 - confirmysl(url){ - debugger; - console.log(2); + confirmysl(url,urls){ + axios.get(url + '?export=true').then((response) => { if(response === undefined){ return @@ -239,8 +238,10 @@ class GraduationTasksquestions extends Component{ }) } }else { - this.props.slowDownload(url) - + // this.props.slowDownload(urls) + //this.props.showNotification(`正在下载中`); + this.props.slowDownload(getRandomcode(url)) + // window.open(getRandomcode("/api" + url), '_blank'); // this.props.showNotification(`正在下载中`); // window.open("/api"+url, '_blank'); } diff --git a/public/react/src/modules/courses/graduation/topics/index.js b/public/react/src/modules/courses/graduation/topics/index.js index b77b4c096..fb3d6bab6 100644 --- a/public/react/src/modules/courses/graduation/topics/index.js +++ b/public/react/src/modules/courses/graduation/topics/index.js @@ -4,7 +4,7 @@ import {Checkbox, Menu, Pagination,Spin} from "antd"; import Titlesearchsection from '../../common/titleSearch/TitleSearchSection' import DownloadMessageysl from "../../../modals/DownloadMessageysl"; -import { WordsBtn ,getRandomcode} from 'educoder' +import { WordsBtn ,getRandomcode,getRandomNumber} from 'educoder' import NoneData from '../../coursesPublic/NoneData' import Modals from "../../../modals/Modals" import axios from 'axios' @@ -55,7 +55,7 @@ class Boards extends Component{ let {pageSize}=this.state; const cid = this.props.match.params.coursesId - + let url = `/courses/${cid}/graduation_topics.json?limit=${pageSize}` if(searchValue!=""){ url+="&search="+searchValue @@ -142,8 +142,8 @@ class Boards extends Component{ checkBoxValues: _.difference(this.state.checkBoxValues, values) }) } - } - + } + onItemClick = (item) => { const checkBoxValues = this.state.checkBoxValues.slice(0); const index = checkBoxValues.indexOf(item.id); @@ -198,7 +198,7 @@ class Boards extends Component{ }) } cancelOperateTopic=()=>{ - this.setState({ + this.setState({ modalsType:false, modalsTopval:"", modalsBottomval:"", @@ -257,7 +257,7 @@ onDelete=(index)=>{ console.log(error) }) } - + }else{ this.setState({ // delType:true, @@ -319,7 +319,7 @@ sureDelTopic=()=>{ }).catch((error)=>{ console.log(error); }) - } + } }else{ this.setState({ delType:false, @@ -335,7 +335,7 @@ onBoardsNew=()=>{ } /// 确认是否下载 confirmysl(url){ - axios.get(url + '?export=true').then((response) => { + axios.get(url + '&export=true').then((response) => { if(response.data.status&&response.data.status===-1){ }else if(response.data.status&&response.data.status===-2){ @@ -376,12 +376,12 @@ onBoardsNew=()=>{ this.fetchAll(searchValue,page,status); } render(){ - let { - searchValue, - topicList, + let { + searchValue, + topicList, data, course_public, - checkBoxValues, + checkBoxValues, checkAllValue, page, totalCount, @@ -507,9 +507,9 @@ onBoardsNew=()=>{ :
    } - -
    -
    + +
    +
    ) } diff --git a/public/react/src/modules/courses/groupjobbank/GroupPackage.js b/public/react/src/modules/courses/groupjobbank/GroupPackage.js index e0b220202..1cd0564a2 100644 --- a/public/react/src/modules/courses/groupjobbank/GroupPackage.js +++ b/public/react/src/modules/courses/groupjobbank/GroupPackage.js @@ -1,6 +1,6 @@ import React, {Component} from "react"; -import { WordsBtn,on, off, trigger,markdownToHTML,getImageUrl} from 'educoder'; +import { WordsBtn,on, off, trigger,markdownToHTML,getRandomNumber} from 'educoder'; import { Button, Checkbox, @@ -23,7 +23,8 @@ class GroupPackage extends Component { } } DownloadOpenPdf=(type,url)=>{ - type===true?window.open(url):window.location.href=url; + let newurl=url+getRandomNumber(); + type===true?window.open(newurl):window.location.href=newurl; } componentDidMount() { console.log("Groupjobquesanswer"); diff --git a/public/react/src/modules/courses/members/CourseGroupList.js b/public/react/src/modules/courses/members/CourseGroupList.js index 0db0ae37e..afec12fa9 100644 --- a/public/react/src/modules/courses/members/CourseGroupList.js +++ b/public/react/src/modules/courses/members/CourseGroupList.js @@ -14,7 +14,7 @@ import CourseLayoutcomponent from '../common/CourseLayoutComponent' import Titlesearchsection from '../common/titleSearch/TitleSearchSection' import ColorCountText from '../common/titleSearch/ColorCountText' -import { WordsBtn, trigger, on, off, getUrl, downloadFile , sortDirections, NoneData } from 'educoder' +import { WordsBtn, trigger, on, off, getUrl, downloadFile , getRandomcode, NoneData } from 'educoder' import Modals from "../../modals/Modals"; import DownloadMessageysl from "../../modals/DownloadMessageysl"; @@ -23,7 +23,7 @@ import ChangeRolePop from './ChangeRolePop' import CourseGroupListTable from './CourseGroupListTable' import './studentsList.css' -/** +/** 角色数组, CREATOR: 创建者, PROFESSOR: 教师, ASSISTANT_PROFESSOR: 助教, STUDENT: 学生 */ function CourseGroupList(props) { @@ -36,7 +36,7 @@ function CourseGroupList(props) { const [listRes, setListRes] = useState({}) const createGroupModalEl = useRef(null); - const courseId = props.match.params.coursesId + const courseId = props.match.params.coursesId useEffect(() => { fetchAll() @@ -63,7 +63,7 @@ function CourseGroupList(props) { } const onConfirm = async () => { } - + function createGroupImportSuccess() { } @@ -83,7 +83,7 @@ function CourseGroupList(props) { } const confirmysl = (url) => { - axios.get(url + 'export=true').then((response) => { + axios.get(url + '&export=true').then((response) => { if(response === undefined){ return } @@ -100,13 +100,13 @@ function CourseGroupList(props) { setDownloadMessageval(500) } }else { - props.slowDownload(url) + props.slowDownload(getRandomcode(url)) } }).catch((error) => { console.log(error) }); } - + const isAdmin = props.isAdmin(); const isSuperAdmin = props.isSuperAdmin(); const isParent = true; @@ -121,9 +121,9 @@ function CourseGroupList(props) { const course_groups = listRes.course_groups const current_group_id = listRes.current_group_id - let exportUrl = `/courses/${courseId}/export_member_scores_excel.xlsx?`; //总成绩 - let exportUrltwo = `/courses/${courseId}/export_couser_info.xlsx?`; //课堂信息 - let exportUrlthree = `/courses/${courseId}/export_member_act_score.xlsx?`; //活跃度 + let exportUrl = `/courses/${courseId}/export_member_scores_excel.xlsx`; //总成绩 + let exportUrltwo = `/courses/${courseId}/export_couser_info.xlsx`; //课堂信息 + let exportUrlthree = `/courses/${courseId}/export_member_act_score.xlsx`; //活跃度 return ( = 10} searchPlaceholder={ '请输入分班名称进行搜索' } firstRowRight={ - - { // pageType !== TYPE_STUDENTS && + + { // pageType !== TYPE_STUDENTS && isSuperAdmin && {/* ref="createGroupByImportModal" */} {createGroupModalEl.current.setVisible(true)}}>导入创建分班 } - { - // pageType !== TYPE_STUDENTS && + { + // pageType !== TYPE_STUDENTS && !isCourseEnd && isAdmin && addDir()}>新建分班 } - {/* { + {/* { isAdmin && !isParent && course_group_id != 0 && deleteDir()}>删除分班 } */} - {/* { + {/* { isAdmin && !isParent && course_group_id != 0 && this.renameDir()}>分班重命名 } */}