From 606d119c6c3ea5daf4dbc24de0a5ed4b79fe9f2b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Wed, 11 Sep 2019 18:55:46 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E7=89=88=E9=80=89=E6=8B=A9=E5=AE=9E?=
=?UTF-8?q?=E8=AE=ADbuild?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../courses/coursesPublic/NewShixunModel.js | 188 ++++++++++--------
.../courses/coursesPublic/Newshixunmodel.css | 3 +-
.../courses/shixunHomework/shixunHomework.js | 45 +++--
public/react/src/search/searchc.css | 2 +-
4 files changed, 138 insertions(+), 100 deletions(-)
diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js
index d16581962..8737178ec 100644
--- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js
+++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js
@@ -7,55 +7,50 @@ class NewShixunModel extends Component{
constructor(props){
super(props)
this.state={
- diff:0,
shixun_list:undefined,
shixuns_count:undefined,
Grouplist:[],
+ page:1,
+ type:'all',
+ status:'all',
+ search:undefined,
+ order:'desc',
+ diff:0,
+ limit:15,
}
}
componentDidMount() {
- console.log(this.props.type)
-
- if(this.props.type==='shixun'){
- let url="/shixuns/shixun_list.json"
- axios.get(url).then((response) => {
-
- if(response.data){
- console.log(response.data);
- if(response.data.status===0){
- }
- }
-
- })
- }else{
- let url="/shixuns/shixun_list.json"
- axios.get(url,{params:{
- type:'all', //这是带过来的值
- status:'all',
- search:undefined,
- diff:0,
- order:'desc',
- page:1,
- limit:15,
- }}).then((response) => {
-
- if(response.data){
- this.setState({
- shixun_list:response.data.shixun_list,
- shixuns_count:response.data.shixuns_count,
- })
- }
-
- })
+ let{page,type,status,search,order,diff,limit}=this.state;
+ this.getdatalist(page,type,status,search,order,diff,limit)
+ }
- }
+ getdatalist=(page,type,status,search,order,diff,limit)=>{
+ let url="/shixuns/shixun_list.json"
+ axios.get(url,{params:{
+ page,
+ type,
+ status,
+ search,
+ order,
+ diff,
+ limit
+ }}).then((response) => {
+ if(response.data){
+ this.setState({
+ shixun_list:response.data.shixun_list,
+ shixuns_count:response.data.shixuns_count,
+ })
+ }
+ })
}
- DropdownClick=(type)=>{
+ DropdownClick=(diff)=>{
this.setState({
- diff:type
+ diff:diff
})
+ let{page,type,status,search,order,limit}=this.state;
+ this.getdatalist(page,type,status,search,order,diff,limit)
}
ItsCourse=(item)=>{
@@ -75,39 +70,86 @@ class NewShixunModel extends Component{
Grouplist: Grouplist,
})
}
+
+ PaginationCourse=(pageNumber)=>{
+ this.setState({
+ page:pageNumber
+ })
+ let{type,status,search,order,diff,limit}=this.state;
+ this.getdatalist(pageNumber,type,status,search,order,diff,limit)
+ }
+
+ belongto=(value)=>{
+ this.setState({
+ type:value
+ })
+ let{page,status,search,order,diff,limit}=this.state;
+ this.getdatalist(page,value,status,search,order,diff,limit)
+ }
+
+ updatedlist=(order)=>{
+
+ if(order==="desc"){
+ this.setState({
+ order:"asc"
+ })
+ let{type,page,status,search,diff,limit}=this.state;
+ this.getdatalist(page,type,status,search,"asc",diff,limit)
+ }else{
+ this.setState({
+ order:"desc"
+ })
+ let{type,page,status,search,diff,limit}=this.state;
+ this.getdatalist(page,type,status,search,"desc",diff,limit)
+ }
+
+ }
+
+ setdatafunsval=(e)=>{
+ this.setState({
+ search:e.target.value
+ })
+ }
+ setdatafuns=(value)=>{
+ this.setState({
+ search:value
+ })
+ let{type,page,status,diff,order,limit}=this.state;
+ this.getdatalist(page,type,status,value,order,diff,limit)
+ }
render() {
- let {diff,Grouplist,shixun_list,shixuns_count}=this.state;
+ let {diff,Grouplist,shixun_list,shixuns_count,page,type,order}=this.state;
// let {visible,patheditarry}=this.props;
const menus = (