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

fix:修改设备编号获取

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