Browse Source

[Mod 0000] 优化echarts坐标轴自动配置错误问题; 修改环境贴图bug

hongrunxia 4 days ago
parent
commit
59b04c15f2

+ 10 - 14
src/components/chart/BarAndLine.vue

@@ -142,9 +142,9 @@
               } else if (max < 0.9) {
                 yMax = 1.5;
               } else if (max < 5) {
+                yMax = 5;
+              } else if (max < 10) {
                 yMax = 10;
-              } else {
-                yMax = 15;
               }
             } else if (digitCount < 3) {
               const n = Number((Number(max.toFixed(0)) / 10).toFixed(0));
@@ -177,14 +177,12 @@
             }
 
             if (minDigitCount < 2) {
-              if (min > 0.5) {
-                yMin = 0.5;
-              } else if (min > 1.5) {
+              if (min > 1.5) {
                 yMin = 1.0;
-              } else if (min > 10) {
+              } else if (min > 5) {
                 yMin = 5;
               } else {
-                yMin = 15;
+                yMin = 0;
               }
             } else if (minDigitCount < 3) {
               const n = Number((Number(min.toFixed(0)) / 10).toFixed(0));
@@ -216,14 +214,11 @@
               }
             }
 
-            if (yMax != 0 && yMax !== propType?.ymax) {
-              propType.ymax = yMax;
-            }
-            if (yMin != 0 && yMin !== propType?.yMin) {
-              propType.ymin = yMin;
-            }
+            propType.ymax = yMax;
+            propType.ymin = yMin;
             return true;
           });
+          debugger;
           // 根据sort分组
           const groupedBy = {};
           for (const item of chartsColumns) {
@@ -254,7 +249,7 @@
               tempYmax[index] = ymax;
               isFresh = true;
             }
-            if (!tempYmin[index] || tempYmin[index] != ymin) {
+            if (tempYmin[index] != ymin) {
               tempYmin[index] = ymin;
               isFresh = true;
             }
@@ -280,6 +275,7 @@
             // console.log('echarts监测列表数据', option.xAxis[0].data);
             setOptions(option, isRefresh);
           }
