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
3cd987b2
Commit
3cd987b2
authored
Nov 09, 2023
by
“yiyousong”
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 优化设备信息获取
parent
f52e9412
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
17 deletions
+12
-17
sample-form-client-ui/admin/src/App.vue
sample-form-client-ui/admin/src/App.vue
+9
-14
sample-form-client-ui/admin/src/api/index.js
sample-form-client-ui/admin/src/api/index.js
+3
-3
No files found.
sample-form-client-ui/admin/src/App.vue
View file @
3cd987b2
...
@@ -11,7 +11,7 @@ import local from "@/utils/local";
...
@@ -11,7 +11,7 @@ import local from "@/utils/local";
import
NetworkError
from
"
@/components/NetworkError.vue
"
;
import
NetworkError
from
"
@/components/NetworkError.vue
"
;
import
EnabledDev
from
"
@/components/EnabledDev.vue
"
;
import
EnabledDev
from
"
@/components/EnabledDev.vue
"
;
import
mq
from
"
@/mixin/mq
"
;
import
mq
from
"
@/mixin/mq
"
;
import
{
getHomeInfo
,
getSkinList
,
getDevice
List
}
from
"
@/api
"
;
import
{
getHomeInfo
,
getSkinList
,
getDevice
Info
}
from
"
@/api
"
;
import
{
mapMutations
}
from
"
vuex
"
;
import
{
mapMutations
}
from
"
vuex
"
;
export
default
{
export
default
{
mixins
:
[
mq
],
mixins
:
[
mq
],
...
@@ -30,7 +30,7 @@ export default {
...
@@ -30,7 +30,7 @@ export default {
},
},
watch
:
{
watch
:
{
"
$route.path
"
(
newVal
)
{
"
$route.path
"
(
newVal
)
{
this
.
getDevice
List
();
this
.
getDevice
Info
();
if
(
newVal
==
"
/
"
||
newVal
==
"
/home
"
)
{
if
(
newVal
==
"
/
"
||
newVal
==
"
/home
"
)
{
this
.
getHomeInfo
();
this
.
getHomeInfo
();
this
.
getSetinfo
();
this
.
getSetinfo
();
...
@@ -66,8 +66,8 @@ export default {
...
@@ -66,8 +66,8 @@ export default {
homeUrl
:
"
http://192.168.0.24:8080/#/
"
,
homeUrl
:
"
http://192.168.0.24:8080/#/
"
,
serverUrl
:
"
http://192.168.0.98:11078/
"
,
serverUrl
:
"
http://192.168.0.98:11078/
"
,
},
},
devicenum
:
"
18-93-7F-C0-AD-B5
"
,
//
devicenum: "18-93-7F-C0-AD-B5",
//
devicenum: "B8-13-32-86-9F-04",
devicenum
:
"
B8-13-32-86-9F-04
"
,
};
};
local
.
setLocal
(
"
devicenum
"
,
obj
.
devicenum
);
local
.
setLocal
(
"
devicenum
"
,
obj
.
devicenum
);
local
.
setLocal
(
"
deviceInfo
"
,
obj
.
deviceInfo
);
local
.
setLocal
(
"
deviceInfo
"
,
obj
.
deviceInfo
);
...
@@ -165,22 +165,17 @@ export default {
...
@@ -165,22 +165,17 @@ export default {
}
}
}
}
},
},
async
getDeviceList
()
{
async
getDeviceInfo
()
{
let
res
=
await
getDeviceList
({
let
res
=
await
getDeviceInfo
();
page
:
1
,
size
:
-
1
,
});
if
(
res
.
data
.
code
==
1
)
{
if
(
res
.
data
.
code
==
1
)
{
let
{
data
}
=
res
.
data
.
data
;
let
{
data
}
=
res
.
data
;
if
(
!
data
.
length
)
return
;
this
.
enabled
=
data
.
enabled
;
let
{
enabled
}
=
data
[
0
];
this
.
enabled
=
enabled
;
}
}
},
},
// 轮询设备状态
// 轮询设备状态
getDevInfo
()
{
getDevInfo
()
{
this
.
timer
=
setInterval
(()
=>
{
this
.
timer
=
setInterval
(()
=>
{
this
.
getDevice
List
();
this
.
getDevice
Info
();
},
1000
*
60
);
},
1000
*
60
);
},
},
},
},
...
...
sample-form-client-ui/admin/src/api/index.js
View file @
3cd987b2
...
@@ -124,12 +124,12 @@ export const getMatterForFlownum = (params) => {
...
@@ -124,12 +124,12 @@ export const getMatterForFlownum = (params) => {
params
,
params
,
});
});
};
};
//获取设备
列表
//获取设备
信息(按设备编码)
export
const
getDevice
List
=
(
data
)
=>
{
export
const
getDevice
Info
=
(
data
)
=>
{
let
baseUrl
=
local
.
getLocal
(
"
serverUrl
"
);
let
baseUrl
=
local
.
getLocal
(
"
serverUrl
"
);
let
deviceCode
=
local
.
getLocal
(
"
devicenum
"
);
let
deviceCode
=
local
.
getLocal
(
"
devicenum
"
);
return
request
({
return
request
({
url
:
`
${
baseUrl
}
sampleform/device/
list
`
,
url
:
`
${
baseUrl
}
sampleform/device/
check
`
,
method
:
"
post
"
,
method
:
"
post
"
,
data
:
{
data
:
{
deviceCode
,
deviceCode
,
...
...
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