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
5c787d05
Commit
5c787d05
authored
Mar 10, 2025
by
Ivan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复Observer
parent
28692f2c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
28 deletions
+10
-28
ComImageCard.jsx
app/frontend/components/images/ComImageCard.jsx
+7
-4
ComImageIndex.jsx
app/frontend/components/images/ComImageIndex.jsx
+3
-24
No files found.
app/frontend/components/images/ComImageCard.jsx
View file @
5c787d05
import
{
Link
}
from
"@inertiajs/react"
;
import
ComImageStatusTag
from
"./ComImageStatusTag"
;
import
{
forwardRef
}
from
'react'
;
export
function
ComImageCard
({
image
,
path
,
showUserName
=
false
})
{
// Convert to forwardRef to allow the IntersectionObserver to work
export
const
ComImageCard
=
forwardRef
(({
image
,
path
,
showUserName
=
false
},
ref
)
=>
{
return
(
<
div
ref=
{
ref
}
className=
"bg-white overflow-hidden shadow rounded-lg flex flex-col"
>
<
div
className=
"relative pb-[75%]"
>
...
...
@@ -49,5 +52,5 @@ export function ComImageCard({ image, path, showUserName = false}) {
</
div
>
</
div
>
</
div
>
)
}
\ No newline at end of file
);
});
\ No newline at end of file
app/frontend/components/images/ComImageIndex.jsx
View file @
5c787d05
...
...
@@ -46,16 +46,6 @@ export default function ComImageIndex({ title, description, path, images, pagina
setLoadedPageMap
({})
setMaxVisiblePage
(
0
)
setAllImages
([])
// 打印搜索参数以便调试
console
.
log
(
'搜索参数:'
,
{
title_cont
:
searchParams
.
title_cont
,
tags_name_cont
:
searchParams
.
tags_name_cont
,
tags_id_in
:
searchParams
.
tags_id_in
,
created_at_gteq
:
searchParams
.
created_at_gteq
,
created_at_lteq
:
searchParams
.
created_at_lteq
,
status_eq
:
searchParams
.
status_eq
})
loadPage
(
1
)
}
...
...
@@ -68,19 +58,6 @@ export default function ComImageIndex({ title, description, path, images, pagina
try
{
setLoading
(
true
)
// 打印请求参数以便调试
console
.
log
(
'发送请求参数:'
,
{
page
:
currentPage
,
q
:
{
title_cont
:
searchParams
.
title_cont
,
tags_name_cont
:
searchParams
.
tags_name_cont
,
tags_id_in
:
searchParams
.
tags_id_in
,
created_at_gteq
:
searchParams
.
created_at_gteq
,
created_at_lteq
:
searchParams
.
created_at_lteq
,
status_eq
:
searchParams
.
status_eq
}
})
await
router
.
visit
(
path
,
{
...
...
@@ -101,7 +78,6 @@ export default function ComImageIndex({ title, description, path, images, pagina
replace
:
true
,
only
:
[
'images'
,
'pagination'
],
onSuccess
:
(
response
)
=>
{
// Prepend new images to existing ones
setPage
(
response
.
props
.
pagination
.
current_page
)
setHasMore
(
maxVisiblePage
<
response
.
props
.
pagination
.
total_pages
)
setFilterCount
(
Object
.
values
(
searchParams
).
filter
(
i
=>
Array
.
isArray
(
i
)
?
i
.
length
:
!!
i
).
length
)
...
...
@@ -401,6 +377,9 @@ export default function ComImageIndex({ title, description, path, images, pagina
</
svg
>
</
div
>
)
}
{
!
loading
&&
allImages
.
length
>
0
&&
!
hasMore
&&
(<
div
className=
"flex justify-center mt-6 pb-6"
>
没有更多了
</
div
>)
}
</
div
>
</>
)
...
...
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