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
@@ -145,17 +145,20 @@
|
||||
|
||||
<!-- 数据表格 -->
|
||||
<div class="list-body list-wrap">
|
||||
<ListTable
|
||||
table-key="pl-plan-cert"
|
||||
class="list-table pl-plan-merge-list-table"
|
||||
:data="displayRows"
|
||||
v-loading="loading"
|
||||
row-key="rowKey"
|
||||
:span-method="planListSpanMethod"
|
||||
:row-class-name="getPlPlanListRowClassName"
|
||||
@selection-change="handleDisplaySelectionChange"
|
||||
@row-dblclick="handleDisplayRowDblClick"
|
||||
>
|
||||
<div ref="planCertTableWrapRef" class="table-scroll bx-list-table-wrap">
|
||||
<ListTable
|
||||
ref="planCertTableRef"
|
||||
table-key="pl-plan-cert"
|
||||
class="list-table pl-plan-merge-list-table"
|
||||
:height="tableHeight"
|
||||
:data="displayRows"
|
||||
v-loading="loading"
|
||||
row-key="rowKey"
|
||||
:span-method="planListSpanMethod"
|
||||
:row-class-name="getPlPlanListRowClassName"
|
||||
@selection-change="handleDisplaySelectionChange"
|
||||
@row-dblclick="handleDisplayRowDblClick"
|
||||
>
|
||||
<el-table-column
|
||||
type="selection"
|
||||
width="55"
|
||||
@@ -454,21 +457,23 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ListTable>
|
||||
</div>
|
||||
<div ref="planCertBelowRef">
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="list-pager-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
</div>
|
||||
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="list-pager-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
<el-pagination
|
||||
v-model:current-page="pagination.page"
|
||||
v-model:page-size="pagination.pageSize"
|
||||
:total="pagination.total"
|
||||
:page-sizes="[10, 20, 100, 500]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handlePageChange"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<el-pagination
|
||||
v-model:current-page="pagination.page"
|
||||
v-model:page-size="pagination.pageSize"
|
||||
:total="pagination.total"
|
||||
:page-sizes="[10, 20, 100, 500]"
|
||||
layout="total, sizes, prev, pager, next"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handlePageChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -536,6 +541,7 @@
|
||||
} from '@/composables/usePlToxicProductCertCheck'
|
||||
import { useContractDetailDialog } from '@/composables/useContractDetailDialog'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
import { useListTableViewportHeight } from '@/composables/useListTableViewportHeight'
|
||||
import { usePlPlanMergeListTable } from '@/composables/usePlPlanMergeListTable'
|
||||
import PlPlanViewDialog from '@/components/business/pl-plan-view-dialog/index.vue'
|
||||
import PlPlanTypeTabs from '@/components/business/pl-plan-type-tabs/index.vue'
|
||||
@@ -618,6 +624,15 @@
|
||||
const { visibleColumns, checkAll, isIndeterminate, isColumnVisible, resetToDefault } =
|
||||
usePersistedListColumns('pl-plan-cert-list-columns-v4', listColumnDefs)
|
||||
|
||||
const planCertTableWrapRef = ref<HTMLElement | null>(null)
|
||||
const planCertBelowRef = ref<HTMLElement | null>(null)
|
||||
const planCertTableRef = ref<any>(null)
|
||||
const { tableHeight, recalc: recalcTableHeight } = useListTableViewportHeight({
|
||||
tableEl: planCertTableWrapRef,
|
||||
pagerEl: planCertBelowRef,
|
||||
tableRef: planCertTableRef
|
||||
})
|
||||
|
||||
const selectedRows = ref<Plan[]>([])
|
||||
|
||||
const pagination = reactive({
|
||||
@@ -1001,6 +1016,7 @@
|
||||
|
||||
onMounted(() => {
|
||||
fetchData()
|
||||
nextTick(() => recalcTableHeight())
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in new issue
Block a user