feat(admin): 增加履约渠道批量删除并统一分页配置

This commit is contained in:
yml2213
2026-11-02 17:31:55 +08:00
parent 735a791a2e
commit d871b93fde
14 changed files with 184 additions and 46 deletions
@@ -27,25 +27,25 @@ import {
setAdminProductPrice,
} from '@/services/admin'
import type { ProductCatalogItem } from '@/types/admin'
import { ADMIN_DEFAULT_PAGE_SIZE, buildAdminTablePagination } from '@/utils/admin-pagination'
import { useCostCenter } from './CostCenterContext'
const PAGE_SIZE = 100
export default function VoucherSkuPanel() {
const queryClient = useQueryClient()
const { canConfig, refreshAll } = useCostCenter()
const [page] = useState(1)
const [page, setPage] = useState(1)
const [pageSize, setPageSize] = useState(ADMIN_DEFAULT_PAGE_SIZE)
const [selected, setSelected] = useState<ProductCatalogItem | null>(null)
const [ensuringRules, setEnsuringRules] = useState(false)
const [form] = Form.useForm<{ amountFen: number; changeReason?: string }>()
const query = useQuery({
queryKey: ['cost-center-voucher-products', page],
queryKey: ['cost-center-voucher-products', page, pageSize],
queryFn: () =>
fetchAdminProductCatalog({
carrierType: 'third_party_voucher',
page,
pageSize: PAGE_SIZE,
pageSize,
}),
})
@@ -154,7 +154,15 @@ export default function VoucherSkuPanel() {
loading={query.isFetching}
dataSource={items}
columns={columns}
pagination={{ pageSize: 20, showSizeChanger: false }}
pagination={buildAdminTablePagination({
current: page,
pageSize,
total,
onChange: (nextPage, nextPageSize) => {
setPage(nextPageSize !== pageSize ? 1 : nextPage)
setPageSize(nextPageSize)
},
})}
/>
<Modal