From 94dc999e2107401cb9e6c65dd67bc17eecc5e548 Mon Sep 17 00:00:00 2001 From: guonan <guonan201020@163.com> Date: 星期一, 28 四月 2025 11:40:02 +0800 Subject: [PATCH] 修改图表时间以及将避险点修改为避险场所 --- src/components/monifangzhen/echartInfo.vue | 1665 +++------------------------------------------------------- 1 files changed, 102 insertions(+), 1,563 deletions(-) diff --git a/src/components/monifangzhen/echartInfo.vue b/src/components/monifangzhen/echartInfo.vue index 9ea190d..ce0892d 100644 --- a/src/components/monifangzhen/echartInfo.vue +++ b/src/components/monifangzhen/echartInfo.vue @@ -25,21 +25,71 @@ <p style="cursor: pointer" @click="debuffClick">濞佽儊瀵硅薄</p> <div class="echartBox"> <div class="table-container" ref="tableContainer"> - <el-table :data="tableData" style="width: 100%; font-size: 10px" height="100%" @row-click="handleRowClick"> + <el-table + :data="tableData" + style="width: 100%; font-size: 10px" + height="100%" + @row-click="handleRowClick" + > <el-table-column label="褰卞搷鍖哄悕绉�" width="30" align="center"> <template #default="scope"> 褰卞搷鍖簕{ scope.row.zoneId }} </template> </el-table-column> - <el-table-column prop="time" label="褰卞搷鏃堕棿" width="50" align="center"></el-table-column> - <el-table-column prop="population" label="浜哄憳(浜�)" width="23" align="center"></el-table-column> - <el-table-column prop="room" label="鎴垮眿(闂�)" width="23" align="center"></el-table-column> - <el-table-column prop="households" label="鎴锋暟(鎴�)" width="23" align="center"></el-table-column> - <el-table-column prop="property" label="璐骇(涓囧厓)" width="23" align="center"></el-table-column> - <el-table-column prop="maxDepth" label="鏈�澶ф按娣�(绫�)" width="28" align="center"></el-table-column> - <el-table-column prop="maxVelocity" label="鏈�澶ф祦閫�(m/s)" width="35" align="center"></el-table-column> - <el-table-column prop="raininess" label="闆ㄥ己(mm/h)" width="28" align="center"></el-table-column> - <el-table-column prop="warningLevel" label="棰勮绛夌骇" width="28" align="center"></el-table-column> + <el-table-column + prop="time" + label="褰卞搷鏃堕棿" + width="50" + align="center" + ></el-table-column> + <el-table-column + prop="population" + label="浜哄憳(浜�)" + width="23" + align="center" + ></el-table-column> + <el-table-column + prop="room" + label="鎴垮眿(闂�)" + width="23" + align="center" + ></el-table-column> + <el-table-column + prop="households" + label="鎴锋暟(鎴�)" + width="23" + align="center" + ></el-table-column> + <el-table-column + prop="property" + label="璐骇(涓囧厓)" + width="23" + align="center" + ></el-table-column> + <el-table-column + prop="maxDepth" + label="鏈�澶ф按娣�(绫�)" + width="28" + align="center" + ></el-table-column> + <el-table-column + prop="maxVelocity" + label="鏈�澶ф祦閫�(m/s)" + width="35" + align="center" + ></el-table-column> + <el-table-column + prop="raininess" + label="闆ㄥ己(mm/h)" + width="28" + align="center" + ></el-table-column> + <el-table-column + prop="warningLevel" + label="棰勮绛夌骇" + width="28" + align="center" + ></el-table-column> </el-table> </div> </div> @@ -51,7 +101,14 @@ <script setup> import * as echarts from "echarts"; import { EventBus } from "@/eventBus"; // 寮曞叆浜嬩欢鎬荤嚎 -import { ref, onMounted, onBeforeUnmount, nextTick, watch, onUnmounted } from "vue"; +import { + ref, + onMounted, + onBeforeUnmount, + nextTick, + watch, + onUnmounted, +} from "vue"; import dayjs from "dayjs"; import { getRainfall } from "@/api"; @@ -64,6 +121,8 @@ const chart2Data = ref(null); let intervalId1 = null; let intervalId2 = null; + +const nowTime = ref(null); const isFinished = ref(true); @@ -188,1508 +247,6 @@ ]); const rainChangeShow = ref(false); const tableContainer = ref(null); -const rainfallData = ref([ - { - time: "2023-07-30 00:00:00", - total: 0.2, - value: 0.2, - }, - { - time: "2023-07-30 00:10:00", - total: 0.5, - value: 0.3, - }, - { - time: "2023-07-30 00:20:00", - total: 0.6, - value: 0.1, - }, - { - time: "2023-07-30 00:30:00", - total: 0.7, - value: 0.1, - }, - { - time: "2023-07-30 00:40:00", - total: 0.8, - value: 0.1, - }, - { - time: "2023-07-30 00:50:00", - total: 2.2, - value: 1.4, - }, - { - time: "2023-07-30 01:00:00", - total: 9.4, - value: 7.2, - }, - { - time: "2023-07-30 01:10:00", - total: 9.5, - value: 0.1, - }, - { - time: "2023-07-30 01:20:00", - total: 9.6, - value: 0.1, - }, - { - time: "2023-07-30 01:30:00", - total: 9.7, - value: 0.1, - }, - { - time: "2023-07-30 01:40:00", - total: 9.8, - value: 0.1, - }, - { - time: "2023-07-30 01:50:00", - total: 9.9, - value: 0.1, - }, - { - time: "2023-07-30 02:00:00", - total: 19.5, - value: 9.6, - }, - { - time: "2023-07-30 02:10:00", - total: 19.7, - value: 0.2, - }, - { - time: "2023-07-30 02:20:00", - total: 20.5, - value: 0.8, - }, - { - time: "2023-07-30 02:30:00", - total: 20.9, - value: 0.4, - }, - { - time: "2023-07-30 02:40:00", - total: 21.3, - value: 0.4, - }, - { - time: "2023-07-30 02:50:00", - total: 21.8, - value: 0.5, - }, - { - time: "2023-07-30 03:00:00", - total: 21.9, - value: 0.1, - }, - { - time: "2023-07-30 03:10:00", - total: 22.1, - value: 0.2, - }, - { - time: "2023-07-30 03:20:00", - total: 22.4, - value: 0.3, - }, - { - time: "2023-07-30 03:30:00", - total: 22.5, - value: 0.1, - }, - { - time: "2023-07-30 03:40:00", - total: 23.1, - value: 0.6, - }, - { - time: "2023-07-30 03:50:00", - total: 25.1, - value: 2.0, - }, - { - time: "2023-07-30 04:00:00", - total: 27.7, - value: 2.6, - }, - { - time: "2023-07-30 04:10:00", - total: 28.1, - value: 0.4, - }, - { - time: "2023-07-30 04:20:00", - total: 29.0, - value: 0.9, - }, - { - time: "2023-07-30 04:30:00", - total: 30.5, - value: 1.5, - }, - { - time: "2023-07-30 04:40:00", - total: 31.3, - value: 0.8, - }, - { - time: "2023-07-30 04:50:00", - total: 32.1, - value: 0.8, - }, - { - time: "2023-07-30 05:00:00", - total: 33.1, - value: 1.0, - }, - { - time: "2023-07-30 05:10:00", - total: 43.5, - value: 10.4, - }, - { - time: "2023-07-30 05:20:00", - total: 45.9, - value: 2.4, - }, - { - time: "2023-07-30 05:30:00", - total: 47.3, - value: 1.4, - }, - { - time: "2023-07-30 05:40:00", - total: 48.5, - value: 1.2, - }, - { - time: "2023-07-30 05:50:00", - total: 49.3, - value: 0.8, - }, - { - time: "2023-07-30 06:00:00", - total: 50.1, - value: 0.8, - }, - { - time: "2023-07-30 06:10:00", - total: 51.1, - value: 1.0, - }, - { - time: "2023-07-30 06:20:00", - total: 52.1, - value: 1.0, - }, - { - time: "2023-07-30 06:30:00", - total: 52.7, - value: 0.6, - }, - { - time: "2023-07-30 06:40:00", - total: 52.9, - value: 0.2, - }, - { - time: "2023-07-30 06:50:00", - total: 53.3, - value: 0.4, - }, - { - time: "2023-07-30 07:00:00", - total: 53.7, - value: 0.4, - }, - { - time: "2023-07-30 07:10:00", - total: 60.3, - value: 6.6, - }, - { - time: "2023-07-30 07:20:00", - total: 60.9, - value: 0.6, - }, - { - time: "2023-07-30 07:30:00", - total: 61.5, - value: 0.6, - }, - { - time: "2023-07-30 07:40:00", - total: 62.7, - value: 1.2, - }, - { - time: "2023-07-30 07:50:00", - total: 63.3, - value: 0.6, - }, - { - time: "2023-07-30 08:00:00", - total: 63.9, - value: 0.6, - }, - { - time: "2023-07-30 08:10:00", - total: 65.3, - value: 1.4, - }, - { - time: "2023-07-30 08:20:00", - total: 67.7, - value: 2.4, - }, - { - time: "2023-07-30 08:30:00", - total: 68.9, - value: 1.2, - }, - { - time: "2023-07-30 08:40:00", - total: 70.1, - value: 1.2, - }, - { - time: "2023-07-30 08:50:00", - total: 71.7, - value: 1.6, - }, - { - time: "2023-07-30 09:00:00", - total: 75.1, - value: 3.4, - }, - { - time: "2023-07-30 09:10:00", - total: 85.9, - value: 10.8, - }, - { - time: "2023-07-30 09:20:00", - total: 87.9, - value: 2.0, - }, - { - time: "2023-07-30 09:30:00", - total: 89.3, - value: 1.4, - }, - { - time: "2023-07-30 09:40:00", - total: 90.1, - value: 0.8, - }, - { - time: "2023-07-30 09:50:00", - total: 92.7, - value: 2.6, - }, - { - time: "2023-07-30 10:00:00", - total: 95.3, - value: 2.6, - }, - { - time: "2023-07-30 10:10:00", - total: 98.1, - value: 2.8, - }, - { - time: "2023-07-30 10:20:00", - total: 100.5, - value: 2.4, - }, - { - time: "2023-07-30 10:30:00", - total: 102.9, - value: 2.4, - }, - { - time: "2023-07-30 10:40:00", - total: 106.9, - value: 4.0, - }, - { - time: "2023-07-30 10:50:00", - total: 109.5, - value: 2.6, - }, - { - time: "2023-07-30 11:00:00", - total: 110.5, - value: 1.0, - }, - { - time: "2023-07-30 11:10:00", - total: 118.9, - value: 8.4, - }, - { - time: "2023-07-30 11:20:00", - total: 121.3, - value: 2.4, - }, - { - time: "2023-07-30 11:30:00", - total: 123.5, - value: 2.2, - }, - { - time: "2023-07-30 11:40:00", - total: 126.3, - value: 2.8, - }, - { - time: "2023-07-30 11:50:00", - total: 128.7, - value: 2.4, - }, - { - time: "2023-07-30 12:00:00", - total: 129.7, - value: 1.0, - }, - { - time: "2023-07-30 12:10:00", - total: 130.5, - value: 0.8, - }, - { - time: "2023-07-30 12:20:00", - total: 131.7, - value: 1.2, - }, - { - time: "2023-07-30 12:30:00", - total: 133.3, - value: 1.6, - }, - { - time: "2023-07-30 12:40:00", - total: 136.3, - value: 3.0, - }, - { - time: "2023-07-30 12:50:00", - total: 139.5, - value: 3.2, - }, - { - time: "2023-07-30 13:00:00", - total: 141.9, - value: 2.4, - }, - { - time: "2023-07-30 13:10:00", - total: 144.5, - value: 2.6, - }, - { - time: "2023-07-30 13:20:00", - total: 154.1, - value: 9.6, - }, - { - time: "2023-07-30 13:30:00", - total: 155.9, - value: 1.8, - }, - { - time: "2023-07-30 13:40:00", - total: 157.7, - value: 1.8, - }, - { - time: "2023-07-30 13:50:00", - total: 160.1, - value: 2.4, - }, - { - time: "2023-07-30 14:00:00", - total: 163.1, - value: 3.0, - }, - { - time: "2023-07-30 14:10:00", - total: 165.1, - value: 2.0, - }, - { - time: "2023-07-30 14:20:00", - total: 167.1, - value: 2.0, - }, - { - time: "2023-07-30 14:30:00", - total: 168.9, - value: 1.8, - }, - { - time: "2023-07-30 14:40:00", - total: 170.7, - value: 1.8, - }, - { - time: "2023-07-30 14:50:00", - total: 172.1, - value: 1.4, - }, - { - time: "2023-07-30 15:00:00", - total: 173.9, - value: 1.8, - }, - { - time: "2023-07-30 15:10:00", - total: 177.9, - value: 4.0, - }, - { - time: "2023-07-30 15:20:00", - total: 179.9, - value: 2.0, - }, - { - time: "2023-07-30 15:30:00", - total: 186.1, - value: 6.2, - }, - { - time: "2023-07-30 15:40:00", - total: 188.9, - value: 2.8, - }, - { - time: "2023-07-30 15:50:00", - total: 192.1, - value: 3.2, - }, - { - time: "2023-07-30 16:00:00", - total: 194.1, - value: 2.0, - }, - { - time: "2023-07-30 16:10:00", - total: 196.9, - value: 2.8, - }, - { - time: "2023-07-30 16:20:00", - total: 208.9, - value: 12.0, - }, - { - time: "2023-07-30 16:30:00", - total: 211.9, - value: 3.0, - }, - { - time: "2023-07-30 16:40:00", - total: 216.7, - value: 4.8, - }, - { - time: "2023-07-30 16:50:00", - total: 223.5, - value: 6.8, - }, - { - time: "2023-07-30 17:00:00", - total: 228.1, - value: 4.6, - }, - { - time: "2023-07-30 17:10:00", - total: 232.3, - value: 4.2, - }, - { - time: "2023-07-30 17:20:00", - total: 234.7, - value: 2.4, - }, - { - time: "2023-07-30 17:30:00", - total: 237.7, - value: 3.0, - }, - { - time: "2023-07-30 17:40:00", - total: 241.3, - value: 3.6, - }, - { - time: "2023-07-30 17:50:00", - total: 245.1, - value: 3.8, - }, - { - time: "2023-07-30 18:00:00", - total: 250.3, - value: 5.2, - }, - { - time: "2023-07-30 18:10:00", - total: 258.1, - value: 7.8, - }, - { - time: "2023-07-30 18:20:00", - total: 265.1, - value: 7.0, - }, - { - time: "2023-07-30 18:30:00", - total: 268.3, - value: 3.2, - }, - { - time: "2023-07-30 18:40:00", - total: 271.9, - value: 3.6, - }, - { - time: "2023-07-30 18:50:00", - total: 283.7, - value: 11.8, - }, - { - time: "2023-07-30 19:00:00", - total: 287.9, - value: 4.2, - }, - { - time: "2023-07-30 19:10:00", - total: 291.3, - value: 3.4, - }, - { - time: "2023-07-30 19:20:00", - total: 295.1, - value: 3.8, - }, - { - time: "2023-07-30 19:30:00", - total: 300.7, - value: 5.6, - }, - { - time: "2023-07-30 19:40:00", - total: 306.3, - value: 5.6, - }, - { - time: "2023-07-30 19:50:00", - total: 312.1, - value: 5.8, - }, - { - time: "2023-07-30 20:00:00", - total: 317.7, - value: 5.6, - }, - { - time: "2023-07-30 20:10:00", - total: 325.9, - value: 8.2, - }, - { - time: "2023-07-30 20:20:00", - total: 343.3, - value: 17.4, - }, - { - time: "2023-07-30 20:30:00", - total: 353.7, - value: 10.4, - }, - { - time: "2023-07-30 20:40:00", - total: 361.7, - value: 8.0, - }, - { - time: "2023-07-30 20:50:00", - total: 366.7, - value: 5.0, - }, - { - time: "2023-07-30 21:00:00", - total: 369.9, - value: 3.2, - }, - { - time: "2023-07-30 21:10:00", - total: 372.9, - value: 3.0, - }, - { - time: "2023-07-30 21:20:00", - total: 374.3, - value: 1.4, - }, - { - time: "2023-07-30 21:30:00", - total: 376.7, - value: 2.4, - }, - { - time: "2023-07-30 21:40:00", - total: 379.5, - value: 2.8, - }, - { - time: "2023-07-30 21:50:00", - total: 384.5, - value: 5.0, - }, - { - time: "2023-07-30 22:00:00", - total: 387.1, - value: 2.6, - }, - { - time: "2023-07-30 22:10:00", - total: 387.5, - value: 0.4, - }, - { - time: "2023-07-30 22:20:00", - total: 388.9, - value: 1.4, - }, - { - time: "2023-07-30 22:30:00", - total: 398.5, - value: 9.6, - }, - { - time: "2023-07-30 22:40:00", - total: 400.1, - value: 1.6, - }, - { - time: "2023-07-30 22:50:00", - total: 401.7, - value: 1.6, - }, - { - time: "2023-07-30 23:00:00", - total: 403.1, - value: 1.4, - }, - { - time: "2023-07-30 23:10:00", - total: 404.7, - value: 1.6, - }, - { - time: "2023-07-30 23:20:00", - total: 406.5, - value: 1.8, - }, - { - time: "2023-07-30 23:30:00", - total: 412.3, - value: 5.8, - }, - { - time: "2023-07-30 23:40:00", - total: 417.5, - value: 5.2, - }, - { - time: "2023-07-30 23:50:00", - total: 420.1, - value: 2.6, - }, - { - time: "2023-07-31 00:00:00", - total: 422.3, - value: 2.2, - }, - { - time: "2023-07-31 00:10:00", - total: 425.5, - value: 3.2, - }, - { - time: "2023-07-31 00:20:00", - total: 426.3, - value: 0.8, - }, - { - time: "2023-07-31 00:30:00", - total: 427.7, - value: 1.4, - }, - { - time: "2023-07-31 00:40:00", - total: 428.5, - value: 0.8, - }, - { - time: "2023-07-31 00:50:00", - total: 429.3, - value: 0.8, - }, - { - time: "2023-07-31 01:00:00", - total: 434.9, - value: 5.6, - }, - { - time: "2023-07-31 01:10:00", - total: 437.5, - value: 2.6, - }, - { - time: "2023-07-31 01:20:00", - total: 438.3, - value: 0.8, - }, - { - time: "2023-07-31 01:30:00", - total: 439.9, - value: 1.6, - }, - { - time: "2023-07-31 01:40:00", - total: 442.5, - value: 2.6, - }, - { - time: "2023-07-31 01:50:00", - total: 446.9, - value: 4.4, - }, - { - time: "2023-07-31 02:00:00", - total: 449.9, - value: 3.0, - }, - { - time: "2023-07-31 02:10:00", - total: 450.9, - value: 1.0, - }, - { - time: "2023-07-31 02:20:00", - total: 451.9, - value: 1.0, - }, - { - time: "2023-07-31 02:30:00", - total: 452.7, - value: 0.8, - }, - { - time: "2023-07-31 02:40:00", - total: 453.9, - value: 1.2, - }, - { - time: "2023-07-31 02:50:00", - total: 454.3, - value: 0.4, - }, - { - time: "2023-07-31 03:00:00", - total: 455.3, - value: 1.0, - }, - { - time: "2023-07-31 03:10:00", - total: 455.9, - value: 0.6, - }, - { - time: "2023-07-31 03:20:00", - total: 458.7, - value: 2.8, - }, - { - time: "2023-07-31 03:30:00", - total: 459.4, - value: 0.7, - }, - { - time: "2023-07-31 03:40:00", - total: 461.5, - value: 2.1, - }, - { - time: "2023-07-31 03:50:00", - total: 466.9, - value: 5.4, - }, - { - time: "2023-07-31 04:00:00", - total: 467.3, - value: 0.4, - }, - { - time: "2023-07-31 04:10:00", - total: 467.9, - value: 0.6, - }, - { - time: "2023-07-31 04:20:00", - total: 469.1, - value: 1.2, - }, - { - time: "2023-07-31 04:30:00", - total: 472.5, - value: 3.4, - }, - { - time: "2023-07-31 04:40:00", - total: 473.4, - value: 0.9, - }, - { - time: "2023-07-31 04:50:00", - total: 473.8, - value: 0.4, - }, - { - time: "2023-07-31 05:00:00", - total: 474.5, - value: 0.7, - }, - { - time: "2023-07-31 05:10:00", - total: 477.3, - value: 2.8, - }, - { - time: "2023-07-31 05:20:00", - total: 489.5, - value: 12.2, - }, - { - time: "2023-07-31 05:30:00", - total: 495.9, - value: 6.4, - }, - { - time: "2023-07-31 05:40:00", - total: 503.9, - value: 8.0, - }, - { - time: "2023-07-31 05:50:00", - total: 505.5, - value: 1.6, - }, - { - time: "2023-07-31 06:00:00", - total: 506.7, - value: 1.2, - }, - { - time: "2023-07-31 06:10:00", - total: 509.7, - value: 3.0, - }, - { - time: "2023-07-31 06:20:00", - total: 513.9, - value: 4.2, - }, - { - time: "2023-07-31 06:30:00", - total: 515.3, - value: 1.4, - }, - { - time: "2023-07-31 06:40:00", - total: 517.3, - value: 2.0, - }, - { - time: "2023-07-31 06:50:00", - total: 519.3, - value: 2.0, - }, - { - time: "2023-07-31 07:00:00", - total: 523.7, - value: 4.4, - }, - { - time: "2023-07-31 07:10:00", - total: 526.3, - value: 2.6, - }, - { - time: "2023-07-31 07:20:00", - total: 528.9, - value: 2.6, - }, - { - time: "2023-07-31 07:30:00", - total: 535.5, - value: 6.6, - }, - { - time: "2023-07-31 07:40:00", - total: 541.1, - value: 5.6, - }, - { - time: "2023-07-31 07:50:00", - total: 544.3, - value: 3.2, - }, - { - time: "2023-07-31 08:00:00", - total: 550.1, - value: 5.8, - }, - { - time: "2023-07-31 08:10:00", - total: 553.9, - value: 3.8, - }, - { - time: "2023-07-31 08:20:00", - total: 559.7, - value: 5.8, - }, - { - time: "2023-07-31 08:30:00", - total: 562.9, - value: 3.2, - }, - { - time: "2023-07-31 08:40:00", - total: 572.1, - value: 9.2, - }, - { - time: "2023-07-31 08:50:00", - total: 585.3, - value: 13.2, - }, - { - time: "2023-07-31 09:00:00", - total: 596.9, - value: 11.6, - }, - { - time: "2023-07-31 09:10:00", - total: 610.1, - value: 13.2, - }, - { - time: "2023-07-31 09:20:00", - total: 621.5, - value: 11.4, - }, - { - time: "2023-07-31 09:30:00", - total: 628.1, - value: 6.6, - }, - { - time: "2023-07-31 09:40:00", - total: 633.3, - value: 5.2, - }, - { - time: "2023-07-31 09:50:00", - total: 636.5, - value: 3.2, - }, - { - time: "2023-07-31 10:00:00", - total: 642.6, - value: 6.1, - }, - { - time: "2023-07-31 10:10:00", - total: 647.9, - value: 5.3, - }, - { - time: "2023-07-31 10:20:00", - total: 655.3, - value: 7.4, - }, - { - time: "2023-07-31 10:30:00", - total: 668.5, - value: 13.2, - }, - { - time: "2023-07-31 10:40:00", - total: 675.3, - value: 6.8, - }, - { - time: "2023-07-31 10:50:00", - total: 681.1, - value: 5.8, - }, - { - time: "2023-07-31 11:00:00", - total: 682.1, - value: 1.0, - }, - { - time: "2023-07-31 11:10:00", - total: 684.1, - value: 2.0, - }, - { - time: "2023-07-31 11:20:00", - total: 688.3, - value: 4.2, - }, - { - time: "2023-07-31 11:30:00", - total: 690.7, - value: 2.4, - }, - { - time: "2023-07-31 11:40:00", - total: 694.5, - value: 3.8, - }, - { - time: "2023-07-31 11:50:00", - total: 704.1, - value: 9.6, - }, - { - time: "2023-07-31 12:00:00", - total: 711.3, - value: 7.2, - }, - { - time: "2023-07-31 12:10:00", - total: 715.9, - value: 4.6, - }, - { - time: "2023-07-31 12:20:00", - total: 717.5, - value: 1.6, - }, - { - time: "2023-07-31 12:30:00", - total: 724.3, - value: 6.8, - }, - { - time: "2023-07-31 12:40:00", - total: 724.4, - value: 0.1, - }, - { - time: "2023-07-31 12:50:00", - total: 724.7, - value: 0.3, - }, - { - time: "2023-07-31 13:00:00", - total: 725.1, - value: 0.4, - }, - { - time: "2023-07-31 13:10:00", - total: 726.7, - value: 1.6, - }, - { - time: "2023-07-31 13:20:00", - total: 726.8, - value: 0.1, - }, - { - time: "2023-07-31 13:30:00", - total: 726.9, - value: 0.1, - }, - { - time: "2023-07-31 13:40:00", - total: 726.9, - value: 0.0, - }, - { - time: "2023-07-31 13:50:00", - total: 726.9, - value: 0.0, - }, - { - time: "2023-07-31 14:00:00", - total: 726.9, - value: 0.0, - }, - { - time: "2023-07-31 14:10:00", - total: 727.0, - value: 0.1, - }, - { - time: "2023-07-31 14:20:00", - total: 727.5, - value: 0.5, - }, - { - time: "2023-07-31 14:30:00", - total: 736.3, - value: 8.8, - }, - { - time: "2023-07-31 14:40:00", - total: 737.3, - value: 1.0, - }, - { - time: "2023-07-31 14:50:00", - total: 737.9, - value: 0.6, - }, - { - time: "2023-07-31 15:00:00", - total: 738.1, - value: 0.2, - }, - { - time: "2023-07-31 15:10:00", - total: 738.9, - value: 0.8, - }, - { - time: "2023-07-31 15:20:00", - total: 741.3, - value: 2.4, - }, - { - time: "2023-07-31 15:30:00", - total: 742.5, - value: 1.2, - }, - { - time: "2023-07-31 15:40:00", - total: 743.7, - value: 1.2, - }, - { - time: "2023-07-31 15:50:00", - total: 744.9, - value: 1.2, - }, - { - time: "2023-07-31 16:00:00", - total: 746.5, - value: 1.6, - }, - { - time: "2023-07-31 16:10:00", - total: 753.5, - value: 7.0, - }, - { - time: "2023-07-31 16:20:00", - total: 753.9, - value: 0.4, - }, - { - time: "2023-07-31 16:30:00", - total: 754.3, - value: 0.4, - }, - { - time: "2023-07-31 16:40:00", - total: 763.7, - value: 9.4, - }, - { - time: "2023-07-31 16:50:00", - total: 765.7, - value: 2.0, - }, - { - time: "2023-07-31 17:00:00", - total: 766.1, - value: 0.4, - }, - { - time: "2023-07-31 17:10:00", - total: 766.2, - value: 0.1, - }, - { - time: "2023-07-31 17:20:00", - total: 766.3, - value: 0.1, - }, - { - time: "2023-07-31 17:30:00", - total: 766.4, - value: 0.1, - }, - { - time: "2023-07-31 17:40:00", - total: 766.5, - value: 0.1, - }, - { - time: "2023-07-31 17:50:00", - total: 766.6, - value: 0.1, - }, - { - time: "2023-07-31 18:00:00", - total: 767.0, - value: 0.4, - }, - { - time: "2023-07-31 18:10:00", - total: 769.2, - value: 2.2, - }, - { - time: "2023-07-31 18:20:00", - total: 771.6, - value: 2.4, - }, - { - time: "2023-07-31 18:30:00", - total: 773.2, - value: 1.6, - }, - { - time: "2023-07-31 18:40:00", - total: 782.0, - value: 8.8, - }, - { - time: "2023-07-31 18:50:00", - total: 783.2, - value: 1.2, - }, - { - time: "2023-07-31 19:00:00", - total: 783.6, - value: 0.4, - }, - { - time: "2023-07-31 19:10:00", - total: 784.2, - value: 0.6, - }, - { - time: "2023-07-31 19:20:00", - total: 784.5, - value: 0.3, - }, - { - time: "2023-07-31 19:30:00", - total: 784.6, - value: 0.1, - }, - { - time: "2023-07-31 19:40:00", - total: 785.0, - value: 0.4, - }, - { - time: "2023-07-31 19:50:00", - total: 786.0, - value: 1.0, - }, - { - time: "2023-07-31 20:00:00", - total: 790.0, - value: 4.0, - }, - { - time: "2023-07-31 20:10:00", - total: 790.4, - value: 0.4, - }, - { - time: "2023-07-31 20:20:00", - total: 790.8, - value: 0.4, - }, - { - time: "2023-07-31 20:30:00", - total: 791.4, - value: 0.6, - }, - { - time: "2023-07-31 20:40:00", - total: 806.0, - value: 14.6, - }, - { - time: "2023-07-31 20:50:00", - total: 811.6, - value: 5.6, - }, - { - time: "2023-07-31 21:00:00", - total: 816.4, - value: 4.8, - }, - { - time: "2023-07-31 21:10:00", - total: 818.6, - value: 2.2, - }, - { - time: "2023-07-31 21:20:00", - total: 824.6, - value: 6.0, - }, - { - time: "2023-07-31 21:30:00", - total: 825.4, - value: 0.8, - }, - { - time: "2023-07-31 21:40:00", - total: 827.6, - value: 2.2, - }, - { - time: "2023-07-31 21:50:00", - total: 833.2, - value: 5.6, - }, - { - time: "2023-07-31 22:00:00", - total: 836.8, - value: 3.6, - }, - { - time: "2023-07-31 22:10:00", - total: 840.4, - value: 3.6, - }, - { - time: "2023-07-31 22:20:00", - total: 843.4, - value: 3.0, - }, - { - time: "2023-07-31 22:30:00", - total: 845.2, - value: 1.8, - }, - { - time: "2023-07-31 22:40:00", - total: 850.0, - value: 4.8, - }, - { - time: "2023-07-31 22:50:00", - total: 861.6, - value: 11.6, - }, - { - time: "2023-07-31 23:00:00", - total: 864.2, - value: 2.6, - }, - { - time: "2023-07-31 23:10:00", - total: 865.8, - value: 1.6, - }, - { - time: "2023-07-31 23:20:00", - total: 868.4, - value: 2.6, - }, - { - time: "2023-07-31 23:30:00", - total: 871.2, - value: 2.8, - }, - { - time: "2023-07-31 23:40:00", - total: 878.4, - value: 7.2, - }, - { - time: "2023-07-31 23:50:00", - total: 883.0, - value: 4.6, - }, - { - time: "2023-08-01 00:00:00", - total: 883.6, - value: 0.6, - }, - { - time: "2023-08-01 00:10:00", - total: 883.6, - value: 0.0, - }, - { - time: "2023-08-01 00:20:00", - total: 883.6, - value: 0.0, - }, - { - time: "2023-08-01 00:30:00", - total: 883.6, - value: 0.0, - }, - { - time: "2023-08-01 00:40:00", - total: 883.6, - value: 0.0, - }, - { - time: "2023-08-01 00:50:00", - total: 883.6, - value: 0.0, - }, - { - time: "2023-08-01 01:00:00", - total: 883.6, - value: 0.0, - }, - { - time: "2023-08-01 01:10:00", - total: 883.6, - value: 0.0, - }, - { - time: "2023-08-01 01:20:00", - total: 883.6, - value: 0.0, - }, - { - time: "2023-08-01 01:30:00", - total: 883.6, - value: 0.0, - }, - { - time: "2023-08-01 01:40:00", - total: 883.6, - value: 0.0, - }, - { - time: "2023-08-01 01:59:00", - total: 883.6, - value: 0.0, - }, -]); let myChart1 = null; let myChart2 = null; @@ -1701,7 +258,9 @@ }; const getDangerInfo = async () => { try { - const response = await fetch("/json/listMaxInfluenceArea_wgs84_output.json"); + const response = await fetch( + "/json/listMaxInfluenceArea_wgs84_output.json" + ); const result = await response.json(); console.log("Loaded JSON data:", result); if (result && result.data && Array.isArray(result.data.items)) { @@ -1778,6 +337,14 @@ charts.style.height = style.height; }; +const syncTimeWithTimeline = () => { + // 2025-05-24 00:25 + // // 灏嗘椂闂村瓧绗︿覆杞崲涓哄垎閽熸暟 (鏍煎紡: "YYYY-MM-DD mm:ss") + const timeParts = nowTime.value.split(" "); + const timeOnly = timeParts[1]; // 鑾峰彇 "mm:ss" 閮ㄥ垎 + return timeOnly; +}; + const setEcharts1 = () => { const chartDom = document.getElementById("echarts1"); myChart1 = echarts.init(chartDom); @@ -1794,14 +361,16 @@ try { const response = await fetch("/json/rainfall.json"); const result = await response.json(); - console.log("Loaded JSON data:", result); if (result && result.data && Array.isArray(result.data)) { rainfallData.value = result.data; - console.log("rainfallData is an array with length:", rainfallData.value.length); // 璁$畻 value 鍜� total 鐨勬渶澶у�� - const maxValue = Math.max(...rainfallData.value.map((item) => item.value)); - const maxTotal = Math.max(...rainfallData.value.map((item) => item.total)); + const maxValue = Math.max( + ...rainfallData.value.map((item) => item.value) + ); + const maxTotal = Math.max( + ...rainfallData.value.map((item) => item.total) + ); // 鍒濆鍖栨椂闂磋酱锛堜粠00:00寮�濮嬶級 xAxisData.value = ["00:00"]; // 鍒濆鏃堕棿鐐� @@ -1817,28 +386,13 @@ const yAxis2Params = calculateYAxisParams(maxTotal); updateChart(yAxis1Params, yAxis2Params); } else { - console.error("Invalid JSON format: 'data' is missing or not an array!"); + console.error( + "Invalid JSON format: 'data' is missing or not an array!" + ); } } catch (error) { console.error("Error fetching data:", error); } - }; - - // 璁$畻涓嬩竴涓椂闂寸偣锛堝鍔�10鍒嗛挓锛� - const getNextTime = (currentTime) => { - const [hours, mins] = currentTime.split(':').map(Number); - let newHours = hours; - let newMins = mins + 10; - - if (newMins >= 60) { - newMins = 0; - newHours += 1; - } - if (newHours >= 24) { - newHours = 0; - } - - return `${String(newHours).padStart(2, "0")}:${String(newMins).padStart(2, "0")}`; }; // 璁$畻 y 杞村弬鏁帮紙鏈�澶氭湁 4 涓偣锛� @@ -1979,9 +533,7 @@ data1.value.push(newItem.value); // 娣诲姞闄嶉洦鏁版嵁 data2.value.push(newItem.total); // 娣诲姞绱闆ㄩ噺 - // 璁$畻骞舵坊鍔犳柊鐨勬椂闂寸偣锛堝墠涓�涓椂闂寸偣+10鍒嗛挓锛� - const lastTime = xAxisData.value[xAxisData.value.length - 1] || "00:00"; - const nextTime = getNextTime(lastTime); + const nextTime = syncTimeWithTimeline(); xAxisData.value.push(nextTime); // 鏇存柊褰撳墠绱㈠紩 @@ -2077,17 +629,15 @@ try { const response = await fetch("/json/浜庡瑗挎矡鏂潰涓嬫暟鎹�.json"); const result = await response.json(); - console.log("Loaded JSON data:", result); if (result && result.data && Array.isArray(result.data)) { jsonData.value = result.data; - console.log("jsonData is an array with length:", jsonData.value.length); // 璁$畻 value 鍜� total 鐨勬渶澶у�� const maxValue = Math.max(...jsonData.value.map((item) => item.value)); const maxTotal = Math.max(...jsonData.value.map((item) => item.total)); // 鍒濆鍖栨椂闂磋酱锛堜粠00:00寮�濮嬶級 - xAxisData.value = ["00:00"]; // 鍒濆鏃堕棿鐐� + xAxisData.value = ["00:00"] || syncTimeWithTimeline(); // 鍒濆鏃堕棿鐐� // 鍒濆鍖栧浘琛紙浠呭姞杞界涓�涓暟鎹偣锛� if (jsonData.value.length > 0) { @@ -2100,29 +650,15 @@ const yAxis2Params = calculateYAxisParams(maxTotal); updateChart(yAxis1Params, yAxis2Params); } else { - console.error("Invalid JSON format: 'data' is missing or not an array!"); + console.error( + "Invalid JSON format: 'data' is missing or not an array!" + ); } } catch (error) { console.error("Error fetching data:", error); } }; - // 璁$畻涓嬩竴涓椂闂寸偣锛堝鍔�10鍒嗛挓锛� - const getNextTime = (currentTime) => { - const [hours, mins] = currentTime.split(':').map(Number); - let newHours = hours; - let newMins = mins + 10; - - if (newMins >= 60) { - newMins = 0; - newHours += 1; - } - if (newHours >= 24) { - newHours = 0; - } - - return `${String(newHours).padStart(2, "0")}:${String(newMins).padStart(2, "0")}`; - }; // 璁$畻 y 杞村弬鏁帮紙鏈�澶氭湁 4 涓偣锛� const calculateYAxisParams = (max) => { @@ -2262,9 +798,7 @@ data1.value.push(newItem.value); // 娣诲姞瀹炴椂娴侀噺 data2.value.push(newItem.total); // 娣诲姞绱娴侀噺 - // 璁$畻骞舵坊鍔犳柊鐨勬椂闂寸偣锛堝墠涓�涓椂闂寸偣+10鍒嗛挓锛� - const lastTime = xAxisData.value[xAxisData.value.length - 1] || "00:00"; - const nextTime = getNextTime(lastTime); + const nextTime = syncTimeWithTimeline(); xAxisData.value.push(nextTime); // 鏇存柊褰撳墠绱㈠紩 @@ -2352,7 +886,10 @@ }; onMounted(() => { - getRainfallData(); + // getRainfallData(); + EventBus.on("time-update", (time) => { + nowTime.value = time; + }); chart1Data.value = setEcharts1(); chart2Data.value = setEcharts2(); myChart1 = chart1Data.value.myChart1; @@ -2361,6 +898,8 @@ }); onBeforeUnmount(() => { + EventBus.off("time-update"); // 娓呯悊浜嬩欢鐩戝惉 + nowTime.value = null; if (intervalId1) clearInterval(intervalId1); if (intervalId2) clearInterval(intervalId2); if (dataIntervalId) clearInterval(dataIntervalId); -- Gitblit v1.9.3