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

Merge remote-tracking branch 'origin/master'

parents 84b184dd 4ca161dd
......@@ -11,7 +11,7 @@ import local from "@/utils/local";
import NetworkError from "@/components/NetworkError.vue";
import EnabledDev from "@/components/EnabledDev.vue";
import mq from "@/mixin/mq";
import { getHomeInfo, getSkinList, getDeviceList } from "@/api";
import { getHomeInfo, getSkinList, getDeviceInfo } from "@/api";
import { mapMutations } from "vuex";
export default {
mixins: [mq],
......@@ -30,7 +30,7 @@ export default {
},
watch: {
"$route.path"(newVal) {
this.getDeviceList();
this.getDeviceInfo();
if (newVal == "/" || newVal == "/home") {
this.getHomeInfo();
this.getSetinfo();
......@@ -66,8 +66,8 @@ export default {
homeUrl: "http://192.168.0.24:8080/#/",
serverUrl: "http://192.168.0.98:11078/",
},
devicenum: "18-93-7F-C0-AD-B5",
// devicenum: "B8-13-32-86-9F-04",
// devicenum: "18-93-7F-C0-AD-B5",
devicenum: "B8-13-32-86-9F-04",
};
local.setLocal("devicenum", obj.devicenum);
local.setLocal("deviceInfo", obj.deviceInfo);
......@@ -165,22 +165,17 @@ export default {
}
}
},
async getDeviceList() {
let res = await getDeviceList({
page: 1,
size: -1,
});
async getDeviceInfo() {
let res = await getDeviceInfo();
if (res.data.code == 1) {
let { data } = res.data.data;
if (!data.length) return;
let { enabled } = data[0];
this.enabled = enabled;
let { data } = res.data;
this.enabled = data.enabled;
}
},
// 轮询设备状态
getDevInfo() {
this.timer = setInterval(() => {
this.getDeviceList();
this.getDeviceInfo();
}, 1000 * 60);
},
},
......
......@@ -124,12 +124,12 @@ export const getMatterForFlownum = (params) => {
params,
});
};
//获取设备列表
export const getDeviceList = (data) => {
//获取设备信息(按设备编码)
export const getDeviceInfo = (data) => {
let baseUrl = local.getLocal("serverUrl");
let deviceCode = local.getLocal("devicenum");
return request({
url: `${baseUrl}sampleform/device/list`,
url: `${baseUrl}sampleform/device/check`,
method: "post",
data: {
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