|
@@ -217,7 +217,17 @@
|
|
|
|
|
|
onMounted(async () => {
|
|
|
await fetchDevice();
|
|
|
- initTable([deviceInfo.value.deviceType as string, props.columnsCode], deviceOptions.value, dictOptions.value);
|
|
|
+ // 生成所有需要查询的表头编码,例如 forcFan_auto 对应 forcFan_auto_history、forcFan_history 这两个
|
|
|
+ const codes: string[] = [];
|
|
|
+ if (deviceInfo.value.deviceType) {
|
|
|
+ const arr = (deviceInfo.value.deviceType as string).split('_');
|
|
|
+ while (arr.length) {
|
|
|
+ codes.push(arr.join('_').concat('_history'));
|
|
|
+ arr.pop();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 如此,例如deviceType为forcFan_auto, 则查询表头按 forcFan_auto_history、forcFan_history、columnsCode 为顺序
|
|
|
+ initTable(codes.concat(props.columnsCode), deviceOptions.value, dictOptions.value);
|
|
|
search();
|
|
|
});
|
|
|
</script>
|