diff --git a/backend/src/main/java/com/imeeting/controller/biz/HotWordController.java b/backend/src/main/java/com/imeeting/controller/biz/HotWordController.java index 06e605e..1ef643d 100644 --- a/backend/src/main/java/com/imeeting/controller/biz/HotWordController.java +++ b/backend/src/main/java/com/imeeting/controller/biz/HotWordController.java @@ -80,6 +80,7 @@ public class HotWordController { @RequestParam(defaultValue = "10") Integer size, @RequestParam(required = false) String word, @RequestParam(required = false) String category, + @RequestParam(required = false) Long hotWordGroupId, @RequestParam(required = false) Long tenantId) { LoginUser loginUser = (LoginUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); Long targetTenantId = Boolean.TRUE.equals(loginUser.getIsPlatformAdmin()) ? tenantId : null; @@ -87,6 +88,7 @@ public class HotWordController { LambdaQueryWrapper wrapper = new LambdaQueryWrapper() .like(word != null && !word.isEmpty(), HotWord::getWord, word) .eq(category != null && !category.isEmpty(), HotWord::getCategory, category) + .eq(hotWordGroupId != null, HotWord::getHotWordGroupId, hotWordGroupId) .orderByDesc(HotWord::getCreatedAt); wrapper.eq(targetTenantId != null, HotWord::getTenantId, targetTenantId); diff --git a/frontend/src/api/business/hotword.ts b/frontend/src/api/business/hotword.ts index 0350148..008c108 100644 --- a/frontend/src/api/business/hotword.ts +++ b/frontend/src/api/business/hotword.ts @@ -35,6 +35,7 @@ export const getHotWordPage = (params: { size: number; word?: string; category?: string; + hotWordGroupId?: number; tenantId?: number; }) => { return http.get<{ code: string; data: { records: HotWordVO[]; total: number }; msg: string }>( diff --git a/frontend/src/pages/business/HotWords.tsx b/frontend/src/pages/business/HotWords.tsx index 9382b17..9c278d0 100644 --- a/frontend/src/pages/business/HotWords.tsx +++ b/frontend/src/pages/business/HotWords.tsx @@ -83,6 +83,7 @@ const HotWords: React.FC = () => { const [size, setSize] = useState(10); const [searchWord, setSearchWord] = useState(""); const [searchCategory, setSearchCategory] = useState(undefined); + const [searchGroupId, setSearchGroupId] = useState(undefined); const [modalVisible, setModalVisible] = useState(false); const [editingId, setEditingId] = useState(null); @@ -103,7 +104,7 @@ const HotWords: React.FC = () => { useEffect(() => { void fetchData(); - }, [current, searchCategory, searchWord, size]); + }, [current, searchCategory, searchGroupId, searchWord, size]); useEffect(() => { void loadGroupOptions(); @@ -117,6 +118,7 @@ const HotWords: React.FC = () => { size, word: searchWord, category: searchCategory, + hotWordGroupId: searchGroupId, tenantId: isPlatformAdmin ? activeTenantId : undefined, }); if (res.data?.data) { @@ -396,6 +398,16 @@ const HotWords: React.FC = () => { ))} + } diff --git a/frontend/src/pages/business/MeetingDetail.tsx b/frontend/src/pages/business/MeetingDetail.tsx index 9d70e97..913c042 100644 --- a/frontend/src/pages/business/MeetingDetail.tsx +++ b/frontend/src/pages/business/MeetingDetail.tsx @@ -42,7 +42,7 @@ import { updateSpeakerInfo, } from '../../api/business/meeting'; import { getAiModelDefault, getAiModelPage, AiModelVO } from '../../api/business/aimodel'; -import { getHotWordPage, saveHotWord } from '../../api/business/hotword'; +import { getHotWordPage, getPinyinSuggestion, saveHotWord } from '../../api/business/hotword'; import { getPromptPage, PromptTemplateVO } from '../../api/business/prompt'; import { listUsers } from '../../api'; import { useDict } from '../../hooks/useDict'; @@ -977,15 +977,24 @@ const MeetingDetail: React.FC = () => { await Promise.all( toCreate.map((word) => - saveHotWord({ - word, - pinyinList: [], - matchStrategy: 1, - category: '', - weight: 2, - status: 1, + (async () => { + let pinyinList: string[] = []; + try { + const pinyinRes = await getPinyinSuggestion(word); + pinyinList = (pinyinRes.data?.data || []).map((item) => item.trim()).filter(Boolean); + } catch { + pinyinList = []; + } + return saveHotWord({ + word, + pinyinList, + matchStrategy: 1, + category: '', + weight: 2, + status: 1, remark: meeting ? `来源于会议:${meeting.title}` : '来源于会议关键词', - }), + }); + })(), ), );