Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
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
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'
...
@@ -2,7 +2,7 @@ import request from '@/utils/request'
// const baseURL = process.env.VUE_APP_BASE_API
// const baseURL = process.env.VUE_APP_BASE_API
const
baseURL
=
''
const
baseURL
=
''
//
获取数据集列表-分页
//
时域分析
export
function
getTimeDomainData
(
data
)
{
export
function
getTimeDomainData
(
data
)
{
return
request
({
return
request
({
url
:
`
${
baseURL
}
/iot/dashboard/timeDomainData`
,
url
:
`
${
baseURL
}
/iot/dashboard/timeDomainData`
,
...
@@ -10,3 +10,19 @@ export function getTimeDomainData(data) {
...
@@ -10,3 +10,19 @@ export function getTimeDomainData(data) {
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 {
...
@@ -75,23 +75,16 @@ export default {
this
.
chart
=
null
this
.
chart
=
null
},
},
methods
:
{
methods
:
{
dispatch
(
action
)
{
this
.
chart
.
dispatchAction
(
action
)
},
updateChart
(
data
)
{
updateChart
(
data
)
{
console
.
log
(
data
)
const
xAxis
=
[]
const
series
=
[]
data
.
forEach
(
v
=>
{
xAxis
.
push
(
v
[
0
])
series
.
push
(
v
[
1
])
})
this
.
chart
.
setOption
({
this
.
chart
.
setOption
({
xAxis
:
{
data
:
xAxis
},
series
:
[{
series
:
[{
type
:
'
line
'
,
type
:
'
line
'
,
showSymbol
:
false
,
showSymbol
:
false
,
clip
:
true
,
clip
:
true
,
data
:
series
data
:
data
}]
}]
})
})
},
},
...
@@ -118,6 +111,12 @@ export default {
...
@@ -118,6 +111,12 @@ export default {
},
},
yAxis
:
{
yAxis
:
{
name
:
'
y
'
,
name
:
'
y
'
,
max
:
function
(
value
)
{
return
(
value
.
max
+
2
).
toFixed
(
2
)
},
min
:
function
(
value
)
{
return
(
value
.
min
-
2
).
toFixed
(
2
)
},
minorTick
:
{
minorTick
:
{
show
:
true
show
:
true
},
},
...
@@ -146,6 +145,13 @@ export default {
...
@@ -146,6 +145,13 @@ export default {
}
}
this
.
chart
.
setOption
(
config
)
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 {
...
@@ -55,6 +55,12 @@ export default {
step
:
{
step
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
false
default
:
false
},
functionList
:
{
type
:
Array
,
default
:
()
=>
{
return
{}
}
}
}
},
},
data
()
{
data
()
{
...
@@ -65,6 +71,18 @@ export default {
...
@@ -65,6 +71,18 @@ export default {
watch
:
{
watch
:
{
lineData
:
function
(
val
)
{
lineData
:
function
(
val
)
{
this
.
updateChart
(
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
()
{
mounted
()
{
...
@@ -78,14 +96,50 @@ export default {
...
@@ -78,14 +96,50 @@ export default {
this
.
chart
=
null
this
.
chart
=
null
},
},
methods
:
{
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
)
{
updateChart
(
data
)
{
this
.
chart
.
setOption
({
this
.
chart
.
setOption
({
legend
:
{
data
:
[
'
时序数据
'
]
},
xAxis
:
{
xAxis
:
{
data
:
data
.
xAxis
data
:
data
.
xAxis
},
},
series
:
[{
series
:
[{
type
:
'
line
'
,
type
:
'
line
'
,
showSymbol
:
false
,
showSymbol
:
false
,
name
:
'
时序数据
'
,
clip
:
true
,
clip
:
true
,
data
:
data
.
series
.
map
(
v
=>
this
.
strip
(
v
))
data
:
data
.
series
.
map
(
v
=>
this
.
strip
(
v
))
}]
}]
...
@@ -110,12 +164,16 @@ export default {
...
@@ -110,12 +164,16 @@ export default {
this
.
chart
=
echarts
.
init
(
document
.
getElementById
(
this
.
id
))
this
.
chart
=
echarts
.
init
(
document
.
getElementById
(
this
.
id
))
let
config
=
{
let
config
=
{
tooltip
:
{},
tooltip
:
{},
legend
:
{
data
:
[
'
时序数据
'
]
},
xAxis
:
{
xAxis
:
{
data
:
[]
data
:
[]
},
},
yAxis
:
{},
yAxis
:
{},
series
:
[{
series
:
[{
type
:
'
line
'
,
type
:
'
line
'
,
name
:
'
时序数据
'
,
data
:
[]
data
:
[]
}]
}]
}
}
...
@@ -125,6 +183,13 @@ export default {
...
@@ -125,6 +183,13 @@ export default {
}
}
this
.
chart
.
setOption
(
config
)
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
...
@@ -32,21 +32,25 @@
...
@@ -32,21 +32,25 @@
/>
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"时间范围:"
prop=
"startAndEndTime"
>
<el-form-item
label=
"采样数据:"
prop=
"time"
>
<el-date-picker
<el-select
v-model=
"form.time"
placeholder=
"请选择"
style=
"width: 240px"
>
v-model=
"form.startAndEndTime"
<el-option
type=
"datetimerange"
v-for=
"(sample, index) in samplingList"
range-separator=
"至"
:key=
"index"
start-placeholder=
"开始日期"
:label=
"$moment(sample.time, 'MM-DD HH:mm:ss')"
end-placeholder=
"结束日期"
:value=
"sample.time"
:picker-options=
"pickerOptions"
>
/>
<span
style=
"float: left"
>
{{
$moment
(
sample
.
time
,
'
MM-DD HH:mm:ss
'
)
}}
</span>
<span
style=
"float: right; color: #8492a6; font-size: 13px"
>
{{
sample
.
samplingRate
}}
MS/s
</span>
</el-option>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
<el-button
type=
"primary"
@
click=
"queryData"
>
查询
</el-button>
<el-button
type=
"primary"
@
click=
"queryData"
>
查询
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</el-card>
</el-card>
<el-card
class=
"margin-top-20"
>
<el-card
class=
"margin-top-20"
>
<div
slot=
"header"
>
<div
slot=
"header"
>
<span>
采样信息
</span>
<span>
采样信息
</span>
...
@@ -69,6 +73,7 @@
...
@@ -69,6 +73,7 @@
</descriptions>
</descriptions>
<div
v-else
class=
"el-table__empty-text"
style=
"text-align: center;margin: 0 auto"
>
不支持频域分析
</div>
<div
v-else
class=
"el-table__empty-text"
style=
"text-align: center;margin: 0 auto"
>
不支持频域分析
</div>
</el-card>
</el-card>
<el-row
:gutter=
"20"
>
<el-row
:gutter=
"20"
>
<el-col
:span=
"16"
>
<el-col
:span=
"16"
>
<el-card
class=
"margin-top-20"
>
<el-card
class=
"margin-top-20"
>
...
@@ -86,12 +91,15 @@
...
@@ -86,12 +91,15 @@
<time-domain-line
<time-domain-line
v-if=
"isSupported"
v-if=
"isSupported"
:id=
"'line-' + property.propertyCode"
:id=
"'line-' + property.propertyCode"
ref=
"timeDomainLine"
:title=
"property.propertyName"
:title=
"property.propertyName"
:step=
"property.propertyType === 4"
:step=
"property.propertyType === 4"
:line-data=
"property.data"
:line-data=
"property.data"
:description=
"property.propertyUnit"
:description=
"property.propertyUnit"
:config=
"lineConfig"
:config=
"lineConfig"
:function-list=
"functionList"
format=
"MM-DD HH:mm:ss"
format=
"MM-DD HH:mm:ss"
@
datazoom=
"onDataZoom"
/>
/>
<div
v-else
class=
"el-table__empty-text"
style=
"text-align: center;margin: 0 auto"
>
不支持频域分析
</div>
<div
v-else
class=
"el-table__empty-text"
style=
"text-align: center;margin: 0 auto"
>
不支持频域分析
</div>
</el-card>
</el-card>
...
@@ -111,20 +119,50 @@
...
@@ -111,20 +119,50 @@
</el-card>
</el-card>
</el-col>
</el-col>
</el-row>
</el-row>
<el-row
:gutter=
"20"
>
<el-col
<el-card
class=
"margin-top-20"
>
v-for=
"(chart, index) in functionList"
<div
slot=
"header"
class=
"clearfix"
>
:key=
"index"
<span>
分量
</span>
:span=
"8"
</div>
>
<el-tabs
v-if=
"isSupported"
v-model=
"activeFunction"
>
<el-card
class=
"margin-top-20"
>
<el-tab-pane
v-for=
"(func, index) in functionList"
:key=
"index"
:label=
"func.name"
:name=
"func.id"
/>
</el-tabs>
<el-row
v-if=
"isSupported"
:gutter=
"20"
>
<el-col
:span=
"16"
>
<function-line
<function-line
:id=
"'function-line-' + index"
id=
"function-line"
:line-data=
"chart.data"
ref=
"functionLine"
:line-data=
"functionChartData"
:config=
"lineConfig"
@
datazoom=
"onDataZoom"
/>
/>
</el-card>
</el-col>
</el-col>
<el-col
:span=
"8"
>
</el-row>
<descriptions
title=
"Detail"
label-position=
"top"
label-width=
"80px"
style=
"margin-left: 30px"
>
<descriptions-item
:span=
"24"
label=
"振幅"
value=
""
>
<div>
{{
functionChartDetail
.
amplitude
}}
</div>
</descriptions-item>
<descriptions-item
:span=
"24"
label=
"频率"
value=
""
>
<div>
{{
functionChartDetail
.
frequency
}}
Hz
</div>
</descriptions-item>
<descriptions-item
:span=
"24"
label=
"相位"
value=
""
>
<div>
{{
functionChartDetail
.
phase
}}
</div>
</descriptions-item>
</descriptions>
</el-col>
</el-row>
<div
v-else
class=
"el-table__empty-text"
style=
"text-align: center;margin: 0 auto"
>
不支持频域分析
</div>
</el-card>
</div>
</div>
</
template
>
</
template
>
...
@@ -136,7 +174,7 @@ import FunctionLine from '@/components/Charts/FunctionLine'
...
@@ -136,7 +174,7 @@ import FunctionLine from '@/components/Charts/FunctionLine'
import
TimeDomainLine
from
'
@/components/Charts/TimeDomainLine
'
import
TimeDomainLine
from
'
@/components/Charts/TimeDomainLine
'
import
FftLine
from
'
@/components/Charts/FFtLine
'
import
FftLine
from
'
@/components/Charts/FFtLine
'
import
moment
from
'
moment
'
import
moment
from
'
moment
'
import
{
getTimeDomainData
}
from
'
@/api/device-management/frequency-analysis
'
import
{
getTimeDomainData
,
getFrequencyDomainData
,
getDataPreview
}
from
'
@/api/device-management/frequency-analysis
'
import
{
getPropertyDetail
}
from
'
@/api/equipment-management/device-instance
'
import
{
getPropertyDetail
}
from
'
@/api/equipment-management/device-instance
'
export
default
{
export
default
{
...
@@ -152,7 +190,7 @@ export default {
...
@@ -152,7 +190,7 @@ export default {
deviceType
:
null
,
deviceType
:
null
,
deviceInstance
:
null
,
deviceInstance
:
null
,
dataMode
:
null
,
dataMode
:
null
,
startAndEndTime
:
[]
time
:
null
},
},
activeProperty
:
null
,
activeProperty
:
null
,
tableData
:
[],
tableData
:
[],
...
@@ -232,8 +270,8 @@ export default {
...
@@ -232,8 +270,8 @@ export default {
dataMode
:
[
dataMode
:
[
{
required
:
true
,
message
:
''
,
trigger
:
'
blur
'
}
{
required
:
true
,
message
:
''
,
trigger
:
'
blur
'
}
],
],
startAndEndT
ime
:
[
t
ime
:
[
{
type
:
'
array
'
,
required
:
true
,
message
:
''
,
trigger
:
'
blur
'
}
{
required
:
true
,
message
:
''
,
trigger
:
'
blur
'
}
]
]
},
},
functionList
:
[],
functionList
:
[],
...
@@ -248,7 +286,16 @@ export default {
...
@@ -248,7 +286,16 @@ export default {
count
:
null
,
count
:
null
,
samplingPeriod
:
null
samplingPeriod
:
null
},
},
isSupported
:
false
isSupported
:
false
,
activeFunction
:
null
,
functionChartData
:
[],
functionChartDetail
:
{
amplitude
:
null
,
frequency
:
null
,
phase
:
null
,
cycle
:
null
},
samplingList
:
[]
}
}
},
},
watch
:
{
watch
:
{
...
@@ -270,6 +317,12 @@ export default {
...
@@ -270,6 +317,12 @@ export default {
}
}
}
}
},
},
activeFunction
:
{
immediate
:
true
,
handler
:
function
(
val
)
{
this
.
functionChartData
=
this
.
getFuncChartData
(
val
)
}
},
form
:
{
form
:
{
deep
:
true
,
deep
:
true
,
handler
:
function
()
{
handler
:
function
()
{
...
@@ -279,10 +332,6 @@ export default {
...
@@ -279,10 +332,6 @@ export default {
},
},
created
()
{
created
()
{
const
{
deviceTypeId
,
deviceInstanceId
}
=
this
.
$route
.
query
const
{
deviceTypeId
,
deviceInstanceId
}
=
this
.
$route
.
query
const
now
=
new
Date
().
getTime
()
const
beginTime
=
new
Date
(
now
-
1000
*
3600
*
24
*
7
)
const
endTime
=
new
Date
(
now
)
this
.
form
.
startAndEndTime
=
[
beginTime
,
endTime
]
this
.
init
(
deviceTypeId
,
deviceInstanceId
)
this
.
init
(
deviceTypeId
,
deviceInstanceId
)
},
},
methods
:
{
methods
:
{
...
@@ -305,11 +354,12 @@ export default {
...
@@ -305,11 +354,12 @@ export default {
this
.
propertyList
.
push
(
v
)
this
.
propertyList
.
push
(
v
)
}
}
})
})
this
.
samplingList
=
await
getDataPreview
({
modelId
:
this
.
form
.
dataMode
,
deviceId
:
this
.
form
.
deviceInstance
})
this
.
form
.
time
=
this
.
samplingList
.
length
?
this
.
samplingList
[
0
].
time
:
null
this
.
activeProperty
=
this
.
propertyList
.
length
?
this
.
propertyList
[
0
].
propertyCode
:
null
this
.
activeProperty
=
this
.
propertyList
.
length
?
this
.
propertyList
[
0
].
propertyCode
:
null
// 判断该模型是否支持频域分析,不支持则不获取数据
// 判断该模型是否支持频域分析,不支持则不获取数据
if
(
this
.
isFrequency
(
this
.
dataModelList
[
0
].
propertyList
))
{
if
(
this
.
isFrequency
(
this
.
dataModelList
[
0
].
propertyList
))
{
await
this
.
getFFTData
()
// 查询时域数据
// 查询图表数据
await
this
.
queryData
()
await
this
.
queryData
()
}
}
}
}
...
@@ -352,8 +402,7 @@ export default {
...
@@ -352,8 +402,7 @@ export default {
})
})
.
then
(
_
=>
{
.
then
(
_
=>
{
return
{
return
{
beginTime
:
this
.
form
.
startAndEndTime
[
0
].
getTime
(),
time
:
this
.
form
.
time
,
endTime
:
this
.
form
.
startAndEndTime
[
1
].
getTime
(),
modelId
:
this
.
form
.
dataMode
,
modelId
:
this
.
form
.
dataMode
,
deviceId
:
this
.
form
.
deviceInstance
,
deviceId
:
this
.
form
.
deviceInstance
,
propertyCodeList
:
this
.
propertyList
.
map
(
v
=>
v
.
propertyCode
)
propertyCodeList
:
this
.
propertyList
.
map
(
v
=>
v
.
propertyCode
)
...
@@ -375,8 +424,14 @@ export default {
...
@@ -375,8 +424,14 @@ export default {
xAxis
:
xAxis
,
xAxis
:
xAxis
,
series
:
res
.
data
[
this
.
activeProperty
]
series
:
res
.
data
[
this
.
activeProperty
]
}
}
return
{
time
:
this
.
form
.
time
,
modelId
:
this
.
form
.
dataMode
,
deviceId
:
this
.
form
.
deviceInstance
,
propertyCode
:
this
.
activeProperty
}
})
})
.
then
(
_
=>
this
.
getFFTData
(
))
.
then
(
params
=>
this
.
getFFTData
(
params
))
.
catch
(
_
=>
{})
.
catch
(
_
=>
{})
},
},
onDeviceTypeChange
(
val
)
{
onDeviceTypeChange
(
val
)
{
...
@@ -410,194 +465,94 @@ export default {
...
@@ -410,194 +465,94 @@ export default {
})
})
.
catch
(
_
=>
{})
.
catch
(
_
=>
{})
},
},
getDataPreview
(
modelId
,
deviceId
)
{
getDataPreview
({
modelId
,
deviceId
})
.
then
(
res
=>
{
this
.
samplingList
=
res
.
data
this
.
form
.
time
=
this
.
samplingList
.
length
?
this
.
samplingList
[
0
].
time
:
null
})
},
getDataModelByDeviceTypeId
(
id
)
{
getDataModelByDeviceTypeId
(
id
)
{
getDataModelByDeviceTypeId
({
id
})
getDataModelByDeviceTypeId
({
id
})
.
then
(
res
=>
{
.
then
(
res
=>
{
this
.
dataModelList
=
res
.
data
this
.
dataModelList
=
res
.
data
if
(
this
.
dataModelList
.
length
)
{
if
(
this
.
dataModelList
.
length
)
{
this
.
form
.
dataMode
=
this
.
dataModelList
[
0
].
id
this
.
form
.
dataMode
=
this
.
dataModelList
[
0
].
id
this
.
getDataPreview
(
this
.
form
.
dataMode
,
this
.
form
.
deviceInstance
)
}
}
})
})
.
catch
(
_
=>
{})
.
catch
(
_
=>
{})
},
},
getFunctionChartList
()
{
getFrequencyDomainData
()
{},
this
.
functionList
.
push
({
generateData
(
amplitude
,
frequency
,
phase
)
{
name
:
'
func1
'
,
const
length
=
frequency
.
toString
().
split
(
'
.
'
)[
0
].
length
data
:
this
.
generateData
()
let
step
=
'
1
'
})
for
(
let
i
=
0
;
i
<
length
;
i
++
)
{
},
step
+=
'
0
'
generateData
()
{
}
step
=
0.1
/
parseInt
(
step
)
const
data
=
[]
const
data
=
[]
f
or
(
let
i
=
0
;
i
<
50
;
i
+=
0.1
)
{
f
unction
strip
(
num
,
precision
=
12
)
{
data
.
push
([
i
,
this
.
func
(
i
)]
)
return
+
parseFloat
(
num
.
toPrecision
(
precision
)
)
}
}
for
(
let
i
=
0
;
i
<
1
;
i
+=
step
)
{
data
.
push
([
strip
(
i
),
this
.
func
(
strip
(
i
),
amplitude
,
frequency
,
phase
)])
}
console
.
log
(
amplitude
,
frequency
,
phase
)
return
data
return
data
},
},
getFFTData
()
{
func
(
x
,
amplitude
=
1
,
frequency
=
1
,
phase
=
0
)
{
const
xAxis
=
[
return
amplitude
*
Math
.
cos
(
2
*
Math
.
PI
*
frequency
*
x
+
phase
*
Math
.
PI
)
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
},
18
,
19
,
20
,
21
,
22
,
23
,
24
,
25
,
26
,
27
,
28
,
29
,
30
,
31
,
32
,
33
,
34
,
35
,
getFuncChartData
(
activeFunction
)
{
36
,
37
,
38
,
39
,
40
,
41
,
42
,
43
,
44
,
45
,
46
,
47
,
48
,
49
,
50
,
51
,
52
,
53
,
const
func
=
this
.
functionList
.
find
(
v
=>
v
.
id
===
activeFunction
)
54
,
55
,
56
,
57
,
58
,
59
,
60
,
61
,
62
,
63
,
64
,
65
,
66
,
67
,
68
,
69
,
70
,
71
,
if
(
func
)
{
72
,
73
,
74
,
75
,
76
,
77
,
78
,
79
,
80
,
81
,
82
,
83
,
84
,
85
,
86
,
87
,
88
,
89
,
const
{
amplitude
,
frequency
,
phase
}
=
func
.
func
90
,
91
,
92
,
93
,
94
,
95
,
96
,
97
,
98
,
99
,
100
,
101
,
102
,
103
,
104
,
105
,
106
,
107
,
this
.
functionChartDetail
=
{
108
,
109
,
110
,
111
,
112
,
113
,
114
,
115
,
116
,
117
,
118
,
119
,
120
,
121
,
122
,
123
,
124
,
125
,
amplitude
,
126
,
127
,
128
,
129
,
130
,
131
,
132
,
133
,
134
,
135
,
136
,
137
,
138
,
139
,
140
,
141
,
142
,
143
,
frequency
,
144
,
145
,
146
,
147
,
148
,
149
,
150
,
151
,
152
,
153
,
154
,
155
,
156
,
157
,
158
,
159
,
160
,
161
,
phase
162
,
163
,
164
,
165
,
166
,
167
,
168
,
169
,
170
,
171
,
172
,
173
,
174
,
175
,
176
,
177
,
178
,
179
,
}
180
,
181
,
182
,
183
,
184
,
185
,
186
,
187
,
188
,
189
,
190
,
191
,
192
,
193
,
194
,
195
,
196
,
197
,
return
this
.
generateData
(
amplitude
,
frequency
,
phase
)
198
,
199
,
200
,
201
,
202
,
203
,
204
,
205
,
206
,
207
,
208
,
209
,
210
,
211
,
212
,
213
,
214
,
215
,
}
else
{
216
,
217
,
218
,
219
,
220
,
221
,
222
,
223
,
224
,
225
,
226
,
227
,
228
,
229
,
230
,
231
,
232
,
233
,
return
[]
234
,
235
,
236
,
237
,
238
,
239
,
240
,
241
,
242
,
243
,
244
,
245
,
246
,
247
,
248
,
249
,
250
,
251
,
}
252
,
253
,
254
,
255
,
256
,
257
,
258
,
259
,
260
,
261
,
262
,
263
,
264
,
265
,
266
,
267
,
268
,
269
,
},
270
,
271
,
272
,
273
,
274
,
275
,
276
,
277
,
278
,
279
,
280
,
281
,
282
,
283
,
284
,
285
,
286
,
287
,
getFFTData
(
params
)
{
288
,
289
,
290
,
291
,
292
,
293
,
294
,
295
,
296
,
297
,
298
,
299
,
300
,
301
,
302
,
303
,
304
,
305
,
getFrequencyDomainData
(
params
)
306
,
307
,
308
,
309
,
310
,
311
,
312
,
313
,
314
,
315
,
316
,
317
,
318
,
319
,
320
,
321
,
322
,
323
,
.
then
(
res
=>
{
324
,
325
,
326
,
327
,
328
,
329
,
330
,
331
,
332
,
333
,
334
,
335
,
336
,
337
,
338
,
339
,
340
,
341
,
const
{
chart
,
functionList
}
=
res
.
data
342
,
343
,
344
,
345
,
346
,
347
,
348
,
349
,
350
,
351
,
352
,
353
,
354
,
355
,
356
,
357
,
358
,
359
,
const
xAxis
=
chart
.
xdata
360
,
361
,
362
,
363
,
364
,
365
,
366
,
367
,
368
,
369
,
370
,
371
,
372
,
373
,
374
,
375
,
376
,
377
,
const
series
=
chart
.
ydata
378
,
379
,
380
,
381
,
382
,
383
,
384
,
385
,
386
,
387
,
388
,
389
,
390
,
391
,
392
,
393
,
394
,
395
,
this
.
fft
.
data
=
{
xAxis
,
series
}
396
,
397
,
398
,
399
,
400
,
401
,
402
,
403
,
404
,
405
,
406
,
407
,
408
,
409
,
410
,
411
,
412
,
413
,
this
.
functionList
=
functionList
.
map
((
v
,
i
)
=>
{
414
,
415
,
416
,
417
,
418
,
419
,
420
,
421
,
422
,
423
,
424
,
425
,
426
,
427
,
428
,
429
,
430
,
431
,
const
{
amplitude
,
frequency
,
phase
}
=
v
432
,
433
,
434
,
435
,
436
,
437
,
438
,
439
,
440
,
441
,
442
,
443
,
444
,
445
,
446
,
447
,
448
,
449
,
const
phaseNumber
=
(
parseFloat
(
phase
)
/
Math
.
PI
).
toFixed
(
2
)
450
,
451
,
452
,
453
,
454
,
455
,
456
,
457
,
458
,
459
,
460
,
461
,
462
,
463
,
464
,
465
,
466
,
467
,
const
name
=
frequency
===
'
0.00
'
?
'
直流信号
'
:
`
${
amplitude
}
*sin(2*Pi*
${
frequency
}
+
${
phaseNumber
}
*Pi)`
468
,
469
,
470
,
471
,
472
,
473
,
474
,
475
,
476
,
477
,
478
,
479
,
480
,
481
,
482
,
483
,
484
,
485
,
return
{
486
,
487
,
488
,
489
,
490
,
491
,
492
,
493
,
494
,
495
,
496
,
497
,
498
,
499
,
500
,
501
,
502
,
503
,
id
:
i
.
toString
(),
504
,
505
,
506
,
507
,
508
,
509
,
510
,
511
,
512
,
513
,
514
,
515
,
516
,
517
,
518
,
519
,
520
,
521
,
name
:
name
,
522
,
523
,
524
,
525
,
526
,
527
,
528
,
529
,
530
,
531
,
532
,
533
,
534
,
535
,
536
,
537
,
538
,
539
,
func
:
{
540
,
541
,
542
,
543
,
544
,
545
,
546
,
547
,
548
,
549
,
550
,
551
,
552
,
553
,
554
,
555
,
556
,
557
,
amplitude
:
parseFloat
(
amplitude
),
558
,
559
,
560
,
561
,
562
,
563
,
564
,
565
,
566
,
567
,
568
,
569
,
570
,
571
,
572
,
573
,
574
,
575
,
frequency
:
parseFloat
(
frequency
),
576
,
577
,
578
,
579
,
580
,
581
,
582
,
583
,
584
,
585
,
586
,
587
,
588
,
589
,
590
,
591
,
592
,
593
,
phase
:
parseFloat
(
phaseNumber
)
594
,
595
,
596
,
597
,
598
,
599
,
600
,
601
,
602
,
603
,
604
,
605
,
606
,
607
,
608
,
609
,
610
,
611
,
},
612
,
613
,
614
,
615
,
616
,
617
,
618
,
619
,
620
,
621
,
622
,
623
,
624
,
625
,
626
,
627
,
628
,
629
,
data
:
[]
630
,
631
,
632
,
633
,
634
,
635
,
636
,
637
,
638
,
639
,
640
,
641
,
642
,
643
,
644
,
645
,
646
,
647
,
}
648
,
649
,
650
,
651
,
652
,
653
,
654
,
655
,
656
,
657
,
658
,
659
,
660
,
661
,
662
,
663
,
664
,
665
,
})
666
,
667
,
668
,
669
,
670
,
671
,
672
,
673
,
674
,
675
,
676
,
677
,
678
,
679
,
680
,
681
,
682
,
683
,
this
.
activeFunction
=
this
.
functionList
.
length
?
this
.
functionList
[
0
].
id
:
null
684
,
685
,
686
,
687
,
688
,
689
,
690
,
691
,
692
,
693
,
694
,
695
,
696
,
697
,
698
,
699
this
.
functionChartData
=
this
.
getFuncChartData
(
this
.
activeFunction
)
]
})
const
series
=
[
0
,
0.00003183
,
0.00006367
,
0.00009551
,
0.00012737
,
0.00015925
,
0.00019116
,
0.0002231
,
0.00025508
,
0.0002871
,
0.00031916
,
0.00035128
,
0.00038346
,
0.0004157
,
0.00044801
,
0.00048039
,
0.00051285
,
0.0005454
,
0.00057804
,
0.00061078
,
0.00064362
,
0.00067657
,
0.00070963
,
0.00074281
,
0.00077612
,
0.00080956
,
0.00084314
,
0.00087687
,
0.00091075
,
0.00094478
,
0.00097898
,
0.00101335
,
0.0010479
,
0.00108263
,
0.00111756
,
0.00115269
,
0.00118802
,
0.00122356
,
0.00125933
,
0.00129533
,
0.00133156
,
0.00136804
,
0.00140478
,
0.00144177
,
0.00147904
,
0.00151658
,
0.00155442
,
0.00159255
,
0.00163099
,
0.00166975
,
0.00170883
,
0.00174825
,
0.00178802
,
0.00182815
,
0.00186865
,
0.00190953
,
0.0019508
,
0.00199247
,
0.00203457
,
0.00207709
,
0.00212005
,
0.00216348
,
0.00220737
,
0.00225175
,
0.00229662
,
0.00234202
,
0.00238794
,
0.0024344
,
0.00248144
,
0.00252905
,
0.00257726
,
0.00262609
,
0.00267555
,
0.00272567
,
0.00277647
,
0.00282796
,
0.00288018
,
0.00293314
,
0.00298686
,
0.00304138
,
0.00309671
,
0.00315288
,
0.00320993
,
0.00326788
,
0.00332675
,
0.00338659
,
0.00344742
,
0.00350927
,
0.00357219
,
0.0036362
,
0.00370135
,
0.00376768
,
0.00383522
,
0.00390402
,
0.00397414
,
0.0040456
,
0.00411847
,
0.00419279
,
0.00426863
,
0.00434603
,
0.00442506
,
0.00450578
,
0.00458826
,
0.00467256
,
0.00475877
,
0.00484695
,
0.00493719
,
0.00502957
,
0.00512419
,
0.00522113
,
0.00532051
,
0.00542242
,
0.00552698
,
0.00563431
,
0.00574454
,
0.00585779
,
0.00597422
,
0.00609397
,
0.00621721
,
0.0063441
,
0.00647483
,
0.0066096
,
0.00674861
,
0.00689209
,
0.00704028
,
0.00719343
,
0.00735182
,
0.00751574
,
0.00768552
,
0.0078615
,
0.00804405
,
0.00823357
,
0.00843049
,
0.00863529
,
0.00884848
,
0.00907062
,
0.00930231
,
0.00954422
,
0.00979708
,
0.01006168
,
0.01033891
,
0.01062972
,
0.0109352
,
0.01125651
,
0.01159498
,
0.01195207
,
0.01232942
,
0.01272886
,
0.01315244
,
0.01360251
,
0.01408168
,
0.01459296
,
0.01513977
,
0.01572603
,
0.01635628
,
0.01703575
,
0.01777058
,
0.01856793
,
0.01943628
,
0.0203857
,
0.02142828
,
0.02257861
,
0.02385453
,
0.02527802
,
0.02687653
,
0.02868475
,
0.03074721
,
0.03312199
,
0.03588633
,
0.03914525
,
0.0430452
,
0.04779685
,
0.05371452
,
0.06128887
,
0.07133084
,
0.08528383
,
0.10598965
,
0.13992337
,
0.20572746
,
0.38811359
,
3.40538473
,
0.50292848
,
0.23419892
,
0.15264074
,
0.11320989
,
0.08996233
,
0.07462905
,
0.06375467
,
0.05563975
,
0.0493511
,
0.04433368
,
0.04023666
,
0.03682742
,
0.03394565
,
0.03147724
,
0.02933879
,
0.02746791
,
0.025817
,
0.02434913
,
0.02303518
,
0.0218519
,
0.02078049
,
0.01980559
,
0.01891453
,
0.01809676
,
0.01734341
,
0.01664702
,
0.0160012
,
0.0154005
,
0.01484022
,
0.01431628
,
0.01382514
,
0.0133637
,
0.01292924
,
0.01251935
,
0.0121319
,
0.01176502
,
0.011417
,
0.01108635
,
0.01077171
,
0.01047186
,
0.01018571
,
0.00991226
,
0.0096506
,
0.00939993
,
0.00915949
,
0.0089286
,
0.00870664
,
0.00849303
,
0.00828725
,
0.00808881
,
0.00789727
,
0.00771222
,
0.00753327
,
0.00736007
,
0.0071923
,
0.00702964
,
0.00687182
,
0.00671856
,
0.00656963
,
0.00642479
,
0.00628383
,
0.00614654
,
0.00601273
,
0.00588223
,
0.00575487
,
0.00563048
,
0.00550892
,
0.00539006
,
0.00527375
,
0.00515987
,
0.0050483
,
0.00493893
,
0.00483165
,
0.00472636
,
0.00462296
,
0.00452136
,
0.00442148
,
0.00432322
,
0.0042265
,
0.00413126
,
0.00403742
,
0.0039449
,
0.00385364
,
0.00376357
,
0.00367464
,
0.00358677
,
0.00349991
,
0.00341401
,
0.00332901
,
0.00324486
,
0.00316151
,
0.0030789
,
0.00299698
,
0.00291572
,
0.00283507
,
0.00275497
,
0.00267539
,
0.00259628
,
0.0025176
,
0.00243931
,
0.00236137
,
0.00228374
,
0.00220637
,
0.00212923
,
0.00205228
,
0.00197547
,
0.00189878
,
0.00182216
,
0.00174557
,
0.00166897
,
0.00159233
,
0.00151561
,
0.00143876
,
0.00136175
,
0.00128454
,
0.00120709
,
0.00112935
,
0.00105129
,
0.00097286
,
0.00089402
,
0.00081473
,
0.00073494
,
0.0006546
,
0.00057368
,
0.00049212
,
0.00040986
,
0.00032687
,
0.00024309
,
0.00015846
,
0.00007292
,
0.00001357
,
0.00010109
,
0.00018969
,
0.00027944
,
0.0003704
,
0.00046266
,
0.00055628
,
0.00065134
,
0.00074792
,
0.0008461
,
0.00094599
,
0.00104766
,
0.00115123
,
0.00125679
,
0.00136445
,
0.00147434
,
0.00158657
,
0.00170128
,
0.0018186
,
0.00193868
,
0.00206168
,
0.00218776
,
0.00231711
,
0.00244991
,
0.00258637
,
0.0027267
,
0.00287114
,
0.00301993
,
0.00317336
,
0.00333171
,
0.00349529
,
0.00366444
,
0.00383954
,
0.00402098
,
0.00420919
,
0.00440466
,
0.00460788
,
0.00481944
,
0.00503994
,
0.00527007
,
0.00551057
,
0.00576227
,
0.00602609
,
0.00630303
,
0.00659423
,
0.00690095
,
0.00722459
,
0.00756675
,
0.0079292
,
0.00831397
,
0.00872337
,
0.00916
,
0.00962688
,
0.01012748
,
0.0106658
,
0.01124651
,
0.01187509
,
0.012558
,
0.01330289
,
0.01411896
,
0.01501729
,
0.01601138
,
0.01711787
,
0.01835748
,
0.01975636
,
0.02134798
,
0.02317588
,
0.02529781
,
0.02779198
,
0.03076703
,
0.03437844
,
0.03885682
,
0.04455949
,
0.05207142
,
0.06242082
,
0.07759716
,
0.10201693
,
0.14784909
,
0.2653271
,
1.22547021
,
0.47684077
,
0.2011075
,
0.12801071
,
0.09418782
,
0.07468309
,
0.06198855
,
0.05306449
,
0.04644588
,
0.04133966
,
0.03727907
,
0.0339715
,
0.03122419
,
0.028905
,
0.0269203
,
0.02520191
,
0.02369897
,
0.02237282
,
0.02119351
,
0.02013748
,
0.01918596
,
0.0183238
,
0.01753864
,
0.01682028
,
0.01616026
,
0.01555148
,
0.01498795
,
0.01446455
,
0.01397693
,
0.01352133
,
0.0130945
,
0.0126936
,
0.01231617
,
0.01196003
,
0.01162326
,
0.01130418
,
0.01100127
,
0.01071319
,
0.01043875
,
0.01017685
,
0.00992654
,
0.00968694
,
0.00945726
,
0.00923677
,
0.00902483
,
0.00882084
,
0.00862425
,
0.00843456
,
0.00825133
,
0.00807412
,
0.00790256
,
0.00773627
,
0.00757494
,
0.00741826
,
0.00726593
,
0.00711771
,
0.00697333
,
0.00683258
,
0.00669524
,
0.0065611
,
0.00642998
,
0.0063017
,
0.0061761
,
0.00605302
,
0.00593232
,
0.00581384
,
0.00569748
,
0.00558309
,
0.00547056
,
0.00535978
,
0.00525064
,
0.00514304
,
0.00503689
,
0.00493208
,
0.00482854
,
0.00472617
,
0.0046249
,
0.00452465
,
0.00442534
,
0.0043269
,
0.00422925
,
0.00413234
,
0.00403608
,
0.00394043
,
0.00384531
,
0.00375067
,
0.00365645
,
0.00356258
,
0.00346901
,
0.00337568
,
0.00328255
,
0.00318955
,
0.00309662
,
0.00300373
,
0.00291081
,
0.00281781
,
0.00272469
,
0.00263137
,
0.00253783
,
0.002444
,
0.00234983
,
0.00225527
,
0.00216027
,
0.00206477
,
0.00196872
,
0.00187207
,
0.00177476
,
0.00167673
,
0.00157794
,
0.00147831
,
0.0013778
,
0.00127634
,
0.00117388
,
0.00107034
,
0.00096567
,
0.00085979
,
0.00075265
,
0.00064417
,
0.00053428
,
0.00042291
,
0.00030997
,
0.0001954
,
0.0000791
,
0.000039
,
0.000159
,
0.00028099
,
0.00040505
,
0.0005313
,
0.00065983
,
0.00079076
,
0.00092419
,
0.00106024
,
0.00119903
,
0.0013407
,
0.00148538
,
0.00163321
,
0.00178434
,
0.00193892
,
0.00209712
,
0.00225911
,
0.00242508
,
0.00259521
,
0.00276972
,
0.00294881
,
0.00313271
,
0.00332166
,
0.00351593
,
0.00371577
,
0.00392148
,
0.00413337
,
0.00435175
,
0.00457699
,
0.00480945
,
0.00504952
,
0.00529764
,
0.00555425
,
0.00581985
,
0.00609496
,
0.00638015
,
0.00667602
,
0.00698322
,
0.00730248
,
0.00763455
,
0.00798026
,
0.00834053
,
0.00871632
,
0.00910871
,
0.00951888
,
0.00994809
,
0.01039775
,
0.0108694
,
0.01136473
,
0.01188562
,
0.01243414
,
0.01301259
,
0.01362352
,
0.01426981
,
0.01495463
,
0.01568159
,
0.01645473
,
0.01727863
,
0.01815851
,
0.01910029
,
0.02011077
,
0.02119779
,
0.02237041
,
0.02363917
,
0.02501642
,
0.02651671
,
0.02815731
,
0.02995885
,
0.03194624
,
0.03414976
,
0.03660668
,
0.03936331
,
0.04247798
,
0.0460252
,
0.05010165
,
0.05483515
,
0.06039823
,
0.06702964
,
0.07506935
,
0.08501871
,
0.09764903
,
0.11421147
,
0.13687909
,
0.16978758
,
0.22189715
,
0.31692414
,
0.54497643
,
1.83656816
,
1.39487923
,
0.5127898
,
0.316862
,
0.23067088
,
0.18219712
,
0.15113042
,
0.12952387
,
0.11362907
,
0.10144695
,
0.0918139
,
0.08400662
,
0.07755183
,
0.07212685
,
0.06750411
,
0.06351851
,
0.06004736
,
0.0569976
,
0.05429734
,
0.05189019
,
0.04973126
,
0.04778443
,
0.04602023
,
0.04441446
,
0.042947
,
0.04160101
,
0.04036228
,
0.03921877
,
0.03816014
,
0.03717755
,
0.0362633
,
0.03541075
,
0.03461408
,
0.03386818
,
0.03316855
,
0.03251123
,
0.03189268
,
0.03130977
,
0.0307597
,
0.03023995
,
0.02974826
,
0.02928259
,
0.02884112
,
0.02842218
,
0.02802424
,
0.02764596
,
0.02728605
,
0.0269434
,
0.02661694
,
0.02630571
,
0.02600885
,
0.02572553
,
0.025455
,
0.02519658
,
0.02494964
,
0.02471358
,
0.02448785
,
0.02427196
,
0.02406542
,
0.02386781
,
0.02367872
,
0.02349777
,
0.02332461
,
0.0231589
,
0.02300035
,
0.02284866
,
0.02270357
,
0.02256483
,
0.02243219
,
0.02230545
,
0.0221844
,
0.02206884
,
0.0219586
,
0.0218535
,
0.02175339
,
0.02165812
,
0.02156755
,
0.02148155
,
0.0214
,
0.02132279
,
0.02124981
,
0.02118097
,
0.02111616
,
0.0210553
,
0.02099832
,
0.02094515
,
0.0208957
,
0.02084992
,
0.02080776
,
0.02076916
,
0.02073407
,
0.02070245
,
0.02067425
,
0.02064946
,
0.02062803
,
0.02060994
,
0.02059517
,
0.0205837
,
0.02057552
,
0.02057061
]
this
.
fft
.
data
=
{
xAxis
,
series
}
},
},
func
(
x
)
{
onDataZoom
(
params
)
{
return
Math
.
sin
(
x
)
const
{
start
,
end
}
=
params
.
val
const
action
=
{
type
:
'
dataZoom
'
,
start
,
end
}
const
ref
=
params
.
type
===
'
timeDomainLine
'
?
'
functionLine
'
:
'
timeDomainLine
'
this
.
$refs
[
ref
].
dispatch
(
action
)
}
}
}
}
}
}
...
...
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