Compare commits

...

2 Commits

Author SHA1 Message Date
ChenYi
6c1fdb7adb 设备数据查询优化 2025-07-31 17:34:07 +08:00
ChenYi
67261b19c9 优化平台日志 2025-07-31 16:09:52 +08:00
12 changed files with 55 additions and 299 deletions

View File

@ -218,8 +218,8 @@
"IoTDataType": "数据类型", "IoTDataType": "数据类型",
"DataBaseName": "所属数据库", "DataBaseName": "所属数据库",
"DeviceType": "设备类型", "DeviceType": "设备类型",
"Timestamps": "时标(纳秒)", "Timestamps": "UTC时标(纳秒)",
"FormattedTimestamps": "时标", "FormattedTimestamps": "本地时间",
"DevicePath": "设备路径", "DevicePath": "设备路径",
"DeviceAddress": "设备地址" "DeviceAddress": "设备地址"
}, },

View File

@ -186,6 +186,11 @@ async function onEdit(record: any) {
// //
const formValues = { ...record }; const formValues = { ...record };
// ioTPlatformApiSelectvalueField'key'
if (formValues.ioTPlatform !== undefined && formValues.ioTPlatform !== null) {
formValues.ioTPlatform = String(formValues.ioTPlatform);
}
if (record.ioTPlatform === 2 || record.ioTPlatform === '2') { if (record.ioTPlatform === 2 || record.ioTPlatform === '2') {
// OneNET // OneNET
formValues.oneNETAccountId = record.ioTPlatformAccountId; formValues.oneNETAccountId = record.ioTPlatformAccountId;

View File

@ -104,6 +104,8 @@ export const addDeviceFormSchema: any = computed(() => [
valueField: 'key', valueField: 'key',
optionsPropName: 'options', optionsPropName: 'options',
immediate: true, immediate: true,
allowClear: true,
placeholder: $t('common.pleaseSelect') + $t('abp.deviceInfos.ioTPlatform'),
afterFetch: (res: any) => { afterFetch: (res: any) => {
// 确保返回的是数组格式 // 确保返回的是数组格式
if (Array.isArray(res)) { if (Array.isArray(res)) {

View File

@ -136,11 +136,9 @@ const formOptions: VbenFormProps = {
// //
const relevantFields = new Set([ const relevantFields = new Set([
'DeviceId', 'DeviceId',
'DeviceType',
'EndCreationTime', 'EndCreationTime',
'IoTDataType', 'IoTDataType',
'StartCreationTime', 'StartCreationTime',
'DataBaseName',
]); ]);
const hasRelevantChange = changedFields.some((field) => const hasRelevantChange = changedFields.some((field) =>
relevantFields.has(field), relevantFields.has(field),
@ -183,9 +181,7 @@ const gridOptions: VxeGridProps<any> = {
const currentFormValues = gridApi?.formApi ? await gridApi.formApi.getValues() : {}; const currentFormValues = gridApi?.formApi ? await gridApi.formApi.getValues() : {};
// //
let deviceId = currentFormValues.DeviceId || ''; let deviceAddress = currentFormValues.DeviceId || '';
let dataBaseName = '';
const deviceType = currentFormValues.DeviceType || '';
// 使 // 使
const deviceInfo = const deviceInfo =
@ -195,28 +191,17 @@ const gridOptions: VxeGridProps<any> = {
: null); : null);
if (deviceInfo) { if (deviceInfo) {
dataBaseName = deviceInfo.businessSystemName || ''; deviceAddress = deviceInfo.deviceAddress || deviceAddress;
// id
if (Number(deviceType) === 10) {
// 使 focusId
deviceId = deviceInfo.focusId || deviceId;
} else {
// 使 meterId
deviceId = deviceInfo.meterId || deviceId;
}
} }
// //
const queryParams = { const queryParams = {
pageIndex: page.currentPage, pageIndex: page.currentPage,
pageSize: page.pageSize, pageSize: page.pageSize,
SearchKeyword: currentFormValues.SearchKeyword || '', SearchKeyword: currentFormValues.SearchKeyword || '',
DeviceType: deviceType,
IoTDataType: currentFormValues.IoTDataType || '', IoTDataType: currentFormValues.IoTDataType || '',
DeviceId: deviceId, DeviceId: deviceAddress, // 使
DataBaseName: dataBaseName || currentFormValues.DataBaseName || '',
StartCreationTime: formatDate(currentFormValues.StartCreationTime), StartCreationTime: formatDate(currentFormValues.StartCreationTime),
EndCreationTime: formatDate(currentFormValues.EndCreationTime), EndCreationTime: formatDate(currentFormValues.EndCreationTime),
FocusAddress: currentFormValues.FocusAddress || '',
}; };
if (DeviceType) queryParams.DeviceType = DeviceType; if (DeviceType) queryParams.DeviceType = DeviceType;

View File

@ -8,73 +8,6 @@ import { getCommonGetSelectList } from '#/api-client';
import { $t } from '#/locales'; import { $t } from '#/locales';
export const querySchema = computed(() => [ 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', component: 'ApiSelect',
fieldName: 'IoTDataType', fieldName: 'IoTDataType',
@ -83,15 +16,15 @@ export const querySchema = computed(() => [
api: getCommonGetSelectList, api: getCommonGetSelectList,
params: { params: {
query: { query: {
input: { typeName: 'IoTDBDataTypeConst',
typeName: 'IoTDBDataTypeConst',
},
}, },
}, },
labelField: 'value', labelField: 'value',
valueField: 'key', valueField: 'key',
optionsPropName: 'options', optionsPropName: 'options',
immediate: true, immediate: true,
allowClear: true,
placeholder: $t('common.pleaseSelect') + $t('abp.IoTDBBase.IoTDataType'),
afterFetch: (res: any) => { afterFetch: (res: any) => {
// 确保返回的是数组格式 // 确保返回的是数组格式
if (Array.isArray(res)) { if (Array.isArray(res)) {
@ -161,12 +94,7 @@ export const tableSchema: any = computed((): VxeGridProps['columns'] => [
return cellValue ? dayjs(cellValue).format('YYYY-MM-DD HH:mm:ss') : ''; return cellValue ? dayjs(cellValue).format('YYYY-MM-DD HH:mm:ss') : '';
}, },
}, },
{
field: 'deviceType',
title: $t('abp.IoTDBBase.DeviceType'),
minWidth: 150,
slots: {},
},
{ {
field: 'ioTDataType', field: 'ioTDataType',
title: $t('abp.IoTDBBase.IoTDataType'), title: $t('abp.IoTDBBase.IoTDataType'),

View File

@ -59,8 +59,8 @@ const fetchData = async () => {
if (data?.items) { if (data?.items) {
options.value = data.items.map((item) => ({ options.value = data.items.map((item) => ({
label: item.meterName, label: `${item.deviceName || item.deviceAddress} (${item.deviceAddress})`,
value: item.id, value: item.deviceAddress, // 使
...item, // ...item, //
})); }));
total.value = data.totalCount || 0; total.value = data.totalCount || 0;

View File

@ -42,12 +42,12 @@ const fetchDeviceOptions = async () => {
} }
}; };
// ID //
const getDeviceInfoById = (deviceId: string) => { const getDeviceInfoByAddress = (deviceAddress: string) => {
if (!deviceId || !deviceOptions.value || deviceOptions.value.length === 0) { if (!deviceAddress || !deviceOptions.value || deviceOptions.value.length === 0) {
return null; return null;
} }
return deviceOptions.value.find((device) => device.id === deviceId); return deviceOptions.value.find((device) => device.deviceAddress === deviceAddress);
}; };
// yyyy-MM-dd HH:mm:ss // yyyy-MM-dd HH:mm:ss
@ -68,7 +68,7 @@ const formatDate = (date: Date | string) => {
}; };
const route = useRoute(); const route = useRoute();
const { DeviceType, DeviceId, FocusAddress, DataBaseName } = route.query; const { DeviceType, DeviceId } = route.query;
// //
const dynamicColumns = ref<any[]>([]); const dynamicColumns = ref<any[]>([]);
@ -90,13 +90,6 @@ const fixedColumns = [
showOverflow: true, showOverflow: true,
slots: {}, slots: {},
}, },
{
field: 'DataBaseName',
title: $t('abp.IoTDBBase.DataBaseName'),
minWidth: 150,
showOverflow: true,
slots: {},
},
{ {
field: 'DeviceType', field: 'DeviceType',
title: $t('abp.IoTDBBase.DeviceType'), title: $t('abp.IoTDBBase.DeviceType'),
@ -160,10 +153,8 @@ initDefaultColumns();
const formOptions: VbenFormProps = { const formOptions: VbenFormProps = {
schema: querySchema.value, schema: querySchema.value,
initialValues: { initialValues: {
FocusAddress: FocusAddress as string,
DeviceType: DeviceType ? Number(DeviceType) : undefined, DeviceType: DeviceType ? Number(DeviceType) : undefined,
DeviceId: DeviceId as string, DeviceAddress: DeviceId as string, // 使DeviceIdDeviceAddress
DataBaseName: DataBaseName as string,
}, },
// 使 // 使
submitOnChange: false, submitOnChange: false,
@ -171,27 +162,25 @@ const formOptions: VbenFormProps = {
handleValuesChange: async (values, changedFields) => { handleValuesChange: async (values, changedFields) => {
// //
const relevantFields = new Set([ const relevantFields = new Set([
'DeviceId', 'DeviceAddress',
'DeviceType', 'DeviceType',
'EndCreationTime', 'EndCreationTime',
'FocusAddress',
'IoTDataType', 'IoTDataType',
'StartCreationTime', 'StartCreationTime',
'DataBaseName',
]); ]);
const hasRelevantChange = changedFields.some((field) => const hasRelevantChange = changedFields.some((field) =>
relevantFields.has(field), relevantFields.has(field),
); );
// DeviceIdselectedDeviceInfo // DeviceAddressselectedDeviceInfo
if (changedFields.includes('DeviceId')) { if (changedFields.includes('DeviceAddress')) {
const deviceId = values.DeviceId; const deviceAddress = values.DeviceAddress;
if (deviceId) { if (deviceAddress) {
// deviceOptions // deviceOptions
let device = let device =
deviceOptions.value.length > 0 deviceOptions.value.length > 0
? deviceOptions.value.find((d) => d.id === deviceId) ? deviceOptions.value.find((d) => d.deviceAddress === deviceAddress)
: null; : null;
// DeviceSelect // DeviceSelect
@ -199,7 +188,7 @@ const formOptions: VbenFormProps = {
try { try {
// DeviceSelect // DeviceSelect
const deviceSelectRef = const deviceSelectRef =
gridApi.formApi.getFieldComponentRef('DeviceId'); gridApi.formApi.getFieldComponentRef('DeviceAddress');
if (deviceSelectRef && deviceSelectRef.getSelectedDevice) { if (deviceSelectRef && deviceSelectRef.getSelectedDevice) {
device = deviceSelectRef.getSelectedDevice(); device = deviceSelectRef.getSelectedDevice();
} }
@ -215,7 +204,7 @@ const formOptions: VbenFormProps = {
setTimeout(() => { setTimeout(() => {
try { try {
const deviceSelectRef = const deviceSelectRef =
gridApi.formApi.getFieldComponentRef('DeviceId'); gridApi.formApi.getFieldComponentRef('DeviceAddress');
if (deviceSelectRef && deviceSelectRef.getSelectedDevice) { if (deviceSelectRef && deviceSelectRef.getSelectedDevice) {
const delayedDevice = deviceSelectRef.getSelectedDevice(); const delayedDevice = deviceSelectRef.getSelectedDevice();
if (delayedDevice) { if (delayedDevice) {
@ -278,7 +267,7 @@ const gridOptions: VxeGridProps<any> = {
(gridApi?.formApi ? await gridApi.formApi.getValues() : {}) || (gridApi?.formApi ? await gridApi.formApi.getValues() : {}) ||
{}; {};
// DeviceTypeIoTDataType // DeviceTypeIoTDataType
const deviceTypeValue = currentFormValues.DeviceType || DeviceType; const deviceTypeValue = currentFormValues.DeviceType;
const deviceTypeNumber = deviceTypeValue const deviceTypeNumber = deviceTypeValue
? Number(deviceTypeValue) ? Number(deviceTypeValue)
: undefined; : undefined;
@ -293,43 +282,27 @@ const gridOptions: VxeGridProps<any> = {
? formatDate(currentFormValues.EndCreationTime) ? formatDate(currentFormValues.EndCreationTime)
: undefined; : undefined;
// DeviceId(10)使focusId //
let finalDeviceId = currentFormValues.DeviceId || DeviceId || ''; let deviceAddress = currentFormValues.DeviceAddress || '';
let finalFocusAddress = currentFormValues.FocusAddress || '';
// 使 // 使
const deviceInfo = const deviceInfo =
selectedDeviceInfo.value || selectedDeviceInfo.value ||
(currentFormValues.DeviceId && deviceOptions.value.length > 0 (currentFormValues.DeviceAddress && deviceOptions.value.length > 0
? getDeviceInfoById(currentFormValues.DeviceId) ? getDeviceInfoByAddress(currentFormValues.DeviceAddress)
: null); : null);
if (deviceInfo) { if (deviceInfo) {
finalFocusAddress = deviceInfo.focusAddress || ''; deviceAddress = deviceInfo.deviceAddress || deviceAddress;
if (deviceTypeNumber === 10) {
// 使focusId
if (deviceInfo.focusId) {
finalDeviceId = deviceInfo.focusId;
}
} else {
// 使meterId
if (deviceInfo.meterId) {
finalDeviceId = deviceInfo.meterId;
}
}
} }
try { try {
const { data } = await postTreeModelDeviceDataInfoPage({ const { data } = await postTreeModelDeviceDataInfoPage({
body: { body: {
pageIndex: page.currentPage, pageIndex: page.currentPage,
pageSize: page.pageSize, pageSize: page.pageSize,
// 使使 // 使DeviceAddress
DeviceAddress: deviceAddress,
DeviceType: deviceTypeNumber || undefined, DeviceType: deviceTypeNumber || undefined,
DeviceId: finalDeviceId ? finalDeviceId.toString() : '',
FocusAddress: finalFocusAddress || FocusAddress || '',
//
DataBaseName: currentFormValues.DataBaseName || DataBaseName,
IoTDataType: ioTDataTypeValue || undefined, IoTDataType: ioTDataTypeValue || undefined,
// //
StartCreationTime: startCreationTime || undefined, StartCreationTime: startCreationTime || undefined,
@ -436,7 +409,7 @@ const initializeGrid = async () => {
} }
// //
if (DeviceType || DeviceId || FocusAddress || DataBaseName) { if (DeviceType || DeviceId) {
// //
setTimeout(() => { setTimeout(() => {
if (gridApi) { if (gridApi) {
@ -451,7 +424,7 @@ const initializeGrid = async () => {
// //
watch( watch(
() => [DeviceType, DeviceId, FocusAddress, DataBaseName], () => [DeviceType, DeviceId],
async (newValues, oldValues) => { async (newValues, oldValues) => {
// //
if (newValues.some(Boolean) && gridApi && isGridInitialized.value) { if (newValues.some(Boolean) && gridApi && isGridInitialized.value) {

View File

@ -6,39 +6,6 @@ import { getCommonGetSelectList } from '#/api-client';
import { $t } from '#/locales'; import { $t } from '#/locales';
export const querySchema = computed(() => [ 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', component: 'ApiSelect',
fieldName: 'DeviceType', fieldName: 'DeviceType',
@ -47,13 +14,15 @@ export const querySchema = computed(() => [
api: getCommonGetSelectList, api: getCommonGetSelectList,
params: { params: {
query: { query: {
typeName: 'MeterTypeEnum', typeName: 'DeviceTypeEnum',
}, },
}, },
labelField: 'value', labelField: 'value',
valueField: 'key', valueField: 'key',
optionsPropName: 'options', optionsPropName: 'options',
immediate: true, immediate: true,
allowClear: true,
placeholder: $t('common.pleaseSelect') + $t('abp.IoTDBBase.DeviceType'),
afterFetch: (res: any) => { afterFetch: (res: any) => {
// 确保返回的是数组格式 // 确保返回的是数组格式
if (Array.isArray(res)) { if (Array.isArray(res)) {
@ -87,6 +56,8 @@ export const querySchema = computed(() => [
valueField: 'key', valueField: 'key',
optionsPropName: 'options', optionsPropName: 'options',
immediate: true, immediate: true,
allowClear: true,
placeholder: $t('common.pleaseSelect') + $t('abp.IoTDBBase.IoTDataType'),
afterFetch: (res: any) => { afterFetch: (res: any) => {
// 确保返回的是数组格式 // 确保返回的是数组格式
if (Array.isArray(res)) { if (Array.isArray(res)) {
@ -107,7 +78,7 @@ export const querySchema = computed(() => [
}, },
{ {
component: 'DeviceSelect', component: 'DeviceSelect',
fieldName: 'DeviceId', fieldName: 'DeviceAddress',
label: $t('abp.log.deviceInfo'), label: $t('abp.log.deviceInfo'),
componentProps: { componentProps: {
placeholder: $t('common.pleaseSelect') + $t('abp.log.deviceInfo'), placeholder: $t('common.pleaseSelect') + $t('abp.log.deviceInfo'),
@ -146,11 +117,6 @@ export const tableSchema: any = computed((): VxeGridProps['columns'] => [
title: $t('abp.IoTDBBase.Timestamps'), title: $t('abp.IoTDBBase.Timestamps'),
minWidth: '150', minWidth: '150',
}, },
{
field: 'DataBaseName',
title: $t('abp.IoTDBBase.DataBaseName'),
minWidth: '150',
},
{ {
field: 'DeviceType', field: 'DeviceType',
title: $t('abp.IoTDBBase.DeviceType'), title: $t('abp.IoTDBBase.DeviceType'),

View File

@ -135,11 +135,9 @@ const formOptions: VbenFormProps = {
// //
const relevantFields = new Set([ const relevantFields = new Set([
'DeviceId', 'DeviceId',
'DeviceType',
'EndCreationTime', 'EndCreationTime',
'IoTDataType', 'IoTDataType',
'StartCreationTime', 'StartCreationTime',
'DataBaseName',
]); ]);
const hasRelevantChange = changedFields.some((field) => const hasRelevantChange = changedFields.some((field) =>
relevantFields.has(field), relevantFields.has(field),
@ -181,9 +179,7 @@ const gridOptions: VxeGridProps<any> = {
const currentFormValues = gridApi?.formApi ? await gridApi.formApi.getValues() : {}; const currentFormValues = gridApi?.formApi ? await gridApi.formApi.getValues() : {};
// //
let deviceId = currentFormValues.DeviceId || ''; let deviceAddress = currentFormValues.DeviceId || '';
let dataBaseName = '';
const deviceType = currentFormValues.DeviceType || '';
// 使 // 使
const deviceInfo = const deviceInfo =
@ -193,15 +189,7 @@ const gridOptions: VxeGridProps<any> = {
: null); : null);
if (deviceInfo) { if (deviceInfo) {
dataBaseName = deviceInfo.businessSystemName || ''; deviceAddress = deviceInfo.deviceAddress || deviceAddress;
// id
if (Number(deviceType) === 10) {
// 使 focusId
deviceId = deviceInfo.focusId || deviceId;
} else {
// 使 meterId
deviceId = deviceInfo.meterId || deviceId;
}
} }
// //
@ -209,10 +197,8 @@ const gridOptions: VxeGridProps<any> = {
pageIndex: page.currentPage, pageIndex: page.currentPage,
pageSize: page.pageSize, pageSize: page.pageSize,
SearchKeyword: currentFormValues.SearchKeyword || '', SearchKeyword: currentFormValues.SearchKeyword || '',
DeviceType: deviceType,
IoTDataType: currentFormValues.IoTDataType || '', IoTDataType: currentFormValues.IoTDataType || '',
DeviceId: deviceId, DeviceId: deviceAddress, // 使
DataBaseName: dataBaseName || currentFormValues.DataBaseName || '',
StartCreationTime: formatDate(currentFormValues.StartCreationTime), StartCreationTime: formatDate(currentFormValues.StartCreationTime),
EndCreationTime: formatDate(currentFormValues.EndCreationTime), EndCreationTime: formatDate(currentFormValues.EndCreationTime),
}; };

View File

@ -8,72 +8,6 @@ import { getCommonGetSelectList } from '#/api-client';
import { $t } from '#/locales'; import { $t } from '#/locales';
export const querySchema = computed(() => [ 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', component: 'ApiSelect',
fieldName: 'IoTDataType', fieldName: 'IoTDataType',
@ -89,6 +23,8 @@ export const querySchema = computed(() => [
valueField: 'key', valueField: 'key',
optionsPropName: 'options', optionsPropName: 'options',
immediate: true, immediate: true,
allowClear: true,
placeholder: $t('common.pleaseSelect') + $t('abp.IoTDBBase.IoTDataType'),
afterFetch: (res: any) => { afterFetch: (res: any) => {
// 确保返回的是数组格式 // 确保返回的是数组格式
if (Array.isArray(res)) { if (Array.isArray(res)) {
@ -158,12 +94,7 @@ export const tableSchema: any = computed((): VxeGridProps['columns'] => [
return cellValue ? dayjs(cellValue).format('YYYY-MM-DD HH:mm:ss') : ''; return cellValue ? dayjs(cellValue).format('YYYY-MM-DD HH:mm:ss') : '';
}, },
}, },
{
field: 'deviceType',
title: $t('abp.IoTDBBase.DeviceType'),
minWidth: '120',
slots: {},
},
{ {
field: 'ioTDataType', field: 'ioTDataType',
title: $t('abp.IoTDBBase.IoTDataType'), title: $t('abp.IoTDBBase.IoTDataType'),

View File

@ -58,9 +58,6 @@ const [Grid] = useVbenVxeGrid({ formOptions, gridOptions });
<template> <template>
<Page auto-content-height> <Page auto-content-height>
<Grid> <Grid>
<template #isdeviceType="{ row }">
{{ row.deviceType }}
</template>
<template #ismanualOrNot="{ row }"> <template #ismanualOrNot="{ row }">
<component :is="h(Tag, { color: row.manualOrNot ? 'green' : 'red' }, () => <component :is="h(Tag, { color: row.manualOrNot ? 'green' : 'red' }, () =>
row.manualOrNot ? $t('common.yes') : $t('common.no'), row.manualOrNot ? $t('common.yes') : $t('common.no'),

View File

@ -19,28 +19,11 @@ export const querySchema = computed(() => [
export const tableSchema: any = computed((): VxeGridProps['columns'] => [ export const tableSchema: any = computed((): VxeGridProps['columns'] => [
{ title: $t('common.seq'), type: 'seq', width: 50 }, { title: $t('common.seq'), type: 'seq', width: 50 },
{ field: 'dataBaseName', title: $t('abp.log.dataBaseName'), minWidth: '150' },
{ {
field: 'projectId', field: 'deviceAddress',
title: $t('abp.log.projectId'),
minWidth: '150',
},
{
field: 'meterAddress',
title: $t('abp.meters.meterAddress'),
minWidth: '150',
},
{
field: 'focusAddress',
title: $t('abp.focus.focusAddress'), title: $t('abp.focus.focusAddress'),
minWidth: '100', minWidth: '100',
}, },
{
field: 'deviceType',
title: $t('abp.log.deviceType'),
minWidth: '100',
slots: { default: 'isdeviceType' },
},
{ {
field: 'timestamps', field: 'timestamps',
title: $t('abp.log.timestamps'), title: $t('abp.log.timestamps'),