杨树明 6 years ago
commit 8ebf969251

@ -42,8 +42,6 @@
"immutability-helper": "^2.6.6", "immutability-helper": "^2.6.6",
"install": "^0.12.2", "install": "^0.12.2",
"jest": "20.0.4", "jest": "20.0.4",
"js-base64": "^2.5.1",
"js-file-download": "^0.4.7",
"lodash": "^4.17.5", "lodash": "^4.17.5",
"loglevel": "^1.6.1", "loglevel": "^1.6.1",
"material-ui": "^1.0.0-beta.40", "material-ui": "^1.0.0-beta.40",
@ -165,7 +163,6 @@
"babel-plugin-import": "^1.11.0", "babel-plugin-import": "^1.11.0",
"concat": "^1.0.3", "concat": "^1.0.3",
"happypack": "^5.0.1", "happypack": "^5.0.1",
"videojs-for-react": "^0.0.3",
"webpack-bundle-analyzer": "^3.0.3", "webpack-bundle-analyzer": "^3.0.3",
"webpack-parallel-uglify-plugin": "^1.1.0" "webpack-parallel-uglify-plugin": "^1.1.0"
} }

@ -0,0 +1,103 @@
function Base64() {
// private property
_keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
// public method for encoding
this.encode = function (input) {
var output = "";
var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
var i = 0;
input = _utf8_encode(input);
while (i < input.length) {
chr1 = input.charCodeAt(i++);
chr2 = input.charCodeAt(i++);
chr3 = input.charCodeAt(i++);
enc1 = chr1 >> 2;
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
enc4 = chr3 & 63;
if (isNaN(chr2)) {
enc3 = enc4 = 64;
} else if (isNaN(chr3)) {
enc4 = 64;
}
output = output +
_keyStr.charAt(enc1) + _keyStr.charAt(enc2) +
_keyStr.charAt(enc3) + _keyStr.charAt(enc4);
}
return output;
}
// public method for decoding
this.decode = function (input) {
var output = "";
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0;
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
while (i < input.length) {
enc1 = _keyStr.indexOf(input.charAt(i++));
enc2 = _keyStr.indexOf(input.charAt(i++));
enc3 = _keyStr.indexOf(input.charAt(i++));
enc4 = _keyStr.indexOf(input.charAt(i++));
chr1 = (enc1 << 2) | (enc2 >> 4);
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
chr3 = ((enc3 & 3) << 6) | enc4;
output = output + String.fromCharCode(chr1);
if (enc3 != 64) {
output = output + String.fromCharCode(chr2);
}
if (enc4 != 64) {
output = output + String.fromCharCode(chr3);
}
}
output = _utf8_decode(output);
return output;
}
// private method for UTF-8 encoding
_utf8_encode = function (string) {
string = string.replace(/\r\n/g,"\n");
var utftext = "";
for (var n = 0; n < string.length; n++) {
var c = string.charCodeAt(n);
if (c < 128) {
utftext += String.fromCharCode(c);
} else if((c > 127) && (c < 2048)) {
utftext += String.fromCharCode((c >> 6) | 192);
utftext += String.fromCharCode((c & 63) | 128);
} else {
utftext += String.fromCharCode((c >> 12) | 224);
utftext += String.fromCharCode(((c >> 6) & 63) | 128);
utftext += String.fromCharCode((c & 63) | 128);
}
}
return utftext;
}
// private method for UTF-8 decoding
_utf8_decode = function (utftext) {
var string = "";
var i = 0;
var c = c1 = c2 = 0;
while ( i < utftext.length ) {
c = utftext.charCodeAt(i);
if (c < 128) {
string += String.fromCharCode(c);
i++;
} else if((c > 191) && (c < 224)) {
c2 = utftext.charCodeAt(i+1);
string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
i += 2;
} else {
c2 = utftext.charCodeAt(i+1);
c3 = utftext.charCodeAt(i+2);
string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
i += 3;
}
}
return string;
}
}

