Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sample-form-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
sample-form-platform
Commits
76a00edf
Commit
76a00edf
authored
Aug 12, 2024
by
“yiyousong”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 优化设备列表搜索
parent
5506d7b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
15 deletions
+20
-15
sample-form-manager-ui/admin/src/pages/hardware/NumberWriteDevice.vue
...manager-ui/admin/src/pages/hardware/NumberWriteDevice.vue
+20
-15
No files found.
sample-form-manager-ui/admin/src/pages/hardware/NumberWriteDevice.vue
View file @
76a00edf
...
@@ -25,10 +25,13 @@
...
@@ -25,10 +25,13 @@
v-model=
"type"
v-model=
"type"
placeholder=
"请选择搜索类型"
placeholder=
"请选择搜索类型"
>
>
<el-option
label=
"按设备名称"
:value=
"1"
>
</el-option>
<el-option
<el-option
label=
"按mac地址"
:value=
"2"
>
</el-option>
v-for=
"(v, key) in typeList"
<el-option
label=
"按设备IP"
:value=
"3"
>
</el-option>
:key=
"key"
<el-option
label=
"按所属机构"
:value=
"4"
>
</el-option>
:label=
"v"
:value=
"key"
>
</el-option>
</el-select>
</el-select>
<el-input
<el-input
size=
"small"
size=
"small"
...
@@ -71,6 +74,8 @@
...
@@ -71,6 +74,8 @@
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
prop=
"deviceMac"
label=
"mac地址"
>
<el-table-column
align=
"center"
prop=
"deviceMac"
label=
"mac地址"
>
</el-table-column>
</el-table-column>
<el-table-column
align=
"center"
prop=
"ip"
label=
"IP地址"
>
</el-table-column>
<el-table-column
align=
"center"
label=
"设备位置"
>
<el-table-column
align=
"center"
label=
"设备位置"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<span
<span
...
@@ -204,6 +209,12 @@ import {
...
@@ -204,6 +209,12 @@ import {
delDevice
,
delDevice
,
}
from
"
@/api/device
"
;
}
from
"
@/api/device
"
;
import
local
from
"
@/utils/local
"
;
import
local
from
"
@/utils/local
"
;
const
typeList
=
{
deviceName
:
"
按设备名称
"
,
deviceMac
:
"
按mac地址
"
,
ip
:
"
按IP地址
"
,
belong
:
"
按所属机构
"
,
}
;
export
default
{
export
default
{
components
:
{
components
:
{
TableHeader
,
TableHeader
,
...
@@ -214,6 +225,7 @@ export default {
...
@@ -214,6 +225,7 @@ export default {
}
,
}
,
data
()
{
data
()
{
return
{
return
{
typeList
,
searchVal
:
""
,
searchVal
:
""
,
siteId
:
local
.
getLocal
(
"
sampleSiteId
"
)
siteId
:
local
.
getLocal
(
"
sampleSiteId
"
)
?
local
.
getLocal
(
"
sampleSiteId
"
)
?
local
.
getLocal
(
"
sampleSiteId
"
)
...
@@ -227,7 +239,7 @@ export default {
...
@@ -227,7 +239,7 @@ export default {
loading
:
false
,
loading
:
false
,
matterDrawer
:
false
,
matterDrawer
:
false
,
dict
:
{
}
,
// 字典
dict
:
{
}
,
// 字典
type
:
1
,
type
:
"
deviceName
"
,
}
;
}
;
}
,
}
,
created
()
{
created
()
{
...
@@ -242,15 +254,8 @@ export default {
...
@@ -242,15 +254,8 @@ export default {
page
:
this
.
current
,
page
:
this
.
current
,
size
:
this
.
size
,
size
:
this
.
size
,
}
;
}
;
if
(
this
.
type
==
1
)
{
let
value
=
`%${this.searchVal
}
%`
;
obj
.
deviceName
=
`%${this.searchVal
}
%`
;
obj
[
this
.
type
]
=
value
;
}
else
if
(
this
.
type
==
2
)
{
obj
.
deviceMac
=
`%${this.searchVal
}
%`
;
}
else
if
(
this
.
type
==
3
)
{
obj
.
ip
=
`%${this.searchVal
}
%`
;
}
else
if
(
this
.
type
==
4
)
{
obj
.
belong
=
`%${this.searchVal
}
%`
;
}
let
res
=
await
getDeviceList
(
obj
);
let
res
=
await
getDeviceList
(
obj
);
this
.
loading
=
false
;
this
.
loading
=
false
;
...
@@ -278,7 +283,7 @@ export default {
...
@@ -278,7 +283,7 @@ export default {
searchReset
()
{
searchReset
()
{
this
.
searchVal
=
""
;
this
.
searchVal
=
""
;
this
.
current
=
1
;
this
.
current
=
1
;
this
.
type
=
1
;
this
.
type
=
"
deviceName
"
;
this
.
getDeviceList
();
this
.
getDeviceList
();
}
,
}
,
// 翻页
// 翻页
...
...
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