Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
template_pda_Web
Project
Project
Details
Activity
Releases
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
高宇
template_pda_Web
Commits
068dec34
Commit
068dec34
authored
Sep 14, 2024
by
小费同学阿
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uhf功能修复-筛选
parent
334a776d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
39 deletions
+11
-39
uhfIndex.vue
src/views/setup/uhfIndex.vue
+11
-39
No files found.
src/views/setup/uhfIndex.vue
View file @
068dec34
...
@@ -21,9 +21,9 @@
...
@@ -21,9 +21,9 @@
<!--展示页-->
<!--展示页-->
<div
class=
""
style=
"margin-bottom: 10px;font-size: 60px"
>
{{
resultInfo
.
length
}}
条
</div>
<div
class=
""
style=
"margin-bottom: 10px;font-size: 60px"
>
{{
resultInfo
.
length
}}
条
</div>
<el-table
:data=
"tableList"
style=
"width: 100%"
>
<el-table
:data=
"tableList"
style=
"width: 100%"
>
<el-table-column
prop=
"typeId"
label=
"ID"
min-width=
"2
10rpx
"
/>
<el-table-column
prop=
"typeId"
label=
"ID"
min-width=
"2
20
"
/>
<el-table-column
prop=
"rssi"
label=
"RSSI"
min-width=
"60
rpx
"
/>
<el-table-column
prop=
"rssi"
label=
"RSSI"
min-width=
"60"
/>
<el-table-column
label=
"操作"
min-width=
"100
rpx
"
>
<el-table-column
label=
"操作"
min-width=
"100"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<el-button
@
click=
"handleFilter(scope.row)"
>
筛选
</el-button>
<el-button
@
click=
"handleFilter(scope.row)"
>
筛选
</el-button>
</
template
>
</
template
>
...
@@ -103,20 +103,6 @@ export default {
...
@@ -103,20 +103,6 @@ export default {
data
()
{
data
()
{
return
{
return
{
// 假数据
// 假数据
tableList
:
[
{
typeId
:
1
,
rssi
:
-
55
},
{
typeId
:
2
,
rssi
:
-
65
},
{
typeId
:
3
,
rssi
:
-
45
},
{
typeId
:
4
,
rssi
:
-
75
},
{
typeId
:
5
,
rssi
:
-
40
}
],
// 定义音量范围数组
volumeRanges
:
[
[
'0'
,
'-30'
,
5
],
[
'-31'
,
'-50'
,
4
],
[
'-51'
,
'-90'
,
3
],
[
'-91'
,
'-1000'
,
2
]
],
selectValue
:
''
,
selectValue
:
''
,
selectValueList
:
[],
selectValueList
:
[],
dialogVisible
:
false
,
// 控制对话框显示与隐藏
dialogVisible
:
false
,
// 控制对话框显示与隐藏
...
@@ -160,42 +146,28 @@ export default {
...
@@ -160,42 +146,28 @@ export default {
})
})
},
},
methods
:
{
methods
:
{
// 处理筛选并匹配音量值
matchVolumeRange
(
rssi
,
volumeRanges
)
{
for
(
let
i
=
0
;
i
<
volumeRanges
.
length
;
i
++
)
{
const
range
=
volumeRanges
[
i
]
const
start
=
parseInt
(
range
[
0
],
10
)
// 将字符串转换为整数
const
end
=
parseInt
(
range
[
1
],
10
)
// 将字符串转换为整数
const
parsedRssi
=
parseInt
(
rssi
,
10
)
if
(
parsedRssi
<=
start
&&
parsedRssi
>=
end
)
{
return
range
[
2
]
// 返回匹配的音量等级
}
}
return
null
// 如果没有匹配,返回null
},
// 清除筛选值
// 清除筛选值
clearSelect
()
{
clearSelect
()
{
this
.
dialogVisibleSelect
=
false
this
.
dialogVisibleSelect
=
false
this
.
selectValue
=
''
this
.
selectValue
=
''
this
.
selectValueList
=
[]
this
.
selectValueList
=
[]
},
},
// 点击当条筛选值
// 点击当条筛选值
handleFilter
(
row
)
{
handleFilter
(
row
)
{
console
.
log
(
'当前行的
RSSI值:'
,
row
.
rssi
)
console
.
log
(
'当前行的
typeId值:'
,
row
.
typeId
)
// 检查元素是否已经存在于数组中
// 检查元素是否已经存在于数组中
if
(
!
this
.
selectValueList
.
includes
(
row
.
rssi
))
{
if
(
!
this
.
selectValueList
.
includes
(
row
.
typeId
))
{
// 如果不存在,则添加到数组中
// 如果不存在,则添加到数组中
this
.
selectValueList
.
push
(
row
.
rssi
)
this
.
selectValueList
.
push
(
row
.
typeId
)
// 给筛选设置设置默认值,将数组中的元素用逗号拼接
// 给筛选设置设置默认值,将数组中的元素用逗号拼接
this
.
selectValue
=
this
.
selectValueList
.
join
(
','
)
this
.
selectValue
=
this
.
selectValueList
.
join
(
','
)
console
.
log
(
'打印selectValueList值:'
,
this
.
selectValueList
)
console
.
log
(
'打印selectValueList值:'
,
this
.
selectValueList
)
console
.
log
(
'打印selectValue值:'
,
this
.
selectValue
)
console
.
log
(
'打印selectValue值:'
,
this
.
selectValue
)
// 匹配音量值并打印结果
const
matchedVolumes
=
this
.
selectValueList
.
map
(
rssi
=>
this
.
matchVolumeRange
(
rssi
,
this
.
volumeRanges
))
console
.
log
(
'匹配的音量值数组:'
,
matchedVolumes
)
}
else
{
}
else
{
// 如果已存在,可以在这里添加一些逻辑,比如打印一条消息或者什么都不做
// 如果已存在,可以在这里添加一些逻辑,比如打印一条消息或者什么都不做
console
.
log
(
'该
RSSI
值已存在,不再添加。'
)
console
.
log
(
'该
typeId
值已存在,不再添加。'
)
console
.
log
(
'打印selectValueList值:'
,
this
.
selectValueList
)
console
.
log
(
'打印selectValueList值:'
,
this
.
selectValueList
)
console
.
log
(
'打印selectValue值:'
,
this
.
selectValue
)
console
.
log
(
'打印selectValue值:'
,
this
.
selectValue
)
}
}
...
@@ -229,8 +201,10 @@ export default {
...
@@ -229,8 +201,10 @@ export default {
this
.
startState
=
true
this
.
startState
=
true
const
params
=
{
const
params
=
{
flag
:
'startPower'
,
flag
:
'startPower'
,
selectValue
:
this
.
selectValueList
,
tokenMsg
:
getToken
()
tokenMsg
:
getToken
()
}
}
// 补充逻辑:如果设置筛选有值就调筛选逻辑,传id过去,筛选没值就不传id过去
this
.
$WebView
.
startPower
(
params
).
then
(
res
=>
{
this
.
$WebView
.
startPower
(
params
).
then
(
res
=>
{
this
.
imgUrlForm
=
JSON
.
parse
(
res
)
this
.
imgUrlForm
=
JSON
.
parse
(
res
)
})
})
...
@@ -335,7 +309,6 @@ export default {
...
@@ -335,7 +309,6 @@ export default {
console
.
log
(
'调用前'
,
getToken
())
console
.
log
(
'调用前'
,
getToken
())
const
params
=
{
const
params
=
{
flag
:
'addVolume'
,
flag
:
'addVolume'
,
subPath
:
'jbcheck'
,
tokenMsg
:
getToken
()
tokenMsg
:
getToken
()
}
}
this
.
$WebView
.
addVolume
(
params
).
then
(
res
=>
{
this
.
$WebView
.
addVolume
(
params
).
then
(
res
=>
{
...
@@ -349,7 +322,6 @@ export default {
...
@@ -349,7 +322,6 @@ export default {
console
.
log
(
'调用前'
,
getToken
())
console
.
log
(
'调用前'
,
getToken
())
const
params
=
{
const
params
=
{
flag
:
'reduceVolume'
,
flag
:
'reduceVolume'
,
subPath
:
'jbcheck'
,
tokenMsg
:
getToken
()
tokenMsg
:
getToken
()
}
}
this
.
$WebView
.
reduceVolume
(
params
).
then
(
res
=>
{
this
.
$WebView
.
reduceVolume
(
params
).
then
(
res
=>
{
...
...
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