Commit 3e294bf1 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 84b184dd 4ca161dd
...@@ -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, getDeviceList } from "@/api"; import { getHomeInfo, getSkinList, getDeviceInfo } 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.getDeviceList(); this.getDeviceInfo();
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.getDeviceList(); this.getDeviceInfo();
}, 1000 * 60); }, 1000 * 60);
}, },
}, },
......
...@@ -124,12 +124,12 @@ export const getMatterForFlownum = (params) => { ...@@ -124,12 +124,12 @@ export const getMatterForFlownum = (params) => {
params, params,
}); });
}; };
//获取设备列表 //获取设备信息(按设备编码)
export const getDeviceList = (data) => { export const getDeviceInfo = (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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment