更改平面圖原點大小
This commit is contained in:
parent
deb193d242
commit
2dcfd957e5
@ -16,13 +16,13 @@ const sameOption = {
|
||||
type: "effectScatter",
|
||||
coordinateSystem: "geo",
|
||||
geoIndex: 0,
|
||||
symbolSize: 10,
|
||||
encode: {
|
||||
tooltip: 2,
|
||||
},
|
||||
}
|
||||
const defaultOption = (map, data = []) => {
|
||||
return {
|
||||
return {
|
||||
animation: false,
|
||||
tooltip: {},
|
||||
geo: {
|
||||
tooltip: {
|
||||
@ -34,19 +34,22 @@ return {
|
||||
series: [
|
||||
{
|
||||
...sameOption,
|
||||
symbolSize: 10,
|
||||
itemStyle: {
|
||||
color: data?.[0]?.[2]?.device_normal_color || "#b02a02",
|
||||
color: data?.[0]?.[3]?.device_normal_color || "#b02a02",
|
||||
},
|
||||
data,
|
||||
},
|
||||
// {
|
||||
// itemStyle: {
|
||||
// color: "#555555",
|
||||
// },
|
||||
// data: data?.[1],
|
||||
// }
|
||||
{
|
||||
...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,
|
||||
|
Loading…
Reference in New Issue
Block a user