diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index 7c8c07d01..915a4e22c 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -1256,6 +1256,8 @@ class ExercisesController < ApplicationController normal_status(-1,"试卷未发布") elsif (@exercise_users_size == 0) || ( @export_ex_users&.exercise_user_committed.size == 0) normal_status(-1,"暂无用户提交") + elsif params[:export].present? && params[:export] + normal_status(0,"正在下载中") else respond_to do |format| format.xlsx{ @@ -1281,7 +1283,11 @@ class ExercisesController < ApplicationController @exercise_questions = @exercise.exercise_questions.includes(:exercise_choices).order("question_number ASC") filename_ = "#{@exercise.user.real_name}_#{@course.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}.pdf" stylesheets = "#{Rails.root}/app/templates/exercise_export/exercise_export.css" - render pdf: 'exercise_export/blank_exercise', filename: filename_, stylesheets: stylesheets + if params[:export].present? && params[:export] + normal_status(0,"正在下载中") + else + render pdf: 'exercise_export/blank_exercise', filename: filename_, stylesheets: stylesheets + end end #空白试卷预览页面,仅供测试使用,无其他任何用途 diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 5cccb3ee7..dfa6795fb 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -207,9 +207,12 @@ class HomeworkCommonsController < ApplicationController tip_exception(403, "无权限操作") elsif @work_excel.blank? || @work_excel.size == 0 normal_status(-1,"暂无用户提交!") + elsif params[:export].present? && params[:export] + normal_status(0,"正在下载中") else respond_to do |format| format.xlsx{ + cookies[:fileDownload] = true student_work_to_xlsx(@work_excel,@homework) exercise_export_name = "#{current_user.real_name}_#{@course.name}_#{@homework.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}" render xlsx: "#{exercise_export_name.strip}",template: "homework_commons/works_list.xlsx.axlsx",locals: @@ -220,6 +223,8 @@ class HomeworkCommonsController < ApplicationController elsif params[:format] == "zip" if @user_course_identity >= Course::STUDENT tip_exception(403, "无权限操作") + elsif params[:export].present? && params[:export] + normal_status(0,"正在下载中") else if @work_excel.present? zip_works = @work_excel&.where("work_status > 0") @@ -231,6 +236,7 @@ class HomeworkCommonsController < ApplicationController if status == 0 respond_to do |format| format.zip{ + cookies[:fileDownload] = true zipfile = zip_homework_common @homework, zip_works file = decode64(zipfile[0][:base64file]) send_file "#{OUTPUT_FOLDER}/#{file}", filename: filename_for_content_disposition(file), type: 'application/zip' diff --git a/app/controllers/zips_controller.rb b/app/controllers/zips_controller.rb index f4822b96b..bea5784c7 100644 --- a/app/controllers/zips_controller.rb +++ b/app/controllers/zips_controller.rb @@ -8,7 +8,13 @@ class ZipsController < ApplicationController def shixun_report service = BatchExportShixunReportService.new(@homework, @all_student_works) filename_ = filename_for_content_disposition(service.filename) - send_file service.zip, filename: filename_, type: 'application/zip' + if params[:export].present? && params[:export] + normal_status(0,"正在下载中") + else + cookies[:fileDownload] = true + send_file service.zip, filename: filename_, type: 'application/zip' + end + rescue BatchExportShixunReportService::Error => ex normal_status(-1, ex.message) end @@ -18,7 +24,11 @@ class ZipsController < ApplicationController exercises = ExportExercisesService.new(@exercise,@ex_users,@request_url) file_name_ = filename_for_content_disposition(exercises.filename) - send_file exercises.ex_zip, filename: file_name_, type: 'application/zip' + if params[:export].present? && params[:export] + normal_status(0,"正在下载中") + else + send_file exercises.ex_zip, filename: file_name_, type: 'application/zip' + end rescue Exception => e normal_status(-1, e.message) end diff --git a/public/images/educoder/path.png b/public/images/educoder/path.png new file mode 100644 index 000000000..d8b6f1715 Binary files /dev/null and b/public/images/educoder/path.png differ diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index 8b7c727a9..fad3568b4 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -420,7 +420,7 @@ table.text-file{} /*-------------------------------实训路径-------------------------------*/ -.path-head{width: 100%;height: 300px;background-image: url("/images/educoder/path.jpg");background-color: #081C4B;background-size: 100% 100%;} +.path-head{width: 100%;height: 300px;background-image: url("/images/educoder/path.png");background-color: #081C4B;background-size: 100% 100%;} .pathNavLine{position: absolute;bottom: -8px;width: 100%;} .path-nav li{float: left;padding: 0px 30px;height: 42px;} .path-nav li a{color:#fff;font-size: 16px;display: block; height: 40px;} diff --git a/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js b/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js index 4788a7dc1..ac7c8a1a5 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js +++ b/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js @@ -2,7 +2,7 @@ import React, {Component} from 'react'; import {Link} from "react-router-dom"; import axios from 'axios'; import { Input ,Icon,Button,Pagination,DatePicker,Breadcrumb} from 'antd'; -import { handleDateString,markdownToHTML,bytesToSize} from 'educoder'; +import { handleDateString,markdownToHTML,bytesToSize,getImageUrl} from 'educoder'; import NEITaskDetailsModel from './NEITaskDetailsModel'; import moment from 'moment'; import '../packageconcnet.css'; @@ -236,9 +236,9 @@ class PackageIndexNEITaskDetails extends Component { render() { let {overtype,data}=this.state; // console.log(data&&data.creator.login) - // console.log(this.props.current_user.login) + console.log(data) return ( -
+ data===undefined?"":
-
+
{data&&data.status==="pending"?
@@ -281,7 +281,8 @@ class PackageIndexNEITaskDetails extends Component {
+ src={`/images/${data&&data.creator.image_url}`} + width="70"/>
{data&&data.creator.name} @@ -403,7 +404,7 @@ class PackageIndexNEITaskDetails extends Component { return(
{item.status==="bidding_won"?:""} - +

{item.name}

{this.props.current_user&&this.props.current_user.login!=item.login? 头像联系TA @@ -451,7 +452,7 @@ class PackageIndexNEITaskDetails extends Component { return( ) diff --git a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js index c9d49e542..eae5589f2 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js +++ b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js @@ -66,13 +66,7 @@ class PackageIndexNEIBannerConcent extends Component { categories:[] } } - componentDidUpdate = (prevProps) => { - if(prevProps.current_user.username!=this.props.current_user.username){ - this.setState({ - contact_name:this.props.current_user.username - }) - } - } + componentDidMount() { window.document.title = '众包创新' @@ -99,9 +93,7 @@ class PackageIndexNEIBannerConcent extends Component { }) }else{ - this.setState({ - contact_name:this.props.current_user.username - }) + console.log(this.props.current_user&&this.props.current_user.username) } let Url = `/project_package_categories.json`; @@ -119,8 +111,24 @@ class PackageIndexNEIBannerConcent extends Component { console.log(error) }) + this.setState({ + contact_name:this.props.current_user&&this.props.current_user.username + }) + // this.contentMdRef.current.setValue("测试赋值") } + + componentDidUpdate = (prevProps) => { + + if(prevProps.current_user!=this.props.current_user){ + if(this.props.current_user!=undefined){ + this.setState({ + contact_name:this.props.current_user.username + }) + } + } + + } //获取验证码; getverificationcode =()=>{ // if (this.state.logins&&this.state.logins.length === 0) { @@ -707,7 +715,7 @@ class PackageIndexNEIBannerConcent extends Component {

-
+
@@ -856,7 +864,7 @@ class PackageIndexNEIBannerConcent extends Component { placeholder="请输入手机号" disabled={true} /> - + this.editmodels()}>

:""} @@ -897,7 +905,7 @@ class PackageIndexNEIBannerConcent extends Component { {/**/} - + this.modalCancel()}>X

:""} diff --git a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEISubmit.js b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEISubmit.js index a64e222e4..932b9295f 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEISubmit.js +++ b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEISubmit.js @@ -29,8 +29,8 @@ class PackageIndexNEISubmit extends Component {

-
恭喜!
-
提交成功
+
恭喜!
+
提交成功
平台正在审核您的申请,审核结果将以平台消息的形式通知您
this.setageload(this.props.id)}>查看发布需求 diff --git a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNewandEditIndex.js b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNewandEditIndex.js index 1571fd77a..8d73a6e55 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNewandEditIndex.js +++ b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNewandEditIndex.js @@ -27,6 +27,12 @@ class PackageIndexNewandEditIndex extends Component{ id:ids }) } + + goback = () => { + // window.history.go(-1) + window.location.href="/crowdsourcings"; + } + render() { let {setPublication}=this.state; return ( @@ -37,6 +43,7 @@ class PackageIndexNewandEditIndex extends Component{

{this.props.match.params.id!=undefined?"编辑":"新建"} + 返回

diff --git a/public/react/src/modules/projectPackages/packageconcnet.css b/public/react/src/modules/projectPackages/packageconcnet.css index 74119e2b4..7a8c11897 100644 --- a/public/react/src/modules/projectPackages/packageconcnet.css +++ b/public/react/src/modules/projectPackages/packageconcnet.css @@ -167,7 +167,7 @@ color:#999; } .padding251{ - padding: 0px 251px; + padding: 0px 245px; } .ant-modal-title{ diff --git a/public/react/src/modules/tpm/NewHeader.js b/public/react/src/modules/tpm/NewHeader.js index 1798bfca8..b84982d86 100644 --- a/public/react/src/modules/tpm/NewHeader.js +++ b/public/react/src/modules/tpm/NewHeader.js @@ -718,7 +718,7 @@ submittojoinclass=(value)=>{
  • 教学案例
  • 众包创新
  • 交流问答
  • {
  • 我的实训
  • 我的实践课程
  • 我的项目
  • -
  • 我的众包
  • + {/*
  • 我的众包
  • */}
  • 账号管理
  • {/*
  • this.educoderlogin()} >登入测试接口
  • */} {/*
  • this.trialapplications()} >试用申请
  • */} diff --git a/public/react/src/modules/user/usersInfo/Infos.js b/public/react/src/modules/user/usersInfo/Infos.js index 3b58681da..f20cd5be5 100644 --- a/public/react/src/modules/user/usersInfo/Infos.js +++ b/public/react/src/modules/user/usersInfo/Infos.js @@ -17,6 +17,12 @@ import "../../courses/css/Courses.css" import Trialapplication from '../../login/Trialapplication' + +const InfosPackage = Loadable({ + loader: () => import('./InfosPackage'), + loading:Loading, +}) + const InfosCourse = Loadable({ loader: () => import('./InfosCourse'), loading:Loading, @@ -373,11 +379,17 @@ class Infos extends Component{ to={`/users/${username}/paths`}>实践课程
  • - this.setState({moduleName: 'projects'})} to={`/users/${username}/projects`}>项目
  • - + + {/*
  • */} + {/* this.setState({moduleName: 'package'})}*/} + {/*to={`/users/${username}/package`}>众包*/} + {/*
  • */} + {/*{ data && data.identity!="学生" &&
  • 题库
  • }*/}
    @@ -389,6 +401,15 @@ class Infos extends Component{ {/* --------------------------------------------------------------------- */} + + {/* 众包 */} + {/* http://localhost:3007/courses/1309/homework/9300/setting */} + () + } + > + {/* 课堂 */} {/* http://localhost:3007/courses/1309/homework/9300/setting */} () } > + + () diff --git a/public/react/src/modules/user/usersInfo/InfosPackage.js b/public/react/src/modules/user/usersInfo/InfosPackage.js new file mode 100644 index 000000000..f1077cd62 --- /dev/null +++ b/public/react/src/modules/user/usersInfo/InfosPackage.js @@ -0,0 +1,126 @@ +import React, { Component } from 'react'; +import { SnackbarHOC } from 'educoder'; +import {BrowserRouter as Router,Route,Switch} from 'react-router-dom'; +import {Tooltip,Menu,Pagination,Spin} from 'antd'; +import Loadable from 'react-loadable'; +import Loading from '../../../Loading'; +import axios from 'axios'; +import NoneData from '../../courses/coursesPublic/NoneData' +import {getImageUrl} from 'educoder'; +import { TPMIndexHOC } from '../../tpm/TPMIndexHOC'; +import { CNotificationHOC } from '../../courses/common/CNotificationHOC' +import "./usersInfo.css" +import Create from './publicCreatNew' + +class InfosPackage extends Component{ + constructor(props){ + super(props); + this.state={ + category:undefined, + status:undefined, + page:1, + per_page:16, + + totalCount:undefined, + data:undefined, + isSpin:false + } + } + + componentDidMount=()=>{ + this.setState({ + isSpin:true + }) + let{category,status,page}=this.state; + this.getCourses(category,status,page); + } + + getCourses=(category,status,page)=>{ + let url=`/users/${this.props.match.params.username}/courses.json`; + axios.get((url),{params:{ + category, + status, + page, + per_page: this.props.is_current && category && page ==1?17:16 + }}).then((result)=>{ + if(result){ + this.setState({ + totalCount:result.data.count, + data:result.data, + isSpin:false + }) + } + }).catch((error)=>{ + console.log(error); + }) + } + + //切换种类 + changeCategory=(cate)=>{ + this.setState({ + category:cate, + page:1, + isSpin:true + }) + let{status}=this.state; + this.getCourses(cate,status,1); + } + //切换状态 + changeStatus=(status)=>{ + this.setState({ + status:status, + page:1, + isSpin:true + }) + let{category}=this.state; + this.getCourses(category,status,1); + } + //切换页数 + changePage=(page)=>{ + this.setState({ + page, + isSpin:true + }) + let{category,status}=this.state; + this.getCourses(category,status,page); + } + + // 进入课堂 + turnToCourses=(url,flag)=>{ + if(flag){ + this.props.history.push(url); + } + } + + render(){ + let{ + category, + status, + page, + data, + totalCount, + isSpin + } = this.state; + let is_current=this.props.is_current; + + console.log(this.props.current_user&&this.props.current_user.user_identity==="学生") + return( + + ) + } +} +export default InfosPackage; \ No newline at end of file diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 65ff14a59..ec245b196 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -422,7 +422,7 @@ table.text-file{} /*-------------------------------实训路径-------------------------------*/ -.path-head{width: 100%;height: 300px;background-image: url("/images/educoder/path.jpg");background-color: #081C4B;background-size: 100% 100%;} +.path-head{width: 100%;height: 300px;background-image: url("/images/educoder/path.png");background-color: #081C4B;background-size: 100% 100%;} .pathNavLine{position: absolute;bottom: -8px;width: 100%;} .path-nav li{float: left;padding: 0px 30px;height: 42px;} .path-nav li a{color:#fff;font-size: 16px;display: block; height: 40px;}