From e7a0d1042326b311724888e48841845f88c7b51d Mon Sep 17 00:00:00 2001 From: "DESKTOP-FUDKNA8\\znjsz" Date: Mon, 22 Jan 2024 16:29:09 +0800 Subject: [PATCH] update --- src/MainPage.vue | 21 ++++++++++-------- src/components/HourChart.vue | 31 +++++++++++++++++---------- src/components/HourChartOptions.js | 12 ++++++----- src/components/TeamChartDay.vue | 23 ++++++++++---------- src/components/TeamChartDayOptions.js | 9 ++++---- src/pages/AlertListPage.vue | 6 +++--- src/pages/DataPage.vue | 2 +- src/store/index.js | 6 +++--- src/store/settings.js | 2 +- 9 files changed, 63 insertions(+), 49 deletions(-) diff --git a/src/MainPage.vue b/src/MainPage.vue index e7d44bf..a500391 100644 --- a/src/MainPage.vue +++ b/src/MainPage.vue @@ -43,18 +43,21 @@ watch(() => settings.carouselTime, val => { }) const pathMap = { - '/1-1': 1, - '/1-2': 2, - '/1-3': 3, - '/1-4': 4, + // 钢三线 + '/3-1': 1, + '/3-2': 2, + '/3-3': 11, // 3, + '/3-4': 12, + // 钢二线 '/2-1': 5, '/2-2': 6, '/2-3': 7, - '/2-4': 8, - '/3-1': 9, - '/3-2': 10, - '/3-3': 11, - '/3-4': 12 + '/2-4': 4, + // 钢一线 + '/1-1': 9, + '/1-2': 10, + '/1-3': 3, + '/1-4': 8 } diff --git a/src/components/HourChart.vue b/src/components/HourChart.vue index c98f217..943ba02 100644 --- a/src/components/HourChart.vue +++ b/src/components/HourChart.vue @@ -9,19 +9,32 @@ const store = useWsStore(); const chartChart = ref(null); const chart = ref(null); // 小时数据 -const hourData = ref([]); +const hourData = ref([ + { lineName: '001', hour: '00:00', num: 10 }, + { lineName: '002', hour: '00:20', num: 20 }, + { lineName: '003', hour: '00:30', num: 30 }, + { lineName: '004', hour: '00:40', num: 14 }, + { lineName: '005', hour: '00:50', num: 50 } +]); store.$subscribe((mutation, state) => { - console.log("=======>", state.data2.lineHourList?.length); + // console.log("[HourChart] =======>", state.data2.lineHourList?.length); if ( state.data2.lineHourList == undefined || state.data2.lineHourList?.length == 0 ) { + // console.log("[HourChart] 清除数据"); hourData.value.splice(0); if (chart.value) chart.value.dispose(); return; } - console.log("lineHourList ===> ", state.data2.lineHourList); - hourData.value = (state.data2?.lineHourList ?? []).map((item, index) => ({ + // console.log("[HourChart] ===> 有数据: ", state.data2.lineHourList); + hourData.value = (state.data2?.lineHourList ?? [ + { lineName: '001', hour: '00:00', num: 10 }, + { lineName: '002', hour: '00:20', num: 20 }, + { lineName: '003', hour: '00:30', num: 30 }, + { lineName: '004', hour: '00:40', num: 14 }, + { lineName: '005', hour: '00:50', num: 50 }, + ]).map((item, index) => ({ id: `${item.lineName}_${index}`, hour: item.hour || `${index}`.padStart(2, "0"), data: item.num || Math.floor(Math.random() * 100), @@ -33,6 +46,7 @@ function setupChart() { if (chart.value) chart.value.dispose(); nextTick(() => { chart.value = echarts.init(chartChart.value); + // console.log("[HourChart] ===> 设置chart: ", chart.value, hourData.value.map((item) => item.hour), hourData.value.map((item) => item.data)); chartSetup( chart.value, hourData.value.map((item) => item.hour), @@ -64,11 +78,7 @@ onMounted(() => {