Merge branches 'dev_aliyun' and 'dev_ysm' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

competitions
杨树明 5 years ago
commit d1b0df49c9

@ -28,7 +28,7 @@ class Fileslists extends Component{
pagesize: 15,
tagname:undefined,
search:undefined,
sort:undefined,
sort:"desc",
sorttype:"created_on",
coursesecondcategoryid:undefined,
filesId:undefined,
@ -49,16 +49,19 @@ class Fileslists extends Component{
checkBoxValues:[],
checkAllValue:false
})
if(this.props.match.params.main_id){
this.seactall();
this.setState({
child:false,
sort:"desc"
})
this.seactall(undefined,"desc");
}else if(this.props.match.params.Id){
this.seactall(parseInt(this.props.match.params.Id),1)
this.setState({
child:true,
sort:"desc"
})
this.seactall(parseInt(this.props.match.params.Id),"desc")
}
this.updadatalist();
on('updateNavSuccess', this.updateNavSuccess)
@ -66,13 +69,14 @@ class Fileslists extends Component{
}
updateNavSuccess=()=>{
let{sort}=this.state;
this.setState({
isSpin:true
})
if(this.props.match.params.main_id){
this.seactall();
this.seactall(undefined,sort);
}else if(this.props.match.params.Id){
this.seactall(parseInt(this.props.match.params.Id),1)
this.seactall(parseInt(this.props.match.params.Id),sort)
}
}
componentDidUpdate = (prevProps) => {
@ -85,8 +89,9 @@ class Fileslists extends Component{
if(this.props.match.params.main_id!=undefined){
this.setState({
child:false,
sort:"desc"
})
this.seactall();
this.seactall(undefined,"desc");
}
}
if(prevProps.match.params.Id != this.props.match.params.Id){
@ -98,8 +103,9 @@ class Fileslists extends Component{
if(this.props.match.params.Id!=undefined){
this.setState({
child:true,
sort:"desc"
})
this.seactall(parseInt(this.props.match.params.Id),1)
this.seactall(parseInt(this.props.match.params.Id),"desc")
}
}
}
@ -138,29 +144,42 @@ class Fileslists extends Component{
}
updatafiled=()=>{
let{sort}=this.state;
if(this.props.match.params.main_id){
this.seactall();
this.seactall(undefined,sort);
}else if(this.props.match.params.Id){
this.seactall(parseInt(this.props.match.params.Id),1)
this.seactall(parseInt(this.props.match.params.Id),sort)
}
}
seactall=(coursesecondcategoryid,type)=>{
seactall=(coursesecondcategoryid,sort)=>{
this.setState({
coursesecondcategoryid:coursesecondcategoryid,
isSpin:true
})
let{pagesize,page,tagname,searchValue,sort,sorttype}=this.state;
let{pagesize,page,tagname,searchValue,sorttype}=this.state;
this.getfileslist(pagesize,page,tagname,searchValue,sort,sorttype,coursesecondcategoryid);
}
onSortTypeChange=(sorttype)=>{
let{pagesize,page,tagname,searchValue,sort,coursesecondcategoryid}=this.state;
let{pagesize,page,tagname,searchValue,sort,coursesecondcategoryid,}=this.state;
let newsort="desc";
if(sort==="desc"){
this.setState({
sorttype:sorttype
sorttype:sorttype,
sort:"asc"
})
this.getfileslist(pagesize,page,tagname,searchValue,sort,sorttype,coursesecondcategoryid);
newsort="asc"
}else{
this.setState({
sorttype:sorttype,
sort:"desc"
})
newsort="desc"
}
this.getfileslist(pagesize,page,tagname,searchValue,newsort,sorttype,coursesecondcategoryid);
}
getfileslist=(pagesize,page,tagname,searchValue,sort,sorttype,coursesecondcategoryid)=>{
@ -176,7 +195,7 @@ class Fileslists extends Component{
page:page,
tag_name:tagname,
search:searchValue,
sort:sort,
sort:sort==="desc"?0:1,
sort_type:sorttype,
course_second_category_id:id
}
@ -353,7 +372,7 @@ class Fileslists extends Component{
Modalstype:false,
})
let {checkBoxValues} = this.state;
let {checkBoxValues,sort} = this.state;
const cid = this.props.match.params.coursesId;
let url="/files/bulk_public.json";
@ -363,7 +382,7 @@ class Fileslists extends Component{
})
.then((response) => {
if (response.data.status == 0) {
this.seactall();
this.updatafiled()
//:response.data.message
this.props.showNotification("更新成功");
this.setState({
@ -680,7 +699,8 @@ class Fileslists extends Component{
shixunmodal,
course_is_public,
filesId,
child
child,
sort
} = this.state;
let category_id= this.props.match.params.category_id;
@ -753,7 +773,7 @@ class Fileslists extends Component{
patheditarry={this.state.patheditarry}
coursesecondcategoryid={this.state.coursesecondcategoryid}
hidecouseShixunModal={this.hidecouseShixunModal}
setupdate={(id)=>this.seactall(id)}
setupdate={(id)=>this.seactall(id,sort)}
attachmentId={this.state.coursesecondcategoryid}
/>:""}
@ -768,7 +788,7 @@ class Fileslists extends Component{
Savesname={"确认"}
Cancel={this.Cancelvisible}
categoryid={category_id}
setupdate={(id)=>this.seactall(id)}
setupdate={(id)=>this.seactall(id,sort)}
has_course_groups={this.state.has_course_groups}
attachmentId={this.state.coursesecondcategoryid}
/>:""}
@ -779,7 +799,7 @@ class Fileslists extends Component{
Settingtype={Settingtype}
discussMessageid={discussMessageid}
course_id={this.props.match.params.coursesId}
setupdate={(id)=>this.seactall(id)}
setupdate={(id)=>this.seactall(id,sort)}
Cancel={this.Cancelvisible}
has_course_groups={this.state.has_course_groups}
attachmentId={this.state.coursesecondcategoryid}
@ -896,16 +916,24 @@ class Fileslists extends Component{
</li>:""}
{this.props.isAdmin()||this.props.isStudent()? <li className="drop_down">
{sorttype === 'created_on' ? '更新时间排序':sorttype === 'downloads' ?'下载次数排序':'引用次数排序'}
<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_normal" style={{width:'130px'}}>
{/*className={sorttype === 'created_on'?"none":""} className={sorttype === 'quotes'?"none":""} className={sorttype === 'downloads'?"none":""} */}
<li style={{width:'130px'}} onClick={() => this.onSortTypeChange('created_on')}>更新时间排序</li>
<li style={{width:'130px'}} onClick={() => this.onSortTypeChange('downloads')}>下载次数排序</li>
{/*<li style={{width:'130px'}} onClick={() => this.onSortTypeChange('quotes')}>引用次数排序</li>*/}
</ul>
<style>
{
`
.fiilssort{
position: absolute;
top: -10px;
}
`
}
</style>
{this.props.isAdmin()||this.props.isStudent()? <li className="drop_down" onClick={() => this.onSortTypeChange('created_on')}>
更新时间
<sapn className="relativef ml5"style={{"top":"2px"}} >
<i className={sort==="asc"?
"iconfont icon-sanjiaoxing-up font-12 color-blue fiilssort" :"iconfont icon-sanjiaoxing-up font-12 fiilssort"}></i>
<i className={sort==="desc"?
"iconfont icon-sanjiaoxing-down font-12 yslbottomsj color-blue":"iconfont icon-sanjiaoxing-down font-12 yslbottomsj"}></i>
</sapn>
</li>:""}
</div>
</div>

Loading…
Cancel
Save