From 2c6a47658162b8548e70563d2cd3322e80187069 Mon Sep 17 00:00:00 2001 From: QiuSW <105186638@qq.com> Date: Tue, 6 Oct 2026 14:24:30 +0800 Subject: [PATCH] =?UTF-8?q?ui:=20=E4=B8=8B=E8=BD=BD=E5=95=86=E5=93=81?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=89=8D=E7=A1=AE=E8=AE=A4=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/ProductListView.vue | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/ProductListView.vue b/frontend/src/views/ProductListView.vue index e8eb50d..37cd91e 100644 --- a/frontend/src/views/ProductListView.vue +++ b/frontend/src/views/ProductListView.vue @@ -521,8 +521,25 @@ async function run(action, fn) { } } -async function downloadProductData() { +function confirmDownloadProductData() { + if (taskRunning.value || running.value) return const shopID = String(query.value.platformShopId || '').trim() + const shopName = shopOptions.value.find((shop) => String(shop.value) === shopID)?.label || shopID + dialog.warning({ + title: '确认下载商品数据', + content: shopID + ? `将从 erpgo 下载店铺「${shopName}」的商品数据并更新本地记录,可能需要几分钟。` + : '未选择店铺,将从 erpgo 逐店铺下载所有店铺的商品数据并更新本地记录,可能需要几分钟。', + positiveText: '开始下载', + negativeText: '取消', + onPositiveClick: () => { + if (taskRunning.value || running.value) return + void downloadProductData(shopID) + }, + }) +} + +async function downloadProductData(shopID) { // 商品多的店铺要拉几十页,耗时十几秒到几分钟。 // 必须先给出可见反馈,否则按钮看起来像坏了。 running.value = '下载数据' @@ -893,7 +910,7 @@ onUnmounted(() => { type="primary" :loading="running === '下载数据'" :disabled="taskRunning || running !== ''" - @click="downloadProductData" + @click="confirmDownloadProductData" > 下载数据