iloom-flatten/src/utils/constants.ts

72 lines
2.2 KiB
TypeScript
Raw Normal View History

// 状态映射配置
export const statusMap: Record<string, { label: string; color: string; bgColor: string; borderColor: string }> = {
pending: { label: '待确定', color: 'text-amber-700', bgColor: 'bg-amber-50', borderColor: 'border-amber-200' },
producing: { label: '生产中', color: 'text-blue-700', bgColor: 'bg-blue-50', borderColor: 'border-blue-200' },
completed: { label: '已完成', color: 'text-emerald-700', bgColor: 'bg-emerald-50', borderColor: 'border-emerald-200' }
};
// 简化的状态映射(用于纺织厂)
export const simpleStatusMap: Record<string, { label: string; color: string }> = {
pending: { label: '待确定', color: 'bg-yellow-100 text-yellow-700' },
producing: { label: '生产中', color: 'bg-blue-100 text-blue-700' },
completed: { label: '已完成', color: 'bg-green-100 text-green-700' }
};
// 步骤类型配置
export const stepTypeConfig: Record<string, { name: string; icon: string }> = {
confirm: { name: '确认计划', icon: 'Check' },
yarn_purchase: { name: '采纱', icon: 'Clock' },
dyeing: { name: '染纱', icon: 'Clock' },
machine_start: { name: '上机', icon: 'Clock' },
fabric_warehouse: { name: '坯布生产', icon: 'Package' }
};
// 步骤名称映射
export const stepNames: Record<string, string> = {
confirm: '确认计划',
yarn_purchase: '采纱',
dyeing: '染纱',
machine_start: '上机',
fabric_warehouse: '坯布生产'
};
// 步骤顺序
export const stepOrder = ['confirm', 'yarn_purchase', 'dyeing', 'machine_start', 'fabric_warehouse'];
// 动画配置
export const animationConfig = {
// 标准过渡
transition: {
duration: 0.3,
ease: [0.25, 0.46, 0.45, 0.94]
},
// 快速过渡
fastTransition: {
duration: 0.2,
ease: [0.25, 0.46, 0.45, 0.94]
},
// 慢速过渡
slowTransition: {
duration: 0.5,
ease: [0.25, 0.46, 0.45, 0.94]
},
// 弹簧动画
spring: {
type: 'spring',
stiffness: 300,
damping: 30
}
};
// 分页配置
export const paginationConfig = {
defaultPageSize: 20,
maxInventoryRecords: 100,
maxPriceHistory: 50
};
// 进度阈值
export const progressThresholds = {
complete: 97 // 计划完成阈值
};