@@ -107,59 +107,8 @@ export default {
dept: null,
year: "",
total: 0,
- tableData: [
- {
- deptName: "企业1",
- sn: "SN001",
- position: "位置1",
- month1: 1,
- month2: 2,
- month3: 3,
- month4: 4,
- month5: 5,
- month6: 6,
- month7: 7,
- month8: 8,
- month9: 9,
- month10: 10,
- month11: 11,
- month12: 12,
- },
- {
- deptName: "企业2",
- sn: "SN002",
- position: "位置2",
- month1: 1,
- month2: 2,
- month3: 3,
- month4: 4,
- month5: 5,
- month6: 6,
- month7: 7,
- month8: 8,
- month9: 9,
- month10: 10,
- month11: 11,
- month12: 12,
- },
- {
- deptName: "企业3",
- sn: "SN003",
- position: "位置3",
- month1: 1,
- month2: 2,
- month3: 3,
- month4: 4,
- month5: 5,
- month6: 6,
- month7: 7,
- month8: 8,
- month9: 9,
- month10: 10,
- month11: 11,
- month12: 12,
- },
- ],
+ tableData: [],
+ rowTagNum: 4,
dashboardTag: [
{
label: "设备总数",
@@ -171,26 +120,26 @@ export default {
key: "normalDeviceCount",
icon: "el-icon-help",
},
- {
- label: "异常设备数",
- key: "abnormalDeviceCount",
- icon: "el-icon-s-help",
- },
+ // {
+ // label: "异常设备数",
+ // key: "abnormalDeviceCount",
+ // icon: "el-icon-s-help",
+ // },
// {
// label: "正在报警设备数",
// key: "alarmDeviceCount",
// icon: "el-icon-message-solid",
// },
- // {
- // label: "全年报警次数",
- // key: "alarmCountYear",
- // icon: "el-icon-s-marketing",
- // },
- // {
- // label: "全年解决报警次数",
- // key: "alarmSolveCountYear",
- // icon: "el-icon-folder-checked",
- // },
+ {
+ label: "全年报警次数",
+ key: "alarmCountYear",
+ icon: "el-icon-s-marketing",
+ },
+ {
+ label: "全年解决报警次数",
+ key: "alarmSolveCountYear",
+ icon: "el-icon-folder-checked",
+ },
// {
// label: "全年未解决报警次数",
// key: "alarmUnsolvedCountYear",
@@ -243,7 +192,7 @@ export default {
}
return newArr;
}
- return splitArray(this.dashboardTag, 3);
+ return splitArray(this.dashboardTag, this.rowTagNum);
},
},
methods: {
@@ -272,6 +221,17 @@ export default {
}).then((res) => {
if (res.code === 200) {
this.tableData = res.data;
+ console.log(this.tableData);
+ this.dashboardData.alarmCountYear = res.data.reduce((prev, cur) => {
+ for (let key in cur) {
+ if (key.includes("month")) {
+ prev += cur[key];
+ }
+ }
+ return prev;
+ },
+ 0
+ );
}
});
@@ -308,7 +268,7 @@ export default {
display: flex;
flex-direction: column;
justify-content: center;
- align-items: end;
+ align-items: flex-end;
.card-content__title {
font-size: 14px;