+          setOptions(option, isRefresh);
         }
       }
       setTimeout(() => {

+ 12 - 2
src/utils/echartsUtil.ts

@@ -254,18 +254,28 @@ export default class echartsUtil {
     if (!this.option.grid) {
       let rightnum = 0,
         leftnum = 0;
+      let max = 0;
       yAxis.forEach((item) => {
         if (item.position == 'right') {
           ++rightnum;
         } else if (item.position == 'left') {
           ++leftnum;
         }
+        if (item['ymax'] > max) max = item['ymax'];
       });
+      let yWidth = 30;
+      if (max < 100) {
+        yWidth = 15;
+      } else if (max < 1000) {
+        yWidth = 20;
+      } else {
+        yWidth = 30;
+      }
       const grid = {
         top: '60px',
         bottom: type == 'history' ? '40px' : '15px',
-        right: rightnum * 30 + 20 + 'px',
-        left: leftnum * 40 + 'px',
+        right: rightnum * yWidth + 20 + 'px',
+        left: leftnum * (yWidth + 10) + 'px',
         containLabel: true,
       };
       return grid;

+ 1 - 1
src/views/vent/gas/gasAssessment/threejs/gasAssessmen.threejs.ts

@@ -161,7 +161,7 @@ export const mountedThree = (pageType: Ref<string>, activeUnitId: Ref<string>) =
   activeId = activeUnitId;
   return new Promise(async (resolve) => {
     model = new UseThree('#workFace3D', '#workFace3DCSS');
-    model.setEnvMap('test1');
+    model.setEnvMap('test1.hdr');
     model.renderer.toneMappingExposure = 1.0;
     // model.renderer = 1;
     workFaceObj = new GasAssessmen(model);

+ 1 - 1
src/views/vent/monitorManager/balancePressMonitor/balancePress.threejs.ts

@@ -79,7 +79,7 @@ export const setModelType = (type) => {
 export const mountedThree = () => {
   return new Promise(async (resolve) => {
     model = new UseThree('#balancePress3D');
-    model.setEnvMap('test1');
+    model.setEnvMap('test1.hdr');
     model.renderer.toneMappingExposure = 1.0;
     balancePressBaseObj = new balancePressBase(model);
     await balancePressBaseObj.mountedThree();

+ 1 - 1
src/views/vent/monitorManager/balancePressMonitor1/balancePress.three.ts

@@ -471,7 +471,7 @@ export const mountedThree = (playerVal1) => {
   player1 = playerVal1;
   return new Promise((resolve) => {
     model = new UseThree('#fanLocal3D', '#fanLocal3DCSS');
-    model.setEnvMap('test1');
+    model.setEnvMap('test1.hdr');
 
     resetCamera();
     model.setGLTFModel([modelName]).then(async (gltf) => {

+ 1 - 1
src/views/vent/monitorManager/beltTunMonitor/beltTun.threejs.ts

@@ -84,7 +84,7 @@ export const setModelType = (type) => {
 export const mountedThree = () => {
   return new Promise(async (resolve) => {
     model = new UseThree('#beltTun3D', '#beltTun3DCSS');
-    model.setEnvMap('test1');
+    model.setEnvMap('test1.hdr');
     model.renderer.toneMappingExposure = 1.0;
     model.camera.position.set(100, 0, 1000);
     beltTunObj = new BeltFace(model);

+ 0 - 1
src/views/vent/monitorManager/comment/FanDeviceEcharts.vue

@@ -361,7 +361,6 @@
                   strtype: device.deviceType,
                   interval: historyParams.interval,
                   column: 'createTime',
-                  deviceNum: 'Fan2',
                 });
                 if (res && res.records && res.records.length > 0) {
                   resultDataSource.value = res.records.map((item) => Object.assign(item, item.readData));

+ 1 - 1
src/views/vent/monitorManager/deviceMonitor/components/device/modal/bundle.modal.vue

@@ -161,7 +161,7 @@
         grid: {
           top: '29%',
           left: '3',
-          right: '20',
+          right: '9%',
           bottom: '3%',
           containLabel: true,
         },

+ 2 - 2
src/views/vent/monitorManager/fanLocalMonitor/fanLocal.data.ts

@@ -3595,10 +3595,10 @@ export const option = reactive<EChartsOption>({
 });
 export const echatsOption = {
   legend: {
-    top: -10,
+    top: 5,
   },
   grid: {
-    top: '18%',
+    top: '35',
     left: '30',
     right: '35',
     bottom: '10%',

+ 21 - 4
src/views/vent/monitorManager/windrectMonitor/components/modalTable.vue

@@ -2,9 +2,10 @@
   <BasicTable @register="registerTable" :rowSelection="rowSelection" :scroll="{ y: 450 }" />
 </template>
 <script lang="ts">
+  import { defineComponent, onMounted, ref, watch } from 'vue';
   import { BasicTable } from '/@/components/Table';
   import { useListPage } from '/@/hooks/system/useListPage';
-  import { deviceList } from '/@/views/vent/monitorManager/windrectMonitor/windrect.api';
+  import { list } from '/@/views/vent/monitorManager/windrectMonitor/windrect.api';
   import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
 
   export default {
@@ -16,15 +17,17 @@
         required: true,
       },
     },
+
     setup(props) {
       const columns = getTableHeaderColumns(props.deviceType);
-
+      const dataTableSource = ref<any[]>([]);
       // 列表页面公共参数、方法
       const { tableContext, onExportXls } = useListPage({
         designScope: 'windrect_list',
         tableProps: {
           title: '',
-          api: deviceList.bind(null, { pageSize: 1000 }),
+          dataSource: dataTableSource,
+          rowKey: 'id',
           columns: columns,
           size: 'small',
           actionColumn: {
@@ -42,9 +45,23 @@
           },
         },
       });
-
       //注册table数据
       const [registerTable, { clearSelectedRowKeys, setSelectedRowKeys }, { rowSelection, selectedRowKeys }] = tableContext;
+      onMounted(() => {
+        list({ devicetype: 'windrect', pagetype: 'normal', pageSize: 1000 }).then((res) => {
+          if (res && res.msgTxt[0]) {
+            const dataList: any[] = [];
+            if (res.msgTxt[0].datalist && res.msgTxt[0].datalist.length > 0) {
+              res.msgTxt[0].datalist.forEach((data: any) => {
+                const readData = data.readData;
+                data = Object.assign(data, readData);
+                dataList.push(data);
+              });
+              dataTableSource.value = dataList;
+            }
+          }
+        });
+      });
       return {
         registerTable,
         onExportXls,

+ 13 - 8
src/views/vent/sys/setting/setting.data.ts

@@ -99,6 +99,14 @@ export const formSchema: FormSchema[] = [
     },
   },
   {
+    field: 'loginBack',
+    label: '登录背景图',
+    component: 'JImageUpload',
+    componentProps: {
+      fileMax: 1,
+    },
+  },
+  {
     field: 'dataType',
     label: '矿井数据来源',
     component: 'RadioGroup',
@@ -121,14 +129,6 @@ export const formSchema: FormSchema[] = [
     },
   },
   {
-    field: 'loginBack',
-    label: '登录背景图',
-    component: 'JImageUpload',
-    componentProps: {
-      fileMax: 1,
-    },
-  },
-  {
     field: 'voiceAlarmType',
     label: '语音报警协议类型',
     component: 'Input',
@@ -138,4 +138,9 @@ export const formSchema: FormSchema[] = [
     label: '语音报警服务地址',
     component: 'Input',
   },
+  {
+    field: 'airDensity',
+    label: '矿井空气密度',
+    component: 'Input',
+  },
 ];