From 147f7933edabe9149fd98b09826000bbcbbdd006 Mon Sep 17 00:00:00 2001 From: zch Date: Tue, 15 Jul 2025 16:24:21 +0800 Subject: [PATCH] =?UTF-8?q?feat(ems):=20=E4=BC=98=E5=8C=96=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=9F=A5=E8=AF=A2=E9=80=BB=E8=BE=91=E5=92=8C=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 recordIOTInstant 页面添加未选择设备时的提示信息 - 优化 recordIOTInstant 页面的数据查询逻辑 --- .../ems/record/recordIOTInstant/index.vue | 41 +- .../ems/report/currentIOTCurve/index.vue | 2 + src/views/system/menu/原本的.vue | 452 ++++++++++++++++++ 3 files changed, 488 insertions(+), 7 deletions(-) create mode 100644 src/views/system/menu/原本的.vue diff --git a/src/views/ems/record/recordIOTInstant/index.vue b/src/views/ems/record/recordIOTInstant/index.vue index d0bb5bc..2850cc1 100644 --- a/src/views/ems/record/recordIOTInstant/index.vue +++ b/src/views/ems/record/recordIOTInstant/index.vue @@ -222,6 +222,13 @@ + +
+ + + +
+ @@ -364,6 +371,12 @@ export default { } }; }, + computed: { + // 计算是否已选择设备 + hasSelectedDevice() { + return this.queryParams.monitorId || (this.queryParams.monitorIds && this.queryParams.monitorIds.length > 0); + } + }, created() { //时间范围从昨天8:00:00到今天8:00:00 const nowDate = new Date(); @@ -464,6 +477,13 @@ export default { getList() { this.loading = true; + // 检查是否已选择设备,未选择时不查询数据 + if (!this.hasSelectedDevice) { + this.recordIotenvInstantList = []; + this.total = 0; + this.loading = false; + return; + } if (null != this.daterangeCollectTime && '' != this.daterangeCollectTime) { this.queryParams.params['beginCollectTime'] = this.daterangeCollectTime[0] @@ -484,13 +504,6 @@ export default { this.recordIotenvInstantList = response.rows; this.total = response.total; this.loading = false; - - // 调试信息:检查返回的数据 - console.log('查询结果:', response.rows); - console.log('当前选中节点类型:', this.selectedNodeType); - if (response.rows && response.rows.length > 0) { - console.log('第一条记录的时间字段:', response.rows[0].recodeTime); - } }); }, // 取消按钮 @@ -610,3 +623,17 @@ export default { } }; + + diff --git a/src/views/ems/report/currentIOTCurve/index.vue b/src/views/ems/report/currentIOTCurve/index.vue index 27bd537..eb98242 100644 --- a/src/views/ems/report/currentIOTCurve/index.vue +++ b/src/views/ems/report/currentIOTCurve/index.vue @@ -313,6 +313,8 @@ export default { let query = JSON.parse(JSON.stringify(this.queryParams)) const {data} = await getRecordIotenvInstantList(query) + console.log('数据条数:', data.length); + // 根据设备类型创建对应的图表配置 this.createChartByType(data); }, diff --git a/src/views/system/menu/原本的.vue b/src/views/system/menu/原本的.vue new file mode 100644 index 0000000..4a48e18 --- /dev/null +++ b/src/views/system/menu/原本的.vue @@ -0,0 +1,452 @@ + + +