Merge remote-tracking branch 'origin/master'

dev_forum
杨树明 5 years ago
commit 9ac46ae0e3

@ -8,12 +8,13 @@ import { CNotificationHOC } from '../common/CNotificationHOC'
import { RouteHOC } from './common'
import locale from 'antd/lib/date-picker/locale/zh_CN';
import { WordsBtn, MarkdownToHtml, trigger } from 'educoder';
import { WordsBtn, MarkdownToHtml, trigger, queryString } from 'educoder';
import axios from 'axios';
import Modals from '../../modals/Modals';
import CoursesListType from '../coursesPublic/CoursesListType';
import AccessoryModal from "../coursesPublic/AccessoryModal";
import PublishRightnow from './PublishRightnow'
import DownloadMessage from '../../modals/DownloadMessage';
import '../css/Courses.css'
import CBreadcrumb from '../common/CBreadcrumb'
@ -121,9 +122,17 @@ class CommonWorkDetailIndex extends Component{
}
const isAdmin = this.props.isAdmin()
let exportUrl = `/api/homework_commons/${workId}/works_list.zip`
const exportResultUrl = `/api/homework_commons/${workId}/works_list.xlsx`
let exportParams = {}
const isListModule = childModuleName == '作品列表';
// 是列表页
let params = {}
if (isListModule) {
// TODO
// params = this.refs.commonWorkList._getRequestParams()
}
let exportUrl = `/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}`
let exportResultUrl = `/homework_commons/${workId}/works_list.xlsx?${queryString.stringify(params)}`
return (
<div>
<PublishRightnow ref={this.publishModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}
@ -132,6 +141,9 @@ class CommonWorkDetailIndex extends Component{
></PublishRightnow>
<PublishRightnow ref={this.endModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}
isPublish={false} doWhenSuccess={this.doWhenSuccess}></PublishRightnow>
<DownloadMessage ref="DownloadMessage" {...this.props} />
<div className="newMain clearfix worklist1">
<div className={"educontent mt20"}>
<style>{`
@ -189,7 +201,7 @@ class CommonWorkDetailIndex extends Component{
<div className="mt10 clearfix edu-back-white poll_list pl5">
<Link
onClick={() => this.setState({moduleName: '作品列表'})}
className={`${childModuleName == '作品列表' ? 'active' : '' } `}
className={`${isListModule ? 'active' : '' } `}
to={`/courses/${courseId}/${moduleEngName}/${workId}/list`}>作品列表</Link>
<Link
onClick={() => this.setState({moduleName: '作业问答'})}
@ -228,8 +240,12 @@ class CommonWorkDetailIndex extends Component{
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding":"0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a href={exportResultUrl} className="color-dark">导出成绩</a></li>
<li><a href={exportUrl} className="color-dark">导出作品附件</a></li>
<li><a href={"javascript:void(0)"} className="color-dark"
onClick={() => this.refs.DownloadMessage.confirmysl(exportResultUrl, exportParams)}
>导出成绩</a></li>
<li><a href={"javascript:void(0)"} className="color-dark"
onClick={() => this.refs.DownloadMessage.confirmysl(exportUrl, exportParams)}
>导出作品附件</a></li>
</ul>
</li>:""}
@ -293,7 +309,7 @@ class CommonWorkDetailIndex extends Component{
{/* 作品列表 */}
<Route exact path="/courses/:coursesId/common_homeworks/:workId/list"
render={
(props) => (<CommonWorkList {...this.props} {...props} {...this.state} {...commonHandler}/>)
(props) => (<CommonWorkList ref="commonWorkList" {...this.props} {...props} {...this.state} {...commonHandler}/>)
}
></Route>

@ -337,12 +337,16 @@ class MainContentContainer extends Component {
this.oldGameIdentifier = null;
return;
}
// 重试调用的这个 this.props.fetchRepositoryCode(this.props, null, null, true)
setTimeout(() => {
this.fetchRepositoryCode(props, arg_path, type, 1)
}, 1500);
}
}
}else{
} else if (fetchRepositoryCodeResponse.data.status === -4) {
// 异常 直接重试
this.fetchRepositoryCode(props, null, null, true)
} else{
this.setState({ isEditablePath, currentPath: path });
this.oldRepositoryCode = fetchRepositoryCodeResponse.data.content || '';
this.updateRepositoryCode(this.oldRepositoryCode, updateCodeMirror)

@ -154,11 +154,13 @@ function checkIfLoaded (callback) {
const mirror2LanguageMap = {
'JFinal': 'java',
'Java': 'java',
'JavaWeb': 'java',
'Kotlin': 'java',
'Html': 'html',
'Css': 'css',
'Javascript': 'javascript',
'JavaScript': 'javascript',
'C/C++': 'cpp',
'MachineLearning': 'python',
@ -173,6 +175,7 @@ function getLanguageByMirrorName(mirror_name) {
let lang = 'javascript'
if (mirror_name && mirror_name.length) {
// 需要倒着遍历, html、css的实训主评测语言环境是python小类别是html或css
// TODO http://localhost:3007/tasks/hmcwa3g8typ5?debug=t ["Python3.6", "VNC", "Html"]
for (let i = mirror_name.length - 1; i >= 0; i--) {
let languageVal = mirror2LanguageMap[mirror_name[i]];
if (languageVal) {

@ -1,4 +1,4 @@
import * as monaco from 'monaco-editor'
// import * as monaco from 'monaco-editor'
import _ from 'lodash'
const ifelse = {
label: 'ifelse',

@ -6,7 +6,7 @@
}
#game_test_set_results .-task-ces-top {
background: #1F2F3B;
padding: 5px 20px;
padding: 9px 20px;
}

@ -1,6 +1,6 @@
import React, {Component} from 'react';
import {Input, InputNumber, Select, Radio, Checkbox, Popconfirm, message, Modal} from 'antd';
import {Input, InputNumber, Select, Radio, Checkbox, Popconfirm, message, Modal, Tooltip} from 'antd';
import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom";
@ -320,9 +320,11 @@ export default class TPManswer extends Component {
return <div className="levelSection" id={`levelSection${index}`} style={{ clear: 'both' }}>
<span className="mr4 color-orange pt10">*</span>
<p className="color-grey-6 font-16 mb30 mt10" style={{ display: "inline" }}>级别{index + 1}</p>
<Tooltip title="删除">
<a className="fr sample_icon_remove mr30 mt8" onClick={()=>this.delanswers(index)}>
<i className="fa fa-times-circle color-grey-c font-16 fl" ></i>
</a>
</Tooltip>
<div className=" color-grey-6 font-16" style={{ marginLeft: "9px", margin: '8px 9px'}}>
<div className=" ">
<span>名称</span>

@ -101,7 +101,11 @@ class AccountBasic extends Component {
this.props.form.validateFieldsAndScroll((err, values) => {
console.log(values);
let {basicInfo}=this.props;
if(!err){
// TODO 为什么modal里的form影响到这里的了
if (err) {
delete err.depart
}
if(!err || Object.keys(err).length == 0){
let url=`/users/accounts/${basicInfo.id}.json`
axios.put((url),{
nickname:values.nickname,
@ -117,7 +121,9 @@ class AccountBasic extends Component {
department_id:this.state.department_id
}).then((result)=>{
if(result){
this.props.showNotification('保存成功')
this.props.getBasicInfo();
this.props.history.push('/account/profile')
}
}).catch((error)=>{
console.log(error);

Loading…
Cancel
Save