From 5efebb555efd984f3dd35de83e465cd53aaf8175 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期五, 26 四月 2024 10:34:51 +0800 Subject: [PATCH] 完善左上角切换监测因子后,折线图联动切换功能 --- complaint.layer2.js | 2 +- history.mode.js | 8 ++++++-- underway.html | 13 ++++++++----- httpservice.js | 4 ++-- componet/checkbox.js | 3 ++- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/complaint.layer2.js b/complaint.layer2.js index 14b1a70..0af3c36 100644 --- a/complaint.layer2.js +++ b/complaint.layer2.js @@ -115,7 +115,7 @@ }, refreshEPW: function (force) { - var centerData = this.epwResult[(this.epwResult.length - 1) / 2 - 1]; + var centerData = this.epwResult[Math.ceil(this.epwResult.length / 2)]; MapUtil.setCenter([centerData.ciLongitude, centerData.ciLatitude]); if (force || this.points.length == 0) { diff --git a/componet/checkbox.js b/componet/checkbox.js index e7eeee8..6963d35 100644 --- a/componet/checkbox.js +++ b/componet/checkbox.js @@ -39,7 +39,8 @@ var checkboxList = $(`#${elementId}`).find('input') for (let i = 0; i < checkboxList.length; i++) { const box = checkboxList[i]; - $(box).prop('checked', checkedList.indexOf(i) != -1) + const value = $(box).prop('value') + $(box).prop('checked', checkedList.indexOf(parseInt(value)) != -1) } }, diff --git a/history.mode.js b/history.mode.js index 0d2ead3..2f19c09 100644 --- a/history.mode.js +++ b/history.mode.js @@ -327,14 +327,18 @@ this.refreshLineChartData(); }, // 鍗曢�変竴涓洃娴嬪洜瀛愬睍绀烘姌绾垮浘 - choseOneFactorLineChart(index) { + choseOneFactorLineChart(factorType) { + let index = parseInt(factorType) - 1 for (let i = 0; i < this.historyDatas.datas.length; i++) { this.historyDatas.datas[i].show = false; this.historyDatas.physicalQuantity[i].show = false; + // if (this.historyDatas.datas[i].name == Util.factorName[factorName]) { + // index = i + // } } this.historyDatas.datas[index].show = true; this.historyDatas.physicalQuantity[index].show = true; - this.lineChartFactorType = [index]; + this.lineChartFactorType = [factorType]; CheckBox.refreshCheckBox( 'history_chart_factorbox', this.lineChartFactorType diff --git a/httpservice.js b/httpservice.js index 8825fad..148a65a 100644 --- a/httpservice.js +++ b/httpservice.js @@ -1,8 +1,8 @@ var appConfig = { - // baseUrl: "http://114.215.109.124:8805/", + baseUrl: "http://114.215.109.124:8805/", // baseUrl: "http://47.100.191.150:9029/", // baseUrl: "http://localhost:8080/", - baseUrl: 'http://192.168.0.138:8084/', + // baseUrl: 'http://192.168.0.138:8084/', }; var service = { diff --git a/underway.html b/underway.html index 3dfad25..4f4fa44 100644 --- a/underway.html +++ b/underway.html @@ -1165,6 +1165,9 @@ <a id="btn_realtime" class="mode-btn btn-unselected margin-left-8"> <div>璧拌埅鐩戞祴</div> </a> + <a id="btn_gridmonitor" class="mode-btn mode-btn-other btn-unselected margin-left-8"> + <div>缃戞牸鍖栫洃娴�</div> + </a> <!-- <div class="flexbox-col"> <a id="btn_more" class="btn-unselected margin-left-8"> <div id="mode_selected">鍏朵粬妯″紡</div> @@ -1225,7 +1228,7 @@ <script src="./componet/myPage.js"></script> <script src="./lib/tableutil.js?v=11"></script> <script src="./componet/table.js?v=3"></script> - <script src="./componet/checkbox.js?v=3"></script> + <script src="./componet/checkbox.js?v=5"></script> <script src="./lib/multiselect.js"></script> <script src="./lib/jackwei.slider.js?v=2"></script> <script src="./debugdata.js?v=2"></script> @@ -1237,7 +1240,7 @@ <script src="./lib/dialog.js"></script> <script src="./map.util.js?v=9"></script> - <script src="./httpservice.js?v=12"></script> + <script src="./httpservice.js?v=13"></script> <script src="./dataprocesser.js?v=12"></script> <script src="./entity/Legend.js?v=9"></script> <script src="./entity/Factor.js?v=9"></script> @@ -1246,13 +1249,13 @@ <script src="./util/data.summary.js"></script> <script src="./grid.monitor.js?v=14"></script> <script src="./realtime.mode.js?v=34"></script> - <script src="./history.mode.js?v=19"></script> + <script src="./history.mode.js?v=21"></script> <script src="./task.manage.js?v=3"></script> <script src="./company.layer.js?v=3"></script> <script src="./complaint.layer.js?v=4"></script> - <script src="./complaint.layer2.js?v=2"></script> + <script src="./complaint.layer2.js?v=3"></script> <script src="./electrcity.mode.js?v=12"></script> - <script src="./underway.js?v=23"></script> + <script src="./underway.js?v=24"></script> <script src="./test.js"></script> <!-- <script type="text/javascript" src="./asset/data/data.json?callback=debugJson"></script> --> </body> -- Gitblit v1.9.3