...
|
...
|
@@ -105,8 +105,8 @@ |
105
|
105
|
@change="(v: number, o: Recordable, w: Recordable, s1: number) => onHandleSelectProvince(v, o, item, map3DIndex)"
|
106
|
106
|
placeholder="请选择省份" v-model:value="item.name" :options="item.provinceOptions" />
|
107
|
107
|
</setting-item>
|
108
|
|
- <setting-item name="城市名称">
|
109
|
|
- <n-select placeholder="请选择城市" v-model:value="item.city_name" :options="item.cityOptions" />
|
|
108
|
+ <setting-item name="市/区/县名称">
|
|
109
|
+ <n-select placeholder="请选择市/区/县" v-model:value="item.city_name" :options="item.cityOptions" />
|
110
|
110
|
</setting-item>
|
111
|
111
|
<setting-item name="区块厚度">
|
112
|
112
|
<n-input-number v-model:value="item.height"> </n-input-number>
|
...
|
...
|
@@ -212,9 +212,11 @@ const getAreaLists = async (level = areaEnum.PROVINCE, parentId = 1) => { |
212
|
212
|
}
|
213
|
213
|
|
214
|
214
|
onMounted(async () => {
|
|
215
|
+ const {saveSelect} = unref(mapRegionCache) || {}
|
|
216
|
+ const {levelStr} = saveSelect || {}
|
215
|
217
|
datasetMap3DList.value.forEach(async (item: Recordable) => {
|
216
|
218
|
item.provinceOptions = await getAreaLists()
|
217
|
|
- item.cityOptions = await getAreaLists(areaEnum.CITY, !item.adcode ? mapRegionCache.value.adcode : item.adcode)
|
|
219
|
+ item.cityOptions = await getAreaLists(levelStr===areaEnum.CITY?areaEnum.COUNTY:areaEnum.CITY, !item.adcode ? mapRegionCache.value.adcode : item.adcode)
|
218
|
220
|
item.adcode = !item.adcode ? mapRegionCache.value.adcode : item.adcode
|
219
|
221
|
})
|
220
|
222
|
})
|
...
|
...
|
@@ -229,11 +231,11 @@ const onHandleSelectProvince = async (value: number, option: Recordable, item: R |
229
|
231
|
const handleAddRegion =async () => {
|
230
|
232
|
props.optionData.dataset.map3D.push(cloneDeep(STATIC_SCATTER_CONFIG))
|
231
|
233
|
if (mapRegionCache.value.adcode !== 'china') {
|
232
|
|
- const { adcode, areaName } = unref(mapRegionCache) || {}
|
233
|
|
- const cityOptions = await getAreaLists(areaEnum.CITY, adcode)
|
|
234
|
+ const { adcode, areaName,saveSelect } = unref(mapRegionCache) || {}
|
|
235
|
+ const {levelStr} = saveSelect || {}
|
|
236
|
+ const cityOptions = await getAreaLists(levelStr===areaEnum.CITY?areaEnum.COUNTY:areaEnum.CITY, adcode)
|
234
|
237
|
// 循环 push 城市数据
|
235
|
238
|
datasetMap3DList.value.forEach((item: any) => {
|
236
|
|
-
|
237
|
239
|
item.name = areaName
|
238
|
240
|
item.value = null
|
239
|
241
|
item.cityOptions = cityOptions && cityOptions.length ? cityOptions : [{ adcode, label: areaName, value: areaName }]
|
...
|
...
|
@@ -274,8 +276,9 @@ const onHandleSelectValues = async (values: regionInfo) => { |
274
|
276
|
}
|
275
|
277
|
|
276
|
278
|
const setDatasetArea = async () => {
|
277
|
|
- const { adcode, areaName } = unref(mapRegionCache) || {}
|
278
|
|
- const cityOptions = await getAreaLists(areaEnum.CITY, adcode)
|
|
279
|
+ const { adcode, areaName,saveSelect } = unref(mapRegionCache) || {}
|
|
280
|
+ const {levelStr} = saveSelect || {}
|
|
281
|
+ const cityOptions = await getAreaLists(levelStr===areaEnum.CITY?areaEnum.COUNTY:areaEnum.CITY, adcode)
|
279
|
282
|
// 循环 push 城市数据
|
280
|
283
|
datasetMap3DList.value.forEach((item: any) => {
|
281
|
284
|
item.name = areaName
|
...
|
...
|
|