|
@@ -155,7 +155,7 @@ async function asyncLoadData(item: CascaderItem) {
|
|
|
data: region,
|
|
data: region,
|
|
|
}));
|
|
}));
|
|
|
}
|
|
}
|
|
|
-function handlePickEnd(values: CascaderItem[]) {
|
|
|
|
|
|
|
+async function handlePickEnd(values: CascaderItem[]) {
|
|
|
if (values.length > 0) {
|
|
if (values.length > 0) {
|
|
|
selectedRegion.value = values[values.length - 1].data;
|
|
selectedRegion.value = values[values.length - 1].data;
|
|
|
let i = values.length - 1;
|
|
let i = values.length - 1;
|
|
@@ -169,6 +169,25 @@ function handlePickEnd(values: CascaderItem[]) {
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ const areaCode = Number(selectedValue.value[selectedValue.value.length - 1]);
|
|
|
|
|
+ try {
|
|
|
|
|
+ const mapVillages = await LightVillageApi.getMapVillage({ areaCode });
|
|
|
|
|
+ const existingVillages = mapVillages.filter(v => v.village_id !== null);
|
|
|
|
|
+ if (existingVillages.length > 0) {
|
|
|
|
|
+ searchedList.value = existingVillages.map(v => ({
|
|
|
|
|
+ id: v.village_id!,
|
|
|
|
|
+ name: v.village_name || v.name,
|
|
|
|
|
+ image: '',
|
|
|
|
|
+ address: v.merger_name?.replace(/,/g, '') || '',
|
|
|
|
|
+ }) as unknown as VillageListItem);
|
|
|
|
|
+ showSearchedList.value = true;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (_) {
|
|
|
|
|
+ // 查询失败不阻塞流程,继续进入输入信息步骤
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (i !== values.length - 1) {
|
|
if (i !== values.length - 1) {
|
|
|
alert({
|
|
alert({
|
|
|
title: '提示',
|
|
title: '提示',
|