!794 feat(iot):将高德地图更换为百度地图

Merge pull request !794 from alwayssuper/feature/iot
This commit is contained in:
芋道源码
2025-07-19 11:53:44 +00:00
committed by Gitee
6 changed files with 176 additions and 112 deletions

View File

@ -93,14 +93,14 @@
@blur="updateLocationFromCoordinates"
/>
</el-form-item>
<div class="pl-0 w-full ml-[-18px]" v-if="showMap">
<div class="pl-0 h-[400px] w-full ml-[-18px]" v-if="showMap">
<Map
:isWrite="true"
:clickMap="true"
:center="formData.location"
@locateChange="handleLocationChange"
ref="mapRef"
class="h-[400px] w-full"
class="h-full w-full"
/>
</div>
</template>
@ -151,7 +151,7 @@ const formData = ref({
groupIds: [] as number[]
})
// 监听经纬度变化更新location
/** 监听经纬度变化更新location */
watch([() => formData.value.longitude, () => formData.value.latitude], ([newLong, newLat]) => {
if (newLong && newLat) {
formData.value.location = `${newLong},${newLat}`

View File

@ -151,12 +151,12 @@ const authPasswordVisible = ref(false) // 定义密码可见性状态
const authInfo = ref<IotDeviceAuthInfoVO>({} as IotDeviceAuthInfoVO) // 定义设备认证信息对象
// TODO @AI注释使用 /** */ 风格,方法注释;
// 控制地图显示的标志
/** 控制地图显示的标志 */
const showMap = computed(() => {
return !!(device.longitude && device.latitude)
})
// 获取位置字符串,用于地图组件
/** 获取位置字符串,用于地图组件 */
const getLocationString = () => {
if (device.longitude && device.latitude) {
return `${device.longitude},${device.latitude}`