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
40af6556
Commit
40af6556
authored
Apr 19, 2024
by
陈龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复数据剔除预测的逻辑导致的异常
parent
9bcc889e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
95 additions
and
302 deletions
+95
-302
VirtualTable.js
...ages/extend-components/EC_HistoryView/src/VirtualTable.js
+5
-6
VirtualTable.less
...es/extend-components/EC_HistoryView/src/VirtualTable.less
+58
-4
index.js
packages/extend-components/EC_HistoryView/src/demos/index.js
+4
-277
index.js
packages/extend-components/EC_HistoryView/src/index.js
+4
-3
index.less
packages/extend-components/EC_HistoryView/src/index.less
+1
-1
indexForBI.less
...ages/extend-components/EC_HistoryView/src/indexForBI.less
+23
-11
No files found.
packages/extend-components/EC_HistoryView/src/VirtualTable.js
View file @
40af6556
...
...
@@ -6,7 +6,7 @@ import { VariableSizeGrid as Grid } from 'react-window';
import
'./VirtualTable.less'
;
const
VirtualTable
=
(
props
)
=>
{
const
TABLE_ROW_HEIGHT
=
40
;
const
{
columns
,
scroll
}
=
props
;
const
{
columns
,
scroll
,
theme
}
=
props
;
const
[
tableWidth
,
setTableWidth
]
=
useState
(
0
);
const
widthColumnCount
=
columns
.
filter
(({
width
})
=>
!
width
).
length
;
const
totalWidth
=
columns
.
reduce
((
final
,
curr
)
=>
{
...
...
@@ -61,7 +61,7 @@ const VirtualTable = (props) => {
return
(
<
Grid
ref
=
{
gridRef
}
className
=
"virtual-grid"
className
=
{
`
${
theme
===
'BI'
?
'BI-'
:
''
}
virtual-grid`
}
columnCount
=
{
mergedColumns
.
length
}
columnWidth
=
{(
index
)
=>
{
const
{
width
}
=
mergedColumns
[
index
];
...
...
@@ -82,7 +82,7 @@ const VirtualTable = (props) => {
>
{({
columnIndex
,
rowIndex
,
style
})
=>
(
<
div
className
=
{
classNames
(
'virtual-table-cell'
,
{
className
=
{
classNames
(
`
${
theme
===
'BI'
?
'BI-'
:
''
}
virtual-table-cell`
,
{
'virtual-table-cell-last'
:
columnIndex
===
mergedColumns
.
length
-
1
,
})}
style
=
{
style
}
...
...
@@ -102,7 +102,7 @@ const VirtualTable = (props) => {
<
BasicTable
{...
props
}
size
=
{
'small'
}
className
=
"virtual-table"
className
=
{
`
${
theme
===
'BI'
?
'BI-'
:
''
}
virtual-table`
}
columns
=
{
mergedColumns
}
pagination
=
{
false
}
components
=
{{
...
...
@@ -112,4 +112,4 @@ const VirtualTable = (props) => {
<
/ResizeObserver
>
);
};
export
default
VirtualTable
;
\ No newline at end of file
export
default
VirtualTable
;
packages/extend-components/EC_HistoryView/src/VirtualTable.less
View file @
40af6556
...
...
@@ -14,9 +14,11 @@
text-align: center;
line-height: 1;
&:nth-child(even) {}
&:nth-child(even) {
}
&:nth-child(odd) {}
&:nth-child(odd) {
}
}
[data-theme="dark"] .virtual-table-cell {
...
...
@@ -25,4 +27,57 @@
border-bottom: 1px solid #303030;
background: #141414;
text-align: center;
}
\ No newline at end of file
}
;
.BI-virtual-table .ant-table-container:before,
.BI-virtual-table .ant-table-container:after {
display: none;
}
.BI-virtual-table {
--text-color: #dcdcf2d9;
--background-color: #282b34;
--border-color: #38435a;
--table-head-background-color:#363a46;
.@{ant-prefix}-table-thead > tr > th {
background-color: var(--table-head-background-color)!important;
border-bottom: 1px solid var(--border-color);
color: var(--text-color);
}
.virtual-table-container {
background: var(--background-color);
}
.ant-table-cell-scrollbar:not([rowspan]) {
box-shadow: 0 1px 0 1px var(--border-color);
}
}
.BI-virtual-table-cell {
--text-color: #dcdcf2d9;
--background-color: #282b34;
--border-color: #38435a;
background-color: var(--background-color);
border-bottom: 1px solid var(--border-color);
color: var(--text-color);
box-sizing: border-box;
padding: 16px;
text-align: center;
line-height: 1;
&:nth-child(even) {
}
&:nth-child(odd) {
}
}
.BI-virtual-grid {
--text-color: #dcdcf2d9;
--background-color: #282b34;
--border-color: #38435a;
background-color: var(--background-color);
}
packages/extend-components/EC_HistoryView/src/demos/index.js
View file @
40af6556
import
React
from
'react'
;
import
HistoryView
from
'../index'
;
import
{
MobileHistoryChart
}
from
'../mobile'
;
/*const deviceParams = [
/!*10.182*!/
/!* {
"deviceCode": "EGBF00000136",
// "sensors": "进水压力,出水压力,出水瞬时流量,今日供水量,1#水箱液位,视频报警",
"sensors": "进水压力",
// "sensors": "视频报警",
"deviceType": "二供泵房"
},*!/
/!* {
"deviceCode": "EGJZ00000158",
// "sensors": "进水压力,出水压力,泵1状态",
"sensors": "进水压力",
// "sensors": "泵1状态",
"deviceType": "二供机组"
}*!/
/!* {
deviceCode: 'EGBF00000141',
// sensors: '进水压力,出水瞬时流量,出水累计流量',
sensors: '进水压力',
deviceType: '熊猫二供泵房',
pointAddressID: 208,
},*!/
/!* {
"deviceCode": "SYJ00000008",
"sensors": "瞬时流量",
"deviceType": "水源井"
},*!/
/!* {
deviceCode: 'EGJZ00000197',
sensors: '进水压力,出水压力,出水瞬时流量,出水累计流量',
// sensors: '1#变频器运行频率',
deviceType: '二供机组',
// pointAddressID: 208,
},*!/
/!* {
"deviceCode": "SC00000001",
// "sensors": "出厂瞬时流量1,1#清水池液位,2#清水池液位,今日供水量,出水压力1",
"sensors": "出厂瞬时流量1",
"deviceType": "水厂"
}*!/
/!* {
deviceCode: 'EGJZ00000198',
// sensors: '进水压力,出水压力,出水瞬时流量,出水累计流量',
sensors: '1#变频器运行频率',
deviceType: '二供机组',
// pointAddressID: 208,
}, *!/
/!* {
// deviceCode: 'EGBF00000002',
// deviceCode: 'EGBF00000018',
// deviceCode: 'XMYL00000345',
// deviceCode: 'XMYL00000000',
deviceCode: 'EGBF00000014',
// sensors: '今日供水量,今日用电量,1#水箱液位',
sensors: '进水压力',
deviceType: '熊猫压力表',
pointAddressID: 4,
},*!/
/!* {
deviceCode: 'EGJZ00000226',
sensors: '出水压力',
deviceType: '二供机组',
pointAddressID: 4,
}, *!/
/!* {
"deviceCode": "LLJ00000055",
"sensors": "正累计流量,瞬时流量",
"deviceType": "流量计"
}*!/
/!* {
"deviceCode": "EGJZ00000163",
"sensors": "进水压力",
"deviceType": "二供机组"
}*!/
// 邳州张楼水厂
/!* {
"deviceCode": "LLJ00000001",
"sensors": "瞬时流量",
"deviceType": "流量计"
} *!/
/!* {
"deviceCode": "SC00000023",
"sensors": "瞬时流量",
"deviceType": "水厂"
},
{
"deviceCode": "JFJ00000001",
"sensors": "沉淀池投矾量瞬时,",
"deviceType": "加矾间"
}, *!/
/!* {
"deviceCode": "QSBF00000001",
"sensors": "取水浊度",
"deviceType": "取水泵房"
},
{
"deviceCode": "SC00000023",
"sensors": "出水瞬时流量",
"deviceType": "水厂"
},
{
"deviceCode": "XNCDC00000001",
"sensors": "沉淀池1号进水管流量",
"deviceType": "絮凝沉淀池"
},
{
"deviceCode": "LLJ00000001",
"sensors": "瞬时流量",
"deviceType": "流量计"
},*!/
/!* {
"deviceCode": "LLJ00000001",
"sensors": "瞬时流量",
"deviceType": "流量计"
}*!/
/!* {
deviceCode: 'EGJZ00000027',
sensors: '2#变频器运行频率',
deviceType: '二供机组',
}, *!/
/!*确山*!/
/!*泵3状态*!/
/!* {
// EGJZ00000003
deviceCode: 'EGJZ00000003',
// sensors: '3#频率',
sensors: '出1累计流量',
deviceType: '二供机组',
},*!/
/!* {
"deviceCode": "EGBF00000006",
"sensors": "出1累计流量",
"deviceType": "二供泵房"
}*!/
// 永吉
/!* {
"deviceCode": "SZJCY00000001",
"sensors": "pH",
"deviceType": "水质监测仪"
}*!/
// 滦州
/!* {
"deviceCode": "XMSB00000015",
"sensors": "今日出水量",
"deviceType": "熊猫水表"
} *!/
/!* {
deviceCode: 'SYJ00000003',
sensors: '站点在线状态',
deviceType: '水源井',
}, *!/
/!* {
"deviceCode": "SSB00000005",
"sensors": "频率,站点在线状态",
"deviceType": "送水泵"
}*!/
/!*界首*!/
/!* {
"deviceCode": "SYJ00000022",
"sensors": "IC",
"deviceType": "水源井"
}*!/
/!* {
"deviceCode": "JYJZ00000002",
"sensors": "频率,泵1状态",
"deviceType": "加压机组"
}*!/
/!*铁山*!/
/!* {
"deviceCode": "SZ00000001",
"deviceType": "水质",
"sensors": "PH,浑浊度,氨氮,总氮,总磷,溶解氧,水温,电导率,叶绿素a,藻密度,高锰酸盐指数"
}*!/
/!*邳州*!/
/!* {
"deviceCode": "TLC00000001",
"sensors": "1号碳滤池浊度",
"deviceType": "碳滤池"
}*!/
/!*邳州*!/
{
"deviceCode": "SSBF00000001",
"sensors": "出水压力",
"deviceType": "送水泵房"
}
];*/
/*const deviceParams = [
// 预测的
/!* {
"deviceCode": "YLB00000041",
"sensors": "进水压力",
"deviceType": "压力表"
},*!/
/!* {
"deviceCode": "SSBF00000001",
"sensors": "出水压力",
"deviceType": "送水泵房"
}*!/
//预测结束
/!* {
"deviceCode": "EGBF00000141",
"sensors": "进水压力,出水瞬时流量,今日用电量",
"deviceType": "二供泵房"
}*!/
];*/
const
deviceParams
=
[
// 新乐,水厂数据异常的问题
{
"deviceCode"
:
"SC00000004"
,
"sensors"
:
"进水瞬时流量,1#出水瞬时流量,2#出水瞬时流量"
,
"deviceType"
:
"水厂"
},
/* {
"deviceCode": "EGJZ00000073",
"sensors": "进水压力",
"deviceType": "二供机组"
},
{
"deviceCode": "EGJZ00000006",
"sensors": "进水压力",
"deviceType": "二供机组"
}*/
/* {
"deviceCode": "EGBF00000002",
"deviceType": "二供泵房",
"sensors": "进水压力"
},
{
"deviceType": "二供机组",
"deviceCode": "EGJZ00000005",
"sensors": "出水压力"
},
{
"deviceType": "二供机组",
"deviceCode": "EGJZ00000001",
"sensors": "出水压力"
},
{
"deviceType": "二供机组",
"deviceCode": "EGJZ00000004",
"sensors": "出水压力"
},
{
"deviceType": "二供机组",
"deviceCode": "EGJZ00000003",
"sensors": "出水压力"
},
{
"deviceType": "二供机组",
"deviceCode": "EGJZ00000002",
"sensors": "出水压力"
}*/
// 182:8088 报警设备
/* {
"deviceCode": "XMYL00000043",
"sensors": "进水压力",
"deviceType": "熊猫压力表"
}*/
/* {
"deviceCode": "LLJ00000001",
"sensors": "瞬时流量",
"deviceType": "流量计"
}*/
/* {
"deviceCode": "EGBF00000024",
// "deviceCode": "EGBF00000023",
"sensors": "进水压力",
"deviceType": "二供泵房"
}*/
]
const
p1
=
[
{
"deviceCode"
:
"SC00000004"
,
"sensors"
:
"进水瞬时流量"
,
"deviceType"
:
"水厂"
"deviceCode"
:
"EGBF00000022"
,
"sensors"
:
"出水瞬时流量,今日用电量,余氯"
,
"deviceType"
:
"二供泵房"
}
]
const
Demo
=
()
=>
{
...
...
@@ -286,7 +13,7 @@ const Demo = () => {
<>
<
div
>
<
div
style
=
{{
height
:
700
}}
>
{
/* <HistoryView deviceParams={deviceParams} defaultModel="table" />
*/
}
{
/*<HistoryView deviceParams={deviceParams} defaultModel="curve" />
*/
}
<
HistoryView
theme
=
{
'BI'
}
deviceParams
=
{
deviceParams
}
defaultModel
=
"curve"
/>
<
/div
>
<
/div
>
...
...
packages/extend-components/EC_HistoryView/src/index.js
View file @
40af6556
...
...
@@ -640,7 +640,8 @@ const HistoryView = (props) => {
)}
{
timeValue
===
'contrast'
&&
(
// 同期对比
<>
<
Select
value
=
{
contrastOption
}
style
=
{{
width
:
60
}}
onChange
=
{
onContrastChange
}
>
<
Select
value
=
{
contrastOption
}
getPopupContainer
=
{
trigger
=>
trigger
.
parentElement
}
style
=
{{
width
:
60
}}
onChange
=
{
onContrastChange
}
>
<
Option
value
=
"day"
>
日
<
/Option
>
<
Option
value
=
"month"
disabled
=
{
lineDataType
===
'原始曲线'
}
>
月
...
...
@@ -660,6 +661,7 @@ const HistoryView = (props) => {
<
div
key
=
{
child
.
key
}
className
=
{
classNames
(
`
${
prefixCls
}
-contrast-list`
)}
>
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-contrast-wrap`
)}
>
<
DatePicker
getPopupContainer
=
{
trigger
=>
trigger
.
parentElement
}
key
=
{
child
.
key
}
picker
=
{
contrastOption
===
'day'
?
undefined
:
contrastOption
}
value
=
{
child
.
value
}
...
...
@@ -1181,7 +1183,6 @@ const HistoryView = (props) => {
emptyOrError
.
current
.
error
=
false
;
if
(
results
.
length
)
{
let
data
=
[];
// let _predicateData = [];
results
.
forEach
((
res
,
index
)
=>
{
const
{
dateFrom
,
dateTo
}
=
dateRange
?.[
index
]
??
{};
if
(
res
.
code
===
0
&&
res
.
data
.
length
)
{
...
...
@@ -1551,7 +1552,7 @@ const HistoryView = (props) => {
},
[
loading
]);
return
(
<
div
className
=
{
classNames
(
prefixCls
,
theme
===
'BI'
?
BIStyles
.
historyViewComponents
:
''
,
'wkt-scroll-light'
)}
className
=
{
classNames
(
prefixCls
,
theme
===
'BI'
?
BIStyles
[
`
${
prefixCls
}
-historyViewComponents`
]
:
''
,
'wkt-scroll-light'
)}
style
=
{{
background
:
theme
===
'BI'
?
'#282b34'
:
'#ffffff'
}}
>
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-spin`
)}
style
=
{{
position
:
'relative'
}}
>
{
loading
||
percent
!==
0
?
(
...
...
packages/extend-components/EC_HistoryView/src/index.less
View file @
40af6556
...
...
@@ -24,7 +24,7 @@
}
.@{ant-prefix}-table-thead > tr > th {
background: rgba(224, 234, 251, 0.4)
!important
;
background: rgba(224, 234, 251, 0.4);
}
&-extra-right {
...
...
packages/extend-components/EC_HistoryView/src/indexForBI.less
View file @
40af6556
...
...
@@ -6,7 +6,7 @@
@primaryColorOpacity: #1980ff16;
@primaryTextColor: #dcdcf2d9;
.historyViewComponents {
.
@{history-view}-
historyViewComponents {
--primary-color: @primaryColor;
--primary-color-opacity: @primaryColorOpacity;
...
...
@@ -27,8 +27,8 @@
--panel-border-color: #38435a;
--table-head-background-color: #dcdcf214;
//background-color: var(--background-color);
.@{ant-prefix}-table-thead
>tr>
th {
:global{}
.@{ant-prefix}-table-thead
> tr >
th {
background: var(--table-head-background-color);
border-bottom: 1px solid var(--border-color);
color: var(--text-color);
...
...
@@ -50,7 +50,7 @@
color: var(--text-color);
}
// radio
:global {
.@{ant-prefix}-radio-button-wrapper {
...
...
@@ -112,7 +112,7 @@
}
}
.@{ant-prefix}-tabs-top
>
.@{ant-prefix}-tabs-nav::before {
.@{ant-prefix}-tabs-top
>
.@{ant-prefix}-tabs-nav::before {
border-bottom: 1px solid var(--panel-border-color);
}
}
...
...
@@ -137,7 +137,15 @@
:global {
.@{ant-prefix}-picker {
background-color: var(--background-color);
border: 1px solid var(--border-color)
border: 1px solid var(--border-color);
input {
color: var(--text-color);
}
.@{ant-prefix}-picker-clear {
background-color: var(--background-color);
color: var(--text-color);
}
}
.@{ant-prefix}-picker-panel {
...
...
@@ -149,10 +157,10 @@
border-left: 1px solid var(--date-border-color);
}
.ant-picker-header
>
button,
.ant-picker-header
>
button,
.@{ant-prefix}-picker-cell.@{ant-prefix}-picker-cell-in-view,
.@{ant-prefix}-picker-content th,
.@{ant-prefix}-picker-time-panel-column
>
li.@{ant-prefix}-picker-time-panel-cell .@{ant-prefix}-picker-time-panel-cell-inner {
.@{ant-prefix}-picker-time-panel-column
>
li.@{ant-prefix}-picker-time-panel-cell .@{ant-prefix}-picker-time-panel-cell-inner {
color: var(--text-color);
}
...
...
@@ -169,8 +177,8 @@
color: var(--date-negative);
}
.@{ant-prefix}-picker-time-panel-column
>
li.@{ant-prefix}-picker-time-panel-cell .@{ant-prefix}-picker-time-panel-cell-inner:hover,
.@{ant-prefix}-picker-time-panel-column
>
li.@{ant-prefix}-picker-time-panel-cell-selected .@{ant-prefix}-picker-time-panel-cell-inner,
.@{ant-prefix}-picker-time-panel-column
>
li.@{ant-prefix}-picker-time-panel-cell .@{ant-prefix}-picker-time-panel-cell-inner:hover,
.@{ant-prefix}-picker-time-panel-column
>
li.@{ant-prefix}-picker-time-panel-cell-selected .@{ant-prefix}-picker-time-panel-cell-inner,
.@{ant-prefix}-picker-cell:hover:not(.@{ant-prefix}-picker-cell-in-view) .@{ant-prefix}-picker-cell-inner,
.@{ant-prefix}-picker-cell:hover:not(.@{ant-prefix}-picker-cell-selected):not(.@{ant-prefix}-picker-cell-range-start):not(.@{ant-prefix}-picker-cell-range-end):not(.@{ant-prefix}-picker-cell-range-hover-start):not(.@{ant-prefix}-picker-cell-range-hover-end) .@{ant-prefix}-picker-cell-inner {
background-color: var(--primary-color);
...
...
@@ -184,6 +192,10 @@
.@{ant-prefix}-picker-range-arrow::before {
background-color: var(--background-color);
}
.@{ant-prefix}-picker-panel .@{ant-prefix}-picker-footer {
border-top: 1px solid var(--border-color);
}
}
// select
...
...
@@ -240,7 +252,7 @@
}
.@{history-view}-spin,
.@{history-view}-spin
>
.@{ant-prefix}-spin-container,
.@{history-view}-spin
>
.@{ant-prefix}-spin-container,
.@{ant-prefix}-tabs,
.@{ant-prefix}-tabs-content,
.@{ant-prefix}-tabs-tabpane {
...
...
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