刘妍 2024-10-10 11:08:03 +08:00
commit c6cbb36e2c
4 changed files with 56 additions and 8 deletions

View File

@ -232,12 +232,13 @@
}, 100);
}
// pinia
// file_upload
function submitChangeFrom() {
setTimeout(() => {
let data = getFieldsValue();
let result = {};
Object.keys(data).forEach((key) => {
if (key.indexOf('_select') !== -1) {
if (key.indexOf('_select') !== -1 || key.indexOf('_upload') !== -1) {
result[key] = data[key];
}
});

View File

@ -147,6 +147,8 @@ export async function splitPolygonByFill(drawPolygon, outerPolygon) {
// 多面数据分割裁剪
export async function splitPolygonByMultiFill(drawPolygons,outerPolygon){
let tempDrawPolygons = [...drawPolygons]
drawPolygons = handlerMultiPolygonToPolygon(tempDrawPolygons);
return new Promise((resolve,reject)=>{
try{
@ -170,14 +172,24 @@ export async function splitPolygonByMultiFill(drawPolygons,outerPolygon){
console.log("原始数据处理精度后坐标",featuresArray);
// 求交集图斑
drawPolygons.forEach((item,index)=>{
let turfPolygon = turf.truncate(turf.polygon(item.geometry.coordinates),dealOptions);
//
console.log("coordinates",index,item.geometry.coordinates)
try{
let turfPolygon = turf.truncate(turf.polygon(item.geometry.coordinates),dealOptions);
// 取交集
let intersection = turf.intersect(turf.featureCollection([featuresArray[0],turfPolygon]));
if(intersection){
resultArray.push(intersection);
let intersection = turf.intersect(turf.featureCollection([featuresArray[0],turfPolygon]));
if(intersection){
resultArray.push(intersection);
}
console.log("第3步交集"+index+"",intersection)
splitFeaturesArray.push(turfPolygon);
}catch(e){
console.log(e);
}
console.log("第3步交集"+index+"",intersection)
splitFeaturesArray.push(turfPolygon);
})
// 取差集
@ -201,6 +213,29 @@ export async function splitPolygonByMultiFill(drawPolygons,outerPolygon){
})
}
// MultiPolygon转换Polygon
export function handlerMultiPolygonToPolygon(sourcePolygons){
let polygons = [];
sourcePolygons.forEach((item,ndex)=>{
if(item.geometry.type == "MultiPolygon"){
item.geometry.coordinates.forEach((coorItem,idx)=>{
let polygonItem = {
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": coorItem
},
"properties": {}
}
polygons.push(polygonItem);
})
}else if(item.geometry.type == "Polygon"){
polygons.push(item);
}
})
return polygons;
}
export function printLngLat(arr){
arr.forEach((item,index)=>{
console.log(item[1]+","+item[0]+"\n");

View File

@ -0,0 +1,12 @@
<template>
<div>
</div>
</template>
<script lang="ts" setup>
import Vue from 'vue'
</script>
<style lang="scss" scoped>
</style>

View File

@ -168,7 +168,7 @@
<a-descriptions-item v-if="props.showInfoData.is_illegal == 2" label="实际用途">{{
getLabel('qita_use_to', props.showInfoData.qita_use_to)
}}</a-descriptions-item>
<a-descriptions-item v-if="is_illegal == 2" label="附件">
<a-descriptions-item v-if="props.showInfoData.is_illegal == 2" label="附件">
<a-image-preview-group :preview="{ getContainer }">
<template v-for="(item, itemIndex) in qitafujianList" :key="itemIndex">
<a-image