Vue.component('dashboard-location-selector-adb', { template: `
`, props: { selectedNetwork: {type: String, required: true} }, data: () => ({ filterOptions: { netOwners: [] } }), mounted() { this.fetchNetworkFilterOptions(); }, methods: { async fetchNetworkFilterOptions() { const { data } = await axios.get(`${window.TT_CONFIG['BASE_PATH']}/DashboardNew/getNetworkFilterOptions`); this.filterOptions.netOwners = [{value: 'all', text: 'Alle'}, ...data]; } } }); Vue.component('tt-dashboard-display-card', { props: ['header', 'icon', 'text', 'subHeaders', 'color'], computed: { cardHeight() { return `${96 + 25 * this.subHeaders?.length ?? 0}px`; } }, template: `
{{ header }}

{{ text }}

{{ subHeader }}

` }) Vue.component('dashboard-adb-content', { props: ['addressDbData'], template: `

Gebäude

` }) Vue.component('dashboard-adb', { template: `

`, data: () => ({ addressDbData: null, selectedNetwork: 'all', isLoading: false }), mounted() { this.fetchAddressDbData(); }, methods: { async fetchAddressDbData() { this.isLoading = true; const netzParam = this.selectedNetwork !== 'all' ? `?netzgebiet_id=${this.selectedNetwork}` : ''; const url = `${window.TT_CONFIG['BASE_PATH']}/DashboardNew/getDashboardAddressDBData${netzParam}`; const { data } = await axios.get(url); this.addressDbData = data; this.isLoading = false; } }, watch: { selectedNetwork() { this.fetchAddressDbData(); } } });