|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
import axios from "axios";
|
|
|
|
|
import { onMounted, ref } from "vue";
|
|
|
|
|
import OurPlayer from "@/components/VideoPlayer/OurPlayer.vue";
|
|
|
|
|
import { ElMessageBox } from "element-plus";
|
|
|
|
|
import {ElMessage, ElMessageBox} from "element-plus";
|
|
|
|
|
import { getConfig } from "@/config";
|
|
|
|
|
import { getToken, formatToken } from "@/utils/auth";
|
|
|
|
|
|
|
|
|
@ -14,10 +14,10 @@ const AdminHostUrl = getConfig().AdminHostUrl;
|
|
|
|
|
|
|
|
|
|
const formInline = ref({
|
|
|
|
|
date: [],
|
|
|
|
|
policeId: "",
|
|
|
|
|
event: "",
|
|
|
|
|
violation: "",
|
|
|
|
|
violationType: ""
|
|
|
|
|
violationReason: "",
|
|
|
|
|
scene: ""
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const currentPage = ref(1);
|
|
|
|
@ -30,6 +30,8 @@ const dialogVisible = ref(false);
|
|
|
|
|
const tableData = ref([]);
|
|
|
|
|
|
|
|
|
|
const eventMap = ref({});
|
|
|
|
|
const sceneMap = ref({});
|
|
|
|
|
const vioReasonMap = ref({});
|
|
|
|
|
|
|
|
|
|
const violationMap = ref({
|
|
|
|
|
"是": "1",
|
|
|
|
@ -49,7 +51,7 @@ function playVideo(data) {
|
|
|
|
|
time: data.relative_time
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
sessionStorage.setItem("video_url", data.video_dir);
|
|
|
|
|
sessionStorage.setItem("video_url", data.video_path);
|
|
|
|
|
sessionStorage.setItem("highlights", JSON.stringify(highlights));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -66,10 +68,10 @@ function onSearch() {
|
|
|
|
|
params: {
|
|
|
|
|
start_time: start_time || undefined,
|
|
|
|
|
end_time: end_time || undefined,
|
|
|
|
|
police_id: formInline.value.policeId || undefined,
|
|
|
|
|
event_type: formInline.value.event || undefined,
|
|
|
|
|
violation: violationMap.value[formInline.value.violation] || undefined,
|
|
|
|
|
violation_type: formInline.value.violationType || undefined,
|
|
|
|
|
violation_type: formInline.value.violationReason || undefined,
|
|
|
|
|
scene: formInline.value.scene || undefined,
|
|
|
|
|
page: currentPage.value || undefined,
|
|
|
|
|
page_size: pageSize.value || undefined
|
|
|
|
|
},
|
|
|
|
@ -89,7 +91,10 @@ function onSearch() {
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
// console.log("请求失败");
|
|
|
|
|
ElMessage({
|
|
|
|
|
message: "网络暂不通畅",
|
|
|
|
|
type: "warning"
|
|
|
|
|
})
|
|
|
|
|
console.log(error);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -124,20 +129,27 @@ const handleClose = (done: () => void) => {
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function getEvents() {
|
|
|
|
|
|
|
|
|
|
function getFields(field) {
|
|
|
|
|
axios({
|
|
|
|
|
url: AdminHostUrl + "events",
|
|
|
|
|
url: AdminHostUrl + field,
|
|
|
|
|
headers: {
|
|
|
|
|
token: formatToken(getToken().accessToken)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.then(response => {
|
|
|
|
|
if (field == "events") {
|
|
|
|
|
eventMap.value = response.data.data;
|
|
|
|
|
// console.log(eventMap.value);
|
|
|
|
|
} else if (field == "scenes") {
|
|
|
|
|
sceneMap.value = response.data.data;
|
|
|
|
|
} else if (field == "violation_reasons") {
|
|
|
|
|
vioReasonMap.value = response.data.data;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch(error => {
|
|
|
|
|
// console.log("请求失败");
|
|
|
|
|
ElMessage({
|
|
|
|
|
message: "网络暂不通畅",
|
|
|
|
|
type: "warning"
|
|
|
|
|
})
|
|
|
|
|
console.log(error);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -181,13 +193,14 @@ onMounted(() => {
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="警号:">
|
|
|
|
|
<el-input v-model="formInline.policeId" placeholder="警号" clearable style="width: 198px" />
|
|
|
|
|
<el-form-item label="场景:">
|
|
|
|
|
<el-select v-model="formInline.scene" placeholder="场景" clearable @click="getFields('scenes')">
|
|
|
|
|
<el-option v-for="(scene, type) in sceneMap" :key="type" :label="scene" :value="scene"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="违法行为:">
|
|
|
|
|
<!-- <el-input v-model="formInline.event" placeholder="事件"/>-->
|
|
|
|
|
<el-select v-model="formInline.event" placeholder="违法行为" clearable @click="getEvents">
|
|
|
|
|
<el-form-item label="事件类型:">
|
|
|
|
|
<el-select v-model="formInline.event" placeholder="事件类型" clearable @click="getFields('events')">
|
|
|
|
|
<el-option v-for="(event, type) in eventMap" :key="type" :label="event" :value="event"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
@ -198,8 +211,10 @@ onMounted(() => {
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="违规行为:">
|
|
|
|
|
<el-input v-model="formInline.violationType" placeholder="违规行为" clearable style="width: 198px" />
|
|
|
|
|
<el-form-item label="违规原因:">
|
|
|
|
|
<el-select v-model="formInline.violationReason" placeholder="违规原因" clearable @click="getFields('violation_reasons')">
|
|
|
|
|
<el-option v-for="(reason, type) in vioReasonMap" :key="type" :label="reason" :value="reason"></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item>
|
|
|
|
@ -221,13 +236,13 @@ onMounted(() => {
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
>
|
|
|
|
|
<el-table-column prop="record_time" sortable label="记录仪日期时间" />
|
|
|
|
|
<el-table-column prop="police_id" label="警号" />
|
|
|
|
|
<el-table-column prop="event_type" label="违法行为">
|
|
|
|
|
<template v-slot="scope">
|
|
|
|
|
<span>
|
|
|
|
|
{{ scope.row.event_type || "未定义事件" }}
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
<el-table-column prop="scene" label="场景" />
|
|
|
|
|
<el-table-column prop="event_type" label="事件类型">
|
|
|
|
|
<!-- <template v-slot="scope">-->
|
|
|
|
|
<!-- <span>-->
|
|
|
|
|
<!-- {{ scope.row.event_type || "未定义事件" }}-->
|
|
|
|
|
<!-- </span>-->
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
<el-table-column prop="is_violation" label="是否违规">
|
|
|
|
@ -237,30 +252,28 @@ onMounted(() => {
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
<el-table-column prop="ai_analysis" label="违规行为" />
|
|
|
|
|
<el-table-column prop="relative_time" label="时间点">
|
|
|
|
|
<template v-slot="scope">
|
|
|
|
|
<span>第 {{ scope.row.relative_time }} 秒</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column prop="violation_reason" label="违规原因" />
|
|
|
|
|
<!-- <el-table-column prop="relative_time" label="时间点">-->
|
|
|
|
|
<!-- <template v-slot="scope">-->
|
|
|
|
|
<!-- <span>第 {{ scope.row.relative_time }} 秒</span>-->
|
|
|
|
|
<!-- </template>-->
|
|
|
|
|
<!-- </el-table-column>-->
|
|
|
|
|
|
|
|
|
|
<el-table-column prop="small_image" label="缩率图">
|
|
|
|
|
<el-table-column prop="thumbnail" label="缩率图">
|
|
|
|
|
<template v-slot="scope">
|
|
|
|
|
<el-image
|
|
|
|
|
:preview-src-list="[scope.row.small_image]"
|
|
|
|
|
:preview-src-list="[scope.row.thumbnail]"
|
|
|
|
|
style="width: 65px; height: 65px"
|
|
|
|
|
:src="scope.row.small_image"
|
|
|
|
|
:src="scope.row.thumbnail"
|
|
|
|
|
:preview-teleported="true"
|
|
|
|
|
/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
|
|
|
|
|
<el-table-column prop="car_number" label="车牌号" />
|
|
|
|
|
|
|
|
|
|
<el-table-column show-overflow-tooltip label="视频">
|
|
|
|
|
<template v-slot="scope">
|
|
|
|
|
<el-button @click="playVideo(scope.row)">
|
|
|
|
|
<span v-if="scope.row.video_dir">播放视频</span>
|
|
|
|
|
<span v-if="scope.row.video_path">播放视频</span>
|
|
|
|
|
<span v-else>暂无视频</span>
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|