caishi 5 years ago
commit 9946062dbe

File diff suppressed because one or more lines are too long

@ -1379,7 +1379,7 @@ class Listofworks extends Component {
// console.log(course_group_info)
// console.log(JSON.stringify(this.props));
return (
<div className=" clearfix " style={{margin: "auto" ,paddingBottom: "235px", minWidth:"1200px"}}>
<div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}>
{visible === true ? <ModulationModal
visible={visible}
Cancel={this.cancelModulationModel}

@ -854,7 +854,7 @@ class Listofworksstudentone extends Component {
return (
teacherdata === undefined || teacherdata.student_works === undefined || teacherdata.student_works === null || JSON.stringify(teacherdata.student_works) === "[]" ?
// 学生不能查看别人的
<div className=" clearfix " style={{margin: "auto" ,paddingBottom: "235px", minWidth:"1200px"}}>
<div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}>
<style>
{`
.startbox{
@ -1037,7 +1037,7 @@ class Listofworksstudentone extends Component {
</div>
:
// 学生能查看别人的
<div className="newMain clearfix ">
<div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}>
{visibles === true ?
<TraineetraininginformationModal
homeworkid={this.props.match.params.homeworkid}

@ -589,7 +589,7 @@ class ShixunStudentWork extends Component {
}
return (
<div className=" clearfix " style={{margin: "auto" ,paddingBottom: "235px", minWidth:"1200px"}}>
<div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}>
{this.state.showmodel===true?<ShixunWorkModal
{...this.props}
visible={this.state.showmodel}

@ -1756,7 +1756,7 @@ class Trainingjobsetting extends Component {
// console.log(this.props.isAdmin())
// console.log(this.state.code_review===false)
return (
<div className=" clearfix " ref='targetElementTrainingjobsetting' style={{margin: "auto" ,paddingBottom: "235px", minWidth:"1200px"}}>
<div className=" clearfix " ref='targetElementTrainingjobsetting' style={{margin: "auto", minWidth:"1200px"}}>
{this.state.showmodel===true?<ShixunWorkModal
{...this.props}
visible={this.state.showmodel}

@ -370,7 +370,7 @@ class Workquestionandanswer extends Component {
return (
<div className=" clearfix " style={{margin: "auto" ,paddingBottom: "235px", minWidth:"1200px"}}>
<div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}>
{this.state.showmodel === true ? <ShixunWorkModal
{...this.props}
visible={this.state.showmodel}

@ -39,11 +39,27 @@ class ChangeHeaderPicModal extends Component{
URL.revokeObjectURL(uploadedImageURL);
}
const image = document.getElementById( imageId );
image.src = uploadedImageURL = URL.createObjectURL(file);
that.refs['cropper'].renew(image)
// cropper.destroy();
// cropper = new Cropper(image, options);
inputImage.value = null;
// base64
var reader = new FileReader();
reader.readAsBinaryString(file);
reader.onload = () => {
let base64_content = btoa(reader.result);
console.log();
image.src = `data:${file.type};base64,${base64_content}` // uploadedImageURL = URL.createObjectURL(file);
that.fileUploaded = true;
that.refs['cropper'].renew(image)
// cropper.destroy();
// cropper = new Cropper(image, options);
inputImage.value = null;
};
reader.onerror = function() {
console.log('there are some problems');
};
} else {
this.props.showNotification && this.props.showNotification("请选择一个图片格式的文件")
// window.alert('Please choose an image file.');
@ -57,6 +73,8 @@ class ChangeHeaderPicModal extends Component{
this.refs['modalWrapper'].setVisible(visible)
if (visible) {
this.fileUploaded = false;
setTimeout(() => {
this.init()
}, 500)
@ -69,7 +87,12 @@ class ChangeHeaderPicModal extends Component{
}
onOk = () => {
var img_lg = document.getElementById(previewId);
if (this.fileUploaded != true) {
this.props.showNotification("请先上传图片")
return;
}
var img_lg = document.getElementById(previewId);
// https://github.com/niklasvh/html2canvas/issues/1908
// 截图小的显示框内的内容
window.html2canvas(img_lg).then((canvas) => {
var dataUrl = canvas.toDataURL("image/jpeg");

Loading…
Cancel
Save