|
|
|
@ -37,7 +37,8 @@ class Fileslists extends Component{
|
|
|
|
|
course_modules:undefined,
|
|
|
|
|
has_course_groups:false,
|
|
|
|
|
course_is_public:undefined,
|
|
|
|
|
isSpin:false
|
|
|
|
|
isSpin:false,
|
|
|
|
|
course_second_categories:[]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
componentDidMount=()=>{
|
|
|
|
@ -115,12 +116,22 @@ class Fileslists extends Component{
|
|
|
|
|
axios.get(url, {
|
|
|
|
|
}).then((response) => {
|
|
|
|
|
if(response!=undefined){
|
|
|
|
|
|
|
|
|
|
if(response.data&&response.data){
|
|
|
|
|
let list=response.data.course_modules;
|
|
|
|
|
let course_second_categoriess;
|
|
|
|
|
list.map((item,key)=>{
|
|
|
|
|
course_second_categoriess=item.course_second_categories
|
|
|
|
|
})
|
|
|
|
|
debugger
|
|
|
|
|
this.setState({
|
|
|
|
|
course_modules:response.data,
|
|
|
|
|
has_course_groups:response.data.has_course_groups
|
|
|
|
|
has_course_groups:response.data.has_course_groups,
|
|
|
|
|
course_second_categories:course_second_categoriess
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
@ -647,7 +658,8 @@ class Fileslists extends Component{
|
|
|
|
|
discussMessageid,
|
|
|
|
|
course_modules,
|
|
|
|
|
shixunmodal,
|
|
|
|
|
course_is_public
|
|
|
|
|
course_is_public,
|
|
|
|
|
filesId
|
|
|
|
|
} = this.state;
|
|
|
|
|
let category_id= this.props.match.params.category_id;
|
|
|
|
|
|
|
|
|
@ -799,29 +811,35 @@ class Fileslists extends Component{
|
|
|
|
|
.drop_down_menu li {
|
|
|
|
|
overflow: visible;
|
|
|
|
|
}
|
|
|
|
|
.courseSecond{
|
|
|
|
|
margin-left: 10px;
|
|
|
|
|
padding: 10px;
|
|
|
|
|
}
|
|
|
|
|
`}
|
|
|
|
|
</style>
|
|
|
|
|
<ul className="drop_down_menu" style={{"right":"0px","left":"unset"}}>
|
|
|
|
|
<p className="drop_down_search">
|
|
|
|
|
<ul className="drop_down_menu" style={{"right":"0px","left":"unset","min-width":'150px'}}>
|
|
|
|
|
{this.state.course_second_categories.length>10? <p className="drop_down_search">
|
|
|
|
|
<Input placeholder="搜索" value={this.state.dirSearchValue} onChange={(e) => {this.setState({dirSearchValue: e.target.value})}}/>
|
|
|
|
|
</p>
|
|
|
|
|
</p>:""}
|
|
|
|
|
|
|
|
|
|
{/*{course_modules&&course_modules.course_modules.map((item,key)=>{*/}
|
|
|
|
|
{/*return(*/}
|
|
|
|
|
{/*<li key={key} id={item.id} onClick={() => this.moveTos(0)}>{item.module_name}</li>*/}
|
|
|
|
|
{/*)*/}
|
|
|
|
|
{/*})}*/}
|
|
|
|
|
{course_modules&&course_modules.course_modules.map((item,key)=>{
|
|
|
|
|
return(
|
|
|
|
|
filesId&&filesId===item.id?"":<li key={key} id={item.id} onClick={() => this.moveTos(0)}>{item.module_name}</li>
|
|
|
|
|
)
|
|
|
|
|
})}
|
|
|
|
|
|
|
|
|
|
{ course_modules&&course_modules.course_modules.map( (item,key) => {
|
|
|
|
|
|
|
|
|
|
return item.course_second_categories.filter((item)=> {
|
|
|
|
|
return (!this.state.dirSearchValue || item.name.indexOf(this.state.dirSearchValue) != -1)
|
|
|
|
|
}).map((itm,k)=>{
|
|
|
|
|
return(
|
|
|
|
|
<li key={k} id={itm.id} onClick={() => this.moveTos(itm.id )}>{itm.name}</li>
|
|
|
|
|
filesId&&filesId===itm.id?"":<li key={k} id={itm.id} onClick={() => this.moveTos(itm.id )}>{itm.name}</li>
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
})}
|
|
|
|
|
|
|
|
|
|
{this.state.course_second_categories.length===0?
|
|
|
|
|
<div className={"courseSecond"}>暂无数据</div>:""}
|
|
|
|
|
|
|
|
|
|
{/*{course_modules&&course_modules.course_modules.map((item,key)=>{*/}
|
|
|
|
|
{/*return(*/}
|
|
|
|
@ -834,7 +852,7 @@ class Fileslists extends Component{
|
|
|
|
|
{/*})}*/}
|
|
|
|
|
{this.props.isAdmin()?parseInt(this.props.match.params.main_id)===parseInt(this.props.coursesids)?
|
|
|
|
|
<p className="drop_down_btn">
|
|
|
|
|
<a className="color-grey-6" onClick={()=>this.addDir()}>添加目录...</a>
|
|
|
|
|
<a className="color-grey-6" onClick={()=>this.addDir()}>添加目录</a>
|
|
|
|
|
</p>
|
|
|
|
|
:"":""}
|
|
|
|
|
</ul>
|
|
|
|
|