31
0
Fork 0

fix: 时间格式调整以及标识bug解决

develop
kongfp 2 years ago
parent 8860c8cd7d
commit deea7e56cf

@ -10,7 +10,8 @@ export function videoUtil() {
label: "视频内时间",
prop: "relative_time",
minWidth: 100,
sortable: true
sortable: true,
slot: "relative_time"
},
{
label: "异常类型",

@ -227,6 +227,20 @@ function startAnalyse() {
});
}
function dataFormate(time) {
const milliseconds = time * 1000;
let sec = Math.floor(milliseconds / 1000);
let min = Math.floor(sec / 60);
const hour = Math.floor(min / 60);
sec %= 60;
min %= 60;
return `${hour.toString().padStart(2, "0")}:${min
.toString()
.padStart(2, "0")}:${sec.toString().padStart(2, "0")}`;
}
onMounted(() => {
onSearch();
setInterval(() => {
@ -304,7 +318,9 @@ onMounted(() => {
:key="index"
class="scrollbar-item"
>
<span :class="spanStyle(item.id)">{{ item.id }}</span>
<span :class="spanStyle(item.id)">{{
2 * index + 1
}}</span>
<el-image
style="height: 100px"
:src="item.pic_path"
@ -330,7 +346,9 @@ onMounted(() => {
:key="index"
class="scrollbar-item"
>
<span :class="spanStyle(item.id)">{{ item.id }}</span>
<span :class="spanStyle(item.id)">{{
2 * index + 2
}}</span>
<el-image
style="height: 100px"
:src="item.pic_path"
@ -359,11 +377,13 @@ onMounted(() => {
</div>
<el-scrollbar :height="`calc(${height}px - 60vh - 220px)`">
<div
v-for="item in carOddList"
:key="item.id"
v-for="(item, index) in carOddList"
:key="index"
class="scrollbar-item"
>
<span :class="spanStyle(item.id)">{{ item.id }}</span>
<span :class="spanStyle(item.id)">{{
2 * index + 1
}}</span>
<div class="defect-image">
<el-image
style="height: 100px"
@ -388,11 +408,13 @@ onMounted(() => {
</div>
<el-scrollbar :height="`calc(${height}px - 60vh - 220px)`">
<div
v-for="item in carEvenList"
:key="item.id"
v-for="(item, index) in carEvenList"
:key="index"
class="scrollbar-item"
>
<span :class="spanStyle(item.id)">{{ item.id }}</span>
<span :class="spanStyle(item.id)">{{
2 * index + 2
}}</span>
<div class="defect-image">
<el-image
style="height: 100px"
@ -435,6 +457,9 @@ onMounted(() => {
@page-size-change="handleSizeChange"
@page-current-change="handleCurrentChange"
>
<template #relative_time="{ row }">
<span>{{ dataFormate(row.relative_time) }}</span>
</template>
<template #behavior="{ row }">
<span style="color: red">{{ row.abnormal_behavior }}</span>
</template>

Loading…
Cancel
Save