|
@@ -74,6 +74,7 @@ export default createStore({
|
|
|
.then((requset) => {
|
|
|
if (requset.status === 'SUCCESS') {
|
|
|
state.siteList = requset.data
|
|
|
+ state.siteId = requset.data[0].id
|
|
|
} else {
|
|
|
ElMessage.error(requset.msg)
|
|
|
}
|
|
@@ -94,19 +95,19 @@ export default createStore({
|
|
|
requset.data.map((val) => {
|
|
|
// if (val.children.length > 0) {
|
|
|
state.deviceList.push({
|
|
|
- deviceCode: val.deviceCode,
|
|
|
- deviceName: val.deviceName,
|
|
|
- id: val.id,
|
|
|
- children: val.children.length > 0 ?
|
|
|
- val.children.map((val) => {
|
|
|
- return {
|
|
|
- deviceCode: val.variableCoding,
|
|
|
- deviceName: val.variableName,
|
|
|
- id: val.id,
|
|
|
- }
|
|
|
- }) : val.children,
|
|
|
- })
|
|
|
- // }
|
|
|
+ deviceCode: val.deviceCode,
|
|
|
+ deviceName: val.deviceName,
|
|
|
+ id: val.id,
|
|
|
+ children: val.children.length > 0 ?
|
|
|
+ val.children.map((val) => {
|
|
|
+ return {
|
|
|
+ deviceCode: val.variableCoding,
|
|
|
+ deviceName: val.variableName,
|
|
|
+ id: val.id,
|
|
|
+ }
|
|
|
+ }) : val.children,
|
|
|
+ })
|
|
|
+ // }
|
|
|
})
|
|
|
} else {
|
|
|
ElMessage.error(requset.msg)
|
|
@@ -130,10 +131,10 @@ export default createStore({
|
|
|
if (requset.status === 'SUCCESS') {
|
|
|
state.authorities = []
|
|
|
var menuObj = requset.data;
|
|
|
- menuObj.forEach(function(item) {
|
|
|
- state.authorities.push(item.menuName)
|
|
|
- })
|
|
|
- // console.log(state.authorities)
|
|
|
+ menuObj.forEach(function (item) {
|
|
|
+ state.authorities.push(item.menuName)
|
|
|
+ })
|
|
|
+ // console.log(state.authorities)
|
|
|
} else {
|
|
|
ElMessage.error(requset.msg)
|
|
|
}
|
|
@@ -164,7 +165,7 @@ export default createStore({
|
|
|
var HH = time[i].getHours() < 10 ? '0' + time[i].getHours() : time[i].getHours()
|
|
|
var MM = time[i].getMinutes() < 10 ? '0' + time[i].getMinutes() : time[i].getMinutes()
|
|
|
var SS = time[i].getSeconds() < 10 ? '0' + time[i].getSeconds() : time[i].getSeconds()
|
|
|
- // console.log(Y + '-' + M + '-' + D + ' ' + HH + ':' + MM + ':' + SS)
|
|
|
+ // console.log(Y + '-' + M + '-' + D + ' ' + HH + ':' + MM + ':' + SS)
|
|
|
state.Time_Data.push(Y + '-' + M + '-' + D + ' ' + HH + ':' + MM + ':' + SS)
|
|
|
}
|
|
|
},
|
|
@@ -188,8 +189,8 @@ export default createStore({
|
|
|
k = k + 24 * 60 * 60 * 1000;
|
|
|
}
|
|
|
state.timearr = arrTime
|
|
|
- // return arrTime;
|
|
|
- // 时间格式处理
|
|
|
+ // return arrTime;
|
|
|
+ // 时间格式处理
|
|
|
function datetimeparse(timestamp, format, prefix) {
|
|
|
if (typeof timestamp == "string") {
|
|
|
timestamp = Number(timestamp);
|
|
@@ -221,20 +222,20 @@ export default createStore({
|
|
|
let YYYY = dateobj.getFullYear();
|
|
|
let MM =
|
|
|
dateobj.getMonth() > 8 ?
|
|
|
- dateobj.getMonth() + 1 :
|
|
|
- "0" + (dateobj.getMonth() + 1);
|
|
|
+ dateobj.getMonth() + 1 :
|
|
|
+ "0" + (dateobj.getMonth() + 1);
|
|
|
let DD =
|
|
|
dateobj.getDate() > 9 ? dateobj.getDate() : "0" + dateobj.getDate();
|
|
|
let HH =
|
|
|
dateobj.getHours() > 9 ? dateobj.getHours() : "0" + dateobj.getHours();
|
|
|
let mm =
|
|
|
dateobj.getMinutes() > 9 ?
|
|
|
- dateobj.getMinutes() :
|
|
|
- "0" + dateobj.getMinutes();
|
|
|
+ dateobj.getMinutes() :
|
|
|
+ "0" + dateobj.getMinutes();
|
|
|
let ss =
|
|
|
dateobj.getSeconds() > 9 ?
|
|
|
- dateobj.getSeconds() :
|
|
|
- "0" + dateobj.getSeconds();
|
|
|
+ dateobj.getSeconds() :
|
|
|
+ "0" + dateobj.getSeconds();
|
|
|
let output = "";
|
|
|
let separator = "/";
|
|
|
if (format) {
|