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
070fea10
Commit
070fea10
authored
Aug 28, 2023
by
陈龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复多设备曲线无法显示的问题
parent
951b85f3
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
23 additions
and
12 deletions
+23
-12
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
+17
-5
index.js
packages/extend-components/EC_HistoryView/src/index.js
+5
-5
utils.js
packages/extend-components/EC_HistoryView/src/utils.js
+0
-1
No files found.
packages/extend-components/EC_HistoryView/src/EC_HistoryView.md
View file @
070fea10
...
...
@@ -24,7 +24,7 @@ path: /
<code
src=
"./demos/index.js"
></code>
## 移动端
[
//
]:
#
(## 移动端)
[
//
]:
#
(<code src="./demos/mobile.js"></code>)
...
...
packages/extend-components/EC_HistoryView/src/demos/GridDemo.js
View file @
070fea10
import
React
from
'react'
;
import
HistoryView
from
'../index'
;
const
deviceParams
=
[
/*
const deviceParams = [
{
deviceCode
:
'EGBF000001
4
6'
,
deviceCode: 'EGBF000001
3
6',
sensors: '进水压力,出水瞬时流量,出水累计流量',
deviceType: '二供泵房',
pointAddressID: 4,
},
{
deviceCode
:
'EGBF00000
001
'
,
deviceCode: 'EGBF00000
137
',
sensors: '进水压力,出水瞬时流量,出水累计流量',
deviceType: '二供泵房',
pointAddressID: 4,
},
{
// deviceCode: 'EGBF00000002',
deviceCode
:
'EGBF00000
082
'
,
deviceCode: 'EGBF00000
135
',
sensors: '进水压力,出水瞬时流量,出水累计流量',
deviceType: '二供泵房',
pointAddressID: 4,
},
];
];
*/
/*const deviceParams = [
{
"deviceCode": "LLJ00000055",
...
...
@@ -34,6 +34,18 @@ const deviceParams = [
"deviceType": "流量计"
}
]*/
const
deviceParams
=
[
{
"deviceCode"
:
"EGBF00000023"
,
"sensors"
:
"出水瞬时流量,是否在线"
,
"deviceType"
:
"二供泵房"
},
{
"deviceCode"
:
"EGBF00000019"
,
"sensors"
:
"出水瞬时流量,是否在线"
,
"deviceType"
:
"二供泵房"
}
]
const
Demo
=
()
=>
{
return
<
div
style
=
{{
height
:
700
}}
>
<
HistoryView
deviceParams
=
{
deviceParams
}
grid
/>
...
...
packages/extend-components/EC_HistoryView/src/index.js
View file @
070fea10
...
...
@@ -920,7 +920,7 @@ const HistoryView = (props) => {
dataItem.dateFrom = dateFrom || '';
dataItem.dateTo = dateTo || '';
// 抽稀情况下,剔除掉为null的点
/* if (zoomArray[index]?.unit !== '' && zoomArray[index]?.zoom !== '') {
/* if (zoomArray[index]?.unit !== '' && zoomArray[index]?.zoom !== '') {
dataItem.dataModel = dataItem.dataModel.filter(item => item.pv !== null)
}*/
return dataItem;
...
...
@@ -1043,10 +1043,10 @@ const HistoryView = (props) => {
}
};
// 获取字段配置
const
getDefaultOptions
=
()
=>
{
const
getDefaultOptions
=
async
()
=>
{
// 非单曲线、单指标不执行
if
(
deviceParams
?.
length
!==
1
||
(
deviceParams
?.
length
===
1
&&
deviceParams
?.[
0
]?.
sensors
?.
split
(
','
)?.
length
>
1
))
return
;
getDictionaryInfoAll
({
if
(
deviceParams
?.
length
!==
1
||
(
deviceParams
?.
length
===
1
&&
deviceParams
?.[
0
]?.
sensors
?.
split
(
','
)?.
length
>
1
))
return
setCompleteInit
(
true
)
;
await
getDictionaryInfoAll
({
level
:
'组件_ec_historyview'
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
...
...
@@ -1062,9 +1062,9 @@ const HistoryView = (props) => {
return
_item
;
});
setCheckboxData
(
_checkboxData
);
setCompleteInit
(
true
);
}
})
setCompleteInit
(
true
);
};
useEffect
(()
=>
{
getDefaultOptions
();
...
...
packages/extend-components/EC_HistoryView/src/utils.js
View file @
070fea10
...
...
@@ -693,7 +693,6 @@ const returnCustomSeries = (dataSource) => {
*/
const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth, config, lineDataType = '') => {
console.log('config:', config)
const {
needUnit,
curveCenter,
...
...
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