- 更新纵坐标刻度算法,优化小数趋势图范围显示 - 添加稳态趋势图全屏模式和共享工具组件 - 实现多图联动的鼠标悬停竖线同步功能 - 调整主线线宽分档策略,降低最大线宽限制 - 重构稳态趋势工具栏,优化谐波次数选择逻辑 - 添加周时间周期搜索支持和自定义时间范围选择 - 完善稳态数据表格和指示器浮动面板功能 - 优化稳态趋势图性能,添加LTB采样和动画控制 - 修复数据表格打开前的趋势数据验证问题 - 统一时间轴标签格式化和网格对齐处理
58 lines
2.2 KiB
JavaScript
58 lines
2.2 KiB
JavaScript
/* eslint-env node */
|
|
import fs from 'node:fs'
|
|
import path from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
const currentDir = path.dirname(fileURLToPath(import.meta.url))
|
|
const chartPanelFile = path.resolve(currentDir, '../components/SteadyTrendChartPanel.vue')
|
|
const trendOptionsFile = path.resolve(currentDir, '../utils/trendOptions.ts')
|
|
|
|
const chartPanelSource = fs.readFileSync(chartPanelFile, 'utf8')
|
|
const trendOptionsSource = fs.readFileSync(trendOptionsFile, 'utf8')
|
|
|
|
const checks = [
|
|
['chart panel defines missing data tool action', /'missing-data'/, chartPanelSource],
|
|
['chart panel labels missing data action', /action:\s*'missing-data'[\s\S]*label:/, chartPanelSource],
|
|
[
|
|
'chart panel defaults missing data enabled for every query',
|
|
/const\s+missingDataEnabled\s*=\s*ref\(true\)/,
|
|
chartPanelSource
|
|
],
|
|
[
|
|
'chart panel marks missing data action active only when enabled',
|
|
/action\s*===\s*'missing-data'[\s\S]*return\s+missingDataEnabled\.value/,
|
|
chartPanelSource
|
|
],
|
|
[
|
|
'chart panel passes missing data state into chart options',
|
|
/buildSteadyTrendChartGroups\([^)]*trendXZoomRange\.value[\s\S]*showMissingData:\s*missingDataEnabled\.value/,
|
|
chartPanelSource
|
|
],
|
|
['chart options accept missing data option', /showMissingData\?:\s*boolean/, trendOptionsSource],
|
|
[
|
|
'chart options only fills missing data when enabled',
|
|
/chartOptions\.showMissingData\s*===\s*true\s*\?\s*fillSteadyTrendMissingPoints\(/,
|
|
trendOptionsSource
|
|
],
|
|
[
|
|
'missing data filler inserts null values',
|
|
/fillSteadyTrendMissingPoints[\s\S]*value:[\s\S]*:\s*null/,
|
|
trendOptionsSource
|
|
],
|
|
[
|
|
'missing data filler infers interval from existing time gaps',
|
|
/resolveSteadyTrendPointIntervalMs[\s\S]*gaps[\s\S]*Math\.min/,
|
|
trendOptionsSource
|
|
]
|
|
]
|
|
|
|
const failed = checks.filter(([, pattern, source]) => !pattern.test(source)).map(([message]) => message)
|
|
|
|
if (failed.length) {
|
|
console.error('steadyDataView missing data contract failed:')
|
|
failed.forEach(message => console.error(`- ${message}`))
|
|
process.exit(1)
|
|
}
|
|
|
|
console.log('steadyDataView missing data contract passed')
|