|
|
|
@ -9,7 +9,7 @@ import { type PaginationProps } from "@pureadmin/table";
|
|
|
|
|
import { ElMessageBox } from "element-plus";
|
|
|
|
|
// import { getConfig } from "@/config";
|
|
|
|
|
// import { getToken, formatToken } from "@/utils/auth";
|
|
|
|
|
import { getHomeList, getEvents } from "@/api/home";
|
|
|
|
|
import { getHomeList, getEvents, getScenes, getReasons } from "@/api/home";
|
|
|
|
|
import { welcomeUtil } from "./hook";
|
|
|
|
|
|
|
|
|
|
defineOptions({
|
|
|
|
@ -20,10 +20,10 @@ defineOptions({
|
|
|
|
|
const { openDialog } = welcomeUtil();
|
|
|
|
|
const formInline = reactive({
|
|
|
|
|
date: "",
|
|
|
|
|
policeId: "",
|
|
|
|
|
event: "",
|
|
|
|
|
violation: "",
|
|
|
|
|
violationType: ""
|
|
|
|
|
violationReason: "",
|
|
|
|
|
scene: ""
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const currentPage = ref(1);
|
|
|
|
@ -37,6 +37,10 @@ const tableData = ref([]);
|
|
|
|
|
|
|
|
|
|
const eventMap = ref({});
|
|
|
|
|
|
|
|
|
|
const sceneMap = ref({});
|
|
|
|
|
|
|
|
|
|
const vioReasonMap = ref({});
|
|
|
|
|
|
|
|
|
|
const violationMap = ref({
|
|
|
|
|
是: "1",
|
|
|
|
|
否: "0",
|
|
|
|
@ -70,10 +74,10 @@ function onSearch() {
|
|
|
|
|
const params = {
|
|
|
|
|
start_time: formInline.date === null ? undefined : formInline.date[0],
|
|
|
|
|
end_time: formInline.date === null ? undefined : formInline.date[1],
|
|
|
|
|
police_id: formInline.policeId || undefined,
|
|
|
|
|
scene: formInline.scene || undefined,
|
|
|
|
|
event_type: formInline.event || undefined,
|
|
|
|
|
violation: violationMap.value[formInline.violation] || undefined,
|
|
|
|
|
violation_type: formInline.violationType || undefined,
|
|
|
|
|
violation_type: formInline.violationReason || undefined,
|
|
|
|
|
page: currentPage.value || undefined,
|
|
|
|
|
page_size: pageSize.value || undefined
|
|
|
|
|
};
|
|
|
|
@ -165,25 +169,18 @@ const handleClose = (done: () => void) => {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
async function getEvent() {
|
|
|
|
|
// axios({
|
|
|
|
|
// url: AdminHostUrl + "events",
|
|
|
|
|
// headers: {
|
|
|
|
|
// token: formatToken(getToken().accessToken)
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// .then(response => {
|
|
|
|
|
// eventMap.value = response.data.data;
|
|
|
|
|
// // console.log(eventMap.value);
|
|
|
|
|
// })
|
|
|
|
|
// .catch(error => {
|
|
|
|
|
// ElMessage({
|
|
|
|
|
// message: "网络暂不通畅",
|
|
|
|
|
// type: "warning"
|
|
|
|
|
// });
|
|
|
|
|
// console.log(error);
|
|
|
|
|
// });
|
|
|
|
|
const { results } = await getEvents();
|
|
|
|
|
eventMap.value = results;
|
|
|
|
|
const { data } = await getEvents();
|
|
|
|
|
eventMap.value = data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function getScene() {
|
|
|
|
|
const { data } = await getScenes();
|
|
|
|
|
sceneMap.value = data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async function getReason() {
|
|
|
|
|
const { data } = await getReasons();
|
|
|
|
|
vioReasonMap.value = data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function pickerOptions(time) {
|
|
|
|
@ -202,12 +199,12 @@ const columns: TableColumnList = [
|
|
|
|
|
sortable: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "警号",
|
|
|
|
|
prop: "police_id",
|
|
|
|
|
label: "场景",
|
|
|
|
|
prop: "scene",
|
|
|
|
|
minWidth: 100
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "违法行为",
|
|
|
|
|
label: "事件类型",
|
|
|
|
|
prop: "event_type",
|
|
|
|
|
minWidth: 100
|
|
|
|
|
},
|
|
|
|
@ -218,24 +215,19 @@ const columns: TableColumnList = [
|
|
|
|
|
slot: "violation"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "违规行为",
|
|
|
|
|
prop: "ai_analysis",
|
|
|
|
|
minWidth: 100
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "时间点",
|
|
|
|
|
prop: "relative_time",
|
|
|
|
|
label: "违规原因",
|
|
|
|
|
prop: "violation_reason",
|
|
|
|
|
minWidth: 100
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "缩率图",
|
|
|
|
|
slot: "image"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: "车牌号",
|
|
|
|
|
prop: "car_number",
|
|
|
|
|
minWidth: 100
|
|
|
|
|
},
|
|
|
|
|
// {
|
|
|
|
|
// label: "车牌号",
|
|
|
|
|
// prop: "car_number",
|
|
|
|
|
// minWidth: 100
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// label: "视频",
|
|
|
|
|
// slot: "video"
|
|
|
|
@ -294,7 +286,7 @@ onMounted(() => {
|
|
|
|
|
:default-value="lastMonth"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<!--
|
|
|
|
|
<el-form-item label="警号:">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formInline.policeId"
|
|
|
|
@ -302,15 +294,28 @@ onMounted(() => {
|
|
|
|
|
clearable
|
|
|
|
|
style="width: 198px"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item> -->
|
|
|
|
|
<el-form-item label="场景:">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="formInline.scene"
|
|
|
|
|
placeholder="场景"
|
|
|
|
|
clearable
|
|
|
|
|
@click="getScene()"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="(scene, type) in sceneMap"
|
|
|
|
|
:key="type"
|
|
|
|
|
:label="scene"
|
|
|
|
|
:value="scene"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="违法行为:">
|
|
|
|
|
<!-- <el-input v-model="formInline.event" placeholder="事件"/>-->
|
|
|
|
|
<el-form-item label="事件类型:">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="formInline.event"
|
|
|
|
|
placeholder="违法行为"
|
|
|
|
|
placeholder="事件类型"
|
|
|
|
|
clearable
|
|
|
|
|
@click="getEvent"
|
|
|
|
|
@click="getEvent()"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="(event, type) in eventMap"
|
|
|
|
@ -336,13 +341,20 @@ onMounted(() => {
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item label="违规行为:">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="formInline.violationType"
|
|
|
|
|
placeholder="违规行为"
|
|
|
|
|
<el-form-item label="违规原因:">
|
|
|
|
|
<el-select
|
|
|
|
|
v-model="formInline.violationReason"
|
|
|
|
|
placeholder="违规原因"
|
|
|
|
|
clearable
|
|
|
|
|
style="width: 198px"
|
|
|
|
|
/>
|
|
|
|
|
@click="getReason()"
|
|
|
|
|
>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="(reason, type) in vioReasonMap"
|
|
|
|
|
:key="type"
|
|
|
|
|
:label="reason"
|
|
|
|
|
:value="reason"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<el-form-item>
|
|
|
|
@ -380,8 +392,8 @@ onMounted(() => {
|
|
|
|
|
<el-image
|
|
|
|
|
preview-teleported
|
|
|
|
|
loading="lazy"
|
|
|
|
|
:src="row.small_image"
|
|
|
|
|
:preview-src-list="[row.small_image]"
|
|
|
|
|
:src="row.thumbnail"
|
|
|
|
|
:preview-src-list="[row.thumbnail]"
|
|
|
|
|
:initial-index="index"
|
|
|
|
|
fit="cover"
|
|
|
|
|
class="w-[100px] h-[100px]"
|
|
|
|
|