Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
A
audit_material_manage
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_material_manage
Commits
97b9b7d3
Commit
97b9b7d3
authored
Sep 03, 2026
by
drigle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: derive material category tabs from subject config
parent
a4933ad8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
48 deletions
+26
-48
audit-material-center.business-flow.md
...project_manager_xy/audit-material-center.business-flow.md
+1
-1
index.jsx
src/pages/project_manager_xy/resource-booking/index.jsx
+25
-47
No files found.
src/pages/project_manager_xy/audit-material-center.business-flow.md
View file @
97b9b7d3
...
...
@@ -119,7 +119,7 @@
-
备注:匹配
`metadata.remark`
-
是否涉密:匹配
`metadata.is_confidential`
-
是否审计部材料:匹配
`metadata.is_audit_dept_material`
3.
页面提供“全部文件”与“分类快捷标签”两种浏览方式
3.
页面提供“全部文件”与“分类快捷标签”两种浏览方式
;分类标签按 Subject 字段
`archive_category.settings.options`
配置展示,顺序为“全部文件”“未分类”、其余配置分类,未分类始终紧邻全部文件
4.
列表固定每页 10 条,不提供每页条数切换,避免分页密度在不同终端间漂移
5.
用户通过上一页 / 下一页进行分页浏览
6.
在“全部文件”视图下,直接以列表展示当前筛选条件下的全部材料
...
...
src/pages/project_manager_xy/resource-booking/index.jsx
View file @
97b9b7d3
...
...
@@ -366,27 +366,6 @@ function sortMaterialsByTime(materials) {
);
}
function
mergeCategoryOptions
(
previousOptions
,
nextMaterials
)
{
const
optionMap
=
new
Map
(
(
previousOptions
||
[]).
map
((
item
)
=>
[
item
.
key
,
item
]),
);
(
nextMaterials
||
[]).
forEach
((
item
)
=>
{
const
key
=
item
.
archiveCategory
||
UNCATEGORIZED_CATEGORY_LABEL
;
const
current
=
optionMap
.
get
(
key
);
optionMap
.
set
(
key
,
{
key
,
label
:
key
,
count
:
current
?
current
.
count
+
1
:
1
,
icon
:
FolderIcon
,
});
});
return
[...
optionMap
.
values
()].
sort
(
(
left
,
right
)
=>
right
.
count
-
left
.
count
,
);
}
export
default
function
ResourceBookingPage
()
{
const
userInfo
=
useContext
(
UserContext
);
const
[
materialSearchForm
,
setMaterialSearchForm
]
=
useState
(
...
...
@@ -399,7 +378,6 @@ export default function ResourceBookingPage() {
const
[
activeCategory
,
setActiveCategory
]
=
useState
(
ALL_CATEGORY_KEY
);
const
[
pageSize
,
setPageSize
]
=
useState
(
DEFAULT_PAGE_SIZE
);
const
[
page
,
setPage
]
=
useState
(
0
);
const
[
categoryOptions
,
setCategoryOptions
]
=
useState
([]);
const
[
materials
,
setMaterials
]
=
useState
([]);
const
[
dashboard
,
setDashboard
]
=
useState
(()
=>
buildMaterialDashboard
([]));
const
[
activeMaterialId
,
setActiveMaterialId
]
=
useState
(
""
);
...
...
@@ -502,11 +480,6 @@ export default function ResourceBookingPage() {
totalCount
:
result
.
total
||
0
,
}),
);
setCategoryOptions
((
prev
)
=>
activeCategory
===
ALL_CATEGORY_KEY
?
mergeCategoryOptions
([],
result
.
materials
||
[])
:
prev
,
);
setTotal
(
result
.
total
||
0
);
setError
(
result
.
error
||
""
);
setLoading
(
false
);
...
...
@@ -543,21 +516,31 @@ export default function ResourceBookingPage() {
);
},
[
dashboard
.
sourceSuggestions
]);
const
categoryTabs
=
useMemo
(
()
=>
[
{
key
:
ALL_CATEGORY_KEY
,
label
:
"全部文件"
,
count
:
materials
.
length
,
icon
:
FolderIcon
,
},
...
categoryOptions
.
map
((
item
)
=>
({
key
:
item
.
key
,
label
:
item
.
label
,
count
:
item
.
count
,
icon
:
item
.
icon
,
})),
],
[
categoryOptions
,
materials
.
length
],
()
=>
{
const
categorizedTabs
=
archiveCategoryOptions
.
filter
((
item
)
=>
item
.
value
!==
UNCATEGORIZED_CATEGORY_LABEL
)
.
map
((
item
)
=>
({
key
:
item
.
value
,
label
:
item
.
label
,
icon
:
FolderIcon
,
}));
return
[
{
key
:
ALL_CATEGORY_KEY
,
label
:
"全部文件"
,
count
:
materials
.
length
,
icon
:
FolderIcon
,
},
{
key
:
UNCATEGORIZED_CATEGORY_LABEL
,
label
:
UNCATEGORIZED_CATEGORY_LABEL
,
icon
:
FolderIcon
,
},
...
categorizedTabs
,
];
},
[
archiveCategoryOptions
,
materials
.
length
],
);
useEffect
(()
=>
{
...
...
@@ -782,11 +765,6 @@ export default function ResourceBookingPage() {
totalCount
:
result
.
total
||
0
,
}),
);
setCategoryOptions
((
prev
)
=>
activeCategory
===
ALL_CATEGORY_KEY
?
mergeCategoryOptions
([],
result
.
materials
||
[])
:
prev
,
);
setTotal
(
result
.
total
||
0
);
setError
(
result
.
error
||
""
);
...
...
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