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
@@ -65,14 +65,18 @@
|
||||
</div>
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<ListTable table-key="pl-inventory-document-reminder"
|
||||
class="list-table"
|
||||
:data="displayReminderList"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<div ref="docReminderTableWrapRef" class="table-scroll bx-list-table-wrap">
|
||||
<ListTable
|
||||
ref="docReminderTableRef"
|
||||
table-key="pl-inventory-document-reminder"
|
||||
class="list-table"
|
||||
:height="tableHeight"
|
||||
:data="displayReminderList"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
row-key="id"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column type="index" label="序号" width="68" align="center" header-align="center" />
|
||||
<el-table-column
|
||||
@@ -154,12 +158,14 @@
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
</ListTable>
|
||||
</div>
|
||||
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="list-pager-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
</div>
|
||||
<div ref="docReminderBelowRef">
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="list-pager-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@@ -172,6 +178,7 @@ import ListExportDropdown from '@/components/business/list-export-dropdown/index
|
||||
import { CircleCheck, RefreshLeft, Search } from '@element-plus/icons-vue'
|
||||
import { inventoryApi, type DocumentReminder } from '@/api/pl'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
import { useListTableViewportHeight } from '@/composables/useListTableViewportHeight'
|
||||
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
import { refreshMenuBadges } from '@/utils/menu-badge-registry'
|
||||
|
||||
@@ -193,6 +200,15 @@ const {
|
||||
resetToDefault
|
||||
} = usePersistedListColumns('pl-inventory-document-reminder-list-columns', listColumnDefs)
|
||||
|
||||
const docReminderTableWrapRef = ref<HTMLElement | null>(null)
|
||||
const docReminderBelowRef = ref<HTMLElement | null>(null)
|
||||
const docReminderTableRef = ref<any>(null)
|
||||
const { tableHeight, recalc: recalcTableHeight } = useListTableViewportHeight({
|
||||
tableEl: docReminderTableWrapRef,
|
||||
pagerEl: docReminderBelowRef,
|
||||
tableRef: docReminderTableRef
|
||||
})
|
||||
|
||||
const loading = ref(false)
|
||||
const resolveLoading = ref(false)
|
||||
const reminderSourceList = ref<DocumentReminder[]>([])
|
||||
@@ -337,5 +353,6 @@ useDbInstantSearch(() => ({ status: searchForm.status }), handleSearch)
|
||||
|
||||
onMounted(() => {
|
||||
fetchData()
|
||||
nextTick(() => recalcTableHeight())
|
||||
})
|
||||
</script>
|
||||
@@ -58,7 +58,10 @@
|
||||
</div>
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<ListTable table-key="pl-inventory-ledger"
|
||||
<div ref="ledgerTableWrapRef" class="table-scroll bx-list-table-wrap">
|
||||
<ListTable
|
||||
ref="ledgerTableRef"
|
||||
:height="tableHeight" table-key="pl-inventory-ledger"
|
||||
class="list-table"
|
||||
:data="inventoryList"
|
||||
v-loading="loading"
|
||||
@@ -163,7 +166,10 @@
|
||||
</el-table-column>
|
||||
</ListTable>
|
||||
|
||||
<div class="pagination list-pager-bar">
|
||||
|
||||
</div>
|
||||
<div ref="ledgerBelowRef">
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="list-pager-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
</div>
|
||||
@@ -178,6 +184,7 @@
|
||||
@current-change="handlePageChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
@@ -190,6 +197,7 @@ import ListExportDropdown from '@/components/business/list-export-dropdown/index
|
||||
import { RefreshLeft, Search } from '@element-plus/icons-vue'
|
||||
import { inventoryApi, type InventoryRecord } from '@/api/pl'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
import { useListTableViewportHeight } from '@/composables/useListTableViewportHeight'
|
||||
import { useDbInstantSearch } from '@/composables/useDbInstantSearch'
|
||||
|
||||
const listColumnDefs = [
|
||||
@@ -210,6 +218,15 @@ const {
|
||||
resetToDefault
|
||||
} = usePersistedListColumns('pl-inventory-ledger-list-columns', listColumnDefs)
|
||||
|
||||
const ledgerTableWrapRef = ref<HTMLElement | null>(null)
|
||||
const ledgerBelowRef = ref<HTMLElement | null>(null)
|
||||
const ledgerTableRef = ref<any>(null)
|
||||
const { tableHeight, recalc: recalcTableHeight } = useListTableViewportHeight({
|
||||
tableEl: ledgerTableWrapRef,
|
||||
pagerEl: ledgerBelowRef,
|
||||
tableRef: ledgerTableRef
|
||||
})
|
||||
|
||||
const loading = ref(false)
|
||||
const selectedRows = ref<any[]>([])
|
||||
|
||||
@@ -297,6 +314,8 @@ useDbInstantSearch(() => ({ productName: searchForm.productName }), handleSearch
|
||||
|
||||
onMounted(() => {
|
||||
fetchData()
|
||||
|
||||
nextTick(() => recalcTableHeight())
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in new issue
Block a user