Commit 71a1be2319f78f9253757d606a0cf4dcc57a46b8
1 parent
f2e6d56f
feat(src/packages): 图表3d地图增加loading效果
Showing
1 changed file
with
8 additions
and
1 deletions
1 | <template> | 1 | <template> |
2 | <!-- 原生方式,没有使用vue-echarts --> | 2 | <!-- 原生方式,没有使用vue-echarts --> |
3 | - <div :style="`width:${w}px;height:${h}px;`" ref="map3DRef"></div> | 3 | + <n-space vertical> |
4 | + <n-spin :show="show"> | ||
5 | + <div :style="`width:${w}px;height:${h}px;`" ref="map3DRef"></div> | ||
6 | + </n-spin> | ||
7 | + </n-space> | ||
4 | </template> | 8 | </template> |
5 | 9 | ||
6 | <script setup lang="ts"> | 10 | <script setup lang="ts"> |
@@ -26,6 +30,8 @@ const { w, h } = toRefs(props.chartConfig.attr) | @@ -26,6 +30,8 @@ const { w, h } = toRefs(props.chartConfig.attr) | ||
26 | 30 | ||
27 | const map3DRef = ref() | 31 | const map3DRef = ref() |
28 | 32 | ||
33 | +const show = ref(true) | ||
34 | + | ||
29 | const chartInstance = ref() | 35 | const chartInstance = ref() |
30 | 36 | ||
31 | const toolBoxOption = ref({ | 37 | const toolBoxOption = ref({ |
@@ -130,6 +136,7 @@ const getGeojson = (regionId: any) => { | @@ -130,6 +136,7 @@ const getGeojson = (regionId: any) => { | ||
130 | const geoJsonFile = JSON.parse(geoJson) | 136 | const geoJsonFile = JSON.parse(geoJson) |
131 | saveGeojson.value = geoJsonFile | 137 | saveGeojson.value = geoJsonFile |
132 | registerMap(level === areaEnum.COUNTRY ? name : code, { geoJSON: geoJsonFile as any, specialAreas: {} }) | 138 | registerMap(level === areaEnum.COUNTRY ? name : code, { geoJSON: geoJsonFile as any, specialAreas: {} }) |
139 | + show.value = false | ||
133 | resolve(true) | 140 | resolve(true) |
134 | }) | 141 | }) |
135 | }) | 142 | }) |