refactor(order-import): 简化向导操作按钮布局,移除冗余显示

This commit is contained in:
小蟑螂
2026-05-12 00:19:23 +08:00
parent 2ac5b06444
commit 42a433328a
@@ -142,16 +142,6 @@ function getValidOrderStatusIdSet(): Set<number> {
return new Set(orderStatusList.value.map((s) => s.id));
}
/** 模板里记录的原始映射:仅展示仍存在的系统状态名,已删除的视为无映射 */
function getTemplateOriginalMappedLabel(csvStatus: string): string {
const tplId = currentStatusTemplateMappings.value.find(
(m) => m.csvStatus === csvStatus,
)?.mappedStatusId;
if (tplId === undefined || tplId === null) return '(未映射)';
const name = orderStatusList.value.find((s) => s.id === tplId)?.statusName;
return name ?? '-';
}
function mergeObsoleteSystemTargetRemind(csvList: string[]) {
const allowed = new Set(uniqueStatusValues.value);
const set = new Set(csvStatusesObsoleteSystemTarget.value);
@@ -1196,11 +1186,6 @@ const handlePrev = () => {
}
};
// 取消:回到第一步(不清空已选店铺与映射,与原先关闭弹窗行为一致)
const handleCancel = () => {
currentStep.value = 0;
};
// 创建导入任务
const handleCreateTask = async () => {
if (!selectedFile.value) {
@@ -1536,22 +1521,6 @@ const shopOptions = computed(() => {
已变更
</span>
</div>
<div
v-if="
selectedTemplateId &&
currentTemplateMappings.some(
(m) => m.fieldName === fieldDef.fieldName,
)
"
class="mt-1.5 text-xs text-slate-500 dark:text-slate-400"
>
模板原文件列:
{{
currentTemplateMappings.find(
(m) => m.fieldName === fieldDef.fieldName,
)?.fileFieldName || '(未映射)'
}}
</div>
</div>
<!-- 文件侧:CSV 表头 -->
<div
@@ -1724,18 +1693,6 @@ const shopOptions = computed(() => {
原系统状态已删除
</span>
</div>
<div
v-if="
selectedStatusTemplateId &&
currentStatusTemplateMappings.some(
(m) => m.csvStatus === statusValue,
)
"
class="mb-2 text-xs text-slate-500 dark:text-slate-400"
>
模板原系统状态:
{{ getTemplateOriginalMappedLabel(statusValue) }}
</div>
<div
class="flex min-w-0 flex-col gap-2 sm:flex-row sm:items-center sm:gap-2"
>
@@ -1912,28 +1869,25 @@ const shopOptions = computed(() => {
</div>
</div>
<div
class="flex shrink-0 justify-between gap-2 border-t border-slate-100 bg-slate-50/80 px-3 py-3 dark:border-[hsl(240deg_3.7%_22%)] dark:bg-[hsl(240deg_3.7%_15.9%/40%)]"
class="flex shrink-0 flex-wrap justify-end gap-2 border-t border-slate-100 bg-slate-50/80 px-3 py-3 dark:border-[hsl(240deg_3.7%_22%)] dark:bg-[hsl(240deg_3.7%_15.9%/40%)]"
>
<Button @click="handleCancel">取消</Button>
<div class="flex flex-wrap justify-end gap-2">
<Button v-if="currentStep > 0" @click="handlePrev">上一步</Button>
<Button
v-if="currentStep < 2"
type="primary"
:disabled="!canGoToNextStep"
@click="handleNext"
>
下一步
</Button>
<Button
v-if="currentStep === 2"
type="primary"
:loading="createTaskSubmitting"
@click="handleCreateTask"
>
创建导入任务
</Button>
</div>
<Button v-if="currentStep > 0" @click="handlePrev">上一步</Button>
<Button
v-if="currentStep < 2"
type="primary"
:disabled="!canGoToNextStep"
@click="handleNext"
>
下一步
</Button>
<Button
v-if="currentStep === 2"
type="primary"
:loading="createTaskSubmitting"
@click="handleCreateTask"
>
创建导入任务
</Button>
</div>
</div>