+
+ {/* 资源
*/}
{this.state.course_second_categories&&this.state.course_second_categories.length>10?
{this.setState({dirSearchValue: e.target.value})}}/>
:""}
{course_modules&&course_modules.course_modules.map((item,key)=>{
return(
- filesId&&filesId===item.id?"":- this.moveTos(0)} title={item.module_name}>{item.module_name}
+ filesId&&filesId===item.value?"":- this.moveTos(0)} title={item.title}>{item.title}
)
})}
{ course_modules&&course_modules.course_modules.map( (item,key) => {
- return item.course_second_categories&&item.course_second_categories.filter((item)=> {
- return (!this.state.dirSearchValue || item.name.indexOf(this.state.dirSearchValue) != -1)
+ return item.children&&item.children.filter((item)=> {
+ return (!this.state.dirSearchValue || item.title.indexOf(this.state.dirSearchValue) != -1)
}).map((itm,k)=>{
return(
- filesId&&filesId===itm.id?"":- this.moveTos(itm.id )} title={itm.name}>{itm.name}
+
+
+
this.moveTos(itm.value )} style={{marginLeft:15,width:itm.title.length>13?200:undefined,color:'#000000',overflow: 'hidden',textOverflow:'ellipsis',whiteSpace: 'nowrap'}}>{itm.title}
+ {itm.children.length===0?'':
this.istowshow(itm,filesId)} className="iconfont icon-xiajiantou font-12 ml2">}
+
+
+ { this.state.istowshowid===itm.value?
+ itm.children.map((tt,ti) => {
+ return(
+ filesId&&filesId===itm.id?"":
+
+
+
13?tt.title:''} >
+ 13?200:undefined,overflow: 'hidden',textOverflow:'ellipsis',whiteSpace: 'nowrap'}} key={ti} id={tt.value} onClick={() => this.moveTos(tt.value )} title={tt.name}>{tt.title}
+
+
+
+
+ )
+ })
+ :''}
+
)
})
})}
- {this.state.course_second_categories&&this.state.course_second_categories.length===0?
+ {this.state.course_second_categories.length===0?
暂无数据
:""}
{/*{course_modules&&course_modules.course_modules.map((item,key)=>{*/}
@@ -1034,11 +1079,11 @@ class Fileslists extends Component{
{/*})*/}
{/*)*/}
{/*})}*/}
- {this.props.isAdmin()?parseInt(this.props.match.params.main_id)===filesId&&filesId?
-
+ {/* {this.props.isAdmin()?parseInt(this.props.match.params.main_id)===filesId&&filesId?
+
this.addDir()}>新建目录
- :"":""}
+ :"":""} */}
diff --git a/public/react/src/modules/courses/Resource/style.css b/public/react/src/modules/courses/Resource/style.css
index e69de29bb..eb1c2fc5a 100644
--- a/public/react/src/modules/courses/Resource/style.css
+++ b/public/react/src/modules/courses/Resource/style.css
@@ -0,0 +1,7 @@
+
+ .indexdiv {
+ background:#ffffff;
+ }
+ .indexdiv:hover {
+ background:#ccc;
+ }
\ No newline at end of file
diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js
index 409b3bd6c..e743eb1b9 100644
--- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js
+++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js
@@ -1,7 +1,7 @@
import React,{ Component } from "react";
import { Link } from "react-router-dom";
import axios from 'axios';
-import {Checkbox,Modal,Input,Tooltip,notification,Popover} from 'antd';
+import {Checkbox,Modal,Input,Tooltip,notification,Popover,Dropdown,Menu,TreeSelect} from 'antd';
import { DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd';
import Modals from '../../modals/Modals';
import { on, off, trigger } from 'educoder';
@@ -11,7 +11,8 @@ const CheckboxGroup = Checkbox.Group;
let navidtype=true;
-
+const { SubMenu } = Menu;
+const { TreeNode } = TreeSelect;
//a little function to help us with reordering the result
const reorder = (list, startIndex, endIndex) => {
@@ -62,9 +63,26 @@ class Coursesleftnav extends Component{
antIcon:false,
chapterupdate:false,
- successFunc:undefined
+ successFunc:undefined,
+
+ //用来判断 是不是资源点击进入的
+ Navmodalziyname:'',
+ treeData:undefined,
+ //默认为0主目录
+ parentid:0,
+ //判断3级目录是否显示三个点
+ sanshow:'',
+ sansandiantype:undefined,
+ //新增参数判断打开关闭 默认关闭
+ showPreson:false,
+ //获取资源id 判断是否选中的事资源来判控
+ treeDataid:'',
+ //默认值
+ treedefaultValue:'',
+ dropdownStyleshow:''
}
}
+
// updataleftNav=()=>{
//
@@ -182,7 +200,7 @@ class Coursesleftnav extends Component{
this.Navmodalnames(e,5,"editSecondname", data.id, data.name);
}
attachmentAddlog=(e,data)=>{
- this.Navmodalnames(e,1,"attachment",data);
+ this.Navmodalnames(e,1,"attachment",data.id,data.name,data.coursesecondcategoryid,data.coursesecondcategoryid===undefined?false:true);
}
flieseditDir=(e, data)=>{
this.Navmodalnames(e,4,"editSecondname",data.id,data.name);
@@ -208,7 +226,6 @@ class Coursesleftnav extends Component{
on('editcommon_homeworks',this.editcommon_homeworks)
let courstype=this.props.match.url;
-
courstype = courstype.split('/');
courstype=courstype[3];
@@ -234,7 +251,6 @@ class Coursesleftnav extends Component{
newselectnavid:parseInt(category_id),
})
}else{
-
if(isNaN(category_id)){
this.setState({
positiontype:courstype,
@@ -286,7 +302,36 @@ class Coursesleftnav extends Component{
}
}
- }
+ }
+
+ //请求接口获取资源列表数据
+ getatahcment(){
+ let coursesId=this.props.match.params.coursesId;
+ let url="/courses/"+coursesId+"/attahcment_category_list.json";
+ axios.get(url, {params:{
+ no_child: true,
+ }
+
+ }).then((response) => {
+ if(response!=undefined){
+ if(response.data&&response.data) {
+ if (response.data.status != 401) {
+
+ let tr=response.data.course_modules;
+ this.setState({
+ treeData:tr
+ })
+ tr.map((iem,index)=>{
+ this.setState({
+ treeDataid:iem.value
+ })
+ })
+ }
+ }
+
+ }
+ })
+ }
setnavid=(e,key,id,type,url)=>{
// this.props.getleftNavid && this.props.getleftNavid(key,type);
@@ -359,7 +404,8 @@ class Coursesleftnav extends Component{
e.stopPropagation();//阻止冒泡
}
- selectnavids=(e,key,id,type,urls,index)=>{
+ selectnavids=(e,key,id,type,urls,index,santype)=>{
+
this.setState({
selectnavid:true,
newselectnavid:id,
@@ -384,7 +430,6 @@ class Coursesleftnav extends Component{
// console.log("twosandianshow");
// console.log(key);
- // console.log(type);
this.setState({
toopvisibleindexs:key,
twosandiantype:key,
@@ -394,6 +439,23 @@ class Coursesleftnav extends Component{
})
e.stopPropagation();//阻止冒泡
}
+
+ sansandianshow=(e,key,type,name)=>{
+
+ // console.log("twosandianshow");
+ // console.log(key);
+ this.setState({
+ toopvisibleindexs:key,
+ sansandiantype:key,
+ toopvisible:false,
+ sanshow:name,
+ toopvisibleindex:undefined,
+ twosandiantypes:type
+ })
+ e.stopPropagation();//阻止冒泡
+ }
+
+
twosandianshowys=(e,key,type)=>{
// console.log("twosandianshow");
// console.log(key);
@@ -403,6 +465,17 @@ class Coursesleftnav extends Component{
})
e.stopPropagation();//阻止冒泡
}
+
+ sansandianshowys=(e,key,type)=>{
+ // console.log("twosandianshow");
+ // console.log(key);
+ // console.log(type);
+ this.setState({
+ toopvisibleindexs:key,
+ })
+ e.stopPropagation();//阻止冒泡
+ }
+
twosandianshowyss=(e,key,type)=>{
// console.log("twosandianshow");
// console.log(key);
@@ -413,6 +486,16 @@ class Coursesleftnav extends Component{
e.stopPropagation();//阻止冒泡
}
+ sansandianshowyss=(e,key,type)=>{
+ // console.log("twosandianshow");
+ // console.log(key);
+ // console.log(type);
+ this.setState({
+ toopvisibleindexs:undefined,
+ })
+ e.stopPropagation();//阻止冒泡
+ }
+
twosandianhide=(e,index,type)=>{
// console.log(index)
this.setState({
@@ -426,6 +509,20 @@ class Coursesleftnav extends Component{
e.stopPropagation();//阻止冒泡
}
+ sansandianhide=(e,index,type)=>{
+ // console.log(index)
+ this.setState({
+ toopvisibleindexs:undefined,
+ sansandiantype:undefined,
+ twosandiantypenum:undefined,
+ toopvisible:true,
+ sanshow:'',
+ toopvisibleindex:index,
+ twosandiantypes:type
+ })
+ e.stopPropagation();//阻止冒泡
+ }
+
twosandianhideys=(e,index,type)=>{
// console.log(index)
this.setState({
@@ -442,6 +539,9 @@ class Coursesleftnav extends Component{
navid:undefined,
sandiantype:undefined,
twosandiantype:undefined,
+ sansandiantype:undefined,
+
+
})
let url="/course_modules/"+id+"/sticky_module.json"
@@ -461,6 +561,7 @@ class Coursesleftnav extends Component{
navid:undefined,
sandiantype:undefined,
twosandiantype:undefined,
+ sansandiantype:undefined,
ModalsType:false
})
@@ -481,6 +582,8 @@ class Coursesleftnav extends Component{
})
}
+
+
edithidden=(e,id)=>{
e.stopPropagation();//阻止冒泡
let {course_modules}=this.props;
@@ -505,8 +608,9 @@ class Coursesleftnav extends Component{
}
- Navmodalnames=(e,id,type,setnavid,name)=>{
+ Navmodalnames=(e,id,type,setnavid,name,towid,showPreson)=>{
e.stopPropagation();//阻止冒泡
+ this.getatahcment()
navidtype=false
if(id===1||id===2||id===6){
this.setState({
@@ -515,7 +619,11 @@ class Coursesleftnav extends Component{
Navplaceholder:"请输入名称,最大限制60个字符",
Navmodalnametype:true,
Navmodaltypename:id,
+ Navmodalziyname:name,
+ treedefaultValue:towid,
+ showPreson:showPreson,
setnavid:setnavid,
+ parentid:towid,
NavmodalValue:""
})
}else if(id===3||id===4||id===5||id===7){
@@ -527,6 +635,10 @@ class Coursesleftnav extends Component{
Navmodalnametype:true,
Navmodaltypename:id,
setnavid:setnavid,
+ treedefaultValue:towid,
+ showPreson:showPreson,
+ Navmodalziyname:'',
+ parentid:towid,
NavmodalValue:name
})
@@ -565,7 +677,9 @@ class Coursesleftnav extends Component{
saveNavmodapost=(url,value,positiontype,coursesId,type)=>{
console.log(positiontype)
axios.post(url,
- {name:value}).then((result)=>{
+ {name:value,
+ parent_id:this.state.parentid
+ }).then((result)=>{
if(result!=undefined){
if(result.data.status===0){
@@ -604,11 +718,9 @@ class Coursesleftnav extends Component{
}
if(positiontype==="files"||positiontype==="file"){
-
if(type===true){
this.updasaveNavmoda()
trigger('files')
-
}else{
this.updasaveNavmoda()
this.props.history.push(`/classrooms/${coursesId}/file/${result.data.category_id}`);
@@ -798,7 +910,23 @@ class Coursesleftnav extends Component{
}
}
+ tronChange=(value)=>{
+ console.log(this.state.dropdownStyleshow)
+
+ this.setState({
+ parentid:this.state.treeDataid===value?0:value,
+ dropdownStyleshow:'none'
+
+ })
+
+ }
+ tronclick=()=>{
+ this.setState({
+ dropdownStyleshow:'inline-block'
+ })
+
+ }
droppablepost=(url,list)=>{
axios.post(url,{position: list}).then((result)=>{
@@ -871,6 +999,7 @@ class Coursesleftnav extends Component{
}
+
hidesandian=(e,key)=>{
this.setState({
sandiantypes:undefined
@@ -885,9 +1014,11 @@ class Coursesleftnav extends Component{
e.stopPropagation();//阻止冒泡
}
+
showsandians=(e,key,urls,num,id,type,index)=> {
let {url}=this.state;
if (key === this.props.indexs) {
+
this.props.unlocationNavfun(undefined)
} else {
this.props.updataleftNavfun();
@@ -923,7 +1054,7 @@ class Coursesleftnav extends Component{
{/*/!* 分组作业 *!/*/}
{item.type==="group_homework"?this.Navmodalnames(e,1,"group_homeworks",item.id)}>新建目录
:""}
{/*资源*/}
- {item.type==="attachment"?this.Navmodalnames(e,1,"attachment",item.id)}>新建目录
:""}
+ {item.type==="attachment"?this.Navmodalnames(e,1,"attachment",item.id,"资源")}>新建目录
:""}
{/* 视频 */}
{item.type==="video"?this.Navmodalnames(e,1,"video",item.id)}>新建目录
:""}
{/*毕业设计*/}
@@ -948,10 +1079,11 @@ class Coursesleftnav extends Component{
this.editSetup(e,item.id)}>置顶
)
}
- content=(item,iem,index)=>{
+ content=(item,iem,index,san)=>{
let {twosandiantypes,twosandiantypenum}=this.state;
return (item.type==="graduation"?"":
{/*作业/资源*/}
+ {item.type==="attachment"&&san!=='san'?
this.Navmodalnames(e,1,"attachment",item.id,"资源",iem.category_id,true)}>新建目录
:""}
{item.type==="shixun_homework"||item.type==="attachment"||item.type==="graduation"||item.type==="common_homework"||item.type==="group_homework"?
this.Navmodalnames(e,4,"editSecondname",iem.category_id,iem.category_name)}>重命名
:""}
{item.type==="shixun_homework"||item.type==="attachment"||item.type==="common_homework"||item.type==="group_homework"?
this.deleteSecondary(e,1,iem.category_id)}>删除
:""}
{/*分班*/}
@@ -980,6 +1112,7 @@ class Coursesleftnav extends Component{
})
}
render(){
+
let {
twosandiantype,
Navmodalname,
@@ -991,7 +1124,8 @@ class Coursesleftnav extends Component{
ModalSave,
loadtype,
twosandiantypes,
- toopvisibleindexs
+ toopvisibleindexs,
+ sansandiantype
}=this.state;
let {course_modules,hidden_modules,is_teacher} =this.props;
@@ -1003,6 +1137,9 @@ class Coursesleftnav extends Component{
// console.log("CoursesLeftNav");
// console.log(course_modules);
+
+
+
return(
@@ -1059,14 +1196,35 @@ class Coursesleftnav extends Component{
destroyOnClose={true}
centered={true}
>
-
-
{this.state.Navtitles}:
+
+ {this.state.Navmodalziyname==="资源"?
:''}
+
+
+
{this.state.Navtitles}:
+
+
{this.state.NavmodalValuetype===true?
{this.state.NavmodalValues}
:""}
@@ -1182,7 +1341,7 @@ class Coursesleftnav extends Component{
>
{/*"/classrooms/"+this.props.match.params.coursesId+"/"+item.type+"/"+iem.category_type+"/"+iem.category_id*/}
- - this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} onMouseLeave={(e)=>this.twosandianhide(e,index,item.type)} onMouseEnter={(e)=>this.twosandianshow(e,index,item.type)}
+
- this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key,'san')} onMouseLeave={(e)=>this.twosandianhide(e,index,item.type)} onMouseEnter={(e)=>this.twosandianshow(e,index,item.type)}
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
@@ -1193,6 +1352,7 @@ class Coursesleftnav extends Component{
this.twosandianshowys(e,index,item.type)}>{iem.category_name}
{iem.category_count===0?"":iem.category_count}
+
{item.type===twosandiantypes&&twosandiantype===index?
iem.category_id===0?"":
iem.category_type==="graduation_topics"||iem.category_type==="graduation_tasks"?
@@ -1222,8 +1382,55 @@ class Coursesleftnav extends Component{
{provided.placeholder}
-
+
+ {
+ iem.third_category===undefined?"":iem.third_category.map((itt,index)=>{
+ if(itt.category_type!=="attachment"){
+ return
+
+ }
+ return(
+
+ )
+ })
+
+
+ }
)}
@@ -1312,10 +1519,53 @@ class Coursesleftnav extends Component{
{iem.category_count===0?"":iem.category_count}
+
}
-
+ {
+ iem.third_category===undefined?"":iem.third_category.map((itt,index)=>{
+ if(itt.category_type!=="attachment"){
+ return
+
+ }
+ return(
+
+ )
+ })
+
+
+ }
+
)
})
}
diff --git a/public/react/src/modules/courses/coursesDetail/MainLeftNav.css b/public/react/src/modules/courses/coursesDetail/MainLeftNav.css
index 9c3bf1b28..6b344fbe3 100644
--- a/public/react/src/modules/courses/coursesDetail/MainLeftNav.css
+++ b/public/react/src/modules/courses/coursesDetail/MainLeftNav.css
@@ -29,6 +29,19 @@
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0);
background-color: white;
}
+.ant-select-tree-title{
+ overflow:hidden;
+ text-overflow:ellipsis;
+ white-space:nowrap;
+ display:inline-block;
+ max-width:200px;
+}
+.ant-select-tree-title{
+ overflow:hidden;
+ text-overflow:ellipsis;
+ white-space:nowrap;
+ max-width:200px;
+}
/*鼠标悬浮在滚动条上的主干部分*/
/*.droppableul::-webkit-scrollbar-track:hover {*/
diff --git a/public/react/src/modules/courses/videostatistics/component/Videostatisticslist.js b/public/react/src/modules/courses/videostatistics/component/Videostatisticslist.js
index 860f29132..f0392fce1 100644
--- a/public/react/src/modules/courses/videostatistics/component/Videostatisticslist.js
+++ b/public/react/src/modules/courses/videostatistics/component/Videostatisticslist.js
@@ -109,7 +109,7 @@ class Videostatisticslist extends Component {
width: '100px',
render: (text, record) => (
-