diff --git a/src/commands/report/list.ts b/src/commands/report/list.ts index c745dc9..00de913 100644 --- a/src/commands/report/list.ts +++ b/src/commands/report/list.ts @@ -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)}`) diff --git a/src/commands/storage/list.ts b/src/commands/storage/list.ts index d7f19dd..f447d26 100644 --- a/src/commands/storage/list.ts +++ b/src/commands/storage/list.ts @@ -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 都没出现)') } diff --git a/src/commands/workflow/list.ts b/src/commands/workflow/list.ts index 4cc2378..e4815e5 100644 --- a/src/commands/workflow/list.ts +++ b/src/commands/workflow/list.ts @@ -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= ...`)