Merge branch 'feature/headquartersSetting' into feature/dockerSetting

This commit is contained in:
koko 2025-09-23 17:22:46 +08:00
commit ba53c07661

View File

@ -36,14 +36,25 @@ const defaultOption = (map, data = []) => {
//
const formattedData = data.map((coordinate) => {
const coordString = JSON.stringify(coordinate);
// device_coordinate
let isSelected = false;
if (formState.value.device_coordinate) {
try {
const deviceCoord = JSON.parse(formState.value.device_coordinate);
//
isSelected = coordinate.length === deviceCoord.length &&
coordinate.every((val, index) => Math.abs(val - deviceCoord[index]) < 0.001);
} catch (e) {
console.warn('解析 device_coordinate 失敗:', e);
}
}
return {
name: coordString,
value: coordinate,
itemStyle: {
color:
coordString === formState.value.device_coordinate
? "#0000FF"
: "#b02a02",
color: isSelected ? "#0000FF" : "#b02a02",
},
};
});