refactor: 调整订单表

This commit is contained in:
2026-08-10 23:46:31 +08:00
parent f0a08444c5
commit 58671f3bd6
70 changed files with 1163 additions and 2132 deletions
@@ -0,0 +1,69 @@
<script lang="ts" setup>
import { computed } from 'vue';
import { Tag } from 'ant-design-vue';
import {
getPlatformLabel,
getPlatformTagColor,
} from '#/utils/platform-display';
defineOptions({ name: 'PlatformTag' });
const props = withDefaults(
defineProps<{
/** 平台代码(taobao/jd/pdd/...) */
code?: null | string;
/** 优先展示名(如后端 platformLabel / 字典 label) */
label?: null | string;
/** 无平台时是否显示「未关联平台」 */
showEmpty?: boolean;
size?: 'default' | 'small';
}>(),
{
code: undefined,
label: undefined,
showEmpty: false,
size: 'small',
},
);
const hasPlatform = computed(
() => !!(props.code?.trim() || props.label?.trim()),
);
const displayLabel = computed(() =>
getPlatformLabel(props.code, props.label),
);
const color = computed(() => getPlatformTagColor(props.code));
</script>
<template>
<Tag
v-if="hasPlatform"
:color="color"
:class="['platform-tag', size === 'small' ? 'platform-tag--sm' : '']"
>
{{ displayLabel }}
</Tag>
<Tag v-else-if="showEmpty" color="default" class="platform-tag platform-tag--sm">
未关联平台
</Tag>
<span v-else class="platform-tag-empty">-</span>
</template>
<style scoped>
.platform-tag {
margin: 0;
}
.platform-tag--sm {
font-size: 12px;
line-height: 18px;
}
.platform-tag-empty {
color: #bfbfbf;
}
</style>