Commit 94429fed authored by “yiyousong”'s avatar “yiyousong”

fix:修改设备编号获取

parent bdc0497a
......@@ -64,6 +64,8 @@ export default {
devicenum: "18-93-7F-C0-AD-B5",
// devicenum: "B8-13-32-86-9F-04",
};
local.setLocal(obj.devicenum);
this.SET_deviceCodet(obj.devicenum);
this.WebSocketMq(obj);
}
},
......@@ -79,7 +81,12 @@ export default {
});
},
methods: {
...mapMutations(["SET_homeInfo", "SET_datumList", "SET_matterList"]),
...mapMutations([
"SET_homeInfo",
"SET_datumList",
"SET_matterList",
"SET_deviceCodet",
]),
// 简析url
urlGet() {
let q = {};
......@@ -103,6 +110,7 @@ export default {
let { devicenum } = routeQuery;
this.devicenum = devicenum;
local.setLocal("devicenum", devicenum);
this.SET_deviceCodet(devicenum);
}
},
// 获取首页信息
......
// 事项api
import local from "@/utils/local";
import request from "@/utils/request";
import store from "@/store";
// 首页数据展示
export const getHomeInfo = (data) => {
let baseUrl = local.getLocal("serverUrl");
......@@ -19,13 +20,13 @@ export const getHomeInfo = (data) => {
export const getdeptList = (data) => {
let baseUrl = local.getLocal("serverUrl");
let siteId = local.getLocal("siteId");
let deviceCode = local.getLocal("devicenum");
// let deviceCode = local.getLocal("devicenum");
return request({
url: `${baseUrl}sampleform/home/depts`,
method: "post",
data: {
siteId,
deviceCode,
deviceCode: store.getters.deviceCode,
...data,
},
});
......@@ -49,13 +50,13 @@ export const getSampleformMatterList = (data) => {
export const getDeviceMatterList = (data) => {
let baseUrl = local.getLocal("serverUrl");
let siteId = local.getLocal("siteId");
let deviceCode = local.getLocal("devicenum");
// let deviceCode = local.getLocal("devicenum");
return request({
url: `${baseUrl}sampleform/device/matter/datum/list`,
method: "post",
data: {
siteId,
deviceCode,
deviceCode: store.getters.deviceCode,
...data,
},
});
......
......@@ -190,13 +190,14 @@ export default {
},
// mq通讯
WebSocketMq(objc) {
alert(JSON.stringify(objc));
let obj = objc.rabbmitInfo; //mq信息
let serviceInfo = objc.serviceInfo; //服务器信息
let deviceInfo = objc.deviceInfo; //设备信息
let serverUrl = serviceInfo.serverUrl; //系统地址
let siteId = deviceInfo.siteId; //站点id
let devicenum = objc.devicenum;
local.setLocal("devicenum", devicenum); // 设备编号
// let devicenum = objc.devicenum;
// local.setLocal("devicenum", devicenum); // 设备编号
// 保存地址
local.setLocal("serverUrl", serverUrl);
local.setLocal("siteId", siteId);
......
......@@ -19,7 +19,7 @@ export default {
clearInterval(that.timeOut);
this.timeOut = setTimeout(function () {
that.$router.push({ path: "/" });
}, 1000 * 60 * 2);
}, 1000 * 60 * 5);
},
// 无任何操作返回首页
isTimeOut() {
......
......@@ -83,7 +83,6 @@ import SearchBox from "@/components/SearchBox.vue";
import MateralsList from "../../components/MateralsList.vue";
import YEmpty from "@/components/YEmpty.vue";
import { getDeviceMatterList } from "@/api";
export default {
components: {
Header,
......
......@@ -11,8 +11,13 @@ export default new Vuex.Store({
homeInfo: {}, // 首页数据
datumList: [], // 首页材料
matterList: [], // 首页事项
deviceCode: "", // 设备编码
},
getters: {
deviceCode(state) {
return state.deviceCode;
},
},
getters: {},
mutations: {
SET_devicenum(state, devicenum) {
state.devicenum = devicenum;
......@@ -26,6 +31,9 @@ export default new Vuex.Store({
SET_matterList(state, matterList) {
state.matterList = matterList;
},
SET_deviceCodet(state, deviceCode) {
state.deviceCode = deviceCode;
},
},
actions: {},
modules: {},
......
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