Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
super-hive-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SuperHive
front-end
super-hive-web
Commits
bb00d5e7
Commit
bb00d5e7
authored
Aug 21, 2020
by
wends
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 频域分析
parent
eadf5a9f
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
262 additions
and
220 deletions
+262
-220
frequency-analysis.js
src/api/device-management/frequency-analysis.js
+17
-1
FunctionLine.vue
src/components/Charts/FunctionLine.vue
+17
-11
TimeDomainLine.vue
src/components/Charts/TimeDomainLine.vue
+65
-0
index.vue
src/views/device-management/frequency-analysis/index.vue
+163
-208
No files found.
src/api/device-management/frequency-analysis.js
View file @
bb00d5e7
...
...
@@ -2,7 +2,7 @@ import request from '@/utils/request'
// const baseURL = process.env.VUE_APP_BASE_API
const
baseURL
=
''
//
获取数据集列表-分页
//
时域分析
export
function
getTimeDomainData
(
data
)
{
return
request
({
url
:
`
${
baseURL
}
/iot/dashboard/timeDomainData`
,
...
...
@@ -10,3 +10,19 @@ export function getTimeDomainData(data) {
data
})
}
// 频域分析
export
function
getFrequencyDomainData
(
data
)
{
return
request
({
url
:
`
${
baseURL
}
/iot/dashboard/frequencyDomainData`
,
method
:
'
post
'
,
data
})
}
// 获取指定实例采样数据列表
export
function
getDataPreview
(
data
)
{
return
request
({
url
:
`
${
baseURL
}
/iot/dashboard/dataPreview`
,
method
:
'
post
'
,
data
})
}
src/components/Charts/FunctionLine.vue
View file @
bb00d5e7
...
...
@@ -75,23 +75,16 @@ export default {
this
.
chart
=
null
},
methods
:
{
dispatch
(
action
)
{
this
.
chart
.
dispatchAction
(
action
)
},
updateChart
(
data
)
{
console
.
log
(
data
)
const
xAxis
=
[]
const
series
=
[]
data
.
forEach
(
v
=>
{
xAxis
.
push
(
v
[
0
])
series
.
push
(
v
[
1
])
})
this
.
chart
.
setOption
({
xAxis
:
{
data
:
xAxis
},
series
:
[{
type
:
'
line
'
,
showSymbol
:
false
,
clip
:
true
,
data
:
series
data
:
data
}]
})
},
...
...
@@ -118,6 +111,12 @@ export default {
},
yAxis
:
{
name
:
'
y
'
,
max
:
function
(
value
)
{
return
(
value
.
max
+
2
).
toFixed
(
2
)
},
min
:
function
(
value
)
{
return
(
value
.
min
-
2
).
toFixed
(
2
)
},
minorTick
:
{
show
:
true
},
...
...
@@ -146,6 +145,13 @@ export default {
}
this
.
chart
.
setOption
(
config
)
// this.chart.on('datazoom', (val) => {
// const params = {
// type: 'functionLine',
// val: val.batch[0]
// }
// this.$emit('datazoom', params)
// })
}
}
}
...
...
src/components/Charts/TimeDomainLine.vue
View file @
bb00d5e7
...
...
@@ -55,6 +55,12 @@ export default {
step
:
{
type
:
Boolean
,
default
:
false
},
functionList
:
{
type
:
Array
,
default
:
()
=>
{
return
{}
}
}
},
data
()
{
...
...
@@ -65,6 +71,18 @@ export default {
watch
:
{
lineData
:
function
(
val
)
{
this
.
updateChart
(
val
)
},
functionList
:
function
(
val
)
{
const
series
=
[]
this
.
lineData
.
xAxis
.
forEach
(
i
=>
{
let
sum
=
0
val
.
forEach
(
v
=>
{
const
{
amplitude
,
frequency
,
phase
}
=
v
.
func
sum
+=
this
.
func
(
i
,
amplitude
,
frequency
,
phase
)
})
series
.
push
(
sum
)
})
this
.
secondChart
(
series
)
}
},
mounted
()
{
...
...
@@ -78,14 +96,50 @@ export default {
this
.
chart
=
null
},
methods
:
{
func
(
x
,
amplitude
=
1
,
frequency
=
1
,
phase
=
0
)
{
return
amplitude
*
Math
.
cos
(
2
*
Math
.
PI
*
frequency
*
x
+
phase
*
Math
.
PI
)
},
dispatch
(
action
)
{
this
.
chart
.
dispatchAction
(
action
)
},
secondChart
(
chart
)
{
this
.
chart
.
setOption
({
xAxis
:
{
data
:
this
.
lineData
.
xAxis
},
legend
:
{
data
:
[
'
时序数据
'
,
'
拟合数据
'
]
},
series
:
[
{
type
:
'
line
'
,
showSymbol
:
false
,
name
:
'
时序数据
'
,
clip
:
true
,
data
:
this
.
lineData
.
series
.
map
(
v
=>
this
.
strip
(
v
))
},
{
type
:
'
line
'
,
showSymbol
:
false
,
name
:
'
拟合数据
'
,
clip
:
true
,
data
:
chart
}
]
})
},
updateChart
(
data
)
{
this
.
chart
.
setOption
({
legend
:
{
data
:
[
'
时序数据
'
]
},
xAxis
:
{
data
:
data
.
xAxis
},
series
:
[{
type
:
'
line
'
,
showSymbol
:
false
,
name
:
'
时序数据
'
,
clip
:
true
,
data
:
data
.
series
.
map
(
v
=>
this
.
strip
(
v
))
}]
...
...
@@ -110,12 +164,16 @@ export default {
this
.
chart
=
echarts
.
init
(
document
.
getElementById
(
this
.
id
))
let
config
=
{
tooltip
:
{},
legend
:
{
data
:
[
'
时序数据
'
]
},
xAxis
:
{
data
:
[]
},
yAxis
:
{},
series
:
[{
type
:
'
line
'
,
name
:
'
时序数据
'
,
data
:
[]
}]
}
...
...
@@ -125,6 +183,13 @@ export default {
}
this
.
chart
.
setOption
(
config
)
this
.
chart
.
on
(
'
datazoom
'
,
(
val
)
=>
{
const
params
=
{
type
:
'
timeDomainLine
'
,
val
:
val
.
batch
[
0
]
}
this
.
$emit
(
'
datazoom
'
,
params
)
})
}
}
}
...
...
src/views/device-management/frequency-analysis/index.vue
View file @
bb00d5e7
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