Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
ujia
/
uj-store
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 4645629a
authored
Oct 16, 2026
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'v1.0.0' of
http://192.168.3.233:8090/ujia/uj-store
into v1.0.0
2 parents
a28f9ad1
1b222cf8
Pipeline
#365
for
4645629a
failed
in 0 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
src/components/DataTable/index.tsx
src/pages/StoreListing/index.tsx
src/components/DataTable/index.tsx
View file @
4645629
...
...
@@ -79,7 +79,7 @@ export function DataTable<T extends object>({
rowSelection,
actionColumnTitle = '操作',
actionColumnWidth,
actionColumnFixed,
actionColumnFixed
= 'right'
,
toolbarClassName,
toolbarTitle,
fillHeight = false,
...
...
@@ -196,6 +196,7 @@ export function DataTable<T extends object>({
]
: [...columns, ...(actionColumn ? [actionColumn] : [])];
const hasLineLimit = hasLineConfigured(sourceColumns);
const minTableWidth = getMinimumTableWidth(sourceColumns);
const tableColumns = withLineLimit(sourceColumns);
const TableComponent = fillHeight ? FillTable<T> : UTable<T>;
return (
...
...
@@ -226,6 +227,7 @@ export function DataTable<T extends object>({
columns={tableColumns}
tableLayout={hasLineLimit ? 'fixed' : undefined}
rowSelection={resolvedSelection}
scroll={{ ...props.scroll, x: props.scroll?.x ?? minTableWidth }}
styles={{
header: { cell: { paddingLeft: 20 } },
body: { cell: { paddingLeft: 20 } },
...
...
@@ -266,6 +268,15 @@ function hasLineConfigured<T extends object>(columns: ColumnsType<T>): boolean {
});
}
function getMinimumTableWidth<T extends object>(columns: ColumnsType<T>): number {
return columns.reduce((width, column) => {
if ('children' in column && column.children) {
return width + getMinimumTableWidth(column.children);
}
return width + (typeof column.width === 'number' ? column.width : 120);
}, 0);
}
function withLineLimit<T extends object>(columns: DataTableColumnsType<T>): ColumnsType<T> {
return columns.map((column) => {
if ('children' in column && column.children) {
...
...
src/pages/StoreListing/index.tsx
View file @
4645629
...
...
@@ -238,8 +238,8 @@ export default function StoreListing() {
total,
showSizeChanger: false,
pageSizeOptions: [10, 20, 50, 100],
showTotal: (count
, range
) =>
`共 ${count.toLocaleString('zh-CN')} 条记录 · 每页 ${params.size ?? DEFAULT_PAGE_SIZE} 条
· 当前 ${range[0]}–${range[1]} 条
`,
showTotal: (count) =>
`共 ${count.toLocaleString('zh-CN')} 条记录 · 每页 ${params.size ?? DEFAULT_PAGE_SIZE} 条`,
onChange: (current, size) =>
setParams((previous) => ({
...previous,
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment