Merge pull request #392 from SuanmoSuanyangTechnology/fix/release_web_zy

fix(web): change skill search key
This commit is contained in:
yingzhao
2026-02-10 18:02:17 +08:00
committed by GitHub

View File

@@ -1,8 +1,8 @@
/* /*
* @Author: ZhaoYing * @Author: ZhaoYing
* @Date: 2026-02-05 10:45:08 * @Date: 2026-02-05 10:45:08
* @Last Modified by: ZhaoYing * @Last Modified by: ZhaoYing
* @Last Modified time: 2026-02-05 10:45:08 * @Last Modified time: 2026-02-10 17:59:37
*/ */
import { forwardRef, useEffect, useImperativeHandle, useState } from 'react'; import { forwardRef, useEffect, useImperativeHandle, useState } from 'react';
import { Space, List, Flex, Tooltip } from 'antd'; import { Space, List, Flex, Tooltip } from 'antd';
@@ -31,7 +31,7 @@ interface SkillModalProps {
* *
* A modal dialog for selecting skills from a searchable list. * A modal dialog for selecting skills from a searchable list.
* Features: * Features:
* - Search functionality to filter skills by keywords * - Search functionality to filter skills by search
* - Grid layout displaying skill cards with icons and descriptions * - Grid layout displaying skill cards with icons and descriptions
* - Multi-select capability with visual feedback * - Multi-select capability with visual feedback
* - Excludes already selected skills from the list * - Excludes already selected skills from the list
@@ -49,7 +49,7 @@ const SkillListModal = forwardRef<SkillModalRef, SkillModalProps>(({
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
const [list, setList] = useState<Skill[]>([]) const [list, setList] = useState<Skill[]>([])
const [filterList, setFilterList] = useState<Skill[]>([]) const [filterList, setFilterList] = useState<Skill[]>([])
const [query, setQuery] = useState<{keywords?: string}>({}) const [query, setQuery] = useState<{search?: string}>({})
const [selectedIds, setSelectedIds] = useState<string[]>([]) const [selectedIds, setSelectedIds] = useState<string[]>([])
const [selectedRows, setSelectedRows] = useState<Skill[]>([]) const [selectedRows, setSelectedRows] = useState<Skill[]>([])
@@ -82,7 +82,7 @@ const SkillListModal = forwardRef<SkillModalRef, SkillModalProps>(({
if (visible) { if (visible) {
getList() getList()
} }
}, [query.keywords, visible]) }, [query.search, visible])
/** /**
* Fetches the skill list from API with current search parameters * Fetches the skill list from API with current search parameters
@@ -123,7 +123,7 @@ const SkillListModal = forwardRef<SkillModalRef, SkillModalProps>(({
* @param value - Search keyword * @param value - Search keyword
*/ */
const handleSearch = (value?: string) => { const handleSearch = (value?: string) => {
setQuery({keywords: value}) setQuery({search: value})
setSelectedIds([]) setSelectedIds([])
setSelectedRows([]) setSelectedRows([])
} }