【数据统计】异步加载地图组件,点击数据跳转到第一条图斑的第一个点,
parent
a09621f9cb
commit
dabb028f3e
|
|
@ -58,7 +58,7 @@
|
|||
</PageWrapper>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref, nextTick, unref, h, reactive } from 'vue';
|
||||
import { onMounted, ref, nextTick, unref, h, reactive, defineAsyncComponent } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { BasicTable, useTable, BasicColumn, FormSchema } from '@/components/Table';
|
||||
import { BasicTree, TreeItem, TreeActionItem, TreeActionType } from '@/components/Tree';
|
||||
|
|
@ -71,9 +71,13 @@
|
|||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import CallModal from './CallModal.vue';
|
||||
import CreateFlow from './CreateFlow.vue';
|
||||
import MapboxMap from '@/components/MapboxMaps/MapComponent.vue'
|
||||
// import MapboxMap from '@/components/MapboxMaps/MapComponent.vue'
|
||||
import ShowFormModal from './ShowFormModal/index.vue';
|
||||
|
||||
const MapboxMap = defineAsyncComponent(() =>
|
||||
import('@/components/MapboxMaps/MapComponent.vue')
|
||||
)
|
||||
|
||||
const { createConfirm, createMessage } = useMessage();
|
||||
const route = useRoute();
|
||||
const btnArr: any = [
|
||||
|
|
@ -420,7 +424,6 @@
|
|||
showFormModalData.value = toProps
|
||||
openShowFormModal.value = true
|
||||
MapboxComponent.value.handlerDraw(mapgemoList.value,mapSetData.value.isAllowEditPolygon)
|
||||
console.log(mapgemoList.value)
|
||||
}else{
|
||||
openModal(true, toProps);
|
||||
}
|
||||
|
|
@ -516,9 +519,9 @@
|
|||
// 可否添加图斑
|
||||
isAllowAddPolygon: true,
|
||||
// 可否编辑图斑
|
||||
isAllowEditPolygon: false,
|
||||
isAllowEditPolygon: true,
|
||||
// 可否跳转到图斑
|
||||
isEnablePostionJump: false,
|
||||
isEnablePostionJump: true,
|
||||
layerFields: {},
|
||||
}
|
||||
|
||||
|
|
@ -606,16 +609,15 @@
|
|||
mapgemoList.value.push(item)
|
||||
}
|
||||
})
|
||||
// console.log('mapgemoList', mapgemoList.value)
|
||||
// let mapData = mapgemoList.value.join(' ')
|
||||
// let data = "POLYGON ((118.52211538509077 35.882871898529494, 118.5243438435118 35.8822923130291, 118.52360102403814 35.88070959877732, 118.52153763661282 35.881021683278426, 118.52211538509077 35.882871898529494))"
|
||||
// if(mapgemoList.value.length > 0){
|
||||
// let aaa = mapgemoList.value[0]
|
||||
// console.log('aaaa',aaa)
|
||||
// let dataList = mapgemoList.value[0].value.replace(/[A-Z|(|)]/g, "").split(" ")
|
||||
// MapboxComponent.value.handlerDraw(mapgemoList.value)
|
||||
// MapboxComponent.value.handlerLocation([dataList[1],dataList[2]]);
|
||||
// }
|
||||
if(mapgemoList.value.length > 0 && mapSetData.value.isEnablePostionJump){
|
||||
let jumpDataString = mapgemoList.value[0].value
|
||||
let jumpDataList = jumpDataString.replace(/[A-Z|(|)]/g, "").split(" ")
|
||||
if(jumpDataString.slice(0,5) === 'POINT'){
|
||||
MapboxComponent.value.handlerLocation([jumpDataList[0],jumpDataList[1]])
|
||||
}else{
|
||||
MapboxComponent.value.handlerLocation([jumpDataList[0],jumpDataList[1].split(',')[0]])
|
||||
}
|
||||
}
|
||||
}).catch(err => {
|
||||
console.log('err',err)
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in New Issue