- 更新纵坐标刻度算法,优化小数趋势图范围显示 - 添加稳态趋势图全屏模式和共享工具组件 - 实现多图联动的鼠标悬停竖线同步功能 - 调整主线线宽分档策略,降低最大线宽限制 - 重构稳态趋势工具栏,优化谐波次数选择逻辑 - 添加周时间周期搜索支持和自定义时间范围选择 - 完善稳态数据表格和指示器浮动面板功能 - 优化稳态趋势图性能,添加LTB采样和动画控制 - 修复数据表格打开前的趋势数据验证问题 - 统一时间轴标签格式化和网格对齐处理
34 lines
1.6 KiB
JavaScript
34 lines
1.6 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 toolbarFile = path.resolve(currentDir, '../components/SteadyTrendToolbar.vue')
|
|
const payloadFile = path.resolve(currentDir, '../utils/trendPayload.ts')
|
|
|
|
const toolbarSource = fs.readFileSync(toolbarFile, 'utf8')
|
|
const payloadSource = fs.readFileSync(payloadFile, 'utf8')
|
|
|
|
const checks = [
|
|
['toolbar labels the filter as data quality', /toolbar-field__label">数据质量:<\/span>/],
|
|
['toolbar renders quality flag with switch', /<el-switch[\s\S]*:model-value="modelValue\.qualityFlag \?\? 0"/],
|
|
['quality switch maps valid data to zero', /active-text="有效"[\s\S]*:active-value="0"/],
|
|
['quality switch maps invalid data to one', /inactive-text="无效"[\s\S]*:inactive-value="1"/],
|
|
['quality switch updates qualityFlag', /@update:model-value="handleQualityFlagChange"/],
|
|
['quality switch reserves enough prompt width', /\.quality-switch\s*\{[\s\S]*min-width:\s*72px/],
|
|
['utilities default to valid quality flag zero', /qualityFlag:\s*0/],
|
|
['utilities send quality flag in trend query payload', /qualityFlag:\s*formState\.qualityFlag/]
|
|
]
|
|
|
|
const failed = checks
|
|
.filter(([, pattern], index) => !pattern.test(index < 6 ? toolbarSource : payloadSource))
|
|
.map(([message]) => message)
|
|
|
|
if (failed.length) {
|
|
console.error('steadyTrend quality switch contract failed:')
|
|
failed.forEach(message => console.error(`- ${message}`))
|
|
process.exit(1)
|
|
}
|
|
|
|
console.log('steadyTrend quality switch contract passed')
|