- 清理 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>
22 lines
519 B
TypeScript
22 lines
519 B
TypeScript
/**
|
|
* 渲染辅助工具函数
|
|
* 纯函数,无 wx.* 依赖
|
|
*/
|
|
|
|
/**
|
|
* 从对象中提取指定字段,缺失字段填充 null
|
|
* @param item 数据对象
|
|
* @param fieldList 需要的字段名数组
|
|
* @returns 仅包含指定字段的新对象
|
|
*/
|
|
export function getRequiredFields(
|
|
item: Record<string, any>,
|
|
fieldList: string[]
|
|
): Record<string, any> {
|
|
const result: Record<string, any> = {}
|
|
for (const field of fieldList) {
|
|
result[field] = field in item ? item[field] : null
|
|
}
|
|
return result
|
|
}
|