Browse Source

[0924] 测点监控中。YC取值iValue, YX取值dValue

taosj 17 hours ago
parent
commit
19445db18d

+ 5 - 4
forecast-backend-vue/src/views/ufo/electricity/realtime/PointMonitor.vue

@@ -112,17 +112,18 @@ const clearDataRefresh = () => {
   countdown.value = 0;
 };
 
-const columns = [
+// 值列: 遥信(YX)取iValue, 遥测(YC)取dValue
+const columns = computed(() => [
   { title: '名称', dataIndex: 'name', width: 180, ellipsis: true },
   { title: '编码', dataIndex: 'code', width: 140, ellipsis: true },
   { title: '地址', dataIndex: 'addr', width: 100 },
   { title: '测点属性', dataIndex: 'pointAttr', width: 110 },
-  { title: '值', dataIndex: 'dValue', width: 120 },
+  { title: '值', dataIndex: queryParams.category === 'YX' ? 'iValue' : 'dValue', width: 120 },
   { title: '值属性', dataIndex: 'valueAttr', width: 110 },
   { title: '上报时间', dataIndex: 'tmReport', key: 'tmReport', width: 170 },
   { title: '变化时间', dataIndex: 'tmChange', key: 'tmChange', width: 170 }
-];
-const tableScroll = computed(() => ({ x: columns.reduce((sum, col) => sum + (col.width || 140), 0) + 40 }));
+]);
+const tableScroll = computed(() => ({ x: columns.value.reduce((sum, col) => sum + (col.width || 140), 0) + 40 }));
 
 // 计算2: 时间计算, timestamp 转 date(yyyy-MM-dd HH:mm:ss)
 const formatTime = (timestamp) => (timestamp && Number(timestamp) > 0 ? dayjs(Number(timestamp)).format('YYYY-MM-DD HH:mm:ss') : '');