mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 23:09:19 +08:00
refactor: 重构推广费导入链
This commit is contained in:
@@ -393,11 +393,20 @@ async function handleSync() {
|
||||
...batch.value,
|
||||
channelShopId: channelShopId.value!,
|
||||
};
|
||||
const result = await batchImportPddGoodsAdFee(payload);
|
||||
statusText.value = '同步完成';
|
||||
const result = await batchImportPddGoodsAdFee(payload, (task) => {
|
||||
const done = (task.successCount ?? 0) + (task.failCount ?? 0);
|
||||
statusText.value = `正在导入… ${done}/${task.totalCount ?? 0}`;
|
||||
});
|
||||
const failed = result.status === 'failed';
|
||||
const partial = result.status === 'partial';
|
||||
statusText.value = failed ? '同步失败' : partial ? '部分成功' : '同步完成';
|
||||
const authHint = result.authExpired
|
||||
? ',授权已失效请重新授权后再导失败商品'
|
||||
: '';
|
||||
syncResultText.value =
|
||||
`成功 ${result.successCount}/${result.totalCount}` +
|
||||
(result.failureCount ? `,失败 ${result.failureCount}` : '');
|
||||
(result.failCount ? `,失败 ${result.failCount}` : '') +
|
||||
authHint;
|
||||
} catch (error) {
|
||||
statusText.value = '同步失败';
|
||||
errorText.value = toUserMessage(error);
|
||||
|
||||
Reference in New Issue
Block a user