From dd4d7b2412e36dc8d6db8486116a301cea55419c Mon Sep 17 00:00:00 2001 From: luojiayi <1712054227@qq.com> Date: Wed, 30 Apr 2025 10:50:03 +0800 Subject: [PATCH] =?UTF-8?q?2025=E5=B9=B404=E6=9C=8830=E6=97=A510:50:02?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 8 +- components.d.ts | 1 + src/components/sectionDate.vue | 73 +++++++++++++++++++ src/views/statisticalCenter/deviceHistory.vue | 56 +------------- src/views/statisticalCenter/index.vue | 8 +- .../synthesizeManage/mapLocation/index.vue | 69 ++---------------- 6 files changed, 91 insertions(+), 124 deletions(-) create mode 100644 src/components/sectionDate.vue diff --git a/.env.development b/.env.development index ec71f38..54fa899 100644 --- a/.env.development +++ b/.env.development @@ -1,8 +1,8 @@ -VITE_APP_URL = 'http://192.168.3.116:8001/' -VITE_APP_URL_WEBSOCKET = 'http://192.168.3.116:8000/api/websocket' +# VITE_APP_URL = 'http://192.168.3.116:8001/' +# VITE_APP_URL_WEBSOCKET = 'http://192.168.3.116:8000/api/websocket' -# VITE_APP_URL = 'http://47.112.185.26:8001/' -# VITE_APP_URL_WEBSOCKET = 'ws://47.112.185.26:8000/api/websocket' +VITE_APP_URL = 'http://47.112.185.26:8001/' +VITE_APP_URL_WEBSOCKET = 'ws://47.112.185.26:8000/api/websocket' # VITE_APP_URL = 'http://api.handcuff.zhuhaiguangdun.cn' # VITE_APP_URL_WEBSOCKET = 'ws://device.handcuff.zhuhaiguangdun.cn:8000/api/websocket' diff --git a/components.d.ts b/components.d.ts index 6953697..356e312 100644 --- a/components.d.ts +++ b/components.d.ts @@ -46,6 +46,7 @@ declare module '@vue/runtime-core' { InfoWindow: typeof import('./src/components/InfoWindow.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + SectionDate: typeof import('./src/components/sectionDate.vue')['default'] Sidebar: typeof import('./src/components/sidebar.vue')['default'] TableCustom: typeof import('./src/components/table-custom.vue')['default'] TableDetail: typeof import('./src/components/table-detail.vue')['default'] diff --git a/src/components/sectionDate.vue b/src/components/sectionDate.vue new file mode 100644 index 0000000..14fc65b --- /dev/null +++ b/src/components/sectionDate.vue @@ -0,0 +1,73 @@ + + + + + diff --git a/src/views/statisticalCenter/deviceHistory.vue b/src/views/statisticalCenter/deviceHistory.vue index b7a46cc..0d23ec8 100644 --- a/src/views/statisticalCenter/deviceHistory.vue +++ b/src/views/statisticalCenter/deviceHistory.vue @@ -2,59 +2,20 @@
内容数据
-
- - - - - -
- - -
-
+
diff --git a/src/views/statisticalCenter/index.vue b/src/views/statisticalCenter/index.vue index affff4b..2294fa8 100644 --- a/src/views/statisticalCenter/index.vue +++ b/src/views/statisticalCenter/index.vue @@ -122,7 +122,6 @@ let option2 = ref({ { value: 0, name: "SOS告警" }, { value: 0, name: "围栏告警" }, { value: 0, name: "破坏告警" }, - { value: 0, name: "低电告警" }, { value: 0, name: "心率告警" }, { value: 0, name: "血氧告警" }, { value: 0, name: "体温告警" }, @@ -154,7 +153,6 @@ const getStatisticsWarningApi = () => { { value: res?.sosCount, name: "SOS告警" }, { value: res?.railCount, name: "围栏告警" }, { value: res?.destroyCount, name: "破坏告警" }, - { value: res?.batteryCount, name: "低电告警" }, { value: res?.heartRateCount, name: "心率告警" }, { value: res?.bloodOxygenCount, name: "血氧告警" }, { value: res?.tempCount, name: "体温告警" }, @@ -175,28 +173,24 @@ const getStatisticsUseCount = () => { const getStatisticsContent = (req) => { statisticsContent(req).then((res) => { if (res.times && res.times.length) { - option.value.xAxis.data = res.times; + option.value.xAxis.data = res.times.map((item) => (req.type == "hour" ? format(item) : format(item, "YYYY-MM-DD"))); option.value.series = [ { - stack: "Total", name: "SOS预警数组", data: res?.sosArr, type: "line", }, { - stack: "Total", name: "围栏预警数组", data: res?.railArr, type: "line", }, { - stack: "Total", name: "破坏预警数组", data: res?.destroyArr, type: "line", }, { - stack: "Total", name: "生理预警数组", data: res?.healthArr, type: "line", diff --git a/src/views/synthesizeManage/mapLocation/index.vue b/src/views/synthesizeManage/mapLocation/index.vue index 322b9ea..dca1636 100644 --- a/src/views/synthesizeManage/mapLocation/index.vue +++ b/src/views/synthesizeManage/mapLocation/index.vue @@ -3,57 +3,10 @@
时间区间: - - 小时 - - - - -
- - -
- +
-
@@ -72,14 +25,12 @@ import InfoWindow from "@/components/InfoWindow.vue"; import ViaMarker from "@/assets/img/via-marker.png"; import endMarker from "@/assets/img/end-marker.png"; import startMarker from "@/assets/img/start-marker.png"; +import SectionDate from "@/components/sectionDate.vue"; const { query } = useRoute(); let d = new Date(); let newMap = null; -let time = ref([new Date(`${format(d, "YYYY-MM-DD")} 00:00:00`), new Date(`${format(d, "YYYY-MM-DD")} 23:59:59`)]); -let week = ref(d); let deviceInfo = ref({}); -let sectionType = ref(1); let InfoWin = null; const params = reactive({ @@ -88,23 +39,18 @@ const params = reactive({ endDate: `${format(d, "YYYY-MM-DD")} 23:59:59`, }); -const weekChange = (val: any) => { - let endTime = new Date(val).getTime() + 6 * 24 * 60 * 60 * 1000; - params.startDate = `${val} 00:00:00`; - params.endDate = `${format(endTime, "YYYY-MM-DD")} 23:59:59`; - getLocateRecord(); -}; -const timeChange = (val: any) => { - params.startDate = `${format(val[0], "YYYY-MM-DD")} 00:00:00`; - params.endDate = `${format(val[1], "YYYY-MM-DD")} 23:59:59`; +const sectionDateChange = (val) => { + params.startDate = val.startDate; + params.endDate = val.endDate; getLocateRecord(); }; const getLocateRecord = () => { locateRecord(params).then((res) => { + newMap.clearMap(); if (res && res.length) { let list = res; - newMap.clearMap(); + newMap.setCenter([list[0].lng, list[0].lat]); newMap.polyline(list); let startIcon = newMap.newIcon({ @@ -136,6 +82,7 @@ const getLocateRecord = () => { InfoWin.open(newMap.map, marker.getPosition()); }); }); + } else { } }); };