刘妍 2024-05-22 11:41:46 +08:00
commit 5927453973
2 changed files with 540 additions and 535 deletions

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,7 @@
@select="handleSelect"
/>
<div style="display: flex;width:100%;">
<div class="table-container" :style="`${haveMap? 'width:50%;':'width:100%'}`">
<div class="table-container" :style="`${haveMap? `width:${100 - mapSetData.width}%;`:'width:100%'}`">
<BasicTable @register="registerTable" @row-click="handRowClick">
<template #toolbar>
<div v-for="(item, index) in btnArr" :key="index">
@ -29,7 +29,7 @@
<ShowFormModal v-if="openShowFormModal" :showFormModalData="showFormModalData" :mapgemoList="mapgemoList"
@closeShowFormModal="closeShowFormModal" @success="submitsuccess"/>
</div>
<div v-if="haveMap" style="width:50%;height:calc(100vh - 78px) ">
<div v-if="haveMap" class="showMap" :style="`width:${mapSetData.width}%;height:calc(100vh - 78px) `">
<MapboxMap
:layers="layers"
:location="location"
@ -82,6 +82,9 @@
{ label: '删除', prop: 'Delete', class: 'error' },
{ label: '详情', prop: 'Details', class: 'default' },
];
const mapSetData = ref({
width:100
})
const mapgemoList = ref([])
const MapboxComponent = ref()
const openShowFormModal = ref(false)
@ -384,10 +387,7 @@
showFormModalData.value = toProps
openShowFormModal.value = true
mapgemoList.value = []
// const feature = "POLYGON ((118.54774514802972 35.80786133598188, 118.54515277045988 35.79816597053564, 118.55919536113471 35.80085134034624, 118.56021460056033 35.80462789316549, 118.5595188628206 35.80695604583504, 118.5580066425723 35.80815336506183, 118.54774514802972 35.80786133598188))"
// MapboxComponent.value.handlerDraw(feature)
// MapboxComponent.value.handlerLocation([118.54774514802972,35.80786133598188]);
MapboxComponent.value.handlerDraw()
mapSetData.value.isAllowAddPolygon && MapboxComponent.value.handlerDraw()
}else{
openModal(true, toProps);
}
@ -419,7 +419,7 @@
if(haveMap.value){
showFormModalData.value = toProps
openShowFormModal.value = true
MapboxComponent.value.handlerDraw(mapgemoList.value)
MapboxComponent.value.handlerDraw(mapgemoList.value,mapSetData.value.isAllowEditPolygon)
console.log(mapgemoList.value)
}else{
openModal(true, toProps);
@ -468,8 +468,7 @@
if(haveMap.value){
showFormModalData.value = toProps
openShowFormModal.value = true
MapboxComponent.value.handlerDraw(mapgemoList.value)
// MapboxComponent.value.handlerLocation([1113.640352364387,35.8665000676054])
MapboxComponent.value.handlerDraw(mapgemoList.value,false)
}else{
openModal(true, toProps);
}
@ -500,7 +499,28 @@
let formObj = JSON.parse(res.formScheme.scheme);
// TODO
haveMap.value = formObj.formInfo.schemas.findIndex(item => item.field === "MapGeom") !== -1
let mapgeomData = formObj.formInfo.schemas.find(item => item.field === "MapGeom")
haveMap.value = mapgeomData !== undefined
if(haveMap.value){
mapSetData.value = mapgeomData.mapSetData || { isAllowAddPolygon: false,
isAllowEditPolygon: false,
isEnablePostionJump: false,
width: 50,
layerFields: {},
}
console.log(mapSetData.value,'mapSetData')
}
// todo
mapSetData.value = {
width: 50,
//
isAllowAddPolygon: true,
//
isAllowEditPolygon: false,
//
isEnablePostionJump: false,
layerFields: {},
}
console.log(formObj,'formObj');
paramsId.value = res.formScheme.id;
@ -640,4 +660,9 @@
.table-container{
position:relative;
}
.showMap{
width:100%;
background-color: #fff;
z-index: 1;
}
</style>