style(frontend): 列表表格改为表体内部滚动,分页默认 20 条
- 各列表 el-table/DataTable 传 height="100%",让表头固定、表体滚动 (原先只写了 CSS height,Element Plus 不会生成内部滚动容器,行多时被父容器裁掉) - 每页条数选项改为 20/50/100/200,默认 20;移除硬编码的 10 条/页 (外打平台商家列表、店铺商品绑定弹窗、商品选择弹窗统一走 DEFAULT_PAGE_SIZE) - 清理因此失效的 .fill-table 样式 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
266c01538e
commit
b946d09a03
@ -1,5 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue'
|
import { computed, ref } from 'vue'
|
||||||
|
import { DEFAULT_PAGE_SIZE } from '@/composables/useListPage'
|
||||||
import {
|
import {
|
||||||
getProducts,
|
getProducts,
|
||||||
searchProducts,
|
searchProducts,
|
||||||
@ -82,7 +83,7 @@ const pickerLoading = ref(false)
|
|||||||
const pickerList = ref<ProductItem[]>([])
|
const pickerList = ref<ProductItem[]>([])
|
||||||
const pickerTotal = ref(0)
|
const pickerTotal = ref(0)
|
||||||
const pickerPage = ref(1)
|
const pickerPage = ref(1)
|
||||||
const pickerPageSize = ref(10)
|
const pickerPageSize = ref(DEFAULT_PAGE_SIZE)
|
||||||
|
|
||||||
async function openPicker() {
|
async function openPicker() {
|
||||||
pickerVisible.value = true
|
pickerVisible.value = true
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import { ref, type Ref } from 'vue'
|
import { ref, type Ref } from 'vue'
|
||||||
|
|
||||||
/** 每页条数下拉可选项 */
|
/** 每页条数下拉可选项(不再提供 10 条/页) */
|
||||||
export const PAGE_SIZES = [10, 20, 50, 100]
|
export const PAGE_SIZES = [20, 50, 100, 200]
|
||||||
/** 默认每页条数 */
|
/** 默认每页条数 */
|
||||||
export const DEFAULT_PAGE_SIZE = 10
|
export const DEFAULT_PAGE_SIZE = 20
|
||||||
|
|
||||||
/** 分页查询条件:各列表页的 query 至少要含 page / pageSize */
|
/** 分页查询条件:各列表页的 query 至少要含 page / pageSize */
|
||||||
export interface PageQuery {
|
export interface PageQuery {
|
||||||
|
|||||||
@ -200,7 +200,7 @@ onUnmounted(() => stopPolling())
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<div class="table-wrap">
|
<div class="table-wrap">
|
||||||
<DataTable :loading="loading" :data="list" class="fill-table">
|
<DataTable :loading="loading" :data="list" height="100%">
|
||||||
<el-table-column prop="id" label="ID" width="80" />
|
<el-table-column prop="id" label="ID" width="80" />
|
||||||
<el-table-column label="类型" width="120">
|
<el-table-column label="类型" width="120">
|
||||||
<template #default="{ row }">{{ row.type_label || row.type }}</template>
|
<template #default="{ row }">{{ row.type_label || row.type }}</template>
|
||||||
|
|||||||
@ -877,7 +877,7 @@ onMounted(fetchList)
|
|||||||
:loading="loading"
|
:loading="loading"
|
||||||
:data="list"
|
:data="list"
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
class="fill-table"
|
height="100%"
|
||||||
@row-click="handleRowClick"
|
@row-click="handleRowClick"
|
||||||
>
|
>
|
||||||
<el-table-column prop="code" label="仓库编码" width="180" />
|
<el-table-column prop="code" label="仓库编码" width="180" />
|
||||||
@ -990,7 +990,7 @@ onMounted(fetchList)
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom-table-wrap">
|
<div class="bottom-table-wrap">
|
||||||
<DataTable :loading="configLoading" :data="configList" class="fill-table">
|
<DataTable :loading="configLoading" :data="configList" height="100%">
|
||||||
<el-table-column prop="name" label="配置名称" min-width="140" />
|
<el-table-column prop="name" label="配置名称" min-width="140" />
|
||||||
<el-table-column label="接口类型" width="150">
|
<el-table-column label="接口类型" width="150">
|
||||||
<template #default>{{ API_TYPE_LABEL }}</template>
|
<template #default>{{ API_TYPE_LABEL }}</template>
|
||||||
@ -1048,7 +1048,7 @@ onMounted(fetchList)
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom-table-wrap">
|
<div class="bottom-table-wrap">
|
||||||
<DataTable :loading="mappingLoading" :data="mappingList" class="fill-table">
|
<DataTable :loading="mappingLoading" :data="mappingList" height="100%">
|
||||||
<el-table-column label="快递名称" min-width="150">
|
<el-table-column label="快递名称" min-width="150">
|
||||||
<template #default="{ row }">{{ row.express_name || '-' }}</template>
|
<template #default="{ row }">{{ row.express_name || '-' }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -1099,7 +1099,7 @@ onMounted(fetchList)
|
|||||||
<ExportButton type="warehouse_product" :filters="productExportFilters" size="small" plain />
|
<ExportButton type="warehouse_product" :filters="productExportFilters" size="small" plain />
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom-table-wrap">
|
<div class="bottom-table-wrap">
|
||||||
<DataTable :loading="productLoading" :data="productList" class="fill-table" @selection-change="handleProductSelectionChange">
|
<DataTable :loading="productLoading" :data="productList" height="100%" @selection-change="handleProductSelectionChange">
|
||||||
<el-table-column type="selection" width="45" />
|
<el-table-column type="selection" width="45" />
|
||||||
<el-table-column prop="item_code" label="商品编码" min-width="130" />
|
<el-table-column prop="item_code" label="商品编码" min-width="130" />
|
||||||
<el-table-column prop="item_name" label="商品名称" min-width="180" show-overflow-tooltip />
|
<el-table-column prop="item_name" label="商品名称" min-width="180" show-overflow-tooltip />
|
||||||
@ -1163,7 +1163,7 @@ onMounted(fetchList)
|
|||||||
<ExportButton type="warehouse_product" :filters="inventoryExportFilters" size="small" plain />
|
<ExportButton type="warehouse_product" :filters="inventoryExportFilters" size="small" plain />
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom-table-wrap">
|
<div class="bottom-table-wrap">
|
||||||
<DataTable :loading="inventoryLoading" :data="displayInventoryList" class="fill-table" @selection-change="handleInventorySelectionChange">
|
<DataTable :loading="inventoryLoading" :data="displayInventoryList" height="100%" @selection-change="handleInventorySelectionChange">
|
||||||
<el-table-column type="selection" width="45" />
|
<el-table-column type="selection" width="45" />
|
||||||
<el-table-column prop="item_code" label="商品编码" min-width="130" />
|
<el-table-column prop="item_code" label="商品编码" min-width="130" />
|
||||||
<el-table-column prop="item_name" label="商品名称" min-width="180" show-overflow-tooltip />
|
<el-table-column prop="item_name" label="商品名称" min-width="180" show-overflow-tooltip />
|
||||||
@ -1219,7 +1219,7 @@ onMounted(fetchList)
|
|||||||
<ExportButton type="api_outbound_log" :filters="detailExportFilters" size="small" plain />
|
<ExportButton type="api_outbound_log" :filters="detailExportFilters" size="small" plain />
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom-table-wrap">
|
<div class="bottom-table-wrap">
|
||||||
<DataTable :loading="outboundLoading" :data="outboundLogs" class="fill-table">
|
<DataTable :loading="outboundLoading" :data="outboundLogs" height="100%">
|
||||||
<el-table-column type="expand">
|
<el-table-column type="expand">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<div class="log-detail">
|
<div class="log-detail">
|
||||||
@ -1425,9 +1425,6 @@ onMounted(fetchList)
|
|||||||
min-height: 0;
|
min-height: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.fill-table {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
.hint {
|
.hint {
|
||||||
color: var(--el-text-color-secondary);
|
color: var(--el-text-color-secondary);
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
|||||||
@ -474,7 +474,7 @@ onMounted(async () => {
|
|||||||
:loading="loading"
|
:loading="loading"
|
||||||
:data="list"
|
:data="list"
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
class="fill-table"
|
height="100%"
|
||||||
@row-click="handleRowClick"
|
@row-click="handleRowClick"
|
||||||
>
|
>
|
||||||
<el-table-column prop="bill_no" label="单号" min-width="160" />
|
<el-table-column prop="bill_no" label="单号" min-width="160" />
|
||||||
@ -614,7 +614,7 @@ onMounted(async () => {
|
|||||||
<el-button type="primary" :disabled="!currentOrder || itemSaving || itemsLocked" :loading="itemSaving" @click="saveItems">保存明细</el-button>
|
<el-button type="primary" :disabled="!currentOrder || itemSaving || itemsLocked" :loading="itemSaving" @click="saveItems">保存明细</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom-table-wrap" v-loading="itemsLoading">
|
<div class="bottom-table-wrap" v-loading="itemsLoading">
|
||||||
<el-table :data="editItems" size="small" border class="fill-table">
|
<el-table :data="editItems" size="small" border height="100%">
|
||||||
<el-table-column type="index" label="行号" width="60" align="center" />
|
<el-table-column type="index" label="行号" width="60" align="center" />
|
||||||
<el-table-column label="系统商品" min-width="220">
|
<el-table-column label="系统商品" min-width="220">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
@ -881,9 +881,6 @@ onMounted(async () => {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
}
|
}
|
||||||
.fill-table {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
.info-pane {
|
.info-pane {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@ -522,7 +522,7 @@ onMounted(async () => {
|
|||||||
:loading="loading"
|
:loading="loading"
|
||||||
:data="list"
|
:data="list"
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
class="fill-table"
|
height="100%"
|
||||||
@row-click="handleRowClick"
|
@row-click="handleRowClick"
|
||||||
>
|
>
|
||||||
<el-table-column prop="bill_no" label="单号" min-width="160" />
|
<el-table-column prop="bill_no" label="单号" min-width="160" />
|
||||||
@ -682,7 +682,7 @@ onMounted(async () => {
|
|||||||
<el-button type="primary" :disabled="!currentOrder || itemSaving || itemsLocked" :loading="itemSaving" @click="saveItems">保存明细</el-button>
|
<el-button type="primary" :disabled="!currentOrder || itemSaving || itemsLocked" :loading="itemSaving" @click="saveItems">保存明细</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom-table-wrap" v-loading="itemsLoading">
|
<div class="bottom-table-wrap" v-loading="itemsLoading">
|
||||||
<el-table :data="editItems" size="small" border class="fill-table">
|
<el-table :data="editItems" size="small" border height="100%">
|
||||||
<el-table-column type="index" label="行号" width="60" align="center" />
|
<el-table-column type="index" label="行号" width="60" align="center" />
|
||||||
<el-table-column label="系统商品" min-width="220">
|
<el-table-column label="系统商品" min-width="220">
|
||||||
<template #default="{ row, $index }">
|
<template #default="{ row, $index }">
|
||||||
@ -990,9 +990,6 @@ onMounted(async () => {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
}
|
}
|
||||||
.fill-table {
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
.info-pane {
|
.info-pane {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@ -435,7 +435,7 @@ onMounted(async () => {
|
|||||||
:loading="loading"
|
:loading="loading"
|
||||||
:data="list"
|
:data="list"
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
class="fill-table"
|
height="100%"
|
||||||
@row-click="handleRowClick"
|
@row-click="handleRowClick"
|
||||||
>
|
>
|
||||||
<el-table-column prop="bill_no" label="单号" min-width="160" />
|
<el-table-column prop="bill_no" label="单号" min-width="160" />
|
||||||
|
|||||||
@ -218,7 +218,7 @@ onMounted(() => {
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<div class="table-wrap">
|
<div class="table-wrap">
|
||||||
<DataTable :loading="loading" :data="list" class="fill-table">
|
<DataTable :loading="loading" :data="list" height="100%">
|
||||||
<el-table-column prop="created_at" label="记录时间" width="165">
|
<el-table-column prop="created_at" label="记录时间" width="165">
|
||||||
<template #default="{ row }">{{ formatDateTime(row.created_at) }}</template>
|
<template #default="{ row }">{{ formatDateTime(row.created_at) }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user