From 4e8dec3ba7a99aec224051a6c107a759632ddafb Mon Sep 17 00:00:00 2001 From: chenjinsong <523037378@qq.com> Date: Fri, 6 Sep 2024 18:10:04 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E5=8E=BB=E6=8E=89=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/location/Index.vue | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/views/location/Index.vue b/src/views/location/Index.vue index cce0f17f..e55e78d2 100644 --- a/src/views/location/Index.vue +++ b/src/views/location/Index.vue @@ -379,7 +379,7 @@ import SimpleLoading from '@/components/common/SimpleLoading.vue' import MyFollowBox from '@/components/rightBox/location/MyFollowBox' import dataListMixin from '@/mixins/data-list' -import testData from './test' +// import testData from './test' const humanSvg = '' const baseStationSvg = '' @@ -485,7 +485,7 @@ export default { layout: {}, paint: { 'fill-color': ['get', 'color'], - 'fill-opacity': ['case', ['boolean', ['feature-state', 'hover'], false], 0.7, 0.3] + 'fill-opacity': ['case', ['boolean', ['feature-state', 'hover'], false], 0.7, 0.4] } }) // 六边形的鼠标事件 @@ -527,9 +527,9 @@ export default { } this.loading.pieLoading = true try { - // const response = await axios.get(api.location.density, { params }) - // const densityData = response.data.data - const densityData = testData + const response = await axios.get(api.location.density, { params }) + const densityData = response.data.data + // const densityData = testData // 按值的大小分组,并计算各组数量和颜色 this.pieValueRamp = this.calculateValueRamp(densityData) const option = _.cloneDeep(pieOption) @@ -619,9 +619,9 @@ export default { } this.loading.hexagonLoading = true try { - // const response = await axios.get(api.location.map, { params }) - // return response.data.data - return testData + const response = await axios.get(api.location.map, { params }) + return response.data.data + // return testData } catch (e) { this.errorMsgHandler(e) console.error(e) @@ -744,6 +744,9 @@ export default { const response = await axios.get(api.location.tracking, { params }) const trackingSubscribers = _.cloneDeep(this.trackingSubscribers) if (response.data.data.result) { + response.data.data.result.forEach(item => { + item.trackRecords = item.trackRecords.filter(t => t.hexId) + }) trackingSubscribers.forEach(s => { const find = response.data.data.result.find(item => item.subscriberId === s.subscriberId) if (find) { @@ -837,7 +840,7 @@ export default { layout: {}, paint: { 'fill-color': ['get', 'color'], - 'fill-opacity': ['case', ['boolean', ['feature-state', 'hover'], false], 0.75, 0.5] + 'fill-opacity': ['case', ['boolean', ['feature-state', 'hover'], false], 0.7, 0.4] } }) // 轨迹线