chore: v1 整理 — 清理历史文件、DDL 合并、文档归档
- 清理 1155 个已删除的历史文件(废弃 prompt_logs、tmp、旧 ops 脚本) - export/ 数据文件从 git 移除(已在 .gitignore) - demo-miniprogram 从 tmp/ 移入 apps/,添加 CLAUDE.md 注解 - DDL 合并:完整 schema 定义填充到 db/*/schemas/(从 docs/database/ddl/ 复制) - 39 个 v1 迁移脚本归档到 db/_archived/migrations_v1_merged/ - 4 个迁移变更类 BD_Manual 文档归档到 docs/database/_archived/ - .gitignore 补充 .vite/ 和 apps/*.zip - settings.json 添加 effortLevel 默认配置 - scripts/ops/ 新增运维脚本入库 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
36
apps/demo-miniprogram/miniprogram/utils/task.ts
Normal file
36
apps/demo-miniprogram/miniprogram/utils/task.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* 任务类型映射工具函数
|
||||
* 纯函数,无 wx.* 依赖
|
||||
*/
|
||||
|
||||
export type TaskType = 'callback' | 'priority_recall' | 'relationship'
|
||||
|
||||
const TASK_TYPE_COLOR_MAP: Record<TaskType, string> = {
|
||||
callback: '#0052d9',
|
||||
priority_recall: '#e34d59',
|
||||
relationship: '#00a870',
|
||||
}
|
||||
|
||||
const TASK_TYPE_LABEL_MAP: Record<TaskType, string> = {
|
||||
callback: '回访',
|
||||
priority_recall: '优先召回',
|
||||
relationship: '关系构建',
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务类型对应的颜色
|
||||
* @param type 任务类型
|
||||
* @returns 颜色 hex 值,未知类型返回灰色
|
||||
*/
|
||||
export function getTaskTypeColor(type: TaskType): string {
|
||||
return TASK_TYPE_COLOR_MAP[type] ?? '#8b8b8b'
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务类型对应的中文标签
|
||||
* @param type 任务类型
|
||||
* @returns 中文标签,未知类型返回空字符串
|
||||
*/
|
||||
export function getTaskTypeLabel(type: TaskType): string {
|
||||
return TASK_TYPE_LABEL_MAP[type] ?? ''
|
||||
}
|
||||
Reference in New Issue
Block a user