优化设备信息

This commit is contained in:
ChenYi 2026-02-26 16:05:35 +08:00
parent f7c939d9ed
commit caf28b0ad7
5 changed files with 51 additions and 3 deletions

View File

@ -36,9 +36,9 @@ VITE_REFRESH_ROLE = true
# 后端接口地址
#VITE_APP_API_ADDRESS=http://47.110.53.196:28080
VITE_APP_API_ADDRESS=http://10.10.10.103:10500
VITE_APP_API_ADDRESS=http://10.10.10.104:10500
# websocket地址
VITE_WEBSOCKET_URL=http://10.10.10.103:10500/signalr/notification
VITE_WEBSOCKET_URL=http://10.10.10.104:10500/signalr/notification

View File

@ -220,6 +220,7 @@
"thingModelInfoManage": "ThingModelInfoManage",
"isNeedConfigDeviceModel": "IsNeedConfigDeviceModel",
"readingMode": "ReadingMode",
"deviceType": "DeviceType",
"deviceThingModelName": "ThingModelInfoManage"
},
"thingModelInfos": {

View File

@ -212,6 +212,7 @@
"deviceInfoManage": "设备管理",
"thingModelInfoManage": "物模型管理",
"isNeedConfigDeviceModel": "是否绑定设备模型",
"deviceType": "设备类型",
"readingMode": "抄读模式",
"deviceThingModelName": "设备物模型名称"
},

View File

@ -2280,7 +2280,10 @@ const toolbarActions = computed(() => [
<UserModal :title="editRow.id ? $t('common.edit') : $t('common.add')" class="w-[800px]">
<component :is="editRow.id ? EditForm : AddForm" />
</UserModal>
<CommandModal title="设备操作" class="w-[1200px]">
<CommandModal
:title="`设备操作 - ${commandRow.deviceName || commandRow.deviceAddress || ''}`"
class="w-[1200px]"
>
<div v-if="thingModelLoading" style="padding: 40px; text-align: center">
<Loading :loading="true" tip="加载物模型属性中..." />
</div>

View File

@ -131,6 +131,11 @@ export const tableSchema: any = computed((): VxeGridProps['columns'] => [
title: $t('common.BelongingProductName'),
minWidth: '150',
},
{
field: 'deviceTypeName',
title: $t('abp.deviceInfos.deviceType'),
minWidth: '150',
},
{
field: 'deviceName',
title: $t('abp.deviceInfos.deviceName'),
@ -219,6 +224,44 @@ export const addDeviceFormSchema: any = computed(() => [
message: `${$t('common.pleaseInput')}${$t('abp.deviceInfos.deviceAddress')}`,
}),
},
{
component: 'ApiSelect',
fieldName: 'deviceType',
label: $t('abp.deviceInfos.deviceType'),
componentProps: {
api: getCommonGetSelectList,
params: {
query: {
typeName: 'DeviceTypeEnum',
},
},
labelField: 'value',
valueField: 'key',
optionsPropName: 'options',
immediate: true,
allowClear: true,
placeholder: $t('common.pleaseSelect') + $t('abp.deviceInfos.deviceType'),
afterFetch: (res: any) => {
// 确保返回的是数组格式
if (Array.isArray(res)) {
return res;
}
// 如果是包装在 items 中的,提取出来
if (res && Array.isArray(res.items)) {
return res.items;
}
// 如果是包装在 data 中的,提取出来
if (res && Array.isArray(res.data)) {
return res.data;
}
// 如果都不是,返回空数组
return [];
},
},
rules: z.string().min(1, {
message: `${$t('common.pleaseSelect')}${$t('abp.deviceInfos.deviceType')}`,
}),
},
{
component: 'ApiSelect',
fieldName: 'ioTPlatform',