From f93a054160ab7160c1d7c28ffc6cb270a062d8d3 Mon Sep 17 00:00:00 2001 From: kongfp Date: Mon, 24 Jul 2023 14:36:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=A6=96=E9=A1=B5=E4=BB=A5?= =?UTF-8?q?=E5=8F=8A=E9=A6=96=E9=A1=B5=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/sidebar/horizontal.vue | 2 +- src/layout/components/sidebar/mixNav.vue | 2 +- src/router/modules/home.ts | 3 +- src/views/welcome/index.vue | 91 +++++++++++--------- 4 files changed, 55 insertions(+), 43 deletions(-) diff --git a/src/layout/components/sidebar/horizontal.vue b/src/layout/components/sidebar/horizontal.vue index 1271998..2a6ecd6 100644 --- a/src/layout/components/sidebar/horizontal.vue +++ b/src/layout/components/sidebar/horizontal.vue @@ -58,7 +58,7 @@ nextTick(() => { - + diff --git a/src/layout/components/sidebar/mixNav.vue b/src/layout/components/sidebar/mixNav.vue index 31dd25f..3431d25 100644 --- a/src/layout/components/sidebar/mixNav.vue +++ b/src/layout/components/sidebar/mixNav.vue @@ -91,7 +91,7 @@ watch( - + diff --git a/src/router/modules/home.ts b/src/router/modules/home.ts index 74c351f..aec5455 100644 --- a/src/router/modules/home.ts +++ b/src/router/modules/home.ts @@ -15,8 +15,7 @@ export default { { path: "/welcome", name: "Welcome", - // component: () => import("@/views/welcome/index.vue"), - component: () => import("@/views/common/common.vue"), + component: () => import("@/views/welcome/index.vue"), meta: { title: "首页", showLink: VITE_HIDE_HOME === "true" ? false : true diff --git a/src/views/welcome/index.vue b/src/views/welcome/index.vue index bf0e842..1720bc9 100644 --- a/src/views/welcome/index.vue +++ b/src/views/welcome/index.vue @@ -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 => { - eventMap.value = response.data.data; - // console.log(eventMap.value); + if (field == "events") { + eventMap.value = response.data.data; + } 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(() => { /> - - + + + + - - - + + @@ -198,8 +211,10 @@ onMounted(() => { - - + + + + @@ -221,13 +236,13 @@ onMounted(() => { style="width: 100%" > - - - + + + + + + + @@ -237,30 +252,28 @@ onMounted(() => { - - - - + + + + + + - + - -