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

courseware
dinglink 5 years ago
parent fc781e15e1
commit 0438df7ce9

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

@ -74,9 +74,7 @@ class Coursesleftnav extends Component{
sanshow:'', sanshow:'',
sansandiantype:undefined, sansandiantype:undefined,
//新增参数判断打开关闭 默认关闭 //新增参数判断打开关闭 默认关闭
showPreson:true, showPreson:false,
//判断二级还是三级目录点击
sanclick:'issan',
//获取资源id 判断是否选中的事资源来判控 //获取资源id 判断是否选中的事资源来判控
treeDataid:'', treeDataid:'',
//默认值 //默认值
@ -201,8 +199,7 @@ class Coursesleftnav extends Component{
this.Navmodalnames(e,5,"editSecondname", data.id, data.name); this.Navmodalnames(e,5,"editSecondname", data.id, data.name);
} }
attachmentAddlog=(e,data)=>{ attachmentAddlog=(e,data)=>{
console.log(data.id,data.name) this.Navmodalnames(e,1,"attachment",data.id,data.name,data.coursesecondcategoryid,data.coursesecondcategoryid===undefined?false:true);
this.Navmodalnames(e,1,"attachment",data.id,data.name);
} }
flieseditDir=(e, data)=>{ flieseditDir=(e, data)=>{
this.Navmodalnames(e,4,"editSecondname",data.id,data.name); 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)=>{ selectnavids=(e,key,id,type,urls,index,santype)=>{
const doesShow = this.state.showPreson;
this.setState({ this.setState({
selectnavid:true, selectnavid:true,
newselectnavid:id, newselectnavid:id,
url:urls, url:urls,
showPreson:santype==='san'?!doesShow:'',
indexs:index indexs:index
}) })
this.props.updataleftNavfun(); 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();//阻止冒泡 e.stopPropagation();//阻止冒泡
this.getatahcment() this.getatahcment()
navidtype=false navidtype=false
@ -625,6 +620,7 @@ class Coursesleftnav extends Component{
Navmodaltypename:id, Navmodaltypename:id,
Navmodalziyname:name, Navmodalziyname:name,
treedefaultValue:towid, treedefaultValue:towid,
showPreson:showPreson,
setnavid:setnavid, setnavid:setnavid,
parentid:towid, parentid:towid,
NavmodalValue:"" NavmodalValue:""
@ -639,6 +635,7 @@ class Coursesleftnav extends Component{
Navmodaltypename:id, Navmodaltypename:id,
setnavid:setnavid, setnavid:setnavid,
treedefaultValue:towid, treedefaultValue:towid,
showPreson:showPreson,
Navmodalziyname:name, Navmodalziyname:name,
parentid:towid, parentid:towid,
NavmodalValue:name NavmodalValue:name
@ -723,7 +720,6 @@ class Coursesleftnav extends Component{
if(type===true){ if(type===true){
this.updasaveNavmoda() this.updasaveNavmoda()
trigger('files') trigger('files')
}else{ }else{
this.updasaveNavmoda() this.updasaveNavmoda()
this.props.history.push(`/classrooms/${coursesId}/file/${result.data.category_id}`); this.props.history.push(`/classrooms/${coursesId}/file/${result.data.category_id}`);
@ -1078,7 +1074,7 @@ class Coursesleftnav extends Component{
let {twosandiantypes,twosandiantypenum}=this.state; let {twosandiantypes,twosandiantypenum}=this.state;
return (item.type==="graduation"?"": <div className={item.type===twosandiantypes&&twosandiantypenum===index?"sandianboxs":"sandianboxs"} > 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==="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>:""} {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' }} dropdownStyle={{ maxHeight: 400 ,width:300,overflow: 'auto' }}
treeData={this.state.treeData} treeData={this.state.treeData}
placeholder="资源" placeholder="资源"
disabled={this.state.showPreson}
defaultValue={this.state.treedefaultValue} defaultValue={this.state.treedefaultValue}
treeDefaultExpandAll treeDefaultExpandAll
onChange={this.tronChange} onChange={this.tronChange}
@ -1376,16 +1373,16 @@ class Coursesleftnav extends Component{
</a> </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"){ if(itt.category_type!=="attachment"){
return 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*/} {/*"/classrooms/"+this.props.match.params.coursesId+"/"+item.type+"/"+iem.category_type+"/"+iem.category_id*/}
<a className={"Draggablelichild"} key={index}> <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} key={index}
ref={provided.innerRef} ref={provided.innerRef}
{...provided.draggableProps} {...provided.draggableProps}
@ -1393,7 +1390,7 @@ class Coursesleftnav extends Component{
// title={iem.category_name.length<10?"":iem.category_name} // title={iem.category_name.length<10?"":iem.category_name}
> >
<a className="fl pl46 pd0 Draggablelichild"> <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> <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> </li>
</a> </a>
</div> </div>
) )
}) })

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

Loading…
Cancel
Save