Checkpoint: La colonne Code est maintenant cliquable dans la vue Établissements OPEX : clic pour trier par code croissant/décroissant. Le tri par code est aussi le tri par défaut (quand aucune autre colonne n'est sélectionnée). Les colonnes Établissement et Total restent triables comme avant.
This commit is contained in:
@@ -1203,6 +1203,8 @@ export default function DsiOpex() {
|
|||||||
const arr = [...filteredEtabs];
|
const arr = [...filteredEtabs];
|
||||||
if (sortCol === 'total') arr.sort((a, b) => sortDir === 'asc' ? a.total - b.total : b.total - a.total);
|
if (sortCol === 'total') arr.sort((a, b) => sortDir === 'asc' ? a.total - b.total : b.total - a.total);
|
||||||
else if (sortCol === 'nom') arr.sort((a, b) => sortDir === 'asc' ? a.nom.localeCompare(b.nom) : b.nom.localeCompare(a.nom));
|
else if (sortCol === 'nom') arr.sort((a, b) => sortDir === 'asc' ? a.nom.localeCompare(b.nom) : b.nom.localeCompare(a.nom));
|
||||||
|
else if (sortCol === 'code') arr.sort((a, b) => sortDir === 'asc' ? a.code.localeCompare(b.code) : b.code.localeCompare(a.code));
|
||||||
|
else arr.sort((a, b) => a.code.localeCompare(b.code)); // tri par défaut : code croissant
|
||||||
return arr;
|
return arr;
|
||||||
}, [filteredEtabs, sortCol, sortDir]);
|
}, [filteredEtabs, sortCol, sortDir]);
|
||||||
|
|
||||||
@@ -1773,7 +1775,9 @@ export default function DsiOpex() {
|
|||||||
<table className="text-xs border-separate border-spacing-0" style={{ minWidth: 'max-content', width: '100%' }}>
|
<table className="text-xs border-separate border-spacing-0" style={{ minWidth: 'max-content', width: '100%' }}>
|
||||||
<thead>
|
<thead>
|
||||||
<tr className="border-b border-border bg-muted/40">
|
<tr className="border-b border-border bg-muted/40">
|
||||||
<th className="text-left px-3 py-3 font-medium text-muted-foreground" style={{ position: 'sticky', left: 0, top: 0, zIndex: 40, background: 'oklch(0.94 0.005 80)', boxShadow: '2px 0 4px -1px rgba(0,0,0,0.15)', width: '110px', minWidth: '110px', maxWidth: '110px' }}>Code</th>
|
<th className="text-left px-3 py-3 font-medium text-muted-foreground" style={{ position: 'sticky', left: 0, top: 0, zIndex: 40, background: 'oklch(0.94 0.005 80)', boxShadow: '2px 0 4px -1px rgba(0,0,0,0.15)', width: '110px', minWidth: '110px', maxWidth: '110px' }}>
|
||||||
|
<SortBtn col="code" label="Code" />
|
||||||
|
</th>
|
||||||
<th className="text-left px-3 py-3 font-medium text-muted-foreground" style={{ position: 'sticky', left: '110px', top: 0, zIndex: 40, background: 'oklch(0.94 0.005 80)', boxShadow: '2px 0 8px -2px rgba(0,0,0,0.2)', width: '220px', minWidth: '220px', maxWidth: '220px' }}>
|
<th className="text-left px-3 py-3 font-medium text-muted-foreground" style={{ position: 'sticky', left: '110px', top: 0, zIndex: 40, background: 'oklch(0.94 0.005 80)', boxShadow: '2px 0 8px -2px rgba(0,0,0,0.2)', width: '220px', minWidth: '220px', maxWidth: '220px' }}>
|
||||||
<SortBtn col="nom" label="Établissement" />
|
<SortBtn col="nom" label="Établissement" />
|
||||||
</th>
|
</th>
|
||||||
|
|||||||
Reference in New Issue
Block a user