fix
This commit is contained in:
parent
4b876f3c0d
commit
cb494dd28e
|
|
@ -13,17 +13,18 @@ import {
|
||||||
|
|
||||||
const ResourceCategoryPageV2: React.FC = () => {
|
const ResourceCategoryPageV2: React.FC = () => {
|
||||||
// 使用 Zustand store 管理分类数据
|
// 使用 Zustand store 管理分类数据
|
||||||
const { categories, loading, error } = useCategoriesData()
|
const { categories, loading } = useCategoriesData()
|
||||||
const {
|
const {
|
||||||
loadCategories,
|
loadCategories,
|
||||||
refreshCategories,
|
refreshCategories,
|
||||||
addCategory,
|
addCategory,
|
||||||
updateCategory,
|
updateCategory,
|
||||||
removeCategory,
|
removeCategory
|
||||||
clearError,
|
|
||||||
searchCategories
|
|
||||||
} = useCategoryActions()
|
} = useCategoryActions()
|
||||||
|
|
||||||
|
// 从 store 获取搜索功能
|
||||||
|
const { searchCategories } = useCategoryStore()
|
||||||
|
|
||||||
// 本地 UI 状态
|
// 本地 UI 状态
|
||||||
const [searchTerm, setSearchTerm] = useState('')
|
const [searchTerm, setSearchTerm] = useState('')
|
||||||
const [editingCategory, setEditingCategory] = useState<ResourceCategoryV2 | null>(null)
|
const [editingCategory, setEditingCategory] = useState<ResourceCategoryV2 | null>(null)
|
||||||
|
|
@ -292,7 +293,7 @@ const ResourceCategoryPageV2: React.FC = () => {
|
||||||
placeholder="搜索分类..."
|
placeholder="搜索分类..."
|
||||||
value={searchTerm}
|
value={searchTerm}
|
||||||
onChange={(e) => setSearchTerm(e.target.value)}
|
onChange={(e) => setSearchTerm(e.target.value)}
|
||||||
onKeyPress={(e) => e.key === 'Enter' && handleSearch()}
|
onKeyDown={(e) => e.key === 'Enter' && handleSearch()}
|
||||||
className="pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent w-full"
|
className="pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent w-full"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue