Browse Source

[Feat 0000] 修改了场景类历史数据组件的动态表头计算逻辑

houzekong 4 months ago
parent
commit
d49b6d93b1

+ 3 - 2
src/views/vent/comment/history/HistoryTable.vue

@@ -129,8 +129,9 @@
       const dataIndex = col.dataIndex as string;
       // 获取到子设备编码的前缀及编码,正则例子:forcFan1 => [forcFan1, forcFan, 1]
       const [_, pfx] = prefix.match(/([A-Za-z]+)([0-9]+)/) || [];
-      // 同时,如若已经配置了编号则不要更改
-      if (dataIndex.search(/[0-9]/) !== -1) return col;
+      // 同时,如若已经在前缀后配置了编号则不要更改
+      const reg = new RegExp(`${pfx}[0-9]`);
+      if (dataIndex.search(reg) !== -1) return col;
       if (dataIndex.includes(pfx)) {
         return {
           ...col,

+ 3 - 3
src/views/vent/comment/history/history.data.ts

@@ -5,11 +5,11 @@ import { getAutoScrollContainer } from '/@/utils/common/compUtils';
 /**
  * 默认的查询表单项props
  *
- * @param dictCode 字典编码,用于初始化子设备下拉框
- * @param deviceOptions 设备编码,用于初始化设备下拉框
+ * @param dictOptions 用于初始化子设备下拉框
+ * @param deviceOptions 用于初始化设备下拉框
  * @returns
  */
-export const getDefaultSchemas: (dictCode: any[], deviceOptions: any[]) => FormSchema[] = (dictOptions: any[], deviceOptions: any[]) => [
+export const getDefaultSchemas: (dictOptions: any[], deviceOptions: any[]) => FormSchema[] = (dictOptions: any[], deviceOptions: any[]) => [
   {
     field: 'ttime_begin',
     label: '开始时间',