feat: add unread notifications feature and enhance notification display
This commit is contained in:
+29
-88
@@ -94,7 +94,7 @@ const truncate = (value?: string, max = 120) => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="container my-5 admin-report-overview">
|
||||
<div class="container my-5">
|
||||
<div class="d-flex flex-wrap justify-content-between align-items-center gap-3 mb-4">
|
||||
<div>
|
||||
<h1 class="h3 font-weight-bold mb-1">Overview Segnalazioni</h1>
|
||||
@@ -110,14 +110,16 @@ const truncate = (value?: string, max = 120) => {
|
||||
{ label: 'In lavorazione', value: activeReports, tone: 'warning' },
|
||||
{ label: 'Chiuse/Risolte', value: closedReports, tone: 'success' }
|
||||
]" :key="card.label">
|
||||
<div class="overview-stat-card" :class="`tone-${card.tone}`">
|
||||
<span class="overview-stat-label">{{ card.label }}</span>
|
||||
<strong class="overview-stat-value">{{ card.value }}</strong>
|
||||
<div class="card card-bg dashboard-stat h-100">
|
||||
<div class="card-body py-3">
|
||||
<div class="stat-value">{{ card.value }}</div>
|
||||
<div class="small text-muted">{{ card.label }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card border-0 shadow-sm mb-4">
|
||||
<div class="card card-bg border-0 shadow-sm mb-4">
|
||||
<div class="card-body">
|
||||
<div class="row g-3 align-items-end">
|
||||
<div class="col-12 col-lg-4">
|
||||
@@ -154,17 +156,31 @@ const truncate = (value?: string, max = 120) => {
|
||||
</div>
|
||||
|
||||
<template v-else>
|
||||
<div class="card border-0 shadow-sm mb-4">
|
||||
<div class="card card-bg border-0 shadow-sm mb-4">
|
||||
<div class="card-body">
|
||||
<div class="d-flex flex-wrap align-items-center justify-content-between gap-2 mb-3">
|
||||
<h2 class="h5 mb-0">Distribuzione stati</h2>
|
||||
<span class="text-muted small">{{ filteredReports.length }} elementi visibili</span>
|
||||
</div>
|
||||
<div class="status-chip-grid">
|
||||
<div v-for="item in reportsByStatus" :key="item.status" class="status-chip" :class="`tone-${item.tone}`">
|
||||
<span>{{ item.label }}</span>
|
||||
<strong>{{ item.total }}</strong>
|
||||
</div>
|
||||
<div class="table-responsive report-table-wrapper">
|
||||
<table class="table table-hover report-table mb-0 align-middle">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Stato</th>
|
||||
<th class="text-end">Totale</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="item in reportsByStatus" :key="item.status">
|
||||
<td>
|
||||
<span class="badge" :class="`bg-${item.tone}`">
|
||||
{{ item.label }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="text-end">{{ item.total }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -173,7 +189,7 @@ const truncate = (value?: string, max = 120) => {
|
||||
Nessuna segnalazione trovata con filtri correnti.
|
||||
</div>
|
||||
|
||||
<div v-else class="card border-0 shadow-sm">
|
||||
<div v-else class="card card-bg border-0 shadow-sm">
|
||||
<div class="card-body p-0">
|
||||
<div class="table-responsive report-table-wrapper">
|
||||
<table class="table table-hover report-table mb-0 align-middle">
|
||||
@@ -198,7 +214,7 @@ const truncate = (value?: string, max = 120) => {
|
||||
<td>{{ report.address || '-' }}</td>
|
||||
<td>{{ report.area_name || 'Non assegnata' }}</td>
|
||||
<td>
|
||||
<span class="badge rounded-pill" :class="`text-bg-${statusMeta[report.status].tone}`">
|
||||
<span class="badge" :class="`bg-${statusMeta[report.status].tone}`">
|
||||
{{ statusMeta[report.status].label }}
|
||||
</span>
|
||||
</td>
|
||||
@@ -213,78 +229,3 @@ const truncate = (value?: string, max = 120) => {
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.admin-report-overview {
|
||||
--admin-surface: #ffffff;
|
||||
--admin-border: rgba(31, 48, 78, 0.12);
|
||||
--admin-text-soft: #5b6577;
|
||||
}
|
||||
|
||||
.overview-stat-card {
|
||||
background:
|
||||
linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(246, 248, 252, 0.9)),
|
||||
var(--admin-surface);
|
||||
border: 1px solid var(--admin-border);
|
||||
border-radius: 1rem;
|
||||
padding: 1rem 1.1rem;
|
||||
min-height: 118px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
box-shadow: 0 14px 34px rgba(31, 48, 78, 0.08);
|
||||
}
|
||||
|
||||
.overview-stat-card::before {
|
||||
content: '';
|
||||
width: 2.5rem;
|
||||
height: 0.35rem;
|
||||
border-radius: 999px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.overview-stat-card.tone-primary::before { background: #0d6efd; }
|
||||
.overview-stat-card.tone-danger::before { background: #d9364f; }
|
||||
.overview-stat-card.tone-warning::before { background: #c58100; }
|
||||
.overview-stat-card.tone-success::before { background: #198754; }
|
||||
|
||||
.overview-stat-label {
|
||||
color: var(--admin-text-soft);
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.overview-stat-value {
|
||||
font-size: clamp(1.8rem, 4vw, 2.5rem);
|
||||
line-height: 1;
|
||||
color: #17324d;
|
||||
}
|
||||
|
||||
.status-chip-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.status-chip {
|
||||
border-radius: 0.9rem;
|
||||
padding: 0.85rem 1rem;
|
||||
border: 1px solid var(--admin-border);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.status-chip strong {
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
.status-chip.tone-danger { background: rgba(217, 54, 79, 0.08); }
|
||||
.status-chip.tone-warning { background: rgba(197, 129, 0, 0.08); }
|
||||
.status-chip.tone-info { background: rgba(13, 202, 240, 0.08); }
|
||||
.status-chip.tone-primary { background: rgba(13, 110, 253, 0.08); }
|
||||
.status-chip.tone-success { background: rgba(25, 135, 84, 0.08); }
|
||||
.status-chip.tone-secondary,
|
||||
.status-chip.tone-dark { background: rgba(108, 117, 125, 0.08); }
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user