资源三级目录缩进 部分样式修改

courseware
dinglink 5 years ago
parent fc781e15e1
commit 0438df7ce9

@ -144,10 +144,6 @@ class Fileslists extends Component{
}
}
}
updadatalist=(id)=>{
@ -184,8 +180,8 @@ class Fileslists extends Component{
}
updatafiled=()=>{
let{sort}=this.state;
console.log(5)
let{sort}=this.state;
if(this.props.match.params.main_id){
this.seactall(undefined,sort);
}else if(this.props.match.params.Id){
@ -219,12 +215,15 @@ class Fileslists extends Component{
})
newsort="desc"
}
console.log(1)
this.getfileslist(pagesize,page,tagname,searchValue,newsort,sorttype,coursesecondcategoryid);
}
getfileslist=(pagesize,page,tagname,searchValue,sort,sorttype,coursesecondcategoryid)=>{
this.updadatalist(0);
let url = "/files.json";
const courseid = this.props.match.params.coursesId;
let id=coursesecondcategoryid;
@ -446,6 +445,7 @@ class Fileslists extends Component{
onPressEnter = () => {
let {searchValue}=this.state;
let{pagesize,page,tagname,sort,sorttype,coursesecondcategoryid}=this.state;
console.log(2)
this.getfileslist(pagesize,1,tagname,searchValue,sort,sorttype,coursesecondcategoryid);
}
@ -456,17 +456,21 @@ class Fileslists extends Component{
}
addDir = () => {
let {filesId,course_modules}=this.state;
let {filesId,course_modules,coursesecondcategoryid}=this.state;
//调用获取资源接口 刷新数据
this.setState({
checkBoxValues:[]
})
})
console.log(this.props);
if(parseInt(this.props.match.params.main_id)!=parseInt(this.props.coursesids)){
trigger('attachmentAddlog', {id: parseInt( course_modules&&course_modules.course_modules[0].value),name:'资源'})
trigger('attachmentAddlog', {id: parseInt( course_modules&&course_modules.course_modules[0].value),name:'资源',coursesecondcategoryid:coursesecondcategoryid})
}else{
console.log(parseInt(filesId))
trigger('attachmentAddlog', {id:parseInt(filesId),name:'资源'})
}
trigger('attachmentAddlog', {id:parseInt(filesId),name:'资源',coursesecondcategoryid:coursesecondcategoryid})
}
}
@ -557,6 +561,7 @@ class Fileslists extends Component{
this.onCheckBoxChange(checkBoxValues)
}
PaginationTask=(page)=>{
console.log(3)
let {search,order,selectpage,checkAllValue,checkBoxValues}=this.state;
let selectpagetype=selectpage===page?true:false
@ -631,6 +636,7 @@ class Fileslists extends Component{
Updateresourcepage=()=>{
console.log(4)
let{pagesize,tagname,searchValue,page,sort,sorttype,coursesecondcategoryid}=this.state;
this.getfileslist(pagesize,page,tagname,searchValue,sort,sorttype,coursesecondcategoryid);
}
@ -1012,9 +1018,7 @@ class Fileslists extends Component{
margin-left: 10px;
padding: 10px;
}
.bordboom{
border-bottom: 1 solid red;
}
`}
</style>
<ul className="drop_down_menu" style={{"right":"0px","left":"unset","min-width":'180px'}}>
@ -1038,17 +1042,17 @@ class Fileslists extends Component{
filesId&&filesId===itm.value?"":
<div>
<div className="bordboom" style={{display:'flex',marginTop:15,height:30}}>
<div onClick={() => this.moveTos(itm.value )} style={{marginLeft:15,width:200,color:'#000000',overflow: 'hidden',textOverflow:'ellipsis',whiteSpace: 'nowrap'}}>{itm.title}</div>
{itm.children.length===0?'':<i style={{marginLeft:15}} onClick={() => this.istowshow(itm,filesId)} className="iconfont icon-xiajiantou font-12 ml2"></i>}
<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>}
</div>
{ this.state.istowshowid===itm.value?
itm.children.map((tt,ti) => {
return(
filesId&&filesId===itm.id?"":
<div style={{marginLeft:30}} key={ti} id={tt.value} onClick={() => this.moveTos(tt.value )} title={tt.name}>{tt.title}</div>
)
})
:''}
{ this.state.istowshowid===itm.value?
itm.children.map((tt,ti) => {
return(
filesId&&filesId===itm.id?"":
<div style={{marginLeft:30}} key={ti} id={tt.value} onClick={() => this.moveTos(tt.value )} title={tt.name}>{tt.title}</div>
)
})
:''}
</div>
)
})

@ -74,9 +74,7 @@ class Coursesleftnav extends Component{
sanshow:'',
sansandiantype:undefined,
//新增参数判断打开关闭 默认关闭
showPreson:true,
//判断二级还是三级目录点击
sanclick:'issan',
showPreson:false,
//获取资源id 判断是否选中的事资源来判控
treeDataid:'',
//默认值
@ -201,8 +199,7 @@ class Coursesleftnav extends Component{
this.Navmodalnames(e,5,"editSecondname", data.id, data.name);
}
attachmentAddlog=(e,data)=>{
console.log(data.id,data.name)
this.Navmodalnames(e,1,"attachment",data.id,data.name);
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);
@ -407,13 +404,11 @@ class Coursesleftnav extends Component{
}
selectnavids=(e,key,id,type,urls,index,santype)=>{
const doesShow = this.state.showPreson;
this.setState({
selectnavid:true,
newselectnavid:id,
url:urls,
showPreson:santype==='san'?!doesShow:'',
indexs:index
})
this.props.updataleftNavfun();
@ -612,7 +607,7 @@ class Coursesleftnav extends Component{
}
Navmodalnames=(e,id,type,setnavid,name,towid)=>{
Navmodalnames=(e,id,type,setnavid,name,towid,showPreson)=>{
e.stopPropagation();//阻止冒泡
this.getatahcment()
navidtype=false
@ -625,6 +620,7 @@ class Coursesleftnav extends Component{
Navmodaltypename:id,
Navmodalziyname:name,
treedefaultValue:towid,
showPreson:showPreson,
setnavid:setnavid,
parentid:towid,
NavmodalValue:""
@ -639,6 +635,7 @@ class Coursesleftnav extends Component{
Navmodaltypename:id,
setnavid:setnavid,
treedefaultValue:towid,
showPreson:showPreson,
Navmodalziyname:name,
parentid:towid,
NavmodalValue:name
@ -723,7 +720,6 @@ class Coursesleftnav extends Component{
if(type===true){
this.updasaveNavmoda()
trigger('files')
}else{
this.updasaveNavmoda()
this.props.history.push(`/classrooms/${coursesId}/file/${result.data.category_id}`);
@ -1078,7 +1074,7 @@ class Coursesleftnav extends Component{
let {twosandiantypes,twosandiantypenum}=this.state;
return (item.type==="graduation"?"": <div className={item.type===twosandiantypes&&twosandiantypenum===index?"sandianboxs":"sandianboxs"} >
{/*作业/资源*/}
{item.type==="attachment"&&san!=='san'?<div onClick={e=>this.Navmodalnames(e,1,"attachment",item.id,"资源",iem.category_id)}>新建目录</div>:""}
{item.type==="attachment"&&san!=='san'?<div onClick={e=>this.Navmodalnames(e,1,"attachment",item.id,"资源",iem.category_id,true)}>新建目录</div>:""}
{item.type==="shixun_homework"||item.type==="attachment"||item.type==="graduation"||item.type==="common_homework"||item.type==="group_homework"?<div onClick={e=>this.Navmodalnames(e,4,"editSecondname",iem.category_id,iem.category_name)}>重命名</div>:""}
{item.type==="shixun_homework"||item.type==="attachment"||item.type==="common_homework"||item.type==="group_homework"?<div onClick={e=>this.deleteSecondary(e,1,iem.category_id)}>删除</div>:""}
{/*分班*/}
@ -1201,6 +1197,7 @@ class Coursesleftnav extends Component{
dropdownStyle={{ maxHeight: 400 ,width:300,overflow: 'auto' }}
treeData={this.state.treeData}
placeholder="资源"
disabled={this.state.showPreson}
defaultValue={this.state.treedefaultValue}
treeDefaultExpandAll
onChange={this.tronChange}
@ -1376,16 +1373,16 @@ class Coursesleftnav extends Component{
</a>
{
this.props.location.pathname!==iem.second_category_url?"":iem.third_category.map((itt,index)=>{
iem.third_category===undefined?"":iem.third_category.map((itt,index)=>{
if(itt.category_type!=="attachment"){
return
return
}
return(
<div onClick={this.getatahcment}>
<div onClick={this.getatahcment} style={{display:this.state.newselectnavid===undefined?'none':itt.parent_id===this.state.newselectnavid?'block':'none'}}>
{/*"/classrooms/"+this.props.match.params.coursesId+"/"+item.type+"/"+iem.category_type+"/"+iem.category_id*/}
<a className={"Draggablelichild"} key={index}>
<li className="clearfix width93 Draggableli" key={index} onClick={(e)=>this.selectnavids(e,key,itt.category_id,item.type+"child",itt.second_category_url,key)} onMouseLeave={(e)=>this.sansandianhide(e,index,item.type)} onMouseEnter={(e)=>this.sansandianshow(e,index,item.type,itt.category_name)}
<li className="clearfix width93 Draggableli" key={index} onClick={(e)=>this.selectnavids(e,key,itt.parent_id,item.type+"child",itt.second_category_url,key)} onMouseLeave={(e)=>this.sansandianhide(e,index,item.type)} onMouseEnter={(e)=>this.sansandianshow(e,index,item.type,itt.category_name)}
key={index}
ref={provided.innerRef}
{...provided.draggableProps}
@ -1393,7 +1390,7 @@ class Coursesleftnav extends Component{
// title={iem.category_name.length<10?"":iem.category_name}
>
<a className="fl pl46 pd0 Draggablelichild">
<span style={{marginLeft:20}} className={this.props.location.pathname===itt.second_category_url?"color-blue fl ml38 maxwidth170 task-hide Draggablelichild":"fl ml38 maxwidth170 task-hide Draggablelichild"} onMouseEnter={(e)=>this.sansandianshowys(e,index,item.type)}>{itt.category_name}</span>
<span style={{marginLeft:20}} className={this.props.location.pathname===itt.second_category_url?"color-blue fl ml38 maxwidth170 task-hide Draggablelichild":"fl ml38 maxwidth170 task-hide Draggablelichild"} onMouseEnter={(e)=>this.sansandianshowys(e,index,item.type)}>{itt.category_name}</span>
<span className={sansandiantype===undefined?this.props.location.pathname===itt.second_category_url?"fr mr20 color-blue Draggablelichild font-14":"fr mr20 color999 Draggablelichild font-14":item.type===twosandiantypes&&sansandiantype===index&&itt.category_id!=0?"none":this.props.location.pathname===itt.second_category_url?"fr mr20 color-blue Draggablelichild font-14":"fr mr20 color999 Draggablelichild font-14"} >{itt.category_count===0?"":itt.category_count}</span>
@ -1416,7 +1413,7 @@ class Coursesleftnav extends Component{
</li>
</a>
</div>
</div>
)
})

@ -47,7 +47,11 @@
margin-left: 73%;
}
.bordboom{
width: 100%;
border-bottom: 1 solid red;
}
.guiimgcontee{
width: 100%;

Loading…
Cancel
Save