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
2a5e388d
Commit
2a5e388d
authored
Aug 22, 2023
by
陈龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 历史曲线版本更新
parent
c327eac2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
98 additions
and
34 deletions
+98
-34
index.js
packages/extend-components/EC_HistoryView/src/apis/index.js
+26
-16
最小实心箭头朝下.svg
.../extend-components/EC_HistoryView/src/assets/最小实心箭头朝下.svg
+39
-0
index.js
packages/extend-components/EC_HistoryView/src/demos/index.js
+6
-1
index.js
packages/extend-components/EC_HistoryView/src/index.js
+26
-16
mobile.js
packages/extend-components/EC_HistoryView/src/mobile.js
+1
-1
utils.js
packages/extend-components/EC_HistoryView/src/utils.js
+0
-0
No files found.
packages/extend-components/EC_HistoryView/src/apis/index.js
View file @
2a5e388d
import
{
request
}
from
'@wisdom-utils/utils'
;
import
{
request
}
from
'@wisdom-utils/utils'
;
const
REQUEST_METHOD_GET
=
'get'
;
const
REQUEST_METHOD_POST
=
'post'
;
...
...
@@ -6,29 +6,38 @@ const REQUEST_METHOD_POST = 'post';
const
baseUrl
=
typeof
DUMI_TYPE
!==
'undefined'
&&
DUMI_TYPE
===
'dumi'
?
'/api'
:
''
;
const
monitorDeviceUrl
=
`
${
baseUrl
}
/PandaMonitor/Monitor/Device`
;
// 获取历史数据
export
function
getHistoryInfo
(
data
)
{
return
request
({
url
:
`
${
monitorDeviceUrl
}
/GetSensorsDataForStation`
,
method
:
REQUEST_METHOD_POST
,
data
,
});
return
request
({
url
:
`
${
monitorDeviceUrl
}
/GetSensorsDataForStation`
,
method
:
REQUEST_METHOD_POST
,
data
,
});
}
// 获取指标报警方案配置
export
function
getDeviceAlarmScheme
(
option
)
{
return
request
({
url
:
`
${
monitorDeviceUrl
}
/GetDeviceAlarmScheme`
,
method
:
REQUEST_METHOD_POST
,
...
option
,
});
return
request
({
url
:
`
${
monitorDeviceUrl
}
/GetDeviceAlarmScheme`
,
method
:
REQUEST_METHOD_POST
,
...
option
,
});
}
// 导出设备指标历史数据
export
function
getExportDeviceHistoryUrl
(
data
)
{
return
request
({
url
:
`
${
monitorDeviceUrl
}
/ExportDeviceHistoryInfo`
,
method
:
REQUEST_METHOD_POST
,
data
,
});
return
request
({
url
:
`
${
monitorDeviceUrl
}
/ExportDeviceHistoryInfo`
,
method
:
REQUEST_METHOD_POST
,
data
,
});
}
export
function
getDictionaryInfoAll
(
params
)
{
return
request
({
url
:
`
${
baseUrl
}
/PandaCore/GCK/Common/GetDictionaryInfoAll`
,
method
:
REQUEST_METHOD_GET
,
params
})
}
\ No newline at end of file
packages/extend-components/EC_HistoryView/src/assets/最小实心箭头朝下.svg
0 → 100644
View file @
2a5e388d
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 26.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
version=
"1.1"
id=
"图层_1"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
x=
"0px"
y=
"0px"
width=
"38.8px"
height=
"24.8px"
viewBox=
"0 0 38.8 24.8"
enable-background=
"new 0 0 38.8 24.8"
xml:space=
"preserve"
>
<image
overflow=
"visible"
opacity=
"0.55"
enable-background=
"new "
width=
"48"
height=
"33"
xlink:href=
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAhCAYAAACfiCi5AAAACXBIWXMAAAsSAAALEgH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GdyMAAAAASUVORK5CYII="
transform=
"matrix(-1 0 0 -1 43 29.5848)"
>
</image>
<g>
<g>
<g>
<path
opacity=
"0.8"
fill-rule=
"evenodd"
clip-rule=
"evenodd"
fill=
"#05C2BC"
enable-background=
"new "
d=
"M4.4,0.5h29
c1.7,0,3,1.3,3,3v10c0,1.7-1.3,3-3,3H22.7l-4.2,4l-4.7-4H4.3c-1.7,0-3-1.3-3-3v-10C1.4,1.8,2.7,0.5,4.4,0.5z"
/>
<path
fill=
"none"
stroke=
"#05C2BC"
stroke-width=
"0.5"
stroke-linecap=
"round"
d=
"M4.4,0.5h29c1.7,0,3,1.3,3,3v10
c0,1.7-1.3,3-3,3H22.7l-4.2,4l-4.7-4H4.3c-1.7,0-3-1.3-3-3v-10C1.4,1.8,2.7,0.5,4.4,0.5z"
/>
</g>
</g>
</g>
<path
fill-rule=
"evenodd"
clip-rule=
"evenodd"
fill=
"#FFFFFF"
d=
"M29.2,11.6c-0.5-1.7-1.1-3.5-1.9-5.6l1.2-0.7
c0.8,2.1,1.5,4,1.9,5.5L29.2,11.6z M24,13.6h-1.7L22,12.4c0.6,0.1,1.1,0.1,1.6,0.1s0.7-0.2,0.7-0.7V2.9h1.3v9.2
C25.6,13.1,25.1,13.6,24,13.6z M19,10.6c0.9-1.2,1.6-2.9,2-4.9l1.3,0.5c-0.5,2.4-1.3,4.2-2.1,5.4L19,10.6z M15.6,12.8
c-0.5,0.4-1.2,0.8-1.9,1.1l-0.6-1c0.7-0.3,1.2-0.6,1.7-0.9c-0.6-0.6-1-1.4-1.2-2.1h-0.4v-1h4.2v0.9c-0.2,0.8-0.5,1.6-1,2.2
c0.4,0.3,1,0.6,1.7,0.9l-0.6,1C16.8,13.5,16.1,13.1,15.6,12.8z M14.7,9.8c0.2,0.5,0.5,1,0.9,1.4c0.4-0.4,0.6-0.9,0.8-1.4H14.7z
M12.8,11.8c0.3-0.1,0.5-0.1,0.6-0.1v0.9c-0.3,0.1-0.5,0.1-0.6,0.1v1.1h-1.2v-1c-1,0.1-2.3,0.2-4,0.4L7.4,12h1V8.1h-1v-1h10.7v1
h-5.3V11.8z M11.6,8.2h-2v0.6h2V8.2z M11.6,9.8h-2v0.7h2V9.8z M11.6,11.3h-2v0.8c0.7,0,1.4-0.1,2-0.2V11.3z M8.8,3h8v3.7h-8
C8.8,6.7,8.8,3,8.8,3z M10,5.9h5.6V5.3H10V5.9z M10,4.5h5.6V3.9H10V4.5z"
/>
</svg>
packages/extend-components/EC_HistoryView/src/demos/index.js
View file @
2a5e388d
...
...
@@ -42,7 +42,12 @@ const deviceParams = [
"deviceCode": "LLJ00000004",
"sensors": "瞬时流量",
"deviceType": "流量计"
} */
}*/
/* {
"deviceCode": "JFJ00000001",
"sensors": "沉淀池投矾量瞬时,是否在线",
"deviceType": "加矾间"
}*/
];
const
Demo
=
()
=>
{
return
(
...
...
packages/extend-components/EC_HistoryView/src/index.js
View file @
2a5e388d
...
...
@@ -24,7 +24,7 @@ import _ from 'lodash';
import
TimeRangePicker
from
'@wisdom-components/timerangepicker'
;
import
PandaEmpty
from
'@wisdom-components/empty'
;
import
BasicTable
from
'@wisdom-components/basictable'
;
import
{
getHistoryInfo
,
getDeviceAlarmScheme
,
getExportDeviceHistoryUrl
}
from
'./apis'
;
import
{
getHistoryInfo
,
getDeviceAlarmScheme
,
getExportDeviceHistoryUrl
,
getDictionaryInfoAll
}
from
'./apis'
;
import
SimgleChart
from
'./SingleChart'
;
import
GridChart
from
'./GridChart'
;
import
'./index.less'
;
...
...
@@ -81,15 +81,6 @@ const CheckboxData = [
showInTable
:
true
,
tooltip
:
'本算法采用递推平均滤波法(滑动平均滤波法)对采样数据进行均值化平滑处理。'
,
},
// 需求变更,剔除
/* {
key: 'justLine',
label: '仅查看曲线',
type: '',
checked: false,
showInCurve: false,
showInTable: false,
},*/
{
key
:
'dataThin'
,
label
:
'数据抽稀'
,
...
...
@@ -777,14 +768,10 @@ const HistoryView = (props) => {
});
setLoading(false);
handleTableData(data);
/* //
let _dataModel = data[0].dataModel;
data[0].dataModel[0].pv = 0.123451
data[0].dataModel[_dataModel.length - 1].pv = 1000000*/
setChartDataSource(data);
}
}).catch(err => {
message.
error('数据请求失败,请重试~')
message.
info('未查询到数据,请重试~');
setLoading(false)
});
};
...
...
@@ -887,7 +874,30 @@ const HistoryView = (props) => {
return
tableMemo
;
}
};
// 获取字段配置
const
getDefaultOptions
=
()
=>
{
getDictionaryInfoAll
({
level
:
'组件_ec_historyview'
}).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
let
_opt
=
res
.
data
.
reduce
((
final
,
cur
)
=>
{
final
[
cur
.
fieldName
]
=
cur
.
fieldValue
return
final
},
{});
let
_checkboxData
=
[...
checkboxData
].
map
(
item
=>
{
let
_item
=
{...
item
};
if
(
_opt
[
item
.
label
]
!==
undefined
)
{
_item
.
checked
=
_opt
[
item
.
label
]
===
'true'
}
return
_item
;
});
setCheckboxData
(
_checkboxData
);
}
})
};
useEffect
(()
=>
{
getDefaultOptions
();
},
[])
return
(
<
div
className
=
{
classNames
(
prefixCls
,
'wkt-scroll-light'
)}
>
<
Spin
spinning
=
{
loading
}
wrapperClassName
=
{
classNames
(
`
${
prefixCls
}
-spin`
)}
>
...
...
packages/extend-components/EC_HistoryView/src/mobile.js
View file @
2a5e388d
...
...
@@ -42,7 +42,7 @@ const MobileHistoryChart = (
const
{
getPrefixCls
}
=
useContext
(
ConfigProvider
.
ConfigContext
);
const
prefixCls
=
getPrefixCls
(
'history-view'
);
const
isBoxPlots
=
deviceParams
?.
length
===
1
&&
deviceParams
[
0
]?.
sensors
?.
split
(
','
).
length
===
1
;
deviceParams
?.
length
===
1
&&
deviceParams
?.
[
0
]?.
sensors
?.
split
(
','
).
length
===
1
;
const
handleDataThinKey
=
(
diffDays
)
=>
{
// 移动端缩放的抽稀一倍,需要实际调试
if
(
diffDays
>=
7
&&
diffDays
<
15
)
{
...
...
packages/extend-components/EC_HistoryView/src/utils.js
View file @
2a5e388d
This diff is collapsed.
Click to expand it.
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