From 213c5e0b915ffd54fe286e80706cbf7a5353c1ca Mon Sep 17 00:00:00 2001 From: ah-max150 Date: Mon, 19 Oct 2026 16:00:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8F=91=E5=B8=83=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E5=8F=B0=E5=92=8C=E7=BC=96=E8=BE=91=E9=A1=B5=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=94=B9=E4=B8=BA=E7=9F=AD=E6=96=87=E6=A1=88?= =?UTF-8?q?=E5=B9=B6=E6=82=AC=E5=81=9C=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../goods/publish/editor/PddPublishEditor.vue | 66 +++++++++++-------- .../views/channel/pdd/goods/publish/index.vue | 56 +++++++++++++++- 2 files changed, 94 insertions(+), 28 deletions(-) diff --git a/apps/web/apps/web-antd/src/views/channel/pdd/goods/publish/editor/PddPublishEditor.vue b/apps/web/apps/web-antd/src/views/channel/pdd/goods/publish/editor/PddPublishEditor.vue index b0741f87..a887cb8f 100644 --- a/apps/web/apps/web-antd/src/views/channel/pdd/goods/publish/editor/PddPublishEditor.vue +++ b/apps/web/apps/web-antd/src/views/channel/pdd/goods/publish/editor/PddPublishEditor.vue @@ -759,32 +759,46 @@ function onSkuTableWrapRef(el: HTMLElement | null) { > - - - - + + + + + + + + + + + + + + + + + + diff --git a/apps/web/apps/web-antd/src/views/channel/pdd/goods/publish/index.vue b/apps/web/apps/web-antd/src/views/channel/pdd/goods/publish/index.vue index 57280737..32350711 100644 --- a/apps/web/apps/web-antd/src/views/channel/pdd/goods/publish/index.vue +++ b/apps/web/apps/web-antd/src/views/channel/pdd/goods/publish/index.vue @@ -62,6 +62,7 @@ const jobOpen = ref(false); const jobLoading = ref(false); const currentJob = ref(null); const pushingDraftId = ref(null); +const publishingDraftId = ref(null); let jobPollTimer: ReturnType | undefined; const detailOpen = ref(false); @@ -109,7 +110,7 @@ const columns = [ { title: '状态', key: 'status', width: 140 }, { title: '投递统计', key: 'deliveryStat', width: 160 }, { title: '更新时间', dataIndex: 'updateTime', key: 'updateTime', width: 170 }, - { title: '操作', key: 'actions', width: 280 }, + { title: '操作', key: 'actions', width: 320 }, ]; /** 列表悬停:从草稿 payloadJson.editorState.skuRows 解析 */ @@ -234,6 +235,18 @@ function pushDisabledReason(draft: { return ''; } +function publishDisabledReason(draft: { + pddShopId?: number; + payloadJson?: string; + status?: string; +}): string { + const base = pushDisabledReason(draft); + if (base) return base; + if (draft.status === 'NEED_CHECK') return '待校验,请先核对类目和运费'; + if (draft.status === 'PUBLISHING') return '正在发布中'; + return ''; +} + async function pushPlatform(draft: { id?: number; pddShopId?: number; @@ -399,6 +412,32 @@ async function submitClone() { } } +async function publishOne(draft: { + id?: number; + pddShopId?: number; + payloadJson?: string; + status?: string; +}) { + if (draft.id == null) return; + const reason = publishDisabledReason(draft); + if (reason) { + message.warning(reason); + return; + } + publishingDraftId.value = draft.id; + try { + const job = await createPddPublishDeskJobApi({ draftIds: [draft.id] }); + currentJob.value = job; + jobOpen.value = true; + startJobPoll(job.id); + await loadDrafts(); + } catch (e: any) { + message.error(e?.message || '创建发布任务失败'); + } finally { + publishingDraftId.value = null; + } +} + async function batchPublish() { if (selectedRowKeys.value.length === 0) { message.warning('请先勾选草稿'); @@ -640,7 +679,20 @@ onUnmounted(() => stopJobPoll()); :loading="pushingDraftId === record.id" @click="pushPlatform(record)" > - 推送平台 + 推送 + + + + + +