courseware
daiao 5 years ago
commit 1dcee8ada4

@ -251,7 +251,13 @@ module CoursesHelper
# 获取课堂的资源数
def get_attachment_count(course, category_id)
identity = current_user.course_identity(course)
attachments = category_id.to_i == 0 ? course.attachments : course.attachments.where(course_second_category_id: category_id)
if category_id.to_i == 0
attachments = course.attachments
else
# children_ids = CourseSecondCategory.where(parent_id: category_id).pluck(:id)
# category_ids = [category_id] + children_ids
attachments = course.attachments.joins(:course_second_category).where(course_second_categories: {id: category_id}).or(course.attachments.joins(:course_second_category).where(course_second_categories: {parent_id: category_id}))
end
identity > Course::ASSISTANT_PROFESSOR ? attachments.published.size : attachments.size
end

@ -17,10 +17,15 @@ json.data do
end
# json.partial! "files/course_groups", attachment_group_settings: attachment.attachment_group_settings
json.category_id attachment.course_second_category_id
if (@course_second_category_id.to_i == 0 && attachment.course_second_category.present?) || (@parent_category_id == 0 && attachment.course_second_category&.parent_id.to_i != 0)
if @course_second_category_id.to_i == 0 && attachment.course_second_category.present?
json.category_name attachment.course_second_category&.name
json.parent_category_name attachment.course_second_category&.parent&.name
end
if @parent_category_id == 0 && attachment.course_second_category&.parent_id.to_i != 0
json.category_name attachment.course_second_category&.name
json.parent_category_name nil
end
end
end
end

