From 977e332a5338942df338728dbfb77a359e35bd0b Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期五, 09 五月 2025 12:25:21 +0800 Subject: [PATCH] 添加动态溯源相关逻辑(待完成) --- src/views/historymode/HistoryMode.vue | 23 +++++++++++++++-------- 1 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/views/historymode/HistoryMode.vue b/src/views/historymode/HistoryMode.vue index 1772dfd..10673f9 100644 --- a/src/views/historymode/HistoryMode.vue +++ b/src/views/historymode/HistoryMode.vue @@ -92,6 +92,8 @@ factorType: defaultOptions(TYPE0).value, // 鐩戞祴鏁版嵁 factorDatas: new FactorDatas(), + // 姹℃煋婧簮缁撴灉 + pollutionData: undefined, // 鍐冲畾缁樺埗3D鍥惧舰鏃舵槸鍚︿笌鍘熷浘鍍忓悎骞� merge: false, // 鍐冲畾缁樺埗瀹�3D鍥惧舰鍚庡湴鍥捐瑙掓槸鍚﹁嚜鍔ㄥ洖涓� @@ -110,7 +112,9 @@ watch: { factorType(nValue, oValue) { if (nValue != oValue && this.status == 0) { + Layer.clear(); this.draw(); + this.drawHighlightPollution(); } } }, @@ -194,12 +198,21 @@ } ); }, + drawHighlightPollution() { + this.pollutionData.forEach((e) => { + if (this.factorType == e.factorId + '') { + const fDatas = this.factorDatas.getByDate(e.startDate, e.endDate); + Layer.drawHighLight3DLayer(fDatas, fDatas.factor[this.factorType]); + } + }); + }, onFetchData(deviceType, data) { if (this.isUnmounted) return; // todo 鏍规嵁璁惧绫诲瀷鍒囨崲鍦板浘鐩戞祴鍥犲瓙灞曠ず鍗曢�夋銆佹姌绾垮浘澶嶉�夋銆佹暟鎹〃鏍煎閫夋鐨勫洜瀛愮被鍨� this.deviceType = deviceType; this.factorDatas.setData(data, this.drawMode, () => { this.factorDatas.refreshHeight(this.factorType); + Layer.clear(); this.draw(); }); }, @@ -227,14 +240,8 @@ handleClick() { const { missionCode } = this.mission; dataAnalysisApi.pollutionTrace(missionCode).then((res) => { - res.data.forEach((e) => { - const fDatas = new FactorDatas(); - fDatas.setData(e.dataVoList, this.drawMode, () => { - fDatas.refreshHeight(this.factorType); - Layer.drawHighLight3DLayer(fDatas, fDatas.factor[this.factorType]); - console.log(e.dataVoList); - }); - }); + this.pollutionData = res.data; + this.drawHighlightPollution(); }); } }, -- Gitblit v1.9.3