refactor(event): 重构事件列表和稳态数据视图组件结构

- 将事件列表页面逻辑拆分为 EventListTable 组件
- 新增 MeasurementPointDialog 和 VoltageToleranceDialog 弹窗组件
- 重构稳态数据视图为主工作台组件 SteadyTrendWorkbench
- 移除不再使用的相别参数和相关逻辑
- 更新事件详情工具函数和接口参数映射
- 优化波形查看功能的数据传递方式
- 修正事件描述字段命名和严重程度解析逻辑
This commit is contained in:
2026-05-18 08:46:42 +08:00
parent 609fdd5379
commit f9ed6c6245
39 changed files with 1943 additions and 755 deletions

View File

@@ -0,0 +1,71 @@
/* 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 pageFile = path.join(currentDir, '..', 'index.vue')
const componentDir = path.join(currentDir, '..', 'components')
const apiFile = path.resolve(currentDir, '../../../../api/steady/steadyDataView/index.ts')
const interfaceFile = path.resolve(currentDir, '../../../../api/steady/steadyDataView/interface/index.ts')
const source = fs.readFileSync(pageFile, 'utf8')
const componentSource = fs.existsSync(componentDir)
? fs
.readdirSync(componentDir)
.filter(file => file.endsWith('.vue'))
.map(file => fs.readFileSync(path.join(componentDir, file), 'utf8'))
.join('\n')
: ''
const viewSource = `${source}\n${componentSource}`
const apiSource = fs.readFileSync(apiFile, 'utf8')
const interfaceSource = fs.readFileSync(interfaceFile, 'utf8')
const forbiddenPatterns = [
['data detail tab is removed', /数据明细|name="detail"|SteadyDataTablePanel/, source],
['detail ProTable is removed', /buildSteadyDataQueryParams|SteadyDataSearchParams/, source],
['trend summary panel is removed', /SteadyTrendSummaryPanel|trendSummary|loading\.summary/, source],
[
'page detail API is removed',
/getSteadyDataPage|getSteadyDataDetail|getSteadyDataTemplates|\/steady\/data-view\/page|\/steady\/data-view\/detail|\/steady\/data-view\/templates/,
apiSource
],
['trend summary API is removed', /getSteadyTrendSummary|\/steady\/data-view\/trend\/summary/, apiSource],
[
'page detail types are removed',
/PageResult|SteadyDataPageParams|SteadyDataDetailParams|SteadyDataTemplate|SteadyDataRecord/,
interfaceSource
],
[
'trend summary types are removed',
/SteadyTrendSummary|SteadyTrendSummaryItem/,
interfaceSource
]
]
const requiredPatterns = [
['page defines SteadyDataView component name', /name:\s*'SteadyDataView'/, source],
['page renders extracted trend workbench', /<SteadyTrendWorkbench/, source],
['trend workbench component exists', /SteadyTrendWorkbench/, viewSource],
['floating indicator panel component exists', /SteadyIndicatorFloatingPanel/, viewSource],
['components keep trend chart panel', /SteadyTrendChartPanel/, viewSource],
['components keep right floating indicator panel', /indicator-floating-panel/, viewSource],
['indicator panel defaults expanded', /indicatorPanelCollapsed\s*=\s*ref\(false\)/, source],
['indicator panel supports collapsed state', /is-collapsed/, viewSource],
['API keeps trend query endpoint', /\/steady\/data-view\/trend\/query/, apiSource]
]
const failures = [
...forbiddenPatterns.filter(([, pattern, target]) => pattern.test(target)),
...requiredPatterns.filter(([, pattern, target]) => !pattern.test(target))
]
if (failures.length) {
console.error('steadyDataView visible contract failed:')
for (const [name] of failures) {
console.error(`- ${name}`)
}
process.exit(1)
}
console.log('steadyDataView visible contract passed')