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,