From dda3cb00d9e1ea37a6fc49459135c98f9f047b27 Mon Sep 17 00:00:00 2001 From: wenlele Date: Tue, 29 Aug 2023 09:24:27 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=9B=86=E5=A4=A7=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/routes/project/index.js | 3 - .../assets/images/projectGroup/backend.png | Bin 0 -> 911 bytes .../sections/projectGroup/actions/group.js | 11 ++ .../projectGroup/components/header.jsx | 8 ++ .../projectGroup/containers/bigscreen.jsx | 9 +- .../sections/projectGroup/containers/index.js | 3 +- .../projectGroup/containers/statistic.jsx | 125 +++++++++++++++++- .../src/sections/projectGroup/routes.js | 13 +- web/client/src/utils/webapi.js | 1 + 9 files changed, 162 insertions(+), 11 deletions(-) create mode 100644 web/client/assets/images/projectGroup/backend.png diff --git a/api/app/lib/routes/project/index.js b/api/app/lib/routes/project/index.js index 4cb4c3a..395f6c2 100644 --- a/api/app/lib/routes/project/index.js +++ b/api/app/lib/routes/project/index.js @@ -43,9 +43,6 @@ module.exports = function (app, router, opts) { app.fs.api.logAttr['GET/project/group/statistic'] = { content: '获取项目分组统计信息', visible: true }; router.get('/project/group/statistic', projectGroup.groupStatistic); - app.fs.api.logAttr['GET/project/group/statistic'] = { content: '获取项目分组统计信息', visible: true }; - router.get('/project/group/statistic', projectGroup.groupStatistic); - app.fs.api.logAttr['GET/project/group/statistic/online'] = { content: '获取项目分组在线率统计信息', visible: true }; router.get('/project/group/statistic/online', projectGroup.groupStatisticOnline); }; \ No newline at end of file diff --git a/web/client/assets/images/projectGroup/backend.png b/web/client/assets/images/projectGroup/backend.png new file mode 100644 index 0000000000000000000000000000000000000000..55445720085a78835690fe2ed798f5f831418b67 GIT binary patch literal 911 zcmV;A191F_P)Px&Nl8ROR7gv`mdQ_3Q543%bNeg>MFeA9IVH|<0~%vo>B?b`B8U>PEt(jE(S$PS z(^5bsaY!^;G$ArL^dFF&JEPI1ByNoEHE0~D9qwmtpAQ?TT4?pGn%BPjJKyO&-#LN; z!nSQ?+qSOvN9q7J0f-YK0ulm6%6BL}1%3DKM^C>8C{h3qwY85tvDm(Jy}zdsNCyG= z20|IwPk2(m1&Z>zOnE}lXxpcPfF@%=crXyDp{T6{lcF=g#bCOckSYS7g;*?tha&@> zHwy&js*jUIT}$su(L5>C8(bm3I%RCA85wcW7#^FnL z76^3I1r)*{RtRKZH%0`07`kT z58nYdL4jy5IpxLQsKctJ8sUJ0c<#7FXW^Z7GSLwObRl_n^!oK0h%Bc z;MEY5#eAh??E6IWS}bNKW&i_$zKSn8)epgX0FxQFpH2Ln3=pJ9W0~}c!aG%7(mK?C z=4*pLvWMW=sXlCKvVAG9cQ=V8#_g%{A6c1dXdM?N+o`$Im^2`tpxHKhxAR@jlFmj< z_HTb#*QGV06X!uxY9$HL>cZ%q(90dRZ9TE=RL)y!UVimzW8SS%SvjGi(O~jmbMIpoOWn#wyWaGiV#@klu`|k4zv%s%8TSQ4(!O0i{)`E*#=^Z zaW+7WjSjT;J78qSRZ)SBEs;%H^D>DNA)Y15%Pz#OoSJl3j%;9kq2tLtG_$D*cUtpQ z`@I|OAF^TDz#=T$k=2tQhXppFaKn*%IX}PDaV}HIa%{qIC@+ ll?1*NZB6{|i||}l{U5)VMv?RWBs>5B002ovPDHLkV1klmnEL<# literal 0 HcmV?d00001 diff --git a/web/client/src/sections/projectGroup/actions/group.js b/web/client/src/sections/projectGroup/actions/group.js index c84e90c..e7d2b18 100644 --- a/web/client/src/sections/projectGroup/actions/group.js +++ b/web/client/src/sections/projectGroup/actions/group.js @@ -32,4 +32,15 @@ export function delProjectGroup (id) { url: `${ApiTable.projectGroup}?groupId=${id}`, msg: { option: "删除项目分组" }, }); +} + +export function groupStatistic () { + return (dispatch) => basicAction({ + type: "get", + dispatch: dispatch, + actionType: "GET_GROPUP_STATISTICS", + url: `${ApiTable.groupStatistic}`, + msg: { error: "获取项目分组统计信息失败" }, + reducer: { name: "groupStatistic", params: { noClear: true } }, + }); } \ No newline at end of file diff --git a/web/client/src/sections/projectGroup/components/header.jsx b/web/client/src/sections/projectGroup/components/header.jsx index 3ea6e27..62a08fe 100644 --- a/web/client/src/sections/projectGroup/components/header.jsx +++ b/web/client/src/sections/projectGroup/components/header.jsx @@ -110,6 +110,14 @@ const Header = (props) => { {weatherMap[weatherRealtime?.skycon]} +
+
+ + 返回后台 +
) diff --git a/web/client/src/sections/projectGroup/containers/bigscreen.jsx b/web/client/src/sections/projectGroup/containers/bigscreen.jsx index 51790aa..3f12b24 100644 --- a/web/client/src/sections/projectGroup/containers/bigscreen.jsx +++ b/web/client/src/sections/projectGroup/containers/bigscreen.jsx @@ -5,7 +5,13 @@ import Body from '../components/body' import Card from '../components/card' import '../style.less' -const Bigscreen = (props) => { +const Bigscreen = ({ dispatch, actions, user, history, clientHeight }) => { + + useEffect(() => { + let projectGroupId = localStorage.getItem('project_group_id') + console.log(projectGroupId); + }) + return (
@@ -24,6 +30,7 @@ function mapStateToProps (state) { return { user: auth.user, actions: global.actions, + clientHeight: global.clientHeight, }; } diff --git a/web/client/src/sections/projectGroup/containers/index.js b/web/client/src/sections/projectGroup/containers/index.js index 3818a4a..3f751da 100644 --- a/web/client/src/sections/projectGroup/containers/index.js +++ b/web/client/src/sections/projectGroup/containers/index.js @@ -1,4 +1,5 @@ 'use strict'; import Statistic from './statistic' +import Bigscreen from './bigscreen' -export { Statistic }; \ No newline at end of file +export { Statistic ,Bigscreen}; \ No newline at end of file diff --git a/web/client/src/sections/projectGroup/containers/statistic.jsx b/web/client/src/sections/projectGroup/containers/statistic.jsx index a76caef..95a4bd5 100644 --- a/web/client/src/sections/projectGroup/containers/statistic.jsx +++ b/web/client/src/sections/projectGroup/containers/statistic.jsx @@ -1,19 +1,133 @@ import React, { useEffect, useRef, useState } from 'react'; 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 Body from '../components/body' import Card from '../components/card' 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) =>
{ + localStorage.setItem('project_group_id', row.id) + history.push({ + pathname: `/projectGroup/bigscreen`, + }) + }}>{text}
+ }, { + 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 (
- - 123 + +
+ + + +
+ +
+ + 共{groupStatistic?.length || 0}条信息 + + { + setQuery({ limit: pageSize, page: currentPage - 1 }); + // page.current = currentPage - 1 + // setChange(!change) + }} + /> +
+
+ @@ -21,10 +135,13 @@ const Statistic = (props) => { } function mapStateToProps (state) { - const { auth, global, } = state; + const { auth, global, groupStatistic } = state; return { + clientHeight: global.clientHeight, user: auth.user, actions: global.actions, + groupStatistic: groupStatistic?.data || [], + loading: groupStatistic.isRequesting, }; } diff --git a/web/client/src/sections/projectGroup/routes.js b/web/client/src/sections/projectGroup/routes.js index 1db3bed..dd7a581 100644 --- a/web/client/src/sections/projectGroup/routes.js +++ b/web/client/src/sections/projectGroup/routes.js @@ -1,4 +1,4 @@ -import { Statistic } from './containers'; +import { Statistic, Bigscreen } from './containers'; export default [{ type: 'outer', @@ -8,4 +8,13 @@ export default [{ breadcrumb: '项目集', component: Statistic, } -}]; \ No newline at end of file +}, { + type: 'outer', + route: { + path: '/projectGroup/bigscreen', + key: 'bigscreen', + breadcrumb: '数据大屏 ', + component: Bigscreen, + } +} +]; \ No newline at end of file diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index 6251a0b..2fade7a 100644 --- a/web/client/src/utils/webapi.js +++ b/web/client/src/utils/webapi.js @@ -38,6 +38,7 @@ export const ApiTable = { //项目分组 projectGroup: 'project/group', + groupStatistic:'project/group/statistic', //告警 getProjectPoms: 'project/poms', //获取已绑定项目