Browse Source

数据问题的修复

yes-yes-yes-k 1 week ago
parent
commit
c27ec4899f

+ 1 - 3
src/components/atmpollution/atmcompanymap.vue

@@ -70,8 +70,6 @@ onMounted(() => {
     .then(townshipGeojson => {
       L.geoJSON(townshipGeojson, {
         style: (feature) => {
-          // 关键:从乡镇数据中获取所属区县信息(假设属性字段为county)
-          // 请根据你的实际GeoJSON属性字段调整(可能是district、parent等)
           const countyName = feature.properties.FXZQMC || '';
           
           return {
@@ -121,7 +119,7 @@ onMounted(() => {
           const emission = props.particulate_emission !== null ? parseFloat(props.particulate_emission) : null;
           const formattedEmission = emission === null || isNaN(emission)
             ? '未知' 
-            : `${emission.toFixed(3)} t/a`;
+            : `${emission} t/a`;
 
           const marker = L.marker([lat, lng], {
             icon: blueTriangle,

+ 2 - 2
src/components/atmpollution/heavyMetalEnterprisechart.vue

@@ -155,11 +155,11 @@ const processData = (features) => {
     data: validRegions.map(region => {
       if (region === '全市平均') {
         return globalStats[field].count 
-          ? (globalStats[field].sum / globalStats[field].count).toFixed(4) 
+          ? (globalStats[field].sum / globalStats[field].count) 
           : 0;
       }
       return regionStats[region][field].count 
-        ? (regionStats[region][field].sum / regionStats[region][field].count).toFixed(4) 
+        ? (regionStats[region][field].sum / regionStats[region][field].count) 
         : 0;
     }),
     itemStyle: { 

+ 1 - 1
src/components/irrpollution/crosssectionmap.vue

@@ -138,7 +138,7 @@ onMounted(() => {
 
                   // 镉含量格式化(保持原有逻辑)
                   const cdValue = parseFloat(mappedItem["Cd(ug/L)"]);
-                  const formattedCd = isNaN(cdValue) ? '未知' : cdValue.toFixed(2) + ' μg/L';
+                  const formattedCd = isNaN(cdValue) ? '未知' : cdValue + ' μg/L';
 
                   // 弹窗内容(保持原有结构)
                   marker.bindPopup(`

+ 1 - 1
src/components/irrpollution/irrwatermap.vue

@@ -22,7 +22,7 @@ onMounted(() => {
   const formatLocation = (fullLocation) => {
     if (!fullLocation) return '未知位置'; // 处理空值
     // 移除前缀并清理空格
-    const processed = fullLocation.replace(/^广东省韶关市/, '').trim();
+    const processed = fullLocation.replace(/^(广东省)?韶关市/, '').trim();
     // 处理移除后为空的情况
     return processed || '未知位置';
   };