From 1dadfc0b6b372dd16874d18bed4ab76cd09a190c Mon Sep 17 00:00:00 2001 From: hym Date: Mon, 6 Apr 2026 11:01:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=88=AA=E6=AC=A1=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E8=88=AA=E8=BF=B9=E6=98=BE=E7=A4=BA=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/statistics/ShipStatistics.vue | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/views/statistics/ShipStatistics.vue b/src/views/statistics/ShipStatistics.vue index d2e3b55..e7257a2 100644 --- a/src/views/statistics/ShipStatistics.vue +++ b/src/views/statistics/ShipStatistics.vue @@ -76,7 +76,7 @@ import PieChart from './components/PieChart.vue' import { reportList, shipTotal, shipUnit, shipUnitYear, shipVoyage } from '../../api/statistics' import { getYearRange, filterDictItems } from '../../utils/index' import { initMapbox } from '@/utils/mapbox-utils' -import { loadVectorLayer, loadJsonPointFeature, showUnitReport } from '@/utils/vector-layer-utils' +import { setMapLayoutProperty, loadVectorLayer, loadJsonPointFeature, showUnitReport } from '@/utils/vector-layer-utils' import { ColorGenerator } from '@/utils/color-generator' export default { @@ -171,7 +171,6 @@ export default { // 选择科考船 handleCommand(command) { this.currentTitle = command - // this.removeSingleLineImg() if (command === '全部科考船') { this.getShipList() this.gitShipVoyage() @@ -243,13 +242,7 @@ export default { shipVoyage(params).then(res => { if (params.start || params.end) { // 按年份筛选数据,先隐藏所有图层,再根据筛选结果显示对应图层 - const layers = Vue.config.maps['voyageMap_ship'].getStyle().layers; - layers.forEach(layer => { - // 跳过底图 - if (layer.id !== '影像地图' && layer.type !== 'raster') { - Vue.config.maps['voyageMap_ship'].setLayoutProperty(layer.id, 'visibility', 'none'); - } - }); + setMapLayoutProperty('voyageMap_ship', 'none') } let i = 0 @@ -267,7 +260,6 @@ export default { selectVoyageYear(val) { const shipName = this.currentTitle === '全部科考船' ? '' : this.currentTitle if (val) { - // this.removeSingleLineImg() const params = getYearRange(val) this.gitShipVoyage({ ...params, ship_name: shipName }) } else {