feat(chat): 完善固资预览与下载权限

This commit is contained in:
runny committed 2026-07-07 02:27:08 +08:00
1 parent 6ce0942fef
commit bf18a7ef1d
19 files changed
+1163 -86

No files matched your search

@@ -26,6 +26,7 @@ import { useChatSessions } from './useChatSessions';
import { useChatShipping } from './useChatShipping';
import { useChatSourceFiles } from './useChatSourceFiles';
import { useChatAssetHistory } from './useChatAssetHistory';
import { useChatAssetImage } from './useChatAssetImage';
import { useChatStore } from '../stores/chat.store';
import { useTrainingWorkspace } from './useTrainingWorkspace';
import { matchesTrainingAgent } from '../training/trainingWorkspace.utils';
@@ -157,6 +158,8 @@ export function useChatPage() {
const {
filePreviewVisible,
previewFile,
previewFiles,
currentPreviewIndex,
getSourceTitle,
getSourceMeta,
getSourceBrief,
@@ -165,6 +168,8 @@ export function useChatPage() {
getDisplayRetrieverResources,
shouldExpandSourceDetails,
openPreview,
openPreviewGallery,
setPreviewFileIndex,
parsePlmPreviewLink,
} = sourceFiles;
const assetHistory = useChatAssetHistory({
@@ -172,6 +177,11 @@ export function useChatPage() {
openPreview,
warn: (text) => msg.warning(text),
});
const assetImage = useChatAssetImage({
agentId: currentAgentId,
openPreviewGallery,
warn: (text) => msg.warning(text),
});
watch(currentAgentId, (id) => {
chatStore.setCurrentAgentId(id > 0 ? id : null);
@@ -315,6 +325,8 @@ export function useChatPage() {
resetPeripheralState,
filePreviewVisible,
previewFile,
previewFiles,
currentPreviewIndex,
});
({ loadConversation, startNewChat } = conversationApi);
@@ -363,6 +375,7 @@ export function useChatPage() {
parsePlmPreviewLink,
openPreview,
openAssetHistory: assetHistory.openHistory,
openAssetImage: assetImage.openImage,
getMessageLinks,
getDisplayRetrieverResources,
getSourceLinks,
@@ -504,6 +517,7 @@ export function useChatPage() {
queryPreviewError: queryPreview.error,
queryPreviewState: queryPreview.state,
assetHistory,
assetImage,
...agent,
agentGuides: chatGuides.guides,
showGuideModal: chatGuides.showModal,
@@ -514,6 +528,9 @@ export function useChatPage() {
...attachmentApi,
filePreviewVisible,
previewFile,
previewFiles,
currentPreviewIndex,
setPreviewFileIndex,
isSidebarOpen,
sidebarCollapsed,
toggleBrowserPanel: browser.toggle,