feat(web-admin): viewport-fill list height for pl transport menus
Wire 运输管理 list pages (plans, IO orders, freight panels, vehicles, personnel, and related lists) to useListTableViewportHeight so table body scrolls with sticky header and pager stays near the content bottom. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
11185f066a
commit
c577edc597
35 files changed
+11667
-8490
No files matched your search
@@ -63,8 +63,10 @@
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<div ref="doneTableWrapRef" class="table-scroll bx-list-table-wrap">
|
||||
<ListTable table-key="pl-freight-components-approval-done-panel"
|
||||
class="list-table"
|
||||
<ListTable
|
||||
ref="doneTableRef" table-key="pl-freight-components-approval-done-panel"
|
||||
:height="tableHeight"
|
||||
class="list-table"
|
||||
:data="settlementList"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
@@ -144,7 +146,9 @@
|
||||
<template #default="{ row }">{{ row.submitterName || '—' }}</template>
|
||||
</el-table-column>
|
||||
</ListTable>
|
||||
<ListColumnStatsRow
|
||||
</div>
|
||||
<div ref="doneBelowRef">
|
||||
<ListColumnStatsRow
|
||||
ref="doneStatsRowRef"
|
||||
storage-key="pl-freight-approval-done-column-stats"
|
||||
:columns="doneStatsRowColumns"
|
||||
@@ -152,9 +156,8 @@
|
||||
:table-wrap-el="doneTableWrapRef"
|
||||
:get-cell-value="getDoneStatCellValue"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="list-pager-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
</div>
|
||||
@@ -169,6 +172,7 @@
|
||||
@current-change="handlePageChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<PlFreightSettlementViewDialog ref="viewDialogRef" />
|
||||
@@ -183,6 +187,7 @@ import ListColumnStatsRow from '@/components/business/list-column-stats-row/inde
|
||||
import type { StatsRowColumn } from '@/utils/list-column-stats'
|
||||
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
import { useListTableViewportHeight } from '@/composables/useListTableViewportHeight'
|
||||
import { RefreshLeft, Search } from '@element-plus/icons-vue'
|
||||
import { freightApi, type FreightSettlement } from '@/api/pl'
|
||||
import PlFreightSettlementViewDialog from '@/components/business/pl-freight-settlement-view-dialog/index.vue'
|
||||
@@ -211,6 +216,13 @@ const {
|
||||
} = usePersistedListColumns('pl-freight-approval-done-columns', listColumnDefs)
|
||||
|
||||
const doneTableWrapRef = ref<HTMLElement | null>(null)
|
||||
const doneBelowRef = ref<HTMLElement | null>(null)
|
||||
const doneTableRef = ref<any>(null)
|
||||
const { tableHeight, recalc: recalcTableHeight } = useListTableViewportHeight({
|
||||
tableEl: doneTableWrapRef,
|
||||
pagerEl: doneBelowRef,
|
||||
tableRef: doneTableRef
|
||||
})
|
||||
const doneStatsRowRef = ref<{ resync?: () => void } | null>(null)
|
||||
|
||||
const doneStatsRowColumns = computed((): StatsRowColumn[] => {
|
||||
@@ -349,6 +361,8 @@ useDbInstantSearch(
|
||||
|
||||
onMounted(() => {
|
||||
fetchData()
|
||||
|
||||
nextTick(() => recalcTableHeight())
|
||||
})
|
||||
|
||||
defineExpose({ refresh })
|
||||
|
||||
@@ -81,8 +81,10 @@
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<div ref="pendingTableWrapRef" class="table-scroll bx-list-table-wrap">
|
||||
<ListTable table-key="pl-freight-components-approval-pending-panel"
|
||||
class="list-table"
|
||||
<ListTable
|
||||
ref="pendingTableRef" table-key="pl-freight-components-approval-pending-panel"
|
||||
:height="tableHeight"
|
||||
class="list-table"
|
||||
:data="settlementList"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
@@ -156,7 +158,9 @@
|
||||
<template #default="{ row }">{{ formatDateTime(row.createTime) }}</template>
|
||||
</el-table-column>
|
||||
</ListTable>
|
||||
<ListColumnStatsRow
|
||||
</div>
|
||||
<div ref="pendingBelowRef">
|
||||
<ListColumnStatsRow
|
||||
ref="pendingStatsRowRef"
|
||||
storage-key="pl-freight-approval-pending-column-stats"
|
||||
:columns="pendingStatsRowColumns"
|
||||
@@ -164,9 +168,8 @@
|
||||
:table-wrap-el="pendingTableWrapRef"
|
||||
:get-cell-value="getPendingStatCellValue"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="list-pager-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
</div>
|
||||
@@ -181,6 +184,7 @@
|
||||
@current-change="handlePageChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<PlFreightSettlementViewDialog ref="viewDialogRef">
|
||||
@@ -215,6 +219,7 @@ import ListColumnStatsRow from '@/components/business/list-column-stats-row/inde
|
||||
import type { StatsRowColumn } from '@/utils/list-column-stats'
|
||||
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
import { useListTableViewportHeight } from '@/composables/useListTableViewportHeight'
|
||||
import { CircleCheck, CircleClose, RefreshLeft, Search } from '@element-plus/icons-vue'
|
||||
import { freightApi, type FreightSettlement } from '@/api/pl'
|
||||
import PlFreightApprovalDialog from '@/components/business/pl-freight-approval-dialog/index.vue'
|
||||
@@ -240,6 +245,13 @@ const {
|
||||
} = usePersistedListColumns('pl-freight-approval-pending-columns', listColumnDefs)
|
||||
|
||||
const pendingTableWrapRef = ref<HTMLElement | null>(null)
|
||||
const pendingBelowRef = ref<HTMLElement | null>(null)
|
||||
const pendingTableRef = ref<any>(null)
|
||||
const { tableHeight, recalc: recalcTableHeight } = useListTableViewportHeight({
|
||||
tableEl: pendingTableWrapRef,
|
||||
pagerEl: pendingBelowRef,
|
||||
tableRef: pendingTableRef
|
||||
})
|
||||
const pendingStatsRowRef = ref<{ resync?: () => void } | null>(null)
|
||||
|
||||
const pendingStatsRowColumns = computed((): StatsRowColumn[] => {
|
||||
@@ -403,6 +415,8 @@ useDbInstantSearch(() => ({ q: searchForm.q }), handleSearch)
|
||||
|
||||
onMounted(() => {
|
||||
fetchData()
|
||||
|
||||
nextTick(() => recalcTableHeight())
|
||||
})
|
||||
|
||||
defineExpose({ refresh })
|
||||
|
||||
@@ -65,8 +65,10 @@
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<div ref="disburseTableWrapRef" class="table-scroll bx-list-table-wrap">
|
||||
<ListTable table-key="pl-freight-components-disburse-panel"
|
||||
class="list-table"
|
||||
<ListTable
|
||||
ref="disburseTableRef" table-key="pl-freight-components-disburse-panel"
|
||||
:height="tableHeight"
|
||||
class="list-table"
|
||||
:data="settlementList"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
@@ -133,7 +135,9 @@
|
||||
<template #default="{ row }">{{ row.submitterName || '—' }}</template>
|
||||
</el-table-column>
|
||||
</ListTable>
|
||||
<ListColumnStatsRow
|
||||
</div>
|
||||
<div ref="disburseBelowRef">
|
||||
<ListColumnStatsRow
|
||||
ref="disburseStatsRowRef"
|
||||
storage-key="pl-freight-disburse-column-stats"
|
||||
:columns="disburseStatsRowColumns"
|
||||
@@ -141,9 +145,8 @@
|
||||
:table-wrap-el="disburseTableWrapRef"
|
||||
:get-cell-value="getDisburseStatCellValue"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="list-pager-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
</div>
|
||||
@@ -158,6 +161,7 @@
|
||||
@current-change="handlePageChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<PlFreightSettlementViewDialog ref="viewDialogRef">
|
||||
@@ -179,6 +183,7 @@ import ListColumnStatsRow from '@/components/business/list-column-stats-row/inde
|
||||
import type { StatsRowColumn } from '@/utils/list-column-stats'
|
||||
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
import { useListTableViewportHeight } from '@/composables/useListTableViewportHeight'
|
||||
import { Money, RefreshLeft, Search } from '@element-plus/icons-vue'
|
||||
import { freightApi, type FreightSettlement } from '@/api/pl'
|
||||
import PlFreightDisburseDialog from '@/components/business/pl-freight-disburse-dialog/index.vue'
|
||||
@@ -205,6 +210,13 @@ const {
|
||||
const emit = defineEmits<{ disbursed: [] }>()
|
||||
|
||||
const disburseTableWrapRef = ref<HTMLElement | null>(null)
|
||||
const disburseBelowRef = ref<HTMLElement | null>(null)
|
||||
const disburseTableRef = ref<any>(null)
|
||||
const { tableHeight, recalc: recalcTableHeight } = useListTableViewportHeight({
|
||||
tableEl: disburseTableWrapRef,
|
||||
pagerEl: disburseBelowRef,
|
||||
tableRef: disburseTableRef
|
||||
})
|
||||
const disburseStatsRowRef = ref<{ resync?: () => void } | null>(null)
|
||||
|
||||
const disburseStatsRowColumns = computed((): StatsRowColumn[] => {
|
||||
@@ -357,6 +369,8 @@ useDbInstantSearch(() => ({ q: searchForm.q }), handleSearch)
|
||||
|
||||
onMounted(() => {
|
||||
fetchData()
|
||||
|
||||
nextTick(() => recalcTableHeight())
|
||||
})
|
||||
|
||||
defineExpose({ refresh })
|
||||
|
||||
@@ -57,8 +57,10 @@
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<div ref="settledTableWrapRef" class="table-scroll bx-list-table-wrap">
|
||||
<ListTable table-key="pl-freight-components-settled-panel"
|
||||
class="list-table"
|
||||
<ListTable
|
||||
ref="settledTableRef" table-key="pl-freight-components-settled-panel"
|
||||
:height="tableHeight"
|
||||
class="list-table"
|
||||
:data="settlementList"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
@@ -126,7 +128,9 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ListTable>
|
||||
<ListColumnStatsRow
|
||||
</div>
|
||||
<div ref="settledBelowRef">
|
||||
<ListColumnStatsRow
|
||||
ref="settledStatsRowRef"
|
||||
storage-key="pl-freight-settled-column-stats"
|
||||
:columns="settledStatsRowColumns"
|
||||
@@ -134,9 +138,8 @@
|
||||
:table-wrap-el="settledTableWrapRef"
|
||||
:get-cell-value="getSettledStatCellValue"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="list-pager-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
</div>
|
||||
@@ -151,6 +154,7 @@
|
||||
@current-change="handlePageChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<PlFreightSettlementViewDialog ref="viewDialogRef" />
|
||||
@@ -165,6 +169,7 @@ import ListColumnStatsRow from '@/components/business/list-column-stats-row/inde
|
||||
import type { StatsRowColumn } from '@/utils/list-column-stats'
|
||||
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
import { useListTableViewportHeight } from '@/composables/useListTableViewportHeight'
|
||||
import { RefreshLeft, Search } from '@element-plus/icons-vue'
|
||||
import { freightApi, type FreightSettlement } from '@/api/pl'
|
||||
import PlFreightSettlementViewDialog from '@/components/business/pl-freight-settlement-view-dialog/index.vue'
|
||||
@@ -191,6 +196,13 @@ const {
|
||||
} = usePersistedListColumns('pl-freight-settled-columns', listColumnDefs)
|
||||
|
||||
const settledTableWrapRef = ref<HTMLElement | null>(null)
|
||||
const settledBelowRef = ref<HTMLElement | null>(null)
|
||||
const settledTableRef = ref<any>(null)
|
||||
const { tableHeight, recalc: recalcTableHeight } = useListTableViewportHeight({
|
||||
tableEl: settledTableWrapRef,
|
||||
pagerEl: settledBelowRef,
|
||||
tableRef: settledTableRef
|
||||
})
|
||||
const settledStatsRowRef = ref<{ resync?: () => void } | null>(null)
|
||||
|
||||
const settledStatsRowColumns = computed((): StatsRowColumn[] => {
|
||||
@@ -319,6 +331,8 @@ useDbInstantSearch(() => ({ q: searchForm.q }), handleSearch)
|
||||
|
||||
onMounted(() => {
|
||||
fetchData()
|
||||
|
||||
nextTick(() => recalcTableHeight())
|
||||
})
|
||||
|
||||
defineExpose({ refresh })
|
||||
|
||||
@@ -136,8 +136,10 @@
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<div ref="billsTableWrapRef" class="table-scroll bx-list-table-wrap">
|
||||
<ListTable table-key="pl-freight-components-settlement-bill-panel"
|
||||
class="list-table"
|
||||
<ListTable
|
||||
ref="billsTableRef" table-key="pl-freight-components-settlement-bill-panel"
|
||||
:height="tableHeight"
|
||||
class="list-table"
|
||||
:data="settlementList"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
@@ -246,7 +248,9 @@
|
||||
<template #default="{ row }">{{ formatDateTime(row.createTime) }}</template>
|
||||
</el-table-column>
|
||||
</ListTable>
|
||||
<ListColumnStatsRow
|
||||
</div>
|
||||
<div ref="billsBelowRef">
|
||||
<ListColumnStatsRow
|
||||
ref="billsStatsRowRef"
|
||||
storage-key="pl-freight-settlement-bill-column-stats"
|
||||
:columns="billsStatsRowColumns"
|
||||
@@ -254,9 +258,8 @@
|
||||
:table-wrap-el="billsTableWrapRef"
|
||||
:get-cell-value="getBillsStatCellValue"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="list-pager-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
</div>
|
||||
@@ -271,6 +274,7 @@
|
||||
@current-change="handlePageChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<PlFreightSettlementViewDialog ref="viewDialogRef">
|
||||
@@ -334,6 +338,7 @@ import ListColumnStatsRow from '@/components/business/list-column-stats-row/inde
|
||||
import type { StatsRowColumn } from '@/utils/list-column-stats'
|
||||
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
import { useListTableViewportHeight } from '@/composables/useListTableViewportHeight'
|
||||
import {
|
||||
CircleClose,
|
||||
Edit,
|
||||
@@ -376,6 +381,13 @@ const {
|
||||
} = usePersistedListColumns('pl-freight-settlement-bill-columns', listColumnDefs)
|
||||
|
||||
const billsTableWrapRef = ref<HTMLElement | null>(null)
|
||||
const billsBelowRef = ref<HTMLElement | null>(null)
|
||||
const billsTableRef = ref<any>(null)
|
||||
const { tableHeight, recalc: recalcTableHeight } = useListTableViewportHeight({
|
||||
tableEl: billsTableWrapRef,
|
||||
pagerEl: billsBelowRef,
|
||||
tableRef: billsTableRef
|
||||
})
|
||||
const billsStatsRowRef = ref<{ resync?: () => void } | null>(null)
|
||||
|
||||
const billsStatsRowColumns = computed((): StatsRowColumn[] => {
|
||||
@@ -610,6 +622,8 @@ useDbInstantSearch(
|
||||
onMounted(() => {
|
||||
loadCarrierList()
|
||||
fetchData()
|
||||
|
||||
nextTick(() => recalcTableHeight())
|
||||
})
|
||||
|
||||
defineExpose({ refresh })
|
||||
|
||||
@@ -94,8 +94,10 @@
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<div ref="unsettledTableWrapRef" class="table-scroll bx-list-table-wrap">
|
||||
<ListTable table-key="pl-freight-components-unsettled-plan-panel"
|
||||
class="list-table"
|
||||
<ListTable
|
||||
ref="unsettledTableRef" table-key="pl-freight-components-unsettled-plan-panel"
|
||||
:height="tableHeight"
|
||||
class="list-table"
|
||||
:data="planList"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
@@ -198,7 +200,9 @@
|
||||
}}</template>
|
||||
</el-table-column>
|
||||
</ListTable>
|
||||
<ListColumnStatsRow
|
||||
</div>
|
||||
<div ref="unsettledBelowRef">
|
||||
<ListColumnStatsRow
|
||||
ref="unsettledStatsRowRef"
|
||||
storage-key="pl-freight-unsettled-plan-column-stats"
|
||||
:columns="unsettledStatsRowColumns"
|
||||
@@ -206,9 +210,8 @@
|
||||
:table-wrap-el="unsettledTableWrapRef"
|
||||
:get-cell-value="getUnsettledStatCellValue"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="list-pager-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
</div>
|
||||
@@ -223,6 +226,7 @@
|
||||
@current-change="handlePageChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<PlPlanViewDialog v-model:visible="planViewVisible" :plan-id="viewPlanId" />
|
||||
@@ -237,6 +241,7 @@ import ListColumnStatsRow from '@/components/business/list-column-stats-row/inde
|
||||
import type { StatsRowColumn } from '@/utils/list-column-stats'
|
||||
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
import { useListTableViewportHeight } from '@/composables/useListTableViewportHeight'
|
||||
import { DocumentAdd, RefreshLeft, Search } from '@element-plus/icons-vue'
|
||||
import { freightApi, vehicleApi, type UnsettledPlanItem, type Vehicle } from '@/api/pl'
|
||||
import { usePlRemoteCarrierOptions } from '@/composables/usePlRemoteOptions'
|
||||
@@ -270,6 +275,13 @@ const {
|
||||
} = usePersistedListColumns('pl-freight-unsettled-plan-columns', listColumnDefs)
|
||||
|
||||
const unsettledTableWrapRef = ref<HTMLElement | null>(null)
|
||||
const unsettledBelowRef = ref<HTMLElement | null>(null)
|
||||
const unsettledTableRef = ref<any>(null)
|
||||
const { tableHeight, recalc: recalcTableHeight } = useListTableViewportHeight({
|
||||
tableEl: unsettledTableWrapRef,
|
||||
pagerEl: unsettledBelowRef,
|
||||
tableRef: unsettledTableRef
|
||||
})
|
||||
const unsettledStatsRowRef = ref<{ resync?: () => void } | null>(null)
|
||||
|
||||
const unsettledStatsRowColumns = computed((): StatsRowColumn[] => {
|
||||
@@ -474,6 +486,8 @@ onMounted(() => {
|
||||
loadCarrierList()
|
||||
loadVehicleOptions()
|
||||
fetchData()
|
||||
|
||||
nextTick(() => recalcTableHeight())
|
||||
})
|
||||
|
||||
defineExpose({ refresh })
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
class="panel-tabs"
|
||||
@tab-change="handleTabChange"
|
||||
>
|
||||
<el-tab-pane label="未结算计划" name="unsettled">
|
||||
<el-tab-pane label="未结算计划" name="unsettled" lazy>
|
||||
<UnsettledPlanPanel ref="unsettledRef" @created="handleSettlementCreated" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="结算单" name="bills">
|
||||
<el-tab-pane label="结算单" name="bills" lazy>
|
||||
<SettlementBillPanel ref="billsRef" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
Reference in new issue
Block a user