基地地图调用接口

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 = () => { const selBaseList = () => {
loading.value = true loading.value = true
selAllBreedingBase({}).then(res =>{ selAllBreedingBase({}).then(res =>{
console.log(res);
baseList.value = res.data baseList.value = res.data
}).finally(()=>{ }).finally(()=>{
loading.value = false loading.value = false

@ -47,11 +47,7 @@
<el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange" border> <el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange" border>
<el-table-column type="selection" width="50" align="center" /> <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="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" > <el-table-column label="基地类型" align="center" key="baseType" prop="baseTypeName" 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> </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="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" /> <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> <script setup>
import {ElAmap, useGeolocation, lazyAMapApiLoaderInstance} from "@vuemap/vue-amap"; import {ElAmap, useGeolocation, lazyAMapApiLoaderInstance} from "@vuemap/vue-amap";
import BaseRightControl from "@/views/system/base/baseRightControl.vue"; import BaseRightControl from "@/views/system/base/baseRightControl.vue";
import {selAllBreedingBase} from "@/api/basicData/breedingBaseApi.js";
const router = useRouter() const router = useRouter()
const maxHeight = ref(window.innerHeight - 100); const maxHeight = ref(window.innerHeight - 100);
@ -10,18 +11,21 @@ const center = ref([
107.5856025, 107.5856025,
22.484856 22.484856
]); ]);
const baseList = ref([ const baseList = ref([])
{ const selBaseList = () => {
baseId: 1, selAllBreedingBase({}).then(res=>{
position: [116.338461, 39.97947], baseList.value = res.data.map(item =>{
label: '测试', return {
}, id: item.id,
{ position: [item.longitude, item.latitude],
baseId: 2, label: item.baseName,
position: [107.5856025, 22.484856], }
label: '金光农场(广西农垦育种基地)', })
}, })
]) }
onMounted(()=>{
selBaseList()
})
const control = reactive({ const control = reactive({
// //
dataType: 1, dataType: 1,
@ -45,8 +49,7 @@ const control = reactive({
const clickBase = ref(null) const clickBase = ref(null)
const clickMarker = (value) => { const clickMarker = (value) => {
clickBase.value = value clickBase.value = value
router.push({path: '/system/base/massifMap/' + value.baseId}) router.push({path: '/system/base/massifMap/' + value.id})
console.log(value);
} }
onBeforeMount(() => { onBeforeMount(() => {
// //

Loading…
Cancel
Save