31
0
Fork 0

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

develop
kongfp 2 years ago
parent 8860c8cd7d
commit deea7e56cf

@ -10,7 +10,8 @@ export function videoUtil() {
label: "视频内时间", label: "视频内时间",
prop: "relative_time", prop: "relative_time",
minWidth: 100, minWidth: 100,
sortable: true sortable: true,
slot: "relative_time"
}, },
{ {
label: "异常类型", 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(() => { onMounted(() => {
onSearch(); onSearch();
setInterval(() => { setInterval(() => {
@ -304,7 +318,9 @@ onMounted(() => {
:key="index" :key="index"
class="scrollbar-item" class="scrollbar-item"
> >
<span :class="spanStyle(item.id)">{{ item.id }}</span> <span :class="spanStyle(item.id)">{{
2 * index + 1
}}</span>
<el-image <el-image
style="height: 100px" style="height: 100px"
:src="item.pic_path" :src="item.pic_path"
@ -330,7 +346,9 @@ onMounted(() => {
:key="index" :key="index"
class="scrollbar-item" class="scrollbar-item"
> >
<span :class="spanStyle(item.id)">{{ item.id }}</span> <span :class="spanStyle(item.id)">{{
2 * index + 2
}}</span>
<el-image <el-image
style="height: 100px" style="height: 100px"
:src="item.pic_path" :src="item.pic_path"
@ -359,11 +377,13 @@ onMounted(() => {
</div> </div>
<el-scrollbar :height="`calc(${height}px - 60vh - 220px)`"> <el-scrollbar :height="`calc(${height}px - 60vh - 220px)`">
<div <div
v-for="item in carOddList" v-for="(item, index) in carOddList"
:key="item.id" :key="index"
class="scrollbar-item" class="scrollbar-item"
> >
<span :class="spanStyle(item.id)">{{ item.id }}</span> <span :class="spanStyle(item.id)">{{
2 * index + 1
}}</span>
<div class="defect-image"> <div class="defect-image">
<el-image <el-image
style="height: 100px" style="height: 100px"
@ -388,11 +408,13 @@ onMounted(() => {
</div> </div>
<el-scrollbar :height="`calc(${height}px - 60vh - 220px)`"> <el-scrollbar :height="`calc(${height}px - 60vh - 220px)`">
<div <div
v-for="item in carEvenList" v-for="(item, index) in carEvenList"
:key="item.id" :key="index"
class="scrollbar-item" class="scrollbar-item"
> >
<span :class="spanStyle(item.id)">{{ item.id }}</span> <span :class="spanStyle(item.id)">{{
2 * index + 2
}}</span>
<div class="defect-image"> <div class="defect-image">
<el-image <el-image
style="height: 100px" style="height: 100px"
@ -435,6 +457,9 @@ onMounted(() => {
@page-size-change="handleSizeChange" @page-size-change="handleSizeChange"
@page-current-change="handleCurrentChange" @page-current-change="handleCurrentChange"
> >
<template #relative_time="{ row }">
<span>{{ dataFormate(row.relative_time) }}</span>
</template>
<template #behavior="{ row }"> <template #behavior="{ row }">
<span style="color: red">{{ row.abnormal_behavior }}</span> <span style="color: red">{{ row.abnormal_behavior }}</span>
</template> </template>

Loading…
Cancel
Save