界面修改
This commit is contained in:
parent
8209630370
commit
0c9576039b
@ -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',
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -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',
|
||||
},
|
||||
];
|
||||
|
@ -2,7 +2,7 @@
|
||||
<Page class="h-full w-full">
|
||||
<!-- 设备分组区域 -->
|
||||
<div class="flex h-full gap-[8px]">
|
||||
<ChannelTree class="h-[83vh] w-[260px]" @check="onNodeChecked" />
|
||||
<ChannelTree class="h-[83vh] w-[300px]" @check="onNodeChecked" />
|
||||
|
||||
<!-- 设备分组区域 -->
|
||||
<div class="bg-background flex-1">
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user