Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
A
audit_project_manager
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
David Yang
audit_project_manager
Commits
918096b2
Commit
918096b2
authored
Sep 03, 2026
by
drigle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: restore dynamic form field actions
parent
01cf462f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
10 deletions
+18
-10
DynamicFormManager.jsx
src/components/DynamicFormManager.jsx
+1
-0
TableActionButton.jsx
src/components/TableActionButton.jsx
+2
-2
index.jsx
src/components/record-workbench/index.jsx
+15
-8
No files found.
src/components/DynamicFormManager.jsx
View file @
918096b2
...
...
@@ -402,6 +402,7 @@ function FieldsDialog({ form, open, onClose }) {
{
key
:
'move-down'
,
label
:
'下移'
,
icon
:
ArrowDownIcon
,
disabled
:
({
record
})
=>
fields
.
findIndex
((
item
)
=>
item
.
name
===
record
.
name
)
===
fields
.
length
-
1
,
onClick
:
({
record
})
=>
reorder
(
record
.
raw
,
1
)
},
{
key
:
'delete'
,
label
:
'删除'
,
icon
:
Delete
,
tone
:
'danger'
,
onClick
:
({
record
})
=>
setDeleteField
(
record
.
raw
)
},
]
}
collapseRowActions=
{
false
}
states=
{
{
loading
,
error
,
success
,
emptyTitle
:
'暂无字段'
,
emptyDescription
:
'使用“新建字段”配置表单结构。'
}
}
/>
...
...
src/components/TableActionButton.jsx
View file @
918096b2
...
...
@@ -92,9 +92,9 @@ function sortTableActions(actions) {
.
map
(({
action
})
=>
action
);
}
export
function
TableActionGroup
({
className
,
children
,
...
props
})
{
export
function
TableActionGroup
({
className
,
children
,
collapseOverflow
=
true
,
...
props
})
{
const
actions
=
sortTableActions
(
flattenActions
(
children
));
const
shouldCollapseOverflow
=
actions
.
length
>=
4
;
const
shouldCollapseOverflow
=
collapseOverflow
&&
actions
.
length
>=
4
;
const
visibleActions
=
shouldCollapseOverflow
?
actions
.
slice
(
0
,
2
)
:
actions
;
const
overflowActions
=
shouldCollapseOverflow
?
actions
.
slice
(
2
)
:
[];
...
...
src/components/record-workbench/index.jsx
View file @
918096b2
...
...
@@ -54,12 +54,12 @@ const DEFAULT_ROW_ACTION_ICONS = {
'view-detail'
:
Eye
,
};
function
resolveActionColumnWidth
(
rowActions
=
[],
explicitWidth
)
{
function
resolveActionColumnWidth
(
rowActions
=
[],
explicitWidth
,
collapseRowActions
=
true
)
{
if
(
Number
.
isFinite
(
explicitWidth
)
&&
explicitWidth
>
0
)
{
return
explicitWidth
;
}
const
visibleActionCount
=
rowActions
.
length
>=
4
const
visibleActionCount
=
collapseRowActions
&&
rowActions
.
length
>=
4
?
3
:
Math
.
max
(
1
,
rowActions
.
length
);
...
...
@@ -312,6 +312,13 @@ function defaultGetRecordLabel(record) {
return
record
?.
title
||
record
?.
name
||
record
?.
id
||
'当前记录'
;
}
function
getRecordFieldValue
(
record
,
field
)
{
const
mappedValue
=
getFieldValue
(
record
,
field
);
return
mappedValue
===
undefined
?
getFieldValue
(
record
?.
raw
,
field
)
:
mappedValue
;
}
function
getFilterPlaceholder
(
field
)
{
if
(
field
?.
placeholder
)
return
field
.
placeholder
;
if
(
field
?.
type
===
'text'
||
field
?.
type
===
'number'
)
return
'请输入'
;
...
...
@@ -322,8 +329,7 @@ function getFilterPlaceholder(field) {
}
function
defaultRenderCell
(
record
,
column
)
{
const
sourceRecord
=
record
?.
raw
||
record
;
const
value
=
getFieldValue
(
sourceRecord
,
column
.
field
);
const
value
=
getRecordFieldValue
(
record
,
column
.
field
);
const
text
=
formatFieldValue
(
value
,
column
.
fieldDef
)
||
'-'
;
if
(
column
.
fieldDef
?.
type
===
'user'
)
{
...
...
@@ -555,6 +561,7 @@ export default function RecordWorkbench({
pagination
=
null
,
stickyTable
=
false
,
showExpandColumn
=
true
,
collapseRowActions
=
true
,
})
{
const
tableScrollRef
=
useRef
(
null
);
const
pendingTableScrollRef
=
useRef
(
null
);
...
...
@@ -605,8 +612,8 @@ export default function RecordWorkbench({
[
records
,
getRecordId
],
);
const
resolvedActionColumnWidth
=
useMemo
(
()
=>
resolveActionColumnWidth
(
rowActions
,
actionColumnWidth
),
[
rowActions
,
actionColumnWidth
],
()
=>
resolveActionColumnWidth
(
rowActions
,
actionColumnWidth
,
collapseRowActions
),
[
rowActions
,
actionColumnWidth
,
collapseRowActions
],
);
const
stickyColumns
=
useMemo
(
()
=>
...
...
@@ -914,7 +921,7 @@ export default function RecordWorkbench({
}
if (columnIndex === 0 && detailPanel) {
const value = get
FieldValue(row.record?.raw ||
row.record, column.field);
const value = get
RecordFieldValue(
row.record, column.field);
const text = formatFieldValue(value, column.fieldDef) || '-';
return (
<DataTablePrimaryAction
...
...
@@ -946,7 +953,7 @@ export default function RecordWorkbench({
(action) => !isActionHidden(action, row.rowContext),
);
return (
<TableActionGroup className="justify-start">
<TableActionGroup className="justify-start"
collapseOverflow={collapseRowActions}
>
{visibleRowActions.map((action) =>
renderRowActionButton({
action,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment