|
@@ -16,9 +16,6 @@
|
|
|
/>
|
|
/>
|
|
|
</template>
|
|
</template>
|
|
|
<template v-else-if="step === 'inputInfo'">
|
|
<template v-else-if="step === 'inputInfo'">
|
|
|
- <FlexRow center gap="gap.md">
|
|
|
|
|
- <Text>请输入家乡名称,然后选择地图位置定位哦</Text>
|
|
|
|
|
- </FlexRow>
|
|
|
|
|
<Field v-model="currentVillageName" placeholder="请输入家乡名称,例如:大庆村" />
|
|
<Field v-model="currentVillageName" placeholder="请输入家乡名称,例如:大庆村" />
|
|
|
<Field
|
|
<Field
|
|
|
v-model="currentVillageDesc"
|
|
v-model="currentVillageDesc"
|
|
@@ -66,7 +63,8 @@
|
|
|
>
|
|
>
|
|
|
</map>
|
|
</map>
|
|
|
</FlexCol>
|
|
</FlexCol>
|
|
|
- <FlexRow justify="flex-end">
|
|
|
|
|
|
|
+ <FlexRow justify="space-between">
|
|
|
|
|
+ <Text text="如果地图定位不正确,请拖动准星至您的家乡准确位置" fontConfig="secondText" />
|
|
|
<Button :text="'切换' + (enableSatellite ? '地图' : '卫星')" @click="enableSatellite = !enableSatellite" />
|
|
<Button :text="'切换' + (enableSatellite ? '地图' : '卫星')" @click="enableSatellite = !enableSatellite" />
|
|
|
</FlexRow>
|
|
</FlexRow>
|
|
|
<FlexCol gap="gap.md">
|
|
<FlexCol gap="gap.md">
|
|
@@ -108,6 +106,10 @@
|
|
|
import { ref, onMounted } from 'vue';
|
|
import { ref, onMounted } from 'vue';
|
|
|
import { showError } from '@/common/composeabe/ErrorDisplay';
|
|
import { showError } from '@/common/composeabe/ErrorDisplay';
|
|
|
import { toast, alert } from '@/components/dialog/CommonRoot';
|
|
import { toast, alert } from '@/components/dialog/CommonRoot';
|
|
|
|
|
+import { getCascaderItemByValue } from '@/components/form/CascaderUtils';
|
|
|
|
|
+import { isValidLonLat } from '../composeabe/LonLat';
|
|
|
|
|
+import { useLoadQuerys } from '@/components/composeabe/LoadQuerys';
|
|
|
|
|
+import { back, backAndCallOnPageBack } from '@/components/utils/PageAction';
|
|
|
import FlexCol from '@/components/layout/FlexCol.vue';
|
|
import FlexCol from '@/components/layout/FlexCol.vue';
|
|
|
import FlexRow from '@/components/layout/FlexRow.vue';
|
|
import FlexRow from '@/components/layout/FlexRow.vue';
|
|
|
import Cascader, { type CascaderItem } from '@/components/form/Cascader.vue';
|
|
import Cascader, { type CascaderItem } from '@/components/form/Cascader.vue';
|
|
@@ -117,16 +119,13 @@ import Text from '@/components/basic/Text.vue';
|
|
|
import Button from '@/components/basic/Button.vue';
|
|
import Button from '@/components/basic/Button.vue';
|
|
|
import Field from '@/components/form/Field.vue';
|
|
import Field from '@/components/form/Field.vue';
|
|
|
import LightVillageApi, { type VillageListItem } from '@/api/light/LightVillageApi';
|
|
import LightVillageApi, { type VillageListItem } from '@/api/light/LightVillageApi';
|
|
|
-import { back, backAndCallOnPageBack } from '@/components/utils/PageAction';
|
|
|
|
|
import RadioGroup from '@/components/form/RadioGroup.vue';
|
|
import RadioGroup from '@/components/form/RadioGroup.vue';
|
|
|
import Radio from '@/components/form/Radio.vue';
|
|
import Radio from '@/components/form/Radio.vue';
|
|
|
import CommonDialog from '@/common/components/CommonDialog.vue';
|
|
import CommonDialog from '@/common/components/CommonDialog.vue';
|
|
|
import BoxMid from '@/common/components/box/BoxMid.vue';
|
|
import BoxMid from '@/common/components/box/BoxMid.vue';
|
|
|
import Touchable from '@/components/feedback/Touchable.vue';
|
|
import Touchable from '@/components/feedback/Touchable.vue';
|
|
|
import Image from '@/components/basic/Image.vue';
|
|
import Image from '@/components/basic/Image.vue';
|
|
|
-import { getCascaderItemByValue } from '@/components/form/CascaderUtils';
|
|
|
|
|
-import { isValidLonLat } from '../composeabe/LonLat';
|
|
|
|
|
-import { useLoadQuerys } from '@/components/composeabe/LoadQuerys';
|
|
|
|
|
|
|
+import AppCofig from '@/common/config/AppCofig';
|
|
|
|
|
|
|
|
const { querys } = useLoadQuerys({
|
|
const { querys } = useLoadQuerys({
|
|
|
villageName: '',
|
|
villageName: '',
|
|
@@ -147,7 +146,12 @@ const { querys } = useLoadQuerys({
|
|
|
content: '您的家乡暂时没有经纬度信息,麻烦您拖动地图至您的家乡准确位置',
|
|
content: '您的家乡暂时没有经纬度信息,麻烦您拖动地图至您的家乡准确位置',
|
|
|
confirmText: '好',
|
|
confirmText: '好',
|
|
|
})
|
|
})
|
|
|
|
|
+ currentLonLat.value = {
|
|
|
|
|
+ longitude: AppCofig.defaultLonLat[0],
|
|
|
|
|
+ latitude: AppCofig.defaultLonLat[1],
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ currentLonLat.value = query;
|
|
|
mapCtx.moveToLocation({
|
|
mapCtx.moveToLocation({
|
|
|
longitude: Number(query.longitude),
|
|
longitude: Number(query.longitude),
|
|
|
latitude: Number(query.latitude),
|
|
latitude: Number(query.latitude),
|
|
@@ -214,25 +218,8 @@ async function handlePickEnd(values: CascaderItem[]) {
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ currentVillageName.value = values[selectedValue.value.length - 1].text;
|
|
|
currentAreaCode.value = Number(selectedValue.value[selectedValue.value.length - 1]);
|
|
currentAreaCode.value = Number(selectedValue.value[selectedValue.value.length - 1]);
|
|
|
- try {
|
|
|
|
|
- const mapVillages = await LightVillageApi.getMapVillage({ areaCode: currentAreaCode.value });
|
|
|
|
|
- const existingVillages = mapVillages.filter(v => v.villageId !== null);
|
|
|
|
|
- if (existingVillages.length > 0) {
|
|
|
|
|
- searchedList.value = existingVillages.map(v => ({
|
|
|
|
|
- id: v.villageId!,
|
|
|
|
|
- name: v.villageName || v.name,
|
|
|
|
|
- image: '',
|
|
|
|
|
- address: v.mergerName?.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: '提示',
|
|
@@ -277,7 +264,7 @@ async function handleConfirm(skipSearch?: boolean) {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ showSearchedList.value = false;
|
|
|
//否则添加村社
|
|
//否则添加村社
|
|
|
const res = (await LightVillageApi.createVillage({
|
|
const res = (await LightVillageApi.createVillage({
|
|
|
name: currentVillageName.value,
|
|
name: currentVillageName.value,
|