feat(data-tools): 新增入库类型选择功能并优化数据工具界面

- 在补数任务面板中添加入库类型单选按钮组,支持 MySQL 和 InfluxDB
- 更新 AddData 接口定义,添加 StorageType 相关类型和选项接口
- 修改补数 API 请求逻辑,根据入库类型动态调整接口路径前缀
- 重构台账设备表单,统一使用装置网络参数作为 MAC 和 NDID 的单一数据源
- 优化台账线路表单,仅当存在 ID 时才设置 lineId 字段,避免空值传递
- 添加入库类型列表获取接口和相关数据处理逻辑
- 更新台账字典代码常量,新增终端型号字典码
- 优化台账树节点添加逻辑,增加前置条件验证和禁用原因提示
- 添加 InfluxDB 配置文件到额外资源目录
- 更新稳定数据分析视图,优化台账树数据结构处理和样式布局
- 完善 API 调试契约检查,确保设备和线路数据映射正确性
- 优化趋势查询性能,禁用全局加载状态提升用户体验
This commit is contained in:
2026-05-21 14:07:10 +08:00
parent f1eaabae0e
commit b9ddfb5275
23 changed files with 2462 additions and 180 deletions

View File

@@ -20,7 +20,9 @@ const componentSource = fs.existsSync(componentDir)
const readComponent = file => fs.readFileSync(path.join(componentDir, file), 'utf8')
const toolbarSource = readComponent('SteadyTrendToolbar.vue')
const chartPanelSource = readComponent('SteadyTrendChartPanel.vue')
const workbenchSource = readComponent('SteadyTrendWorkbench.vue')
const floatingPanelSource = readComponent('SteadyIndicatorFloatingPanel.vue')
const ledgerTreeSource = readComponent('SteadyLedgerTree.vue')
const indicatorTreeSource = readComponent('SteadyIndicatorTree.vue')
const viewSource = `${source}\n${componentSource}`
const apiSource = fs.readFileSync(apiFile, 'utf8')
@@ -62,15 +64,40 @@ const requiredPatterns = [
['indicator panel supports collapsed state', /is-collapsed/, viewSource],
['API keeps trend query endpoint', /\/steady\/data-view\/trend\/query/, apiSource],
[
'trend toolbar reserves four evenly distributed search columns',
/grid-template-columns:\s*repeat\(4,\s*minmax\(0,\s*1fr\)\)\s*auto/,
'trend toolbar gives the time selector a wider first column',
/grid-template-columns:\s*minmax\(360px,\s*1\.35fr\)\s+repeat\(3,\s*minmax\(0,\s*1fr\)\)\s*auto/,
toolbarSource
],
['trend toolbar keeps actions after four search columns', /grid-column:\s*5/, toolbarSource],
[
'trend toolbar widens the shared time period unit selector',
/\.trend-toolbar__time\s*:deep\(\.time-period-search__unit\)[\s\S]*width:\s*72px[\s\S]*flex:\s*0 0 72px/,
toolbarSource
],
[
'trend toolbar widens the shared time period date picker',
/\.trend-toolbar__time\s*:deep\(\.time-period-search__picker\)[\s\S]*width:\s*136px[\s\S]*flex:\s*0 0 136px/,
toolbarSource
],
['floating indicator panel expanded width is reduced', /width:\s*300px/, floatingPanelSource],
['floating indicator collapsed state keeps icon only', /width:\s*0/, floatingPanelSource],
['floating indicator body is hidden when collapsed', /\.indicator-floating-panel\.is-collapsed\s+\.indicator-panel-body/, floatingPanelSource],
['indicator tree header separates title and refresh icon', /justify-content:\s*flex-start/, indicatorTreeSource]
['floating indicator toggle keeps enough distance from title', /left:\s*-28px/, floatingPanelSource],
['floating indicator toggle uses primary theme color', /class="indicator-toggle"[\s\S]*type="primary"/, floatingPanelSource],
['ledger collapse buttons use primary theme color', /class="panel-toggle"[\s\S]*type="primary"/, ledgerTreeSource],
['indicator tree header separates title and refresh icon', /justify-content:\s*flex-start/, indicatorTreeSource],
['page tracks collapsed ledger panel state', /ledgerPanelCollapsed\s*=\s*ref\(false\)/, source],
['page passes collapsed ledger state to workbench', /v-model:ledger-panel-collapsed="ledgerPanelCollapsed"/, source],
['query collapses floating indicator panel', /indicatorPanelCollapsed\.value\s*=\s*true[\s\S]*querySteadyTrend/, source],
['workbench exposes collapsed ledger panel model', /ledgerPanelCollapsed[\s\S]*update:ledgerPanelCollapsed/, workbenchSource],
['workbench applies collapsed ledger layout class', /is-ledger-collapsed/, workbenchSource],
['ledger panel stays in normal layout instead of floating', /\.selector-column[\s\S]*position:\s*relative/, workbenchSource],
['collapsed ledger panel does not reserve trigger column width', /grid-template-columns:\s*0\s+minmax\(0,\s*1fr\)/, workbenchSource],
[
'collapsed ledger panel allows only the expand button to float',
/\.steady-trend-layout\.is-ledger-collapsed\s+\.selector-column[\s\S]*overflow:\s*visible/,
workbenchSource
]
]
const failures = [