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
5c7320b8
Commit
5c7320b8
authored
Sep 19, 2023
by
陈龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 优化历史曲线显示
parent
bc1f77da
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
57 deletions
+61
-57
index.js
packages/extend-components/EC_HistoryView/src/demos/index.js
+58
-54
utils.js
packages/extend-components/EC_HistoryView/src/utils.js
+3
-3
No files found.
packages/extend-components/EC_HistoryView/src/demos/index.js
View file @
5c7320b8
...
@@ -11,18 +11,18 @@ const deviceParams = [
...
@@ -11,18 +11,18 @@ const deviceParams = [
deviceType: '熊猫二供泵房',
deviceType: '熊猫二供泵房',
pointAddressID: 208,
pointAddressID: 208,
}, */
}, */
/*
{
/*
{
"deviceCode": "SYJ00000008",
"deviceCode": "SYJ00000008",
"sensors": "瞬时流量",
"sensors": "瞬时流量",
"deviceType": "水源井"
"deviceType": "水源井"
},
},
{
{
deviceCode: 'EGJZ00000197',
deviceCode: 'EGJZ00000197',
sensors: '进水压力,出水压力,出水瞬时流量,出水累计流量',
sensors: '进水压力,出水压力,出水瞬时流量,出水累计流量',
// sensors: '1#变频器运行频率',
// sensors: '1#变频器运行频率',
deviceType: '二供机组',
deviceType: '二供机组',
// pointAddressID: 208,
// pointAddressID: 208,
}, */
}, */
/* {
/* {
deviceCode: 'EGJZ00000198',
deviceCode: 'EGJZ00000198',
sensors: '进水压力,出水压力,出水瞬时流量,出水累计流量',
sensors: '进水压力,出水压力,出水瞬时流量,出水累计流量',
...
@@ -41,12 +41,12 @@ const deviceParams = [
...
@@ -41,12 +41,12 @@ const deviceParams = [
deviceType: '熊猫压力表',
deviceType: '熊猫压力表',
pointAddressID: 4,
pointAddressID: 4,
},*/
},*/
{
/*
{
deviceCode
:
'EGJZ00000226'
,
deviceCode: 'EGJZ00000226',
sensors
:
'出水压力'
,
sensors: '出水压力',
deviceType
:
'二供机组'
,
deviceType: '二供机组',
pointAddressID
:
4
,
pointAddressID: 4,
},
}, */
/* {
/* {
"deviceCode": "LLJ00000055",
"deviceCode": "LLJ00000055",
"sensors": "正累计流量,瞬时流量",
"sensors": "正累计流量,瞬时流量",
...
@@ -58,42 +58,41 @@ const deviceParams = [
...
@@ -58,42 +58,41 @@ const deviceParams = [
"deviceType": "二供机组"
"deviceType": "二供机组"
}*/
}*/
// 邳州张楼水厂
// 邳州张楼水厂
{
/* {
"deviceCode"
:
"SC00000023"
,
"deviceCode": "SC00000023",
"sensors"
:
"瞬时流量"
,
"sensors": "瞬时流量",
"deviceType"
:
"水厂"
"deviceType": "水厂"
},
}, */
/* {
{
"deviceCode": "JFJ00000001",
"deviceCode"
:
"JFJ00000001"
,
"sensors": "沉淀池投矾量瞬时,",
"sensors"
:
"沉淀池投矾量瞬时,"
,
"deviceType": "加矾间"
"deviceType"
:
"加矾间"
},
},
{
{
"deviceCode": "QSBF00000001",
"deviceCode"
:
"QSBF00000001"
,
"sensors": "取水浊度",
"sensors"
:
"取水浊度"
,
"deviceType": "取水泵房"
"deviceType"
:
"取水泵房"
},
},
{
{
"deviceCode": "SC00000023",
"deviceCode"
:
"SC00000023"
,
"sensors": "出水瞬时流量",
"sensors"
:
"出水瞬时流量"
,
"deviceType": "水厂"
"deviceType"
:
"水厂"
},
},
{
{
"deviceCode": "XNCDC00000001",
"deviceCode"
:
"XNCDC00000001"
,
"sensors": "沉淀池1号进水管流量",
"sensors"
:
"沉淀池1号进水管流量"
,
"deviceType": "絮凝沉淀池"
"deviceType"
:
"絮凝沉淀池"
},
},
{
{
"deviceCode": "LLJ00000001",
"deviceCode"
:
"LLJ00000001"
,
"sensors": "瞬时流量",
"sensors"
:
"瞬时流量"
,
"deviceType": "流量计"
"deviceType"
:
"流量计"
},
},
/!*邳州*!/
{
{
deviceCode
:
'EGJZ00000027'
,
deviceCode: 'EGJZ00000027',
sensors
:
'2#变频器运行频率'
,
sensors: '2#变频器运行频率',
deviceType
:
'二供机组'
,
deviceType: '二供机组',
},
},*/
/*确山*/
/*确山*/
/*泵3状态*/
/*泵3状态*/
/* {
/* {
...
@@ -102,6 +101,11 @@ const deviceParams = [
...
@@ -102,6 +101,11 @@ const deviceParams = [
// sensors: '3#频率',
// sensors: '3#频率',
sensors: '出1累计流量',
sensors: '出1累计流量',
deviceType: '二供机组',
deviceType: '二供机组',
}, */
/* {
"deviceCode": "EGBF00000006",
"sensors": "出1累计流量",
"deviceType": "二供泵房"
} */
} */
];
];
const
Demo
=
()
=>
{
const
Demo
=
()
=>
{
...
...
packages/extend-components/EC_HistoryView/src/utils.js
View file @
5c7320b8
...
@@ -635,8 +635,8 @@ const handleDefault = (config, cusOption) => {
...
@@ -635,8 +635,8 @@ const handleDefault = (config, cusOption) => {
};
};
const handleMaxValue = (value) => {
const handleMaxValue = (value) => {
if (value <= 1) return value.toFixed(2);
if (value <= 1) return value.toFixed(2);
if (value >= 10000
) return `
$
{(
value
/
1000
).
toFixed
(
1
)}
k
`;
if (value >= 10000
0) return `
$
{(
value
/
1000
).
toFixed
(
2
)}
k
`;
return value.toFixed(
1
);
return value.toFixed(
2
);
}
}
const handleYAxis = ({ dataSource, needUnit, curveCenter, showGridLine }) => {
const handleYAxis = ({ dataSource, needUnit, curveCenter, showGridLine }) => {
// 一种指标一个y轴
// 一种指标一个y轴
...
@@ -789,7 +789,7 @@ const handleGrid = (dataSource, needUnit, leftNum, rightNum, chartType) => {
...
@@ -789,7 +789,7 @@ const handleGrid = (dataSource, needUnit, leftNum, rightNum, chartType) => {
return {
return {
top: _base + _topForUnit,
top: _base + _topForUnit,
// left: leftNum === 1 ? 10 : leftNum * AXIS_WIDTH,
// left: leftNum === 1 ? 10 : leftNum * AXIS_WIDTH,
left:
1
0,
left:
2
0,
right:10,
right:10,
// right: rightNum === 0 ? 20 : rightNum * AXIS_WIDTH,
// right: rightNum === 0 ? 20 : rightNum * AXIS_WIDTH,
bottom: 60,
bottom: 60,
...
...
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