更改平面圖原點大小

This commit is contained in:
JouChun 2024-11-18 20:19:27 -05:00
parent deb193d242
commit 2dcfd957e5

View File

@ -16,37 +16,40 @@ const sameOption = {
type: "effectScatter", type: "effectScatter",
coordinateSystem: "geo", coordinateSystem: "geo",
geoIndex: 0, geoIndex: 0,
symbolSize: 10,
encode: { encode: {
tooltip: 2, tooltip: 2,
}, },
} }
const defaultOption = (map, data = []) => { const defaultOption = (map, data = []) => {
return { return {
tooltip: {}, animation: false,
geo: { tooltip: {},
tooltip: { geo: {
show: false, tooltip: {
}, show: false,
map,
roam: true, //
},
series: [
{
...sameOption,
itemStyle: {
color: data?.[0]?.[2]?.device_normal_color || "#b02a02",
}, },
data, map,
roam: true, //
}, },
// { series: [
// itemStyle: { {
// color: "#555555", ...sameOption,
// }, symbolSize: 10,
// data: data?.[1], 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]) || []) 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) { newChart.value.chart.on("click", function (params) {
console.log(params, params.data[2]) console.log(params, params.data[2])
getCurrentInfoModalData(params.event, { getCurrentInfoModalData(params.event, {
left: params.event.offsetX left: params.event.offsetX
, top: params.event.offsetY , 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, immediate: true,