Commit b50bc3db authored by 崔佳豪's avatar 崔佳豪

perf: 优化历史曲线组件添加缺省页

parent 883a88d0
......@@ -124,6 +124,7 @@ export default {
'EC_HistoryInfo',
'EC_RealTimeInfo',
'EC_ConfigurationView',
'EC_HistoryView',
],
},
],
......
......@@ -2,7 +2,7 @@ const proxyURL = process.env.PANDA_ENV_PROXY || 'http://192.168.8.28:8911';
export default {
'/api': {
target: 'http://192.168.10.150:8669',
target: proxyURL,
changeOrigin: true,
pathRewrite: { '^/api': '' },
},
......
import React from 'react';
import HistoryView from '../index';
const deviceParams = [{
deviceCode: "EGBF00000146",
sensors: "进水压力,出水瞬时流量,出水累计流量",
deviceType: "二供泵房"
}]
const deviceParams = [
// {
// deviceCode: "EGBF00000146",
// sensors: "进水压力,出水瞬时流量,出水累计流量",
// deviceType: "二供泵房"
// },
// {
// deviceCode: "EGJZ00001113",
// sensors: "出水瞬时流量,出水压力,泵1状态",
// deviceType: "二供机组"
// }
];
const Demo = () => {
return (
<div style={{height: 700}}>
<div style={{ height: 700 }}>
<HistoryView deviceParams={deviceParams} />
</div>
);
......
......@@ -6,6 +6,7 @@ import { CloseCircleFilled, DownloadOutlined, PlusCircleOutlined } from '@ant-de
import moment from 'moment';
import _ from 'lodash';
import TimeRangePicker from '@wisdom-components/timerangepicker';
import PandaEmpty from '@wisdom-components/empty';
import BasicTable from '@wisdom-components/basictable';
import { getHistoryInfo } from './apis';
import SimgleChart from './SingleChart';
......@@ -580,7 +581,9 @@ const HistoryView = (props) => {
{renderCurveOption()}
</div>
<div className={`${prefixCls}-content`}>
{grid === true ? (
{!chartDataSource.length ? (
<PandaEmpty />
) : grid === true ? (
<GridChart
prefixCls={prefixCls}
dataSource={chartDataSource}
......@@ -603,7 +606,7 @@ const HistoryView = (props) => {
{renderCurveOption()}
</div>
<div className={`${prefixCls}-content`}>
{
{chartDataSource.length > 0 ? (
<BasicTable
dataSource={tableData}
columns={columns}
......@@ -611,7 +614,9 @@ const HistoryView = (props) => {
pagination={{ showQuickJumper: true, showSizeChanger: true }}
onChange={() => {}}
/>
}
) : (
<PandaEmpty />
)}
</div>
</Tabs.TabPane>
</Tabs>
......
......@@ -104,13 +104,17 @@
}
.@{history-view}-content {
display: flex;
flex: 1;
align-items: center;
justify-content: center;
overflow: hidden;
}
.@{history-view}-grid {
display: flex;
flex-wrap: wrap;
width: 100%;
height: 100%;
padding: 4px;
overflow-y: auto;
......
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