Commit 18e53612 authored by 皮倩雯's avatar 皮倩雯

fix: '仪表盘功能'

parent 870b3da7
Pipeline #78382 waiting for manual action with stages
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
/* eslint-disable no-unused-expressions */
/* eslint-disable func-names */
/* eslint-disable object-shorthand */
import React, { useState, useEffect } from 'react';
import { USER_MODE } from '@/utils/constants';
import {
Spin,
notification,
Tag,
Divider,
Tooltip,
Table,
Progress,
Select,
Dropdown,
Menu,
Empty,
} from 'antd';
import dengPao from '@/assets/images/icons/dengpao.png';
import icon from '@/assets/images/icons/icon.png';
import people from '@/assets/images/icons/pepole.png';
import people1 from '@/assets/images/icons/项目成员.png';
import people2 from '@/assets/images/icons/角色分类.png';
import people3 from '@/assets/images/icons/站点.png';
import data from '@/assets/images/icons/数据量.png';
import table1 from '@/assets/images/icons/table1.png';
import table2 from '@/assets/images/icons/table2.png';
import table3 from '@/assets/images/icons/table3.png';
import table4 from '@/assets/images/icons/table4.png';
import flow from '@/assets/images/icons/flow.png';
import flow1 from '@/assets/images/icons/flow1.png';
import flow2 from '@/assets/images/icons/flow2.png';
import web from '@/assets/images/icons/电脑.png';
import mobile from '@/assets/images/icons/手机.png';
import bubble from '@/assets/images/icons/三角形.png';
import abnormalRed from '@/assets/images/icons/异常红色.png';
import abnormalGreen from '@/assets/images/icons/异常绿色.png';
import abnormalYellow from '@/assets/images/icons/异常黄色.png';
import { useHistory } from 'react-router-dom';
import {
publishGetSolutionList,
getDataBaseConfigNew,
connectionTest,
changeSolution,
} from '@/services/database/api';
import ReactEcharts from 'echarts-for-react';
import { GetBasicInfo, GetGateWay } from '@/services/hostmanager/hostmanager';
import { GetWebSiteConfig } from '@/services/gis/gis';
import { GetOMSDashboard, GetWayPages } from '@/services/homePage/api';
import {
GetVectorService,
GetMaplayerByTerminalType,
getProductList,
} from '@/services/webConfig/api';
import classnames from 'classnames';
import styles from './index.less';
const { Option } = Select;
const HomePage = () => {
const [currentData, setCurrentData] = useState(''); // 解决方案的值
const [currentList, setCurrentList] = useState([]);
const [currentSiteInfo, setCurrentSiteInfo] = useState(''); // 当前站点编号
const [dataBase, setDataBase] = useState([]); // 下拉数组
const [getWayConfig, setGetWayConfig] = useState([]); // 网关状态
const [loading, setLoading] = useState(false);
const [website, setWebsite] = useState([]);
const [keepTableList, setKeepTableList] = useState([]);
const [tip, setTip] = useState([]);
const [dashboardData, setDashboardData] = useState({});
const [pipeArr, setPipeArr] = useState();
const [scheme, setScheme] = useState();
const history = useHistory();
const [state, setState] = useState();
const [product, setProduct] = useState([]);
const [limitsWeb, setLimitsWeb] = useState(0);
const [limitsPhone, setLimitsPhone] = useState(0);
const [mapConfig, setMapConfig] = useState();
const [flag, setFlag] = useState(0);
const [show, setShow] = useState();
useEffect(() => {
setLoading(true);
let user = sessionStorage.getItem('userType');
if (user === USER_MODE.SUPER) {
setShow(true);
} else {
setShow(false);
}
getOMSDashboard();
newGetSolution();
getDataBaseConfig();
getSiteCode();
getGateWay();
pipeNetwork();
getMapScheme();
getLogMessage();
onGetProduct();
getLimits();
getMapLayer();
setTimeout(() => {
setLoading(false);
}, 0);
}, [flag]);
const getLimits = () => {
GetMaplayerByTerminalType({ terminalType: 'web', isBaseMap: false }).then(res => {
if (res.code === '0') {
let length = res.data.optionalLayer.layers.length;
setLimitsWeb(length);
}
});
GetMaplayerByTerminalType({ terminalType: 'phone', isBaseMap: false }).then(res => {
if (res.code === '0') {
let length = res.data.optionalLayer.layers.length;
setLimitsPhone(length);
}
});
};
// 获取产品列表
const onGetProduct = () => {
getProductList().then(res => {
if (res.code === 0) {
let arr = [];
res.data.AllProducts.forEach(i => {
if (i.IsUsed) {
arr.push(i.ProductName);
}
});
setProduct(arr);
}
});
};
const getMapLayer = () => {
GetWebSiteConfig({ client: 'sandbox' }).then(res => {
if (res.code === '0') {
let item = res.data.find(i => i.layerType === 'PipenetLayer');
if (res.data.length > 0 && item) {
setMapConfig(true);
} else {
setMapConfig(false);
}
}
});
};
const getOMSDashboard = () => {
GetOMSDashboard().then(res => {
if (res.code === 0) {
let arr = [];
res.data.Web?.forEach(i => {
arr.push({ type: 'web', value: i });
});
res.data.Mobile?.forEach(i => {
arr.push({ type: 'mobile', value: i });
});
setWebsite(arr);
let newTipList = [];
res.data.用户登录统计?.forEach((i, j) => {
let obj = {
xAxis: j,
yAxis: i.登录次数,
symbol:
'image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAdCAYAAADGgB7AAAAAAXNSR0IArs4c6QAAAe5JREFUWEftls9L22AYx5/nzY9WTWt/iKYwxjL0JJt2Nw8iHQMPUrzun9hfMOgm7C8ZOzrYZRdtKjvNmx4mCImt2sRCxTZV19/NK2/HxtYhJulGPSS3kO/zPJ/3k4cQBADIFvNPEe00IPLsfrQXmhdW4z2qpvZMAP5rYiIkckhGywQAtXYTqq3GR1QN/fVDKfJudjI+cigG0KM2fDk77qBqHr1RpOhbJRy9F2AMImfmwQdz8zp8Y25s+Tvm1pZvzDfmxYDbGv875htza8Bt3t8xT8ay5lFGkSIbj8Mxt/X/JU8phZ3SsY3bp9q6JAY+sV9rguhomEAIhITAnVmbUrDazTtzvwdqrSYUrqy9Psl2UX+FAGuAyDnpQgCT87Hp+PTYxK1xdvKDahnK9esDilhy0pdlkEIZRCHjTNFA1x2jsAhIc09iM9F4cPyvmRQADqvnUKpf5UiHrKUUxZ02Buj0JIO5rKEt8chtLcRlKRIY++OxVruA02trt8dLL1Zl+buXGZ7B2DDV0J9zyH1OTiWCYfHHzuUvK2xH9rkOSaUUxfIC1X+lXgt/1qlmPi0i2VycSoiVZh30y8phl6crq/JseZjeQ4Ox4VlTfykg/6Fr94oE7OXUgzljGKh/YuyXuRMtzQeEbyvyo8KwUKz+BiST/d01eWojAAAAAElFTkSuQmCC',
};
newTipList.push(obj);
});
setTip(newTipList);
let echartsData = res.data.用户登录统计;
echartsData.map(i => {
if (i.月份 !== 1 && i.月份 !== 12) {
let str = i.日期.split('-')[1];
i.日期 = `${str}月`;
}
});
res.data.用户登录统计 = echartsData;
setDashboardData(res.data);
}
});
};
// 获取当前解决方案
const newGetSolution = () => {
publishGetSolutionList({
_version: 9999,
_dc: new Date().getTime(),
})
.then(res => {
if (res.code === 0) {
const { currentSolution, solutions } = res.data;
setCurrentData(currentSolution);
setCurrentList(solutions);
}
})
.finally(() => {});
};
// 获取数据库连接配置信息
const getDataBaseConfig = () => {
getDataBaseConfigNew().then(resnew => {
let res = resnew.data;
setDataBase(res);
onCheck(res);
});
};
// 测试连接
const onCheck = val => {
let str = val ? val : dataBase;
if (!val) {
setLoading(true);
}
connectionTest({
ip: str.ip,
dbName: str.dbName,
userName: str.userName,
password: str.password,
})
.then(res => {
if (!val) {
setLoading(false);
}
if (res.code === 0) {
setState(res.data);
notification.success({
message: '提示',
duration: 3,
description: '连接成功',
});
} else {
notification.error({
message: '提示',
duration: 15,
description: res.msg,
});
}
})
.catch(err => {});
};
// 获取站点编号
const getSiteCode = () => {
GetBasicInfo().then(res => {
if (res.code === 0) {
setCurrentSiteInfo(res.data);
}
});
};
// 获取网关状态
const getGateWay = () => {
GetGateWay().then(res => {
if (res.code === 0) {
setGetWayConfig(res.data);
}
});
};
const getMapScheme = () => {
GetMaplayerByTerminalType({ terminalType: 'scheme', isBaseMap: false }).then(res => {
if (res.code === '0') {
setScheme(res.data.length);
}
});
};
// 获取管网数量
const pipeNetwork = () => {
GetVectorService().then(res => {
if (res.code === 0) {
let num = res.data.VectorList.length;
setPipeArr(num);
}
});
};
// 获取日志表格数据
const getLogMessage = () => {
GetWayPages({
pageIndex: 1,
pageSize: 10,
dateFrom: '2023-08-01 07:38:00',
dateTo: '2023-08-30 23:59:59',
info: '',
isSuccess: false,
}).then(res => {
if (res.code === 0) {
setKeepTableList(res.data.list);
} else {
setKeepTableList([]);
notification.error({
message: '提示',
duration: 3,
description: res.msg,
});
}
});
};
// 切换解决方案
const changeProject = () => {
history.push(`/solution`);
};
// 跳转数据中心
const toDataCenter = () => {
history.push(`/dbm/dbInit`);
};
// 跳转机构管理
const toUserCenter = () => {
history.push(`/authority/user`);
};
// 跳转表/字段
const toTableCenter = () => {
history.push(`/biz/account/table`);
};
// 跳转表/字段
const toFlowCenter = () => {
history.push(`/biz/workflow/center`);
};
// 跳转宿主管理
const toHostCenter = () => {
history.push(`/platform/host`);
};
// 跳转GIS平台
const toGISCenter = () => {
history.push(`/platform/gis/map`);
};
// 跳转日志中心
const toLogCenter = () => {
history.push(`/system/logCenter`);
};
// 登录日志
const loginLog = () => {
history.push(`/system/loginLog`);
};
const option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
},
},
grid: {
top: '20',
left: '0%',
right: '0%',
bottom: '10',
containLabel: true,
},
xAxis: [
{
type: 'category',
data: dashboardData.用户登录统计?.map(i => i.日期),
axisTick: {
alignWithLabel: true,
},
splitLine: {
show: false,
lineStyle: {
type: 'dashed',
color: '#DBE9FB',
},
},
splitArea: {
show: false,
},
axisLabel: {
color: '#666666',
},
axisLine: {
show: true,
lineStyle: {
color: '#DBE9FB',
},
},
},
],
yAxis: [
{
type: 'value',
axisLabel: {
formatter: '{value} ',
color: '#999999',
},
axisLine: {
show: true,
lineStyle: {
type: 'solid',
color: '#DBE9FB',
},
},
splitLine: {
show: true,
lineStyle: {
type: 'dashed',
},
},
},
],
series: [
{
name: '登录次数',
type: 'bar',
barWidth: '20%',
data: dashboardData.用户登录统计?.map(i => i.登录次数),
itemStyle: {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: '#46C705', // 0% 处的颜色
},
{
offset: 1,
color: '#7BE645', // 100% 处的颜色
},
],
global: false, // 缺省为 false
},
},
markPoint: {
data: tip,
symbolSize: [34, 28],
symbolOffset: [0, '-70%'],
label: {
show: true,
formatter: function(param) {
return param.data.yAxis;
},
textStyle: {
fontWeight: 400,
fontSize: 12,
color: 'black',
},
},
},
},
],
};
const columns = [
{
title: '事态',
dataIndex: 'errorMsg',
key: 'errorMsg',
width: 100,
align: 'center',
render: record => {
if (record) {
return (
<Progress className={styles.processRed} percent={100} steps={5} showInfo={false} />
);
}
return (
<Progress className={styles.processGreen} percent={100} steps={5} showInfo={false} />
);
},
},
{
title: '接口名称',
dataIndex: 'path',
key: 'path',
width: 300,
fixed: 'left',
onCell: () => ({
style: {
maxWidth: 400,
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
cursor: 'pointer',
},
}),
render: record => (
<Tooltip placement="topLeft" title={record}>
{record}
</Tooltip>
),
},
{
title: '调用时间',
dataIndex: 'requestDate',
key: 'requestDate',
width: 140,
align: 'center',
},
{
title: '调用结果',
dataIndex: 'errorMsg',
key: 'errorMsg',
width: 100,
align: 'center',
render: record => {
if (record) {
return (
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<div
style={{
width: '6px',
height: '6px',
background: '#FF2929',
borderRadius: '50%',
marginRight: '3px',
}}
/>
<Tooltip title={record}>
<span style={{ color: 'red', fontWeight: 'bold' }}>失败</span>
</Tooltip>
</div>
);
}
return (
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
<div
style={{
width: '6px',
height: '6px',
background: '#46C705',
borderRadius: '50%',
marginRight: '3px',
}}
/>
<span style={{ color: '#6ecd3d', fontWeight: 'bold' }}>成功</span>
</div>
);
},
},
// {
// title: '返回信息',
// dataIndex: 'message',
// key: 'message',
// onCell: () => ({
// style: {
// maxWidth: 400,
// overflow: 'hidden',
// whiteSpace: 'nowrap',
// textOverflow: 'ellipsis',
// cursor: 'pointer',
// },
// }),
// render: record => (
// <Tooltip placement="topLeft" title={record}>
// {record}
// </Tooltip>
// ),
// },
{
title: '请求方法',
dataIndex: 'method',
key: 'method',
width: 80,
align: 'center',
render: record => {
if (record === 'GET') {
return (
<Tag color="orange" style={{ width: '44.44px' }}>
GET
</Tag>
);
}
return <Tag color="green">POST</Tag>;
},
},
{
title: '耗时/ms',
dataIndex: 'consumerTime',
key: 'consumerTime',
align: 'center',
width: 80,
},
{
title: '返回体大小/byte',
dataIndex: 'responseSize',
key: 'responseSize',
width: 130,
align: 'center',
},
{
title: '返回状态码',
dataIndex: 'result',
key: 'result',
width: 100,
align: 'center',
},
];
const buttonMenu = (
<Menu>
{currentList.map((i, j) => (
<Menu.Item key={j} onClick={() => menuChange(i)}>
{i}
</Menu.Item>
))}
</Menu>
);
const menuChange = e => {
setLoading(true);
changeSolution({
solution: e,
})
.then(res => {
if (res.code === 0) {
setFlag(flag + 1);
setCurrentData(e);
notification.success({
message: '提示',
description: '切换成功',
duration: 3,
});
} else {
setLoading(false);
notification.error({
message: '提示',
description: res.msg || '切换失败',
duration: 15,
});
}
})
.catch(err => {
console.error(err);
});
};
return (
<Spin tip="Loading..." spinning={loading}>
<div className={styles.homePage}>
<div className={styles.header}>
<img className={styles.headerImg} src={dengPao} style={{ height: '16px' }} alt="" />
<span className={styles.headerText}>[解决方案] 您当前使用的解决方案是:</span>
<span className={styles.headerTextBold}>{currentData}</span>
{show && (
<Dropdown overlay={buttonMenu}>
<span className={styles.headerChangeBtn}>去切换 >></span>
</Dropdown>
)}
</div>
<div className={styles.contentTop}>
<div className={styles.dataCenter}>
<div className={styles.content}>
<div className={styles.dataCenterLabel}>
<div>服务器IP:</div>
<div>连接数据库:</div>
<div>连接状态:</div>
</div>
<div className={styles.dataCenterValue}>
<div>{dataBase.ip}</div>
<div>{dataBase.dbName}</div>
<div className={styles.fontText}>
<span
className={classnames({
[styles.iconBlue]: state,
[styles.iconGrey]: !state,
})}
/>
{state ? '已接通' : '未接通'}
{show && (
<Tag
color="blue"
style={{ marginLeft: '15px', cursor: 'pointer' }}
onClick={() => onCheck()}
>
测试链接
</Tag>
)}
</div>
</div>
</div>
{show && (
<div className={styles.dataCenterFooter}>
<span onClick={() => toDataCenter()} style={{ cursor: 'pointer' }}>
数据中心 <img src={icon} alt="" />
</span>
</div>
)}
</div>
<div className={styles.userCenter}>
<div className={styles.top}>
<img src={people} alt="" style={{ marginRight: '5px' }} /> 用户总数:
<span className={styles.fontColor}>{dashboardData.用户总数}</span>
</div>
<Divider style={{ color: '#E3E7EC' }} />
<div className={styles.center}>
<div className={styles.item}>
<img src={people1} alt="" /> 机构数量
<div>
<span className={styles.font}>{dashboardData.机构总数}</span>
</div>
</div>
<div className={styles.item}>
<img src={people2} alt="" /> 角色数量
<div>
<span className={styles.font}>{dashboardData.角色总数}</span>
</div>
</div>
<div className={styles.item}>
<img src={people3} alt="" /> 站点数量
<div>
<span className={styles.font}>{dashboardData.站点总数}</span>
</div>
</div>
</div>
<div className={styles.bottom}>
<span onClick={() => toUserCenter()} style={{ cursor: 'pointer' }}>
用户中心 <img src={icon} alt="" />
</span>
</div>
</div>
<div className={styles.tableCenter}>
<div className={styles.top}>
<img src={data} alt="" style={{ marginRight: '5px' }} /> 表单总数:
<span className={styles.fontColor}>{dashboardData.表单总数}</span>
</div>
<Divider style={{ color: '#E3E7EC' }} />
<div className={styles.center}>
<div className={styles.item}>
<img src={table1} alt="" /> 业务表
<div>
<span className={styles.font}>{dashboardData.业务表}</span>
</div>
</div>
<div className={styles.item}>
<img src={table2} alt="" /> 反馈表
<div>
<span className={styles.font}>{dashboardData.反馈表}</span>
</div>
</div>
<div className={styles.item}>
<img src={table3} alt="" /> 台账表
<div>
<span className={styles.font}>{dashboardData.台账表}</span>
</div>
</div>
<div className={styles.item}>
<img src={table4} alt="" /> 其他表
<div>
<span className={styles.font}>{dashboardData.其他表}</span>
</div>
</div>
</div>
<div className={styles.bottom}>
<span onClick={() => toTableCenter()} style={{ cursor: 'pointer' }}>
表单中心 <img src={icon} alt="" />
</span>
</div>
</div>
<div className={styles.flowCenter}>
<div className={styles.top}>
<img src={flow} alt="" style={{ marginRight: '5px' }} /> 流程总数:
<span className={styles.fontColor}>{dashboardData.流程数}</span>
</div>
<Divider style={{ color: '#E3E7EC' }} />
<div className={styles.center}>
<div className={styles.item}>
<img src={flow1} alt="" /> 事件类型
<div>
<span className={styles.font}>{dashboardData.事件类型}</span>
</div>
</div>
<div className={styles.item}>
<img src={flow2} alt="" /> 流程分组
<div>
<span className={styles.font}>{dashboardData.流程分组}</span>
</div>
</div>
</div>
<div className={styles.bottom}>
<span onClick={() => toFlowCenter()} style={{ cursor: 'pointer' }}>
流程中心 <img src={icon} alt="" />
</span>
</div>
</div>
<div className={styles.hostCenter}>
<div className={styles.content}>
<div className={styles.dataCenterLabel}>
<div>站点编号:</div>
<div>产品授权:</div>
<div>网关状态:</div>
</div>
<div className={styles.dataCenterValue}>
<div>{currentSiteInfo}</div>
<div>
<Tooltip title={product.toString()}>
<Tag color="purple">{product.length}</Tag>
</Tooltip>
</div>
<div className={styles.fontText}>
<span
className={classnames({
[styles.iconGreen]: getWayConfig,
[styles.iconGrey]: !getWayConfig,
})}
/>
{getWayConfig ? '开启' : '关闭'}
</div>
</div>
</div>
<div className={styles.dataCenterFooter}>
<span onClick={() => toHostCenter()} style={{ cursor: 'pointer' }}>
宿主管理 <img src={icon} alt="" />
</span>
</div>
</div>
</div>
<div className={styles.contentCenter}>
<div className={styles.application}>
<div className={styles.head}>
<div className={styles.icon} />
<span>当前应用</span>
</div>
<div className={styles.content}>
{website?.map(i => {
if (i.type === 'web') {
return (
<div className={styles.contentItem}>
<div className={styles.contentLeft}>
<img src={web} alt="" />
<span className={styles.blueIcon}>{i.type}:</span>
</div>
<div className={styles.contentText}>
<Tooltip title={i.value}>{i.value}</Tooltip>
</div>
</div>
);
}
return (
<div className={styles.contentItem}>
<div className={styles.contentLeftGreen}>
<img src={mobile} alt="" />
<span className={styles.greenIcon}>{i.type}:</span>
</div>
<div className={styles.contentText}>
<Tooltip title={i.value}>{i.value}</Tooltip>
</div>
</div>
);
})}
{website.length === 0 && <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />}
</div>
</div>
<div className={styles.userLogin}>
<div className={styles.head}>
<div className={styles.headLeft}>
<div className={styles.icon} />
<span>用户登录频次统计</span>
</div>
<div className={styles.headRight} onClick={() => loginLog()}>
查看详情 >>
</div>
</div>
<div className={styles.content}>
<ReactEcharts style={{ width: '100%', height: '100%' }} option={option} />
</div>
</div>
<div className={styles.abnormal}>
<div className={styles.head}>
<div className={styles.icon} />
<span>消息提醒</span>
</div>
<div className={styles.content}>
{dashboardData.异常登录 > 0 && (
<div className={styles.contentItem}>
<div className={styles.contentItemTop}>
<div className={styles.topLeft}>
<img src={abnormalRed} className={styles.icon} alt="" />
<div>
<div className={styles.abnormalFont}>异常登录</div>
<span className={styles.abnormalFontText}>查询到有异常的用户登录</span>
</div>
</div>
<div className={styles.textStyle}>
<span className={styles.text}>{dashboardData.异常登录}</span>
</div>
</div>
</div>
)}
{dashboardData.消息数量 > 0 && (
<div className={styles.contentItem}>
<div className={styles.contentItemTop}>
<div className={styles.topLeft}>
<img src={abnormalGreen} className={styles.icon} alt="" />
<div>
<div className={styles.abnormalFont}>消息推送已提醒</div>
<span className={styles.abnormalFontText}>消息平台消息推送已发出</span>
</div>
</div>
<div className={styles.textStyle}>
<span className={styles.text}>{dashboardData.消息数量}</span>
</div>
</div>
</div>
)}
{!state && (
<div className={styles.contentItem}>
<div className={styles.contentItemTop}>
<div className={styles.topLeft}>
<img src={abnormalYellow} className={styles.icon} alt="" />
<div>
<div className={styles.abnormalFont}>断开连接</div>
<span className={styles.abnormalFontText}>数据库链接断开</span>
</div>
</div>
</div>
</div>
)}
{dashboardData.异常登录 === 0 && dashboardData.消息数量 === 0 && state && (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
)}
</div>
</div>
</div>
<div className={styles.contentBottom}>
<div className={styles.callLog}>
<div className={styles.title}>
<div className={styles.titleLeft}>
<div className={styles.icon} />
<span className={styles.text}>API调用日志</span>
</div>
<div className={styles.linkIcon}>
<span onClick={() => toLogCenter()} style={{ cursor: 'pointer' }}>
日志中心 <img src={icon} alt="" />
</span>
</div>
</div>
<div className={styles.table}>
<Table
size="small"
bordered
columns={columns}
dataSource={keepTableList}
scroll={{ y: 'calc(100% - 53px)' }}
pagination={false}
/>
</div>
</div>
<div className={styles.gisMessage}>
<div className={styles.head}>
<div className={styles.icon} />
<span>GIS信息</span>
</div>
<div className={styles.content}>
<div className={styles.item}>
<div className={styles.dataCenterLabel}>
<div>管网服务:</div>
<div>元数据更新时间:</div>
<div>地图方案:</div>
<div>已配置权限:</div>
<div>默认范围:</div>
</div>
<div className={styles.dataCenterValue}>
<div>
<span className={styles.boldText}>{pipeArr}</span>
<span className={styles.smallText}></span>
</div>
<div>{dashboardData.元数据更新事件}</div>
<div>
<span className={styles.boldText}>{scheme}</span>
<span className={styles.smallText}></span>
</div>
<div>
{limitsWeb > 0 && (
<Tag color="blue" style={{ marginRight: 0, marginLeft: '8px' }}>
web
</Tag>
)}
{limitsPhone > 0 && (
<Tag color="cyan" style={{ marginRight: 0, marginLeft: '8px' }}>
手持
</Tag>
)}
</div>
<div className={styles.fontText}>
<span
className={classnames({
[styles.iconBlue]: mapConfig,
[styles.iconGrey]: !mapConfig,
})}
/>
{mapConfig ? <span className={styles.textBlue}>已配置</span> : '未配置'}
</div>
</div>
</div>
<div className={styles.dataCenterFooter}>
<span onClick={() => toGISCenter()} style={{ cursor: 'pointer' }}>
GIS平台 <img src={icon} alt="" />
</span>
</div>
</div>
</div>
</div>
</div>
</Spin>
);
};
export default HomePage;
.homePage {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
.ant-select-selection-item {
font-weight: bold;
}
:global {
::-webkit-scrollbar-thumb {
border-radius: 0;
}
::-webkit-scrollbar {
display: none;
}
}
.processGreen .ant-progress-steps-outer .ant-progress-steps-item-active {
background: #1bc24d;
}
.processRed .ant-progress-steps-outer .ant-progress-steps-item-active {
background: #e92c2c;
}
.ant-divider-horizontal {
margin: 0;
}
.header {
width: 100%;
height: 44px;
background: #ebf5ff;
border: 1px solid #acc4fe;
display: flex;
align-items: center;
flex-shrink: 0;
.headerImg {
margin-left: 20px;
}
.headerText {
margin-left: 10px;
}
.headerTextBold {
margin-left: 10px;
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: bold;
color: #333333;
margin-right: 20px;
}
.headerChangeBtn {
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #1685ff;
cursor: pointer;
}
}
.contentTop {
width: 100%;
height: 165px;
margin: 5px 0px;
display: flex;
flex-wrap: nowrap;
.dataCenter {
height: 165px;
background: #fff;
width: 18%;
border-radius: 5px;
padding: 3px;
position: relative;
.content {
height: 145px;
display: flex;
justify-content: space-around;
align-items: center;
.dataCenterLabel {
line-height: 44px;
margin-left: 10px;
min-width: 74px;
}
.dataCenterValue {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 44px;
font-size: 16px;
font-family: Microsoft YaHei;
font-weight: bold;
color: #333333;
.fontText {
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #333333;
.iconBlue {
display: inline-block;
width: 6px;
height: 6px;
background: #1685ff;
border-radius: 50%;
margin-right: 5px;
}
.iconGrey {
display: inline-block;
width: 6px;
height: 6px;
background: #d9d9d9;
border-radius: 50%;
margin-right: 5px;
}
}
}
}
.dataCenterFooter {
width: calc(100% - 6px);
position: absolute;
bottom: 0;
text-align: center;
font-size: 12px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #1685ff;
background-color: #f4f8ff;
border-radius: 2px;
margin-bottom: 3px;
}
}
.userCenter {
height: 100%;
background: #fff;
width: 20%;
margin: 0 0 0 6px;
border-radius: 5px;
position: relative;
padding: 3px;
.top {
width: 100%;
height: 60px;
display: flex;
align-items: center;
justify-content: center;
.fontColor {
font-size: 24px;
font-family: DINPro;
font-weight: bold;
color: #1685ff;
margin: 0 10px;
}
}
.center {
width: 100%;
height: 85px;
display: flex;
justify-content: space-around;
align-items: center;
.item {
text-align: center;
.font {
font-size: 20px;
font-family: DINPro;
font-weight: bold;
color: #333333;
margin-right: 5px;
}
}
}
.bottom {
width: calc(100% - 6px);
position: absolute;
bottom: 0;
text-align: center;
font-size: 12px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #1685ff;
background-color: #f4f8ff;
border-radius: 2px;
margin-bottom: 3px;
}
}
.tableCenter {
height: 100%;
background: #fff;
border-radius: 5px;
width: 30%;
margin: 0 6px;
position: relative;
padding: 3px;
.top {
width: 100%;
height: 60px;
display: flex;
align-items: center;
justify-content: center;
.fontColor {
font-size: 24px;
font-family: DINPro;
font-weight: bold;
color: #1685ff;
margin: 0 10px;
}
}
.center {
width: 100%;
height: 85px;
display: flex;
justify-content: space-around;
align-items: center;
.item {
text-align: center;
.font {
font-size: 20px;
font-family: DINPro;
font-weight: bold;
color: #333333;
margin-right: 5px;
}
}
}
.bottom {
width: calc(100% - 6px);
position: absolute;
bottom: 0;
text-align: center;
font-size: 12px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #1685ff;
background-color: #f4f8ff;
border-radius: 2px;
margin-bottom: 3px;
}
}
.flowCenter {
height: 100%;
background: #fff;
width: 16%;
margin: 0 6px 0 0;
border-radius: 5px;
position: relative;
padding: 3px;
.top {
width: 100%;
height: 60px;
display: flex;
align-items: center;
justify-content: center;
.fontColor {
font-size: 24px;
font-family: DINPro;
font-weight: bold;
color: #1685ff;
margin: 0 10px;
}
}
.center {
width: 100%;
height: 85px;
display: flex;
justify-content: space-around;
align-items: center;
.item {
text-align: center;
.font {
font-size: 20px;
font-family: DINPro;
font-weight: bold;
color: #333333;
margin-right: 5px;
}
}
}
.bottom {
width: calc(100% - 6px);
position: absolute;
bottom: 0;
text-align: center;
font-size: 12px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #1685ff;
background-color: #f4f8ff;
border-radius: 2px;
margin-bottom: 3px;
}
}
.hostCenter {
height: 100%;
background: #fff;
width: 16%;
border-radius: 5px;
padding: 3px;
position: relative;
.content {
height: 145px;
display: flex;
justify-content: space-around;
align-items: center;
.dataCenterLabel {
line-height: 44px;
margin-left: 10px;
min-width: 60px;
}
.dataCenterValue {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 44px;
font-size: 16px;
font-family: Microsoft YaHei;
font-weight: bold;
color: #333333;
.fontText {
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #333333;
.iconGreen {
display: inline-block;
width: 6px;
height: 6px;
background: #43bd25;
border-radius: 50%;
margin-right: 5px;
}
.iconGrey {
display: inline-block;
width: 6px;
height: 6px;
background: #d9d9d9;
border-radius: 50%;
margin-right: 5px;
}
}
}
}
.dataCenterFooter {
width: calc(100% - 6px);
position: absolute;
bottom: 0;
text-align: center;
font-size: 12px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #1685ff;
background-color: #f4f8ff;
border-radius: 2px;
margin-bottom: 3px;
}
}
}
.contentCenter {
width: 100%;
height: 350px;
margin: 5px 0px;
display: flex;
flex-wrap: nowrap;
.application {
height: 100%;
background: #fff;
width: 22%;
border-radius: 5px;
.head {
width: 100%;
height: 43px;
background: #1685ff;
border-radius: 3px 3px 0px 0px;
display: flex;
align-items: center;
font-size: 15px;
font-family: Microsoft YaHei;
font-weight: bold;
color: #ffffff;
.icon {
width: 3px;
height: 12px;
background: #ffffff;
border-radius: 2px;
margin: 0 10px 0px 20px;
}
}
.content {
height: 295px;
width: 100%;
padding: 12px;
overflow-y: scroll;
.contentItem {
width: 100%;
height: 58px;
background: #ebf5ff;
margin-bottom: 15px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px;
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #333333;
.contentLeft {
min-width: 60px;
}
.contentLeftGreen {
min-width: 75px;
}
.contentText {
max-width: 230px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.blueIcon {
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: bold;
color: #1685ff;
margin-left: 10px;
}
.greenIcon {
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: bold;
color: #03c0b7;
margin-left: 10px;
}
}
}
}
.userLogin {
height: 100%;
background: #fff;
width: 56%;
border-radius: 5px;
margin: 0 6px;
.head {
width: 100%;
height: 43px;
background: #46c705;
border-radius: 3px 3px 0px 0px;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 15px;
font-family: Microsoft YaHei;
font-weight: bold;
color: #ffffff;
.icon {
width: 3px;
height: 12px;
background: #ffffff;
border-radius: 2px;
margin: 0 10px 0px 20px;
}
.headLeft {
display: flex;
align-items: center;
}
.headRight {
margin-right: 20px;
cursor: pointer;
}
}
.content {
height: 312px;
width: 100%;
padding: 12px;
}
}
.abnormal {
height: 100%;
background: #fff;
width: 22%;
border-radius: 5px;
.head {
width: 100%;
height: 43px;
background: #0198fc;
border-radius: 3px 3px 0px 0px;
display: flex;
align-items: center;
font-size: 15px;
font-family: Microsoft YaHei;
font-weight: bold;
color: #ffffff;
.icon {
width: 3px;
height: 12px;
background: #ffffff;
border-radius: 2px;
margin: 0 10px 0px 20px;
}
}
.content {
height: 300px;
width: 100%;
padding: 8px;
overflow-y: scroll;
.contentItem {
width: 100%;
height: 70px;
background: #f4faff;
border-radius: 5px;
padding: 5px 14px;
margin-bottom: 8px;
.contentItemTop {
width: 100%;
height: 50px;
display: flex;
align-items: flex-end;
justify-content: space-between;
.topLeft {
display: flex;
justify-content: flex-start;
.icon {
width: 42px;
height: 42px;
margin-right: 14px;
}
.abnormalFont {
font-size: 15px;
font-family: Microsoft YaHei;
font-weight: bold;
color: #333333;
}
.abnormalFontText {
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #666666;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.textStyle {
color: #666666;
min-width: 42px;
.text {
font-size: 20px;
font-family: DINPro;
font-weight: bold;
color: #333333;
margin-right: 3px;
}
}
}
.btn {
width: 102px;
height: 26px;
background: #ffffff;
border: 1px solid #e4e3e3;
border-radius: 5px;
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #666666;
text-align: center;
margin-top: 3px;
margin-left: 56px;
cursor: pointer;
}
}
}
}
}
.contentBottom {
width: 100%;
flex: 1;
overflow: hidden;
margin: 5px 0px;
display: flex;
flex-wrap: nowrap;
.callLog {
height: 100%;
background: #fff;
width: 78%;
border-radius: 5px;
padding: 0 16px;
.title {
height: 40px;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
.titleLeft {
display: flex;
align-items: center;
.icon {
width: 3px;
height: 12px;
background: #1685ff;
border-radius: 2px;
margin-right: 16px;
}
.text {
font-size: 15px;
font-family: Microsoft YaHei;
font-weight: bold;
color: #333333;
}
}
.linkIcon {
font-size: 12px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #1685ff;
}
}
.table {
width: 100%;
height: calc(100% - 60px);
overflow: hidden;
:global {
.ant-table-wrapper {
height: 100%;
.ant-spin-nested-loading {
height: 100%;
.ant-spin-container {
height: 100%;
.ant-table.ant-table-small {
height: 100%;
.ant-table-container {
height: 100%;
}
}
}
}
}
}
}
}
.gisMessage {
height: 100%;
background: #fff;
width: 22%;
border-radius: 5px;
margin: 0 0 0 6px;
.head {
width: 100%;
height: 43px;
background: #07ccc3;
border-radius: 3px 3px 0px 0px;
display: flex;
align-items: center;
font-size: 15px;
font-family: Microsoft YaHei;
font-weight: bold;
color: #ffffff;
.icon {
width: 3px;
height: 12px;
background: #ffffff;
border-radius: 2px;
margin: 0 10px 0px 20px;
}
}
.content {
width: 100%;
height: calc(100% - 43px);
padding: 4px;
position: relative;
.item {
width: 100%;
height: calc(100% - 20px);
overflow-y: scroll;
display: flex;
justify-content: space-around;
.dataCenterLabel {
line-height: 38px;
margin-left: 10px;
min-width: 102px;
}
.dataCenterValue {
text-align: end;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 38px;
font-size: 16px;
font-family: Microsoft YaHei;
color: #333333;
.boldText {
font-weight: bold;
}
.smallText {
font-size: 12px;
margin-left: 3px;
}
.fontText {
font-size: 14px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #333333;
.iconBlue {
display: inline-block;
width: 6px;
height: 6px;
background: #1685ff;
border-radius: 50%;
margin-right: 5px;
}
.iconGrey {
display: inline-block;
width: 6px;
height: 6px;
background: #d9d9d9;
border-radius: 50%;
margin-right: 5px;
}
.textBlue {
color: #1685ff;
}
}
}
}
.dataCenterFooter {
width: calc(100% - 8px);
position: absolute;
bottom: 0;
text-align: center;
font-size: 12px;
font-family: Microsoft YaHei;
font-weight: 400;
color: #1685ff;
background-color: #f4f8ff;
border-radius: 2px;
margin-bottom: 3px;
}
}
}
}
}
......@@ -53,8 +53,10 @@ const Login = props => {
sessionStorage.setItem('userName', userName);
if (userMode === USER_MODE.SUPER) {
history.push(`/solution`);
// history.push(`/homePage`);
} else {
history.push(`/authority/user`);
// history.push(`/homePage`);
}
}
if (userMode === USER_MODE.COMMON) {
......
......@@ -77,6 +77,8 @@ const BasicLayout = asyncComponent(() => import('@/layouts/BasicLayout'));
const BlankLayout = asyncComponent(() => import('@/layouts/BlankLayout'));
// 登录
const Login = asyncComponent(() => import('@/pages/user/login'));
// 首页
const HomePage = asyncComponent(() => import('@/pages/homePage'));
// 解决方案管理
const CurrentSolution = asyncComponent(() => import('@/pages/currentSolution/CurrentSolution'));
// 数据库管理
......@@ -197,6 +199,12 @@ export default {
authority: superAuthority,
component: CurrentSolution,
},
{
path: '/homePage',
name: '仪表盘',
icon: <HomeOutlined style={iconStyle} />,
component: HomePage,
},
{
path: '/dbm',
name: '数据库',
......
// import { get, post } from '@/services/index';
import qs from 'qs';
import { CITY_SERVICE, get, post, PUBLISH_SERVICE, PandaCore } from '@/services/index';
// 获取仪表盘数据
export const GetOMSDashboard = params =>
get(`${PUBLISH_SERVICE}/LogCenter/GetOMSDashboard`, params);
// 获取仪表盘日志数据
export const GetWayPages = params => post(`/PandaCore/GCK/Log/GetWayPages`, params);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment