function ensureResource (id, resource) { if (resources[id]) return resources[id] = Vue._.assign({ id: id, title: id, _title: id, eventColor: name2rgb.gray, eventTextColor: '#333', eventCount: 0, level_0: id }, resource) }