diff --git a/apps/web-antd/src/locales/langs/zh-CN/abp.json b/apps/web-antd/src/locales/langs/zh-CN/abp.json index d97791b..f18d048 100644 --- a/apps/web-antd/src/locales/langs/zh-CN/abp.json +++ b/apps/web-antd/src/locales/langs/zh-CN/abp.json @@ -218,8 +218,8 @@ "IoTDataType": "数据类型", "DataBaseName": "所属数据库", "DeviceType": "设备类型", - "Timestamps": "时标(纳秒)", - "FormattedTimestamps": "时标", + "Timestamps": "UTC时标(纳秒)", + "FormattedTimestamps": "本地时间", "DevicePath": "设备路径", "DeviceAddress": "设备地址" }, diff --git a/apps/web-antd/src/views/devicemanagement/deviceinfo/index.vue b/apps/web-antd/src/views/devicemanagement/deviceinfo/index.vue index 1e03621..7b18342 100644 --- a/apps/web-antd/src/views/devicemanagement/deviceinfo/index.vue +++ b/apps/web-antd/src/views/devicemanagement/deviceinfo/index.vue @@ -186,6 +186,11 @@ async function onEdit(record: any) { // 根据平台类型设置表单值 const formValues = { ...record }; + // 确保ioTPlatform是字符串格式,因为ApiSelect组件的valueField是'key' + if (formValues.ioTPlatform !== undefined && formValues.ioTPlatform !== null) { + formValues.ioTPlatform = String(formValues.ioTPlatform); + } + if (record.ioTPlatform === 2 || record.ioTPlatform === '2') { // OneNET平台 formValues.oneNETAccountId = record.ioTPlatformAccountId; diff --git a/apps/web-antd/src/views/iotdbdatamanagement/ctwingLog/index.vue b/apps/web-antd/src/views/iotdbdatamanagement/ctwingLog/index.vue index dc1b549..95fec79 100644 --- a/apps/web-antd/src/views/iotdbdatamanagement/ctwingLog/index.vue +++ b/apps/web-antd/src/views/iotdbdatamanagement/ctwingLog/index.vue @@ -136,11 +136,9 @@ const formOptions: VbenFormProps = { // 当任何相关字段发生变化时,刷新表格数据 const relevantFields = new Set([ 'DeviceId', - 'DeviceType', 'EndCreationTime', 'IoTDataType', 'StartCreationTime', - 'DataBaseName', ]); const hasRelevantChange = changedFields.some((field) => relevantFields.has(field), @@ -183,9 +181,7 @@ const gridOptions: VxeGridProps = { const currentFormValues = gridApi?.formApi ? await gridApi.formApi.getValues() : {}; // 获取选中的设备信息 - let deviceId = currentFormValues.DeviceId || ''; - let dataBaseName = ''; - const deviceType = currentFormValues.DeviceType || ''; + let deviceAddress = currentFormValues.DeviceId || ''; // 优先使用选中的设备信息 const deviceInfo = @@ -195,28 +191,17 @@ const gridOptions: VxeGridProps = { : null); if (deviceInfo) { - dataBaseName = deviceInfo.businessSystemName || ''; - // 根据设备类型获取正确的 id - if (Number(deviceType) === 10) { - // 集中器类型使用 focusId - deviceId = deviceInfo.focusId || deviceId; - } else { - // 其他设备类型使用 meterId - deviceId = deviceInfo.meterId || deviceId; - } + deviceAddress = deviceInfo.deviceAddress || deviceAddress; } // 构建查询参数 const queryParams = { pageIndex: page.currentPage, pageSize: page.pageSize, SearchKeyword: currentFormValues.SearchKeyword || '', - DeviceType: deviceType, IoTDataType: currentFormValues.IoTDataType || '', - DeviceId: deviceId, - DataBaseName: dataBaseName || currentFormValues.DataBaseName || '', + DeviceId: deviceAddress, // 直接使用设备地址 StartCreationTime: formatDate(currentFormValues.StartCreationTime), EndCreationTime: formatDate(currentFormValues.EndCreationTime), - FocusAddress: currentFormValues.FocusAddress || '', }; if (DeviceType) queryParams.DeviceType = DeviceType; diff --git a/apps/web-antd/src/views/iotdbdatamanagement/ctwingLog/schema.ts b/apps/web-antd/src/views/iotdbdatamanagement/ctwingLog/schema.ts index d5b4612..59d8502 100644 --- a/apps/web-antd/src/views/iotdbdatamanagement/ctwingLog/schema.ts +++ b/apps/web-antd/src/views/iotdbdatamanagement/ctwingLog/schema.ts @@ -8,73 +8,6 @@ import { getCommonGetSelectList } from '#/api-client'; import { $t } from '#/locales'; export const querySchema = computed(() => [ - { - component: 'ApiSelect', - fieldName: 'DataBaseName', - label: $t('abp.IoTDBBase.DataBaseName'), - componentProps: { - api: getCommonGetSelectList, - params: { - query: { - typeName: 'BusinessSystemEnum' - - }, - }, - labelField: 'secondValue', - valueField: 'value', - optionsPropName: 'options', - immediate: true, - 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 []; - }, - }, - }, - { - component: 'ApiSelect', - fieldName: 'DeviceType', - label: $t('abp.IoTDBBase.DeviceType'), - componentProps: { - api: getCommonGetSelectList, - params: { - query: { - typeName: 'MeterTypeEnum' - }, - }, - labelField: 'value', - valueField: 'key', - optionsPropName: 'options', - immediate: true, - 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 []; - }, - }, - }, { component: 'ApiSelect', fieldName: 'IoTDataType', @@ -83,9 +16,7 @@ export const querySchema = computed(() => [ api: getCommonGetSelectList, params: { query: { - input: { - typeName: 'IoTDBDataTypeConst', - }, + typeName: 'IoTDBDataTypeConst', }, }, labelField: 'value', @@ -161,12 +92,7 @@ export const tableSchema: any = computed((): VxeGridProps['columns'] => [ return cellValue ? dayjs(cellValue).format('YYYY-MM-DD HH:mm:ss') : ''; }, }, - { - field: 'deviceType', - title: $t('abp.IoTDBBase.DeviceType'), - minWidth: 150, - slots: {}, - }, + { field: 'ioTDataType', title: $t('abp.IoTDBBase.IoTDataType'), diff --git a/apps/web-antd/src/views/iotdbdatamanagement/deviceData/DeviceSelect.vue b/apps/web-antd/src/views/iotdbdatamanagement/deviceData/DeviceSelect.vue index 7c4775f..f16a446 100644 --- a/apps/web-antd/src/views/iotdbdatamanagement/deviceData/DeviceSelect.vue +++ b/apps/web-antd/src/views/iotdbdatamanagement/deviceData/DeviceSelect.vue @@ -59,8 +59,8 @@ const fetchData = async () => { if (data?.items) { options.value = data.items.map((item) => ({ - label: item.meterName, - value: item.id, + label: `${item.deviceName || item.deviceAddress} (${item.deviceAddress})`, + value: item.deviceAddress, // 使用设备地址作为值 ...item, // 保留完整数据 })); total.value = data.totalCount || 0; diff --git a/apps/web-antd/src/views/iotdbdatamanagement/onenetLog/index.vue b/apps/web-antd/src/views/iotdbdatamanagement/onenetLog/index.vue index 6b9d8e6..75ab8b6 100644 --- a/apps/web-antd/src/views/iotdbdatamanagement/onenetLog/index.vue +++ b/apps/web-antd/src/views/iotdbdatamanagement/onenetLog/index.vue @@ -135,11 +135,9 @@ const formOptions: VbenFormProps = { // 当任何相关字段发生变化时,刷新表格数据 const relevantFields = new Set([ 'DeviceId', - 'DeviceType', 'EndCreationTime', 'IoTDataType', 'StartCreationTime', - 'DataBaseName', ]); const hasRelevantChange = changedFields.some((field) => relevantFields.has(field), @@ -181,9 +179,7 @@ const gridOptions: VxeGridProps = { const currentFormValues = gridApi?.formApi ? await gridApi.formApi.getValues() : {}; // 获取选中的设备信息 - let deviceId = currentFormValues.DeviceId || ''; - let dataBaseName = ''; - const deviceType = currentFormValues.DeviceType || ''; + let deviceAddress = currentFormValues.DeviceId || ''; // 优先使用选中的设备信息 const deviceInfo = @@ -193,15 +189,7 @@ const gridOptions: VxeGridProps = { : null); if (deviceInfo) { - dataBaseName = deviceInfo.businessSystemName || ''; - // 根据设备类型获取正确的 id - if (Number(deviceType) === 10) { - // 集中器类型使用 focusId - deviceId = deviceInfo.focusId || deviceId; - } else { - // 其他设备类型使用 meterId - deviceId = deviceInfo.meterId || deviceId; - } + deviceAddress = deviceInfo.deviceAddress || deviceAddress; } // 构建查询参数 @@ -209,10 +197,8 @@ const gridOptions: VxeGridProps = { pageIndex: page.currentPage, pageSize: page.pageSize, SearchKeyword: currentFormValues.SearchKeyword || '', - DeviceType: deviceType, IoTDataType: currentFormValues.IoTDataType || '', - DeviceId: deviceId, - DataBaseName: dataBaseName || currentFormValues.DataBaseName || '', + DeviceId: deviceAddress, // 直接使用设备地址 StartCreationTime: formatDate(currentFormValues.StartCreationTime), EndCreationTime: formatDate(currentFormValues.EndCreationTime), }; diff --git a/apps/web-antd/src/views/iotdbdatamanagement/onenetLog/schema.ts b/apps/web-antd/src/views/iotdbdatamanagement/onenetLog/schema.ts index 80030f8..153a79e 100644 --- a/apps/web-antd/src/views/iotdbdatamanagement/onenetLog/schema.ts +++ b/apps/web-antd/src/views/iotdbdatamanagement/onenetLog/schema.ts @@ -8,72 +8,6 @@ import { getCommonGetSelectList } from '#/api-client'; import { $t } from '#/locales'; export const querySchema = computed(() => [ - { - component: 'ApiSelect', - fieldName: 'DataBaseName', - label: $t('abp.IoTDBBase.DataBaseName'), - componentProps: { - api: getCommonGetSelectList, - params: { - query: { - typeName: 'BusinessSystemEnum', - }, - }, - labelField: 'secondValue', - valueField: 'value', - optionsPropName: 'options', - immediate: true, - 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 []; - }, - }, - }, - { - component: 'ApiSelect', - fieldName: 'DeviceType', - label: $t('abp.IoTDBBase.DeviceType'), - componentProps: { - api: getCommonGetSelectList, - params: { - query: { - typeName: 'MeterTypeEnum', - }, - }, - labelField: 'value', - valueField: 'key', - optionsPropName: 'options', - immediate: true, - 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 []; - }, - }, - }, { component: 'ApiSelect', fieldName: 'IoTDataType', @@ -158,12 +92,7 @@ export const tableSchema: any = computed((): VxeGridProps['columns'] => [ return cellValue ? dayjs(cellValue).format('YYYY-MM-DD HH:mm:ss') : ''; }, }, - { - field: 'deviceType', - title: $t('abp.IoTDBBase.DeviceType'), - minWidth: '120', - slots: {}, - }, + { field: 'ioTDataType', title: $t('abp.IoTDBBase.IoTDataType'), diff --git a/apps/web-antd/src/views/iotdbdatamanagement/telemetryLog/index.vue b/apps/web-antd/src/views/iotdbdatamanagement/telemetryLog/index.vue index d1547eb..03b0d5c 100644 --- a/apps/web-antd/src/views/iotdbdatamanagement/telemetryLog/index.vue +++ b/apps/web-antd/src/views/iotdbdatamanagement/telemetryLog/index.vue @@ -58,9 +58,6 @@ const [Grid] = useVbenVxeGrid({ formOptions, gridOptions });