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
37e05e0e
Commit
37e05e0e
authored
Aug 16, 2023
by
陈龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 提交变更
parent
ff3d1098
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
8 deletions
+29
-8
GridDemo.js
...es/extend-components/EC_HistoryView/src/demos/GridDemo.js
+4
-4
index.js
packages/extend-components/EC_HistoryView/src/demos/index.js
+8
-2
index.js
packages/extend-components/EC_HistoryView/src/index.js
+17
-2
No files found.
packages/extend-components/EC_HistoryView/src/demos/GridDemo.js
View file @
37e05e0e
import
React
from
'react'
;
import
HistoryView
from
'../index'
;
/*
const deviceParams = [
const
deviceParams
=
[
{
deviceCode
:
'EGBF00000146'
,
sensors
:
'进水压力,出水瞬时流量,出水累计流量'
,
...
...
@@ -21,8 +21,8 @@ import HistoryView from '../index';
deviceType
:
'二供泵房'
,
pointAddressID
:
4
,
},
];
*/
const
deviceParams
=
[
];
/*
const deviceParams = [
{
"deviceCode": "LLJ00000055",
"sensors": "瞬时流量,正累计流量,是否在线",
...
...
@@ -33,7 +33,7 @@ const deviceParams = [
"sensors": "瞬时流量,正累计流量,是否在线",
"deviceType": "流量计"
}
]
]
*/
const
Demo
=
()
=>
{
return
<
div
style
=
{{
height
:
700
}}
>
<
HistoryView
deviceParams
=
{
deviceParams
}
grid
/>
...
...
packages/extend-components/EC_HistoryView/src/demos/index.js
View file @
37e05e0e
...
...
@@ -3,13 +3,13 @@ import HistoryView from '../index';
import
{
MobileHistoryChart
}
from
"../mobile"
;
const
deviceParams
=
[
{
/*
{
deviceCode: 'EGBF00000141',
// sensors: '进水压力,出水瞬时流量,出水累计流量',
sensors: '进水压力',
deviceType: '二供泵房',
pointAddressID: 208,
},
},
*/
/* {
// deviceCode: 'EGBF00000002',
// deviceCode: 'EGBF00000018',
...
...
@@ -37,6 +37,12 @@ const deviceParams = [
"sensors": "进水压力,是否在线",
"deviceType": "二供机组"
}*/
// 邳州张楼水厂
{
"deviceCode"
:
"LLJ00000004"
,
"sensors"
:
"瞬时流量,是否在线"
,
"deviceType"
:
"流量计"
}
];
const
Demo
=
()
=>
{
return
(
...
...
packages/extend-components/EC_HistoryView/src/index.js
View file @
37e05e0e
...
...
@@ -554,10 +554,11 @@ const HistoryView = (props) => {
let
fileName
=
`数据报表-
${
i
.
deviceType
}
-
${
i
.
deviceCode
}
-
${
moment
(
timeFrom
).
format
(
dateFormat
,
)}
至
${
moment
(
timeTo
).
format
(
dateFormat
)}
`
;
let
_quotas
=
i
.
sensors
.
split
(
','
).
filter
(
item
=>
item
!==
'是否在线'
).
join
(
','
)
getExportDeviceHistoryUrl
({
deviceType
:
i
.
deviceType
,
deviceCode
:
i
.
deviceCode
,
quotas
:
i
.
sensor
s
,
quotas
:
_quota
s
,
startTime
:
timeFrom
,
endTime
:
timeTo
,
fileName
:
fileName
,
...
...
@@ -576,6 +577,8 @@ const HistoryView = (props) => {
};
const handleTableData = useCallback((data) => {
// eslint-disable-next-line no-param-reassign
data = data.filter(item => item.sensorName !== '是否在线');
const ignoreOutliers = checkboxData.find((item) => item.key === 'ignoreOutliers').checked;
const dataIndexAccess = (dataItem, index) => {
const {stationCode, sensorName} = dataItem;
...
...
@@ -659,7 +662,7 @@ const HistoryView = (props) => {
const tableData = times.map((time) => timeData[time]);
setColumns([timeColumn, ...columnsData]);
setTableData(tableData);
}, [timeOrder]);
}, [timeOrder
, timeValue, contrastOption
]);
const [deviceAlarmSchemes, setDeviceAlarmSchemes] = useState([]);
const beforChangeParams = (value = {}) => {
...
...
@@ -778,6 +781,8 @@ const HistoryView = (props) => {
handleTableData(data);
setChartDataSource(data);
}
}).catch(err => {
setLoading(false)
});
};
...
...
@@ -811,6 +816,16 @@ const HistoryView = (props) => {
dataSource={tableData.sort((a, b) => {
let _a = a.time;
let _b = b.time
if (timeValue === 'contrast') {
if (contrastOption === 'day') {
_a = `
2000
-
01
-
01
$
{
a
.
time
}:
00
`;
_b = `
2000
-
01
-
01
$
{
b
.
time
}:
00
`;
}
if (contrastOption === 'month') {
_a = `
2000
-
01
-
$
{
a
.
time
}
:00`
;
_b
=
`2000-01-
${
b
.
time
}
:00`
;
}
}
return
timeOrder
===
'ascend'
?
moment
(
_a
)
-
moment
(
_b
)
:
moment
(
_b
)
-
moment
(
_a
);
})}
columns
=
{
columns
}
...
...
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