Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
img-manager
Project
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Lan
img-manager
Commits
a603fa5e
Commit
a603fa5e
authored
Mar 10, 2025
by
Ivan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修正通过时, 标签选择的的滚动问题
parent
5565aa5b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
45 deletions
+47
-45
TagSearchInput.jsx
app/frontend/components/TagSearchInput.jsx
+42
-40
ComImageShow.jsx
app/frontend/components/images/ComImageShow.jsx
+4
-4
ComTagsIndex.jsx
app/frontend/components/tags/ComTagsIndex.jsx
+1
-1
No files found.
app/frontend/components/TagSearchInput.jsx
View file @
a603fa5e
...
...
@@ -159,7 +159,7 @@ export default function TagSearchInput({ value, onChange, placeholder = "输入
</
div
>
<
Popover
.
Portal
>
<
Popover
.
Content
className=
"bg-white rounded-md shadow-lg p-4 w-72 max-w-[calc(100vw-2rem)] z-2
0
50"
className=
"bg-white rounded-md shadow-lg p-4 w-72 max-w-[calc(100vw-2rem)] z-250"
sideOffset=
{
5
}
>
<
div
className=
"space-y-4"
>
...
...
@@ -189,46 +189,48 @@ export default function TagSearchInput({ value, onChange, placeholder = "输入
</
div
>
<
div
className=
"max-h-60 overflow-y-auto"
>
{
Object
.
keys
(
filteredTags
).
length
>
0
?
(
<
div
className=
"space-y-4"
>
{
Object
.
entries
(
filteredTags
).
map
(([
catalog
,
tags
])
=>
(
<
div
key=
{
catalog
||
'uncategorized'
}
className=
"space-y-2"
>
<
h3
className=
"text-sm font-bold text-gray-700"
>
{
catalog
||
'未分类'
}
</
h3
>
<
div
className=
"space-y-1"
>
{
Array
.
isArray
(
tags
)
?
tags
.
map
(
tag
=>
{
const
isSelected
=
selectedTags
.
some
(
t
=>
t
.
id
===
tag
.
id
)
return
(
<
button
key=
{
tag
.
id
}
type=
"button"
onClick=
{
()
=>
handleSelectTag
(
tag
)
}
// 已选中的标签也可以点击,用于反选
className=
{
`w-full text-left px-3 py-2 text-sm rounded-md ${
isSelected
? 'bg-indigo-100 text-indigo-800'
: 'text-gray-700 hover:bg-gray-100'
}`
}
>
{
tag
.
name
}
{
tag
.
images_count
>
0
&&
(
<
span
className=
"ml-2 text-xs text-gray-500"
>
(
{
tag
.
images_count
}
)
</
span
>
)
}
</
button
>
)
})
:
<
div
className=
"text-sm text-gray-500 py-1"
>
无可用标签
</
div
>
}
<
div
className=
"mb-4"
>
{
Object
.
keys
(
filteredTags
).
length
>
0
?
(
<
div
className=
"space-y-4"
>
{
Object
.
entries
(
filteredTags
).
map
(([
catalog
,
tags
])
=>
(
<
div
key=
{
catalog
||
'uncategorized'
}
className=
"space-y-2"
>
<
h3
className=
"text-sm font-bold text-gray-700"
>
{
catalog
||
'未分类'
}
</
h3
>
<
div
className=
"space-y-1"
>
{
Array
.
isArray
(
tags
)
?
tags
.
map
(
tag
=>
{
const
isSelected
=
selectedTags
.
some
(
t
=>
t
.
id
===
tag
.
id
)
return
(
<
button
key=
{
tag
.
id
}
type=
"button"
onClick=
{
()
=>
handleSelectTag
(
tag
)
}
// 已选中的标签也可以点击,用于反选
className=
{
`w-full text-left px-3 py-2 text-sm rounded-md ${
isSelected
? 'bg-indigo-100 text-indigo-800'
: 'text-gray-700 hover:bg-gray-100'
}`
}
>
{
tag
.
name
}
{
tag
.
images_count
>
0
&&
(
<
span
className=
"ml-2 text-xs text-gray-500"
>
(
{
tag
.
images_count
}
)
</
span
>
)
}
</
button
>
)
})
:
<
div
className=
"text-sm text-gray-500 py-1"
>
无可用标签
</
div
>
}
</
div
>
</
div
>
</
div
>
))
}
</
div
>
)
:
(
<
div
className=
"text-center py-4 text-sm text-gray-500"
>
{
searchQuery
?
'没有找到匹配的标签'
:
'没有可用的标签'
}
</
div
>
)
}
))
}
</
div
>
)
:
(
<
div
className=
"text-center py-4 text-sm text-gray-500"
>
{
searchQuery
?
'没有找到匹配的标签'
:
'没有可用的标签'
}
</
div
>
)
}
</
div
>
</
div
>
</
div
>
<
Popover
.
Arrow
className=
"fill-white"
/>
...
...
app/frontend/components/images/ComImageShow.jsx
View file @
a603fa5e
...
...
@@ -148,8 +148,8 @@ export default function ComImageShow({ path, image, can_edit, can_approve, isAdm
{
/* 全屏图片模态框 */
}
<
Dialog
.
Root
open=
{
isModalOpen
}
onOpenChange=
{
setIsModalOpen
}
>
<
Dialog
.
Portal
>
<
Dialog
.
Overlay
className=
"fixed inset-0 bg-black/50 z-
100
"
/>
<
Dialog
.
Content
className=
"fixed inset-0 flex items-center justify-center z-
150
"
>
<
Dialog
.
Overlay
className=
"fixed inset-0 bg-black/50 z-
[100]
"
/>
<
Dialog
.
Content
className=
"fixed inset-0 flex items-center justify-center z-
[150]
"
>
<
Dialog
.
Title
className=
"hidden"
/>
<
div
className=
"relative w-full h-full max-w-screen-xl max-h-screen p-4"
>
<
img
...
...
@@ -186,8 +186,8 @@ export default function ComImageShow({ path, image, can_edit, can_approve, isAdm
{
/* 审核通过确认对话框 */
}
<
Dialog
.
Root
open=
{
isApproveDialogOpen
}
onOpenChange=
{
setIsApproveDialogOpen
}
>
<
Dialog
.
Portal
>
<
Dialog
.
Overlay
className=
"fixed inset-0 bg-black/50 z-100"
/>
<
Dialog
.
Content
className=
"fixed
z-150 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-md bg-white rounded-lg shadow-xl p-6 z-50
"
>
{
/* <Dialog.Overlay className="fixed inset-0 bg-black/50 z-[100]" /> */
}
<
Dialog
.
Content
className=
"fixed
top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-full max-w-md bg-white rounded-lg shadow-xl p-6 z-[200]
"
>
<
Dialog
.
Title
className=
"text-lg font-medium text-gray-900 mb-4"
>
确认通过审核
</
Dialog
.
Title
>
...
...
app/frontend/components/tags/ComTagsIndex.jsx
View file @
a603fa5e
...
...
@@ -266,7 +266,7 @@ export default function ComTagsIndex({
<
button
type=
"submit"
disabled=
{
createProcessing
}
className=
"inline-flex justify-center w-full rounded-md border border-transparent shadow-sm px-4 py-2 bg-indigo-600 text-base font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:text-sm disabled:opacity-50"
className=
"inline-flex
mb-2
justify-center w-full rounded-md border border-transparent shadow-sm px-4 py-2 bg-indigo-600 text-base font-medium text-white hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:text-sm disabled:opacity-50"
>
创建
</
button
>
...
...
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