Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

master
hjm 5 years ago
commit fd3dd6013b

@ -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
#空白试卷预览页面,仅供测试使用,无其他任何用途

@ -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'

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

@ -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;}

@ -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 (
<div>
data===undefined?"":<div>
<div className="clearfix">
<NEITaskDetailsModel
applytype={this.state.applytype}
@ -265,7 +265,7 @@ class PackageIndexNEITaskDetails extends Component {
<div className={"stud-class-set coursenavbox edu-back-white mt20"}>
<div className={"ant-row contentbox mdInForm "}>
<div className="educontent project-packages-list">
<div className="educontent project-packages-list relative">
{data&&data.status==="pending"?<div>
<div className="publicpart orangeBlack "></div>
<span className="smalltrangle"></span>
@ -281,7 +281,8 @@ class PackageIndexNEITaskDetails extends Component {
<div className="fl edu-back-white ">
<a href={`/users/${data&&data.creator.login}`}>
<img alt="头像" className="radius mt10 ml5" height="70" id="nh_user_logo" name="avatar_image"
src={data&&data.creator.image_url} width="70"/>
src={`/images/${data&&data.creator.image_url}`}
width="70"/>
</a>
<div className=" edu-back-white pagemancenter mt10 ">
{data&&data.creator.name}
@ -403,7 +404,7 @@ class PackageIndexNEITaskDetails extends Component {
return(
<div className="ysldivhomediv1s homehove" key={key}>
{item.status==="bidding_won"?<img src={gouxuan} className="yslgouxuanimg"/>:""}
<a href={`/users/${item.login}`}><img className="div1imgs" src={item.image_url}/></a>
<a href={`/users/${item.login}`}><img className="div1imgs" src={getImageUrl("images/"+item.image_url)}/></a>
<div className="textall mt10" title={item.name}> <p className="ptext">{item.name}</p></div>
{this.props.current_user&&this.props.current_user.login!=item.login?<a className="ContacttheTAs fl none" target="_blank" href={`/users/${item.login}/message_detail?user_id=${item.id}`}>
<img alt="头像" className="mr5" src={require('./newstwo.png')}/>联系TA
@ -451,7 +452,7 @@ class PackageIndexNEITaskDetails extends Component {
return(
<div className="ysldivhomediv1s" onClick={()=>this.Clickteacher2(item.id)} key={key}>
{item.bool===true?<img src={gouxuan} className="yslgouxuanimg"/>:<img src={weigouxuan} className="yslgouxuanimg"/>}
<a href={`/users/${item.login}`} target="_blank"><img className="div1imgs" src={item.image_url}/></a>
<a href={`/users/${item.login}`} target="_blank"><img className="div1imgs" src={getImageUrl("images/"+item.image_url)}/></a>
<span className={item.bool===true?"textall mt10 color-blue":"textall mt10"} title={item.name}> <p className="ptext">{item.name}</p></span>
</div>
)

@ -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 {
<p className="clearfix" id={"publishtimestart"}>
<div className={"stud-class-set pd30a0 coursenavbox edu-back-white pb20"}>
<div className={"ant-row contentbox mdInForm "}>
<div className={"ant-row contentbox mdInForm mb20"}>
<div className="ant-form-item-label mb10">
<label htmlFor="coursesNew_description" className="ant-form-item-requireds font-16">请选择需求类型</label>
</div>
@ -856,7 +864,7 @@ class PackageIndexNEIBannerConcent extends Component {
placeholder="请输入手机号"
disabled={true}
/>
<a className="fl ml20">
<a className="fl ml20 mt10">
<i className="iconfont icon-bianjidaibeijing font-20 color-blue" onClick={()=>this.editmodels()}></i>
</a>
</p>:""}
@ -897,7 +905,7 @@ class PackageIndexNEIBannerConcent extends Component {
{/*<Button type="primary" className="defalutSubmitbtn ml10 defalutSubmitbtnmodels">重新发送()</Button>*/}
</span>
</span>
<a className="fl mt8">
<a className="fl mt8 mt15">
<span className="font-18 color-blue" onClick={()=>this.modalCancel()}>X</span>
</a>
</p>:""}

@ -29,8 +29,8 @@ class PackageIndexNEISubmit extends Component {
<p className="clearfix ">
<div className={"stud-class-set padding200 coursenavbox edu-back-white"}>
<div className={"mb20"}><Icon type="check-circle" theme="filled" className={"fontcircle color-green"}/></div>
<div className={"sumbtongs mb5"}>恭喜!</div>
<div className={"sumbtongs mb5"}>提交成功</div>
<div className={"sumbtongs mb10"}>恭喜!</div>
<div className={"sumbtongs mb10"}>提交成功</div>
<div className={"terraces mb5"}>平台正在审核您的申请审核结果将以平台消息的形式通知您</div>
<div className="clearfix mt30 mb30 padding251">
<a className="defalutCancelbtns fl" onClick={()=>this.setageload(this.props.id)}>查看发布需求</ a>

@ -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{
<p className="clearfix mt20 mb20">
<span className="fl font-24 color-grey-3">
{this.props.match.params.id!=undefined?"编辑":"新建"}</span>
<a className="color-grey-6 fr font-15 mr20" onClick={this.goback}>返回</a>
</p>
<PackageIndexNEIBanner {...this.props} />

@ -167,7 +167,7 @@
color:#999;
}
.padding251{
padding: 0px 251px;
padding: 0px 245px;
}
.ant-modal-title{

@ -718,7 +718,7 @@ submittojoinclass=(value)=>{
<li className=""><a href={this.props.Headertop===undefined?"":this.props.Headertop.moop_cases_url}>教学案例</a></li>
<li className=""><a
// href={this.props.Headertop===undefined?"":this.props.Headertop.crowdsourcing_url}
href={'/crowdsourcing'}
href={'/crowdsourcings'}
>众包创新</a></li>
<li className={`${activeForums === true ? 'active' : ''}`}><a href={this.props.Headertop===undefined?"":this.props.Headertop.topic_url}>交流问答</a></li>
<li
@ -816,7 +816,7 @@ submittojoinclass=(value)=>{
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/shixuns`}>我的实训</Link></li>
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/paths`}>我的实践课程</Link></li>
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的项目</Link></li>
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的众包</Link></li>
{/*<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/package`}>我的众包</Link></li>*/}
<li><a href={`/account/profile`}>账号管理</a></li>
{/*<li><a onClick={()=>this.educoderlogin()} >登入测试接口</a></li>*/}
{/*<li><a onClick={()=>this.trialapplications()} >试用申请</a> </li>*/}

@ -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`}>实践课程</Link>
</li>
<li className={`${moduleName == 'projects' ? 'active' : '' }`}>
<Link
<Link
onClick={() => this.setState({moduleName: 'projects'})}
to={`/users/${username}/projects`}>项目</Link>
</li>
{/*<li className={`${moduleName == 'package' ? 'active' : '' }`}>*/}
{/*<Link*/}
{/*onClick={() => this.setState({moduleName: 'package'})}*/}
{/*to={`/users/${username}/package`}>众包</Link>*/}
{/*</li>*/}
{/*{ data && data.identity!="学生" && <li> <a href={`${this.props.Headertop && this.props.Headertop.old_url}/users/${username}?type=m_bank`}>题库</a></li>}*/}
</div>
@ -389,6 +401,15 @@ class Infos extends Component{
{/* --------------------------------------------------------------------- */}
{/* 众包 */}
{/* http://localhost:3007/courses/1309/homework/9300/setting */}
<Route exact path="/users/:username/package"
render={
(props) => (<InfosPackage {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 课堂 */}
{/* http://localhost:3007/courses/1309/homework/9300/setting */}
<Route exact path="/users/:username/courses"
@ -417,6 +438,8 @@ class Infos extends Component{
(props) => (<InfosProject {...this.props} {...props} {...this.state} />)
}
></Route>
<Route exact path="/users/:username"
render={
(props) => (<InfosCourse {...this.props} {...props} {...this.state} />)

@ -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(
<div className="educontent">
<Spin size="large" spinning={isSpin}>
<div className="white-panel edu-back-white pt25 pb25 clearfix ">
<li className={category ? "" : "active"}><a href="javascript:void(0)" onClick={()=>this.changeCategory()}>全部</a></li>
<li className={category=="manage" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("manage")}>{is_current ? "我":"TA"}管理的</a></li>
<li className={category=="study" ? "active" : ""}><a href="javascript:void(0)" onClick={()=>this.changeCategory("study")}>{is_current ? "我":"TA"}参与的</a></li>
</div>
<p className="pl25 pr25 clearfix font-12 mb20 mt20">
<span className="fl color-grey-9">{0}</span>
<span className="fr color-grey-9">发布时间</span>
</p>
</Spin>
</div>
)
}
}
export default InfosPackage;

@ -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;}

Loading…
Cancel
Save