|
|
|
@ -231,11 +231,14 @@
|
|
|
|
|
</u-table-column>
|
|
|
|
|
<u-table-column label="电池状态" width="138" key="dc" v-if="dccheck">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{
|
|
|
|
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
|
|
|
|
scope.row.raw_report.battary
|
|
|
|
|
}}</span>
|
|
|
|
|
<span v-else>{{
|
|
|
|
|
scope.row.raw_report.hasOwnProperty("msgs")
|
|
|
|
|
? scope.row.raw_report.msgs.battery
|
|
|
|
|
: ""
|
|
|
|
|
}}
|
|
|
|
|
}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</u-table-column>
|
|
|
|
|
|
|
|
|
@ -247,29 +250,38 @@
|
|
|
|
|
:sort-method="sortnumberOfHb"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{
|
|
|
|
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
|
|
|
|
scope.row.raw_report.numberOfHb
|
|
|
|
|
}}</span>
|
|
|
|
|
<span v-else>{{
|
|
|
|
|
scope.row.raw_report.msgs.hasOwnProperty("numberOfHb")
|
|
|
|
|
? Number(scope.row.raw_report.msgs.numberOfHb)
|
|
|
|
|
: ""
|
|
|
|
|
}}
|
|
|
|
|
}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</u-table-column>
|
|
|
|
|
<u-table-column label="周期" min-width="48">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{
|
|
|
|
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
|
|
|
|
scope.row.raw_report.heartbeatDuration
|
|
|
|
|
}}</span>
|
|
|
|
|
<span v-else>{{
|
|
|
|
|
scope.row.raw_report.hasOwnProperty("msgs")
|
|
|
|
|
? scope.row.raw_report.msgs.heartbeatDuration
|
|
|
|
|
: ""
|
|
|
|
|
}}
|
|
|
|
|
}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</u-table-column>
|
|
|
|
|
<u-table-column label="CMA消息" min-width="60">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{
|
|
|
|
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
|
|
|
|
scope.row.raw_report.recv
|
|
|
|
|
}}</span>
|
|
|
|
|
<span v-else>{{
|
|
|
|
|
scope.row.raw_report.hasOwnProperty("msgs")
|
|
|
|
|
? scope.row.raw_report.msgs.recv
|
|
|
|
|
: ""
|
|
|
|
|
}}
|
|
|
|
|
}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</u-table-column>
|
|
|
|
|
</u-table-column>
|
|
|
|
@ -277,11 +289,14 @@
|
|
|
|
|
<u-table-column label="拍照" v-if="pzcheck" key="pz">
|
|
|
|
|
<u-table-column label="计划/实际" min-width="60">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{
|
|
|
|
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
|
|
|
|
scope.row.raw_report.photoTimes
|
|
|
|
|
}}</span>
|
|
|
|
|
<span v-else>{{
|
|
|
|
|
scope.row.raw_report.hasOwnProperty("msgs")
|
|
|
|
|
? scope.row.raw_report.msgs.photoTimes
|
|
|
|
|
: ""
|
|
|
|
|
}}
|
|
|
|
|
}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</u-table-column>
|
|
|
|
|
<u-table-column
|
|
|
|
@ -291,11 +306,14 @@
|
|
|
|
|
:sort-method="sortSuccess"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{
|
|
|
|
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
|
|
|
|
scope.row.raw_report.success
|
|
|
|
|
}}</span>
|
|
|
|
|
<span v-else>{{
|
|
|
|
|
scope.row.raw_report.msgs.hasOwnProperty("success")
|
|
|
|
|
? Number(scope.row.raw_report.msgs.success)
|
|
|
|
|
: ""
|
|
|
|
|
}}
|
|
|
|
|
}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</u-table-column>
|
|
|
|
|
<u-table-column
|
|
|
|
@ -305,11 +323,14 @@
|
|
|
|
|
:sort-method="sortFailure"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{
|
|
|
|
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
|
|
|
|
scope.row.raw_report.failure
|
|
|
|
|
}}</span>
|
|
|
|
|
<span v-else>{{
|
|
|
|
|
scope.row.raw_report.msgs.hasOwnProperty("failure")
|
|
|
|
|
? Number(scope.row.raw_report.msgs.failure)
|
|
|
|
|
: ""
|
|
|
|
|
}}
|
|
|
|
|
}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</u-table-column>
|
|
|
|
|
</u-table-column>
|
|
|
|
@ -333,18 +354,29 @@
|
|
|
|
|
</u-table-column>
|
|
|
|
|
<u-table-column label="卡2" min-width="60" prop="signature2">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-tooltip
|
|
|
|
|
class="item"
|
|
|
|
|
effect="dark"
|
|
|
|
|
:content="scope.row.raw_report.msgs.signature2"
|
|
|
|
|
placement="top"
|
|
|
|
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">
|
|
|
|
|
<el-tooltip
|
|
|
|
|
class="item"
|
|
|
|
|
effect="dark"
|
|
|
|
|
:content="scope.row.raw_report.simcard2"
|
|
|
|
|
placement="top"
|
|
|
|
|
><span>{{ scope.row.raw_report.simcard2 }}</span></el-tooltip
|
|
|
|
|
></span
|
|
|
|
|
>
|
|
|
|
|
<span>{{
|
|
|
|
|
scope.row.raw_report.msgs.hasOwnProperty("signature2")
|
|
|
|
|
? scope.row.raw_report.msgs.signature2.split("/")[0]
|
|
|
|
|
: ""
|
|
|
|
|
}}</span>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
<span v-else>
|
|
|
|
|
<el-tooltip
|
|
|
|
|
class="item"
|
|
|
|
|
effect="dark"
|
|
|
|
|
:content="scope.row.raw_report.msgs.signature2"
|
|
|
|
|
placement="top"
|
|
|
|
|
>
|
|
|
|
|
<span>{{
|
|
|
|
|
scope.row.raw_report.msgs.hasOwnProperty("signature2")
|
|
|
|
|
? scope.row.raw_report.msgs.signature2.split("/")[0]
|
|
|
|
|
: ""
|
|
|
|
|
}}</span>
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
</span>
|
|
|
|
|
<!-- {{
|
|
|
|
|
scope.row.raw_report.msgs.hasOwnProperty("signature2")
|
|
|
|
|
? scope.row.raw_report.msgs.signature2.split("/")[0]
|
|
|
|
@ -360,11 +392,14 @@
|
|
|
|
|
:sort-method="sortNumbersErr"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{
|
|
|
|
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
|
|
|
|
scope.row.raw_report.networkError
|
|
|
|
|
}}</span>
|
|
|
|
|
<span v-else>{{
|
|
|
|
|
scope.row.raw_report.msgs.hasOwnProperty("networkError")
|
|
|
|
|
? Number(scope.row.raw_report.msgs.networkError)
|
|
|
|
|
: ""
|
|
|
|
|
}}
|
|
|
|
|
}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</u-table-column>
|
|
|
|
|
</u-table-column>
|
|
|
|
@ -378,11 +413,14 @@
|
|
|
|
|
:sort-method="sortNumbers"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{
|
|
|
|
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
|
|
|
|
scope.row.raw_report.rebootTimes
|
|
|
|
|
}}</span>
|
|
|
|
|
<span v-else>{{
|
|
|
|
|
scope.row.raw_report.msgs.hasOwnProperty("rebootTimes")
|
|
|
|
|
? Number(scope.row.raw_report.msgs.rebootTimes)
|
|
|
|
|
: ""
|
|
|
|
|
}}
|
|
|
|
|
}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</u-table-column>
|
|
|
|
|
<u-table-column
|
|
|
|
@ -393,31 +431,44 @@
|
|
|
|
|
:sort-method="sortNumbers2"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{
|
|
|
|
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">{{
|
|
|
|
|
scope.row.raw_report.i1RebootTimes
|
|
|
|
|
}}</span>
|
|
|
|
|
<span v-else>{{
|
|
|
|
|
scope.row.raw_report.msgs.hasOwnProperty("i1RebootTimes")
|
|
|
|
|
? Number(scope.row.raw_report.msgs.i1RebootTimes)
|
|
|
|
|
: ""
|
|
|
|
|
}}
|
|
|
|
|
}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</u-table-column>
|
|
|
|
|
</u-table-column>
|
|
|
|
|
<u-table-column label="SIM卡" v-if="simcheck" min-width="160" key="sim">
|
|
|
|
|
<u-table-column label="卡1" width="158" prop="simcard1">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{
|
|
|
|
|
scope.row.raw_report.msgs.hasOwnProperty("simcard1")
|
|
|
|
|
? scope.row.raw_report.msgs.simcard1
|
|
|
|
|
: ""
|
|
|
|
|
}}
|
|
|
|
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">
|
|
|
|
|
{{ scope.row.raw_report.simcard1 }}</span
|
|
|
|
|
>
|
|
|
|
|
<span v-else>
|
|
|
|
|
{{
|
|
|
|
|
scope.row.raw_report.msgs.hasOwnProperty("simcard1")
|
|
|
|
|
? scope.row.raw_report.msgs.simcard1
|
|
|
|
|
: ""
|
|
|
|
|
}}</span
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
</u-table-column>
|
|
|
|
|
<u-table-column label="卡2" width="158" prop="simcard2">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{
|
|
|
|
|
scope.row.raw_report.msgs.hasOwnProperty("simcard2")
|
|
|
|
|
? scope.row.raw_report.msgs.simcard2
|
|
|
|
|
: ""
|
|
|
|
|
}}
|
|
|
|
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">
|
|
|
|
|
{{ scope.row.raw_report.simcard2 }}</span
|
|
|
|
|
>
|
|
|
|
|
<span v-else>
|
|
|
|
|
{{
|
|
|
|
|
scope.row.raw_report.msgs.hasOwnProperty("simcard2")
|
|
|
|
|
? scope.row.raw_report.msgs.simcard2
|
|
|
|
|
: ""
|
|
|
|
|
}}</span
|
|
|
|
|
>
|
|
|
|
|
</template>
|
|
|
|
|
</u-table-column>
|
|
|
|
|
</u-table-column>
|
|
|
|
@ -430,7 +481,10 @@
|
|
|
|
|
:sort-method="sortfreeNumbers"
|
|
|
|
|
>
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{
|
|
|
|
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">
|
|
|
|
|
{{ scope.row.raw_report.freeROM }}</span
|
|
|
|
|
>
|
|
|
|
|
<span v-else>{{
|
|
|
|
|
scope.row.raw_report.msgs.hasOwnProperty("freeROM")
|
|
|
|
|
? scope.row.raw_report.msgs.freeROM
|
|
|
|
|
: ""
|
|
|
|
@ -439,11 +493,14 @@
|
|
|
|
|
</u-table-column>
|
|
|
|
|
<u-table-column label="CMA服务器" v-if="cmacheck" width="160" key="cma">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
{{
|
|
|
|
|
<span v-if="scope.row.raw_report.hasOwnProperty('XyDev')">
|
|
|
|
|
{{ scope.row.raw_report.cma }}</span
|
|
|
|
|
>
|
|
|
|
|
<span v-else>{{
|
|
|
|
|
scope.row.raw_report.hasOwnProperty("msgs")
|
|
|
|
|
? scope.row.raw_report.msgs.cma
|
|
|
|
|
: ""
|
|
|
|
|
}}
|
|
|
|
|
}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</u-table-column>
|
|
|
|
|
<u-table-column label="I1版本" v-if="i1check" min-width="160" key="I1">
|
|
|
|
@ -1133,8 +1190,89 @@ export default {
|
|
|
|
|
// ).length;
|
|
|
|
|
},
|
|
|
|
|
//导出表格
|
|
|
|
|
// handleExport() {
|
|
|
|
|
// htmlToExcel.getExcel("#ywTable", "设备运维信息");
|
|
|
|
|
// },
|
|
|
|
|
//导出表格
|
|
|
|
|
handleExport() {
|
|
|
|
|
htmlToExcel.getExcel("#ywTable", "设备运维信息");
|
|
|
|
|
// 准备 CSV 文件的头部信息
|
|
|
|
|
const headers = [
|
|
|
|
|
"出厂ID",
|
|
|
|
|
"装置编号",
|
|
|
|
|
"状态",
|
|
|
|
|
"最后心跳时间",
|
|
|
|
|
"传图",
|
|
|
|
|
"规约",
|
|
|
|
|
"电池状态",
|
|
|
|
|
|
|
|
|
|
"心跳次数",
|
|
|
|
|
"心跳周期",
|
|
|
|
|
"CMA消息",
|
|
|
|
|
"拍照计划/实际",
|
|
|
|
|
"拍照成功",
|
|
|
|
|
"拍照失败",
|
|
|
|
|
"卡1信号",
|
|
|
|
|
"卡2信号",
|
|
|
|
|
"网络错误",
|
|
|
|
|
"系统重启",
|
|
|
|
|
"I1重启",
|
|
|
|
|
"SIM卡1",
|
|
|
|
|
"SIM卡2",
|
|
|
|
|
|
|
|
|
|
"CMA服务器",
|
|
|
|
|
"磁盘剩余空间",
|
|
|
|
|
"I1版本",
|
|
|
|
|
"运维版本",
|
|
|
|
|
"camera版本",
|
|
|
|
|
"AI版本",
|
|
|
|
|
"MCU版本",
|
|
|
|
|
];
|
|
|
|
|
// 准备 CSV 文件的内容数据
|
|
|
|
|
let csvContent = headers.join(",") + "\n";
|
|
|
|
|
this.tableData.forEach((item) => {
|
|
|
|
|
const rawReport = item.raw_report;
|
|
|
|
|
const msgs = item.raw_report.msgs;
|
|
|
|
|
|
|
|
|
|
// 处理 raw_report 数据
|
|
|
|
|
const rawReportData = [
|
|
|
|
|
item.oid,
|
|
|
|
|
item.cmdid,
|
|
|
|
|
this.nowTime - item.last_heartbeat_ts <= 720 ? "在线" : "离线",
|
|
|
|
|
item.last_heartbeat,
|
|
|
|
|
rawReport.pic || "",
|
|
|
|
|
this.protocolMap[item.protocol],
|
|
|
|
|
msgs.battery || "",
|
|
|
|
|
msgs.numberOfHb || "",
|
|
|
|
|
msgs.heartbeatDuration || "",
|
|
|
|
|
msgs.recv || "",
|
|
|
|
|
msgs.photoTimes || "",
|
|
|
|
|
msgs.success || "",
|
|
|
|
|
msgs.failure || "",
|
|
|
|
|
msgs.signature1 || "",
|
|
|
|
|
msgs.signature2 || "",
|
|
|
|
|
msgs.networkError || "",
|
|
|
|
|
msgs.rebootTimes || "",
|
|
|
|
|
msgs.i1RebootTimes || "",
|
|
|
|
|
msgs.simcard1 || "",
|
|
|
|
|
msgs.simcard2 || "",
|
|
|
|
|
msgs.freeROM || "",
|
|
|
|
|
msgs.cma || "",
|
|
|
|
|
msgs.i1Version || "",
|
|
|
|
|
msgs.maintainVersion || "",
|
|
|
|
|
msgs.cameraService || "",
|
|
|
|
|
msgs.aiVersion || "",
|
|
|
|
|
msgs.mcu || "",
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
// 如果需要处理 msgs 数据,可以在这里添加逻辑
|
|
|
|
|
// 将数据添加到 CSV 内容中
|
|
|
|
|
csvContent += rawReportData.join(",") + "\n";
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 创建一个 Blob 对象,并指定其类型为 text/csv 以及编码为 UTF-8
|
|
|
|
|
const blob = new Blob([csvContent], { type: "text/csv;charset=utf-8" });
|
|
|
|
|
// 使用 FileSaver 保存文件
|
|
|
|
|
saveAs(blob, "运维数据报表.csv");
|
|
|
|
|
},
|
|
|
|
|
// 保存选中的数据id,row-key就是要指定一个key标识这一行的数据
|
|
|
|
|
getRowKey(row) {
|
|
|
|
@ -1625,6 +1763,8 @@ export default {
|
|
|
|
|
return ` 0${minutes} : 0${seconds} `;
|
|
|
|
|
} else if (minutes < 10) {
|
|
|
|
|
return ` 0${minutes} : ${seconds} `;
|
|
|
|
|
} else if (seconds < 10) {
|
|
|
|
|
return ` ${minutes} : 0${seconds} `;
|
|
|
|
|
} else {
|
|
|
|
|
return ` ${minutes} : ${seconds} `;
|
|
|
|
|
}
|
|
|
|
|