feat: 本次提交更新内容如下

样式和功能补齐
This commit is contained in:
2025-07-10 11:50:34 +08:00
parent b4797425fc
commit 2c1e0ab7ac
7 changed files with 68 additions and 29 deletions

View File

@@ -2,7 +2,7 @@ import React, { useState, useEffect, useCallback } from 'react';
import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/components/ui/dialog';
import { Input } from '@/components/ui/input';
import { Button } from '@/components/ui/button';
import { Checkbox } from '@/components/ui/checkbox';
import { Badge } from '@/components/ui/badge';
import { Search, RefreshCw, Loader2 } from 'lucide-react';
import { fetchContentLibraryList } from '@/api/content';
import { ContentLibrary } from '@/api/content';
@@ -50,7 +50,7 @@ export function ContentLibrarySelectionDialog({
fetchLibraries();
setTempSelected(selectedLibraries);
}
}, [open, searchQuery, selectedLibraries, fetchLibraries]);
}, [open, selectedLibraries, fetchLibraries]);
const handleRefresh = () => {
fetchLibraries();
@@ -86,7 +86,7 @@ export function ContentLibrarySelectionDialog({
return (
<Dialog open={open} onOpenChange={handleDialogOpenChange}>
<DialogContent className="max-w-2xl max-h-[80vh] flex flex-col">
<DialogContent className="flex flex-col">
<DialogHeader>
<DialogTitle></DialogTitle>
</DialogHeader>
@@ -136,17 +136,24 @@ export function ContentLibrarySelectionDialog({
libraries.map((library) => (
<label
key={library.id}
className="flex items-center justify-between p-4 rounded-lg border hover:bg-gray-50 cursor-pointer"
className="flex items-start space-x-3 p-4 rounded-lg hover:bg-gray-50 cursor-pointer border"
>
<div className="flex items-center space-x-3 flex-1 min-w-0 pr-4">
<Checkbox
checked={tempSelected.includes(library.id)}
onCheckedChange={() => handleLibraryToggle(library.id)}
/>
<div className="min-w-0 flex-1">
<div className="font-medium truncate mb-1">{library.name}</div>
<div className="text-sm text-gray-500 truncate mb-1">{library.creatorName}</div>
<div className="text-sm text-gray-500 truncate">{new Date(library.updateTime).toLocaleString()}</div>
<input
type="checkbox"
checked={tempSelected.includes(library.id)}
onChange={() => handleLibraryToggle(library.id)}
className="mt-1 w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 focus:ring-2"
/>
<div className="flex-1">
<div className="flex items-center justify-between">
<span className="font-medium">{library.name}</span>
<Badge variant="outline">
{library.sourceType === 1 ? '文本' : library.sourceType === 2 ? '图片' : '视频'}
</Badge>
</div>
<div className="text-sm text-gray-500 mt-1">
<div>: {library.creatorName || '-'}</div>
<div>: {new Date(library.updateTime).toLocaleString()}</div>
</div>
</div>
</label>