From 66a286c385ddb83cb8ba07a3546677114b1189e6 Mon Sep 17 00:00:00 2001 From: dai <851733175@qq.com> Date: Fri, 12 Aug 2022 09:54:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=8C=87=E6=8C=A5=E8=B0=83?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/visual/command/cpts/map.vue | 57 ++++++++++--------- .../modules/visual/command/cpts/popup.vue | 2 +- .../visual/command/cpts/sidemenu-left.vue | 8 +-- .../modules/visual/command/cpts/sidemenu.vue | 1 + src/views/modules/visual/command/index.vue | 10 +++- 5 files changed, 43 insertions(+), 35 deletions(-) diff --git a/src/views/modules/visual/command/cpts/map.vue b/src/views/modules/visual/command/cpts/map.vue index cbcd444d3..d09c8da8f 100644 --- a/src/views/modules/visual/command/cpts/map.vue +++ b/src/views/modules/visual/command/cpts/map.vue @@ -201,32 +201,35 @@ export default { const polygon = [ ...srcGridData.children .filter((item) => item.coordinates.length > 0) - .map((item) => ({ - type: "Feature", - properties: { - // id: item.id, - // name: item.name, - // level: item.level, - center: [item.longitude, item.latitude], - ...item, - dotCount: gridCountData.find((item2) => item2.orgId == item.id) - ? gridCountData.find((item2) => item2.orgId == item.id).total - : "", - }, - geometry: { - type: "Polygon", - coordinates: [ - item.latitude - ? [[item.longitude, item.latitude]] - : spliceIntoChunks( - item.coordinates - .split(",") - .map((item) => parseFloat(item)), - 2 - ).filter((item) => item.length == 2), - ], - }, - })), + .map((item) => { + let countItem = gridCountData.find( + (item2) => item2.orgId == item.id + ); + console.log("countItem", countItem); + return { + type: "Feature", + properties: { + ...item, + center: [item.longitude, item.latitude], + dotCount: countItem + ? countItem.categoryName + ":" + countItem.total + : "", + }, + geometry: { + type: "Polygon", + coordinates: [ + item.latitude + ? [[item.longitude, item.latitude]] + : spliceIntoChunks( + item.coordinates + .split(",") + .map((item) => parseFloat(item)), + 2 + ).filter((item) => item.length == 2), + ], + }, + }; + }), ]; return { type: "FeatureCollection", features: polygon }; }, @@ -496,7 +499,7 @@ export default { .source(polygonDotData) .color("name", styleConfig.textColor) .shape("dotCount", "text") - .size(16) + .size(14) .style({ textAnchor: "center", // 文本相对锚点的位置 center|left|right|top|bottom|top-left textOffset: [0, -80], // 文本相对锚点的偏移量 [水平, 垂直] diff --git a/src/views/modules/visual/command/cpts/popup.vue b/src/views/modules/visual/command/cpts/popup.vue index ab50e8e08..b10e8d182 100644 --- a/src/views/modules/visual/command/cpts/popup.vue +++ b/src/views/modules/visual/command/cpts/popup.vue @@ -393,7 +393,7 @@