diff --git a/src/api/area/areaHouse.ts b/src/api/area/areaHouse.ts
index 46ae211..86e0908 100644
--- a/src/api/area/areaHouse.ts
+++ b/src/api/area/areaHouse.ts
@@ -1,6 +1,17 @@
import request from "/@/utils/request"
+/**
+ * 房间绑定设备
+ */
+export function houseDeviceList(data: any) {
+ return request({
+ url: '/admin/areaHouse/houseDeviceList',
+ method: 'post',
+ data
+ })
+}
+
/**
* 房间绑定设备
*/
diff --git a/src/api/device/deviceManage.ts b/src/api/device/deviceManage.ts
index 7a2542d..e7b63c6 100644
--- a/src/api/device/deviceManage.ts
+++ b/src/api/device/deviceManage.ts
@@ -1,13 +1,21 @@
import request from "/@/utils/request"
+export function channelTree(query: any) {
+ return request({
+ url: '/admin/deviceManage/channelTree',
+ method: 'post',
+ data: query
+ })
+}
+
export function cameraPage(query: any) {
return request({
url: '/admin/deviceManage/cameraPage',
method: 'post',
params: {
- current: query.current,
- size: query.size,
- },
+ current: query.current,
+ size: query.size,
+ },
data: query
})
}
@@ -18,9 +26,9 @@ export function fetchList(query: any) {
url: '/admin/deviceManage/page',
method: 'post',
params: {
- current: query.current,
- size: query.size,
- },
+ current: query.current,
+ size: query.size,
+ },
data: query
})
}
@@ -30,9 +38,9 @@ export function select(query: any) {
url: '/admin/deviceManage/select',
method: 'post',
params: {
- current: query.current,
- size: query.size,
- },
+ current: query.current,
+ size: query.size,
+ },
data: query
})
}
@@ -53,6 +61,14 @@ export function getObj(id?: string) {
})
}
+export function getByCode(params: any) {
+ return request({
+ url: '/admin/deviceManage/getByCode',
+ method: 'get',
+ params: params
+ })
+}
+
export function delObjs(ids?: Object) {
return request({
url: '/admin/deviceManage',
diff --git a/src/components/Select/SelectTreeChannel.vue b/src/components/Select/SelectTreeChannel.vue
new file mode 100644
index 0000000..57625a0
--- /dev/null
+++ b/src/components/Select/SelectTreeChannel.vue
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/index.ts b/src/components/index.ts
index 0162502..107f23a 100644
--- a/src/components/index.ts
+++ b/src/components/index.ts
@@ -25,6 +25,7 @@ import TagUserStatus from "/@/components/Tag/TagUserStatus.vue"
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 ColumnBtn from "/@/components/Column/ColumnBtn.vue"
@@ -80,6 +81,7 @@ export default {
app.component('SelectArea', SelectArea);
app.component('SelectDevice', SelectDevice);
app.component('SelectDutyType', SelectDutyType);
+ app.component('SelectTreeChannel', SelectTreeChannel);
app.component('ColumnBtn', ColumnBtn);
diff --git a/src/views/area/_components/bindCameraForm.vue b/src/views/area/_components/bindCameraForm.vue
index 106075f..ae6b4e3 100644
--- a/src/views/area/_components/bindCameraForm.vue
+++ b/src/views/area/_components/bindCameraForm.vue
@@ -14,10 +14,28 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -49,14 +67,14 @@ const form = reactive({
name: '',
id: '',
areaHouseId: '',
- deviceId: '',
+ channelIds: [],
});
// 定义校验规则
const dataRules = ref({
name: [{ required: true, message: '房间名不能为空', trigger: 'change' }],
uniqueCode: [{ required: true, message: '唯一编码不能为空', trigger: 'change' }],
- deviceId: [{ required: true, message: '设备不能为空', trigger: 'change' }],
+ channelIds: [{ required: true, message: '设备不能为空', trigger: 'change' }],
})
// 打开弹窗
@@ -71,6 +89,8 @@ const openDialog = (areaHouseId: string, bindId?: string) => {
// 获取areaHouse信息
if (areaHouseId) form.areaHouseId = areaHouseId
getareaHouseDeviceData(bindId, areaHouseId)
+ // 查询设备通道信息
+ getHouseDeviceList();
};
// 提交
@@ -79,7 +99,11 @@ const onSubmit = async () => {
if (!valid) return false;
try {
loading.value = true;
- form.id ? await AreaHouseApi.editBindDevice(form) : await AreaHouseApi.bindDevice(form);
+ const _data = { ...form }
+ if (_data.channelIds && _data.channelIds.length) {
+ _data.channelIds = _data.channelIds.join(',')
+ }
+ form.id ? await AreaHouseApi.editBindDevice(_data) : await AreaHouseApi.bindDevice(_data);
useMessage().success(form.id ? '修改成功' : '添加成功');
visible.value = false;
emit('refresh');
@@ -91,6 +115,23 @@ const onSubmit = async () => {
};
+const getHouseDeviceList = async () => {
+ try {
+ const _params = {
+ areaHouseId: form.areaHouseId
+ }
+ const { data } = await AreaHouseApi.houseDeviceList(_params)
+ form.channelIds = []
+ if (data && data.length) {
+ form.channelIds = data.map((item: any) => item.channelCode)
+ }
+ } catch (error: any) {
+ console.error(error);
+ } finally {
+
+ }
+}
+
// 初始化表单数据
const getareaHouseDeviceData = async (bindId: any, areaHouseId: any) => {
// 获取数据
@@ -102,7 +143,10 @@ const getareaHouseDeviceData = async (bindId: any, areaHouseId: any) => {
if (houseDeviceRes) {
form.name = houseDeviceRes.houseName
form.uniqueCode = houseDeviceRes.uniqueCode
- form.deviceId = houseDeviceRes.deviceId
+ form.channelIds = houseDeviceRes.channelIds
+ form.x = houseDeviceRes.x
+ form.y = houseDeviceRes.y
+ form.z = houseDeviceRes.z
}
} else if (areaHouseId) {
const { data: houseRes } = await AreaHouseApi.getObj(areaHouseId)
diff --git a/src/views/area/_components/bindCameraTable.vue b/src/views/area/_components/bindCameraTable.vue
index 697ccad..a97fe31 100644
--- a/src/views/area/_components/bindCameraTable.vue
+++ b/src/views/area/_components/bindCameraTable.vue
@@ -12,17 +12,20 @@
@sort-change="sortChangeHandle">
-
+
-
+ {{ row.uniqueCode }}
+
+
+
+
+
diff --git a/src/views/car/carAccess/index.vue b/src/views/car/carAccess/index.vue
index 43680d8..aafd73c 100644
--- a/src/views/car/carAccess/index.vue
+++ b/src/views/car/carAccess/index.vue
@@ -77,15 +77,6 @@
-
-
-
- 编辑
- 删除
-
-
diff --git a/src/views/car/carAlarm/index.vue b/src/views/car/carAlarm/index.vue
index 617fe53..ae3d1d8 100644
--- a/src/views/car/carAlarm/index.vue
+++ b/src/views/car/carAlarm/index.vue
@@ -81,9 +81,24 @@
+
+
+
+ 回放
+
+
+ 回放
+
+
+
+
+
+
@@ -95,9 +110,14 @@ import { parseTime } from "/@/utils/formatTime"
import * as CarAccessApi from "/@/api/car/carAccess";
+const ReplayVideoDialog = defineAsyncComponent(() => import("../../device/components/replay-video/replay-video-dialog.vue"));
+
+const replayVideoDialogRef = ref()
+
// 搜索变量
const queryRef = ref()
const showSearch = ref(true)
+
// 多选变量
const selectObjs = ref([]) as any
const multiple = ref(true)
diff --git a/src/views/device/components/preview-video/index.vue b/src/views/device/components/preview-video/index.vue
index 466b305..7415cd2 100644
--- a/src/views/device/components/preview-video/index.vue
+++ b/src/views/device/components/preview-video/index.vue
@@ -1,5 +1,5 @@
-
+
-
+
({})
@@ -88,13 +89,18 @@ const channel = reactive({
})
// 打开弹窗
-const openDialog = async (id: string) => {
+const openDialog = async (type: string, code: string) => {
+ console.log("type:", type, "code:", code);
+ if (!type || !code) return
+ state.type = type
state.dialogVisible = true
- if (!id) return
+ if (!code) return
// 设备详情
- await getdeviceManageData(id);
+ if (type === "device") {
+ await getdeviceManageData(code);
+ }
// 设备通道详情
- await getDeviceChannelList()
+ await getDeviceChannelList(code)
}
const handleClose = () => {
@@ -116,11 +122,11 @@ const handleNodeClick = (e: any) => {
}
// 初始化表单数据
-const getdeviceManageData = async (id: string) => {
+const getdeviceManageData = async (deviceCode: string) => {
// 获取数据
state.loading = true
try {
- const { data, code } = await DeviceManageApi.getObj(id)
+ const { data, code } = await DeviceManageApi.getByCode({ code: deviceCode })
if (code != 0) throw new Error()
Object.assign(detail, data)
} catch (error: any) {
@@ -132,11 +138,24 @@ const getdeviceManageData = async (id: string) => {
};
// 查询通道列表
-const getDeviceChannelList = async () => {
+const getDeviceChannelList = async (codeStr: any) => {
state.treeLoading = true
try {
- const { data, code } = await DeviceChannelApi.list({ deviceCode: detail.deviceCode })
+ const _data: any = {}
+ if (state.type == "device") {
+ _data.deviceCode = detail.deviceCode
+ }
+ if (state.type == "channel") {
+ _data.channelCode = codeStr
+ }
+ const { data, code } = await DeviceChannelApi.list(_data)
if (code != 0) throw new Error()
+
+ if (!data || !data.length) {
+ useMessage().error("查询不到设备通道")
+ return
+ }
+
channel.treeList = data
channel.list = data
// 处理树
diff --git a/src/views/device/deviceCamera/index.vue b/src/views/device/deviceCamera/index.vue
index cdac3ff..994c1eb 100644
--- a/src/views/device/deviceCamera/index.vue
+++ b/src/views/device/deviceCamera/index.vue
@@ -80,7 +80,7 @@
预览
回放
+ @click="replayVideoDialogRef.openDialog('device', row.deviceCode)">回放
编辑
+
+
+
+ 回放
+
+
+
+
+
+
@@ -128,9 +139,13 @@ import { parseTime } from "/@/utils/formatTime"
import * as DoorRecordApi from "/@/api/door/doorRecord";
+const ReplayVideoDialog = defineAsyncComponent(() => import("../../device/components/replay-video/replay-video-dialog.vue"));
+
// 定义查询字典
const { dh_card_status, dh_card_type, dh_enter_or_exit, door_alarm_type, dh_door_open_type } = useDict("dh_card_status", "dh_card_type", "dh_enter_or_exit", "door_alarm_type", "dh_door_open_type")
+const replayVideoDialogRef = ref()
+
// 定义变量内容
const formDialogRef = ref()