Commit 9fd5ad5447d3ea5ab52ce9bb166b41764f270815
1 parent
ab0ff5ef
fix(src/packages): 图表地图 地图右侧配置回显省份选择城市选择
Showing
3 changed files
with
12 additions
and
5 deletions
@@ -4,9 +4,12 @@ import { getAreaList } from '@/api/external/common/index' | @@ -4,9 +4,12 @@ import { getAreaList } from '@/api/external/common/index' | ||
4 | import { areaEnum } from '../config' | 4 | import { areaEnum } from '../config' |
5 | 5 | ||
6 | const props = defineProps({ | 6 | const props = defineProps({ |
7 | - drillingIn:{ | ||
8 | - type:Boolean, | ||
9 | - default:false | 7 | + drillingIn: { |
8 | + type: Boolean, | ||
9 | + default: false | ||
10 | + }, | ||
11 | + optionData: { | ||
12 | + type: Object | ||
10 | } | 13 | } |
11 | }) | 14 | }) |
12 | 15 | ||
@@ -39,6 +42,8 @@ onMounted(async () => { | @@ -39,6 +42,8 @@ onMounted(async () => { | ||
39 | label: '中国', | 42 | label: '中国', |
40 | value: 'china' | 43 | value: 'china' |
41 | }) | 44 | }) |
45 | + onHandleSelectProvince(props.optionData?.mapRegion.saveSelect['provinceValue']) | ||
46 | + for (let i in selectValues) Reflect.set(selectValues, i, props.optionData?.mapRegion.saveSelect[i]) | ||
42 | }) | 47 | }) |
43 | 48 | ||
44 | const onHandleSelectProvince = async (value: number | string) => { | 49 | const onHandleSelectProvince = async (value: number | string) => { |
@@ -22,7 +22,8 @@ export const option = { | @@ -22,7 +22,8 @@ export const option = { | ||
22 | dataset: dataJson, | 22 | dataset: dataJson, |
23 | mapRegion: { | 23 | mapRegion: { |
24 | adcode: 'china', | 24 | adcode: 'china', |
25 | - showHainanIsLands: true | 25 | + showHainanIsLands: true, |
26 | + saveSelect:{} | ||
26 | }, | 27 | }, |
27 | tooltip: { | 28 | tooltip: { |
28 | show: true, | 29 | show: true, |
@@ -39,7 +39,7 @@ | @@ -39,7 +39,7 @@ | ||
39 | ></n-input-number> | 39 | ></n-input-number> |
40 | </SettingItem> | 40 | </SettingItem> |
41 | </SettingItemBox> | 41 | </SettingItemBox> |
42 | - <SelectCity :drillingIn="optionData.drillingIn" @submit="onHandleSelectValues" /> | 42 | + <SelectCity :optionData="optionData" :drillingIn="optionData.drillingIn" @submit="onHandleSelectValues" /> |
43 | <SettingItemBox name="区域颜色"> | 43 | <SettingItemBox name="区域颜色"> |
44 | <SettingItem name="0%处颜色"> | 44 | <SettingItem name="0%处颜色"> |
45 | <n-color-picker | 45 | <n-color-picker |
@@ -300,6 +300,7 @@ const mapRegion = computed(() => { | @@ -300,6 +300,7 @@ const mapRegion = computed(() => { | ||
300 | 300 | ||
301 | const onHandleSelectValues = (values: any) => { | 301 | const onHandleSelectValues = (values: any) => { |
302 | const { cityValue, countyValue, provinceValue } = values | 302 | const { cityValue, countyValue, provinceValue } = values |
303 | + props.optionData.mapRegion.saveSelect = values | ||
303 | props.optionData.mapRegion.adcode = countyValue | 304 | props.optionData.mapRegion.adcode = countyValue |
304 | ? countyValue | 305 | ? countyValue |
305 | : cityValue | 306 | : cityValue |