|
@@ -47,26 +47,30 @@
|
|
<div class="tableCard">
|
|
<div class="tableCard">
|
|
<a-table :columns="columns" :data-source="tableList" :loading="loading" :pagination="false">
|
|
<a-table :columns="columns" :data-source="tableList" :loading="loading" :pagination="false">
|
|
<template #bodyCell="{ column, record }">
|
|
<template #bodyCell="{ column, record }">
|
|
- <!-- 跌倒、异常统计 姿势 -->
|
|
|
|
<template v-if="column.key === 'pose'">
|
|
<template v-if="column.key === 'pose'">
|
|
{{ record.poseName }}
|
|
{{ record.poseName }}
|
|
</template>
|
|
</template>
|
|
- <!-- 跌倒、异常统计 是否处理 -->
|
|
|
|
<template v-if="column.key === 'isHandle'">
|
|
<template v-if="column.key === 'isHandle'">
|
|
<a-tag v-if="record.isHandle === 0" :bordered="false" color="red">未处理</a-tag>
|
|
<a-tag v-if="record.isHandle === 0" :bordered="false" color="red">未处理</a-tag>
|
|
<a-tag v-if="record.isHandle === 1" :bordered="false" color="green">已处理</a-tag>
|
|
<a-tag v-if="record.isHandle === 1" :bordered="false" color="green">已处理</a-tag>
|
|
</template>
|
|
</template>
|
|
- <!-- 异常滞留 告警类型 -->
|
|
|
|
<template v-if="column.key === 'eventType'">
|
|
<template v-if="column.key === 'eventType'">
|
|
{{ record.eventTypeName }}
|
|
{{ record.eventTypeName }}
|
|
</template>
|
|
</template>
|
|
- <!-- 一般滞留 滞留类型 -->
|
|
|
|
- <template v-if="column.key === 'type'">
|
|
|
|
- {{ record.typeName }}
|
|
|
|
- </template>
|
|
|
|
- <!-- 一般滞留 停留时间 -->
|
|
|
|
- <template v-if="column.key === 'stayTime'">
|
|
|
|
- {{ formatSeconds(record.stayTime) }}
|
|
|
|
|
|
+ <template v-if="column.key === 'info'">
|
|
|
|
+ <div v-if="record.info?.start_time">开始时间:{{ record.info?.start_time }}</div>
|
|
|
|
+ <div v-if="record.info?.end_time">结束时间:{{ record.info?.end_time }}</div>
|
|
|
|
+ <div v-if="record.info?.stay_time">停留时长:{{ record.info?.stay_time }}(秒)</div>
|
|
|
|
+ <div v-if="record.info?.count">次数{{ record.info?.count }}</div>
|
|
|
|
+ <template v-if="record.info?.event_list">
|
|
|
|
+ 事件列表:
|
|
|
|
+ <div v-for="(event, index) in record.info?.event_list" :key="index">
|
|
|
|
+ <div>开始时间{{ event.start_time }}</div>
|
|
|
|
+ <div>结束时间{{ event.end_time }}</div>
|
|
|
|
+ <div>停留时长{{ event.stay_time }}(秒)</div>
|
|
|
|
+ <div>消失时长{{ event.absence_time }}(秒)</div>
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
</a-table>
|
|
</a-table>
|
|
@@ -91,7 +95,6 @@ import * as statsApi from '@/api/stats'
|
|
import type { StatsFallQueryDataRow, StatsAlarmQueryDataRow } from '@/api/stats/types'
|
|
import type { StatsFallQueryDataRow, StatsAlarmQueryDataRow } from '@/api/stats/types'
|
|
import { useDict, type DictItem } from '@/hooks/useDict'
|
|
import { useDict, type DictItem } from '@/hooks/useDict'
|
|
import { useDictName } from '@/hooks/useDictName'
|
|
import { useDictName } from '@/hooks/useDictName'
|
|
-import { formatSeconds } from '@/utils'
|
|
|
|
import * as alarmApi from '@/api/alarm'
|
|
import * as alarmApi from '@/api/alarm'
|
|
|
|
|
|
defineOptions({
|
|
defineOptions({
|
|
@@ -241,7 +244,7 @@ const fetchFallList = async () => {
|
|
const { rows, total } = res.data
|
|
const { rows, total } = res.data
|
|
fallList.value = rows as StatsFallQueryDataRow[]
|
|
fallList.value = rows as StatsFallQueryDataRow[]
|
|
fallList.value.forEach((item) => {
|
|
fallList.value.forEach((item) => {
|
|
- item.poseName = personPoseName(String(item.pose))
|
|
|
|
|
|
+ item.poseName = item.pose !== null ? personPoseName(String(item.pose)) : ''
|
|
})
|
|
})
|
|
tableList.value = fallList.value
|
|
tableList.value = fallList.value
|
|
tableTotal.value = Number(total)
|
|
tableTotal.value = Number(total)
|
|
@@ -270,6 +273,12 @@ const fetchAlarmList = async () => {
|
|
alarmList.value = rows as StatsAlarmQueryDataRow[]
|
|
alarmList.value = rows as StatsAlarmQueryDataRow[]
|
|
alarmList.value.forEach((item) => {
|
|
alarmList.value.forEach((item) => {
|
|
item.eventTypeName = alarmEventTypeName(item.eventType)
|
|
item.eventTypeName = alarmEventTypeName(item.eventType)
|
|
|
|
+ try {
|
|
|
|
+ item.info = item.info && JSON.parse(item.info)
|
|
|
|
+ } catch (error) {
|
|
|
|
+ item.info = ''
|
|
|
|
+ console.log('❌ 解析info失败', error)
|
|
|
|
+ }
|
|
})
|
|
})
|
|
tableList.value = alarmList.value
|
|
tableList.value = alarmList.value
|
|
tableTotal.value = Number(total)
|
|
tableTotal.value = Number(total)
|