updated new dashboard
This commit is contained in:
@@ -7,20 +7,18 @@ Vue.component('dashboard-location-selector-adb', {
|
||||
props: {
|
||||
selectedNetwork: {type: String, required: true}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
filterOptions: {
|
||||
netOwners: []
|
||||
}
|
||||
};
|
||||
},
|
||||
async mounted() {
|
||||
await this.fetchNetworkFilterOptions();
|
||||
data: () => ({
|
||||
filterOptions: {
|
||||
netOwners: []
|
||||
}
|
||||
}),
|
||||
mounted() {
|
||||
this.fetchNetworkFilterOptions();
|
||||
},
|
||||
methods: {
|
||||
async fetchNetworkFilterOptions() {
|
||||
const response = await axios.get(`${window.TT_CONFIG['BASE_PATH']}/DashboardNew/getNetworkFilterOptions`);
|
||||
this.filterOptions.netOwners = [{value: 'all', text: 'Alle'}, ...response.data];
|
||||
const { data } = await axios.get(`${window.TT_CONFIG['BASE_PATH']}/DashboardNew/getNetworkFilterOptions`);
|
||||
this.filterOptions.netOwners = [{value: 'all', text: 'Alle'}, ...data];
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -94,7 +92,7 @@ Vue.component('dashboard-adb-content', {
|
||||
|
||||
<tt-dashboard-display-card
|
||||
header="Andere"
|
||||
icon="fas fa-city"
|
||||
icon="fas fa-building"
|
||||
:text="(parseInt(addressDbData.other_types.type_greenfield) + parseInt(addressDbData.other_types.type_transformer_station) + parseInt(addressDbData.other_types.type_others)) + ' (' +
|
||||
(parseInt(addressDbData.other_types.type_greenfield_homes) + parseInt(addressDbData.other_types.type_transformer_station_homes) + parseInt(addressDbData.other_types.type_others_homes)) + ')'"
|
||||
:subHeaders="[
|
||||
@@ -128,32 +126,22 @@ Vue.component('dashboard-adb', {
|
||||
</div>
|
||||
</tt-card>
|
||||
`,
|
||||
data() {
|
||||
return {
|
||||
addressDbData: null,
|
||||
selectedNetwork: 'all',
|
||||
isLoading: false
|
||||
};
|
||||
},
|
||||
async mounted() {
|
||||
await this.fetchAddressDbData();
|
||||
data: () => ({
|
||||
addressDbData: null,
|
||||
selectedNetwork: 'all',
|
||||
isLoading: false
|
||||
}),
|
||||
mounted() {
|
||||
this.fetchAddressDbData();
|
||||
},
|
||||
methods: {
|
||||
async fetchAddressDbData() {
|
||||
this.isLoading = true;
|
||||
try {
|
||||
// Use the correct API endpoint as specified
|
||||
const netzgebietId = this.selectedNetwork === 'all' ? '' : this.selectedNetwork;
|
||||
const url = `${window.TT_CONFIG['BASE_PATH']}/DashboardNew/getDashboardAddressDBData${netzgebietId ? '?netzgebiet_id=' + netzgebietId : ''}`;
|
||||
|
||||
const response = await axios.get(url);
|
||||
this.addressDbData = response.data;
|
||||
console.log('Address DB data:', this.addressDbData);
|
||||
} catch (error) {
|
||||
console.error('Error fetching address DB data:', error);
|
||||
} finally {
|
||||
this.isLoading = false;
|
||||
}
|
||||
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: {
|
||||
|
||||
Reference in New Issue
Block a user