From 20cdbc80003038db65492bcfc0b56e7afaaf2198 Mon Sep 17 00:00:00 2001 From: "zangch@mesnac.com" Date: Thu, 8 Jan 2026 15:07:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(record):=20=E4=BF=AE=E6=AD=A3=E6=9D=83?= =?UTF-8?q?=E9=99=90=E6=A0=87=E8=AF=86=E5=92=8C=E6=8C=89=E9=92=AE=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修正 recordIOTInstant 页面权限标识从 recordIotenvInstant 改为 recordIOTInstant - 修正 recordVibrationInstant 页面权限标识从 recordIotenvInstant 改为 recordVibrationInstant - 注释掉 recordIOTInstant 和 recordVibrationInstant 页面的删除按钮 - 修复振动设备参数导出时的接口路径错误 - 优化振动设备查询时的参数传递逻辑 - 修正页面初始化时的设备ID获取流程 --- .../ems/record/recordIOTInstant/index.vue | 44 +++++++++---------- .../record/recordVibrationInstant/index.vue | 34 +++++++------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/views/ems/record/recordIOTInstant/index.vue b/src/views/ems/record/recordIOTInstant/index.vue index 8857b27..954fb64 100644 --- a/src/views/ems/record/recordIOTInstant/index.vue +++ b/src/views/ems/record/recordIOTInstant/index.vue @@ -142,14 +142,14 @@ - + 导出 @@ -192,25 +192,25 @@ - + - - + - - + - - + - @@ -439,7 +439,7 @@ export default { children: 'children', label: 'label' }, - + // 选中节点的类型,用于控制显示字段 selectedNodeType: null, @@ -592,18 +592,18 @@ export default { // 清空之前的查询条件 this.queryParams.monitorIds = []; this.queryParams.monitorId = null; - + // 判断是否为父节点(有children属性) if (data.children && data.children.length > 0) { // 父节点:收集所有子节点的code,过滤掉空值 this.queryParams.monitorIds = data.children .filter(child => child.code) .map(child => child.code); - + // 父节点的type应该与子节点一致,取第一个有效子节点的type const firstValidChild = data.children.find(child => child.type); this.selectedNodeType = firstValidChild ? firstValidChild.type : data.type; - + console.log('点击父节点:', data.label, '节点type:', data.type, '子节点codes:', this.queryParams.monitorIds, '使用type:', this.selectedNodeType); } else { // 子节点:使用单个设备code @@ -611,7 +611,7 @@ export default { this.selectedNodeType = data.type; console.log('点击子节点:', data.label, 'code:', data.code, 'type:', this.selectedNodeType); } - + this.handleQuery(); }, @@ -681,7 +681,7 @@ export default { /** 重置按钮操作 */ resetQuery() { this.resetForm("queryForm"); - + // 重置时间范围为默认值(昨天8:00:00到今天8:00:00) const nowDate = new Date(); const today = parseTime(new Date(), '{y}-{m}-{d}') @@ -689,12 +689,12 @@ export default { lastDate.setDate(nowDate.getDate() - 1) const yesterday = parseTime(lastDate, '{y}-{m}-{d}') this.daterangeRecordTime = [yesterday + ' 08:00:00', today + ' 08:00:00']; - + // 重置选中节点类型和查询条件 this.selectedNodeType = null; this.queryParams.monitorId = null; this.queryParams.monitorIds = []; - + this.handleQuery(); }, // 多选框选中数据 diff --git a/src/views/ems/record/recordVibrationInstant/index.vue b/src/views/ems/record/recordVibrationInstant/index.vue index c30562e..64fd1e9 100644 --- a/src/views/ems/record/recordVibrationInstant/index.vue +++ b/src/views/ems/record/recordVibrationInstant/index.vue @@ -150,14 +150,14 @@ - + 导出 @@ -200,7 +200,7 @@ - + @@ -210,7 +210,7 @@ - + @@ -387,7 +387,7 @@ export default { // 先获取树结构数据(用于新增功能) this.getTreeMonitorInfo() - + // 获取振动设备树结构并初始化查询 await this.initVibrationDevices(); }, @@ -457,7 +457,7 @@ export default { // 清空之前的查询条件 this.queryParams.monitorIds = []; this.queryParams.monitorId = null; - + // 判断是否为父节点(有children属性) if (data.children && data.children.length > 0) { // 父节点:收集所有子节点的code @@ -468,7 +468,7 @@ export default { this.queryParams.monitorId = data.code; console.log('点击振动设备子节点:', data.label, 'code:', data.code); } - + this.handleQuery(); }, @@ -541,12 +541,12 @@ export default { resetQuery() { this.resetForm("queryForm"); this.daterangeCollectTime = []; - + // 重置查询条件,重新获取所有振动设备ID this.queryParams.monitorId = null; this.queryParams.monitorIds = this.getAllMonitorIds(this.monitorInfoOptions); console.log('重置后振动设备IDs:', this.queryParams.monitorIds); - + this.handleQuery(); }, // 多选框选中数据 @@ -620,7 +620,7 @@ export default { this.queryParams.params['monitorTypes'] = '10'; // 传递选中的振动参数,后端只导出该参数列 this.queryParams.params['vibrationParam'] = this.selectedVibrationParam; - + // 参数中文名映射 const paramNameMap = { vibrationSpeed: '振动速度', @@ -629,7 +629,7 @@ export default { vibrationTemp: '振动温度' }; const paramName = paramNameMap[this.selectedVibrationParam] || '振动数据'; - + this.download('ems/record/recordIotenvInstant/export', { ...this.queryParams }, `${paramName}_${this.daterangeRecordTime[0].substring(0,10)}_${this.daterangeRecordTime[1].substring(0,10)}.xlsx`) @@ -646,11 +646,11 @@ export default { try { const response = await getMonitorInfoTree({ monitorType: 10 }); this.monitorInfoOptions = response.data; - + // 获取所有振动设备的ID用于初始查询 this.queryParams.monitorIds = this.getAllMonitorIds(this.monitorInfoOptions); console.log('初始化振动设备IDs:', this.queryParams.monitorIds); - + // 设置完设备ID后再执行查询 this.getList(); } catch (error) {