|
|
|
@ -2,6 +2,7 @@
|
|
|
|
|
<script setup>
|
|
|
|
|
import {ElAmap, useGeolocation, lazyAMapApiLoaderInstance} from "@vuemap/vue-amap";
|
|
|
|
|
import BaseRightControl from "@/views/system/base/baseRightControl.vue";
|
|
|
|
|
import {selAllBreedingBase} from "@/api/basicData/breedingBaseApi.js";
|
|
|
|
|
|
|
|
|
|
const router = useRouter()
|
|
|
|
|
const maxHeight = ref(window.innerHeight - 100);
|
|
|
|
@ -10,18 +11,21 @@ const center = ref([
|
|
|
|
|
107.5856025,
|
|
|
|
|
22.484856
|
|
|
|
|
]);
|
|
|
|
|
const baseList = ref([
|
|
|
|
|
{
|
|
|
|
|
baseId: 1,
|
|
|
|
|
position: [116.338461, 39.97947],
|
|
|
|
|
label: '测试',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
baseId: 2,
|
|
|
|
|
position: [107.5856025, 22.484856],
|
|
|
|
|
label: '金光农场(广西农垦育种基地)',
|
|
|
|
|
},
|
|
|
|
|
])
|
|
|
|
|
const baseList = ref([])
|
|
|
|
|
const selBaseList = () => {
|
|
|
|
|
selAllBreedingBase({}).then(res=>{
|
|
|
|
|
baseList.value = res.data.map(item =>{
|
|
|
|
|
return {
|
|
|
|
|
id: item.id,
|
|
|
|
|
position: [item.longitude, item.latitude],
|
|
|
|
|
label: item.baseName,
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
onMounted(()=>{
|
|
|
|
|
selBaseList()
|
|
|
|
|
})
|
|
|
|
|
const control = reactive({
|
|
|
|
|
// 地图类型
|
|
|
|
|
dataType: 1,
|
|
|
|
@ -45,8 +49,7 @@ const control = reactive({
|
|
|
|
|
const clickBase = ref(null)
|
|
|
|
|
const clickMarker = (value) => {
|
|
|
|
|
clickBase.value = value
|
|
|
|
|
router.push({path: '/system/base/massifMap/' + value.baseId})
|
|
|
|
|
console.log(value);
|
|
|
|
|
router.push({path: '/system/base/massifMap/' + value.id})
|
|
|
|
|
}
|
|
|
|
|
onBeforeMount(() => {
|
|
|
|
|
// 获取当前定位
|
|
|
|
|