feat(chat): 完善附件预览与订单提取交互

- 优化聊天附件上传、预览及 PDF.js 加载
- 完善订单文档画布与审核预览体验
- 优化订单提取运行状态及发送流程
- 增强会话附件接口与相关测试覆盖
- 更新 Nginx 配置、技术文档及四语言文案
This commit is contained in:
hugo committed 2026-09-14 11:06:20 +08:00
1 parent 104afa3844
commit 9d2fa522fa
29 files changed
+584 -140

No files matched your search

@@ -4,6 +4,7 @@
* 依赖:lucide 图标、附件完整性判断工具。
* 逻辑:附件卡片位于文本框上方;订单审核结果随对应聊天消息展示,输入区只保留附件处理状态。
* 同时支持采购合同双文件输入控件:底部左区放附件/合同等工具,右区语音与发送并排;采购合同审查用专用上传按钮,不展示通用回形针附件入口。
* 货代订单抽取提交中(isOrderExtractionSubmitting)时发送钮展示 Loader,免责声明区提示提交中。
*/
<script setup lang="ts">
import { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';
@@ -58,6 +59,8 @@ const props = defineProps<{
isVoiceRecording: boolean;
isVoiceTranscribing: boolean;
isUploadingAttachments: boolean;
/** 货代订单抽取统一提交进行中;为 true 时发送钮 Loader 且禁用。 */
isOrderExtractionSubmitting?: boolean;
canSendMessage: boolean;
isShippingNoticeAgent: boolean;
isProcurementContractAgent?: boolean;
@@ -843,7 +846,7 @@ watch(
</button>
<button
v-if="isThinking && !isUploadingAttachments"
v-if="isThinking && !isUploadingAttachments && !isOrderExtractionSubmitting"
type="button"
class="flex h-10 w-10 items-center justify-center rounded-full border border-rose-300 bg-rose-50 text-rose-600 shadow-sm transition-all duration-200 hover:scale-105 hover:bg-rose-100 active:scale-95"
:title="$t('chat.stopGenerating')"
@@ -862,14 +865,15 @@ watch(
: 'border-brand-500 bg-brand-500 text-white shadow-[0_0_0_4px_rgba(59,130,246,0.18)] hover:scale-105 hover:bg-brand-600 hover:shadow-[0_0_0_6px_rgba(59,130,246,0.24)] active:scale-95'"
@click="emit('send')"
>
<Loader2 v-if="isUploadingAttachments" class="h-4 w-4 animate-spin" />
<Loader2 v-if="isUploadingAttachments || isOrderExtractionSubmitting" class="h-4 w-4 animate-spin" />
<Send v-else class="h-4 w-4" />
</button>
</div>
</div>
</div>
<div class="mt-3 text-center text-[11px] text-muted">
<span v-if="isThinking">{{ $t('chat.thinking') }}</span>
<span v-if="isOrderExtractionSubmitting">{{ $t('chat.shippingNoticeSubmitting') }}</span>
<span v-else-if="isThinking">{{ $t('chat.thinking') }}</span>
<span v-else>{{ $t('chat.disclaimer') }}</span>
</div>
</div>