Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_aliyun_beta
jingquan huang 6 years ago
commit 3912356d61

@ -1100,13 +1100,19 @@ class CoursesController < ApplicationController
def export_member_act_score
search = params[:search] ? "#{params[:search].strip}" : "" #用户名或学生学号id搜索
group_id = params[:group_id] #分班的班级id
@all_members = student_act_score group_id, search
@all_members = @course.students
@all_members = @all_members.where(course_group_id: group_id) unless group_id.blank?
unless search.blank?
@all_members = @all_members.joins(user: [:user_extension]).where('concat(users.lastname, users.firstname) like ? or user_extensions.student_id like ?',"%#{search}%","%#{search}%")
end
if @all_members.size == 0
normal_status(-1,"课堂暂时没有学生")
elsif params[:export].present? && params[:export]
normal_status(0,"正在下载中")
else
set_export_cookies
@all_members = student_act_score group_id, search
act_score_to_xlsx(@all_members)
filename_ = "#{current_user.real_name}_#{@course.name}_活跃度_#{Time.now.strftime('%Y%m%d_%H%M%S')}"
render xlsx: "#{format_sheet_name filename_.strip}",template: "courses/export_member_act_score.xlsx.axlsx",

@ -1,7 +1,7 @@
import React, { Component } from 'react';
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', // 蓝字白底
}
class ActionBtn extends Component {

@ -822,9 +822,7 @@ class Fileslists extends Component{
max-height:350px;
overflow-y: auto;
}
.drop_down_menu li {
overflow: visible;
}
.courseSecond{
margin-left: 10px;
padding: 10px;

@ -186,6 +186,7 @@ class BoardsNew extends Component{
});
}
onAttachmentRemove = (file) => {
if(file.response!=undefined){
confirm({
// title: '确定要删除这个附件吗?',
title: '是否确认删除?',
@ -204,6 +205,8 @@ class BoardsNew extends Component{
return false;
}
}
deleteAttachment = (file) => {
// 初次上传不能直接取uid
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
@ -275,7 +278,7 @@ class BoardsNew extends Component{
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
message.error('文件大小必须小于150MB!');
this.props.showNotification('文件大小必须小于150MB!');
}
return isLt150M;
},

@ -320,10 +320,13 @@ class CommonWorkPost extends Component{
// ModalSave: ()=>this.deleteAttachment(file),
// ModalCancel:this.cancelAttachment
// })
if(file.response!=undefined){
this.deleteAttachment(file)
return false;
}
}
cancelAttachment=()=>{
this.setState({
Modalstype:false,
@ -594,7 +597,7 @@ render(){
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
message.error('文件大小必须小于150MB!');
this.props.showNotification('文件大小必须小于150MB!');
}
return isLt150M;
},

@ -243,6 +243,7 @@ class NewWork extends Component{
}
onAttachmentRemove = (file, stateName) => {
if(file.response!=undefined){
this.props.confirm({
content: '是否确认删除?',
@ -257,6 +258,8 @@ class NewWork extends Component{
return false;
}
}
deleteAttachment = (file, stateName) => {
// 初次上传不能直接取uid
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
@ -335,7 +338,7 @@ class NewWork extends Component{
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
message.error('文件大小必须小于150MB!');
this.props.showNotification('文件大小必须小于150MB!');
}
return isLt150M;
},
@ -354,7 +357,7 @@ class NewWork extends Component{
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
message.error('文件大小必须小于150MB!');
this.props.showNotification('文件大小必须小于150MB!');
}
return isLt150M;
},

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

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

@ -296,8 +296,7 @@ class Selectsetting extends Component{
onAttachmentRemove = (file) => {
// const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
if(file.response!=undefined){
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, {
})
@ -327,6 +326,14 @@ class Selectsetting extends Component{
this.setState({
fileListtype:false,
})
}else{
this.setState({
fileListtype:false,
fileList:[]
})
}
// const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
}
onChangeTimepublishs= (date, dateString,key) => {
@ -389,7 +396,7 @@ class Selectsetting extends Component{
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
message.error('文件大小必须小于150MB!');
this.props.showNotification('文件大小必须小于150MB!');
}
return isLt150M;
},

@ -132,7 +132,7 @@ class Sendresource extends Component{
onAttachmentRemove = (file) => {
debugger
if(file.response!=undefined){
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, {
})
@ -154,6 +154,12 @@ debugger
this.setState({
fileListtype:false,
})
}else{
this.setState({
fileListtype:false,
fileList:[]
})
}
}
ModalCancelModalCancel=()=>{
@ -338,7 +344,7 @@ debugger
// console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
message.error('文件大小必须小于150MB!');
this.props.showNotification('文件大小必须小于150MB!');
}
return isLt150M;
},

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

@ -332,17 +332,17 @@ class Testpapersettinghomepage extends Component{
<div className="fl task_menu_ul">
{this.props.isAdmin()===true?
<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item key="0">答题列表</Menu.Item>
<Menu.Item key="1">统计结果</Menu.Item>
<Menu.Item key="2">试卷预览</Menu.Item>
<Menu.Item key="3">设置</Menu.Item>
<Menu.Item key="0" className={"exercisesafonts"}>答题列表</Menu.Item>
<Menu.Item key="1" className={"exercisesafonts"}>统计结果</Menu.Item>
<Menu.Item key="2" className={"exercisesafonts"}>试卷预览</Menu.Item>
<Menu.Item key="3" className={"exercisesafonts"}>设置</Menu.Item>
</Menu>
:
<Menu mode="horizontal" selectedKeys={tab} onClick={this.changeTab}>
<Menu.Item key="0">答题列表</Menu.Item>
<Menu.Item key="0" className={"exercisesafonts"}>答题列表</Menu.Item>
{Commonheadofthetestpaper&&Commonheadofthetestpaper.show_statistic===true?
<Menu.Item key="1">统计结果</Menu.Item>:""}
<Menu.Item key="3">设置</Menu.Item>
<Menu.Item key="1" className={"exercisesafonts"}>统计结果</Menu.Item>:""}
<Menu.Item key="3" className={"exercisesafonts"}>设置</Menu.Item>
</Menu>
}
</div>
@ -370,7 +370,7 @@ class Testpapersettinghomepage extends Component{
padding-top: 10px;
padding-bottom: 8px;
}
a:hover {
.exercisesafonts:hover {
color:#1A0B00 !important;
}
`}

@ -157,6 +157,7 @@ class GraduationTasksSubmitedit extends Component{
}
onAttachmentRemove = (file) => {
if(file.response!=undefined){
let {attachments,fileList}=this.state;
const url = `/attachments/${file}.json`
axios.delete(url, {
@ -202,6 +203,8 @@ class GraduationTasksSubmitedit extends Component{
});
}
}
inputSearchValue=(e)=>{
if(e.target.value===""){
@ -520,7 +523,7 @@ class GraduationTasksSubmitedit extends Component{
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
message.error('文件大小必须小于150MB!');
this.props.showNotification('文件大小必须小于150MB!');
}
return isLt150M;
},

@ -146,7 +146,7 @@ class GraduationTasksSubmitnew extends Component{
// },
// });
// return false;
if(file.response!=undefined){
this.setState({
Modalstype:true,
Modalstopval:'确定要删除这个附件吗?',
@ -156,6 +156,8 @@ class GraduationTasksSubmitnew extends Component{
return false;
}
}
cancelAttachment=()=>{
this.setState({
Modalstype:false,
@ -538,7 +540,7 @@ render(){
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
message.error('文件大小必须小于150MB!');
this.props.showNotification('文件大小必须小于150MB!');
}
return isLt150M;
},

@ -88,6 +88,7 @@ class GraduationTasksappraiseMainEditor extends Component{
this.setState({ fileList });
}
onAttachmentRemove = (file, stateName) => {
if(file.response!=undefined){
this.props.confirm({
content: '确定要删除这个附件吗?',
okText: '确定',
@ -104,6 +105,8 @@ class GraduationTasksappraiseMainEditor extends Component{
return false;
}
}
deleteAttachment = (file, stateName) => {
// 初次上传不能直接取uid
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
@ -169,7 +172,7 @@ class GraduationTasksappraiseMainEditor extends Component{
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
message.error('文件大小必须小于150MB!');
this.props.showNotification('文件大小必须小于150MB!');
}
return isLt150M;
},

@ -103,6 +103,7 @@ class GraduationTasksedit extends Component{
}
// 附件相关 START
handleChange = (info) => {
if(info.file.status == "done" || info.file.status == "uploading"){
let fileList = info.fileList;
// console.log(fileList)
// for(var list of fileList ){
@ -112,6 +113,7 @@ class GraduationTasksedit extends Component{
fileList: appendFileSizeToUploadFileAll(fileList),
});
}
}
// onAttachmentRemove = (file) => {
// // confirm({
@ -148,6 +150,7 @@ class GraduationTasksedit extends Component{
}
onAttachmentRemove = (file) => {
if(file.response!=undefined){
// debugger
this.cancelAttachment();
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
@ -183,6 +186,8 @@ class GraduationTasksedit extends Component{
});
}
}
Commoninterface=(fileList)=>{
let listid=[]
let graduation_id=this.state.data.graduation_id;
@ -294,7 +299,7 @@ class GraduationTasksedit extends Component{
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
message.error('文件大小必须小于150MB!');
this.props.showNotification('文件大小必须小于150MB!');
}
return isLt150M;
},

@ -57,24 +57,22 @@ class GraduationTasksnew extends Component {
}
// if (GraduationTasksnewtype === true) {
this.props.form.validateFields((err, values) => {
if (!err) {
if (values.tasktype === undefined) {
this.scrollToAnchors("tasktypes");
this.ifHasAnchorJustScorll("tasktypes");
return
}
if (values.name === undefined) {
this.scrollToAnchors("nametypes");
this.ifHasAnchorJustScorll("nametypes");
return
}
if (values.description === undefined) {
this.scrollToAnchors("descriptiontypes");
this.ifHasAnchorJustScorll("descriptiontypes");
return
}else if (values.description.length > 5000) {
this.scrollToAnchors("descriptiontypes");
this.ifHasAnchorJustScorll("descriptiontypes");
return
}
if (!err) {
// console.log('Received values of form: ', values);
// console.log(fileList);
const course_id = this.props.match.params.coursesId;
@ -129,6 +127,7 @@ class GraduationTasksnew extends Component {
}
// 附件相关 START
handleChange = (info) => {
if(info.file.status == "done" || info.file.status == "uploading"){
let fileList = info.fileList;
// for(var list of fileList ){
@ -138,6 +137,7 @@ class GraduationTasksnew extends Component {
fileList: appendFileSizeToUploadFileAll(fileList),
});
}
}
// onAttachmentRemove = (file) => {
// // confirm({
@ -173,6 +173,7 @@ class GraduationTasksnew extends Component {
}
onAttachmentRemove = (file) => {
if(file.response!=undefined){
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
// const url = `/attachments/${file}.json`
axios.delete(url, {})
@ -199,6 +200,8 @@ class GraduationTasksnew extends Component {
});
}
}
//滚动
ifHasAnchorJustScorll() {
// let anchor = this.getURLStuff("anchor");
@ -271,7 +274,7 @@ class GraduationTasksnew extends Component {
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
message.error('文件大小必须小于150MB!');
this.props.showNotification('文件大小必须小于150MB!');
}
return isLt150M;
},

@ -215,6 +215,8 @@ class GraduateTopicNew extends Component{
this.setState({ fileList });
}
onAttachmentRemove = (file) => {
if(file.response!=undefined){
confirm({
title: '确定要删除这个附件吗?',
okText: '确定',
@ -229,6 +231,8 @@ class GraduateTopicNew extends Component{
});
return false;
}
}
deleteAttachment = (file) => {
console.log(file);
let id=file.response ==undefined ? file.id : file.response.id
@ -310,7 +314,7 @@ class GraduateTopicNew extends Component{
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
message.error('文件大小必须小于150MB!');
this.props.showNotification('文件大小必须小于150MB!');
}
return isLt150M;
},

@ -163,6 +163,7 @@ class GraduateTopicPostWorksNew extends Component{
this.setState({ fileList });
}
onAttachmentRemove = (file) => {
if(file.response!=undefined){
confirm({
title: '确定要删除这个附件吗?',
okText: '确定',
@ -179,6 +180,9 @@ class GraduateTopicPostWorksNew extends Component{
return false;
}
}
deleteAttachment = (file) => {
const url = `/attachments/${file.id}.json`
axios.delete(url, {
@ -249,7 +253,7 @@ class GraduateTopicPostWorksNew extends Component{
console.log('beforeUpload', file.name);
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
message.error('文件大小必须小于150MB!');
this.props.showNotification('文件大小必须小于150MB!');
}
return isLt150M;
},

@ -73,6 +73,7 @@ class CreateGroupByImportModal extends Component{
}
onAttachmentRemove = (file) => {
if(file.response!=undefined){
this.props.confirm({
content: '是否确认删除?',
@ -86,6 +87,8 @@ class CreateGroupByImportModal extends Component{
return false;
}
}
deleteAttachment = (file) => {
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
axios.delete(url, {

@ -280,9 +280,13 @@ class PollNew extends Component {
questionnair: true,
left_banner_id:result.data.left_banner_id
})
// console.log(this.state.polls_nametest)
// console.log(this.state.polls_descriptiontest)
// }
if( result.data.poll.polls_name){
if( result.data.poll.polls_name.length>0){
this.setState({
addonAfter: result.data.poll.polls_name.length,
})
}
}
}).catch((error) => {
console.log(error)
})
@ -326,8 +330,13 @@ class PollNew extends Component {
polls_descriptiontest: result.data.poll.polls_description,
questionnair: true,
})
// }
if( result.data.poll.polls_name){
if( result.data.poll.polls_name.length>0){
this.setState({
addonAfter: result.data.poll.polls_name.length,
})
}
}
}).catch((error) => {
console.log(error)
})
@ -1765,12 +1774,13 @@ class PollNew extends Component {
max_choicess = max_choices;
min_choicess = min_choices;
}
axios.post(urlly, {
question_title: object.question.question_title,
question_type: number,
is_necessary: object.question.is_necessary,
max_choices: max_choicess,
min_choices: min_choicess,
max_choices: max_choicess===undefined?null:max_choicess===null?null:max_choicess===0?null:max_choicess,
min_choices: min_choicess===undefined?null:min_choicess===null?null:min_choicess===0?null:min_choicess,
question_answers: option,
question_other_answer: null,
insert_id: insert_id
@ -2123,6 +2133,12 @@ class PollNew extends Component {
//最小值
HandleGradationGroupChangee = (value, index, max, length) => {
console.log("最小值");
console.log(value);
console.log(index);
console.log(max);
console.log(length);
// debugger
var minbool = false;
var maxbool = false;
@ -2146,18 +2162,8 @@ class PollNew extends Component {
} else {
for (var i = 0; i < arr.length; i++) {
if (index === i) {
try {
if(parseInt(value)===0){
arr[i].question.min_choices = 2;
arr[i].question.max_choices = length;
}else{
arr[i].question.min_choices = parseInt(value);
arr[i].question.max_choices = max;
}
}catch (e) {
arr[i].question.min_choices = 2;
arr[i].question.max_choices = length;
}
break;
}
}
@ -2169,17 +2175,30 @@ class PollNew extends Component {
}
//最大值
HandleGradationGroupChangeee = (value, index,minchoices) => {
HandleGradationGroupChangeee = (value, index,minchoices,length) => {
// console.log("2112");
// console.log(value);
// console.log(minchoices);
console.log("最大值");
console.log(value);
console.log(index);
console.log(minchoices);
console.log(length);
let arr = this.state.adddom;
for (var i = 0; i < arr.length; i++) {
if (index === i) {
if(parseInt(value)===0&&parseInt(minchoices)===0){
arr[i].question.min_choices= parseInt(0);
arr[i].question.max_choices = parseInt(0);
}else if(parseInt(minchoices)===0){
arr[i].question.min_choices= parseInt(2);
arr[i].question.max_choices = parseInt(value);
}
else if(parseInt(value)===0&&parseInt(minchoices)>0){
arr[i].question.min_choices= parseInt(minchoices);
arr[i].question.max_choices = parseInt(value);
}else {
}
else {
arr[i].question.min_choices= minchoices===null?2:minchoices===undefined?2:minchoices===0?2:parseInt(minchoices);
arr[i].question.max_choices = parseInt(value);
}
@ -2455,7 +2474,7 @@ class PollNew extends Component {
// console.log(this.state.projects===undefined?"":this.state.projects.poll_questions)
var displaymysave = (mysave === true) ? "" : "display:none;";
return (
<div>
<div className="newMain">
{/*提示*/}
{Modalstype && Modalstype === true ? <Modals
modalsType={this.state.Modalstype}
@ -2465,14 +2484,8 @@ class PollNew extends Component {
modalsBottomval={this.state.ModalsBottomval}
loadtype={this.state.Loadtype}
/> : ""}
<style>
{
`
.newMains{ margin: 0 auto; padding-bottom: 235px !important; min-width:1200px; min-height: 800px !important;}
`
}
</style>
<div className="educontent newMains">
<div className="educontent mb50">
<p className="clearfix mb20 mt10">
<a className=" btn colorgrey fl hovercolorblue" onClick={()=>this.gotohome()}>{this.props.coursedata.name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
@ -2874,7 +2887,7 @@ class PollNew extends Component {
value={itemo.question.min_choices === 0 || itemo.question.min_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.min_choices}
>
<Option value={String("0")}>--</Option>
<Option value={"0"}>--</Option>
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {
return (
indext >= 1 ? <Option value={String(indext + 1)}>{indext + 1}</Option> : ""
@ -2885,10 +2898,10 @@ class PollNew extends Component {
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大*/}
<Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices)}
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)}
value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices}
>
<Option value={String("0")}>--</Option>
<Option value={"0"}>--</Option>
{itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => {
return (
indext >= 1 ? <Option value={String(indext + 1)}>{indext + 1}</Option> : ""
@ -3128,7 +3141,7 @@ class PollNew extends Component {
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大*/}
<Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices)}
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)}
value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices}
>
<Option value={String("0")}>--</Option>
@ -3380,7 +3393,7 @@ class PollNew extends Component {
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大*/}
<Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices)}
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices,itemo.question.answers.length)}
value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices}
>
<Option value={String("0")}>--</Option>

@ -1100,7 +1100,7 @@ class ShixunHomework extends Component{
{course_modules&&course_modules.main_category.map((item,key)=>{
return(
datas&&datas.category_id===null?"":<li key={key} id={item.main_category_id} onClick={() => this.moveTos(item.main_category_id)} title={item.main_category_name}>{item.main_category_name}</li>
datas&&datas.category_id===null?"":<li key={key} id={item.main_category_id} onClick={() => this.moveTos(item.main_category_id)} title={item.main_category_name.length>18?item.main_category_name:""}>{item.main_category_name}</li>
)
})}
@ -1109,10 +1109,10 @@ class ShixunHomework extends Component{
return (!this.state.dirSearchValue || item.category_name.indexOf(this.state.dirSearchValue) != -1)
}).map( (item,key) => {
if(datas&&datas.category_id!=null&&datas&&datas.category_id===item.category_id===false){
return <li key={key} id={item.category_id} onClick={() => this.moveTos(item.category_id )} title={item.category_name}>{item.category_name}</li>
return <li key={key} id={item.category_id} onClick={() => this.moveTos(item.category_id )} title={item.category_name.length>18?item.category_name:""}>{item.category_name}</li>
}
if(datas&&datas.category_id===null){
return <li key={key} id={item.category_id} onClick={() => this.moveTos(item.category_id )} title={item.category_name}>{item.category_name}</li>
return <li key={key} id={item.category_id} onClick={() => this.moveTos(item.category_id )} title={item.category_name.length>18?item.category_name:""}>{item.category_name}</li>
}
})}

@ -561,6 +561,7 @@ class MemoNew extends Component {
}
}
onAttachmentRemove = (file) => {
if(file.response!=undefined){
this.props.confirm({
// title: '确定要删除这个附件吗?',
content: '是否确认删除?',
@ -577,6 +578,8 @@ class MemoNew extends Component {
});
return false;
}
}
deleteAttachment = (file) => {
// 初次上传不能直接取uid
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`

@ -82,10 +82,10 @@ class CaseDetail extends Component{
<a href="/moop_cases" className="color-grey-9">教学案例</a> &gt; <span className="color-grey-3">{ CaseDetail.title}</span>
</p>
<p className="lineh-25 mb20 clearfix">
<span className="font-22 fl mr10 task-hide" style={{maxWidth:"800px"}}>
<span className="font-22 fl mr10 task-hide lineh-30" style={{maxWidth:"800px"}}>
{ CaseDetail.title}
</span>
<span className="mt5 fl">
<span className="mt10 fl">
<Tags tags={tags}></Tags>
{
CaseDetail.status == "pending" && <span class="edu-filter-btn fl cdefault edu-activity-green ml10">草稿</span>

@ -47,6 +47,7 @@ class CaseNew extends Component{
// 上传附件-删除确认框
onAttachmentRemove = (file, stateName) => {
if(file.response!=undefined){
this.props.confirm({
content: '是否确认删除?',
onOk: () => {
@ -58,6 +59,7 @@ class CaseNew extends Component{
});
return false;
}
}
// 上传附件-确认删除
deleteAttachment = (file, stateName) => {
@ -273,7 +275,7 @@ class CaseNew extends Component{
beforeUpload: (file) => {
const isLt150M = file.size / 1024 / 1024 < 150;
if (!isLt150M) {
//message.error('文件大小必须小于150MB!');
//this.props.showNotification('文件大小必须小于150MB!');
this.props.define({
title:'提示',
content:"该文件无法上传。超过文件大小限制(150MB),建议上传到百度云等其它共享工具里然后再txt文档里给出链接以及共享密码并上传"
@ -377,6 +379,7 @@ class CaseNew extends Component{
<ul className="fl libraries_tab">
<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(3) > -1 ? "active" :"" } onClick={()=>this.changeType(3)}>企业案例</li>
</ul>
{
checkTag && <div class="ant-form-explain">请选择标签</div>

@ -14,7 +14,17 @@ class CaseTags extends Component{
{
tags && tags.map((item,key)=>{
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;
line-height: 17px;
}
.edu-activity-orange-sub {
background-color: #FF781B;
color: #fff!important;
cursor: pointer;
border: 1px solid #ff6800;
line-height: 17px;
}
.pointsBtn {
width: 70px;

@ -481,12 +481,13 @@ export function TPMIndexHOC(WrappedComponent) {
}
`
}</style>
<NewHeader {...this.state} {...this.props}></NewHeader>
<Spin spinning={this.state.globalLoading} delay={0} className="globalSpin"
size="large"
tip= {this._gLoadingTip || "加载中..."}
>
<NewHeader {...this.state} {...this.props}></NewHeader>
<div className="newContainer newContainers">
<WrappedComponent initCommonState={(user)=>this.initCommonState(user)}
{...this.props} {...this.state}
@ -497,11 +498,12 @@ export function TPMIndexHOC(WrappedComponent) {
</div>
</Spin>
<NewFooter
Footerdown={Footerdown}
/>
</Spin>
</div>
);
}

@ -1384,6 +1384,7 @@ export default class TPMsettings extends Component {
}
onAttachmentRemove = (file) => {
if(file.response!=undefined){
confirm({
title: '确定要删除这个附件吗?',
okText: '确定',
@ -1400,6 +1401,8 @@ export default class TPMsettings extends Component {
return false;
}
}
deleteAttachment = (file) => {
console.log(file);
let id=file.response ==undefined ? file.id : file.response.id

@ -772,6 +772,7 @@ class Newshixuns extends Component {
}
onAttachmentRemove = (file) => {
if(file.response!=undefined){
confirm({
title: '确定要删除这个附件吗?',
okText: '确定',
@ -787,6 +788,8 @@ class Newshixuns extends Component {
});
return false;
}
}
deleteAttachment = (file) => {
console.log(file);
let id=file.response ==undefined ? file.id : file.response.id
@ -913,7 +916,7 @@ class Newshixuns extends Component {
// // console.log('beforeUpload', file.name);
// const isLt50M = file.size / 1024 / 1024 < 50;
// if (!isLt50M) {
// message.error('文件大小必须小于150MB!');
// this.props.showNotification('文件大小必须小于150MB!');
// }
// return isLt50M;
// },

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