From deb193d24239856a3c35f208d6fde6d0a0ca1bf7 Mon Sep 17 00:00:00 2001 From: JouChun Date: Mon, 18 Nov 2024 20:15:39 -0500 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=A8=93=E5=B1=A43D?= =?UTF-8?q?=E8=A8=AD=E5=82=99=E9=A1=AF=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/forge/useForgeFloor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/forge/useForgeFloor.js b/src/hooks/forge/useForgeFloor.js index 60cf9f7..0545b28 100644 --- a/src/hooks/forge/useForgeFloor.js +++ b/src/hooks/forge/useForgeFloor.js @@ -83,7 +83,7 @@ function useForgeFloor() { forgeViewer.value?.fitToView([forgeViewer.value.model.getRootId()]); showDbIdFn(); } else { - hideDbIdFn(); + showDbIdFn(); // forgeViewer.value.clearSelection(); // forgeViewer.value.model.setAllVisibility(0); forgeViewer.value.impl.toggleGhosting(false); From 2dcfd957e52610b3cf53f410fe10163dd69eadf0 Mon Sep 17 00:00:00 2001 From: JouChun Date: Mon, 18 Nov 2024 20:19:27 -0500 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=B9=B3=E9=9D=A2?= =?UTF-8?q?=E5=9C=96=E5=8E=9F=E9=BB=9E=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/SystemFloor.vue | 67 ++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 25 deletions(-) diff --git a/src/views/system/SystemFloor.vue b/src/views/system/SystemFloor.vue index c649bf2..48fe148 100644 --- a/src/views/system/SystemFloor.vue +++ b/src/views/system/SystemFloor.vue @@ -16,37 +16,40 @@ const sameOption = { type: "effectScatter", coordinateSystem: "geo", geoIndex: 0, - symbolSize: 10, encode: { tooltip: 2, }, } const defaultOption = (map, data = []) => { -return { - tooltip: {}, - geo: { - tooltip: { - show: false, - }, - map, - roam: true, // 一定要关闭拖拽 - }, - series: [ - { - ...sameOption, - itemStyle: { - color: data?.[0]?.[2]?.device_normal_color || "#b02a02", + return { + animation: false, + tooltip: {}, + geo: { + tooltip: { + show: false, }, - data, + map, + roam: true, // 一定要关闭拖拽 }, - // { - // itemStyle: { - // color: "#555555", - // }, - // data: data?.[1], - // } - ], -} + series: [ + { + ...sameOption, + symbolSize: 10, + itemStyle: { + color: data?.[0]?.[3]?.device_normal_color || "#b02a02", + }, + data, + }, + { + ...sameOption, + symbolSize: 20, + itemStyle: { + color: data?.[0]?.[3]?.device_normal_color || "#b02a02", + }, + data: [], + } + ], + } }; @@ -62,13 +65,27 @@ watch([selectedFloor, () => asset_floor_chart,], ([newValue, newChart], [oldValu defaultOption(newValue?.title, subscribeData.value?.filter(d => d.device_coordinate && d.floor_guid === route.params.floor_id).map(d => [...d.device_coordinate.split(","), d]) || []) ); + const allData = subscribeData.value?.filter(d => d.device_coordinate && d.floor_guid === route.params.floor_id).map(d => [...d.device_coordinate.split(","), d]) newChart.value.chart.on("click", function (params) { console.log(params, params.data[2]) getCurrentInfoModalData(params.event, { left: params.event.offsetX , top: params.event.offsetY - }, params.data[2]) + }, params.data[3]) + const selected = allData.filter((d => d[2].device_number === params.data[2].device_number)) + const unSelected = allData.filter((d => d[2].device_number !== params.data[2].device_number)) + newChart.value.chart.setOption({ + + series: [ + { data: unSelected }, { + data: selected, + } + ] + }) + console.log(selected, unSelected) }); + + } }, { immediate: true,