Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
I
integrity_risk_prevention
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
integrity_risk_prevention
Commits
2da8483a
Commit
2da8483a
authored
Sep 02, 2026
by
drigle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: support configurable view filter fields
parent
fb9d7988
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
SubjectRecordWorkbench.jsx
src/components/SubjectRecordWorkbench.jsx
+29
-1
integrity-risk-prevention.business-flow.md
...isk_prevention/integrity-risk-prevention.business-flow.md
+5
-1
No files found.
src/components/SubjectRecordWorkbench.jsx
View file @
2da8483a
...
...
@@ -10,6 +10,7 @@ import {
queryUsers
,
}
from
'@/services/DataService'
;
import
{
buildViewColumns
,
getFieldValue
,
getReferenceSubjectName
,
getSelectOptions
,
...
...
@@ -31,6 +32,30 @@ import {
const
DEFAULT_PAGE_SIZE
=
10
;
const
BOOLEAN_FILTER_OPTIONS
=
[{
label
:
'是'
,
value
:
'true'
},
{
label
:
'否'
,
value
:
'false'
}];
function
normalizeFilterFieldPath
(
field
)
{
const
value
=
typeof
field
===
'string'
?
field
.
trim
()
:
''
;
if
(
!
value
)
return
''
;
return
value
===
'title'
||
value
.
startsWith
(
'metadata.'
)
?
value
:
`metadata.
${
value
}
`
;
}
function
resolveFilterColumns
(
view
,
columns
=
[],
subject
)
{
const
configuredFields
=
view
?.
settings
?.
filters
?.
fields
;
if
(
!
Array
.
isArray
(
configuredFields
))
return
columns
;
const
allViewColumns
=
buildViewColumns
(
view
,
subject
,
{
includeHidden
:
true
});
const
columnsByField
=
new
Map
(
[...
allViewColumns
,
...
columns
].
map
((
column
)
=>
[
column
.
field
,
column
]),
);
return
configuredFields
.
map
((
item
)
=>
{
const
configuredField
=
typeof
item
===
'string'
?
item
:
item
?.
field
||
item
?.
path
||
item
?.
name
;
return
columnsByField
.
get
(
normalizeFilterFieldPath
(
configuredField
));
})
.
filter
(
Boolean
);
}
function
buildFilterSchema
(
columns
=
[])
{
return
columns
.
reduce
((
fields
,
column
)
=>
{
const
fieldDef
=
column
?.
fieldDef
||
{};
...
...
@@ -311,7 +336,10 @@ export default function SubjectRecordWorkbench({
setSelectedIds
((
current
)
=>
current
.
filter
((
id
)
=>
visibleIds
.
has
(
id
)));
},
[
filteredRecords
]);
const
filterSchema
=
useMemo
(()
=>
buildFilterSchema
(
visibleColumns
),
[
visibleColumns
]);
const
filterSchema
=
useMemo
(
()
=>
buildFilterSchema
(
resolveFilterColumns
(
activeView
,
visibleColumns
,
subject
)),
[
activeView
,
subject
,
visibleColumns
],
);
const
feedbackHelpers
=
useMemo
(()
=>
({
reload
,
...
...
src/pages/integrity_risk_prevention/integrity-risk-prevention.business-flow.md
View file @
2da8483a
...
...
@@ -20,7 +20,11 @@
## 2. 表格与详情边界
1.
四个列表页继续使用当前项目的
`SubjectRecordWorkbench`
和
`RecordWorkbench`
。
2.
表格列、分组、排序、筛选、视图限制和字段选项由线上 Subject/View 配置驱动。
2.
表格列、分组、排序、筛选、视图限制和字段选项由线上 Subject/View 配置驱动。筛选清单默认使用当前
Grid View 的可见列;如
`settings.filters.fields`
配置字段数组,则仅按该数组顺序展示筛选控件,
显式配置可引用 View 中的隐藏列。数组项支持字段路径字符串(如
`metadata.business_unit`
或
`business_unit`
)及
`{ field }`
、
`{ path }`
、
`{ name }`
对象;空数组表示该视图不展示筛选控件,
未配置该属性时才回退到可见列,无效字段忽略。
`settings.groups`
的分组入口显示真实组名、列数和字段清单;Hover/Focus 会预览对应表头,
点击只切换该组列的显示状态。分组字段表头同时展示分组名和字段名,不改变查询或记录数据。
3.
详情继续使用当前
`RecordDetailDrawer`
,列表页不复制或改写详情抽屉逻辑;可编辑页面
...
...
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