界面修改

This commit is contained in:
lxj 2025-08-05 16:44:53 +08:00
parent 8209630370
commit 0c9576039b
3 changed files with 59 additions and 36 deletions

View File

@ -14,6 +14,8 @@ import {
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup'; import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { communityTree } from '#/api/property/community'; import { communityTree } from '#/api/property/community';
import { modalSchema } from './data'; import { modalSchema } from './data';
import type {DeviceManageQuery} from "#/api/sis/deviceManage/model";
import {deviceManageList} from "#/api/sis/deviceManage";
const emit = defineEmits<{ reload: [] }>(); const emit = defineEmits<{ reload: [] }>();
@ -92,15 +94,32 @@ async function handleConfirm() {
} }
async function setupCommunitySelect() { async function setupCommunitySelect() {
const areaList = await communityTree(4); const areaList = await communityTree(3);
// / // /
// addFullName(areaList, 'areaName', ' / '); // addFullName(areaList, 'areaName', ' / ');
const splitStr = '/'; const splitStr = '/';
handleNode(areaList, 'label', splitStr, function (node: any) { handleNode(areaList, 'label', splitStr, function (node: any) {
if (node.level != 4) { if (node.level != 3) {
node.disabled = true; 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([ formApi.updateSchema([
{ {
componentProps: () => ({ componentProps: () => ({
@ -124,6 +143,19 @@ async function setupCommunitySelect() {
}), }),
fieldName: 'floorId', fieldName: 'floorId',
}, },
{
componentProps: () => ({
options: arr,
}),
fieldName: 'bindDeviceId',
},
{
componentProps: () => ({
options: arr,
mode: 'multiple', //
}),
fieldName: 'devicePoint',
},
]); ]);
} }

View File

@ -5,8 +5,6 @@ import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render'; import { renderDict } from '#/utils/render';
import { communityTree } from '#/api/property/community'; import { communityTree } from '#/api/property/community';
import { addFullName } from '@vben/utils'; import { addFullName } from '@vben/utils';
import { deviceManageList } from '#/api/sis/deviceManage';
import type { DeviceManageQuery } from '#/api/sis/deviceManage/model';
export const querySchema: FormSchemaGetter = () => [ export const querySchema: FormSchemaGetter = () => [
{ {
@ -25,7 +23,7 @@ export const querySchema: FormSchemaGetter = () => [
children: 'children', children: 'children',
}, },
api: async () => { api: async () => {
const areaList = await communityTree(4); const areaList = await communityTree(3);
addFullName(areaList, 'label', '/'); addFullName(areaList, 'label', '/');
console.log(areaList); console.log(areaList);
return areaList; return areaList;
@ -43,7 +41,7 @@ export const querySchema: FormSchemaGetter = () => [
componentProps: { componentProps: {
options: getDictOptions('wy_kzklx'), options: getDictOptions('wy_kzklx'),
}, },
label: '控制卡类型', label: '接入点',
}, },
]; ];
@ -72,7 +70,7 @@ export const columns: VxeGridProps['columns'] = [
field: 'factoryCode', field: 'factoryCode',
}, },
{ {
title: '控制卡类型', title: '接入点',
field: 'controlType', field: 'controlType',
slots: { slots: {
default: ({ row }) => { default: ({ row }) => {
@ -132,7 +130,7 @@ export const modalSchema: FormSchemaGetter = () => [
component: 'Input', component: 'Input',
}, },
{ {
label: '控制卡类型', label: '接入点',
fieldName: 'controlType', fieldName: 'controlType',
component: 'Select', component: 'Select',
componentProps: { componentProps: {
@ -142,22 +140,15 @@ export const modalSchema: FormSchemaGetter = () => [
rules: 'selectRequired', rules: 'selectRequired',
}, },
{ {
label: '绑定设备', label: '人脸设备',
fieldName: 'bindDeviceId', fieldName: 'bindDeviceId',
component: 'ApiSelect', component: 'Select',
componentProps: { defaultValue: undefined,
allowClear: true, },
resultField: 'list', // 根据API返回结构调整 {
labelField: 'deviceName', label: '监控点',
valueField: 'id', fieldName: 'devicePoint',
api: async () => { defaultValue: undefined,
const params: DeviceManageQuery = { component: 'Select',
pageNum: 1,
pageSize: 500,
};
const res = await deviceManageList(params);
return res.rows;
},
},
}, },
]; ];

View File

@ -2,7 +2,7 @@
<Page class="h-full w-full"> <Page class="h-full w-full">
<!-- 设备分组区域 --> <!-- 设备分组区域 -->
<div class="flex h-full gap-[8px]"> <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"> <div class="bg-background flex-1">
@ -274,16 +274,16 @@ function doPlayer(nodeData: any, index: number = 0) {
console.log('index=', index); console.log('index=', index);
if (mpegts.isSupported()) { if (mpegts.isSupported()) {
let params = {}; let params = {};
if (nodeData.nvrIp) { // if (nodeData.nvrIp) {
params = { // params = {
videoIp: nodeData.nvrIp, // videoIp: nodeData.nvrIp,
videoPort: nodeData.nvrPort, // videoPort: nodeData.nvrPort,
factoryNo: nodeData.nvrFactoryNo, // factoryNo: nodeData.nvrFactoryNo,
account: nodeData.nvrAccount, // account: nodeData.nvrAccount,
pwd: nodeData.nvrPwd, // pwd: nodeData.nvrPwd,
channelId: nodeData.nvrChannelNo, // channelId: nodeData.nvrChannelNo,
}; // };
} else { // } else {
params = { params = {
videoIp: nodeData.deviceIp, videoIp: nodeData.deviceIp,
videoPort: nodeData.devicePort, videoPort: nodeData.devicePort,
@ -292,7 +292,7 @@ function doPlayer(nodeData: any, index: number = 0) {
pwd: nodeData.devicePwd, pwd: nodeData.devicePwd,
channelId: nodeData.channelNo, channelId: nodeData.channelNo,
}; };
} // }
addStreamProxy(params).then((res) => { addStreamProxy(params).then((res) => {
const url = res.wsFlv; const url = res.wsFlv;
// url nodeData // url nodeData