feat: Features架构迁移 - P0和P1部分完成
## 完成的工作 ### P0: 基础设施准备 - 创建 features/ 和 shared/ 目录结构 - 迁移共享资源:API基础设施、工具函数、类型定义 - 迁移通用composables:useMoney, useSmsCountdown, usePricingCalculator - 迁移全局样式文件 - 建立模块化导出系统 ### P1.1: 钱包模块 (wallet) - 迁移 API: wallet.ts - 迁移 Views: WalletView.vue - 新增 Composable: useWallet.ts (封装钱包状态管理) - 更新导入路径到 shared/ ### P1.2: 聊天模块 (chats) - 迁移 API: chats.ts - 迁移 Views: ChatView, MessagesView (桌面+移动) - 迁移 Composables: useChatSSE.ts - 迁移 Components: ChatAttachmentImage.vue - 更新导入路径到 shared/ ## 技术改进 - 修复 shared/composables 导出问题 (default → 命名导出) - 修复 shared/api/client.ts 类型导入路径 - 建立清晰的模块边界和导出规范 ## 文档 - 添加完整的迁移计划文档 - 添加进度跟踪文档 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
10acca637e
commit
b5903a169f
@@ -0,0 +1,65 @@
|
||||
export interface SystemConfigOption {
|
||||
label: string
|
||||
value: string
|
||||
}
|
||||
|
||||
const shortTimeoutOptions: SystemConfigOption[] = [
|
||||
{ label: '不限时', value: '0' },
|
||||
{ label: '5 分钟', value: '5' },
|
||||
{ label: '10 分钟', value: '10' },
|
||||
{ label: '15 分钟', value: '15' },
|
||||
{ label: '30 分钟', value: '30' },
|
||||
{ label: '45 分钟', value: '45' },
|
||||
{ label: '60 分钟', value: '60' },
|
||||
{ label: '90 分钟', value: '90' },
|
||||
{ label: '120 分钟', value: '120' },
|
||||
]
|
||||
|
||||
const longTimeoutOptions: SystemConfigOption[] = [
|
||||
{ label: '不限时', value: '0' },
|
||||
{ label: '30 分钟', value: '30' },
|
||||
{ label: '60 分钟', value: '60' },
|
||||
{ label: '120 分钟', value: '120' },
|
||||
{ label: '180 分钟', value: '180' },
|
||||
{ label: '240 分钟', value: '240' },
|
||||
{ label: '360 分钟', value: '360' },
|
||||
{ label: '12 小时', value: '720' },
|
||||
{ label: '24 小时', value: '1440' },
|
||||
{ label: '48 小时', value: '2880' },
|
||||
]
|
||||
|
||||
const booleanOptions: SystemConfigOption[] = [
|
||||
{ label: '开启', value: 'true' },
|
||||
{ label: '关闭', value: 'false' },
|
||||
]
|
||||
|
||||
export const systemConfigSelectOptions: Record<string, SystemConfigOption[]> = {
|
||||
'handoff.owner_submit_timeout_minutes': shortTimeoutOptions,
|
||||
'handoff.renter_confirm_timeout_minutes': shortTimeoutOptions,
|
||||
'handoff.owner_return_confirm_timeout_minutes': longTimeoutOptions,
|
||||
'order.pending_payment_timeout_minutes': shortTimeoutOptions,
|
||||
'order.return_overdue_grace_minutes': [
|
||||
{ label: '无宽限', value: '0' },
|
||||
{ label: '5 分钟', value: '5' },
|
||||
{ label: '10 分钟', value: '10' },
|
||||
{ label: '15 分钟', value: '15' },
|
||||
{ label: '30 分钟', value: '30' },
|
||||
{ label: '60 分钟', value: '60' },
|
||||
{ label: '120 分钟', value: '120' },
|
||||
],
|
||||
'listing.review_required': booleanOptions,
|
||||
'chat.default_support_admin_id': [
|
||||
{ label: '管理员 ID 1', value: '1' },
|
||||
{ label: '管理员 ID 2', value: '2' },
|
||||
{ label: '管理员 ID 3', value: '3' },
|
||||
],
|
||||
}
|
||||
|
||||
export function getSystemConfigSelectOptions(key: string) {
|
||||
return systemConfigSelectOptions[key] || null
|
||||
}
|
||||
|
||||
export function formatSystemConfigSelectValue(key: string, value: string) {
|
||||
const option = getSystemConfigSelectOptions(key)?.find((item) => item.value === value)
|
||||
return option?.label || null
|
||||
}
|
||||
Reference in New Issue
Block a user