From 91c2ef7e805eefc17ef426f5c6dcf5798ecde20d Mon Sep 17 00:00:00 2001 From: liutao <790864623@qq.com> Date: Thu, 23 Apr 2026 17:15:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/iot/device/index.ts | 4 + src/locales/en.ts | 2 +- src/locales/zh-CN.ts | 4 +- .../iot/historyData/HistorySingleAnalyse.vue | 924 ++++++++++++++++++ src/views/iot/historyData/index.vue | 31 +- 5 files changed, 959 insertions(+), 6 deletions(-) create mode 100644 src/views/iot/historyData/HistorySingleAnalyse.vue diff --git a/src/api/iot/device/index.ts b/src/api/iot/device/index.ts index 235ab29f..c786a796 100644 --- a/src/api/iot/device/index.ts +++ b/src/api/iot/device/index.ts @@ -177,6 +177,10 @@ export const DeviceApi = { getDeviceAttributePage: async (params) => { return await request.get({ url: `/iot/device/device-attribute/page`, params }) }, + // 获得设备属性按类型分租 + getDeviceAttributeGroupList: async (params) => { + return await request.get({ url: `/iot/device/device-attribute/groupList`, params }) + }, // 获得设备属性列表 getDeviceAttributeList: async (deviceId: number | string) => { return await request.get({ url: `/iot/device/device-attribute/list?deviceId=` + deviceId }) diff --git a/src/locales/en.ts b/src/locales/en.ts index 803dec7d..1603c11e 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -4227,7 +4227,7 @@ export default { tableCollectionTimeColumn: 'Collection Time', tableOperateColumn: 'Operation', tableActionHistoryLabel: 'History', - + tableActionHistoryAnalyseLabel: 'History Data Analysis', dialogTitlePrefix: 'History: ', dialogCollectionTimeLabel: 'Collection Time', dialogPointFilterLabel:'Point Filter', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index b139997a..3063462a 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -4070,7 +4070,7 @@ export default { tableCollectionTimeColumn: '采集时间', tableOperateColumn: '操作', tableActionHistoryLabel: '历史记录', - + tableActionHistoryAnalyseLabel: '数据分析', dialogTitlePrefix: '历史记录:', dialogCollectionTimeLabel: '采集时间', dialogPointFilterLabel: '点位筛选', @@ -4444,7 +4444,7 @@ export default { tableCollectionTimeColumn: '采集时间', tableOperateColumn: '操作', tableActionHistoryLabel: '历史记录', - + tableActionHistoryAnalyseLabel: '数据分析', dialogTitlePrefix: '历史记录:', dialogCollectionTimeLabel: '采集时间', dialogPointFilterLabel: '点位筛选', diff --git a/src/views/iot/historyData/HistorySingleAnalyse.vue b/src/views/iot/historyData/HistorySingleAnalyse.vue new file mode 100644 index 00000000..ab02af57 --- /dev/null +++ b/src/views/iot/historyData/HistorySingleAnalyse.vue @@ -0,0 +1,924 @@ + + + + + + + + {{ deviceData.name }} + {{ deviceData.code }} + + {{ deviceData.productionLine }} + {{ deviceData.lastCollectTime }} + + + + + + 保存分析方案 + + + + 导出分析结果 + + + + 刷新 + + + + + + + + + 分析条件 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 选择温度类 + 清空 + + + + + {{ point.name }} + + + 未选择点位 + + + + + + + + + + + {{ point.name }} + + {{ point.code }} + {{ point.unit }} + ({{ point.lower }} ~ {{ point.upper }}) + + + + + + + + + + + + + + 最大值 + 最小值 + 平均值 + 波动值 + 超上限次数 + 超下限次数 + 连续异常时长 + + + + + + + 开始分析 + + + + 重置条件 + + + + + + + + + + + {{ item.title }} + {{ item.value }} + {{ item.desc }} + + + + + + + + + 多点位历史趋势分析 + + + 全部显示 + 仅异常点位 + + + + + + + + + + + + + {{ chartNote.currentPoints }} + + + + {{ chartNote.hasAbnormal ? `发现 ${chartNote.abnormalCount} 个异常点位` : '未发现明显异常' }} + + + + {{ chartNote.maxTime }} + + + {{ chartNote.maxRange }} + + + + + + + + + 分析结果 + + 按点位聚合统计,异常结果已高亮 + + + + + + + + + + + {{ formatValue(row.max, row.unit) }} + + + + + {{ formatValue(row.min, row.unit) }} + + + + + {{ formatValue(row.avg, row.unit) }} + + + + + {{ formatValue(row.range, row.unit) }} + + + + + + {{ row.upperCount }} + + + + + + + {{ row.lowerCount }} + + + + + + {{ row.continuousAbnormal }}分钟 + + + + + + {{ row.conclusion }} + + + + + + + + + + + 历史明细 + + 展示部分原始采集数据 + + + + + + + + + + {{ formatValue(row[point.code], point.unit) }} {{ point.unit }} + + + + + + + + + + + + + + diff --git a/src/views/iot/historyData/index.vue b/src/views/iot/historyData/index.vue index c815878e..0f137ed8 100644 --- a/src/views/iot/historyData/index.vue +++ b/src/views/iot/historyData/index.vue @@ -108,12 +108,15 @@ :label="t('DataCollection.HistoryData.tableOperateColumn')" align="center" fixed="right" - width="150px" + width="300px" > {{ t('DataCollection.HistoryData.tableActionHistoryLabel') }} + + {{ t('DataCollection.HistoryData.tableActionHistoryAnalyseLabel') }} + @@ -137,9 +140,10 @@ import { dateFormatter } from '@/utils/formatTime' import download from '@/utils/download' import { DeviceApi, LineDeviceVO, LineDevicePageParams } from '@/api/iot/device' import HistorySingleDeviceDialog from './HistorySingleDeviceDialog.vue' - +import {useRouter} from "vue-router"; +// 路由 +const router = useRouter() defineOptions({ name: 'HistoryData' }) - const message = useMessage() const { t } = useI18n() @@ -225,6 +229,27 @@ const handleSingleView = (row: LineDeviceVO) => { singleDialogVisible.value = true } +const handleSingleAnalyseView = (row: LineDeviceVO) => { + const deviceId = (row as any)?.deviceId ?? row?.id + if (deviceId === undefined || deviceId === null || deviceId === '') { + return + } + singleDeviceId.value = deviceId + singleDeviceName.value = row.deviceName || '' + router.push({ + path: '/iot/historySingleAnalyse', + query: { + id: deviceId, + name: singleDeviceName.value, + deviceCode: row.deviceCode, + lineNode: row.lineNode, + lineName: row.lineName, + collectionTime: row.collectionTime + } + }); +} + + onMounted(() => { getList() })