Browse Source

图表信息调整

viviandjava 5 months ago
parent
commit
ef8312edfd
3 changed files with 8 additions and 3 deletions
  1. 1 0
      package.json
  2. 1 1
      src/views/Home.vue
  3. 6 2
      src/views/Situational.vue

+ 1 - 0
package.json

@@ -29,6 +29,7 @@
     "echarts-gl": "^2.0.9",
     "element-plus": "^2.8.6",
     "mitt": "^3.0.1",
+    "moment": "^2.30.1",
     "pinia": "^2.2.4",
     "qs": "^6.13.1",
     "vue": "^3.5.12",

+ 1 - 1
src/views/Home.vue

@@ -101,7 +101,7 @@ function reloadLeft2() {
         // rotate: -45, //旋转的角度从 -90 度到 90 度。
         color: '#02cacf'
       },
-      data: ['河道水文', '水文', '实验']
+      data: ['超保证', '超警戒']
     },
     series: [
       {

+ 6 - 2
src/views/Situational.vue

@@ -20,7 +20,7 @@ import StationRightButtonGroup from '@/components/StationRightButtonGroup.vue'
 import {useStationStore} from '@/stores/station'
 import {jumpPage} from '@/utils'
 import bus from "@/utils/bus";
-
+import moment from 'moment';
 const route = useRoute()
 const store = useStationStore()
 const dibaImage = (new URL('@/assets/images/dike.png', import.meta.url).href)
@@ -70,7 +70,11 @@ async function reloadLeft2() {
         }
       },
       axisLabel: { // 坐标轴刻度标签的相关设置
-        color: '#02cacf'
+        color: '#02cacf',
+        formatter: function (value) {
+          // 使用 moment.js 进行时间格式化
+          return moment(value).format('HH:mm');
+        }
       },
       axisTick: {show: false},
       data: flowData.map(item => item.tm ? item.tm.substring(11, 16) + '\n' + item.tm.substring(5, 10) : '')