fix: 财务tab表格首列固定、表头固定及最大高度限制

This commit is contained in:
小蟑螂
2026-05-22 00:52:48 +08:00
parent 047fd866bb
commit 40da6f7603
3 changed files with 71 additions and 9 deletions
@@ -108,7 +108,7 @@ const cellRoi = (v: number | null | undefined) =>
</div>
</div>
<div class="table-container overflow-x-auto">
<div class="table-container">
<table class="w-full whitespace-nowrap text-left text-sm">
<thead
class="bg-slate-50 dark:bg-[hsl(240deg_3.7%_15.9%)] text-xs font-black uppercase text-slate-500 dark:text-[hsl(240deg_5%_64.9%)]"
@@ -159,7 +159,7 @@ const cellRoi = (v: number | null | undefined) =>
盈利分析维度
</th>
</tr>
<tr class="bg-slate-50/80 dark:bg-[hsl(240deg_3.7%_15.9%/80)] text-sm">
<tr class="bg-slate-50 dark:bg-[hsl(240deg_3.7%_15.9%)] text-sm">
<th class="border-b border-l px-6 py-4 font-black text-slate-900 dark:text-[hsl(0deg_0%_95%)]">
<OverviewColumnHint :title="storeOverviewHints.salesAmount">
实际销售额
@@ -290,7 +290,7 @@ const cellRoi = (v: number | null | undefined) =>
<!-- 合计行 -->
<tfoot v-if="categorySummary?.total" class="bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)]">
<tr class="font-black text-slate-900 dark:text-[hsl(0deg_0%_95%)]">
<td class="p-6 text-base">合计</td>
<td class="sticky-col bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] p-6 text-base">合计</td>
<!-- 规模 -->
<td class="p-6">{{ cellMoney(categorySummary?.total?.salesAmount) }}</td>
<td class="p-6">{{ formatIntCell(categorySummary?.total?.orderCount) }}</td>
@@ -320,3 +320,22 @@ const cellRoi = (v: number | null | undefined) =>
</div>
</div>
</template>
<style scoped>
.sticky-col {
position: sticky;
left: 0;
z-index: 10;
}
.table-container {
max-height: 1000px;
overflow: auto;
}
thead {
position: sticky;
top: 0;
z-index: 20;
}
</style>
@@ -156,7 +156,7 @@ const sortedData = computed(() => {
</div>
<!-- 表格 -->
<div class="overflow-x-auto">
<div class="table-container">
<table class="w-full whitespace-nowrap text-left text-sm">
<thead
class="bg-slate-50 dark:bg-[hsl(240deg_3.7%_15.9%)] text-xs font-black uppercase text-slate-500 dark:text-[hsl(240deg_5%_64.9%)]"
@@ -222,7 +222,7 @@ const sortedData = computed(() => {
盈利分析维度
</th>
</tr>
<tr class="bg-slate-50/80 dark:bg-[hsl(240deg_3.7%_15.9%/80)] text-sm">
<tr class="bg-slate-50 dark:bg-[hsl(240deg_3.7%_15.9%)] text-sm">
<!-- 目标子列 -->
<th class="border-b border-l border-slate-200 dark:border-[hsl(240deg_3.7%_22%)] px-6 py-4">
<OverviewColumnHint :title="storeOverviewHints.targetOrderCount">
@@ -368,7 +368,7 @@ const sortedData = computed(() => {
<!-- 合计行 -->
<tfoot v-if="totalData" class="bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)]">
<tr class="font-black text-slate-900 dark:text-[hsl(0deg_0%_95%)]">
<td class="sticky-col border-r-2 border-slate-200 dark:border-[hsl(240deg_3.7%_22%)] p-6 text-base">合计</td>
<td class="sticky-col bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] border-r-2 border-slate-200 dark:border-[hsl(240deg_3.7%_22%)] p-6 text-base">合计</td>
<!-- 目标 -->
<td class="p-6">{{ formatIntCell(totalData.targetOrderCount) }}</td>
<td class="p-6 text-blue-600 dark:text-blue-400">
@@ -422,3 +422,22 @@ const sortedData = computed(() => {
</div>
</div>
</template>
<style scoped>
.sticky-col {
position: sticky;
left: 0;
z-index: 10;
}
.table-container {
max-height: 1000px;
overflow: auto;
}
thead {
position: sticky;
top: 0;
z-index: 20;
}
</style>
@@ -111,7 +111,7 @@ const cellRoi = (v: number | null | undefined) =>
</div>
</div>
<div class="table-container overflow-x-auto">
<div class="table-container">
<table class="w-full whitespace-nowrap text-left text-sm">
<thead
class="bg-slate-50 dark:bg-[hsl(240deg_3.7%_15.9%)] text-xs font-black uppercase text-slate-500 dark:text-[hsl(240deg_5%_64.9%)]"
@@ -177,7 +177,7 @@ const cellRoi = (v: number | null | undefined) =>
盈利分析维度
</th>
</tr>
<tr class="bg-slate-50/80 dark:bg-[hsl(240deg_3.7%_15.9%/80)] text-sm">
<tr class="bg-slate-50 dark:bg-[hsl(240deg_3.7%_15.9%)] text-sm">
<!-- 目标 -->
<th class="border-b border-l border-slate-200 dark:border-[hsl(240deg_3.7%_22%)] px-6 py-4">
<OverviewColumnHint :title="storeOverviewHints.targetOrderCount">
@@ -375,7 +375,12 @@ const cellRoi = (v: number | null | undefined) =>
<!-- 合计行 -->
<tfoot v-if="shopSummary?.total" class="bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)]">
<tr class="font-black text-slate-900 dark:text-[hsl(0deg_0%_95%)]">
<td class="p-6 text-base" :class="shopExportMode ? 'border-l-0' : ''">合计</td>
<td
class="sticky-col bg-slate-100 dark:bg-[hsl(240deg_3.7%_22%)] p-6 text-base"
:class="shopExportMode ? 'border-l-0' : ''"
>
合计
</td>
<!-- 目标 -->
<td class="p-6">{{ formatIntCell(shopSummary?.total?.targetOrderCount) }}</td>
<td class="p-6 text-blue-600 dark:text-blue-400">
@@ -422,3 +427,22 @@ const cellRoi = (v: number | null | undefined) =>
</div>
</div>
</template>
<style scoped>
.sticky-col {
position: sticky;
left: 0;
z-index: 10;
}
.table-container {
max-height: 1000px;
overflow: auto;
}
thead {
position: sticky;
top: 0;
z-index: 20;
}
</style>