fix: 财务tab表格最后一列固定右侧及深色模式字体可见性

This commit is contained in:
小蟑螂
2026-05-22 01:19:18 +08:00
parent 40da6f7603
commit bd9e67383e
3 changed files with 49 additions and 7 deletions
@@ -154,7 +154,7 @@ const cellRoi = (v: number | null | undefined) =>
</th>
<th
colspan="5"
class="border-b border-l border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] dark:border-l-[hsl(240deg_3.7%_22%)] dark:border-[hsl(240deg_3.7%_22%)] bg-emerald-50/50 dark:bg-[hsl(142deg_71.8%_29%/20%)] p-3 text-center text-emerald-700 dark:text-emerald-400"
class="border-b border-l border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] dark:border-l-[hsl(240deg_3.7%_22%)] dark:border-[hsl(240deg_3.7%_22%)] bg-emerald-50/50 dark:bg-[hsl(142deg_71.8%_29%)] p-3 text-center text-emerald-700 dark:text-emerald-200"
>
盈利分析维度
</th>
@@ -277,7 +277,7 @@ const cellRoi = (v: number | null | undefined) =>
<td class="p-6 font-black text-indigo-700 dark:text-indigo-400">
{{ cellRoi(cat.roi) }}
</td>
<td class="bg-emerald-50 dark:bg-[hsl(142deg_71.8%_29%/20%)] p-6 text-base font-black text-emerald-600">
<td class="bg-emerald-50 dark:bg-[hsl(142deg_71.8%_29%)] p-6 text-base font-black text-emerald-600 dark:text-emerald-300">
{{ cellMoney(cat.profitAfterTax) }}
</td>
</tr>
@@ -338,4 +338,12 @@ thead {
top: 0;
z-index: 20;
}
thead tr:last-child th:last-child,
tbody td:last-child:not([colspan]),
tfoot td:last-child:not([colspan]) {
position: sticky;
right: 0;
z-index: 10;
}
</style>
@@ -217,7 +217,7 @@ const sortedData = computed(() => {
<!-- 盈利 -->
<th
colspan="5"
class="border-b border-l border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] dark:border-l-[hsl(240deg_3.7%_22%)] p-3 text-center bg-emerald-50/50 dark:bg-[hsl(142deg_71.8%_29%/20%)] text-emerald-700 dark:text-emerald-400"
class="border-b border-l border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] dark:border-l-[hsl(240deg_3.7%_22%)] p-3 text-center bg-emerald-50/50 dark:bg-[hsl(142deg_71.8%_29%)] text-emerald-700 dark:text-emerald-200"
>
盈利分析维度
</th>
@@ -358,8 +358,8 @@ const sortedData = computed(() => {
<td class="p-6 italic text-slate-400 dark:text-[hsl(240deg_5%_64.9%)]">{{ formatAmount(p.salesTaxAmount) }}</td>
<td class="p-6 font-black text-indigo-700 dark:text-indigo-400">{{ p.roi.toFixed(2) }}</td>
<td
class="bg-emerald-50 dark:bg-[hsl(142deg_71.8%_29%/20%)] p-6 text-base font-black"
:class="p.profitAfterTax >= 0 ? 'text-emerald-600' : 'text-rose-600'"
class="bg-emerald-50 dark:bg-[hsl(142deg_71.8%_29%)] p-6 text-base font-black"
:class="p.profitAfterTax >= 0 ? 'text-emerald-600 dark:text-emerald-300' : 'text-rose-600 dark:text-rose-400'"
>
{{ formatAmount(p.profitAfterTax) }}
</td>
@@ -440,4 +440,12 @@ thead {
top: 0;
z-index: 20;
}
thead tr:last-child th:last-child,
tbody td:last-child:not([colspan]),
tfoot td:last-child:not([colspan]) {
position: sticky;
right: 0;
z-index: 10;
}
</style>
@@ -172,7 +172,7 @@ const cellRoi = (v: number | null | undefined) =>
</th>
<th
colspan="5"
class="border-b border-l border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] dark:border-l-[hsl(240deg_3.7%_22%)] dark:border-[hsl(240deg_3.7%_22%)] bg-emerald-50/50 dark:bg-[hsl(142deg_71.8%_29%/20%)] p-3 text-center text-emerald-700 dark:text-emerald-400"
class="border-b border-l border-slate-200 dark:border-b-[hsl(240deg_3.7%_22%)] dark:border-l-[hsl(240deg_3.7%_22%)] dark:border-[hsl(240deg_3.7%_22%)] bg-emerald-50/50 dark:bg-[hsl(142deg_71.8%_29%)] p-3 text-center text-emerald-700 dark:text-emerald-200"
>
盈利分析维度
</th>
@@ -362,7 +362,7 @@ const cellRoi = (v: number | null | undefined) =>
<td class="p-6 font-black text-indigo-700 dark:text-indigo-400">
{{ cellRoi(shop.roi) }}
</td>
<td class="bg-emerald-50 dark:bg-[hsl(142deg_71.8%_29%/20%)] p-6 text-base font-black text-emerald-600">
<td class="bg-emerald-50 dark:bg-[hsl(142deg_71.8%_29%)] p-6 text-base font-black text-emerald-600 dark:text-emerald-300">
{{ cellMoney(shop.profitAfterTax) }}
</td>
</tr>
@@ -440,6 +440,32 @@ const cellRoi = (v: number | null | undefined) =>
overflow: auto;
}
thead {
position: sticky;
top: 0;
z-index: 20;
}
/* 最后一列(税后盈亏)固定在右侧 */
thead tr:last-child th:last-child,
tbody td:last-child:not([colspan]),
tfoot td:last-child:not([colspan]) {
position: sticky;
right: 0;
z-index: 10;
}
.sticky-right {
position: sticky;
right: 0;
z-index: 10;
}
.table-container {
max-height: 1000px;
overflow: auto;
}
thead {
position: sticky;
top: 0;