@ -211,20 +211,35 @@ $(function(){
var FF = !(window.mozInnerScreenX == null); var FF = !(window.mozInnerScreenX == null);
var websshLineHeight = FF ? 19 : 18 var websshLineHeight = FF ? 19 : 18
function throttle(method, delay, duration){
var timer = null, begin = new Date();
return function(){
var context = this, args = arguments, current = new Date();
clearTimeout(timer);
if(current-begin >= duration){
method.apply(context, args);
begin = current;
} else {
timer = setTimeout(function(){
method.apply(context, args);
}, delay);
}
}
}
doc.live('mousemove touchmove',function(e){ doc.live('mousemove touchmove',function(e){
$(".-brother").show();// 代码行的遮罩显示 $(".-brother").show();// 代码行的遮罩显示
if(dragging) { if(dragging) {
clickX = e.pageX || e.originalEvent.touches[0].pageX;; clickX = e.pageX || e.originalEvent.touches[0].pageX;;
if(clickX > leftOffset+0&&clickX<leftOffset+1600) { if(clickX > leftOffset+0&&clickX<leftOffset+1600) {
console.log('resize')
//console.log(1); //console.log(1);
lab.css('left', clickX - 7 - leftOffset + 'px'); lab.css('left', clickX - 7 - leftOffset + 'px');
$("#game_left_contents").width( clickX-leftOffset + 'px'); $("#game_left_contents").width( clickX-leftOffset + 'px');
nextW2 = clickX-leftOffset; nextW2 = clickX-leftOffset;
$("#game_right_contents").width( wrapWidth - nextW2 + 'px'); $("#game_right_contents").width( wrapWidth - nextW2 + 'px');
//console.log(lab.next().width()); //console.log(lab.next().width());
refresh_editor_monaco() throttle(refresh_editor_monaco, 100, 200)()
} else { } else {
lab.css('left', '0px'); lab.css('left', '0px');
} }
@ -246,7 +261,8 @@ $(function(){
var w = $("#games_repository_contents").width(); var w = $("#games_repository_contents").width();
$(".game_webssh").css("min-height", m); $(".game_webssh").css("min-height", m);
$(".game_webssh").css("max-height", m); $(".game_webssh").css("max-height", m);
refresh_editor_monaco(m) throttle(refresh_editor_monaco, 100, 200)(m)
// refresh_editor_monaco(m)
// 火狐下行高为19 // 火狐下行高为19
// CodeRepositoryView.js有同样的计算逻辑用来初始化ssh // CodeRepositoryView.js有同样的计算逻辑用来初始化ssh
var rows = Math.round(m / websshLineHeight); var rows = Math.round(m / websshLineHeight);
@ -1187,6 +1203,8 @@ $(function(){ // 这里重新加一次事件监听,不在原有事件的基
dragging = true; dragging = true;
dragDom = lab; dragDom = lab;
$('#htmlIframe').css('pointer-events', 'none') $('#htmlIframe').css('pointer-events', 'none')
$('#can-drag').show()
lab.hide()
return false; return false;
} }
); );
@ -1206,8 +1224,11 @@ $(function(){ // 这里重新加一次事件监听,不在原有事件的基
}) })
doc.live("mouseup", function(e) { doc.live("mouseup", function(e) {
lab.show()
// 在大窗口将下边测试集滚动条拖上去后,将窗口缩小,再拖下来就有这种情况 https://www.trustie.net/issues/16326 // 在大窗口将下边测试集滚动条拖上去后,将窗口缩小,再拖下来就有这种情况 https://www.trustie.net/issues/16326
if (dragging === true) { if (dragging === true) {
$('#can-drag').hide()
window.editor_CodeMirror && window.editor_CodeMirror.refresh() window.editor_CodeMirror && window.editor_CodeMirror.refresh()
// 使得iframe可以继续捕获事件 // 使得iframe可以继续捕获事件

@ -1,83 +1,83 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import TPMMDEditor from '../../../modules/tpm/challengesnew/TPMMDEditor' import TPMMDEditor from '../../../modules/tpm/challengesnew/TPMMDEditor'
import {markdownToHTML} from 'educoder' import {markdownToHTML} from 'educoder'
import './DMDEditor.css' import './DMDEditor.css'
// 需要父组件通过toShowMode、toMDMode 来控制一次只能打开一个DMDEditor // 需要父组件通过toShowMode、toMDMode 来控制一次只能打开一个DMDEditor
class DMDEditor extends Component{ class DMDEditor extends Component{
constructor(props){ constructor(props){
super(props); super(props);
this.mdRef = React.createRef() this.mdRef = React.createRef()
this.state={ this.state={
mdMode: false, mdMode: false,
// value: this.props.initValue // value: this.props.initValue
} }
} }
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps, prevState) {
} }
componentDidMount() { componentDidMount() {
// if(this.props.initValue != this.mdRef.current.getValue()) { // if(this.props.initValue != this.mdRef.current.getValue()) {
// this.mdRef.current.setValue(this.props.initValue) // this.mdRef.current.setValue(this.props.initValue)
// } // }
} }
toMDMode = () => { toMDMode = () => {
this.setState({mdMode: true}, () => { this.setState({mdMode: true}, () => {
this.mdRef.current.resize() this.mdRef.current.resize()
this.mdRef.current.setValue(this.props.initValue) this.mdRef.current.setValue(this.props.initValue)
}) })
this.props.toMDMode(this) this.props.toMDMode(this)
} }
toShowMode = () => { toShowMode = () => {
this.setState({mdMode: false}) this.setState({mdMode: false})
this.props.toShowMode && this.props.toShowMode(this) this.props.toShowMode && this.props.toShowMode(this)
} }
onCMBlur = () => { onCMBlur = () => {
this.toShowMode() this.toShowMode()
} }
onChange = (val) => { onChange = (val) => {
// this.setState({ value: val }) // this.setState({ value: val })
this.props.onChange(val) this.props.onChange(val)
if (this.state.showError == true) { if (this.state.showError == true) {
this.setState({showError: false}) this.setState({showError: false})
} }
} }
showError = () => { showError = () => {
this.mdRef.current.showError() this.mdRef.current.showError()
this.setState({showError: true}) this.setState({showError: true})
} }
render(){ render(){
const { mdMode, showError } = this.state; const { mdMode, showError } = this.state;
const { initValue } = this.props; const { initValue } = this.props;
let _style = {} let _style = {}
if (showError) { if (showError) {
_style.border = '1px solid red' _style.border = '1px solid red'
} }
_style = Object.assign(_style, {display: mdMode == true ? 'none' : '', color: initValue? '': '#999', alignItems: 'center', wordBreak: 'break-all'}) _style = Object.assign(_style, {display: mdMode == true ? 'none' : '', color: initValue? '': '#999', alignItems: 'center', wordBreak: 'break-all'})
return( return(
<React.Fragment> <React.Fragment>
<style>{` <style>{`
`}</style> `}</style>
<div id="content_editorMd_show" className="new_li content_editorMd_show" <div id="content_editorMd_show" className="new_li content_editorMd_show markdown-body"
style={_style} style={_style}
dangerouslySetInnerHTML={{__html: initValue ? markdownToHTML(initValue):this.props.placeholder}} dangerouslySetInnerHTML={{__html: initValue ? markdownToHTML(initValue):this.props.placeholder}}
onClick={this.toMDMode} onClick={this.toMDMode}
> >
</div> </div>
{/* {/*
onCMBlur={this.onCMBlur} */} onCMBlur={this.onCMBlur} */}
<TPMMDEditor <TPMMDEditor
ref={this.mdRef} ref={this.mdRef}
{...this.props} {...this.props}
initValue={initValue} initValue={initValue}
className={`${this.props.className} ${mdMode == true ? '' : 'hideMd'}`} className={`${this.props.className} ${mdMode == true ? '' : 'hideMd'}`}
onChange={this.onChange} onChange={this.onChange}
></TPMMDEditor> ></TPMMDEditor>
</React.Fragment> </React.Fragment>
) )
} }
} }
export default DMDEditor; export default DMDEditor;

@ -6,7 +6,6 @@ import {getImageUrl} from 'educoder';
import axios from 'axios' import axios from 'axios'
import {getUrl} from 'educoder'; import {getUrl} from 'educoder';
import moment from 'moment' import moment from 'moment'
import { Base64 } from 'js-base64';
import CoursesListType from '../coursesPublic/CoursesListType'; import CoursesListType from '../coursesPublic/CoursesListType';
import Showoldfiles from "../coursesPublic/Showoldfiles"; import Showoldfiles from "../coursesPublic/Showoldfiles";
import Modals from '../../modals/Modals'; import Modals from '../../modals/Modals';

@ -186,7 +186,7 @@ class Exercisestatisticalresult extends Component {
<span className="CACFF">{item.ques_position+"."}{item.ques_type===0?"单选":item.ques_type===1?"多选":item.ques_type===2?"判断":item.ques_type===3?"填空":item.ques_type===4?"主观":item.ques_type===5?"实训":""}</span> <span className="CACFF">{item.ques_position+"."}{item.ques_type===0?"单选":item.ques_type===1?"多选":item.ques_type===2?"判断":item.ques_type===3?"填空":item.ques_type===4?"主观":item.ques_type===5?"实训":""}</span>
<div> <div>
{/*Q{item.ques_position}*/} {/*Q{item.ques_position}*/}
<div dangerouslySetInnerHTML={{__html: markdownToHTML(item.ques_title).replace(/▁/g,"▁▁▁")}}></div> <div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(item.ques_title).replace(/▁/g,"▁▁▁")}}></div>
{/*<span className="markdown-body" dangerouslySetInnerHTML={createMarkup(item.ques_title)}></span>*/} {/*<span className="markdown-body" dangerouslySetInnerHTML={createMarkup(item.ques_title)}></span>*/}
</div> </div>

@ -293,7 +293,20 @@ class GraduationTasksSubmitedit extends Component{
funtaskstatus=(checkedValues)=>{ funtaskstatus=(checkedValues)=>{
let{memberslist,selectobjct}=this.state;
let{memberslist,selectobjct,workslist}=this.state;
if(selectobjct.length>workslist.max_num){
this.setState({
minvalue:workslist.max_num,
setvalue:"大于",
minmaxtype:true
})
return
}else{
this.setState({
minmaxtype:false
})
}
let newlist =memberslist; let newlist =memberslist;
let newcheckedValues=checkedValues; let newcheckedValues=checkedValues;
let selects=[]; let selects=[];
@ -309,6 +322,7 @@ class GraduationTasksSubmitedit extends Component{
} }
} }
this.setState({ this.setState({
task_status:checkedValues, task_status:checkedValues,
selectmemberslist:selects selectmemberslist:selects
@ -347,12 +361,7 @@ class GraduationTasksSubmitedit extends Component{
handleSubmit=(e) => { handleSubmit=(e) => {
let {fileList,selectmemberslist,workslist}=this.state; let {fileList,selectmemberslist,workslist}=this.state;
if(fileList.length===0){
this.setState({
shixunsreplace:true,
})
return
}
this.Commoninterface(fileList,selectmemberslist,workslist); this.Commoninterface(fileList,selectmemberslist,workslist);
// setTimeout(function () { // setTimeout(function () {
@ -361,6 +370,7 @@ class GraduationTasksSubmitedit extends Component{
} }
Commoninterface =(fileList,selectmemberslist,workslist)=>{ Commoninterface =(fileList,selectmemberslist,workslist)=>{
let userids=[]; let userids=[];
for(var list of selectmemberslist){ for(var list of selectmemberslist){
@ -386,17 +396,16 @@ class GraduationTasksSubmitedit extends Component{
return return
} }
if(workslist.task_type===2){ if(workslist.task_type===2){
if(userids.length<2){ if(userids.length<workslist.min_num){
this.setState({ this.setState({
minvalue:2, minvalue:workslist.min_num,
setvalue:"小于", setvalue:"小于",
minmaxtype:true minmaxtype:true
}) })
return return
}else if(userids.length>5){ }else if(userids.length>workslist.max_num){
this.setState({ this.setState({
minvalue:5, minvalue:workslist.max_num,
setvalue:"大于", setvalue:"大于",
minmaxtype:true minmaxtype:true
}) })
@ -409,6 +418,13 @@ class GraduationTasksSubmitedit extends Component{
}) })
let workId=this.props.match.params.work_Id; let workId=this.props.match.params.work_Id;
if(fileList.length===0){
this.setState({
shixunsreplace:true,
})
return
}
let url="/graduation_works/"+workId+".json"; let url="/graduation_works/"+workId+".json";
axios.put(url, { axios.put(url, {
description:values.description, description:values.description,
@ -474,7 +490,7 @@ class GraduationTasksSubmitedit extends Component{
multiple: true, multiple: true,
// https://github.com/ant-design/ant-design/issues/15505 // https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
showUploadList: false, // showUploadList: false,
action: `${getUrl()}/api/attachments.json`, action: `${getUrl()}/api/attachments.json`,
onChange: this.handleChange, onChange: this.handleChange,
onRemove: this.onAttachmentRemove, onRemove: this.onAttachmentRemove,
@ -628,37 +644,37 @@ class GraduationTasksSubmitedit extends Component{
) )
})} })}
<style> {/*<style>*/}
{ {/*{*/}
` {/*`*/}
.maxwidth500{ {/*.maxwidth500{*/}
max-width:500px; {/*max-width:500px;*/}
overflow: hidden; {/*overflow: hidden;*/}
text-overflow: ellipsis; {/*text-overflow: ellipsis;*/}
white-space: nowrap; {/*white-space: nowrap;*/}
color: #05101a; {/*color: #05101a;*/}
} {/*}*/}
` {/*`*/}
} {/*}*/}
</style> {/*</style>*/}
{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{ {/*{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{*/}
return( {/*return(*/}
<p className="color-grey mt10" key={key} > {/*<p className="color-grey mt10" key={key} >*/}
<a className="color-grey fl"> {/*<a className="color-grey fl">*/}
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i> {/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/}
</a> {/*</a>*/}
<span className="mr12 color9B9B maxwidth500 fl" length="58"> {/*<span className="mr12 color9B9B maxwidth500 fl" length="58">*/}
{item.name} {/*{item.name}*/}
</span> {/*</span>*/}
<span className="color656565 mt2 color-grey-6 font-12 mr8"> {/*<span className="color656565 mt2 color-grey-6 font-12 mr8">*/}
{item.response===undefined?"":bytesToSize(item.size)} {/*{item.response===undefined?"":bytesToSize(item.size)}*/}
</span> {/*</span>*/}
<i className="font-14 iconfont icon-guanbi " {/*<i className="font-14 iconfont icon-guanbi "*/}
id={item.response===undefined?"":item.response.id} {/*id={item.response===undefined?"":item.response.id}*/}
aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i> {/*aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>*/}
</p> {/*</p>*/}
) {/*)*/}
})} {/*})}*/}
@ -675,7 +691,7 @@ class GraduationTasksSubmitedit extends Component{
> >
<div> <div>
<div className={"fl ml20"}>成员要求25</div> <div className={"fl ml20"}>成员要求{workslist&&workslist.min_num}{workslist&&workslist.max_num}</div>
<Search <Search
className={"fl mt5 ml20"} className={"fl mt5 ml20"}
style={{width:"270px"}} style={{width:"270px"}}
@ -724,7 +740,7 @@ class GraduationTasksSubmitedit extends Component{
</div>:memberslist&&memberslist.map((item,key)=>{ </div>:memberslist&&memberslist.map((item,key)=>{
return( return(
<div key={key} style={{ <div key={key} style={{
width: '375px', width: '400px',
height: '30px' height: '30px'
}}> }}>
<Checkbox value={item.user_id} <Checkbox value={item.user_id}
@ -735,8 +751,8 @@ class GraduationTasksSubmitedit extends Component{
} }
disabled={item.commit_status===true?true:false} className="fl "></Checkbox> disabled={item.commit_status===true?true:false} className="fl "></Checkbox>
<div className={"fl ml5 fonthidden width100"} style={{width: '70px'}} title={item.user_name}>{item.user_name}</div> <div className={"fl ml5 fonthidden width100"} style={{width: '70px'}} title={item.user_name}>{item.user_name}</div>
<div className={"fl ml5 fonthidden width100 color-grey-9"} style={{width: '70px'}}>{item.group_name}</div> <div className={"fl ml5 fonthidden width100 color-grey-9"}>{item.group_name}</div>
<div className={"fl ml5 color-grey-9 fonthidden width100"} style={{width: '70px'}}>{item.student_id}</div> <div className={"fl ml5 color-grey-9 fonthidden width100"}>{item.student_id}</div>
<div className={"fl ml20"}>{item.commit_status===false?<span className={"color-orange"}>已提交</span> :""}</div> <div className={"fl ml20"}>{item.commit_status===false?<span className={"color-orange"}>已提交</span> :""}</div>
</div> </div>
) )
@ -760,7 +776,7 @@ class GraduationTasksSubmitedit extends Component{
height: '30px', height: '30px',
display: item.user_name === undefined ? "none" : "" display: item.user_name === undefined ? "none" : ""
}}> }}>
<div className={"fl ml5 fonthidden width100"} style={{width: '50px'}} <div className={"fl ml5 fonthidden width100"}
title={item.user_name}>{item.user_name}</div> title={item.user_name}>{item.user_name}</div>
<div className={"fl ml5 fonthidden width100 color-grey-9"}>{item.group_name}</div> <div className={"fl ml5 fonthidden width100 color-grey-9"}>{item.group_name}</div>
<div className={"fl ml5 color-grey-9 fonthidden width100"}>{item.student_id}</div> <div className={"fl ml5 color-grey-9 fonthidden width100"}>{item.student_id}</div>
@ -769,6 +785,7 @@ class GraduationTasksSubmitedit extends Component{
style={{marginTop: '-4px'}} style={{marginTop: '-4px'}}
onClick={() => this.delecttask_status(item.user_id)}></i> onClick={() => this.delecttask_status(item.user_id)}></i>
</div> : ""} </div> : ""}
<div className={"both"}></div>
</div> </div>
) )
} }

@ -85,15 +85,9 @@ class GraduationTasksSubmitnew extends Component{
} }
handleSubmit=(e) => { handleSubmit=(e) => {
console.log("86");
let {fileList,selectmemberslist,workslist}=this.state; let {fileList,selectmemberslist,workslist}=this.state;
if(fileList.length === 0){
this.setState({
shixunsreplace:true,
})
return
}
this.Commoninterface(fileList,selectmemberslist,workslist); this.Commoninterface(fileList,selectmemberslist,workslist);
} }
@ -280,7 +274,19 @@ class GraduationTasksSubmitnew extends Component{
funtaskstatus=(checkedValues)=>{ funtaskstatus=(checkedValues)=>{
let{memberslist,selectobjct}=this.state; let{memberslist,selectobjct,workslist}=this.state;
if(selectobjct.length>workslist.max_num){
this.setState({
minvalue:workslist.max_num,
setvalue:"大于",
minmaxtype:true
})
return
}else{
this.setState({
minmaxtype:false
})
}
let newlist =memberslist; let newlist =memberslist;
let newcheckedValues=checkedValues; let newcheckedValues=checkedValues;
let selects=[]; let selects=[];
@ -382,17 +388,17 @@ class GraduationTasksSubmitnew extends Component{
} }
if(workslist&&workslist.task_type===2){ if(workslist&&workslist.task_type===2){
if(userids!=undefined){ if(userids!=undefined){
if(userids.length<2){ if(userids.length<workslist.min_num){
this.setState({ this.setState({
minvalue:2, minvalue:workslist.min_num,
setvalue:"小于", setvalue:"小于",
minmaxtype:true minmaxtype:true
}) })
return return
}else if(userids.length>5){ }else if(userids.length>workslist.max_num){
this.setState({ this.setState({
minvalue:5, minvalue:workslist.max_num,
setvalue:"大于", setvalue:"大于",
minmaxtype:true minmaxtype:true
}) })
@ -405,8 +411,16 @@ class GraduationTasksSubmitnew extends Component{
spinnings:true spinnings:true
}) })
let id=this.props.match.params.task_Id; let id=this.props.match.params.task_Id;
if(fileList.length === 0){
this.setState({
shixunsreplace:true,
})
return
}
debugger
let url="/graduation_tasks/"+id+"/graduation_works.json"; let url="/graduation_tasks/"+id+"/graduation_works.json";
axios.post(url, { axios.post(url, {
description:values.description, description:values.description,
@ -471,7 +485,7 @@ render(){
multiple: true, multiple: true,
// https://github.com/ant-design/ant-design/issues/15505 // https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
showUploadList: false, // showUploadList: false,
action: `${getUrl()}/api/attachments.json`, action: `${getUrl()}/api/attachments.json`,
onChange: this.handleChange, onChange: this.handleChange,
onRemove: this.onAttachmentRemove, onRemove: this.onAttachmentRemove,
@ -593,37 +607,37 @@ render(){
</Button> </Button>
<span className={"color-grey-9"}>(单个文件150M以内)</span> <span className={"color-grey-9"}>(单个文件150M以内)</span>
</Upload> </Upload>
<style> {/*<style>*/}
{ {/*{*/}
` {/*`*/}
.maxwidth500{ {/*.maxwidth500{*/}
max-width:500px; {/*max-width:500px;*/}
overflow: hidden; {/*overflow: hidden;*/}
text-overflow: ellipsis; {/*text-overflow: ellipsis;*/}
white-space: nowrap; {/*white-space: nowrap;*/}
color: #05101a; {/*color: #05101a;*/}
} {/*}*/}
` {/*`*/}
} {/*}*/}
</style> {/*</style>*/}
{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{ {/*{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{*/}
return( {/*return(*/}
<p className="color-grey mt10" key={key} > {/*<p className="color-grey mt10" key={key} >*/}
<a className="color-grey fl"> {/*<a className="color-grey fl">*/}
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i> {/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/}
</a> {/*</a>*/}
<span className="mr12 color9B9B maxwidth500 fl" length="58"> {/*<span className="mr12 color9B9B maxwidth500 fl" length="58">*/}
{item.name} {/*{item.name}*/}
</span> {/*</span>*/}
<span className="color656565 mt2 color-grey-6 font-12 mr8"> {/*<span className="color656565 mt2 color-grey-6 font-12 mr8">*/}
{item.response===undefined?"":bytesToSize(item.size)} {/*{item.response===undefined?"":bytesToSize(item.size)}*/}
</span> {/*</span>*/}
<i className="font-14 iconfont icon-guanbi " {/*<i className="font-14 iconfont icon-guanbi "*/}
id={item.response===undefined?"":item.response.id} {/*id={item.response===undefined?"":item.response.id}*/}
aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i> {/*aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>*/}
</p> {/*</p>*/}
) {/*)*/}
})} {/*})}*/}
</div> </div>
@ -638,7 +652,7 @@ render(){
> >
<div> <div>
<div className={"fl ml20"}>成员要求25</div> <div className={"fl ml20"}>成员要求{workslist&&workslist.min_num}{workslist&&workslist.max_num}</div>
<input type="text" style={{width:"0px",height:"0px",display:"none"}} onKeyUp={(e) => this.onSearchKeywordKeyUp(e)} <input type="text" style={{width:"0px",height:"0px",display:"none"}} onKeyUp={(e) => this.onSearchKeywordKeyUp(e)}
onkeydown={(e)=>this.onSearchKeywordKeyUps(e)}/> onkeydown={(e)=>this.onSearchKeywordKeyUps(e)}/>

@ -7,15 +7,9 @@ import axios from 'axios';
import Modals from '../../../modals/Modals'; import Modals from '../../../modals/Modals';
import DownloadMessage from '../../../modals/DownloadMessage'; import DownloadMessage from '../../../modals/DownloadMessage';
import CoursesListType from '../../coursesPublic/CoursesListType'; import CoursesListType from '../../coursesPublic/CoursesListType';
import PublishModals from "../../coursesPublic/PublishModals";
import HomeworkModal from "../../coursesPublic/HomeworkModal"; import HomeworkModal from "../../coursesPublic/HomeworkModal";
import moment from 'moment'; import moment from 'moment';
const { Option} = Select; const { Option} = Select;
const CheckboxGroup = Checkbox.Group;
const confirm = Modal.confirm;
let GraduationTasksnewtype=true;
// const $ = window.$;
const Search = Input.Search;
const RadioGroup = Radio.Group; const RadioGroup = Radio.Group;
function range(start, end) { function range(start, end) {

@ -376,7 +376,7 @@ class GraduationTasksquestions extends Component{
width: '100%', width: '100%',
border: '1px solid transparent' border: '1px solid transparent'
}}> }}>
<div dangerouslySetInnerHTML={{__html: markdownToHTML(questionslist.description).replace(/▁/g,"▁▁▁")}}></div> <div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(questionslist.description).replace(/▁/g,"▁▁▁")}}></div>
</div>:"" </div>:""
} }

@ -0,0 +1,80 @@
import React, { useState, useEffect } from 'react'
import { trigger } from 'educoder'
import { Input, Checkbox } from "antd";
function CourseGroupChooser({ course_groups, isAdminOrCreator, item, index, arg_course_groups, checkAllValue
, coursesids, onCheckAllChange, joinCourseGroup }) {
const [state, setState] = useState({counter: 0})
const [search, setSearch] = useState('')
// useEffect(() => {
// console.log(' cdm')
// return () => {
// console.log(' cwum')
// };
// // , [state.counter] 加了这个后onClick就消失了 加错位置了?
// }, [state.counter] )
// TODO 为什么每次onClick都会执行 cwum
// const add1ToCounter = () => {
// const newCounterValue = state.counter + 1
// setState({ counter: newCounterValue })
// }
/**
that.state.groupSearchValue
that.setState({groupSearchValue: e.target.value})
that.onCheckAllChange(e, item, index) - onCheckAllChange(e, item, index)
that.joinCourseGroup(checkedValues, item, index) - joinCourseGroup(checkedValues, item, index)
that.state.checkAllArray[index] - checkAllValue
*/
return (
<ul className="drop_down_menu" style={{"lef":"tunset", minWidth: '262px'}}>
{
course_groups && course_groups.length > 10?
(<p className="drop_down_search">
<Input placeholder="搜索" value={search} onChange={(e) => {setSearch(e.target.value)}} allowClear/>
</p>):
''
}
<Checkbox.Group onChange={(checkedValues) => joinCourseGroup(checkedValues, item, index)}
value={arg_course_groups.map(item => item.id)}
disabled={!isAdminOrCreator} className="mainGroup"
>
{course_groups && course_groups.length > 1 && <li key={'_all' + index} >
{/* 防止被外面group包裹 */}
<Checkbox.Group>
<Checkbox
checked={checkAllValue}
style={{ marginRight: '6px' }} onClick={(e) => onCheckAllChange(e, item, index)} onChange={() => {}}
>全选</Checkbox>
</Checkbox.Group>
</li>}
{
course_groups && course_groups.filter((item) => {
return (!search || item.name.indexOf(search) != -1)
}).map((item,key)=>{
return(
<li key={item.id} value={item.id} >
<Checkbox value={item.id}
style={{ marginRight: '6px' }}
></Checkbox>
{item.name}
</li>
)
})
}
</Checkbox.Group>
<p className="drop_down_btn">
<a href="javascript:void(0)" className="color-grey-6"
onClick={() => trigger('groupAdd', coursesids)}
>添加分班...</a>
</p>
</ul>
)
}
export default CourseGroupChooser

@ -1,5 +1,5 @@
import React,{ Component } from "react"; import React,{ Component } from "react";
import { Input,Checkbox,Table, Divider, Tooltip,Spin } from "antd"; import { Input,Checkbox,Table, Divider, Tooltip,Spin, Menu } from "antd";
import CourseLayoutcomponent from '../common/CourseLayoutComponent' import CourseLayoutcomponent from '../common/CourseLayoutComponent'
@ -21,24 +21,29 @@ import { from } from "array-flatten";
import AddGraduationGroupModal from './modal/AddGraduationGroupModal' import AddGraduationGroupModal from './modal/AddGraduationGroupModal'
import AddAdminModal from './modal/AddAdminModal' import AddAdminModal from './modal/AddAdminModal'
import { ROLE_TEACHER_NUM, ROLE_ASSISTANT_NUM } from './common' import { ROLE_TEACHER_NUM, ROLE_ASSISTANT_NUM } from './common'
import CourseGroupChooser from './CourseGroupChooser'
const Search = Input.Search; const Search = Input.Search;
const ROLE_ADMIN = "管理员" const ROLE_ADMIN = "管理员"
const ROLE_TEACHER = "教师" const ROLE_TEACHER = "教师"
const ROLE_TEACHER_ASSISTANT = "助教" const ROLE_TEACHER_ASSISTANT = "助教"
const pageSize = 20; const pageSize = 20;
function buildColumns(that) { function buildColumns(that) {
let sortedInfo = that.state.sortedInfo || {}
const isAdmin = that.props.isAdmin() const isAdmin = that.props.isAdmin()
const isAdminOrCreator = that.props.isAdminOrCreator(); const isAdminOrCreator = that.props.isAdminOrCreator();
const isAdminOrTeacher = that.props.isAdminOrTeacher() const isAdminOrTeacher = that.props.isAdminOrTeacher()
const { course_groups } = that.state const { course_groups, filterKey } = that.state
const showSorter = filterKey == '1'
const columns = [{ const columns = [{
title: '序号', title: '序号',
dataIndex: 'name', dataIndex: 'name',
key: 'index', key: 'index',
render: (content, item, index) => { render: (content, item, index) => {
return item.isApply == true ? '' : <a href="javascript:;">{(that.state.page - 1) * 20 + index + 1 return index + 1
- (that.state.application_list ? that.state.application_list.length : 0)} </a> // return item.isApply == true ? '' : <a href="javascript:;">{(that.state.page - 1) * 20 + index + 1
// - (that.state.application_list ? that.state.application_list.length : 0)} </a>
} }
} }
// ,{ // ,{
@ -55,6 +60,8 @@ function buildColumns(that) {
dataIndex: 'name', dataIndex: 'name',
width: 120, width: 120,
key: 'name', key: 'name',
sorter: showSorter,
sortOrder: sortedInfo.columnKey === 'name' && sortedInfo.order,
render: (name, record) => { render: (name, record) => {
return <a href={`/login/${record.login}`} target="_blank" className="overflowHidden1" style={{ maxWidth: '110px'}} return <a href={`/login/${record.login}`} target="_blank" className="overflowHidden1" style={{ maxWidth: '110px'}}
title={`${name.length > 4 ? name : ''}`}>{name}</a> title={`${name.length > 4 ? name : ''}`}>{name}</a>
@ -63,6 +70,11 @@ function buildColumns(that) {
title: '角色', title: '角色',
dataIndex: 'role', dataIndex: 'role',
key: 'role', key: 'role',
sorter: showSorter,
// 'ascend' | 'descend'
defaultSortOrder: 'ascend',
sortOrder: sortedInfo.columnKey === 'role' && sortedInfo.order,
}] }]
that.state.course_groups && that.state.course_groups.length && columns.push({ that.state.course_groups && that.state.course_groups.length && columns.push({
title: <Tooltip title="仅能批阅指定分班的作品">管理权限</Tooltip>, title: <Tooltip title="仅能批阅指定分班的作品">管理权限</Tooltip>,
@ -84,49 +96,13 @@ function buildColumns(that) {
{ isAdmin && { isAdmin &&
<React.Fragment> <React.Fragment>
<i className="iconfont icon-xiajiantou font-12 ml2"></i> <i className="iconfont icon-xiajiantou font-12 ml2"></i>
{!noGroups && <ul className="drop_down_menu" style={{"lef":"tunset", minWidth: '262px'}}> {!noGroups && <CourseGroupChooser
{ {...{course_groups, isAdminOrCreator, item, index, arg_course_groups,
course_groups && course_groups.length > 10? checkAllValue: that.state.checkAllArray[index],
(<p className="drop_down_search"> joinCourseGroup: that.joinCourseGroup,
<Input placeholder="搜索" value={that.state.groupSearchValue} onChange={(e) => {that.setState({groupSearchValue: e.target.value})}} allowClear/> onCheckAllChange: that.onCheckAllChange,
</p>): coursesids: that.props.coursesids }}
'' ></CourseGroupChooser>}
}
{course_groups && course_groups.length > 1 && <li key={'_all' + index} >
{/* 防止被外面group包裹 */}
<Checkbox.Group>
<Checkbox
checked={that.state.checkAllArray[index]}
style={{ marginRight: '6px' }} onClick={(e) => that.onCheckAllChange(e, item, index)} onChange={() => {}}
>全选</Checkbox>
</Checkbox.Group>
</li>}
<Checkbox.Group onChange={(checkedValues) => that.joinCourseGroup(checkedValues, item, index)}
value={arg_course_groups.map(item => item.id)}
disabled={!isAdminOrCreator}
>
{
course_groups && course_groups.filter((item) => {
return (!that.state.groupSearchValue || item.name.indexOf(that.state.groupSearchValue) != -1)
}).map((item,key)=>{
return(
<li key={key} value={item.id} >
<Checkbox value={item.id}
style={{ marginRight: '6px' }}
></Checkbox>
{item.name}
</li>
)
})
}
<p className="drop_down_btn">
<a href="javascript:void(0)" className="color-grey-6"
onClick={() => trigger('groupAdd', that.props.coursesids)}
>添加分班...</a>
</p>
</Checkbox.Group>
</ul>}
</React.Fragment> } </React.Fragment> }
</span> </span>
</ConditionToolTip>) </ConditionToolTip>)
@ -138,8 +114,11 @@ function buildColumns(that) {
columns.push({ columns.push({
title: '答辩组', title: '答辩组',
// width: 90, // width: 90,
sorter: showSorter,
key: 'graduation_group', key: 'graduation_group',
dataIndex: 'graduation_group', dataIndex: 'graduation_group',
sortOrder: sortedInfo.columnKey === 'graduation_group' && sortedInfo.order,
render: text => ( render: text => (
<span> <span>
{text} {text}
@ -200,6 +179,7 @@ class studentsList extends Component{
this.state={ this.state={
headIndex:"1", headIndex:"1",
page:1, page:1,
sortedInfo: { columnKey: 'role', order: 'ascend'},
totalPage:undefined, totalPage:undefined,
searchValue:"", searchValue:"",
order: ORDER_BY_DATE, order: ORDER_BY_DATE,
@ -209,7 +189,8 @@ class studentsList extends Component{
checkBoxValues: [], checkBoxValues: [],
isSpin:false, isSpin:false,
application_list: [], application_list: [],
checkAllArray: [] checkAllArray: [],
filterKey: 1, // 1 已审批 2 待审批
} }
} }
onCheckAllChange = (e, item, index) => { onCheckAllChange = (e, item, index) => {
@ -312,7 +293,7 @@ class studentsList extends Component{
}); });
} }
joinCourseGroup = (ids, item, index) => { joinCourseGroup = (ids, item, index) => {
console.log('join ', ids, item) // console.log('join ', ids, item)
const courseId = this.props.match.params.coursesId const courseId = this.props.match.params.coursesId
@ -339,7 +320,7 @@ class studentsList extends Component{
console.log(error); console.log(error);
}); });
} }
fetchAll=(argPage)=>{ fetchAll = async (argPage) => {
this.setState({ this.setState({
isSpin:true isSpin:true
}) })
@ -347,28 +328,57 @@ class studentsList extends Component{
if (argPage) { if (argPage) {
this.setState({ page: argPage }) this.setState({ page: argPage })
} }
const sortedInfo = this.state.sortedInfo;
let page = argPage || this.state.page let page = argPage || this.state.page
let { order, searchValue }=this.state let { searchValue, filterKey }=this.state
let url=`/courses/${id}/teachers.json?order=${order}&page=${page}`; let order = 1;
if (sortedInfo.columnKey == 'role') {
order = 1;
} else if (sortedInfo.columnKey == 'name') {
order = 2;
} else if (sortedInfo.columnKey == 'graduation_group') {
order = 3;
}
let sort = 'desc'
if (sortedInfo.order == 'ascend') {
sort = 'asc'
}
let url=`/courses/${id}/teachers.json?order=${order}&page=${page}&sort=${sort}`;
if (filterKey == '1') {
} else if (filterKey == '2') {
url = `/courses/${id}/apply_teachers.json?_a=1`
}
if(searchValue!=""){ if(searchValue!=""){
url+='&search='+searchValue; url+='&search='+searchValue;
} }
axios.get((url)).then((result)=>{ const result = await axios.get(url)
// axios.get((url)).then((result)=>{
if (result.data.teacher_list) { if (result.data.teacher_list) {
this.setState({ this.setState({
teachers: result.data.teacher_list, teachers: result.data.teacher_list,
total_count: result.data.teacher_list_size, total_count: result.data.teacher_list_size,
application_list: result.data.application_list, application_list: result.data.application_list || [],
is_admin: result.data.is_admin, is_admin: result.data.is_admin,
apply_size: result.data.apply_size,
isSpin:false
})
} else if (result.data.application_list) {
this.setState({
total_count: result.data.teacher_list_size,
application_list: result.data.application_list || [],
is_admin: result.data.is_admin,
apply_size: result.data.apply_size,
isSpin:false isSpin:false
}) })
} }
}).catch((error)=>{ // }).catch((error)=>{
console.log(error); // console.log(error);
this.setState({ // this.setState({
isSpin:false // isSpin:false
}) // })
}) // })
} }
getGroupList(){ getGroupList(){
let id = this.props.match.params.coursesId let id = this.props.match.params.coursesId
@ -529,13 +539,33 @@ class studentsList extends Component{
}) })
return result && result.length > 0 return result && result.length > 0
} }
onTableChange = (pagination, filters, sorter) => {
console.log('Various parameters', pagination, filters, sorter);
this.setState({
sortedInfo: sorter,
}, () => {
this.fetchAll()
});
};
clearSelection = () => {
this.setState({ checkBoxValues: [] })
}
selectedStatus=(e)=>{
this.clearSelection()
this.setState({
filterKey: e.key,
page:1,
isSpin:true
}, () => {
this.fetchAll();
})
}
render(){ render(){
const isAdmin = this.props.isAdmin() const isAdmin = this.props.isAdmin()
const columns = buildColumns(this) const columns = buildColumns(this)
let { let {
searchValue, checkBoxValues, checkAllValue, searchValue, checkBoxValues, checkAllValue,
groupList, total_count, teachers, order, page groupList, total_count, teachers, order, page, apply_size, filterKey
}=this.state }=this.state
let currentOrderName = '加入时间排序' let currentOrderName = '加入时间排序'
@ -544,12 +574,13 @@ class studentsList extends Component{
} else if (order == ORDER_BY_GRADUATION_GROUP) { } else if (order == ORDER_BY_GRADUATION_GROUP) {
currentOrderName = '答辩组排序' currentOrderName = '答辩组排序'
} }
const combineArray = teachers.slice(0) let combineArray = teachers.slice(0)
if (page == 1) { if (page == 1 && filterKey == '2') {
this.state.application_list && this.state.application_list.slice(0).reverse().forEach(item => { // this.state.application_list && this.state.application_list.slice(0).reverse().forEach(item => {
item.isApply = true // item.isApply = true
combineArray.unshift(item) // combineArray.unshift(item)
}) // })
combineArray = this.state.application_list
} }
const isAdminOrTeacher = this.props.isAdminOrTeacher() const isAdminOrTeacher = this.props.isAdminOrTeacher()
const hasGraduationModule = this.hasGraduationModule() const hasGraduationModule = this.hasGraduationModule()
@ -585,21 +616,39 @@ class studentsList extends Component{
</React.Fragment> </React.Fragment>
} }
secondRowLeft={ secondRowLeft={
total_count ? <ColorCountText count={total_count} name="个教师"></ColorCountText> : '' isAdminOrTeacher ? <div className="fl mt6 task_menu_ul ">
<Menu mode="horizontal" defaultSelectedKeys="1" onClick={this.selectedStatus}>
<Menu.Item key="1">已审批({total_count})</Menu.Item>
<Menu.Item key="2">待审批({apply_size})</Menu.Item>
</Menu>
</div> :
(total_count ? <ColorCountText count={total_count} name="个教师"></ColorCountText> : '')
} }
onPressEnter={this.onPressEnter} onPressEnter={this.onPressEnter}
></Titlesearchsection> ></Titlesearchsection>
<style>{` <style>{`
/* CourseGroupChooser */
.drop_down_menu .mainGroup.ant-checkbox-group {
max-height: 380px;
overflow-y: auto;
}
.task_menu_ul .ant-menu-item, .task_menu_ul .ant-menu-submenu-title{
padding:0px;
margin-right: 30px;
line-height: 68px;
font-size: 16px;
}
.teacherList .ant-table-pagination.ant-pagination { .teacherList .ant-table-pagination.ant-pagination {
float: none; float: none;
text-align: center; text-align: center;
} }
`}</style> `}</style>
<div className="mt20 edu-back-white padding20 teacherList"> <div className="mt20 edu-back-white padding20 teacherList">
<div className="clearfix stu_head" style={{paddingLeft: '15px'}}> {filterKey == '1' && <div className="clearfix stu_head" style={{paddingLeft: '15px'}}>
{ isAdminOrTeacher && hasGraduationModule && <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue} >已选 {checkBoxValues.length} </Checkbox> } { isAdminOrTeacher && hasGraduationModule && <Checkbox className="fl" onChange={this.onCheckAll} checked={checkAllValue} >已选 {checkBoxValues.length} </Checkbox> }
{ <div className="studentList_operation_ul"> { filterKey == '1' && <div className="studentList_operation_ul">
{ hasGraduationModule && isAdminOrTeacher && <li className="li_line drop_down"> { hasGraduationModule && isAdminOrTeacher && <li className="li_line drop_down">
加入答辩组<i className="iconfont icon-xiajiantou font-12 ml2"></i> 加入答辩组<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"0px","left":"unset", minWidth: '222px'}}> <ul className="drop_down_menu" style={{"right":"0px","left":"unset", minWidth: '222px'}}>
@ -627,22 +676,23 @@ class studentsList extends Component{
</p> </p>
</ul> </ul>
</li> } </li> }
<li className="drop_down"> {/* <li className="drop_down">
{currentOrderName} <i className="iconfont icon-xiajiantou font-12 ml2"></i> {currentOrderName} <i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_normal"> <ul className="drop_down_normal">
<li onClick={() => this.onSortTypeChange(ORDER_BY_NAME)} >姓名排序</li> <li onClick={() => this.onSortTypeChange(ORDER_BY_NAME)} >姓名排序</li>
<li onClick={() => this.onSortTypeChange(ORDER_BY_DATE)} style={{width: '125px'}}>加入时间排序</li> <li onClick={() => this.onSortTypeChange(ORDER_BY_DATE)} style={{width: '125px'}}>加入时间排序</li>
{this.hasGraduationModule() && <li onClick={() => this.onSortTypeChange(ORDER_BY_GRADUATION_GROUP)} >答辩组排序</li>} {this.hasGraduationModule() && <li onClick={() => this.onSortTypeChange(ORDER_BY_GRADUATION_GROUP)} >答辩组排序</li>}
</ul> </ul>
</li> </li> */}
</div> } </div> }
</div> </div>}
<Spin size="large" spinning={this.state.isSpin}> <Spin size="large" spinning={this.state.isSpin}>
<div className="clearfix stu_table"> <div className="clearfix stu_table">
<Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}> <Checkbox.Group style={{ width: '100%' }} onChange={this.onCheckBoxChange} value={checkBoxValues}>
{/* pagination={{ current: page, total: total_count, pageSize:20, onChange: this.onPageChange }} */} {/* pagination={{ current: page, total: total_count, pageSize:20, onChange: this.onPageChange }} */}
<Table columns={columns} dataSource={combineArray} <Table columns={columns} dataSource={combineArray}
pagination={total_count > 20 ? { //分页 onChange={this.onTableChange}
pagination={total_count > 20 && filterKey == '1' ? { //分页
total: page == 1 && this.state.application_list.length ? total_count + total_count / Math.floor(this.state.application_list.length + 20) : total_count , //数据总数量 total: page == 1 && this.state.application_list.length ? total_count + total_count / Math.floor(this.state.application_list.length + 20) : total_count , //数据总数量
pageSize: page == 1 && this.state.application_list.length ? this.state.application_list.length + 20 : 20, //显示几条一页 pageSize: page == 1 && this.state.application_list.length ? this.state.application_list.length + 20 : 20, //显示几条一页
current: page, current: page,

File diff suppressed because it is too large Load Diff

@ -1,342 +1,345 @@
/* 单选或多选 */ /* 单选或多选 */
.ant-form{ .ant-form{
color:#05101A; color:#05101A;
} }
.ant-radio-disabled + span,.ant-checkbox-disabled + span{ .ant-radio-disabled + span,.ant-checkbox-disabled + span{
color: #666!important; color: #666!important;
cursor: default cursor: default
} }
.ant-radio-wrapper { .ant-radio-wrapper {
color: #666!important; color: #666!important;
} }
.ant-checkbox-wrapper + .ant-checkbox-wrapper{ .ant-checkbox-wrapper + .ant-checkbox-wrapper{
margin-left: 0px!important; margin-left: 0px!important;
} }
/* 下拉 */ /* 下拉 */
.ant-select-selection,.ant-select-selection-selected-value{ .ant-select-selection,.ant-select-selection-selected-value{
min-height: 40px; min-height: 40px;
min-line-height: 40px; min-line-height: 40px;
} }
/* 选答 */ /* 选答 */
.chooseAnswer{ .chooseAnswer{
display: inline-block; display: inline-block;
width: 68px; width: 68px;
text-align: center; text-align: center;
height: 24px; height: 24px;
line-height: 24px; line-height: 24px;
background: #EDEDED; background: #EDEDED;
color: #666; color: #666;
margin-left: 10px; margin-left: 10px;
border-radius: 12px; border-radius: 12px;
} }
.problemShow{ .problemShow{
padding:30px; padding:30px;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
} }
.problemShow:last-child{ .problemShow:last-child{
border-bottom: none; border-bottom: none;
} }
/* 问卷详情 */ /* 问卷详情 */
/* 答题列表 */ /* 答题列表 */
.unlimit{ .unlimit{
height: 24px; height: 24px;
line-height: 24px; line-height: 24px;
padding:0px 10px; padding:0px 10px;
border-radius: 12px; border-radius: 12px;
cursor: pointer; cursor: pointer;
border:1px solid #cdcdcd; border:1px solid #cdcdcd;
color:#666; color:#666;
} }
.unlimit.active{ .unlimit.active{
background-color: #4CACFF; background-color: #4CACFF;
border:1px solid #4CACFF; border:1px solid #4CACFF;
color: #fff; color: #fff;
} }
.edu-table thead th,.edu-table tbody tr:last-child td{ .edu-table thead th,.edu-table tbody tr:last-child td{
border-bottom: none!important; border-bottom: none!important;
} }
.edu-table tbody tr:hover td{ .edu-table tbody tr:hover td{
background-color: #fff!important; background-color: #fff!important;
} }
/* 统计结果 */ /* 统计结果 */
.countList p.countHeader{ .countList p.countHeader{
background-color: #f8f8f8; background-color: #f8f8f8;
color: #666; color: #666;
height: 38px; height: 38px;
font-size: 16px; font-size: 16px;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
display: -webkit-flex; display: -webkit-flex;
} }
.countList p.countHeader ul{ .countList p.countHeader ul{
width: 100%; width: 100%;
padding:0px 30px padding:0px 30px
} }
.countList p.countHeader span,.countList div.countBody span{ .countList p.countHeader span,.countList div.countBody span{
float: left; float: left;
} }
.countList div.countBody{ .countList div.countBody{
margin:0px 30px; margin:0px 30px;
border-bottom:1px solid #EBEBEB; border-bottom:1px solid #EBEBEB;
padding:12px 0px; padding:12px 0px;
} }
.countList div.countBody:last-child{ .countList div.countBody:last-child{
border-bottom: none; border-bottom: none;
} }
.countList p.countHeader span:nth-child(1),.countList div.countBody span:nth-child(1){ .countList p.countHeader span:nth-child(1),.countList div.countBody span:nth-child(1){
width: 50%; width: 50%;
text-align: left; text-align: left;
} }
.countList p.countHeader span:nth-child(2),.countList div.countBody span:nth-child(2){ .countList p.countHeader span:nth-child(2),.countList div.countBody span:nth-child(2){
width:15%; width:15%;
text-align: center; text-align: center;
} }
.countList p.countHeader span:nth-child(3),.countList div.countBody span:nth-child(3){ .countList p.countHeader span:nth-child(3),.countList div.countBody span:nth-child(3){
width:35%; width:35%;
text-align: left; text-align: left;
} }
.percentForm{ .percentForm{
width: 340px; width: 340px;
height: 11px; height: 11px;
background: #F5F5F5; background: #F5F5F5;
border-radius: 6px; border-radius: 6px;
position: relative; position: relative;
margin-top: 7px; margin-top: 7px;
} }
.percentValue{ .percentValue{
position: absolute; position: absolute;
top:0px; top:0px;
left: 0px; left: 0px;
height: 11px; height: 11px;
background: #29BD8B; background: #29BD8B;
border-radius: 6px; border-radius: 6px;
} }
.answerTxt{ .answerTxt{
max-height: 500px; max-height: 500px;
background-color: #F2F9FF; background-color: #F2F9FF;
width: 100%; width: 100%;
margin-top: 10px; margin-top: 10px;
padding:10px; padding:10px;
box-sizing: border-box; box-sizing: border-box;
color: #4c4c4c; color: #4c4c4c;
} }
.otherTxt{ .otherTxt{
border:none!important; border:none!important;
border-bottom: 1px solid #eee!important; border-bottom: 1px solid #eee!important;
background: transparent!important; background: transparent!important;
flex:1; flex:1;
height: 20px!important; height: 20px!important;
line-height: 20px!important; line-height: 20px!important;
} }
.otherTxt.ant-input:hover,.otherTxt.ant-input:focus{ .otherTxt.ant-input:hover,.otherTxt.ant-input:focus{
border:none!important; border:none!important;
border-bottom: 1px solid #eee!important; border-bottom: 1px solid #eee!important;
background: #F8F8F8!important; background: #F8F8F8!important;
} }
/* 必答 */ /* 必答 */
.mustAnswer{ .mustAnswer{
padding:0px 10px; padding:0px 10px;
border-radius: 15px; border-radius: 15px;
height: 22px; height: 22px;
line-height: 22px; line-height: 22px;
background: #eaeaea; background: #eaeaea;
color: #999; color: #999;
font-size: 14px; font-size: 14px;
} }
/* 问卷内容 */ /* 问卷内容 */
.previewList{ .previewList{
border-bottom: 1px solid #ebebeb; border-bottom: 1px solid #ebebeb;
} }
.previewList:last-child{ .previewList:last-child{
border-bottom:none; border-bottom:none;
} }
.textLine{ .textLine{
flex: 1; flex: 1;
height:22px; height:22px;
border-bottom: 1px solid #ebebeb; border-bottom: 1px solid #ebebeb;
} }
.answerList{ .answerList{
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
margin-bottom: 20px; margin-bottom: 20px;
} }
.answerList li{ .answerList li{
padding:10px 30px; padding:10px 30px;
box-sizing: border-box; box-sizing: border-box;
line-height:20px; line-height:20px;
width: 100%; width: 100%;
} }
.answerList li:hover{ .answerList li:hover{
background: #F8F8F8; background: #F8F8F8;
} }
textarea:read-only{ textarea:read-only{
background: #f3f3f3; background: #f3f3f3;
} }
.ant-calendar-picker-input{ .ant-calendar-picker-input{
height: 40px; height: 40px;
} }
/* 问卷答题 */ /* 问卷答题 */
.questionsNo{ .questionsNo{
position: relative; position: relative;
padding: 30px; padding: 30px;
border-bottom: 1px solid #ebebeb; border-bottom: 1px solid #ebebeb;
} }
.questionsfixed{ .questionsfixed{
position: fixed; position: fixed;
padding: 30px; padding: 30px;
z-index: 12; z-index: 12;
top: 60px; top: 60px;
width: 1200px; width: 1200px;
background: #fff; background: #fff;
} }
.answered,.unanswer,.answerTure,.answerFalse,.answerHalf{ .answered,.unanswer,.answerTure,.answerFalse,.answerHalf{
position: relative; position: relative;
} }
.answered::after{ .answered::after{
position: absolute; position: absolute;
right:35px; right:35px;
top:4px; top:4px;
width: 12px; width: 12px;
height: 12px; height: 12px;
border-radius: 50%; border-radius: 50%;
background: #CBCBCB; background: #CBCBCB;
content: ""; content: "";
} }
.unanswer::after{ .unanswer::after{
position: absolute; position: absolute;
right:35px; right:35px;
top:4px; top:4px;
width: 12px; width: 12px;
height: 12px; height: 12px;
border-radius: 50%; border-radius: 50%;
background: #fff; background: #fff;
content: ""; content: "";
border:1px solid rgba(203,203,203,1); border:1px solid rgba(203,203,203,1);
} }
.answerTure::after{ .answerTure::after{
position: absolute; position: absolute;
right:35px; right:35px;
top:4px; top:4px;
width: 20px; width: 20px;
height: 10px; height: 10px;
border-radius: 5px; border-radius: 5px;
background: #29BD8B; background: #29BD8B;
content: ""; content: "";
} }
.answerFalse::after{ .answerFalse::after{
position: absolute; position: absolute;
right:35px; right:35px;
top:4px; top:4px;
width: 20px; width: 20px;
height: 10px; height: 10px;
border-radius: 5px; border-radius: 5px;
background: #FF3756; background: #FF3756;
content: ""; content: "";
} }
.color-red{color: #FF3756!important} .color-red{color: #FF3756!important}
.answerHalf::after{ .answerHalf::after{
position: absolute; position: absolute;
left:-25px; left:-25px;
top:4px; top:4px;
width: 20px; width: 20px;
height: 10px; height: 10px;
border-radius: 5px; border-radius: 5px;
background: #FF6800; background: #FF6800;
content: ""; content: "";
} }
.leaderNav,.leaderMainNav{ .leaderNav,.leaderMainNav{
margin-top: 20px; margin-top: 20px;
} }
.leaderNav a,.leaderMainNav a{ .leaderNav a,.leaderMainNav a{
display: block; display: block;
float: left; float: left;
margin-right: 10px; margin-right: 10px;
border-radius: 50%; border-radius: 50%;
border:1px solid #CBCBCB; border:1px solid #CBCBCB;
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
width: 40px; width: 40px;
text-align: center; text-align: center;
color: #999999; color: #999999;
cursor: pointer; cursor: pointer;
margin-bottom: 5px; margin-bottom: 5px;
} }
.leaderMainNav a{ .leaderMainNav a{
background: #FF3756; background: #FF3756;
color: #fff; color: #fff;
border:1px solid #FF3756; border:1px solid #FF3756;
} }
.leaderNav a.acted{ .leaderNav a.acted{
background:rgba(203,203,203,1); background:rgba(203,203,203,1);
color: #fff; color: #fff;
} }
.leaderMainNav a.acted{ .leaderMainNav a.acted{
background-color: #29BD8B; background-color: #29BD8B;
color: #fff; color: #fff;
border:1px solid #29BD8B; border:1px solid #29BD8B;
} }
.leaderMainNav a.half{ .leaderMainNav a.half{
background-color: #FF6800; background-color: #FF6800;
color: #fff; color: #fff;
border:1px solid #FF6800; border:1px solid #FF6800;
} }
/* 问卷设置 */ /* 问卷设置 */
.pollForm .ant-form-item-control{ .pollForm .ant-form-item-control{
line-height: 20px; line-height: 20px;
} }
.pollForm.ant-form-item{ .pollForm.ant-form-item{
margin-bottom: 0px margin-bottom: 0px
} }
.setInfo .ant-select-selection__rendered{ .setInfo .ant-select-selection__rendered{
line-height: 40px; line-height: 40px;
} }
/* 下拉搜索框 */ /* 下拉搜索框 */
.ant-select-dropdown-menu .ant-select-dropdown-menu-item{ .ant-select-dropdown-menu .ant-select-dropdown-menu-item{
padding:5px 15px; padding:5px 15px;
} }
.ant-select-dropdown.ant-select-dropdown--multiple .ant-select-dropdown-menu-item .ant-select-selected-icon{ .ant-select-dropdown.ant-select-dropdown--multiple .ant-select-dropdown-menu-item .ant-select-selected-icon{
right: 15px; right: 15px;
} }
.noticeTip{ .noticeTip{
border:1px solid #FF0000; border:1px solid #FF0000;
border-radius: 5px; border-radius: 5px;
} }
/* 试卷 */ /* 试卷 */
.setScoreInput{ .setScoreInput{
width: 60px!important;height: 30px!important;box-sizing: border-box; width: 60px!important;height: 30px!important;box-sizing: border-box;
text-align: center!important; text-align: center!important;
background: #F8F8F8; background: #F8F8F8;
color:#666; color:#666;
} }
.setScoreInput:focus{ .setScoreInput:focus{
background: #fff; background: #fff;
color:#FF6800 color:#FF6800
} }
.standardAnswer p{ .standardAnswer p{
line-height: 20px!important; line-height: 20px!important;
} }
/* 倒计时 */ /* 倒计时 */
.remainingTime li{ .remainingTime li{
float: left; float: left;
width: 40px; width: 40px;
line-height: 40px; line-height: 40px;
background-color: #111C24; background-color: #111C24;
color: #fff; color: #fff;
border-radius: 4px; border-radius: 4px;
text-align: center text-align: center
} }
.remainingTime span{ .remainingTime span{
float: left; float: left;
width: 20px; width: 20px;
line-height: 40px; line-height: 40px;
text-align: center; text-align: center;
} }
.myyslwidth {
min-width:1200px
}

@ -160,7 +160,7 @@ class CommitSummary extends Component{
max: 5000, message: '最大限制为5000个字符', max: 5000, message: '最大限制为5000个字符',
}], }],
})( })(
<TPMMDEditor ref={this.mdRef} placeholder={'请在此输入帖子详情,最大限制为5000个字符'} <TPMMDEditor ref={this.mdRef} placeholder={'请在此输入总结内容,最多5000个字符'}
mdID={'courseMessageMD'} initValue={this.state.description} className="courseMessageMD"></TPMMDEditor> mdID={'courseMessageMD'} initValue={this.state.description} className="courseMessageMD"></TPMMDEditor>
)} )}
</div> </div>

@ -337,13 +337,6 @@ class Listofworks extends Component {
render: (text, record) => ( render: (text, record) => (
record.submitstate === "未提交" ? <span style={{ color: '#9A9A9A'}}>--</span> : record.submitstate === "未提交" ? <span style={{ color: '#9A9A9A'}}>--</span> :
<span> <span>
<Tooltip placement="bottom" title={<div>
<div>直接调整最终成绩的分数</div>
<div>其它评分全部作废</div>
</div>}>
<a style={this.props.isNotMember() === true ? this.state.mystyles : this.state.mystyle}
onClick={() => this.Viewstudenttraininginformations(record)}>调分</a>
</Tooltip>
<a style={{"text-align": "center"}} className="color-blue" <a style={{"text-align": "center"}} className="color-blue"
onClick={() => this.Viewstudenttraininginformation(record)}>{record.operating}</a> onClick={() => this.Viewstudenttraininginformation(record)}>{record.operating}</a>
</span> </span>
@ -590,13 +583,6 @@ class Listofworks extends Component {
render: (text, record) => ( render: (text, record) => (
record.submitstate === "未提交" ? <span style={{ color: '#9A9A9A'}}>--</span> : record.submitstate === "未提交" ? <span style={{ color: '#9A9A9A'}}>--</span> :
<span> <span>
<Tooltip placement="bottom" title={<div>
<div>直接调整最终成绩的分数</div>
<div>其它评分全部作废</div>
</div>}>
<a style={this.props.isNotMember() === true ? this.state.mystyles : this.state.mystyle}
onClick={() => this.Viewstudenttraininginformations(record)}>调分</a>
</Tooltip>
<a style={{"text-align": "center"}} className="color-blue" <a style={{"text-align": "center"}} className="color-blue"
onClick={() => this.Viewstudenttraininginformation(record)}>{record.operating}</a> onClick={() => this.Viewstudenttraininginformation(record)}>{record.operating}</a>
</span> </span>

@ -33,7 +33,6 @@ import '../css/Courses.css'
import './style.css' import './style.css'
import moment from 'moment'; import moment from 'moment';
import 'moment/locale/zh-cn'; import 'moment/locale/zh-cn';
import {Base64} from 'js-base64';
const Search = Input.Search; const Search = Input.Search;
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
@ -752,7 +751,7 @@ class ShixunStudentWork extends Component {
</style> </style>
{data&&data? {data&&data?
<div> <div style={{display:duplicatechecking===false?"":"none"}}>
<ul className="clearfix" style={{padding: '20px 16px 10px'}}> <ul className="clearfix" style={{padding: '20px 16px 10px'}}>
<li className="clearfix "> <li className="clearfix ">

@ -1,5 +1,5 @@
import React, {Component} from "react"; import React, {Component} from "react";
import {WordsBtn} from 'educoder'; import {WordsBtn,markdownToHTML} from 'educoder';
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider,InputNumber, Tag,DatePicker,Radio,Tooltip,Spin} from "antd"; import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider,InputNumber, Tag,DatePicker,Radio,Tooltip,Spin} from "antd";
import {Link,Switch,Route,Redirect} from 'react-router-dom'; import {Link,Switch,Route,Redirect} from 'react-router-dom';
import axios from 'axios'; import axios from 'axios';
@ -13,14 +13,11 @@ import 'codemirror/mode/cmake/cmake';
import 'codemirror/mode/xml/xml'; import 'codemirror/mode/xml/xml';
import 'codemirror/mode/javascript/javascript'; import 'codemirror/mode/javascript/javascript';
import 'codemirror/mode/clike/clike'; import 'codemirror/mode/clike/clike';
import '../css/members.css'; import '../css/members.css';
import "../common/formCommon.css"; import "../common/formCommon.css";
import '../css/Courses.css'; import '../css/Courses.css';
import './style.css'; import './style.css';
import moment from 'moment';
import 'moment/locale/zh-cn'; import 'moment/locale/zh-cn';
import {Base64} from 'js-base64';
class ShixunWorkReport extends Component { class ShixunWorkReport extends Component {
@ -173,7 +170,6 @@ class ShixunWorkReport extends Component {
<style> <style>
{` {`
.personalsummary{ .personalsummary{
height:115px;
border:1px solid rgba(235,235,235,1); border:1px solid rgba(235,235,235,1);
border-radius:2px; border-radius:2px;
} }
@ -195,7 +191,9 @@ class ShixunWorkReport extends Component {
</style> </style>
<div className={"pad040"}> <div className={"pad040"}>
<div className={"personalsummary"}> <div className={"personalsummary"}>
{data&&data.work_description}
<div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(data&&data.work_description).replace(/▁/g, "▁▁▁")}}></div>
</div> </div>
</div> </div>
</div> </div>

@ -184,10 +184,10 @@ class ShixunWorkModal extends Component{
if (response.data.status === 0) { if (response.data.status === 0) {
this.props.updatas() this.props.updatas()
this.props.issCancel() this.props.issCancel()
notification.open({ // notification.open({
message:"提示", // message:"提示",
description: response.data.message // description: response.data.message
}); // });
this.props.history.replace(`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${this.props.match.params.homeworkid}/student_work`); this.props.history.replace(`/courses/${this.props.match.params.coursesId}/shixun_homeworks/${this.props.match.params.homeworkid}/student_work`);
}else if(response.data.status === -1){ }else if(response.data.status === -1){
notification.open({ notification.open({

@ -4,7 +4,6 @@ import HomeworkModal from "../coursesPublic/HomeworkModal";
import {WordsBtn, ActionBtn, handleDateString} from 'educoder'; import {WordsBtn, ActionBtn, handleDateString} from 'educoder';
import PollDetailTabForthRules from '../poll/PollDetailTabForthRules'; import PollDetailTabForthRules from '../poll/PollDetailTabForthRules';
import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal'; import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal';
import {Base64} from 'js-base64';
import { import {
Button, Button,
Checkbox, Checkbox,

@ -23,7 +23,6 @@ import {
import {Link, Switch, Route, Redirect} from 'react-router-dom'; import {Link, Switch, Route, Redirect} from 'react-router-dom';
import moment from 'moment'; import moment from 'moment';
import 'moment/locale/zh-cn'; import 'moment/locale/zh-cn';
import {Base64} from 'js-base64';
import axios from 'axios'; import axios from 'axios';
import '../css/members.css' import '../css/members.css'
import "../common/formCommon.css" import "../common/formCommon.css"
@ -510,7 +509,7 @@ class Workquestionandanswer extends Component {
} }
</style> </style>
<div className={"font-16 color-dark fl pl20 "}> <div className={"font-16 color-dark fl pl20 "}>
<div <div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(jobsettingsdata.data.description).replace(/▁/g, "▁▁▁")}}></div> dangerouslySetInnerHTML={{__html: markdownToHTML(jobsettingsdata.data.description).replace(/▁/g, "▁▁▁")}}></div>
{/* /!*{}}></div> {/* /!*{}}></div>
{/* /!*{jobsettingsdata.data.description}*!/*/} {/* /!*{jobsettingsdata.data.description}*!/*/}
@ -560,7 +559,7 @@ class Workquestionandanswer extends Component {
<div className="pl20 markdown-body" style={{"padding": "10px 10px 10px 20px"}}> <div className="pl20 markdown-body" style={{"padding": "10px 10px 10px 20px"}}>
{jobsettingsdata === undefined ? "无" : jobsettingsdata === null ? "无" : jobsettingsdata === "null" ? "无" : {jobsettingsdata === undefined ? "无" : jobsettingsdata === null ? "无" : jobsettingsdata === "null" ? "无" :
jobsettingsdata.data.explanation === undefined ? "无" : jobsettingsdata.data.explanation === null ? "无" : jobsettingsdata.data.explanation === undefined ? "无" : jobsettingsdata.data.explanation === null ? "无" :
<div <div className={"markdown-body"}
dangerouslySetInnerHTML={{__html: markdownToHTML(jobsettingsdata.data.explanation).replace(/▁/g, "▁▁▁")}}></div> dangerouslySetInnerHTML={{__html: markdownToHTML(jobsettingsdata.data.explanation).replace(/▁/g, "▁▁▁")}}></div>
} }

@ -58,6 +58,14 @@ class MainContent extends Component {
font-family: 微软雅黑,宋体 !important; font-family: 微软雅黑,宋体 !important;
overflow: hidden !important; overflow: hidden !important;
} }
.can-drag {
width: 100%;
height: 100%;
z-index: 100;
position: fixed;
cursor: col-resize;
top: 0px;
}
`}</style> `}</style>
<div className="-layout -stretch -fit labelN" id="game_show_content"> <div className="-layout -stretch -fit labelN" id="game_show_content">
<div className="split-panel--first -layout -vertical -flex -relative -flex-basic40" <div className="split-panel--first -layout -vertical -flex -relative -flex-basic40"
@ -67,7 +75,7 @@ class MainContent extends Component {
{/* 左侧任务说明等功能的区域 */} {/* 左侧任务说明等功能的区域 */}
<LeftViewContainer {...newProps}></LeftViewContainer> <LeftViewContainer {...newProps}></LeftViewContainer>
</div> </div>
<div id="can-drag" className="can-drag" style={{display: 'none'}}></div>
<div className="b-label -layout" style={{left: '687px'}}> <div className="b-label -layout" style={{left: '687px'}}>
<div className="resize-helper "> <div className="resize-helper ">
<Button variant="fab" aria-label="Swap" mini onClick={this.onResizeButtonClick}> <Button variant="fab" aria-label="Swap" mini onClick={this.onResizeButtonClick}>

@ -18,7 +18,7 @@ export function ImageLayerOfCommentHOC(options = {}) {
const imageSrc = event.target.src || event.target.getAttribute('src') || event.target.getAttribute('href') const imageSrc = event.target.src || event.target.getAttribute('src') || event.target.getAttribute('href')
// 判断imageSrc是否是图片 // 判断imageSrc是否是图片
const fileName = event.target.innerHTML.trim() const fileName = event.target.innerHTML.trim()
if (isImageExtension(imageSrc.trim()) || isImageExtension(fileName)) { if (isImageExtension(imageSrc.trim()) || isImageExtension(fileName) || event.target.tagName == 'IMG') {
// 非回复里的头像图片; 非emoticons // 非回复里的头像图片; 非emoticons
if (imageSrc.indexOf('/images/avatars/User') === -1 && if (imageSrc.indexOf('/images/avatars/User') === -1 &&
imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) { imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) {

@ -41,9 +41,10 @@
align-items: center; align-items: center;
display: -webkit-flex; display: -webkit-flex;
height: 100%; height: 100%;
text-align: center;
} }
.passImg{ .passImg{
max-width: 100%; max-width: 86%;
max-height: 100%; max-height: 100%;
} }
/* ImageLayer ----------------- End */ /* ImageLayer ----------------- End */

@ -159,7 +159,7 @@ class CodeEvaluateView extends Component {
let headIconClass = ''; let headIconClass = '';
let _headLockIconClass = ''; let _headLockIconClass = '';
if (item.is_public === 0) { if (item.is_public == 0) {
if (game.test_sets_view === true || power === 1){ if (game.test_sets_view === true || power === 1){
_headLockIconClass = 'fas fa-unlock-alt' _headLockIconClass = 'fas fa-unlock-alt'
} else { } else {
@ -175,7 +175,7 @@ class CodeEvaluateView extends Component {
testSetsComponentArray.push( testSetsComponentArray.push(
<div className="-task-ces-top clearfix" onClick={ this.onTestSetHeaderClick.bind(this, index) } <div className="-task-ces-top clearfix" onClick={ this.onTestSetHeaderClick.bind(this, index) }
style={{cursor:'pointer'}} key={index+'-0'}> style={{cursor:'pointer', 'margin-top':index == 0 ? '4px' : ''}} key={index+'-0'}>
<p className="clearfix"> <p className="clearfix">
<i className={`fa ${ 'fa-caret-right'} mr8 font-16`} <i className={`fa ${ 'fa-caret-right'} mr8 font-16`}
style={isExpanded ? {transform: 'rotate(90deg)'} : {}}></i> style={isExpanded ? {transform: 'rotate(90deg)'} : {}}></i>

@ -283,6 +283,9 @@ class LeftView extends Component {
color: #CDCDCD; color: #CDCDCD;
flex: 0 0 45px; flex: 0 0 45px;
} }
.markdown-body ol, .markdown-body ul {
padding-left: 2.5em;
}
`}</style> `}</style>
<div className="multiLevelAnswer"> <div className="multiLevelAnswer">
@ -293,7 +296,7 @@ class LeftView extends Component {
<div className="name">{item.name}</div> <div className="name">{item.name}</div>
<div className="status">已解锁</div> <div className="status">已解锁</div>
</div> </div>
<div className="contents" dangerouslySetInnerHTML={{__html: markdownToHTML(item.contents)}}> <div className="contents markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(item.contents)}}>
</div> </div>
</div> </div>
})} })}

@ -342,7 +342,7 @@ class PathDetailIndex extends Component{
<div className="color-grey-6 clearfix"> <div className="color-grey-6 clearfix">
<div id="shixuns_propaedeutics" className="new_li fl" style={{"padding":" 0px","textAlign": "justify;"}}> <div id="shixuns_propaedeutics" className="new_li fl" style={{"padding":" 0px","textAlign": "justify;"}}>
{detailInfoList === undefined ? "" :detailInfoList.description===null?"": {detailInfoList === undefined ? "" :detailInfoList.description===null?"":
<div dangerouslySetInnerHTML={{__html: markdownToHTML(detailInfoList.description).replace(/▁/g,"▁▁▁")}}></div> <div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(detailInfoList.description).replace(/▁/g,"▁▁▁")}}></div>
} }
</div> </div>
</div> </div>

@ -304,7 +304,7 @@ class Challenges extends Component {
id="challenge_editorMd_description"> id="challenge_editorMd_description">
<p id="ReactMarkdown" style={{overflow:'hidden'}}> <p id="ReactMarkdown" style={{overflow:'hidden'}}>
{ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"": {ChallengesDataList === undefined ? "" :ChallengesDataList&&ChallengesDataList.description===null?"":
<div dangerouslySetInnerHTML={{__html: markdownToHTML(ChallengesDataList.description).replace(/▁/g,"▁▁▁")}}></div> <div className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(ChallengesDataList.description).replace(/▁/g,"▁▁▁")}}></div>
} }
</p> </p>

Loading…
Cancel
Save