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
d920b3f2
Commit
d920b3f2
authored
Sep 05, 2023
by
陈龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 调整历史曲线
parent
df570e92
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
117 additions
and
27 deletions
+117
-27
index.js
packages/extend-components/EC_HistoryView/src/demos/index.js
+37
-23
index.js
packages/extend-components/EC_HistoryView/src/index.js
+0
-0
index.less
packages/extend-components/EC_HistoryView/src/index.less
+61
-0
utils.js
packages/extend-components/EC_HistoryView/src/utils.js
+19
-4
No files found.
packages/extend-components/EC_HistoryView/src/demos/index.js
View file @
d920b3f2
...
@@ -3,13 +3,13 @@ import HistoryView from '../index';
...
@@ -3,13 +3,13 @@ import HistoryView from '../index';
import
{
MobileHistoryChart
}
from
"../mobile"
;
import
{
MobileHistoryChart
}
from
"../mobile"
;
const
deviceParams
=
[
const
deviceParams
=
[
{
/*
{
deviceCode
:
'EGBF00000141'
,
deviceCode: 'EGBF00000141',
// sensors: '进水压力,出水瞬时流量,出水累计流量',
// sensors: '进水压力,出水瞬时流量,出水累计流量',
sensors
:
'进水压力'
,
sensors: '进水压力',
deviceType
:
'二供泵房'
,
deviceType: '二供泵房',
pointAddressID
:
208
,
pointAddressID: 208,
},
},*/
/* {
/* {
"deviceCode": "SYJ00000008",
"deviceCode": "SYJ00000008",
"sensors": "瞬时流量",
"sensors": "瞬时流量",
...
@@ -32,28 +32,42 @@ const deviceParams = [
...
@@ -32,28 +32,42 @@ const deviceParams = [
deviceType: '二供机组',
deviceType: '二供机组',
pointAddressID: 4,
pointAddressID: 4,
},*/
},*/
/* {
/*
{
"deviceCode": "LLJ00000055",
"deviceCode": "LLJ00000055",
"sensors": "正累计流量,瞬时流量,是否在线",
"sensors": "正累计流量,瞬时流量,是否在线",
"deviceType": "流量计"
"deviceType": "流量计"
}*/
}*/
/* {
/* {
"deviceCode": "EGJZ00000163",
"deviceCode": "EGJZ00000163",
"sensors": "进水压力,是否在线",
"sensors": "进水压力,是否在线",
"deviceType": "二供机组"
"deviceType": "二供机组"
}*/
}*/
// 邳州张楼水厂
// 邳州张楼水厂
/* {
/* {
"deviceCode": "SC00000023",
"deviceCode": "SC00000023",
"sensors": "出水压力",
"sensors": "出水压力",
"deviceType": "水厂"
"deviceType": "水厂"
}*/
}*/
/*
/* {
{
"deviceCode": "JFJ00000001",
"deviceCode": "JFJ00000001",
"sensors": "沉淀池投矾量瞬时,",
"sensors": "沉淀池投矾量瞬时,",
"deviceType": "加矾间"
"deviceType": "加矾间"
}*/
}*/
/* {
"deviceCode": "QSBF00000001",
"sensors": "取水浊度",
"deviceType": "取水泵房"
}*/
/* {
"deviceCode": "SC00000023",
"sensors": "出水瞬时流量,是否在线",
"deviceType": "水厂"
}*/
{
"deviceCode"
:
"XNCDC00000001"
,
"sensors"
:
"沉淀池1号进水管流量"
,
"deviceType"
:
"絮凝沉淀池"
}
];
];
const
Demo
=
()
=>
{
const
Demo
=
()
=>
{
return
(
return
(
...
...
packages/extend-components/EC_HistoryView/src/index.js
View file @
d920b3f2
This diff is collapsed.
Click to expand it.
packages/extend-components/EC_HistoryView/src/index.less
View file @
d920b3f2
...
@@ -38,6 +38,34 @@
...
@@ -38,6 +38,34 @@
height: 100%;
height: 100%;
}
}
.@{history-view}-progressWrapper {
z-index: 100;
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
background: rgba(255, 255, 255, 0.9);
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
.@{history-view}-progress {
display: inline-flex;
}
.@{history-view}-tip {
display: inline-block;
margin-top: 10px;
color: #1890ff;
}
}
.@{history-view}-progress {
}
.@{history-view}-single-panel {
.@{history-view}-single-panel {
display: flex;
display: flex;
flex-direction: column;
flex-direction: column;
...
@@ -205,3 +233,36 @@
...
@@ -205,3 +233,36 @@
align-items: center;
align-items: center;
margin-bottom: 0.3rem;
margin-bottom: 0.3rem;
}
}
.@{history-view}-blink-2 {
-webkit-animation: blink-2 10s infinite both;
animation: blink-2 10s infinite both;
}
/**
* ----------------------------------------
* animation blink-2
* ----------------------------------------
*/
@-webkit-keyframes blink-2 {
0% {
opacity: 1;
}
50% {
opacity: 0.4;
}
100% {
opacity: 1;
}
}
@keyframes blink-2 {
0% {
opacity: 1;
}
50% {
opacity: 0.4;
}
100% {
opacity: 1;
}
}
packages/extend-components/EC_HistoryView/src/utils.js
View file @
d920b3f2
...
@@ -546,7 +546,7 @@ const handleYAxis = ({dataSource, needUnit, curveCenter, showGridLine}) => {
...
@@ -546,7 +546,7 @@ const handleYAxis = ({dataSource, needUnit, curveCenter, showGridLine}) => {
const rightNum = Math.floor(yAxisMap.size / 2);
const rightNum = Math.floor(yAxisMap.size / 2);
return {leftNum, rightNum, yAxis};
return {leftNum, rightNum, yAxis};
}
}
const assignOptions = (restOption, xAxis, legendData, chartType) => {
const assignOptions = (restOption, xAxis, legendData, chartType
, contrast, contrastOption
) => {
restOption.dataZoom = [
restOption.dataZoom = [
{
{
show: true,
show: true,
...
@@ -566,6 +566,14 @@ const assignOptions = (restOption, xAxis, legendData, chartType) => {
...
@@ -566,6 +566,14 @@ const assignOptions = (restOption, xAxis, legendData, chartType) => {
height: currentOption['dataZoomHeight'],
height: currentOption['dataZoomHeight'],
type: 'slider',
type: 'slider',
zoomOnMouseWheel: true,
zoomOnMouseWheel: true,
labelFormatter: function (e) {
let _formatterStr = 'YYYY-MM-DD HH:mm:ss';
if (contrast) {
if (contrastOption === 'day') _formatterStr = 'HH:mm';
if (contrastOption === 'month') _formatterStr = 'MM月DD日 HH时';
}
return moment(e).format(_formatterStr)
}
},
},
];
];
xAxis.minInterval = 3600 * (1 * 1000);
xAxis.minInterval = 3600 * (1 * 1000);
...
@@ -576,6 +584,12 @@ const assignOptions = (restOption, xAxis, legendData, chartType) => {
...
@@ -576,6 +584,12 @@ const assignOptions = (restOption, xAxis, legendData, chartType) => {
const returnMaxOrMinNumber = (dataSource, type) => {
const returnMaxOrMinNumber = (dataSource, type) => {
let _obj = null;
let _obj = null;
if (type === 'period' && dataSource?.[0]?.dataModel?.length) {
let _length = dataSource?.[0]?.dataModel?.length;
let _first = dataSource?.[0]?.dataModel[0]?.pt;
let _last = dataSource?.[0]?.dataModel[_length - 1]?.pt;
return ['展示时段: ', _first, _last, type]
}
dataSource?.[0]?.dataModel.filter(item => item.pv !== null).forEach(item => {
dataSource?.[0]?.dataModel.filter(item => item.pv !== null).forEach(item => {
if (!_obj) {
if (!_obj) {
_obj = item;
_obj = item;
...
@@ -667,6 +681,7 @@ const renderItem = (params, api) => {
...
@@ -667,6 +681,7 @@ const renderItem = (params, api) => {
const returnCustomSeries = (dataSource) => {
const returnCustomSeries = (dataSource) => {
let _maxNumber = returnMaxOrMinNumber(dataSource, 'max');
let _maxNumber = returnMaxOrMinNumber(dataSource, 'max');
let _minNumber = returnMaxOrMinNumber(dataSource, 'min');
let _minNumber = returnMaxOrMinNumber(dataSource, 'min');
// let _period = returnMaxOrMinNumber(dataSource, 'period');
// 需要将最大值最小分别传入,后续计算图例位置需要,先min后max
// 需要将最大值最小分别传入,后续计算图例位置需要,先min后max
let _max = _maxNumber[1];
let _max = _maxNumber[1];
let _min = _minNumber[1];
let _min = _minNumber[1];
...
@@ -813,13 +828,13 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
...
@@ -813,13 +828,13 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
}
<
/span
>
}
<
/span
>
<
span
style
=
"font-size: ${handlePx(12, 'px')};"
>
$
{
_unit
??
''
}
<
/span
>
<
span
style
=
"font-size: ${handlePx(12, 'px')};"
>
$
{
_unit
??
''
}
<
/span
>
<
/div
>
<
/div
>
<
div
style
=
"display: ${lineDataType
==='特征曲线'?'flex':
'none'}; align-items: center;"
>
<
div
style
=
"display: ${lineDataType
=== '特征曲线' ? 'flex' :
'none'}; align-items: center;"
>
<
span
>
周期最小值
<
/span><span style="display:inline-block;">:</
span
>
<
span
>
周期最小值
<
/span><span style="display:inline-block;">:</
span
>
<
span
style
=
"color: ${COLOR.AVG};margin: 0 ${handlePx(5, 'px')} 0 auto;"
>
$
{
e
?.[
1
]?.
value
?.[
1
]
??
'-'
<
span
style
=
"color: ${COLOR.AVG};margin: 0 ${handlePx(5, 'px')} 0 auto;"
>
$
{
e
?.[
1
]?.
value
?.[
1
]
??
'-'
}
<
/span
>
}
<
/span
>
<
span
style
=
"font-size: ${handlePx(12, 'px')};"
>
$
{
_unit
??
''
}
<
/span
>
<
span
style
=
"font-size: ${handlePx(12, 'px')};"
>
$
{
_unit
??
''
}
<
/span
>
<
/div
>
<
/div
>
<
div
style
=
"display: ${lineDataType
==='特征曲线'?'flex':
'none'}; align-items: center;"
>
<
div
style
=
"display: ${lineDataType
=== '特征曲线' ? 'flex' :
'none'}; align-items: center;"
>
<
span
>
周期最大值
<
/span><span style="display:inline-block;">:</
span
>
<
span
>
周期最大值
<
/span><span style="display:inline-block;">:</
span
>
<
span
style
=
"color: ${COLOR.AVG};margin: 0 ${handlePx(5, 'px')} 0 auto;"
>
$
{
_maxValues
[
e
?.[
2
]?.
dataIndex
]
??
'-'
<
span
style
=
"color: ${COLOR.AVG};margin: 0 ${handlePx(5, 'px')} 0 auto;"
>
$
{
_maxValues
[
e
?.[
2
]?.
dataIndex
]
??
'-'
}
<
/span
>
}
<
/span
>
...
@@ -840,7 +855,7 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
...
@@ -840,7 +855,7 @@ const optionGenerator = (dataSource, cusOption, contrast, contrastOption, smooth
}
}
tooltip
.
timeFormat
=
tooltipTimeFormat
;
tooltip
.
timeFormat
=
tooltipTimeFormat
;
let
_legendData
=
series
.
filter
(
item
=>
!
[
'周期最大值'
,
'周期最小值'
,
'自定义'
].
includes
(
item
.
name
)).
map
(
item
=>
item
.
name
);
let
_legendData
=
series
.
filter
(
item
=>
!
[
'周期最大值'
,
'周期最小值'
,
'自定义'
].
includes
(
item
.
name
)).
map
(
item
=>
item
.
name
);
assignOptions
(
restOption
,
xAxis
,
_legendData
,
chartType
);
assignOptions
(
restOption
,
xAxis
,
_legendData
,
chartType
,
contrast
,
contrastOption
);
return
{
return
{
yAxis
,
yAxis
,
grid
,
grid
,
...
...
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