From 5efebb555efd984f3dd35de83e465cd53aaf8175 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期五, 26 四月 2024 10:34:51 +0800 Subject: [PATCH] 完善左上角切换监测因子后,折线图联动切换功能 --- history.mode.js | 37 +++++++++++++++++++++++++++---------- 1 files changed, 27 insertions(+), 10 deletions(-) diff --git a/history.mode.js b/history.mode.js index 77b6c45..2f19c09 100644 --- a/history.mode.js +++ b/history.mode.js @@ -195,6 +195,9 @@ if (!this.mapMaker.runStatus()) { this.drawMesh(false, this, this.factorDatas); } + // 鎶樼嚎鍥鹃�変腑瀵瑰簲鍥犲瓙 + this.choseOneFactorLineChart(factorType); + // 琛ㄦ牸閫変腑瀵瑰簲鍥犲瓙 }, setFactorMode: function (factorMode) { if (this.factorMode != factorMode) { @@ -323,6 +326,25 @@ this.refreshLineChartData(); }, + // 鍗曢�変竴涓洃娴嬪洜瀛愬睍绀烘姌绾垮浘 + 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 = [factorType]; + CheckBox.refreshCheckBox( + 'history_chart_factorbox', + this.lineChartFactorType + ); + this.refreshLineChartData(); + }, // 鍒涘缓鍒濆鎶樼嚎鍥� drawLineChart: function () { this.lineChartOption = FChart.genLineChart( @@ -435,8 +457,10 @@ }, onCheckTable: function (obj) { Table.onChangeTh(obj.value, obj.checked); + DataSummary.onChangeFactor('history_table_summary', obj.value, obj.checked); }, refreshTable: function () { + DataSummary.summary('history_table_summary', this.factorDatas); Table.table( 'history_table', this.originData, @@ -455,11 +479,10 @@ MapUtil.drawSector3(result[0], windDir, windSpeed); // 2. 缁樺埗瀵硅瘽妗� - const window = DialogUtil.createInfoWindow2(factor, () => { + DialogUtil.openNewWindow2(factor, MapUtil._map, result[0], () => { // 绉婚櫎鎵囧舰鍖哄煙 - MapUtil.clearSector3(); + // MapUtil.clearSector3(); }); - window.open(MapUtil._map, result[0]); // 3. 瓒嬪娍鍥捐烦杞畾浣� var f = this.factorDatas.factor[this.factorType + 1 + '']; const progress = FChart.locate( @@ -510,13 +533,7 @@ this.mapMaker.setOnStopCallback( function () { var f = this.factorDatas.factor[this.factorType + 1 + '']; - MapUtil.drawMesh2( - this.factorDatas.lnglats_GD, - this.factorDatas.coors_GD, - f.heights, - f.colors, - f.bottomColor - ); + MapUtil.drawMesh2(this.factorDatas, f); callback(); }.bind(this) ); -- Gitblit v1.9.3