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
f8151b99
Commit
f8151b99
authored
Mar 22, 2024
by
陈龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 优化历史曲线空值的显示
parent
a09e683b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
25 deletions
+34
-25
index.js
packages/extend-components/EC_HistoryView/src/demos/index.js
+7
-1
index.js
packages/extend-components/EC_HistoryView/src/index.js
+27
-24
No files found.
packages/extend-components/EC_HistoryView/src/demos/index.js
View file @
f8151b99
...
...
@@ -262,10 +262,16 @@ const deviceParams = [
"sensors": "进水压力",
"deviceType": "熊猫压力表"
}*/
{
/*
{
"deviceCode": "LLJ00000001",
"sensors": "瞬时流量",
"deviceType": "流量计"
}*/
{
"deviceCode"
:
"EGBF00000024"
,
// "deviceCode": "EGBF00000023",
"sensors"
:
"进水压力"
,
"deviceType"
:
"二供泵房"
}
]
const
Demo
=
()
=>
{
...
...
packages/extend-components/EC_HistoryView/src/index.js
View file @
f8151b99
...
...
@@ -290,10 +290,8 @@ const handleFakeData = (dateRange, deviceParams) => {
_arr
.
forEach
(
sensor
=>
{
final
.
push
({
dataModel
:
[
/* {pt: dateFrom, pv: null},
{pt: dateTo, pv: null}*/
// {pv:null}
{
pv
:
null
}
{
pt
:
dateFrom
,
pv
:
null
},
{
pt
:
dateTo
,
pv
:
null
}
],
dateFrom
,
dateTo
,
...
...
@@ -979,9 +977,9 @@ const HistoryView = (props) => {
};
// 同期对比
if
(
timeValue
===
'contrast'
&&
dataModel
[
0
])
{
const
time
=
item
.
dataModel
[
0
].
pt
.
slice
(
0
,
contrastOption
===
'day'
?
10
:
7
)
.
replace
(
/-/g
,
''
);
const
time
=
item
.
dataModel
[
0
]
?
.
pt
?
.
slice
(
0
,
contrastOption
===
'day'
?
10
:
7
)
?
.
replace
(
/-/g
,
''
);
col
.
title
=
`
${
equipmentName
}
-
${
sensorName
}
-
${
time
}
`
;
}
return
col
;
...
...
@@ -1177,7 +1175,7 @@ const HistoryView = (props) => {
emptyOrError
.
current
.
error
=
false
;
if
(
results
.
length
)
{
let
data
=
[];
let
_predicateData
=
[];
//
let _predicateData = [];
results
.
forEach
((
res
,
index
)
=>
{
const
{
dateFrom
,
dateTo
}
=
dateRange
?.[
index
]
??
{};
if
(
res
.
code
===
0
&&
res
.
data
.
length
)
{
...
...
@@ -1234,20 +1232,25 @@ const HistoryView = (props) => {
}).
filter
((
item
)
=>
item
.
sensorName
);
// 预测的
data
=
data
.
concat
(
list
.
filter
(
item
=>
item
.
deviceType
!==
'预测'
));
_predicateData
=
_predicateData
.
concat
(
list
.
filter
(
item
=>
item
.
deviceType
===
'预测'
));
//
_predicateData = _predicateData.concat(list.filter(item => item.deviceType === '预测'));
});
}
});
setLoading
(
false
);
if
(
data
.
length
!==
0
)
{
emptyOrError
.
current
.
empty
=
false
;
}
else
{
data
=
handleFakeData
(
dateRange
,
deviceParams
)
??
[]
}
handleTableData
(
data
)
setChartDataSource
(
data
);
setPredicateData
(
_predicateData
);
//
setPredicateData(_predicateData);
}
})
.
catch
((
err
)
=>
{
let
data
=
handleFakeData
(
dateRange
,
deviceParams
)
??
[];
handleTableData
(
data
);
setChartDataSource
(
data
);
message
.
info
(
'未查询到数据,请重试~'
);
setLoading
(
false
);
});
...
...
@@ -1451,20 +1454,20 @@ const HistoryView = (props) => {
// let _res3 = result[3];
let
_checkboxData
=
[...
checkboxData
];
// 单设备单曲线时,查询是否配置为预测点
/* if (_res3.code === 0 && _res3.data) {
// 1. 如果是单曲线,并且配置了预测,那么默认开启预测;
// 2024年3月11日 物联预测功能支撑后,再开发这部分
_checkboxData.push({
key: 'predicate',
label: '数据预测',
checked: true,
showInCurve: true,
showInTable: true,
})
setPredicateDevice({..._res3.data, deviceType: '预测'});
} else {
setPredicateDevice(null);
}*/
/* if (_res3.code === 0 && _res3.data) {
// 1. 如果是单曲线,并且配置了预测,那么默认开启预测;
// 2024年3月11日 物联预测功能支撑后,再开发这部分
_checkboxData.push({
key: 'predicate',
label: '数据预测',
checked: true,
showInCurve: true,
showInTable: true,
})
setPredicateDevice({..._res3.data, deviceType: '预测'});
} else {
setPredicateDevice(null);
}*/
// 查字典配置
if
(
_res0
.
code
===
0
)
{
let
_opt
=
_res0
.
data
.
reduce
((
final
,
cur
)
=>
{
...
...
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