added new pop columns

This commit is contained in:
Luca Haid
2025-05-13 18:27:38 +02:00
parent e976246ed7
commit 15a2d11f2d
3 changed files with 71 additions and 82 deletions

View File

@@ -494,40 +494,51 @@ class DashboardNewController extends mfBaseController {
if (!empty($str = $this->request->netzgebiet_id)) $baseFilter["netzgebiet_id"] = $this->request->netzgebiet_id;
$sum_counts = [
"sum" => ADBHausnummerModel::count(array_merge($baseFilter, ["is_deleted" => 0]), false),
"sum_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["is_deleted" => 0])),
"op_state_planned" => ADBHausnummerModel::count(array_merge($baseFilter, ["is_deleted" => 0, "rimo_op_state" => "Planned"]), false),
"op_state_passed" => ADBHausnummerModel::count(array_merge($baseFilter, ["is_deleted" => 0, "rimo_op_state" => "Passed"]), false),
"op_state_connected" => ADBHausnummerModel::count(array_merge($baseFilter, ["is_deleted" => 0, "rimo_op_state" => "Connected"]), false),
"sum" => ADBHausnummerModel::count(array_merge($baseFilter, []), false),
"sum_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, [])),
"op_state_planned" => ADBHausnummerModel::count(array_merge($baseFilter, ["rimo_op_state" => "Planned"]), false),
"op_state_planned_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["rimo_op_state" => "Planned"])),
"op_state_passed" => ADBHausnummerModel::count(array_merge($baseFilter, ["rimo_op_state" => "Passed"]), false),
"op_state_passed_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["rimo_op_state" => "Passed"])),
"op_state_connected" => ADBHausnummerModel::count(array_merge($baseFilter, ["rimo_op_state" => "Connected"]), false),
"op_state_connected_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["rimo_op_state" => "Connected"])),
];
$efh_rimo_types = ["residential", "company", "2/3 familienhaus", "public"];
$efh_counts = [
"sum" => ADBHausnummerModel::count(array_merge($baseFilter, ["is_deleted" => 0, "rimo_type" => $efh_rimo_types]), false),
"sum_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["is_deleted" => 0, "rimo_type" => $efh_rimo_types])),
"op_state_planned" => ADBHausnummerModel::count(array_merge($baseFilter, ["is_deleted" => 0, "rimo_op_state" => "Planned", "rimo_type" => $efh_rimo_types]), false),
"op_state_passed" => ADBHausnummerModel::count(array_merge($baseFilter, ["is_deleted" => 0, "rimo_op_state" => "Passed", "rimo_type" => $efh_rimo_types]), false),
"op_state_connected" => ADBHausnummerModel::count(array_merge($baseFilter, ["is_deleted" => 0, "rimo_op_state" => "Connected", "rimo_type" => $efh_rimo_types]), false),
"sum" => ADBHausnummerModel::count(array_merge($baseFilter, ["rimo_type" => $efh_rimo_types]), false),
"sum_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["rimo_type" => $efh_rimo_types])),
"op_state_planned" => ADBHausnummerModel::count(array_merge($baseFilter, ["rimo_op_state" => "Planned", "rimo_type" => $efh_rimo_types]), false),
"op_state_planned_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["rimo_op_state" => "Planned", "rimo_type" => $efh_rimo_types])),
"op_state_passed" => ADBHausnummerModel::count(array_merge($baseFilter, ["rimo_op_state" => "Passed", "rimo_type" => $efh_rimo_types]), false),
"op_state_passed_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["rimo_op_state" => "Passed", "rimo_type" => $efh_rimo_types])),
"op_state_connected" => ADBHausnummerModel::count(array_merge($baseFilter, ["rimo_op_state" => "Connected", "rimo_type" => $efh_rimo_types]), false),
"op_state_connected_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["rimo_op_state" => "Connected", "rimo_type" => $efh_rimo_types])),
];
$mph_rimo_types = ["multiple dwellings"];
$mph_counts = [
"sum" => ADBHausnummerModel::count(array_merge($baseFilter, ["is_deleted" => 0, "rimo_type" => $mph_rimo_types]), false),
"sum_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["is_deleted" => 0, "rimo_type" => $mph_rimo_types])),
"op_state_planned" => ADBHausnummerModel::count(array_merge($baseFilter, ["is_deleted" => 0, "rimo_op_state" => "Planned", "rimo_type" => $mph_rimo_types]), false),
"op_state_passed" => ADBHausnummerModel::count(array_merge($baseFilter, ["is_deleted" => 0, "rimo_op_state" => "Passed", "rimo_type" => $mph_rimo_types]), false),
"op_state_connected" => ADBHausnummerModel::count(array_merge($baseFilter, ["is_deleted" => 0, "rimo_op_state" => "Connected", "rimo_type" => $mph_rimo_types]), false),
"sum" => ADBHausnummerModel::count(array_merge($baseFilter, ["rimo_type" => $mph_rimo_types]), false),
"sum_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["rimo_type" => $mph_rimo_types])),
"op_state_planned" => ADBHausnummerModel::count(array_merge($baseFilter, ["rimo_op_state" => "Planned", "rimo_type" => $mph_rimo_types]), false),
"op_state_planned_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["rimo_op_state" => "Planned", "rimo_type" => $mph_rimo_types])),
"op_state_passed" => ADBHausnummerModel::count(array_merge($baseFilter, ["rimo_op_state" => "Passed", "rimo_type" => $mph_rimo_types]), false),
"op_state_passed_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["rimo_op_state" => "Passed", "rimo_type" => $mph_rimo_types])),
"op_state_connected" => ADBHausnummerModel::count(array_merge($baseFilter, ["rimo_op_state" => "Connected", "rimo_type" => $mph_rimo_types]), false),
"op_state_connected_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["rimo_op_state" => "Connected", "rimo_type" => $mph_rimo_types])),
];
$other_types = [
"type_greenfield" => ADBHausnummerModel::count(array_merge($baseFilter, ["is_deleted" => 0, "rimo_type" => "greenfield"]), false),
"type_greenfield_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["is_deleted" => 0, "rimo_type" => "greenfield"])),
"type_transformer_station" => ADBHausnummerModel::count(array_merge($baseFilter, ["is_deleted" => 0, "rimo_type" => "transformer station"]), false),
"type_transformer_station_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["is_deleted" => 0, "rimo_type" => "transformer station"])),
"type_others" => ADBHausnummerModel::count(array_merge($baseFilter, ["is_deleted" => 0, "rimo_type" => "other"]), false),
"type_others_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["is_deleted" => 0, "rimo_type" => "other"])),
"other_type_sum" => ADBHausnummerModel::count(array_merge($baseFilter, ["rimo_type" => "other"]), false),
"other_type_sum_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["rimo_type" => "other"])),
"type_greenfield" => ADBHausnummerModel::count(array_merge($baseFilter, ["rimo_type" => "greenfield"]), false),
"type_greenfield_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["rimo_type" => "greenfield"])),
"type_transformer_station" => ADBHausnummerModel::count(array_merge($baseFilter, ["rimo_type" => "transformer station"]), false),
"type_transformer_station_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["rimo_type" => "transformer station"])),
"type_others" => ADBHausnummerModel::count(array_merge($baseFilter, ["rimo_type" => "other"]), false),
"type_others_homes" => ADBHausnummerModel::countHomes(array_merge($baseFilter, ["rimo_type" => "other"])),
];
self::returnJson([

View File

@@ -19,7 +19,7 @@
.dashboard-cards {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-columns: repeat(4, 1fr);
gap: 1rem;
}
@@ -50,19 +50,19 @@
@media (min-width: 768px) {
.dashboard-cards {
grid-template-columns: repeat(3, 1fr);
grid-template-columns: repeat(4, 1fr);
}
}
@media (min-width: 1000px) {
.dashboard-cards {
grid-template-columns: repeat(3, 1fr);
grid-template-columns: repeat(4, 1fr);
}
}
@media (min-width: 1332px) {
.dashboard-cards {
grid-template-columns: repeat(3, 1fr);
grid-template-columns: repeat(4, 1fr);
}
}

View File

@@ -53,31 +53,29 @@ Vue.component('tt-dashboard-display-card', {
Vue.component('dashboard-adb-content', {
props: ['addressDbData'],
template: `
<div>
<div>
<h4 class="mt-4">Gebäude</h4>
<div class="dashboard-cards position-relative">
<tt-dashboard-display-card
header="Gebäude gesamt"
icon="fas fa-building"
:text="addressDbData.sum_counts.sum"
:subHeaders="[
'Wohneinheiten: ' + addressDbData.sum_counts.sum_homes,
'Planned: ' + addressDbData.sum_counts.op_state_planned,
'Passed: ' + addressDbData.sum_counts.op_state_passed,
'Connected: ' + addressDbData.sum_counts.op_state_connected
<tt-dashboard-display-card
header="Gebäude gesamt"
icon="fas fa-building"
:text="addressDbData.sum_counts.sum + ' (' + addressDbData.sum_counts.sum_homes + ')'"
:subHeaders="[
'Planned: ' + addressDbData.sum_counts.op_state_planned + ' (' + addressDbData.sum_counts.op_state_planned_homes + ')',
'Passed: ' + addressDbData.sum_counts.op_state_passed + ' (' + addressDbData.sum_counts.op_state_passed_homes + ')',
'Connected: ' + addressDbData.sum_counts.op_state_connected + ' (' + addressDbData.sum_counts.op_state_connected_homes + ')'
]"
color="#28a745"
/>
color="#28a745"
/>
<tt-dashboard-display-card
header="Einfamilienhäuser gesamt"
icon="fas fa-home"
:text="addressDbData.efh_counts.sum"
:text="addressDbData.efh_counts.sum + ' (' + addressDbData.efh_counts.sum_homes + ')'"
:subHeaders="[
'Wohneinheiten: ' + addressDbData.efh_counts.sum_homes,
'Planned: ' + addressDbData.efh_counts.op_state_planned,
'Passed: ' + addressDbData.efh_counts.op_state_passed,
'Connected: ' + addressDbData.efh_counts.op_state_connected
'Planned: ' + addressDbData.efh_counts.op_state_planned + ' (' + addressDbData.efh_counts.op_state_planned_homes + ')',
'Passed: ' + addressDbData.efh_counts.op_state_passed + ' (' + addressDbData.efh_counts.op_state_passed_homes + ')',
'Connected: ' + addressDbData.efh_counts.op_state_connected + ' (' + addressDbData.efh_counts.op_state_connected_homes + ')'
]"
color="#17a2b8"
/>
@@ -85,52 +83,32 @@ Vue.component('dashboard-adb-content', {
<tt-dashboard-display-card
header="Mehrparteienhäuser gesamt"
icon="fas fa-city"
:text="addressDbData.mph_counts.sum"
:text="addressDbData.mph_counts.sum + ' (' + addressDbData.mph_counts.sum_homes + ')'"
:subHeaders="[
'Wohneinheiten: ' + addressDbData.mph_counts.sum_homes,
'Planned: ' + addressDbData.mph_counts.op_state_planned,
'Passed: ' + addressDbData.mph_counts.op_state_passed,
'Connected: ' + addressDbData.mph_counts.op_state_connected
'Planned: ' + addressDbData.mph_counts.op_state_planned + ' (' + addressDbData.mph_counts.op_state_planned_homes + ')',
'Passed: ' + addressDbData.mph_counts.op_state_passed + ' (' + addressDbData.mph_counts.op_state_passed_homes + ')',
'Connected: ' + addressDbData.mph_counts.op_state_connected + ' (' + addressDbData.mph_counts.op_state_connected_homes + ')'
]"
color="#f5b902"
/>
<tt-dashboard-display-card
header="Andere"
icon="fas fa-city"
: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="[
'Greenfield: ' + addressDbData.other_types.type_greenfield + ' (' + addressDbData.other_types.type_greenfield_homes + ')',
'Transformatorstationen: ' + addressDbData.other_types.type_transformer_station + ' (' + addressDbData.other_types.type_transformer_station_homes + ')',
'Andere: ' + addressDbData.other_types.type_others + ' (' + addressDbData.other_types.type_others_homes + ')'
]"
color="#007bff"
/>
</div>
<hr>
<h4 class="mt-4">Andere Typen</h4>
<div class="dashboard-cards position-relative">
<tt-dashboard-display-card
header="Greenfield"
icon="fas fa-leaf"
:text="addressDbData.other_types.type_greenfield"
:subHeaders="[
'Wohneinheiten: ' + addressDbData.other_types.type_greenfield_homes
]"
color="#0bb36c"
/>
<tt-dashboard-display-card
header="Transformatorstationen"
icon="fas fa-bolt"
:text="addressDbData.other_types.type_transformer_station"
:subHeaders="[
'Wohneinheiten: ' + addressDbData.other_types.type_transformer_station_homes
]"
color="#007bff"
/>
<tt-dashboard-display-card
header="Andere"
icon="fas fa-question-circle"
:text="addressDbData.other_types.type_others"
:subHeaders="[
'Wohneinheiten: ' + addressDbData.other_types.type_others_homes
]"
color="#6c757d"
/>
</div>
</div>
</div>
`
});
})
Vue.component('dashboard-adb', {
template: `