feat(shipping-notice): 添加 MinerU 订单附件表格结构化功能,更新环境配置和数据模型以支持新布局解析和文档模板管理
This commit is contained in:
1 parent
c4095b08da
commit
c35223d49d
148 files changed
+15709
-1353
No files matched your search
@@ -16,6 +16,7 @@ import type {
|
||||
ShippingNoticeCandidate,
|
||||
} from '../types/shipping.types';
|
||||
import type { ShippingNoticeCandidateResponse, ShippingNoticeIntakeResponse } from '../types/shipping.api.types';
|
||||
import type { ShippingOrderExtractionReviewAttachment } from '../types/chat.types';
|
||||
import {
|
||||
cancelShippingNoticeIntake,
|
||||
createShippingNoticeIntake,
|
||||
@@ -137,7 +138,7 @@ function listSafe(value: unknown): string[] {
|
||||
}
|
||||
|
||||
/** 将 Candidate API 契约映射为输入区可审核状态。 */
|
||||
function mapServerCandidate(remote: ShippingNoticeCandidateResponse): ShippingNoticeCandidate {
|
||||
export function mapServerCandidate(remote: ShippingNoticeCandidateResponse): ShippingNoticeCandidate {
|
||||
const duplicate = remote.duplicate
|
||||
? {
|
||||
status: remote.duplicate.status,
|
||||
@@ -551,6 +552,18 @@ export function useShippingNoticeIntakes(options: UseShippingNoticeIntakesOption
|
||||
.map((candidate) => candidate.candidateNo),
|
||||
);
|
||||
|
||||
/** 为指定 Run 投影可持久化的候选审核快照。 */
|
||||
const getOrderExtractionReview = (intakeNos: string[]): ShippingOrderExtractionReviewAttachment[] => {
|
||||
const selected = new Set(intakeNos.map((item) => String(item || '').trim().toUpperCase()).filter(Boolean));
|
||||
return noticeAttachments.value
|
||||
.filter((item) => item.intakeNo && selected.has(item.intakeNo.toUpperCase()) && item.candidates?.length)
|
||||
.map((item) => ({
|
||||
intakeNo: item.intakeNo!,
|
||||
originalFilename: item.originalFilename,
|
||||
candidates: item.candidates || [],
|
||||
}));
|
||||
};
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
stopPolling();
|
||||
});
|
||||
@@ -574,6 +587,7 @@ export function useShippingNoticeIntakes(options: UseShippingNoticeIntakesOption
|
||||
markOrderExtractionStarted,
|
||||
rollbackOrderExtractionStarted,
|
||||
getSelectedCandidateNos,
|
||||
getOrderExtractionReview,
|
||||
refreshStatuses,
|
||||
clearConsumedAttachments,
|
||||
restoreForConversation,
|
||||
|
||||
Reference in new issue
Block a user