您需要遍历区域数组并根据 allZones 填充 active_zones 属性。那些。结果 active_zones = [1, 2, 3, 4, 5];
const allZones = [1, 2, 3, 4, 5];
const zones = [
{
id: 1,
type: "key",
label: "Ключ",
value: 12345,
active_zones: [1, 2, 5]
},
{
id: 2,
type: "key",
label: "Ключ",
value: 12345,
active_zones: [1, 2, 5]
}
];
1 个回答