|
@ -1,19 +1,133 @@ |
|
|
import React, { useEffect, useRef, useState } from 'react'; |
|
|
import React, { useEffect, useRef, useState } from 'react'; |
|
|
import { connect } from 'react-redux'; |
|
|
import { connect } from 'react-redux'; |
|
|
|
|
|
import { Skeleton, Button, Pagination, Form, Popconfirm, Table, Tooltip } from '@douyinfe/semi-ui'; |
|
|
|
|
|
import { SkeletonScreen, } from "$components"; |
|
|
import Header from '../components/header'; |
|
|
import Header from '../components/header'; |
|
|
import Body from '../components/body' |
|
|
import Body from '../components/body' |
|
|
import Card from '../components/card' |
|
|
import Card from '../components/card' |
|
|
import '../style.less' |
|
|
import '../style.less' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Statistic = (props) => { |
|
|
const Statistic = ({ dispatch, actions, user, history, loading, groupStatistic, clientHeight }) => { |
|
|
|
|
|
const { projectGroup } = actions; |
|
|
|
|
|
|
|
|
|
|
|
const [query, setQuery] = useState({ limit: 10, page: 0 }); //页码信息 |
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|
dispatch(projectGroup.groupStatistic()) |
|
|
|
|
|
|
|
|
|
|
|
}, []) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let columns = [ |
|
|
|
|
|
{ |
|
|
|
|
|
title: '项目集名称', |
|
|
|
|
|
dataIndex: "name", |
|
|
|
|
|
key: 'name', |
|
|
|
|
|
width: "30%", |
|
|
|
|
|
render: (text, row) => <div style={{ cursor: 'pointer' }} onClick={() => { |
|
|
|
|
|
localStorage.setItem('project_group_id', row.id) |
|
|
|
|
|
history.push({ |
|
|
|
|
|
pathname: `/projectGroup/bigscreen`, |
|
|
|
|
|
}) |
|
|
|
|
|
}}>{text}</div> |
|
|
|
|
|
}, { |
|
|
|
|
|
title: '项目集类型', |
|
|
|
|
|
dataIndex: "name", |
|
|
|
|
|
key: 'name', |
|
|
|
|
|
render: (_, row) => '--' |
|
|
|
|
|
}, { |
|
|
|
|
|
title: '项目个数', |
|
|
|
|
|
dataIndex: "pomsProjectIds", |
|
|
|
|
|
key: 'pomsProjectIds', |
|
|
|
|
|
render: (_, row) => row?.pomsProjectIds?.length || 0 |
|
|
|
|
|
}, { |
|
|
|
|
|
title: '结构物数量', |
|
|
|
|
|
dataIndex: "strucCount", |
|
|
|
|
|
key: 'strucCount', |
|
|
|
|
|
}, { |
|
|
|
|
|
title: '流转工单数', |
|
|
|
|
|
dataIndex: "name", |
|
|
|
|
|
key: 'name', |
|
|
|
|
|
render: (_, row) => Math.floor(Math.random() * 10) |
|
|
|
|
|
}, { |
|
|
|
|
|
title: '中断时长', |
|
|
|
|
|
dataIndex: "maxOffLineTime", |
|
|
|
|
|
key: 'maxOffLineTime', |
|
|
|
|
|
}, { |
|
|
|
|
|
title: '今日告警个数', |
|
|
|
|
|
dataIndex: "name", |
|
|
|
|
|
key: 'name', |
|
|
|
|
|
render: (_, row) => Math.floor(Math.random() * 20) |
|
|
|
|
|
} |
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
const handleRow = (record, index) => { |
|
|
|
|
|
return { |
|
|
|
|
|
style: { |
|
|
|
|
|
background: 'linear-gradient(180deg, #f1f7ff00 0%, #DEEBFF 100%)', |
|
|
|
|
|
}, |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<div className='project-group'> |
|
|
<div className='project-group'> |
|
|
<Header /> |
|
|
<Header /> |
|
|
<Body> |
|
|
<Body> |
|
|
<Card title="12312312"> |
|
|
<Card title="重点项目集"> |
|
|
123 |
|
|
<div style={{ |
|
|
|
|
|
marginTop: 10, height: clientHeight - 140, |
|
|
|
|
|
display: 'flex', flexDirection: 'column', justifyContent: "space-between" |
|
|
|
|
|
}}> |
|
|
|
|
|
<Skeleton |
|
|
|
|
|
loading={loading} |
|
|
|
|
|
// loading={false} |
|
|
|
|
|
active={true} |
|
|
|
|
|
placeholder={SkeletonScreen()} |
|
|
|
|
|
> |
|
|
|
|
|
<Table |
|
|
|
|
|
rowKey="name" |
|
|
|
|
|
scroll={{ y: clientHeight - 245 }} |
|
|
|
|
|
columns={columns} |
|
|
|
|
|
dataSource={groupStatistic} |
|
|
|
|
|
bordered={false} |
|
|
|
|
|
hideExpandedColumn={false} |
|
|
|
|
|
empty="暂无数据" |
|
|
|
|
|
// expandedRowRender={expandRowRender} |
|
|
|
|
|
pagination={false} |
|
|
|
|
|
onRow={handleRow} |
|
|
|
|
|
/> |
|
|
|
|
|
</Skeleton> |
|
|
|
|
|
<div |
|
|
|
|
|
style={{ |
|
|
|
|
|
display: "flex", |
|
|
|
|
|
justifyContent: "flex-end", |
|
|
|
|
|
padding: "20px 20px", |
|
|
|
|
|
}} |
|
|
|
|
|
> |
|
|
|
|
|
|
|
|
|
|
|
<div style={{ display: 'flex', }}> |
|
|
|
|
|
<span style={{ lineHeight: "30px", fontSize: 13, color: 'rgba(0,90,189,0.8)' }}> |
|
|
|
|
|
共{groupStatistic?.length || 0}条信息 |
|
|
|
|
|
</span> |
|
|
|
|
|
<Pagination |
|
|
|
|
|
className="" |
|
|
|
|
|
total={groupStatistic?.length || 0} |
|
|
|
|
|
showSizeChanger |
|
|
|
|
|
currentPage={query.page + 1} |
|
|
|
|
|
pageSizeOpts={[10, 20, 30, 40]} |
|
|
|
|
|
onChange={(currentPage, pageSize) => { |
|
|
|
|
|
setQuery({ limit: pageSize, page: currentPage - 1 }); |
|
|
|
|
|
// page.current = currentPage - 1 |
|
|
|
|
|
// setChange(!change) |
|
|
|
|
|
}} |
|
|
|
|
|
/> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
</Card> |
|
|
</Card> |
|
|
</Body> |
|
|
</Body> |
|
|
</div> |
|
|
</div> |
|
@ -21,10 +135,13 @@ const Statistic = (props) => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function mapStateToProps (state) { |
|
|
function mapStateToProps (state) { |
|
|
const { auth, global, } = state; |
|
|
const { auth, global, groupStatistic } = state; |
|
|
return { |
|
|
return { |
|
|
|
|
|
clientHeight: global.clientHeight, |
|
|
user: auth.user, |
|
|
user: auth.user, |
|
|
actions: global.actions, |
|
|
actions: global.actions, |
|
|
|
|
|
groupStatistic: groupStatistic?.data || [], |
|
|
|
|
|
loading: groupStatistic.isRequesting, |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|