From d0cc2c6bbc1cbf58021b1eb0fdea2bf10e6ac7b4 Mon Sep 17 00:00:00 2001
From: caicai8 <1149225589@qq.com>
Date: Tue, 31 Dec 2019 16:22:39 +0800
Subject: [PATCH] time
---
public/react/src/forge/Main/Index.js | 95 +++++++++++++++++-------
public/react/src/forge/Main/IndexItem.js | 79 ++++++++++----------
public/react/src/forge/Main/list.css | 1 +
3 files changed, 109 insertions(+), 66 deletions(-)
diff --git a/public/react/src/forge/Main/Index.js b/public/react/src/forge/Main/Index.js
index f80466b66..08ab2a23b 100644
--- a/public/react/src/forge/Main/Index.js
+++ b/public/react/src/forge/Main/Index.js
@@ -1,6 +1,6 @@
import React , { Component } from 'react';
-import { Menu , Input , Dropdown , Icon, Result } from 'antd';
+import { Menu , Input , Dropdown , Icon, Spin , Pagination } from 'antd';
import { Link } from 'react-router-dom';
import '../css/index.css'
import './list.css';
@@ -18,7 +18,9 @@ class Index extends Component{
page:1,
limit:15,
search:undefined,
- sort:undefined
+ sort:undefined,
+ total:0,
+ isSpin:true,
}
}
@@ -34,30 +36,67 @@ class Index extends Component{
user_id:current_user && current_user.user_id,
page,
limit,
- name:search,
+ search,
sort_by:sort
}}).then((result)=>{
if(result){
this.setState({
- projectsList:result.data
+ projectsList:result.data.projects,
+ total:result.data.total_count,
+ isSpin:false
})
}
}).catch((error)=>{})
}
+ // 排序
+ ChangeSoryBy=(e)=>{
+ this.setState({
+ sort_by:e.key,
+ page:1,
+ search:undefined,
+ isSpin:true
+ })
+ const { limit } = this.state;
+ this.getListData(1 ,limit , undefined , e.key);
+ }
+
+ // 搜索
+ searchFun=(value)=>{
+ // console.log(value)
+ this.setState({
+ page:1,
+ search:value,
+ isSpin:true
+ })
+ const { limit , sort } = this.state;
+ this.getListData(1 ,limit, value , sort);
+ }
+ // 翻页
+ ChangePage=(page)=>{
+ this.setState({
+ page
+ })
+ const { limit, search , sort } = this.state;
+ this.getListData(page,limit, search , sort);
+ }
+
render(){
const menu=(
-