Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
wisdom-components
Commits
323d5ef2
Commit
323d5ef2
authored
Feb 28, 2024
by
陈龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复历史曲线的tooltip显示异常的问题
parent
cc0a3f03
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
14 deletions
+27
-14
EC_HistoryView.md
...es/extend-components/EC_HistoryView/src/EC_HistoryView.md
+1
-1
GridDemo.js
...es/extend-components/EC_HistoryView/src/demos/GridDemo.js
+19
-6
index.js
packages/extend-components/EC_HistoryView/src/demos/index.js
+4
-4
index.js
packages/extend-components/EC_HistoryView/src/index.js
+1
-1
utils.js
packages/extend-components/EC_HistoryView/src/utils.js
+2
-2
No files found.
packages/extend-components/EC_HistoryView/src/EC_HistoryView.md
View file @
323d5ef2
...
...
@@ -37,7 +37,7 @@ path: /
## 多图表
<code
src=
"./demos/GridDemo.js"
></code>
[
//
]:
#
(<code src="./demos/GridDemo.js"></code>)
## API
...
...
packages/extend-components/EC_HistoryView/src/demos/GridDemo.js
View file @
323d5ef2
...
...
@@ -70,13 +70,14 @@ import HistoryView from '../index';
"deviceType": "二供泵房"
}
]*/
const
deviceParams
=
[
{
/*const deviceParams = [
/!* {
"deviceCode": "EGBF00000141",
"sensors": "进水压力,出水瞬时流量,今日用电量",
"deviceType": "二供泵房"
}
/* {
}
*!/
/
!
* {
"deviceCode": "EGBF00000244",
"sensors": "进水压力,出水瞬时流量,今日用电量,今日供水量",
"deviceType": "二供泵房"
...
...
@@ -90,8 +91,20 @@ const deviceParams = [
"deviceCode": "EGBF00000184",
"sensors": "进水压力,出水瞬时流量,今日用电量,今日供水量",
"deviceType": "二供泵房"
}*/
];
}*!/
];*/
const
deviceParams
=
[
{
"deviceCode"
:
"EGJZ00000002"
,
"sensors"
:
"出水实际压力,1#水箱液位"
,
"deviceType"
:
"二供机组"
},
{
"deviceCode"
:
"EGBF00000004"
,
"sensors"
:
"今日用电量,今日供水量"
,
"deviceType"
:
"二供泵房"
}
]
const
Demo
=
()
=>
{
return
<
div
style
=
{{
height
:
700
}}
>
<
HistoryView
deviceParams
=
{
deviceParams
}
grid
/>
...
...
packages/extend-components/EC_HistoryView/src/demos/index.js
View file @
323d5ef2
...
...
@@ -192,22 +192,22 @@ import { MobileHistoryChart } from '../mobile';
];*/
const
deviceParams
=
[
// 预测的
/*
{
{
"deviceCode"
:
"YLB00000041"
,
"sensors"
:
"进水压力"
,
"deviceType"
:
"压力表"
}
*/
}
,
/* {
"deviceCode": "SSBF00000001",
"sensors": "出水压力",
"deviceType": "送水泵房"
}*/
//预测结束
{
/*
{
"deviceCode": "EGBF00000141",
"sensors": "进水压力,出水瞬时流量,今日用电量",
"deviceType": "二供泵房"
}
}
*/
]
const
Demo
=
()
=>
{
return
(
...
...
packages/extend-components/EC_HistoryView/src/index.js
View file @
323d5ef2
...
...
@@ -338,7 +338,7 @@ const HistoryView = (props) => {
const
[
allSensorType
,
setAllSensorType
]
=
useState
([]);
const
[
isSingleStatusSensor
,
setIsSingleStatusSensor
]
=
useState
(
false
);
const
[
predicateDevice
,
setPredicateDevice
]
=
useState
(
null
);
const
[
predicateData
,
setPredicateData
]
=
useState
(
null
);
const
[
predicateData
,
setPredicateData
]
=
useState
(
[]
);
// 历史数据相关的特征描述
const
deviceConfig
=
useRef
({
oneDevice
:
deviceParams
.
length
===
1
,
//单设备
...
...
packages/extend-components/EC_HistoryView/src/utils.js
View file @
323d5ef2
...
...
@@ -538,7 +538,7 @@ const returnXAxis = ({
return final
}, [])?.length;
// 线图 且 有预测数据情况下,才合并预测数据
let series = (predicateData && chartType === 'lineChart' ? dataSource.concat(predicateData) : dataSource)
let series = (predicateData &&
predicateData.length &&
chartType === 'lineChart' ? dataSource.concat(predicateData) : dataSource)
.filter((item) => {
if (item.sensorName === '是否在线') {
_offlineData.push(item);
...
...
@@ -1183,7 +1183,7 @@ const optionGenerator = (
<
/div>`
;
},
};
if
(
predicateData
)
{
if
(
predicateData
&&
predicateData
.
length
)
{
tooltip
=
{
trigger
:
'axis'
,
formatter
:
(
e
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment