feat: 本次提交更新内容如下
样式和功能补齐
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user