feat: vibe-registry M1 — 万物皆注册框架骨架
- core: registerLayout/Widget/Action(泛型)/Schema + 校验闸门 - definePage: 页面只管业务,结构来自注册表 - presets: admin / app-shell 预设布局(vr add 物化) - cli: vr list/add/update 防覆盖 - examples/qa-orchestrator: 实战编排验证(workspace:* 依赖)
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* 套件总览页(overview)
|
||||
* 业务:QA 看板上展示所有套件、总通过率、失败数
|
||||
* 布局:qa-console;页面只管业务数据
|
||||
*/
|
||||
import { definePage } from 'vibe-registry'
|
||||
|
||||
export const overviewPage = definePage({
|
||||
layout: 'qa-console',
|
||||
title: '测试编排 · 总览',
|
||||
blocks: [
|
||||
{ widget: 'suite-list', bind: { suites: 'suites' } },
|
||||
{
|
||||
widget: 'suite-detail-view',
|
||||
props: { mode: 'summary' },
|
||||
bind: { cases: 'summary' },
|
||||
},
|
||||
],
|
||||
setup: async () => {
|
||||
// 真实场景:从 API 拉取;这里用模拟数据演示编排
|
||||
const suites = [
|
||||
{ id: 'auth', name: '认证模块', passedRate: 0.92, lastResult: 'passed' },
|
||||
{ id: 'billing', name: '计费模块', passedRate: 0.71, lastResult: 'failed' },
|
||||
{ id: 'search', name: '搜索模块', passedRate: 1.0, lastResult: 'passed' },
|
||||
]
|
||||
const total = suites.length
|
||||
const failed = suites.filter((s) => s.lastResult === 'failed').length
|
||||
return {
|
||||
suites,
|
||||
summary: {
|
||||
total,
|
||||
failed,
|
||||
passingRate: Math.round((1 - failed / total) * 100),
|
||||
},
|
||||
}
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user