Files
CN_Tool_client/frontend/src/views/steady/steadyTrend/contracts/check-steady-trend-route-contract.mjs
yexb 055e69fff7 feat(steady): 完善稳态数据视图功能
- 更新纵坐标刻度算法,优化小数趋势图范围显示
- 添加稳态趋势图全屏模式和共享工具组件
- 实现多图联动的鼠标悬停竖线同步功能
- 调整主线线宽分档策略,降低最大线宽限制
- 重构稳态趋势工具栏,优化谐波次数选择逻辑
- 添加周时间周期搜索支持和自定义时间范围选择
- 完善稳态数据表格和指示器浮动面板功能
- 优化稳态趋势图性能,添加LTB采样和动画控制
- 修复数据表格打开前的趋势数据验证问题
- 统一时间轴标签格式化和网格对齐处理
2026-05-27 08:06:12 +08:00

54 lines
2.3 KiB
JavaScript

import fs from 'node:fs'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
const currentDir = path.dirname(fileURLToPath(import.meta.url))
const rootDir = path.resolve(currentDir, '../../../..')
const files = {
staticRouter: path.resolve(rootDir, 'routers/modules/staticRouter.ts'),
dynamicRouter: path.resolve(rootDir, 'routers/modules/dynamicRouter.ts'),
authStore: path.resolve(rootDir, 'stores/modules/auth.ts'),
page: path.resolve(rootDir, 'views/steady/steadyTrend/index.vue'),
api: path.resolve(rootDir, 'api/steady/steadyTrend/index.ts'),
apiInterface: path.resolve(rootDir, 'api/steady/steadyTrend/interface/index.ts')
}
const read = file => fs.readFileSync(file, 'utf8')
const exists = file => fs.existsSync(file)
const checks = [
['steadyTrend page exists', () => exists(files.page)],
['steadyTrend API exists', () => exists(files.api)],
['steadyTrend API interface exists', () => exists(files.apiInterface)],
['static router registers /steadyTrend/index', () => /path:\s*'\/steadyTrend\/index'/.test(read(files.staticRouter))],
['static route name is steadyTrend', () => /name:\s*'steadyTrend'/.test(read(files.staticRouter))],
['static router imports steadyTrend page', () => /@\/views\/steady\/steadyTrend\/index\.vue/.test(read(files.staticRouter))],
[
'dynamic router aliases steady-trend to steadyTrend',
() => /\/steady\/steady-trend[\s\S]*\/steady\/steadyTrend/.test(read(files.dynamicRouter))
],
[
'dynamic router keeps steadyTrend static route from being overwritten',
() => /STATIC_ROUTE_NAMES[\s\S]*'steadyTrend'/.test(read(files.dynamicRouter))
],
[
'auth normalizes backend steadyTrend menu to static entry',
() => /isSteadyTrendMenu[\s\S]*menu\.path\s*=\s*'\/steadyTrend\/index'/.test(read(files.authStore))
],
[
'business menu path resolver handles steadyTrend',
() => /isSteadyTrendMenu\(menu\)[\s\S]*return\s+'\/steadyTrend\/index'/.test(read(files.authStore))
]
]
const failures = checks.filter(([, check]) => !check()).map(([name]) => name)
if (failures.length) {
console.error('steadyTrend route contract failed:')
failures.forEach(name => console.error(`- ${name}`))
process.exit(1)
}
console.log('steadyTrend route contract passed')