@ -51,6 +51,7 @@ class Fileslists extends Component{
istowshowid:'',
//新增参数判断几级目录
parent_category_id:'',
isToggleOn:false,
}
}
@ -673,8 +674,10 @@ class Fileslists extends Component{
//判断二级链接是否显示
istowshow(item){
let toggleon=this.state.isToggleOn;
this.setState({
istowshowid:item.value
istowshowid:item.value,
isToggleOn:!toggleon
})
}
@ -1032,9 +1035,9 @@ class Fileslists extends Component{
{course_modules&&course_modules.course_modules.map((item,key)=>{
return(
<li key={key} id={item.value} onClick={() => this.moveTos(0)} title={item.title}>{item.title}</li>
<div style={{display:'inline-block',marginTop:10,height:20}}>
<li key={key} style={{paddingTop:5}} id={item.value} onClick={() => this.moveTos(0)} title={item.title}>{item.title}</li>
</div>
)
})}
@ -1046,7 +1049,7 @@ class Fileslists extends Component{
return(
<div >
<div style={{display:'inline-block',marginTop:10,height:20}}>
<li style={{width:200}} key={key} id={itm.value} onClick={() => this.moveTos(0)} title={itm.title}>{itm.title}</li>
<li style={{width:200,paddingTop:5}} key={key} id={itm.value} onClick={() => this.moveTos(itm.value)} title={itm.title}>{itm.title}</li>
{/* <div onClick={() => this.moveTos(itm.value )} style={{marginLeft:15,width:itm.title.length>13?200:undefined,color:'#000000',overflow: 'hidden',textOverflow:'ellipsis',whiteSpace: 'nowrap'}}>{itm.title}</div> */}
{itm.children.length===0?'':<i style={{marginLeft:15,marginRight:15}} onClick={() => this.istowshow(itm,filesId)} className="iconfont icon-xiajiantou font-12 ml2"></i>}
@ -1056,10 +1059,10 @@ class Fileslists extends Component{
itm.children.map((tt,ti) => {
return(
filesId&&filesId===itm.id?"":
<div style={{marginTop:10,height:20}}>
<div style={{display:itm.children.length===1?'none':ti===0?'block':'none',marginLeft:15,width:250,height:1,background:'#c4c4c4'}}></div>
<div style={{marginTop:10,height:20,display:this.state.isToggleOn?'block':'none'}}>
<div style={{display:ti===0?'block':'none',marginLeft:15,width:235,marginRight:15,height:1,background:'#EEEEEE'}}></div>
<li style={{marginTop:5,marginBottom:5,paddingLeft:30,width:tt.title.length>13?200:undefined,overflow: 'hidden',textOverflow:'ellipsis',whiteSpace: 'nowrap'}} key={ti} id={tt.value} onClick={() => this.moveTos(tt.value )} title={tt.title}>{tt.title}</li>
<li style={{marginTop:5,paddingTop:5,marginBottom:5,paddingLeft:30,width:tt.title.length>13?200:undefined,overflow: 'hidden',textOverflow:'ellipsis',whiteSpace: 'nowrap'}} key={ti} id={tt.value} onClick={() => this.moveTos(tt.value )} title={tt.title}>{tt.title}</li>
</div>

@ -1200,14 +1200,13 @@ class Coursesleftnav extends Component{
>
<div>
{this.state.Navmodalziyname==="资源"?<div className="df" style={{marginBottom:50}}>
<div className={"fl mt5"} >上级目录</div>
<div className={"fl mt5"} id="ddd">上级目录</div>
<TreeSelect
className={"input-flex-35 greyInput fl"}
style={{width:300,color:'#000000'}}
style={{width:300,color:'#000000'}}
getPopupContainer={() => document.getElementById('ddd')}
dropdownClassName={{display:this.state.dropdownStyleshow}}
// dropdownMenuStyle={{display:this.state.dropdownStyleshow}}
treeData={this.state.treeData}
placeholder={this.state.treeDataname}
disabled={this.state.showPreson}

@ -36,11 +36,8 @@
display:inline-block;
max-width:200px;
}
.ant-select-tree-title{
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
max-width:200px;
.ant-select-tree{
max-height:300px;
}
/*鼠标悬浮在滚动条上的主干部分*/

@ -510,7 +510,7 @@ class Listofworksstudentone extends Component {
),
},
],
orders: "update_time",
orders: "work_score",
columnsstu2: [
{
title: '序号',

@ -279,7 +279,7 @@ class ShixunHomeworkPage extends Component {
typelist={teacherdatapage === undefined ? [""] : teacherdatapage.homework_status}
/>
<a className="color-grey-9 fr font-16 summaryname ml20 mr20" onClick={()=>this.gotohome()}>返回</a>
{teacherdatapage&&teacherdatapage.shixun_status>1?<a className="color-grey-9 fr font-16 mr20"
{teacherdatapage&&teacherdatapage.shixun_status>1?<a className="color-blue fr font-16 mr20"
href={`/shixuns/${teacherdatapage === undefined ? "" : teacherdatapage.shixun_identifier}/challenges`}
target={"_blank"}>实训详情</a>:""}

@ -172,6 +172,8 @@ class Statistics extends Component{
}
})
// console.log(getRandomcode(`${url}?${urllist}`))
this.props.slowDownload(getRandomcode(`${url}?${urllist}`));
}
@ -420,7 +422,7 @@ class Statistics extends Component{
{
this.props.isAdmin()===true?
// 这里是文件下载 不能替换路由
<a className={"ml20 ant-btn-link"} onClick={()=>this.derivefun(this.state.activeKey==="1"?`/classrooms/${this.props.match.params.coursesId}/export_member_scores_excel.xlsx`:`/courses/${this.props.match.params.coursesId}/export_member_act_score.xlsx`)}>导出</a>
<a className={"ml20 ant-btn-link"} onClick={()=>this.derivefun(this.state.activeKey==="1"?`/courses/${this.props.match.params.coursesId}/export_member_scores_excel.xlsx`:`/courses/${this.props.match.params.coursesId}/export_member_act_score.xlsx`)}>导出</a>
:""
}
</React.Fragment>;

Loading…
Cancel
Save