dev_aliyun_beta
caicai8 6 years ago
parent e2fb524f23
commit 245569cabe

@ -1,7 +1,7 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {Link} from 'react-router-dom' import {Link} from 'react-router-dom'
const map={"blue":"blueFull","greyBack":"greyBack","grey":"greyWidthFixed","green":"greenBack",'greyLine':"greyLine", const map={"blue":"blueFull","greyBack":"greyBack","grey":"greyWidthFixed","green":"greenBack",'greyLine':"greyLine",'orangeLine':"orangeLine",
'colorBlue': 'colorBlue', // 蓝字白底 'colorBlue': 'colorBlue', // 蓝字白底
} }
class ActionBtn extends Component { class ActionBtn extends Component {

@ -275,7 +275,7 @@ class BoardsNew extends Component{
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -594,7 +594,7 @@ render(){
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -335,7 +335,7 @@ class NewWork extends Component{
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },
@ -354,7 +354,7 @@ class NewWork extends Component{
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -256,7 +256,7 @@ class AccessoryModal extends Component{
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -178,7 +178,7 @@ class AccessoryModal2 extends Component{
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -389,7 +389,7 @@ class Selectsetting extends Component{
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -338,7 +338,7 @@ debugger
// console.log('beforeUpload', file.name); // console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -708,7 +708,14 @@ a.white-btn.use_scope-btn:hover{
color: #999!important; color: #999!important;
padding:0px 10px; padding:0px 10px;
} }
.orangeLine{
background: #fff;
border:1px solid #FE944B;
color: #FE944B!important;
padding:0px 10px;
line-height: 28px;
border-radius: 4px;
}
.colorFF6800{ .colorFF6800{
color:#FF6800; color:#FF6800;

@ -520,7 +520,7 @@ class GraduationTasksSubmitedit extends Component{
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -538,7 +538,7 @@ render(){
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -169,7 +169,7 @@ class GraduationTasksappraiseMainEditor extends Component{
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -294,7 +294,7 @@ class GraduationTasksedit extends Component{
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -57,24 +57,22 @@ class GraduationTasksnew extends Component {
} }
// if (GraduationTasksnewtype === true) { // if (GraduationTasksnewtype === true) {
this.props.form.validateFields((err, values) => { this.props.form.validateFields((err, values) => {
if (values.tasktype === undefined) {
this.ifHasAnchorJustScorll("tasktypes");
return
}
if (values.name === undefined) {
this.ifHasAnchorJustScorll("nametypes");
return
}
if (values.description === undefined) {
this.ifHasAnchorJustScorll("descriptiontypes");
return
}else if (values.description.length > 5000) {
this.ifHasAnchorJustScorll("descriptiontypes");
return
}
if (!err) { if (!err) {
if (values.tasktype === undefined) {
this.scrollToAnchors("tasktypes");
return
}
if (values.name === undefined) {
this.scrollToAnchors("nametypes");
return
}
if (values.description === undefined) {
this.scrollToAnchors("descriptiontypes");
return
} else if (values.description.length > 5000) {
this.scrollToAnchors("descriptiontypes");
return
}
// console.log('Received values of form: ', values); // console.log('Received values of form: ', values);
// console.log(fileList); // console.log(fileList);
const course_id = this.props.match.params.coursesId; const course_id = this.props.match.params.coursesId;
@ -129,14 +127,16 @@ class GraduationTasksnew extends Component {
} }
// 附件相关 START // 附件相关 START
handleChange = (info) => { handleChange = (info) => {
let fileList = info.fileList; if(info.file.status == "done" || info.file.status == "uploading"){
let fileList = info.fileList;
// for(var list of fileList ){
// console.log(list) // for(var list of fileList ){
// } // console.log(list)
this.setState({ // }
fileList: appendFileSizeToUploadFileAll(fileList), this.setState({
}); fileList: appendFileSizeToUploadFileAll(fileList),
});
}
} }
// onAttachmentRemove = (file) => { // onAttachmentRemove = (file) => {
@ -271,7 +271,7 @@ class GraduationTasksnew extends Component {
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -310,7 +310,7 @@ class GraduateTopicNew extends Component{
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -249,7 +249,7 @@ class GraduateTopicPostWorksNew extends Component{
console.log('beforeUpload', file.name); console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
message.error('文件大小必须小于150MB!'); this.props.showNotification('文件大小必须小于150MB!');
} }
return isLt150M; return isLt150M;
}, },

@ -273,7 +273,7 @@ class CaseNew extends Component{
beforeUpload: (file) => { beforeUpload: (file) => {
const isLt150M = file.size / 1024 / 1024 < 150; const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) { if (!isLt150M) {
//message.error('文件大小必须小于150MB!'); //this.props.showNotification('文件大小必须小于150MB!');
this.props.define({ this.props.define({
title:'提示', title:'提示',
content:"该文件无法上传。超过文件大小限制(150MB),建议上传到百度云等其它共享工具里然后再txt文档里给出链接以及共享密码并上传" content:"该文件无法上传。超过文件大小限制(150MB),建议上传到百度云等其它共享工具里然后再txt文档里给出链接以及共享密码并上传"
@ -377,6 +377,7 @@ class CaseNew extends Component{
<ul className="fl libraries_tab"> <ul className="fl libraries_tab">
<li className={ casesTags.indexOf(1) > -1 ? "active" :"" } onClick={()=>this.changeType(1)}>获奖案例</li> <li className={ casesTags.indexOf(1) > -1 ? "active" :"" } onClick={()=>this.changeType(1)}>获奖案例</li>
<li className={ casesTags.indexOf(2) > -1 ? "active" :"" } onClick={()=>this.changeType(2)}>入库案例</li> <li className={ casesTags.indexOf(2) > -1 ? "active" :"" } onClick={()=>this.changeType(2)}>入库案例</li>
<li className={ casesTags.indexOf(3) > -1 ? "active" :"" } onClick={()=>this.changeType(3)}>企业案例</li>
</ul> </ul>
{ {
checkTag && <div class="ant-form-explain">请选择标签</div> checkTag && <div class="ant-form-explain">请选择标签</div>

@ -14,7 +14,17 @@ class CaseTags extends Component{
{ {
tags && tags.map((item,key)=>{ tags && tags.map((item,key)=>{
return( return(
<span key={key} className={item.name == "获奖案例" ? "edu-filter-btn fl cdefault edu-activity-red ml10" : "edu-filter-btn fl cdefault edu-activity-blue ml10"}>{item.name}</span> <React.Fragment>
{
item.name == "获奖案例" ?
<span key={key} className="edu-filter-btn fl cdefault edu-activity-red ml10">{item.name}</span>
:
item.name == "入库案例" ?
<span key={key} className="edu-filter-btn fl cdefault edu-activity-blue ml10">{item.name}</span>
:
<span key={key} className="edu-filter-btn fl cdefault edu-activity-orange-sub ml10">{item.name}</span>
}
</React.Fragment>
) )
}) })
} }

@ -62,6 +62,13 @@
border: 1px solid #4CACFF; border: 1px solid #4CACFF;
line-height: 17px; line-height: 17px;
} }
.edu-activity-orange-sub {
background-color: #FF781B;
color: #fff!important;
cursor: pointer;
border: 1px solid #ff6800;
line-height: 17px;
}
.pointsBtn { .pointsBtn {
width: 70px; width: 70px;

@ -913,7 +913,7 @@ class Newshixuns extends Component {
// // console.log('beforeUpload', file.name); // // console.log('beforeUpload', file.name);
// const isLt50M = file.size / 1024 / 1024 < 50; // const isLt50M = file.size / 1024 / 1024 < 50;
// if (!isLt50M) { // if (!isLt50M) {
// message.error('文件大小必须小于150MB!'); // this.props.showNotification('文件大小必须小于150MB!');
// } // }
// return isLt50M; // return isLt50M;
// }, // },

@ -13,6 +13,7 @@ import axios from 'axios';
import { trace, trace_collapse ,getImageUrl, toPath} from "educoder"; import { trace, trace_collapse ,getImageUrl, toPath} from "educoder";
import RepositoryDirectories from './RepositoryDirectories' import RepositoryDirectories from './RepositoryDirectories'
import RepositoryAddFile from './RepositoryAddFile'
const $ = window.$; const $ = window.$;
// 点击按钮复制功能 // 点击按钮复制功能
@ -82,10 +83,10 @@ class Repository extends Component {
<a href="/forums/2784" target="_blank" <a href="/forums/2784" target="_blank"
className=" guideBtn" >Git使用指南</a> className=" guideBtn" >Git使用指南</a>
{/* <RepositoryAddFile {...this.props} {...this.state}></RepositoryAddFile> */}
<div className="fr font-12 color-grey-9 pr"> <div className="fr font-12 color-grey-9 pr">
<label className="fl">网址克隆</label> <label className="fl mt2">网址克隆</label>
<input type="text" id="copy_rep_content" className="fl url-input" <input type="text" id="copy_rep_content" className="fl url-input mt2"
defaultValue={ git_url } style={{width: 313}}/> defaultValue={ git_url } style={{width: 313}}/>
<a onClick={() => { <a onClick={() => {
jsCopy() jsCopy()

@ -0,0 +1,52 @@
import React, { Component } from 'react';
import { ActionBtn } from 'educoder'
import { Form , Modal } from 'antd'
class RepositoryAddFile extends Component {
constructor(props) {
super(props);
this.state={
visible:false
}
}
addFile = () =>{
this.setState({
visible:true
})
}
cancelAdd = () =>{
this.setState({
visible:false
})
}
render(){
let { visible } = this.state
return(
<React.Fragment>
<ActionBtn style="orangeLine" className="ml20" onClick={this.addFile}>+添加文件</ActionBtn>
<Modal
className={"RepositioryModal"}
title={'添加文件'}
visible={visible}
closable={false}
footer={null}
destroyOnClose={true}
width="550px"
>
<div className="task-popup-content">
</div>
<div className="clearfix mt30 edu-txt-center mb10">
<a className="task-btn color-white mr30" onClick={this.cancelAdd}>取消</a>
<a className="task-btn task-btn-orange">提交</a>
</div>
</Modal>
</React.Fragment>
)
}
}
const WrappedRepositoryAddFile = Form.create({name: 'taskRepositoryAddFile'})(RepositoryAddFile);
// RouteHOC()
export default (WrappedRepositoryAddFile);
Loading…
Cancel
Save