feat(dacli): P4 v3 batch 1 — 3 简单 swap 已 wrapCommand 文件 console.log 表 → printRawTable
- report/list.ts (4 列: ID/FULL_NAME/CATEGORY/ENCODE, 已有 wrapCommand) - storage/list.ts (6 列: TYPE/NAME/EN-STORE/EN-ACCESS/ACTIVE/YML-PATH, 已有 wrapCommand) - workflow/list.ts (5 列: ID/FLOW_ID/FULL_NAME/ENCODE/CATEGORY, 已有 wrapCommand) 每文件: - 替换 header console.log + '-' separator + for-loop padEnd 为单 log.printRawTable() 调用 - 列宽由 printRawTable 自动算 (maxColWidth=36 默认), 不再硬编码 95/120 等 - padEnd 字符串对齐逻辑下沉到 primitive, 输出列宽自适应 验证: - TS compile 0 新错误 (baseline 57 不变) - 73/73 单元测试 PASS (含 printRawTable 5 单测) 剩 22 REAL_TABLE 文件待迁 (需新 wrapCommand). 下批: apis/* (search + tags).
This commit is contained in:
1 parent
e0c3977721
commit
15b3361f15
3 files changed
+30
-24
No files matched your search
@@ -111,15 +111,15 @@ export function buildReportListCommand(): Command {
|
||||
return ctx.success(summary)
|
||||
}
|
||||
log.info(`共 ${list.length} 张报表 (total=${total})`)
|
||||
console.log('ID FULL_NAME CATEGORY ENCODE')
|
||||
console.log('-'.repeat(95))
|
||||
for (const d of list) {
|
||||
const id = String(d.id || '').padEnd(30)
|
||||
const name = String(d.fullName || '').padEnd(23)
|
||||
const cat = String(d.category || '').padEnd(23)
|
||||
const code = String(d.enCode || '')
|
||||
console.log(`${id}${name}${cat}${code}`)
|
||||
}
|
||||
log.printRawTable(
|
||||
['ID', 'FULL_NAME', 'CATEGORY', 'ENCODE'],
|
||||
list.map((d) => [
|
||||
String(d.id || ''),
|
||||
String(d.fullName || ''),
|
||||
String(d.category || ''),
|
||||
String(d.enCode || ''),
|
||||
]),
|
||||
)
|
||||
ctx.success(summary)
|
||||
} catch (e) {
|
||||
ctx.fail(`report list 失败: ${(e as Error).message?.slice(0, 200)}`)
|
||||
|
||||
@@ -58,16 +58,17 @@ export function buildStorageListCommand(): Command {
|
||||
log.info(`default-platform: ${cfg.defaultPlatform}`)
|
||||
log.info(`thumbnail-suffix: ${cfg.thumbnailSuffix}`)
|
||||
console.log('')
|
||||
console.log('TYPE NAME EN-STORE EN-ACCESS ACTIVE YML-PATH')
|
||||
console.log('-'.repeat(95))
|
||||
for (const p of cfg.platforms) {
|
||||
const type = p.type.padEnd(16)
|
||||
const name = p.name.padEnd(18)
|
||||
const store = (p.enableStorage ? 'true ' : 'false').padEnd(10)
|
||||
const access = (p.enableAccess ? 'true ' : 'false').padEnd(11)
|
||||
const active = (p.name === cfg.defaultPlatform ? '✓' : ' ').padEnd(8)
|
||||
console.log(`${type}${name}${store}${access}${active}${p.ymlPath}`)
|
||||
}
|
||||
log.printRawTable(
|
||||
['TYPE', 'NAME', 'EN-STORE', 'EN-ACCESS', 'ACTIVE', 'YML-PATH'],
|
||||
cfg.platforms.map((p) => [
|
||||
p.type,
|
||||
p.name,
|
||||
p.enableStorage ? 'true' : 'false',
|
||||
p.enableAccess ? 'true' : 'false',
|
||||
p.name === cfg.defaultPlatform ? '✓' : '',
|
||||
p.ymlPath,
|
||||
]),
|
||||
)
|
||||
if (cfg.platforms.length === 0) {
|
||||
log.warn('yml 中未发现任何已知后端 (7 种 backend-type 都没出现)')
|
||||
}
|
||||
|
||||
@@ -62,11 +62,16 @@ export function buildWorkflowListCommand(): Command {
|
||||
log.info(`${path} 共 ${list.length} 条`)
|
||||
// v0.12+ jxcj-2026-06-29 fix: 多输出一列 FLOW_ID (TemplateJsonEntity.id = 最新 version id)
|
||||
// 作用: launchFlow / actionLaunchFlow 用 template=FLOW_ID, 不要用 ID (TemplateEntity.id)
|
||||
console.log('ID FLOW_ID FULL_NAME ENCODE CATEGORY')
|
||||
console.log('-'.repeat(120))
|
||||
for (const t of list) {
|
||||
console.log(`${String(t.id || '').padEnd(36)}${String(t.flowId || '').padEnd(36)}${String(t.fullName || '').padEnd(22)}${String(t.enCode || '').padEnd(22)}${t.category || ''}`)
|
||||
}
|
||||
log.printRawTable(
|
||||
['ID', 'FLOW_ID', 'FULL_NAME', 'ENCODE', 'CATEGORY'],
|
||||
list.map((t) => [
|
||||
String(t.id || ''),
|
||||
String(t.flowId || ''),
|
||||
String(t.fullName || ''),
|
||||
String(t.enCode || ''),
|
||||
String(t.category || ''),
|
||||
]),
|
||||
)
|
||||
if (list.some((t) => t.id !== t.flowId)) {
|
||||
log.info(` 💡 launchFlow / actionLaunchFlow 需用 FLOW_ID (≠ ID):`)
|
||||
log.info(` dacli workflow launch --id=<FLOW_ID> ...`)
|
||||
|
||||
Reference in new issue
Block a user