feat(chat): 完善固资预览与下载权限
This commit is contained in:
1 parent
6ce0942fef
commit
bf18a7ef1d
19 files changed
+1163
-86
No files matched your search
@@ -11,6 +11,7 @@ import ChatLeaveAgentDialog from '@/features/chat/components/ChatLeaveAgentDialo
|
||||
import ChatOALoginDialog from '@/features/chat/components/ChatOALoginDialog.vue';
|
||||
import ChatGuideModal from '@/features/chat/components/ChatGuideModal.vue';
|
||||
import { Loader2 } from 'lucide-vue-next';
|
||||
import { nextTick } from 'vue';
|
||||
import { useChatPageContext } from '@/features/chat/composables/chat.context';
|
||||
import { getAuthHeaders } from '@/shared/utils/auth';
|
||||
|
||||
@@ -23,14 +24,29 @@ function onFeedbackSubmitted() {
|
||||
page.msg.success(page.t('chat.feedbackSubmitSuccess'));
|
||||
page.showGeneralFeedbackDialog = false;
|
||||
}
|
||||
|
||||
async function handleQueryPreviewAssetHistory(assetId: string, assetName: string) {
|
||||
page.queryPreview.close();
|
||||
await nextTick();
|
||||
await page.assetHistory.openHistory(assetId, assetName);
|
||||
}
|
||||
|
||||
async function handleQueryPreviewAssetImage(assetId: string, assetName: string) {
|
||||
page.queryPreview.close();
|
||||
await nextTick();
|
||||
await page.assetImage.openImage(assetId, assetName);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<FilePreviewModal
|
||||
v-model="page.filePreviewVisible"
|
||||
:file="page.previewFile"
|
||||
:files="page.previewFiles"
|
||||
:current-index="page.currentPreviewIndex"
|
||||
:agent-id="page.currentAgentId"
|
||||
:auth-headers="getAuthHeaders()"
|
||||
@update:current-index="page.setPreviewFileIndex"
|
||||
/>
|
||||
<GeneralFeedbackDialog
|
||||
v-model="page.showGeneralFeedbackDialog"
|
||||
@@ -46,7 +62,8 @@ function onFeedbackSubmitted() {
|
||||
:state="page.queryPreviewState"
|
||||
@close="page.queryPreview.close"
|
||||
@change-page="page.queryPreview.changePage"
|
||||
@open-asset-history="({ assetId, assetName }) => page.assetHistory.openHistory(assetId, assetName)"
|
||||
@open-asset-history="({ assetId, assetName }) => handleQueryPreviewAssetHistory(assetId, assetName)"
|
||||
@open-asset-image="({ assetId, assetName }) => handleQueryPreviewAssetImage(assetId, assetName)"
|
||||
/>
|
||||
<div
|
||||
v-if="page.assetHistory.loading"
|
||||
@@ -57,6 +74,15 @@ function onFeedbackSubmitted() {
|
||||
<span>正在搜索该资产的履历资料,请耐心等待...</span>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="page.assetImage.loading"
|
||||
class="pointer-events-none fixed inset-x-0 top-20 z-[145] flex justify-center px-4"
|
||||
>
|
||||
<div class="flex items-center gap-2 rounded-full border border-brand-200 bg-white/95 px-4 py-2 text-sm text-brand-700 shadow-lg backdrop-blur">
|
||||
<Loader2 class="h-4 w-4 animate-spin text-brand-500" />
|
||||
<span>正在搜索该资产的图片资料,请耐心等待...</span>
|
||||
</div>
|
||||
</div>
|
||||
<ChatLeaveAgentDialog
|
||||
v-model:open="page.showLeaveAgentDialog"
|
||||
v-model:keyword="page.leaveAgentKeyword"
|
||||
|
||||
Reference in new issue
Block a user