分割图斑的总面积需和展示的一致

dianlixunjian
刘妍 2024-07-25 15:07:25 +08:00
parent 6190655fbd
commit d47ef67bf7
2 changed files with 27 additions and 15 deletions

View File

@ -1,7 +1,7 @@
<template>
<div class="detail-container">
<div class="left-container">
<a-divider orientation="left">图斑信息{{ VITE_GLOB_INFO_IMAGE_URL }}</a-divider>
<a-divider orientation="left">图斑信息</a-divider>
<div class="map-container">
<MapboxMap
:mapConfig="mapConfig"
@ -460,7 +460,7 @@
} from '@/views/demo/tiankongdi/curbspotcity/util.ts';
import { getLoadDroneCaseInfoDetail } from '@/api/tiankongdi/index.ts';
import ShowInfoModal from '@/views/demo/tiankongdi/curbspotcity/MapList/ShowInfoModal/index.vue';
import { dataProcessing } from '@/views/demo/tiankongdi/util.ts';
import { dataProcessing ,dataProcessingCount} from '@/views/demo/tiankongdi/util.ts';
const MapboxComponent = ref();
const mapConfig = ref({});
@ -815,9 +815,7 @@
}
});
console.log('area123', area);
if (parseFloat(area.toFixed(4)) != props.showInfoData[type]) {
if (parseFloat(area.toFixed(4)) != dataProcessingCount(props.showInfoData[type])) {
areaAbnormal.value[type] = true;
} else {
areaAbnormal.value[type] = false;

View File

@ -1,14 +1,28 @@
export const dataProcessing = (value) => {
if(!value){
return '0亩'
if (!value) {
return '0亩';
}
if(value.indexOf('.') == -1){
return `${(value)}`
}else{
if(value.split('.')[1].length <= 2){
return `${(value)}`
if (value.indexOf('.') == -1) {
return `${value}`;
} else {
if (value.split('.')[1].length <= 2) {
return `${value}`;
}
let resultString = value.replace('㎡','')
return Number(resultString).toFixed(2) + '亩'
const resultString = value.replace('㎡', '');
return Number(resultString).toFixed(2) + '亩';
}
}
};
export const dataProcessingCount = (value) => {
if (!value) {
return 0;
}
if (value.indexOf('.') == -1) {
return value;
} else {
if (value.split('.')[1].length <= 2) {
return value;
}
const resultString = value.replace('㎡', '');
return Number(resultString).toFixed(2);
}
};