From d88c8a73dc62fbb83b9079b1bb2487d02bdddd7e Mon Sep 17 00:00:00 2001 From: zcxlsm Date: Sun, 7 Sep 2025 10:32:36 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(analytics):=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=BB=AA=E8=A1=A8=E7=9B=98=E9=80=9A=E8=A1=8C=E9=87=8F=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/dashboard/analytics/index.vue | 37 ++++++++++++++++++- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/apps/web-antd/src/views/dashboard/analytics/index.vue b/apps/web-antd/src/views/dashboard/analytics/index.vue index f330e43d..a0c9d5ab 100644 --- a/apps/web-antd/src/views/dashboard/analytics/index.vue +++ b/apps/web-antd/src/views/dashboard/analytics/index.vue @@ -19,11 +19,12 @@ import { getStatisticsCurrDay, getStatistics, } from '#/api/analytics/index'; +import { getVisitorList } from '#/api/property/resident/passRecordManagement'; const overviewItems = ref([ { icon: SvgCardIcon, - title: '今日访客量', - totalTitle: '总访客量', + title: '今日通行量', + totalTitle: '总通行量', totalValue: 0, value: 0, }, @@ -73,6 +74,37 @@ const handleDateChange = (date: any) => { } }; +// 通行量 +async function getPersonCount() { + const date = new Date(); + const nowDate = date + .toLocaleDateString('zh-CN', { + year: 'numeric', + month: '2-digit', + day: '2-digit', + }) + .replace(/\//g, '-'); + + const historyData = { + pageNum: 1, + pageSize: 10, + begTime: '2025-09-01', + endTime: nowDate, + }; + + const todayData = { + pageNum: 1, + pageSize: 10, + begTime: nowDate, + endTime: nowDate, + }; + + const historyTotal = await getVisitorList(historyData); + const todayTotal = await getVisitorList(todayData); + overviewItems.value[0].totalValue = historyTotal.total; + overviewItems.value[0].value = todayTotal.total; +} + // 工单数量 async function getIndex() { const res = await getIndexCount(); @@ -146,6 +178,7 @@ async function getStatisticsCount() { onMounted(() => { getIndex(); getCarCount(); + getPersonCount(); getStatisticsCurrDayCount(); getStatisticsCount(); }); From d24ec29fcc639bed747804e7dd18e1a5fbbb15a3 Mon Sep 17 00:00:00 2001 From: zcxlsm Date: Sun, 7 Sep 2025 11:18:18 +0800 Subject: [PATCH 2/3] refactor(web-antd): 1 --- apps/web-antd/src/store/notify.ts | 2 -- .../electricEnergy/elctricitySituation/index.vue | 3 --- 2 files changed, 5 deletions(-) diff --git a/apps/web-antd/src/store/notify.ts b/apps/web-antd/src/store/notify.ts index 00e81fa4..0a5fa553 100644 --- a/apps/web-antd/src/store/notify.ts +++ b/apps/web-antd/src/store/notify.ts @@ -63,8 +63,6 @@ export const useNotifyStore = defineStore( watch(data, (message) => { if (!message) return - console.log(`接收到消息: ${message}`) - try { // 尝试解析JSON const obj = JSON.parse(message) diff --git a/apps/web-antd/src/views/property/energyManagement/electricEnergy/elctricitySituation/index.vue b/apps/web-antd/src/views/property/energyManagement/electricEnergy/elctricitySituation/index.vue index 767526bb..35da0d07 100644 --- a/apps/web-antd/src/views/property/energyManagement/electricEnergy/elctricitySituation/index.vue +++ b/apps/web-antd/src/views/property/energyManagement/electricEnergy/elctricitySituation/index.vue @@ -19,18 +19,15 @@ onMounted(() => { () => notifyStore.sseList, (val) => { const latestMessage = val[val.length - 1]; - try { // 尝试解析消息内容 const parsedMessage = JSON.parse(latestMessage); - console.log('收到sse消息:', parsedMessage); if (parsedMessage.type === 'meter') { // 根据消息内容执行相应操作 handleSSEMessage(parsedMessage); } } catch (e) { console.log('收到非JSON消息:', latestMessage); - // 处理非JSON格式消息 } }, { deep: true }, From e1917e9540f2a670372c3114400e2eb729526b21 Mon Sep 17 00:00:00 2001 From: 15683799673 Date: Mon, 8 Sep 2025 01:43:41 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E5=9B=9E=E6=94=BE=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sis/video/{ => playback}/channel-tree.vue | 0 .../views/sis/video/{ => playback}/data.ts | 0 .../views/sis/video/{ => playback}/index.vue | 112 ++--- .../src/views/sis/video/playback/process.vue | 386 ++++++++++++++++++ apps/web-antd/tsconfig.json | 1 + 5 files changed, 449 insertions(+), 50 deletions(-) rename apps/web-antd/src/views/sis/video/{ => playback}/channel-tree.vue (100%) rename apps/web-antd/src/views/sis/video/{ => playback}/data.ts (100%) rename apps/web-antd/src/views/sis/video/{ => playback}/index.vue (83%) create mode 100644 apps/web-antd/src/views/sis/video/playback/process.vue diff --git a/apps/web-antd/src/views/sis/video/channel-tree.vue b/apps/web-antd/src/views/sis/video/playback/channel-tree.vue similarity index 100% rename from apps/web-antd/src/views/sis/video/channel-tree.vue rename to apps/web-antd/src/views/sis/video/playback/channel-tree.vue diff --git a/apps/web-antd/src/views/sis/video/data.ts b/apps/web-antd/src/views/sis/video/playback/data.ts similarity index 100% rename from apps/web-antd/src/views/sis/video/data.ts rename to apps/web-antd/src/views/sis/video/playback/data.ts diff --git a/apps/web-antd/src/views/sis/video/index.vue b/apps/web-antd/src/views/sis/video/playback/index.vue similarity index 83% rename from apps/web-antd/src/views/sis/video/index.vue rename to apps/web-antd/src/views/sis/video/playback/index.vue index 82f64f8b..587f013a 100644 --- a/apps/web-antd/src/views/sis/video/index.vue +++ b/apps/web-antd/src/views/sis/video/playback/index.vue @@ -14,7 +14,7 @@
-
+
-
-
- - - - +
+
+ +
+ +
+
+
+
+ +
+ +
+ + + + + + + + + + +
+
+
@@ -67,17 +82,15 @@ import { onMounted, onUnmounted, ref, toRaw } from 'vue'; import { Loading, Page } from '@vben/common-ui'; import ChannelTree from './channel-tree.vue'; +import Process from './process.vue'; import mpegts from 'mpegts.js'; -import { message } from 'ant-design-vue'; +import { DatePicker, message } from 'ant-design-vue'; import { addStreamProxy } from '#/api/sis/stream'; -import { - Svg16FrameIcon, - Svg1FrameIcon, - Svg4FrameIcon, - Svg9FrameIcon, -} from '@vben/icons'; import { checkHEVCSupport } from '#/utils/video'; import type { AddStreamProxyResult } from '#/api/sis/stream/model'; +import { CaretRightOutlined, PauseCircleOutlined } from '@ant-design/icons-vue'; +import type { Dayjs } from 'dayjs'; +import dayjs from 'dayjs'; const selected = 'selected'; @@ -107,12 +120,18 @@ const currentSelectPlayerIndex = ref(0); const playerList: any[] = []; // 播放器loading const playerLoading = ref([]); - // 当前选择播放器的key const currentSelectKey = ref(''); // 当前所有的播放设备key const selectKeys = ref([]); +const playering = ref(true); +const playDate = ref(); + +function onPlayerBtnClick() { + playering.value = !playering.value; +} + function playerSelect(index: number) { currentSelectPlayerIndex.value = index; const player = playerList[index]; @@ -435,11 +454,20 @@ function loading(index: number, cmd: Number = 0) { playerLoading.value = loadinArr; } +const processDate = ref(''); let isSupportH265 = false; onMounted(() => { // 检测浏览器是否支持h265 isSupportH265 = checkHEVCSupport(); - setInterval(catchUp, 120000); + // setInterval(catchUp, 120000); + // 初始化当前日期 + const now = dayjs(); + playDate.value = now; + + processDate.value = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'); + setInterval(() => { + processDate.value = dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'); + }, 1000); }); onUnmounted(() => { @@ -447,20 +475,6 @@ onUnmounted(() => { closePlayer(i); } }); - -function catchUp() { - playerList.forEach((playerData) => { - if (playerData) { - const { player, el } = playerData; - const end = player.buffered.end(player.buffered.length - 1); - const diff = end - el.currentTime; - if (diff > 2) { - // 如果延迟超过2秒 - el.currentTime = end - 0.5; // 跳转到接近直播点 - } - } - }); -} diff --git a/apps/web-antd/src/views/sis/video/playback/process.vue b/apps/web-antd/src/views/sis/video/playback/process.vue new file mode 100644 index 00000000..52d9ced7 --- /dev/null +++ b/apps/web-antd/src/views/sis/video/playback/process.vue @@ -0,0 +1,386 @@ + + + + + diff --git a/apps/web-antd/tsconfig.json b/apps/web-antd/tsconfig.json index d45e3d7a..40a9fdef 100644 --- a/apps/web-antd/tsconfig.json +++ b/apps/web-antd/tsconfig.json @@ -3,6 +3,7 @@ "extends": "@vben/tsconfig/web-app.json", "compilerOptions": { "baseUrl": ".", + "allowJs": true, "paths": { "#/*": [ "./src/*"