Browse Source

[Mod 0000] 场景类历史数据组件表头获取方式修改

houzekong 9 months ago
parent
commit
882d9b700d

+ 0 - 1
src/components/Form/src/BasicForm.vue

@@ -130,7 +130,6 @@
       const getBindValue = computed(() => ({ ...attrs, ...props, ...unref(getProps) }) as Recordable);
 
       const getSchema = computed((): FormSchema[] => {
-        debugger;
         const schemas: FormSchema[] = unref(schemaRef) || (unref(getProps).schemas as any);
         for (const schema of schemas) {
           const { defaultValue, component, componentProps } = schema;

+ 0 - 1
src/components/Form/src/hooks/useAutoFocus.ts

@@ -13,7 +13,6 @@ interface UseAutoFocusContext {
 }
 export async function useAutoFocus({ getSchema, getProps, formElRef, isInitedDefault }: UseAutoFocusContext) {
   watchEffect(async () => {
-    debugger;
     // if (unref(isInitedDefault) || !unref(getProps).autoFocusFirstItem) {
     //   return;
     // }

File diff suppressed because it is too large
+ 1575 - 1553
src/components/Form/src/jeecg/components/MTreeSelect.vue


+ 1 - 5
src/hooks/vent/useThree.ts

@@ -20,12 +20,9 @@ import { saveModel } from '/@/utils/threejs/util';
 const globSetting = useGlobSetting();
 const baseApiUrl = globSetting.domainUrl;
 
-export function useThree(containerID: string, css3dContainerID: string, css2dContainerID: string) {
-
-}
+export function useThree(containerID: string, css3dContainerID: string, css2dContainerID: string) {}
 
 class UseThree {
-
   constructor(canvasSelector, css3Canvas?, css2Canvas?) {
     this.canvasContainer = document.querySelector(canvasSelector);
     //初始化
@@ -205,7 +202,6 @@ class UseThree {
                   modalValue,
                   '/model/glft/',
                   (gltf) => {
-                    debugger;
                     const object = gltf.scene;
                     // setModalCenter(object);
                     object.traverse((obj) => {

+ 15 - 9
src/views/vent/comment/history/HistoryTable.vue

@@ -27,8 +27,7 @@
   // 以压风机为例,设压风机设备的历史数据编码为forcFan_history。
   // 那么字段code中需要把所有字段悉数配置,例子如下:
   //  显示字段    字段code
-  //   温度     forcFan1Temp
-  //   温度     forcFan2Temp
+  //   温度     forcFanTemp
   //  安装位置      name
   //
   // 2、配置数据字典(参考系统管理-数据字典),为上述设备配置子设备
@@ -44,10 +43,11 @@
   // 4、其他内容说明
   // 同以压风机为例,当子设备没有数据时,不进行过滤,此时展示的数据是:
   //      温度    安装位置
-  // 取forcFan2Temp    取name
+  // 取forcFanTemp    取name
   // 同以压风机为例,当子设备选择压风机1时,过滤压风机1相关的表头,此时展示的数据是:
   //      温度        安装位置
   // 取forcFan1Temp    取name
+  // 当设备字段不含数据字典关键词(forcFan)时不做处理,当设备字段包含关键词但已指定编号(即字段包含数字)时不做处理
   import { onMounted, ref, shallowRef } from 'vue';
   import { BasicColumn, PaginationProps, BasicTable } from '/@/components/Table';
   import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
@@ -102,7 +102,6 @@
       const cols = getTableHeaderColumns(code);
       if (cols.length) {
         originColumns = cols;
-        updateColumns(dictOptions[0].value);
         break;
       }
     }
@@ -122,13 +121,20 @@
   function updateColumns(prefix?: string) {
     if (!prefix) return;
     // 如果有子设备信息,筛选符合规范的表头
-    const cols = originColumns.filter(({ dataIndex }) => {
-      // 获取到子设备编码的前缀,如 forcFan 之于 forcFan1,如果表头以该前缀打头则进行过滤,否则放行
+    const cols = originColumns.map((col) => {
+      const dataIndex = col.dataIndex as string;
+      // 获取到子设备编码的前缀及编码,正则例子:forcFan1 => [forcFan1, forcFan, 1]
       const [_, pfx] = prefix.match(/([A-Za-z]+)([0-9]+)/) || [];
-      if ((dataIndex as string).startsWith(pfx)) {
-        return (dataIndex as string).startsWith(prefix);
+      // 同时,如若已经配置了编号则不要更改
+      if (dataIndex.search(/[0-9]/) !== -1) return col;
+      if (dataIndex.includes(pfx)) {
+        return {
+          ...col,
+          dataIndex: dataIndex.replace(pfx, prefix),
+        };
       }
-      return true;
+      // 默认直接放行
+      return col;
     });
     setColumns(cols);
   }

Some files were not shown because too many files changed in this diff