基地地图调用接口

master
贾肃 4 months ago
parent a7d12a4fac
commit b9720963c3
  1. 1
      src/components/baseSelection/index.vue
  2. 6
      src/views/basicData/breedingBase/index.vue
  3. 31
      src/views/system/base/mapMarkers.vue

@ -26,7 +26,6 @@ const clickBase = (item) => {
const selBaseList = () => {
loading.value = true
selAllBreedingBase({}).then(res =>{
console.log(res);
baseList.value = res.data
}).finally(()=>{
loading.value = false

@ -47,11 +47,7 @@
<el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange" border>
<el-table-column type="selection" width="50" align="center" />
<el-table-column label="基地/资源圃名称" align="center" key="baseName" prop="baseName" v-if="columns[0].visible" />
<el-table-column label="基地类型" align="center" key="baseType" prop="baseType" v-if="columns[1].visible" :show-overflow-tooltip="true" >
<template #default="scope">
<el-tag v-if="scope.row.baseType === 1" type="success"></el-tag>
<el-tag v-else-if="scope.row.baseType === 2" type="success">种质资源圃</el-tag>
</template>
<el-table-column label="基地类型" align="center" key="baseType" prop="baseTypeName" v-if="columns[1].visible" :show-overflow-tooltip="true" >
</el-table-column>
<el-table-column label="所属省份" align="center" key="administrativeDivisionName" prop="administrativeDivisionName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
<el-table-column label="地理位置" align="center" key="position" prop="dept.position" v-if="columns[3].visible" :show-overflow-tooltip="true" />

@ -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(() => {
//

Loading…
Cancel
Save