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
10b6e87d
Commit
10b6e87d
authored
Mar 14, 2024
by
陈龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 去除历史曲线loading
parent
b31a4917
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
15 deletions
+51
-15
index.js
packages/extend-components/EC_HistoryView/src/demos/index.js
+20
-6
index.js
packages/extend-components/EC_HistoryView/src/index.js
+30
-9
utils.js
packages/extend-components/EC_HistoryView/src/utils.js
+1
-0
No files found.
packages/extend-components/EC_HistoryView/src/demos/index.js
View file @
10b6e87d
...
...
@@ -190,23 +190,37 @@ import { MobileHistoryChart } from '../mobile';
"deviceType": "送水泵房"
}
];*/
const
deviceParams
=
[
/*
const deviceParams = [
// 预测的
/* {
/
!
* {
"deviceCode": "YLB00000041",
"sensors": "进水压力",
"deviceType": "压力表"
},*/
{
},*
!
/
/!*
{
"deviceCode": "SSBF00000001",
"sensors": "出水压力",
"deviceType": "送水泵房"
}
}
*!/
//预测结束
/* {
/
!
* {
"deviceCode": "EGBF00000141",
"sensors": "进水压力,出水瞬时流量,今日用电量",
"deviceType": "二供泵房"
}*!/
];*/
const
deviceParams
=
[
// 新乐,水厂数据异常的问题
{
"deviceCode"
:
"SC00000004"
,
"sensors"
:
"进水瞬时流量,1#出水瞬时流量,2#出水瞬时流量"
,
"deviceType"
:
"水厂"
}
// 182:8088 报警设备
/* {
"deviceCode": "XMYL00000043",
"sensors": "进水压力",
"deviceType": "熊猫压力表"
}*/
]
const
Demo
=
()
=>
{
...
...
packages/extend-components/EC_HistoryView/src/index.js
View file @
10b6e87d
...
...
@@ -354,6 +354,8 @@ const HistoryView = (props) => {
const
[
predicateDevice
,
setPredicateDevice
]
=
useState
(
null
);
const
[
predicateData
,
setPredicateData
]
=
useState
([]);
const
[
predicateTime
,
setPredicateTime
]
=
useState
(
null
);
// 这部分功能有问题,等待解决后上线 2024年3月13日
// const [discreteDeviceType, setDiscreteDeviceType] = useState(['水厂'])
// 历史数据相关的特征描述
const
deviceConfig
=
useRef
({
oneDevice
:
deviceParams
.
length
===
1
,
//单设备
...
...
@@ -1077,6 +1079,8 @@ const HistoryView = (props) => {
const
requestArr
=
[];
const
acrossTables
=
[];
const
zoomArray
=
[];
// 这部分功能有问题,等待解决后上线 2024年3月13日
// let hasDiscreteDeviceType = false;
deviceParams
.
map
((
item
)
=>
{
let
_item
=
{...
item
};
...
...
@@ -1090,6 +1094,10 @@ const HistoryView = (props) => {
.
forEach
((
i
)
=>
{
if
(
i
.
sensors
&&
i
.
deviceCode
)
acrossTables
.
push
(
_
.
omit
(
i
,
[
'pointAddressID'
]));
// 这部分功能有问题,等待解决后上线 2024年3月13日
/* if (discreteDeviceType.includes(i.deviceType)) {
hasDiscreteDeviceType = true;
}*/
});
if
(
!
acrossTables
?.
length
||
!
dateRange
.
length
)
{
handleTableData
([]);
...
...
@@ -1128,6 +1136,11 @@ const HistoryView = (props) => {
if
(
dateRange
.
length
===
1
&&
predicateDevice
)
{
_finalParams
.
acrossTables
.
push
(
predicateDevice
);
}
// 2024年3月11日 如果设备是某些特殊设备,则采用离散型算法
// 这部分功能有问题,等待解决后上线 2024年3月13日
/* if (hasDiscreteDeviceType) {
_finalParams.algorithmName = "outliers";
}*/
requestArr
.
push
(
getHistoryInfo
(
_finalParams
));
});
setLoading
(
true
);
...
...
@@ -1363,6 +1376,16 @@ const HistoryView = (props) => {
};
// 获取字段配置
const
getDefaultOptions
=
async
()
=>
{
// 特定设备
// 这部分功能有问题,等待解决后上线 2024年3月13日
/* getDictionaryInfoAll({
level: '离散算法设备类型',
}).then(res => {
if (res.code === 0 && res.data.length) {
let deviceType = res.data.find(item => item.fieldName === '设备类型')?.fieldValue;
setDiscreteDeviceType(deviceType.split(',').filter(item => item))
}
})*/
// 非单曲线、单指标不执行
if
(
deviceParams
?.
length
!==
1
||
...
...
@@ -1397,7 +1420,7 @@ const HistoryView = (props) => {
if
(
_res3
.
code
===
0
&&
_res3
.
data
)
{
// 1. 如果是单曲线,并且配置了预测,那么默认开启预测;
// 2024年3月11日 物联预测功能支撑后,再开发这部分
/* _checkboxData.push({
/* _checkboxData.push({
key: 'predicate',
label: '数据预测',
checked: true,
...
...
@@ -1485,12 +1508,11 @@ const HistoryView = (props) => {
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-spin`
)}
style
=
{{
position
:
'relative'
}}
>
{
loading
||
percent
!==
0
?
(
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-progressWrapper`
)}
>
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-contentWrapper`
)}
>
{
lineDataType
===
'原始曲线'
||
(
lineDataType
===
'特征曲线'
&&
moment
(
dateRange
?.[
0
]?.
dateTo
).
diff
(
moment
(
dateRange
?.[
0
]?.
dateFrom
),
'days'
)
>=
30
)
?
(
<
>
30
)
?
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-contentWrapper`
)}
>
<
Progress
percent
=
{
percent
}
steps
=
{
20
}
...
...
@@ -1498,11 +1520,10 @@ const HistoryView = (props) => {
showInfo
=
{
false
}
/
>
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-tip`
)}
>
加载中
...
<
/div
>
<
/
>
)
:
(
<
Spin
spinning
=
{
loading
||
false
}
/
>
)}
<
/div
>
<
/div>
:
<
Spin
spinning
=
{
loading
||
false
}
tip
=
{
'数据加载中...'
}
delay
=
{
1000
}
style
=
{{
background
:
'transparent'
}}
/
>
}
<
/div
>
)
:
(
''
...
...
packages/extend-components/EC_HistoryView/src/utils.js
View file @
10b6e87d
...
...
@@ -1331,6 +1331,7 @@ const optionGenerator = (
visualMap
,
...
restOption
,
};
console
.
log
(
'_option: '
,
_options
);
return
_options
;
};
...
...
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