Commit a603fa5e by Ivan

fix: 修正通过时, 标签选择的的滚动问题

parent 5565aa5b
......@@ -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-2050"
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" />
......
......@@ -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>
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment