feat(web-admin): roll out viewport list height to more lists
Apply fill-viewport table height on demo product/order, bx mine, and db weighing. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
b8efcca1cf
commit
fa48577a74
4 files changed
+106
-49
No files matched your search
@@ -114,8 +114,11 @@
|
||||
|
||||
<div class="list-body list-wrap">
|
||||
<div ref="weighingTableWrapRef" class="table-scroll bx-list-table-wrap">
|
||||
<ListTable table-key="db-weighing"
|
||||
<ListTable
|
||||
ref="weighingTableRef"
|
||||
table-key="db-weighing"
|
||||
class="list-table"
|
||||
:height="tableHeight"
|
||||
:data="paginatedData"
|
||||
v-loading="loading"
|
||||
stripe
|
||||
@@ -323,6 +326,8 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ListTable>
|
||||
</div>
|
||||
<div ref="weighingBelowRef">
|
||||
<ListColumnStatsRow
|
||||
ref="weighingStatsRowRef"
|
||||
storage-key="db-weighing-column-stats"
|
||||
@@ -331,23 +336,23 @@
|
||||
:table-wrap-el="weighingTableWrapRef"
|
||||
:get-cell-value="getWeighingStatCellValue"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="list-pager-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
<div class="pagination list-pager-bar">
|
||||
<div class="list-pager-selected">
|
||||
已选 <span class="sel-num">{{ selectedRows.length }}</span> 项
|
||||
</div>
|
||||
|
||||
<el-pagination
|
||||
v-show="total > 0"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:total="total"
|
||||
:page-sizes="[10, 20, 100, 500]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@current-change="handlePageChange"
|
||||
@size-change="handleSizeChange"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<el-pagination
|
||||
v-show="total > 0"
|
||||
v-model:current-page="currentPage"
|
||||
v-model:page-size="pageSize"
|
||||
:total="total"
|
||||
:page-sizes="[10, 20, 100, 500]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@current-change="handlePageChange"
|
||||
@size-change="handleSizeChange"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -549,6 +554,7 @@
|
||||
import ListColumnStatsRow from '@/components/business/list-column-stats-row/index.vue'
|
||||
import type { StatsRowColumn } from '@/utils/list-column-stats'
|
||||
import { usePersistedListColumns } from '@/composables/usePersistedListColumns'
|
||||
import { useListTableViewportHeight } from '@/composables/useListTableViewportHeight'
|
||||
import DbCrmProductSelect from '@/components/business/db/DbCrmProductSelect.vue'
|
||||
import DbRelatedViewDialog from '@/components/business/db/DbRelatedViewDialog.vue'
|
||||
import { buildWeighingRelatedSections } from '@/components/business/db/db-related-view'
|
||||
@@ -612,8 +618,16 @@
|
||||
|
||||
|
||||
const weighingTableWrapRef = ref<HTMLElement | null>(null)
|
||||
const weighingBelowRef = ref<HTMLElement | null>(null)
|
||||
const weighingTableRef = ref<any>(null)
|
||||
const weighingStatsRowRef = ref<{ resync?: () => void } | null>(null)
|
||||
|
||||
const { tableHeight, recalc: recalcTableHeight } = useListTableViewportHeight({
|
||||
tableEl: weighingTableWrapRef,
|
||||
pagerEl: weighingBelowRef,
|
||||
tableRef: weighingTableRef
|
||||
})
|
||||
|
||||
const weighingStatsRowColumns = computed((): StatsRowColumn[] => {
|
||||
const cols: StatsRowColumn[] = [
|
||||
{ key: '__selection', interactive: false },
|
||||
|
||||
Reference in new issue
Block a user