杨树林 5 years ago
commit b0f9675b56

@ -113,22 +113,21 @@ module.exports = {
// First, run the linter.
// It's important to do this before Babel processes the JS.
// 上线然后要注释回来
{
test: /\.(js|jsx|mjs)$/,
enforce: 'pre',
use: [
{
options: {
formatter: eslintFormatter,
eslintPath: require.resolve('eslint'),
},
loader: require.resolve('eslint-loader'),
},
],
include: paths.appSrc,
},
// {
// test: /\.(js|jsx|mjs)$/,
// enforce: 'pre',
// use: [
// {
// options: {
// formatter: eslintFormatter,
// eslintPath: require.resolve('eslint'),
//
// },
// loader: require.resolve('eslint-loader'),
// },
// ],
// include: paths.appSrc,
// },
{
// "oneOf" will traverse all following loaders until one will
// match the requirements. When no loader matches it will fall

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

@ -31,7 +31,7 @@
location.pathname.indexOf("/compatibility") == -1) {
// location.href = './compatibility'
location.href = './compatibility.html'
location.href = '/compatibility.html'
}
</script>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,9 @@
/*!
* Cropper.js v1.5.2
* https://fengyuanchen.github.io/cropperjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2019-06-30T06:01:02.389Z
*/.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-canvas,.cropper-wrap-box{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:rgba(51,153,255,.75);overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.33333%;left:0;top:33.33333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.33333%;top:0;width:33.33333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:after,.cropper-center:before{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width:768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width:992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width:1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC")}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}

File diff suppressed because one or more lines are too long

@ -1,6 +1,6 @@
export function bytesToSize(bytes) {
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
if (bytes == 0) return '0 Byte';
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i];
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
if (bytes == 0) return '0 Byte';
var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
return parseFloat(bytes / Math.pow(1024, i), 2).toFixed(1) + ' ' + sizes[i];
}

@ -36,6 +36,13 @@ export function getUrl(path, goTest) {
}
return `${path ? path: ''}`;
}
export function getUrl2(path, goTest) {
const local = 'http://localhost:3000'
if (isDev) {
return `${local}${path?path:''}`
}
return `${path ? path: ''}`;
}
export function getUploadActionUrl(path, goTest) {
return `${getUrl()}/api/attachments.json${isDev ? `?debug=${window._debugType || 'admin'}` : ''}`
}

@ -0,0 +1,263 @@
import React, { Component } from 'react';
import { getUrl2 } from 'educoder'
const $ = window.$
let _url_origin = getUrl2()
// let _url_origin = `http://47.96.87.25:48080`;
if (!window.Cropper) {
$('head').append($('<link rel="stylesheet" type="text/css" />')
.attr('href', `${_url_origin}/react/public/js/cropper/cropper.min.css`));
$.getScript(
`${_url_origin}/react/public/js/cropper/cropper.js`,
(data, textStatus, jqxhr) => {
});
$.getScript(
`${_url_origin}/react/public/js/cropper/html2canvas.min.js`,
(data, textStatus, jqxhr) => {
});
}
function save_avatar(){
// if($(img_lg).html().trim() == ""){
// $("#avatar-name").html("请先选择图片上传").css("color", 'red');
// } else {
// $("#avatar-name").html("").css("color", '#333');
const previewId = this.props.previewId
var img_lg = document.getElementById(previewId || 'img-preview');
// 截图小的显示框内的内容
html2canvas(img_lg).then(function(canvas) {
// for test
// document.getElementById('canvasWrap').appendChild(canvas);
var dataUrl = canvas.toDataURL("image/jpeg");
console.log(dataUrl)
// TODO upload base64 image data to server
});
return
// 老版接口:
// html2canvas(img_lg, {
// allowTaint: true,
// taintTest: false,
// onrendered: function(canvas) {
// canvas.id = "mycanvas";
// //生成base64图片数据
// var dataUrl = canvas.toDataURL("image/jpeg");
// console.log(dataUrl)
// var newImg = document.getElementById("showImg");
// newImg.src = dataUrl;
// return;
// imagesAjax(dataUrl);
// $(".avatar-save").attr("disabled","true");
// }
// });
// }
}
class Cropper extends Component {
state = {
};
handleChange = (info) => {
}
componentDidMount() {
setTimeout(() => {
const image = document.getElementById('image');
const cropper = new window.Cropper(image, {
aspectRatio: 1,
crop(event) {
// console.log(event.detail.x);
// console.log(event.detail.y);
// console.log(event.detail.width);
// console.log(event.detail.height);
// console.log(event.detail.rotate);
// console.log(event.detail.scaleX);
// console.log(event.detail.scaleY);
},
preview: '.img-preview',
});
}, 3000)
}
render() {
const { width, height, previewId, imageSrc } = this.props;
return (
<div>
{/* This rule is very important, please do not ignore this! */}
<style>{`
.wrapper {
width: ${ width || '500px'};
height: ${ height || '500px'};
}
img {
max-width: 100%;
}
.preview-lg {
overflow: hidden;
background-color: #fff;
border-radius: 50%;
text-align: center;
}
`}</style>
<div className="wrapper">
{/* http://localhost:3007/images/footNavLogo.png 图片转了后不对 */}
<img id="image" src={`${imageSrc || "/images/testPicture.jpg"}`}></img>
</div>
{/* background: 'aquamarine',
'border-radius': '128px'
*/}
{!previewId && <div id="img-preview" className="img-preview preview-lg" style={{width: '128px', height: '128px', }}>
</div>}
{/* <img id="showImg" src="http://localhost:3007/images/testPicture.jpg"></img> */}
{/* <div id="canvasWrap"></div> */}
<button onClick={save_avatar.bind(this)}>save </button>
</div>
);
}
}
export default Cropper;
// function aaa () {
// function showedit_headphoto() {
// var html = `
// <script src=\"../head/jquery.min.js\"><\/script>\n
// <link href=\"../head/cropper.min.css\" rel=\"stylesheet\">\n
// <link href=\"../head/sitelogo.css\" rel=\"stylesheet\">\n
// <script src=\"../head/bootstrap.min.js\"><\/script>\n
// <script src=\"../head/cropper.js\"><\/script>\n
// <script src=\"../head/sitelogo.js\"><\/script>\n
// <script src=\"../head/html2canvas.min.js\" type=\"text/javascript\" charset=\"utf-8\"><\/script>\n\n
// <div class=\"task-popup\" style=\"width: 550px;\">\n <div class=\"task-popup-title clearfix task-popup-bggrey\">上传头像<\/div>\n <div class=\"clearfix\">\n
// <div class=\"modal fade\" style=\"outline: none;\" id=\"avatar-modal\" aria-hidden=\"true\" aria-labelledby=\"avatar-modal-label\" role=\"dialog\" tabindex=\"-1\">\n
// <div class=\"modal-dialog modal-lg\">\n <div class=\"modal-content\">\n <form class=\"avatar-form\">\n <div class=\"modal-body\">\n
// <div class=\"padding20\">\n <div class=\"avatar-upload\">\n <input class=\"avatar-src\" name=\"avatar_src\" type=\"hidden\">\n
// <input class=\"avatar-data\" name=\"avatar_data\" type=\"hidden\">\n\n <span id=\"avatar-name\"><\/span>\n
// <input class=\"avatar-input\" style=\"display:none;\" id=\"avatarInput\" value=\"avatars/User/116\" name=\"avatar_file\" type=\"file\">\n
// <input type=\"hidden\" id=\"source_id\" value=\"116\"/>\n <input type=\"hidden\" id=\"source_type\" value=\"User\"/>\n <\/div>\n
// <div class=\"row clearfix mt20 pl20\">\n <div class=\"task-form-45 fl panel-box-sizing uplaodImg\">\n
// <div class=\"avatar-wrapper\" id=\"wrapper_image_show\">\n <!--<span style=\"display: block;\">\n 选择你要上传的图片<br/>
// \n 仅支持JPG、GIF、PNG且文件小于2M\n <\/span>-->\n <\/div>\n
// <div class=\"row avatar-btns clearfix\">\n <a href=\"javascript:void(0);\" class=\"fl\" type=\"button\" onClick=\"$(\'input[id=avatarInput]\').click();\">重新上传<\/a>\n
// <!--<div class=\"btn-group\">\n <a href=\"javascript:void(0);\" class=\"fa fa-repeat fr mt5 color-grey-9\" data-method=\"rotate\" data-option=\"90\"
// type=\"button\" title=\"Rotate 90 degrees\">\n <\/a>\n <\/div>-->\n <\/div>\n <\/div>\n
// <div class=\"task-form-50 panel-box-sizing fr color-grey pr20\" style=\"width: 128px;\">\n <div class=\"edu-txt-center\">\n
// <div class=\"avatar-preview preview-lg radius\" id=\"imageHead\">\n
// <img alt=\"头像\" height=\"128\" nhname=\"avatar_image\" src=\"/images/avatars/User/116?1556802838\" width=\"128\" />\n <\/div>\n
// <span>头像预览<\/span>\n <\/div>\n
// <p class=\"color-grey-9 font-12 mt110 justify\">仅支持JPG、GIF、PNG且文件小于2M<\/p>\n <\/div>\n <\/div>\n
// <\/div>\n <div class=\"clearfix edu-txt-center mb20 mt10\">\n
// <a href=\"javascript:void(0);\" class=\"task-btn mr20\" onclick=\"hideModal()\">取消<\/a>\n
// <a href=\"javascript:void(0);\" class=\"avatar-save task-btn task-btn-orange\" data-dismiss=\"modal\">确定<\/a>\n
// <\/div>\n <\/div>\n <\/form>\n <\/div>\n <\/div>\n <\/div>\n <\/div>\n<\/div>\n\n<script>\n
// $(function () {\n new CropAvatar($(\'#crop-avatar\'), 1/1);\n\n //---------------------------头像上传-----------------------------//\n //做个下简易的验证 大小 格式\n $(\'#avatarInput\').on(\'change\', function(e) {\n var filemaxsize = 1024 * 5;//5M\n var target = $(e.target);\n var Size = target[0].files[0].size / 1024;\n if(Size > filemaxsize) {\n alert(\'图片过大,请重新选择!\');\n $(\".avatar-wrapper\").children().remove;\n return false;\n }\n if(!this.files[0].type.match(/image.*/)) {\n alert(\'请选择正确的图片!\')\n } else {\n /*var filename = document.querySelector(\"#avatar-name\");*/\n var texts = document.querySelector(\"#avatarInput\").value;\n var teststr = texts; //你这里的路径写错了\n testend = teststr.match(/[^\\\\]+\\.[^\\(]+/i); //直接完整文件名的\n /*filename.innerHTML = testend;\n $(filename).css(\"color\", \'#333\');*/\n $(\".avatar-save\").removeClass(\"task-btn-grey\").addClass(\"task-btn-orange\");\n $(\".avatar-save\").on(\"click\", save_avatar);\n }\n\n });\n });\n\n function save_avatar(){\n var img_lg = document.getElementById(\'imageHead\');\n if($(img_lg).html().trim() == \"\"){\n $(\"#avatar-name\").html(\"请先选择图片上传\").css(\"color\", \'red\');\n } else {\n $(\"#avatar-name\").html(\"\").css(\"color\", \'#333\');\n // 截图小的显示框内的内容\n html2canvas(img_lg, {\n allowTaint: true,\n taintTest: false,\n onrendered: function(canvas) {\n canvas.id = \"mycanvas\";\n //生成base64图片数据\n var dataUrl = canvas.toDataURL(\"image/jpeg\");\n var newImg = document.createElement(\"img\");\n newImg.src = dataUrl;\n imagesAjax(dataUrl);\n $(\".avatar-save\").attr(\"disabled\",\"true\");\n }\n });\n }\n }\n\n function imagesAjax(src) {\n var data = {};\n data.img = src;\n data.source_id = $(\'#source_id\').val();\n data.source_type = $(\'#source_type\').val();\n data.is_direct = 0;\n $.ajax({\n url: \"/upload_avatar\",\n beforeSend: function(xhr) {xhr.setRequestHeader(\'X-CSRF-Token\', $(\'meta[name=\"csrf-token\"]\').attr(\'content\'))},\n data: data,\n type: \"POST\",\n success: function (re) {\n console.log(re);\n console.log(1562050370);\n if(re){\n var o = JSON.parse(re);\n if (o.status !=0 ){\n console.log(o.message);\n } else {\n var imgSpan = $(\"img[nhname=\'avatar_image\']\");\n imgSpan.attr({\"src\": o.url + \'?1562050370\'});\n $(\"#user_code\").html(o.grade);\n notice_box_redirect(\"/users/shitou\", \"上传成功\");\n }\n } else {\n notice_box(\"上传出错\");\n }\n\n },\n error: function (e) {\n alert(e);\n }\n });\n }\n
// <\/script>`;
// pop_box_new(html, 550, 510);
// $("#imageHead img").attr({"src": $("#user_avatar_show").attr("src")});
// $("#wrapper_image_show img").attr({"src": $("#user_avatar_show").attr("src")});
// }
// $(function () {
// new CropAvatar($('#crop-avatar'), 1/1);
// //---------------------------头像上传-----------------------------//
// //做个下简易的验证 大小 格式
// $('#avatarInput').on('change', function(e) {
// var filemaxsize = 1024 * 5;//5M
// var target = $(e.target);
// var Size = target[0].files[0].size / 1024;
// if(Size > filemaxsize) {
// alert('图片过大,请重新选择!');
// $(".avatar-wrapper").children().remove;
// return false;
// }
// if(!this.files[0].type.match(/image.*/)) {
// alert('请选择正确的图片!')
// } else {
// /*var filename = document.querySelector("#avatar-name");*/
// var texts = document.querySelector("#avatarInput").value;
// var teststr = texts; //你这里的路径写错了
// testend = teststr.match(/[^\\\\]+\\.[^\\(]+/i); //直接完整文件名的
// /*filename.innerHTML = testend; $(filename).css("color", '#333');*/
// $(".avatar-save").removeClass("task-btn-grey").addClass("task-btn-orange");
// $(".avatar-save").on("click", save_avatar);
// }
// });
// });
// function save_avatar(){
// var img_lg = document.getElementById('imageHead');
// if($(img_lg).html().trim() == ""){
// $("#avatar-name").html("请先选择图片上传").css("color", 'red');
// } else {
// $("#avatar-name").html("").css("color", '#333');
// // 截图小的显示框内的内容
// html2canvas(img_lg, {
// allowTaint: true,
// taintTest: false,
// onrendered: function(canvas) {
// canvas.id = "mycanvas";
// //生成base64图片数据
// var dataUrl = canvas.toDataURL("image/jpeg");
// var newImg = document.createElement("img");
// newImg.src = dataUrl;
// imagesAjax(dataUrl);
// $(".avatar-save").attr("disabled","true");
// }
// });
// }
// }
// function imagesAjax(src) {
// var data = {};
// data.img = src;
// data.source_id = $('#source_id').val();
// data.source_type = $('#source_type').val();
// data.is_direct = 0;
// $.ajax({
// url: "/upload_avatar",
// beforeSend: function(xhr) {
// xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'))
// },
// data: data,
// type: "POST",
// success: function (re) {
// console.log(re);
// // console.log(1562050370);
// if(re){
// var o = JSON.parse(re);
// if (o.status !=0 ){
// console.log(o.message);
// } else {
// var imgSpan = $("img[nhname='avatar_image']");
// imgSpan.attr({"src": o.url + '?1562050370'});
// $("#user_code").html(o.grade);
// notice_box_redirect("/users/shitou", "上传成功");
// }
// } else {
// notice_box("上传出错");
// }
// },
// error: function (e) {
// alert(e);
// }
// });
// }
// }

@ -2,7 +2,7 @@ import { from } from '_array-flatten@2.1.2@array-flatten';
// export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil';
export { getImageUrl as getImageUrl, getUrl as getUrl,setImagesUrl as setImagesUrl, getUploadActionUrl as getUploadActionUrl } from './UrlTool';
export { getImageUrl as getImageUrl, getUrl as getUrl, getUrl2 as getUrl2, setImagesUrl as setImagesUrl, getUploadActionUrl as getUploadActionUrl } from './UrlTool';
export { default as queryString } from './UrlTool2';
export { SnackbarHOC as SnackbarHOC } from './SnackbarHOC';

@ -33,15 +33,18 @@ class Fileslistitem extends Component{
axios.get(url,{
params:{
course_id:coursesId
}
},
}).then((result)=>{
if(result.data.attachment_histories.length===0){
let link = document.createElement('a');
// link.href = window.URL.createObjectURL(new Blob([result.data.url]));
link.href = result.data.url;
link.download = result.data.title;
let filesname=encodeURIComponent(result.data.title)
console.log(result.data.title)
link.download = decodeURIComponent(filesname)
//兼容火狐浏览器
console.log(result.data.title)
document.body.appendChild(link);
let evt = document.createEvent("MouseEvents");
evt.initEvent("click", false, false);
@ -201,13 +204,13 @@ class Fileslistitem extends Component{
<span className="fl mr12 mt3">
{checkBox}
</span>
{
this.props.isAdmin ? <a
// href={"/courses/" + coursesId + "/graduation/graduation_tasks/" + categoryid + "/" + taskid + "/list"}
onClick={this.showfiles}
title={discussMessage.title}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</a> : ""
}
{
this.props.isAdmin ? <a
// href={"/courses/" + coursesId + "/graduation/graduation_tasks/" + categoryid + "/" + taskid + "/list"}
onClick={this.showfiles}
title={discussMessage.title}
className="fl mt3 font-16 font-bd color-dark maxwidth580">{discussMessage.title}</a> : ""
}
{
this.props.isStudent? <a
onClick={this.showfiles}
@ -233,11 +236,7 @@ class Fileslistitem extends Component{
</Tooltip>
:""
}
{discussMessage.is_publish===true?"":<CoursesListType typelist={["未发布"]} typesylename={""}/>}
{discussMessage.is_publish===false?<CoursesListType typelist={["未发布"]} typesylename={""}/>:""}
</h6>
<style>
{
@ -292,7 +291,16 @@ class Fileslistitem extends Component{
{ discussMessage.publish_time===null?"":discussMessage.is_publish===true?moment(discussMessage.publish_time).fromNow():moment(discussMessage.publish_time).format('YYYY-MM-DD HH:mm')}
</span>
</span>
{this.props.isAdmin ||this.props.current_user.login===discussMessage.author.login?
{this.props.isAdmin?
<span className={"fr mrf2 mr10"}>
<WordsBtn style="blue" className="colorblue font-16 mr20 fr">
<a className="btn colorblue"
onClick={()=>this.settingList()}>设置</a>
</WordsBtn>
</span>:""}
{this.props.current_user.login===discussMessage.author.login?
<span className={"fr mrf2 mr10"}>
<WordsBtn style="blue" className="colorblue font-16 mr20 fr">

@ -41,7 +41,9 @@ class Fileslists extends Component{
}
componentDidMount=()=>{
this.setState({
isSpin:true
isSpin:true,
checkBoxValues:[],
checkAllValue:false
})
if(this.props.match.params.main_id){
this.seactall();
@ -50,6 +52,7 @@ class Fileslists extends Component{
}
this.updadatalist();
on('updateNavSuccess', this.updateNavSuccess)
on('updateNavSuccess',this.updadatalist)
}
updateNavSuccess=()=>{
@ -64,17 +67,21 @@ class Fileslists extends Component{
}
componentDidUpdate = (prevProps) => {
if(prevProps.match.params.main_id != this.props.match.params.main_id){
this.setState({
isSpin:true
})
this.setState({
isSpin:true,
checkBoxValues:[],
checkAllValue:false
})
if(this.props.match.params.main_id!=undefined){
this.seactall();
}
}
if(prevProps.match.params.Id != this.props.match.params.Id){
this.setState({
isSpin:true
})
this.setState({
isSpin:true,
checkBoxValues:[],
checkAllValue:false
})
if(this.props.match.params.Id!=undefined){
this.seactall(parseInt(this.props.match.params.Id),1)
}
@ -118,7 +125,6 @@ class Fileslists extends Component{
})
}
updatafiled=()=>{
debugger
if(this.props.match.params.main_id){
this.seactall();
}else if(this.props.match.params.Id){
@ -526,8 +532,6 @@ class Fileslists extends Component{
})
.then((response) => {
if (response.data.status == 0) {
this.seactall();
this.setState({
// Modalstype:true,
// Modalstopval:response.data.message,
@ -535,11 +539,12 @@ class Fileslists extends Component{
// ModalSave:this.cancelmodel,
// Loadtype:true,
checkBoxValues:[],
// checkAllValue:false
checkAllValue:false
})
this.updatafiled()
this.props.showNotification('资源移动成功')
this.props.updataleftNavfun()
this.updatafiled()
}
})
}
@ -682,6 +687,9 @@ class Fileslists extends Component{
<div className="studentList_operation_ul">
{this.props.isAdmin()?<li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onDelete}>删除</a></li>:""}
{this.props.isAdmin()?<li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onSend}>发送</a></li>:""}
{/*{this.props.isAdmin()?*/}
{/*<li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.homeworkstart}>立即发布</a></li>*/}
{/*:""}*/}
{this.props.isAdmin()?course_is_public===true?
<li className="li_line"><a href="javascript:void(0)" className="color-grey-9" onClick={this.onOpen}>设为公开</a></li>
:"":""}
@ -786,7 +794,7 @@ class Fileslists extends Component{
isAdmin={this.props.isAdmin()}
isStudent={this.props.isStudent()}
isNotMember={this.props.isNotMember()}
checkBox={<Checkbox value={item.id}></Checkbox>}
checkBox={this.props.isAdmin()?<Checkbox value={item.id}></Checkbox>:""}
Settingtypes={(id)=>this.Settingtypes(id)}
coursesId={this.props.match.params.coursesId}
updatafiledfun={()=>this.updatafiled()}
@ -831,7 +839,7 @@ class Fileslists extends Component{
<div className="alltask edu-back-white"
style={
{
display: total_count===undefined?'block' :total_count===0? 'block' : 'none'
display: files===undefined?'block' :files.length===0? 'block' : 'none'
}
}
>

@ -313,18 +313,14 @@ class BoardsNew extends Component{
</p>
{/* notRequired */}
<Form {...formItemLayout} onSubmit={this.handleSubmit}>
<div className="formBlock" style={{paddingBottom: '0px'}}>
<Form.Item
label="标题"
className="topicTitle "
>
{ isAdmin &&
<div className="formBlock" style={{paddingBottom: '0px', position: 'relative'}}>
{ isAdmin &&
<React.Fragment>
{getFieldDecorator('sticky', {
valuePropName: 'checked',
})(
isAdmin && <Checkbox style={{ right: '0px',
top: '-50px',
isAdmin && <Checkbox style={{ right: '22px',
top: '28px',
position: 'absolute'
}}>置顶</Checkbox>
)}
@ -332,6 +328,11 @@ class BoardsNew extends Component{
<span style={{ "padding-left": 0, "padding-right": 0 }}></span>
</React.Fragment>
}
<Form.Item
label="标题"
className="topicTitle "
>
{getFieldDecorator('subject', {
rules: [{
required: true, message: '请输入标题',

@ -248,7 +248,7 @@ function buildColumns(that, student_works) {
*/
columns.push({
width: 84,
title: <div style={{fontWeight:'bold'}}><div style={{fontWeight:'bold'}}>匿评</div></div>,
title: <div style={{color: 'rgba(0,0,0,.85)'}}><div style={{color: 'rgba(0,0,0,.85)'}}>匿评</div></div>,
key: 'student_score',
dataIndex: 'student_score',

@ -369,7 +369,7 @@ class NewWork extends Component{
</p> */}
<CBreadcrumb items={[
{ to: `/courses/${courseId}`, name: this.state.course_name},
{ to: `/courses/${courseId}/${moduleEngName}/${category && category.category_id ? category.category_id : ''}`, name: category.category_name },
{ to: `/courses/${courseId}/${moduleEngName}/${category && category.category_id ? category.category_id : ''}`, name: moduleName },
{ name: `${ this.isEdit ? '编辑' : '新建'}` }
]}></CBreadcrumb>

@ -128,7 +128,7 @@ class commonWork extends Component{
}
//筛选条件
selectedStatus=(e)=>{
this.clearSelection()
this.setState({
order:e.key==="all"?"":e.key,
page:1,

@ -26,7 +26,7 @@ class ModalWrapper extends Component{
return(
<Modal
title={ title || "题库选用" }
title={ title }
visible={visible}
closable={false}
width={ width || "600px" }

@ -153,14 +153,14 @@ class Addcourses extends Component{
this.setState({
invite_codetype:true,
invite_codevalue:"邀请码不能为空",
spinning:false
isSpin:false
})
return
}else{
this.setState({
invite_codetype:false,
invite_codevalue:" ",
spinning:false
isSpin:false
})
}
@ -217,12 +217,12 @@ class Addcourses extends Component{
}
this.setState({
spinning:false
isSpin:false
})
}).catch((error) => {
console.log(error)
this.setState({
spinning:false
isSpin:false
})
})
@ -313,7 +313,7 @@ class Addcourses extends Component{
<li className="clearfix mb10">
<label className="panel-form-label fl">课堂邀请码</label>
<Input type="text" className="input-60-40 fl mt5" name="invite_code"
placeholder="请输入五位课堂邀请码"
placeholder="请输入5位课堂邀请码或6位分班邀请码"
style={{ height: '30px'}}
value={invite_code} onInput={this.inputjoinclassvalue}/>
</li>
@ -321,7 +321,7 @@ class Addcourses extends Component{
<p id="none_invite_code_notice"
className="color-orange none f12"
// style={{marginLeft: '90px',display:code_notice===true?'block':"none"}}
>请输入五位课堂邀请码</p>
>请输入5位课堂邀请码或6位分班邀请码</p>
<li className="clearfix ">

@ -341,7 +341,7 @@ class Selectresource extends Component{
>
{
Resourcelist === undefined ?Resourcelist.files.length===0?<NoneData/>:
Resourcelist === undefined ?"":Resourcelist.files.length===0?<NoneData/>:
<Checkbox.Group style={{ width: '100%' }} value={patheditarry} onChange={this.shixunhomeworkedit}>
{
@ -365,7 +365,7 @@ class Selectresource extends Component{
)
})
}
</Checkbox.Group>:""
</Checkbox.Group>
}
</div>

@ -1,7 +1,7 @@
import React,{ Component } from "react";
import { Modal,Checkbox,Select,Input,Upload,Button,Icon,message,DatePicker,Tooltip} from "antd";
import axios from'axios';
import {getUrl,handleDateString} from 'educoder';
import {getUrl,handleDateString,appendFileSizeToUploadFileAll} from 'educoder';
import locale from 'antd/lib/date-picker/locale/zh_CN';
import moment from 'moment';
import Modals from '../../modals/Modals';
@ -252,12 +252,12 @@ class Selectsetting extends Component{
let fileList = info.fileList;
if(info.file.status!="removed"){
this.setState({
fileList,
fileList: appendFileSizeToUploadFileAll(fileList),
fileListtype:true
});
}else{
this.setState({
fileList,
fileList: appendFileSizeToUploadFileAll(fileList),
});
}
@ -290,10 +290,10 @@ class Selectsetting extends Component{
// }
onAttachmentRemove = (id) => {
onAttachmentRemove = (file) => {
// const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
const url = `/attachments/${id}.json`
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, {
})
.then((response) => {
@ -319,6 +319,9 @@ class Selectsetting extends Component{
.catch(function (error) {
console.log(error);
});
this.setState({
fileListtype:false,
})
}
onChangeTimepublishs= (date, dateString,key) => {
@ -373,7 +376,7 @@ class Selectsetting extends Component{
width: 600,
// https://github.com/ant-design/ant-design/issues/15505
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
showUploadList: false,
// showUploadList: false,
action: `${getUrl()}/api/attachments.json`,
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
@ -591,36 +594,36 @@ class Selectsetting extends Component{
</Upload>
</p>
<style>
{
`
.maxwidth400{
max-width: 400px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
`
}
</style>
{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{
return(
<p className="color-grey mt10" key={key} >
<a className="color-grey fl">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<span className="mr12 color9B9B maxwidth400 fl" length="58">
{item.name}
</span>
<span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.response===undefined?"":isNaN(this.props.bytesToSize(item.response.filesize))?"123":this.props.bytesToSize(item.response.filesize)}
</span>
<i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id}
aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>
</p>
)
})}
{/*<style>*/}
{/*{*/}
{/*`*/}
{/*.maxwidth400{*/}
{/*max-width: 400px;*/}
{/*overflow: hidden;*/}
{/*text-overflow: ellipsis;*/}
{/*white-space: nowrap;*/}
{/*}*/}
{/*`*/}
{/*}*/}
{/*</style>*/}
{/*{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{*/}
{/*return(*/}
{/*<p className="color-grey mt10" key={key} >*/}
{/*<a className="color-grey fl">*/}
{/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/}
{/*</a>*/}
{/*<span className="mr12 color9B9B maxwidth400 fl" length="58">*/}
{/*{item.name}*/}
{/*</span>*/}
{/*<span className="color656565 mt2 color-grey-6 font-12 mr8">*/}
{/*{item.response===undefined?"":isNaN(bytesToSize(item.filesize))?"123":bytesToSize(item.filesize)}*/}
{/*</span>*/}
{/*<i className="font-14 iconfont icon-guanbi "*/}
{/*id={item.response===undefined?"":item.response.id}*/}
{/*aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>*/}
{/*</p>*/}
{/*)*/}
{/*})}*/}
{this.state.newfileListtypes===true?<p className={"color-red"}>请先上传资源</p>:""}
@ -632,12 +635,13 @@ class Selectsetting extends Component{
}
`}</style>
<Checkbox
checked={is_public}
onChange={this.onChangepublics}>
<span className={"font-14"}>勾选后所有用户可见否则仅课堂成员可见</span>
</Checkbox>
<div className={this.state.fileListtype===true?"mt30":""}>
<Checkbox
checked={is_public}
onChange={this.onChangepublics}>
<span className={"font-14"}>勾选后所有用户可见否则仅课堂成员可见</span>
</Checkbox>
</div>
{/*{this.props.has_course_groups&&this.props.has_course_groups===true?:""}*/}
{/*{this.state.course_groupss&&this.state.course_groupss.length>0?<Checkbox*/}
{/*checked={unified_setting}*/}

@ -2,7 +2,7 @@ import React,{ Component } from "react";
import { Modal,Checkbox,Upload,Button,Icon,message,DatePicker,Select,Tooltip} from "antd";
import axios from 'axios';
import Modals from '../../modals/Modals';
import {getUrl,handleDateString} from 'educoder';
import {getUrl,handleDateString,bytesToSize,appendFileSizeToUploadFileAll} from 'educoder';
import locale from 'antd/lib/date-picker/locale/zh_CN';
import moment from 'moment';
const CheckboxGroup = Checkbox.Group;
@ -85,12 +85,12 @@ class Sendresource extends Component{
let fileList = info.fileList;
if(info.file.status!="removed"){
this.setState({
fileList,
fileList: appendFileSizeToUploadFileAll(fileList),
fileListtype:true
});
}else{
this.setState({
fileList,
fileList: appendFileSizeToUploadFileAll(fileList),
});
}
}
@ -126,9 +126,9 @@ class Sendresource extends Component{
// }
onAttachmentRemove = (id) => {
onAttachmentRemove = (file) => {
const url = `/attachments/${id}.json`
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, {
})
.then((response) => {
@ -146,6 +146,9 @@ class Sendresource extends Component{
.catch(function (error) {
console.log(error);
});
this.setState({
fileListtype:false,
})
}
ModalCancelModalCancel=()=>{
@ -322,7 +325,7 @@ class Sendresource extends Component{
const uploadProps = {
width: 600,
showUploadList:false,
// showUploadList:false,
action: `${getUrl()}/api/attachments.json`,
onChange: this.handleChange,
onRemove: this.onAttachmentRemove,
@ -427,36 +430,37 @@ class Sendresource extends Component{
</Upload>
</p>
<style>
{
`
.maxwidth400{
max-width: 400px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
`
}
</style>
{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{
return(
<p className="color-grey mt10" key={key} >
<a className="color-grey fl">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<span className="mr12 color9B9B maxwidth400 fl" length="58">
{item.name}
</span>
<span className="color656565 mt2 color-grey-6 font-12 mr8">
{item.response===undefined?"":isNaN(this.props.bytesToSize(item.response.filesize))?"":this.props.bytesToSize(item.response.filesize)}
</span>
<i className="font-14 iconfont icon-guanbi "
id={item.response===undefined?"":item.response.id}
aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>
</p>
)
})}
{/*<style>*/}
{/*{*/}
{/*`*/}
{/*.maxwidth400{*/}
{/*max-width: 400px;*/}
{/*overflow: hidden;*/}
{/*text-overflow: ellipsis;*/}
{/*white-space: nowrap;*/}
{/*}*/}
{/*`*/}
{/*}*/}
{/*</style>*/}
{/*{this.state.fileList.length===0?"":this.state.fileList.map((item,key)=>{*/}
{/*debugger*/}
{/*return(*/}
{/*<p className="color-grey mt10" key={key} >*/}
{/*<a className="color-grey fl">*/}
{/*<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>*/}
{/*</a>*/}
{/*<span className="mr12 color9B9B maxwidth400 fl" length="58">*/}
{/*{item.name}*/}
{/*</span>*/}
{/*<span className="color656565 mt2 color-grey-6 font-12 mr8">*/}
{/*{item.response===undefined?"":isNaN(bytesToSize(item.filesize))?"":bytesToSize(item.filesize)}*/}
{/*</span>*/}
{/*<i className="font-14 iconfont icon-guanbi "*/}
{/*id={item.response===undefined?"":item.response.id}*/}
{/*aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.response===undefined?"":item.response.id&&item.response.id)}></i>*/}
{/*</p>*/}
{/*)*/}
{/*})}*/}
{newfileListtype===true?<p className={"color-red"}>请先上传资源</p>:""}
@ -468,7 +472,7 @@ class Sendresource extends Component{
}
`}</style>
<Checkbox checked={is_public} onChange={this.onChangepublic}>
<div className={this.state.fileListtype===true?"mt30":""}></div><Checkbox checked={is_public} onChange={this.onChangepublic}>
<span className={"font-14"}>勾选后所有用户可见否则仅课堂成员可见</span>
</Checkbox>

@ -18,9 +18,12 @@
color: #999999;
}
.appraise .panel-comment_item .t_info {
.appraise .panel-comment_item .t_info {
width: 1062px;
}
.appraise .panel-comment_item .childrenCommentsView .t_info {
width: 989px;
}
.course-message .panel-comment_item .comment_orig_content {
width: 980px;
}

@ -111,11 +111,11 @@ class GraduationTaskssettingapp extends Component{
max_nums: result.data.max_num,
task_type: result.data.task_type,
baseonproject: result.data.base_on_project,
publish_time:result.data.publish_time===null?"":moment(moment(handleDateString(result.data.publish_time))).format("YYYY-MM-DD HH:mm"),
end_time:result.data.end_time===null?"":moment(moment(handleDateString(result.data.end_time))).format("YYYY-MM-DD HH:mm"),
publish_time:result.data.publish_time===null||result.data.publish_time=== ""?"":moment(moment(handleDateString(result.data.publish_time))).format("YYYY-MM-DD HH:mm"),
end_time:result.data.end_time===null||result.data.end_time=== ""?"":moment(moment(handleDateString(result.data.end_time))).format("YYYY-MM-DD HH:mm"),
allowlate: result.data.allow_late,
latepenalty: result.data.late_penalty,
latetime:result.data.late_time===null?"":moment(moment(handleDateString(result.data.late_time))).format("YYYY-MM-DD HH:mm"),
latetime:result.data.late_time===null||result.data.late_time=== ""?"":moment(moment(handleDateString(result.data.late_time))).format("YYYY-MM-DD HH:mm"),
crosscomment: result.data.cross_comment,
taskid: result.data.id,
taskname: result.data.task_name,
@ -128,7 +128,7 @@ class GraduationTaskssettingapp extends Component{
hasproject: result.data.has_project,
hascommit: result.data.has_commit,
assigngroups: assigngroups,
commenttime:result.data.comment_time===null?"":moment(moment(handleDateString(result.data.comment_time))).format("YYYY-MM-DD HH:mm"),
commenttime:result.data.comment_time===null||result.data.comment_time=== ""?"":moment(moment(handleDateString(result.data.comment_time))).format("YYYY-MM-DD HH:mm"),
task_status: result.data.task_status
})
}
@ -288,12 +288,13 @@ class GraduationTaskssettingapp extends Component{
allowlatefun=(e)=>{
let {end_time}=this.state;
if(e.target.value===true||e.target.value===1){
this.setState({
latepenalty:5,
allowlate:e.target.value,
latetime:end_time===null?"":moment(moment(handleDateString(end_time))).add(1, 'months').format("YYYY-MM-DD HH:mm"),
latetime:end_time===null||end_time === ""?"":moment(moment(handleDateString(end_time))).add(1, 'months').format("YYYY-MM-DD HH:mm"),
})
}else{
this.setState({
@ -316,24 +317,24 @@ class GraduationTaskssettingapp extends Component{
})
}
updatesfuncrosscomment=(types,checked,newlatetime,newcommenttime)=>{
updatesfuncrosscomment=(types,newlatetime,newcommenttime)=>{
let {endtimetype}=this.state;
if(types===1){
this.setState({
latetime:newlatetime,
crosscomment:checked,
crosscomment:true,
commenttime:newcommenttime
})
}else{
if(endtimetype===true){
this.setState({
crosscomment:checked,
crosscomment:true,
commenttime:newcommenttime
})
}else{
this.setState({
end_time:newlatetime,
crosscomment:checked,
crosscomment:true,
commenttime:newcommenttime
})
}
@ -341,42 +342,41 @@ class GraduationTaskssettingapp extends Component{
}
funcrosscomment=(e)=>{
let {latetime,end_time,allowlate}=this.state;
let newlatetimea=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttimea=moment(new Date()).format("YYYY-MM-DD HH:mm");
let newlatetimes=moment(latetime).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttimes=moment(latetime).format("YYYY-MM-DD HH:mm");
let newend_timeb=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttimeb=moment(new Date()).add(8, 'days').format("YYYY-MM-DD HH:mm");
let newend_timed=moment(end_time).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttimed=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm");
let {latetime,end_time,allowlate}=this.state;
let newtime;
if(e.target.checked===true){
if(allowlate===1||allowlate===true){
if(latetime===null||latetime===""){
let newlatetime=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttime=moment(new Date()).format("YYYY-MM-DD HH:mm");
this.updatesfuncrosscomment=(1,e.target.checked,newlatetime,newcommenttime)
this.updatesfuncrosscomment(1,newlatetimea,newcommenttimea)
}else{
let newlatetime=moment(latetime).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttime=moment(latetime).format("YYYY-MM-DD HH:mm");
this.updatesfuncrosscomment=(1,e.target.checked,newlatetime,newcommenttime)
this.updatesfuncrosscomment(1,newlatetimes,newcommenttimes)
}
}else{
if(end_time===null||end_time===""){
let newend_time=moment(new Date()).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttime=moment(new Date()).add(8, 'days').format("YYYY-MM-DD HH:mm");
this.updatesfuncrosscomment=(2,e.target.checked,newend_time,newcommenttime)
this.updatesfuncrosscomment(2,newend_timeb,newcommenttimeb)
}else{
let newend_time=moment(end_time).add(7, 'days').format("YYYY-MM-DD HH:mm");
let newcommenttime=moment(end_time).add(8, 'days').format("YYYY-MM-DD HH:mm");
this.updatesfuncrosscomment=(2,e.target.checked,newend_time,newcommenttime)
this.updatesfuncrosscomment(2,newend_timed,newcommenttimed)
}
}
}else{
this.setState({
crosscomment:e.target.checked,
commenttime:undefined
})
}
}
funcommentstatus=(e)=>{
@ -406,7 +406,7 @@ class GraduationTaskssettingapp extends Component{
visibles:true,
Topval:"学生将立即收到毕设任务",
// Botvalleft:"点击修改",
Botval:`本操作只对"未发布"的分班有效`,
// Botval:`本操作只对"未发布"的分班有效`,
starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") ,
starttimes:this.props.getNowFormatDates(1),
typs:"start",
@ -700,10 +700,10 @@ class GraduationTaskssettingapp extends Component{
min_num: this.state.minnum,
max_num: this.state.maxnum,
base_on_project:baseonproject===true?1:0,
publish_time:this.state.publish_time===null?"":this.state.publish_time,
end_time: this.state.end_time===null?this.props.getNowFormatDates(2,1):this.state.end_time,
publish_time:this.state.publish_time===null||this.state.publish_time=== ""?"":this.state.publish_time,
end_time: this.state.end_time===null||this.state.end_time=== ""?this.props.getNowFormatDates(2,1):this.state.end_time,
allow_late:allowlate===true||allowlate===1?1:undefined,
late_time: this.state.latetime===null?this.props.getNowFormatDates(3,1):this.state.latetime,
late_time: this.state.latetime===null||this.state.latetime=== ""?this.props.getNowFormatDates(3,1):this.state.latetime,
late_penalty: latepenalty,
cross_comment: crosscomment===true?1:undefined,
comment_status: crosscomment===true?this.state.commentstatus===0?2:this.state.commentstatus===1?2:this.state.commentstatus:undefined,
@ -780,7 +780,7 @@ class GraduationTaskssettingapp extends Component{
visibles:true,
Topval:"学生将不能再提交作品",
// Botvalleft:"暂不截止",
Botval:`本操作只对"提交中"的分班有效`,
// Botval:`本操作只对"提交中"的分班有效`,
Cancelname:"暂不截止",
Savesname:"立即截止",
Cancel:this.cancelmodel,
@ -1273,7 +1273,7 @@ class GraduationTaskssettingapp extends Component{
placeholder="请选择发布时间"
id={"endTime"}
width={"210px"}
value={commenttime===null||commenttime===""?"":moment(commenttime, dateFormat)}
value={commenttime===null||commenttime=== ""?"":moment(commenttime, dateFormat)}
disabledTime={disabledDateTime}
onChange={this.onChangeTimecommenttime}
disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true}

@ -318,7 +318,7 @@ class GraduationTaskssettinglist extends Component{
visible:true,
Topval:"学生将不能再提交作品",
// Botvalleft:"暂不截止",
Botval:`本操作只对"提交中"的分班有效`,
// Botval:`本操作只对"提交中"的分班有效`,
Cancelname:"暂不截止",
Savesname:"立即截止",
Cancel:this.cancelmodel,
@ -337,7 +337,7 @@ class GraduationTaskssettinglist extends Component{
visible:true,
Topval:"学生将立即收到毕设任务",
// Botvalleft:"点击修改",
Botval:`本操作只对"未发布"的分班有效`,
// Botval:`本操作只对"未发布"的分班有效`,
starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") ,
starttimes:this.props.getNowFormatDates(1),
typs:"start",

@ -61,7 +61,7 @@ class GraduationTasksquestions extends Component{
visible:true,
Topval:"学生将不能再提交作品",
// Botvalleft:"暂不截止",
Botval:`本操作只对"提交中"的分班有效`,
// Botval:`本操作只对"提交中"的分班有效`,
Cancelname:"暂不截止",
Savesname:"立即截止",
Cancel:this.cancelmodel,
@ -80,7 +80,7 @@ class GraduationTasksquestions extends Component{
visible:true,
Topval:"学生将立即收到毕设任务",
// Botvalleft:"点击修改",
Botval:`本操作只对"未发布"的分班有效`,
// Botval:`本操作只对"未发布"的分班有效`,
starttime:moment(moment(new Date())).format("YYYY-MM-DD HH:mm") ,
starttimes:this.props.getNowFormatDates(1),
typs:"start",

@ -31,6 +31,8 @@ class ChooseGraduateTopicModal extends Component{
<ModalWrapper
ref="modalWrapper"
onOk={this.onOk}
title={ "题库选用" }
>
<React.Fragment>
<style>{`

@ -503,7 +503,7 @@ class studentsList extends Component{
<CreateGroupByImportModal ref="createGroupByImportModal" {...this.props}></CreateGroupByImportModal>
<WordsBtn style="blue" className="mr30" onClick={()=> this.refs['createGroupByImportModal'].setVisible(true)}>导入创建分班</WordsBtn>
</React.Fragment> }
{ isAdmin && isParent && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>新建分班</WordsBtn> }
{ isAdmin && isParent && <WordsBtn style="blue" className="mr30" onClick={()=>this.addDir()}>添加分班</WordsBtn> }
{ isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.deleteDir()}>删除分班</WordsBtn> }
{ isAdmin && !isParent && course_group_id != 0 && <WordsBtn style="blue" className="mr30" onClick={()=>this.renameDir()}>分班重命名</WordsBtn> }
{ isAdmin && <WordsBtn style="blue" className="" href={`/api/courses/${courseId}/export_member_scores_excel.xlsx`}>导出成绩</WordsBtn> }

@ -1,6 +1,6 @@
import React, {Component} from "react";
import {WordsBtn} from 'educoder';
import { Form, Select, Input, Button,Checkbox,Upload,Icon,message,Modal, Table, Divider,InputNumber, Tag,DatePicker,Radio,Tooltip} 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 axios from 'axios';
import ShixunCustomsPass from "./Shixunworkdetails/ShixunCustomsPass";
@ -17,22 +17,27 @@ class ShixunWorkDetails extends Component {
constructor(props) {
super(props);
this.state = {
data:undefined
data:undefined,
spinning:true
}
}
componentDidMount() {
this.setState({
spinning:true
})
let homeworkid=this.props.match.params.homeworkid;
let userid=this.props.match.params.userid;
let url = "/homework_commons/"+homeworkid+"/code_review_detail.json";
axios.get(url,{
axios.get(url,{
params: {
user_id:userid,
}
}).then((result) => {
if (result.status === 200) {
this.setState({
data:result.data
data:result.data,
spinning:false
})
}
}).catch((error) => {
@ -52,9 +57,10 @@ class ShixunWorkDetails extends Component {
render() {
let{data}=this.state;
console.log(data)
return (
data===undefined?"":<div className="newMain clearfix ">
<Spin size="large" spinning={this.state.spinning}>
{data===undefined? "":<div className="newMain clearfix ">
<div className={"educontent mb20"}>
<div className="educontent">
@ -100,8 +106,8 @@ class ShixunWorkDetails extends Component {
</div>
</div>
</div>}
</Spin>
)
}
}

@ -88,7 +88,7 @@ class ShixunWorkModal extends Component{
let {page,limit,group_list}=this.state;
let newpage=page+1;
let newgroup_list=group_list;
debugger
let url="/homework_commons/"+this.props.match.params.homeworkid+"/group_list.json";
axios.get(url,{params:{
@ -98,7 +98,7 @@ class ShixunWorkModal extends Component{
}).then((response) => {
if(response!==null || response!==undefined){
if(response.data.group_list.length>0){
console.log("84");
response.data.group_list.map((item,key)=>{
newgroup_list.push(item);
this.setState({
@ -112,8 +112,7 @@ class ShixunWorkModal extends Component{
if(response.data.ungroup_list===undefined || response.data.ungroup_list === null) {
}else {
console.log("95");
console.log(response.data.ungroup_list);
newgroup_list.push(response.data.ungroup_list);
this.setState({
course_groups:response.data,
@ -245,24 +244,23 @@ class ShixunWorkModal extends Component{
.fontlefts{text-align: left;}
`}</style>
<ul className="clearfix edu-txt-center">
<li className="fl paddingleft22 fontlefts" style={{width:'150px'}}>分班名称</li>
<li className="fl edu-txt-left" style={{width:'150px'}}>有效作品数</li>
<li className="fl paddingleft22 fontlefts" style={{width:'260px'}}>分班名称</li>
<li className="fl edu-txt-left" style={{width:'117px'}}>有效作品数</li>
<li className="fl" style={{width:'100px'}}>上次查重时间</li>
</ul>
{course_groups===undefined?"":
<ul className="upload_select_box fl clearfix mt10 mb10" tyle={{"overflow-y":"auto"}}id="search_not_members_list"
onScroll={this.contentViewScroll}
>
onScroll={this.contentViewScroll}
>
<Checkbox.Group style={{ width: '100%' }} onChange={this.shixunhomeworkedit} value={group_ids}>
{
group_list===undefined?
group_list===undefined?course_groups.ungroup_list.work_count===0?"":
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE">
<li className="fl" style={{width: '100px'}}>
<li className="fl task-hide" style={{width: '240px'}}>
<Checkbox
className="fl task-hide edu-txt-left"
name="shixun_homework[]"
@ -272,8 +270,8 @@ class ShixunWorkModal extends Component{
className="task-hide color-grey-name" title="frerere">{course_groups.ungroup_list.name}</label>
</Checkbox>
</li>
<li className="fl" style={{width: '150px'}}>
{course_groups.ungroup_list.works_count}
<li className="fl" style={{width: '100px'}}>
{course_groups.ungroup_list.work_count}
</li>
<li className="fl" style={{width: '160px'}}>
{course_groups.ungroup_list.last_review_time}
@ -283,8 +281,8 @@ class ShixunWorkModal extends Component{
:
group_list&&group_list.map((item,key)=>{
return(
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
<li className="fl" style={{width: '100px'}}>
item.work_count===0?"":<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
<li className="fl task-hide" style={{width: '240px'}}>
<Checkbox
className="fl task-hide edu-txt-left"
name="shixun_homework[]"
@ -294,8 +292,8 @@ class ShixunWorkModal extends Component{
className="task-hide color-grey-name" title="frerere">{item===undefined?"":item.name}</label>
</Checkbox>
</li>
<li className="fl" style={{width: '150px'}}>
{item===undefined?"":item.works_count}
<li className="fl" style={{width: '100px'}}>
{item===undefined?"":item.works_count===undefined?item.work_count:item.works_count}
</li>
<li className="fl" style={{width: '160px'}}>
{item===undefined?"":item.last_review_time}

@ -115,6 +115,7 @@ class LoginDialog extends Component {
let reg = /^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/;
let reg1 = /^1\d{10}$/;
let reg2=/^[a-zA-z]\w{3,14}$/;
// let reg3=/^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
let value=this.refs.loginPassText.value;
let valuenum= value.length;
if(valuenum>0){
@ -405,10 +406,10 @@ class LoginDialog extends Component {
ref="loginPassText"
onInput={this.loginChange}
name="username"
placeholder="手机号/邮箱号/用户名" ></input>
placeholder="请输入有效的手机号/邮箱号" ></input>
<div style={{height: '25px'}}><p className="color-orange edu-txt-left none" id="username_error_notice"
style={{display: regular==0?'none':'block'}}>请输入有效的手机号/邮箱号/用户名</p></div>
style={{display: regular==0?'none':'block'}}>请输入有效的手机号/邮箱号</p></div>
<div>
<input type="password" id="password_loggin_input"
@ -433,7 +434,7 @@ class LoginDialog extends Component {
<div className={disabled===false?"bluebutton edu-back-blue":"bluebutton"}
onClick={disabled===false?
this.loginEDU:""
this.loginEDU: () => {}
// console.log(1)
}
>

@ -7,7 +7,7 @@ export function loadSshScript(callback) {
prefix = ''
} else {
// _url_origin = `https://testeduplus2.educoder.net/`;
_url_origin = 'http://47.96.87.25:48080';
_url_origin = 'http://47.96.87.25:48080/';
}
const $ = window.$;
// 未加载过

@ -0,0 +1,23 @@
import React, { Component } from 'react';
import Cropper from '../../common/components/Cropper'
class TestCrop extends Component {
state = {
};
handleChange = (info) => {
}
render() {
const props = this.props;
return (
<div>
<Cropper></Cropper>
</div>
);
}
}
export default (TestCrop);

@ -2,6 +2,7 @@ import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
import MonacoTest from './monaco'
import TestCrop from './TestCrop'
import TestDragBeautiful from './dnd/TestDragBeautiful'
class TestIndex extends Component {
@ -17,6 +18,7 @@ class TestIndex extends Component {
<Switch {...this.props}>
<Route exact path="/test/monacoTest" component={MonacoTest}></Route>
<Route exact path="/test/testCrop" component={TestCrop}></Route>
<Route exact path="/test/dragBeautifulTest" component={TestDragBeautiful}></Route>
</Switch>

@ -819,12 +819,12 @@ submittojoinclass=(value)=>{
<li className="clearfix mb10">
<label className="panel-form-label fl">项目邀请码</label>
<Input type="text" className="input-60-40 fl" name="invite_code"
placeholder="请输入六位课堂邀请码" value={tojoinclasstitle} onInput={this.inputjoinclassvalue}/>
placeholder="请输入5位课堂邀请码或6位分班邀请码" value={tojoinclasstitle} onInput={this.inputjoinclassvalue}/>
</li>
<p id="none_invite_code_notice"
className="color-orange none f12"
style={{marginLeft: '90px',display:code_notice===true?'block':"none"}}>请输入六位课堂邀请码</p>
style={{marginLeft: '90px',display:code_notice===true?'block':"none"}}>请输入5位课堂邀请码或6位分班邀请码</p>
<li className="clearfix ">

@ -903,7 +903,7 @@ class TPMBanner extends Component {
</Spin>:
<div>
<div className="task-popup-content"><p
className="task-popup-text-center font-16 pb20">复制将在后台执行<br/>平台将为你创建一个新的同名实训和内容请问是否继续</p>
className="task-popup-text-center font-16 pb20">复制将在后台执行平台将为你创建<br/>一个新的同名实训和内容请问是否继续</p>
</div>
<div className="task-popup-submit clearfix">
<a onClick={this.hideForkvisible} className="task-btn fl">取消</a>

@ -38,6 +38,7 @@ body>.-task-title {
}
.ant-select-selection--multiple{
padding-bottom: 0px!important;
padding-top:3px;
}
/* 先注释掉下面2个样式这样写影响范围太广了并不是所有的select都需要40px高 */
/* .ant-select-selection--single{
@ -47,8 +48,10 @@ body>.-task-title {
line-height: 40px!important;
} */
.ant-select-selection--multiple .ant-select-selection__rendered>ul>li, .ant-select-selection--multiple>ul>li{
height: 30px!important;
line-height: 28px!important;
height: 25px!important;
line-height: 23px!important;
margin-bottom:3px;
margin-top:0px;
}
/*Main START*/
.newMain {

@ -1116,7 +1116,33 @@ export default class TPMsettings extends Component {
})
}
inputs=()=>{
setConfigsInputs=(e,keys,str)=>{
let {shixun_service_configs}=this.state;
let newshixun_service_configs=shixun_service_configs;
newshixun_service_configs.map((item,key)=>{
if(key===keys){
switch (str) {
case 1:
item.cpu_limit=e.target.value
break;
case 2:
item.lower_cpu_limit=e.target.value
break;
case 3:
item.memory_limit=e.target.value
break;
case 4:
item.request_limit=e.target.value
break;
}
}
})
this.setState({
shixun_service_configs:newshixun_service_configs,
shixun_service_configlist:newshixun_service_configs,
})
}
@ -1356,7 +1382,7 @@ export default class TPMsettings extends Component {
<div className="width15 fl pr mr20" onMouseLeave={operateauthority?this.bigopens:""}>
<Select mode="multiple" placeholder="请选择小类别"
value={choice_small_type.length===0||choice_small_type[0]===""||choice_small_type===[]?undefined:choice_small_type}
style={{width: 180}}
style={{width: 180,height:30}}
disabled={operateauthority?false:true}
// onChange={operateauthority?this.littleClass:""}
onDeselect={operateauthority?this.Deselectlittle:""}
@ -1440,9 +1466,43 @@ export default class TPMsettings extends Component {
{
this.props.identity<5||this.props.power==true?
<a onClick={this.showModal} id="define_template"
className="color-orange-tip ml20 mt5 fl">使用自定义脚本</a> : ""
className="color-orange-tip ml20 mt1 fl">使用自定义脚本</a> : ""
}
<div className="ml6 fl pr"
style={{display:operateauthority?'block':"none"}}
>
<a onClick={()=>this.testscripttip(0)}><img
src={getImageUrl("images/educoder/problem.png") }/></a>
<div className="invite-tip clearfix none " id="test_script_tip"
style={{top: '33px', right: '-6px',width: '271px',zIndex: '10',display: testscripttiptype===true?'block':"none"}}>
<span className="top-black-trangle"></span>
<div className="padding20 invitecontent clearfix">
<p className="font-12 edu-txt-left">
使用自定义模板平台无法自动更新脚本<br/>
请在关卡创建完后手动更新脚本中的必填参<br/>
数和以下2个数组元素<br/>
challengeProgramNames<br/>
sourceClassNames<br/><br/>
示例有2个关卡的实训<br/><br/>
各关卡的待编译文件为<br/>
src/step1/HelloWorld.java<br/>
src/step2/Other.java<br/><br/>
各关卡的编译后生成的执行文件为<br/>
step1.HelloWorld<br/>
step2.Other<br/><br/>
则数组元素更新如下<br/>
challengeProgramNames=("src/step1/<br/>
HelloWorld.java" "src/step2/Other.java")<br/>
sourceClassNames=("step1.HelloWorld<br/>
" "step2.Other")<br/><br/>
其它参数可按实际需求定制
</p>
</div>
<p className="inviteTipbtn with100 fl">
<a onClick={()=>this.testscripttip(1)}>知道了</a>
</p>
</div>
</div>
<Modal
keyboard={false}
@ -1519,41 +1579,7 @@ export default class TPMsettings extends Component {
{/*</div>*/}
<div className="ml6 fl pr"
style={{display:operateauthority?'block':"none"}}
>
<a onClick={()=>this.testscripttip(0)}><img
src={getImageUrl("images/educoder/problem.png") }/></a>
<div className="invite-tip clearfix none " id="test_script_tip"
style={{top: '33px', right: '-6px',width: '271px',zIndex: '10',display: testscripttiptype===true?'block':"none"}}>
<span className="top-black-trangle"></span>
<div className="padding20 invitecontent clearfix">
<p className="font-12 edu-txt-left">
使用自定义模板平台无法自动更新脚本<br/>
请在关卡创建完后手动更新脚本中的必填参<br/>
数和以下2个数组元素<br/>
challengeProgramNames<br/>
sourceClassNames<br/><br/>
示例有2个关卡的实训<br/><br/>
各关卡的待编译文件为<br/>
src/step1/HelloWorld.java<br/>
src/step2/Other.java<br/><br/>
各关卡的编译后生成的执行文件为<br/>
step1.HelloWorld<br/>
step2.Other<br/><br/>
则数组元素更新如下<br/>
challengeProgramNames=("src/step1/<br/>
HelloWorld.java" "src/step2/Other.java")<br/>
sourceClassNames=("step1.HelloWorld<br/>
" "step2.Other")<br/><br/>
其它参数可按实际需求定制
</p>
</div>
<p className="inviteTipbtn with100 fl">
<a onClick={()=>this.testscripttip(1)}>知道了</a>
</p>
</div>
</div>
</div>
</div>
@ -1792,24 +1818,25 @@ export default class TPMsettings extends Component {
<label style={{top:'6px'}} className="color-grey-9 ml10" >为空则学员在实训发布后能随时开启实训挑战否则学员在开启时间后才能开启实训挑战</label>
</span>
</div>
<div className="clearfix mt20 ml30">
{this.props.identity<3?<div className="clearfix mt20 ml30">
<span className="color-grey-6 mt5 fl" style={{minWidth: '95px'}}>VNC图形化:</span>
<span className="fl mt5">
<Checkbox checked={vnc === undefined ? false : vnc} onChange={this.shixun_vnc}></Checkbox>
<label style={{top:'6px'}} className="color-grey-9 ml10" >勾选则给学员的实践任务提供Ubuntu系统图形化实践窗口否则不提供</label>
</span>
</div>
</div>:""}
</div>
</div>
{/*"name": "我是镜像名", # 镜像名称*/}
{/*"cpu_limit": 1, # cpu核*/}
{/*"lower_cpu_limit": 0.1, # 最低cpu核 浮点数*/}
{/*"memory_limit": 1024 ,#内存限制*/}
{/*"request_limit": 10, # 内存要求*/}
{/*"mirror_repository_id": 12, # 镜像id*/}
<div className="edu-back-white padding40-20 mb20">
{this.props.identity<3?<div className="edu-back-white padding40-20 mb20">
<p className="color-grey-6 font-16 mb30">服务配置</p>
{this.props.identity<2?shixun_service_configs&&shixun_service_configs.map((item,key)=>{
{ shixun_service_configs&&shixun_service_configs.map((item,key)=>{
return(
<div key={key}>
<div id="5">
@ -1817,7 +1844,7 @@ export default class TPMsettings extends Component {
<div className="clearfix mb5">
<label className="panel-form-label fl">CPU()</label>
<div className="pr fl with80 status_con">
<input type="text" name="cpu_limit[]" value={item.cpu_limit} onInput={this.inputs}
<input type="text" value={item.cpu_limit} onInput={(e)=>this.setConfigsInputs(e,key,1)}
className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
</div>
<div className="cl"></div>
@ -1825,7 +1852,7 @@ export default class TPMsettings extends Component {
<div className="clearfix mb5">
<label className="panel-form-label fl">最低CPU()</label>
<div className="pr fl with80 status_con">
<input type="text" name="lower_cpu_limit[]" value={item.lower_cpu_limit} onInput={this.inputs}
<input type="text" value={item.lower_cpu_limit} onInput={(e)=>this.setConfigsInputs(e,key,2)}
className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
</div>
<div className="cl"></div>
@ -1833,7 +1860,7 @@ export default class TPMsettings extends Component {
<div className="clearfix mb5">
<label className="panel-form-label fl">内存限制(M)</label>
<div className="pr fl with80 status_con">
<input type="text" name="memory_limit[]" value={item.memory_limit} onInput={this.inputs}
<input type="text" value={item.memory_limit} onInput={(e)=>this.setConfigsInputs(e,key,3)}
className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
</div>
<div className="cl"></div>
@ -1841,7 +1868,7 @@ export default class TPMsettings extends Component {
<div className="clearfix mb5">
<label className="panel-form-label fl">内存要求(M)</label>
<div className="pr fl with20 status_con">
<input type="text" name="request_limit[]" value={item.request_limit} onInput={this.inputs}
<input type="text" value={item.request_limit} onInput={(e)=>this.setConfigsInputs(e,key,4)}
className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" />
</div>
<label className="panel-form-label fl" style={{width: '48%'}}>温馨提示纯编程类型实训建议使用默认值对于大数据等建议使用最大内存的30%</label>
@ -1851,8 +1878,8 @@ export default class TPMsettings extends Component {
</div>
)
}) :""}
</div>
})}
</div> :""}
<p>
{

@ -225,7 +225,7 @@ export default class TPManswer extends Component {
}
}
this.setState({
answer:response.data.answer,
answer:response.data.answer,
power: response.data.power,
choice_url: newchoice_url, // 导航中的新建选择题url
practice_url: newpractice_url, //string 导航中新建实践题url

Loading…
Cancel
Save