ajuste no cabeçalho
This commit is contained in:
parent
3015974658
commit
03f860dc30
|
|
@ -495,10 +495,17 @@ export default function Teste() {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>
|
||||
<div className="max-h-[400px] overflow-y-auto border rounded-md relative">
|
||||
{/* Header fixo separado */}
|
||||
<div
|
||||
className="sticky top-0 z-30 border-b shadow-sm"
|
||||
style={{ backgroundColor: 'white', opacity: 1 }}
|
||||
>
|
||||
<div
|
||||
className="flex items-center p-4 font-semibold"
|
||||
style={{ backgroundColor: 'white', opacity: 1 }}
|
||||
>
|
||||
<div className="flex-1 min-w-[200px]">
|
||||
<Button
|
||||
variant="ghost"
|
||||
onClick={() => handleSort('descricao')}
|
||||
|
|
@ -507,13 +514,13 @@ export default function Teste() {
|
|||
Descrição
|
||||
{getSortIcon('descricao')}
|
||||
</Button>
|
||||
</TableHead>
|
||||
</div>
|
||||
{mesesDisponiveis.map((mes) => (
|
||||
<TableHead key={mes} className="text-right">
|
||||
<div key={mes} className="w-24 text-right px-2">
|
||||
{mes}
|
||||
</TableHead>
|
||||
</div>
|
||||
))}
|
||||
<TableHead className="text-right">
|
||||
<div className="w-24 text-right px-2">
|
||||
<Button
|
||||
variant="ghost"
|
||||
onClick={() => handleSort('valor')}
|
||||
|
|
@ -522,23 +529,40 @@ export default function Teste() {
|
|||
Total
|
||||
{getSortIcon('valor')}
|
||||
</Button>
|
||||
</TableHead>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Table>
|
||||
<TableHeader className="hidden">
|
||||
<TableRow>
|
||||
<TableHead></TableHead>
|
||||
{mesesDisponiveis.map((mes) => (
|
||||
<TableHead key={mes}></TableHead>
|
||||
))}
|
||||
<TableHead></TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{hierarchicalData.map((row, index) => (
|
||||
<TableRow key={index} className={getRowStyle(row)}>
|
||||
<TableCell style={getIndentStyle(row.level)}>
|
||||
<TableCell
|
||||
className="flex-1 min-w-[200px]"
|
||||
style={getIndentStyle(row.level)}
|
||||
>
|
||||
{renderCellContent(row)}
|
||||
</TableCell>
|
||||
{mesesDisponiveis.map((mes) => (
|
||||
<TableCell key={mes} className="text-right font-medium">
|
||||
<TableCell
|
||||
key={mes}
|
||||
className="w-24 text-right font-medium px-2"
|
||||
>
|
||||
{row.valoresPorMes && row.valoresPorMes[mes]
|
||||
? formatCurrency(row.valoresPorMes[mes])
|
||||
: '-'}
|
||||
</TableCell>
|
||||
))}
|
||||
<TableCell className="text-right font-medium">
|
||||
<TableCell className="w-24 text-right font-medium px-2">
|
||||
{formatCurrency(row.total!)}
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
|
|
@ -546,5 +570,6 @@ export default function Teste() {
|
|||
</TableBody>
|
||||
</Table>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue