diff --git a/apps/web-antd/src/views/sis/accessControl/device/accessControlModal.vue b/apps/web-antd/src/views/sis/accessControl/device/accessControlModal.vue index b65cafe5..1a4ab325 100644 --- a/apps/web-antd/src/views/sis/accessControl/device/accessControlModal.vue +++ b/apps/web-antd/src/views/sis/accessControl/device/accessControlModal.vue @@ -14,6 +14,8 @@ import { import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup'; import { communityTree } from '#/api/property/community'; import { modalSchema } from './data'; +import type {DeviceManageQuery} from "#/api/sis/deviceManage/model"; +import {deviceManageList} from "#/api/sis/deviceManage"; const emit = defineEmits<{ reload: [] }>(); @@ -92,15 +94,32 @@ async function handleConfirm() { } async function setupCommunitySelect() { - const areaList = await communityTree(4); + const areaList = await communityTree(3); // 选中后显示在输入框的值 即父节点 / 子节点 // addFullName(areaList, 'areaName', ' / '); const splitStr = '/'; handleNode(areaList, 'label', splitStr, function (node: any) { - if (node.level != 4) { + if (node.level != 3) { node.disabled = true; } }); + + // 加载监控 + const params: DeviceManageQuery = { + pageNum: 1, + pageSize: 500, + deviceType: 1 + }; + const res = await deviceManageList(params); + const arr = res.rows.map((item) => { + return { + label: item.deviceName, + value: item.id, + deviceIp: item.deviceIp, + deviceId: item.id, + } + }) + formApi.updateSchema([ { componentProps: () => ({ @@ -124,6 +143,19 @@ async function setupCommunitySelect() { }), fieldName: 'floorId', }, + { + componentProps: () => ({ + options: arr, + }), + fieldName: 'bindDeviceId', + }, + { + componentProps: () => ({ + options: arr, + mode: 'multiple', // 关键属性,启用多选模式 + }), + fieldName: 'devicePoint', + }, ]); } diff --git a/apps/web-antd/src/views/sis/accessControl/device/data.ts b/apps/web-antd/src/views/sis/accessControl/device/data.ts index 038e3921..235f910a 100644 --- a/apps/web-antd/src/views/sis/accessControl/device/data.ts +++ b/apps/web-antd/src/views/sis/accessControl/device/data.ts @@ -5,8 +5,6 @@ import { getDictOptions } from '#/utils/dict'; import { renderDict } from '#/utils/render'; import { communityTree } from '#/api/property/community'; import { addFullName } from '@vben/utils'; -import { deviceManageList } from '#/api/sis/deviceManage'; -import type { DeviceManageQuery } from '#/api/sis/deviceManage/model'; export const querySchema: FormSchemaGetter = () => [ { @@ -25,7 +23,7 @@ export const querySchema: FormSchemaGetter = () => [ children: 'children', }, api: async () => { - const areaList = await communityTree(4); + const areaList = await communityTree(3); addFullName(areaList, 'label', '/'); console.log(areaList); return areaList; @@ -43,7 +41,7 @@ export const querySchema: FormSchemaGetter = () => [ componentProps: { options: getDictOptions('wy_kzklx'), }, - label: '控制卡类型', + label: '接入点', }, ]; @@ -72,7 +70,7 @@ export const columns: VxeGridProps['columns'] = [ field: 'factoryCode', }, { - title: '控制卡类型', + title: '接入点', field: 'controlType', slots: { default: ({ row }) => { @@ -132,7 +130,7 @@ export const modalSchema: FormSchemaGetter = () => [ component: 'Input', }, { - label: '控制卡类型', + label: '接入点', fieldName: 'controlType', component: 'Select', componentProps: { @@ -142,22 +140,15 @@ export const modalSchema: FormSchemaGetter = () => [ rules: 'selectRequired', }, { - label: '绑定设备', + label: '人脸设备', fieldName: 'bindDeviceId', - component: 'ApiSelect', - componentProps: { - allowClear: true, - resultField: 'list', // 根据API返回结构调整 - labelField: 'deviceName', - valueField: 'id', - api: async () => { - const params: DeviceManageQuery = { - pageNum: 1, - pageSize: 500, - }; - const res = await deviceManageList(params); - return res.rows; - }, - }, + component: 'Select', + defaultValue: undefined, + }, + { + label: '监控点', + fieldName: 'devicePoint', + defaultValue: undefined, + component: 'Select', }, ]; diff --git a/apps/web-antd/src/views/sis/video/index.vue b/apps/web-antd/src/views/sis/video/index.vue index 4261a4cb..30dc9f04 100644 --- a/apps/web-antd/src/views/sis/video/index.vue +++ b/apps/web-antd/src/views/sis/video/index.vue @@ -2,7 +2,7 @@
- +
@@ -274,16 +274,16 @@ function doPlayer(nodeData: any, index: number = 0) { console.log('index=', index); if (mpegts.isSupported()) { let params = {}; - if (nodeData.nvrIp) { - params = { - videoIp: nodeData.nvrIp, - videoPort: nodeData.nvrPort, - factoryNo: nodeData.nvrFactoryNo, - account: nodeData.nvrAccount, - pwd: nodeData.nvrPwd, - channelId: nodeData.nvrChannelNo, - }; - } else { + // if (nodeData.nvrIp) { + // params = { + // videoIp: nodeData.nvrIp, + // videoPort: nodeData.nvrPort, + // factoryNo: nodeData.nvrFactoryNo, + // account: nodeData.nvrAccount, + // pwd: nodeData.nvrPwd, + // channelId: nodeData.nvrChannelNo, + // }; + // } else { params = { videoIp: nodeData.deviceIp, videoPort: nodeData.devicePort, @@ -292,7 +292,7 @@ function doPlayer(nodeData: any, index: number = 0) { pwd: nodeData.devicePwd, channelId: nodeData.channelNo, }; - } + // } addStreamProxy(params).then((res) => { const url = res.wsFlv; // 将url 绑定到 nodeData