From 2cb3da7f833aecebdea1a9f90a82cb5e502c4c1a Mon Sep 17 00:00:00 2001
From: dzc <2388224167@qq.com>
Date: Wed, 6 Aug 2025 17:31:07 +0800
Subject: [PATCH] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E7=BB=91=E5=AE=9A?=
=?UTF-8?q?=E7=9B=B8=E6=9C=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/Select/SelectTreeChannel.vue | 3 +-
.../Select/SelectTreeChannelRadio.vue | 208 ++++++++++++++++++
src/components/index.ts | 2 +
src/views/area/_components/bindCameraForm.vue | 9 +
.../area/_components/bindCameraTable.vue | 5 +-
.../replay-video/replay-video-dialog.vue | 17 +-
src/views/door/doorAlarm/index.vue | 19 +-
7 files changed, 252 insertions(+), 11 deletions(-)
create mode 100644 src/components/Select/SelectTreeChannelRadio.vue
diff --git a/src/components/Select/SelectTreeChannel.vue b/src/components/Select/SelectTreeChannel.vue
index 8098da9..4535ce7 100644
--- a/src/components/Select/SelectTreeChannel.vue
+++ b/src/components/Select/SelectTreeChannel.vue
@@ -1,11 +1,10 @@
-
+ style="width: 100%" filterable default-expand-all @visible-change="(e: boolean) => e && getOptions()" />
+
+
\ No newline at end of file
diff --git a/src/components/index.ts b/src/components/index.ts
index 107f23a..0ece2ba 100644
--- a/src/components/index.ts
+++ b/src/components/index.ts
@@ -26,6 +26,7 @@ import SelectArea from "/@/components/Select/SelectArea.vue"
import SelectDevice from "/@/components/Select/SelectDevice.vue"
import SelectDutyType from "/@/components/Select/SelectDutyType.vue"
import SelectTreeChannel from "/@/components/Select/SelectTreeChannel.vue"
+import SelectTreeChannelRadio from "/@/components/Select/SelectTreeChannelRadio.vue"
import ColumnBtn from "/@/components/Column/ColumnBtn.vue"
@@ -82,6 +83,7 @@ export default {
app.component('SelectDevice', SelectDevice);
app.component('SelectDutyType', SelectDutyType);
app.component('SelectTreeChannel', SelectTreeChannel);
+ app.component('SelectTreeChannelRadio', SelectTreeChannelRadio);
app.component('ColumnBtn', ColumnBtn);
diff --git a/src/views/area/_components/bindCameraForm.vue b/src/views/area/_components/bindCameraForm.vue
index 10d328a..a817d99 100644
--- a/src/views/area/_components/bindCameraForm.vue
+++ b/src/views/area/_components/bindCameraForm.vue
@@ -19,6 +19,13 @@
+
+
+
+
+
+
+
@@ -75,6 +82,7 @@ const dataRules = ref({
name: [{ required: true, message: '房间名不能为空', trigger: 'change' }],
uniqueCode: [{ required: true, message: '唯一编码不能为空', trigger: 'change' }],
channelIds: [{ required: true, message: '设备不能为空', trigger: 'change' }],
+ channelCode: [{ required: true, message: '设备不能为空', trigger: 'change' }]
})
// 打开弹窗
@@ -144,6 +152,7 @@ const getareaHouseDeviceData = async (bindId: any, areaHouseId: any) => {
form.name = houseDeviceRes.houseName
form.uniqueCode = houseDeviceRes.uniqueCode
form.channelIds = houseDeviceRes.channelIds
+ form.channelCode = houseDeviceRes.channelCode
form.x = houseDeviceRes.x
form.y = houseDeviceRes.y
form.z = houseDeviceRes.z
diff --git a/src/views/area/_components/bindCameraTable.vue b/src/views/area/_components/bindCameraTable.vue
index a97fe31..c48f01e 100644
--- a/src/views/area/_components/bindCameraTable.vue
+++ b/src/views/area/_components/bindCameraTable.vue
@@ -47,8 +47,9 @@
- 预览
+
+ 预览
编辑
({
startTimestamp: null,
endTimestamp: null,
dialogVisible: false,
@@ -89,12 +89,21 @@ const channel = reactive({
})
// 打开弹窗
-const openDialog = async (type: string, code: string) => {
- console.log("type:", type, "code:", code);
+const openDialog = async (type: string, code: string, timeRange?: { startTime: string, endTime: string }) => {
+ console.log("type:", type, "code:", code, "timeRange:", timeRange);
if (!type || !code) return
state.type = type
state.dialogVisible = true
if (!code) return
+
+ // 如果传入了时间范围,则设置查询表单的时间
+ if (timeRange) {
+ queryForm.videoDateList = [timeRange.startTime, timeRange.endTime]
+ // 同时设置时间戳
+ state.startTimestamp = Math.floor(new Date(timeRange.startTime).getTime() / 1000)
+ state.endTimestamp = Math.floor(new Date(timeRange.endTime).getTime() / 1000)
+ }
+
// 设备详情
if (type === "device") {
await getdeviceManageData(code);
@@ -202,7 +211,7 @@ const playRecord = async (channelCode?: string) => {
}
// 获取回放列表
const recordRes = await AlarmReplayVideoListApi.defaultReplayVideoList(_data)
- if (recordRes.code != 0) continue
+ if (recordRes.code != 0 || !recordRes.data) continue
const videoRes = await AlarmReplayVideoListApi.getRtspReplayVideo(_data)
if (videoRes.code != 0 || !videoRes.data) continue
console.log("data:", videoRes.data);
diff --git a/src/views/door/doorAlarm/index.vue b/src/views/door/doorAlarm/index.vue
index 3db505e..ffc9005 100644
--- a/src/views/door/doorAlarm/index.vue
+++ b/src/views/door/doorAlarm/index.vue
@@ -112,11 +112,11 @@
-
+
-
+
回放
@@ -199,6 +199,19 @@ function getDictByValue(value: any, tag: any) {
return target.label
}
}
+function openReplayDialog(row: any) {
+ const dateTime = row.swingTime
+ if (!dateTime) return
+ // 获取dateTime前后30秒的时间
+ const baseTime = new Date(dateTime)
+ const startDateTime = new Date(baseTime.getTime() - 30 * 1000)
+ const endDateTime = new Date(baseTime.getTime() + 30 * 1000)
+
+ const startTime = parseTime(startDateTime, '{y}-{m}-{d} {h}:{i}:{s}')
+ const endTime = parseTime(endDateTime, '{y}-{m}-{d} {h}:{i}:{s}')
+
+ replayVideoDialogRef.value.openDialog('channel', row.channelCode, { startTime, endTime })
+}
\ No newline at end of file