feat(tools): 新增台账管理功能模块

- 添加 addLedger API 接口定义和实现
- 创建工程配置表单组件 (EngineeringForm)
- 创建设备配置表单组件 (EquipmentForm)
- 创建项目和测点表单组件 (ProjectForm, LineForm)
- 实现台账树形结构面板 (LedgerTreePanel)
- 添加台账数据验证契约检查脚本
- 集成字典选项和动态表单验证功能
- 实现台账节点增删改查完整流程
- 优化 Echarts 图表组件分组渲染性能
This commit is contained in:
2026-05-09 07:53:32 +08:00
parent a1e1fb124a
commit cd54bb676c
14 changed files with 2005 additions and 26 deletions

View File

@@ -197,6 +197,9 @@
<el-form-item label="end">
<el-input v-model="row.end" />
</el-form-item>
<el-form-item label="icdcout">
<el-input :model-value="row.icdcout" readonly />
</el-form-item>
</el-form>
</div>
</article>
@@ -241,8 +244,10 @@ interface SequenceConfigRow {
parentDesc: string
desc: string
name: string
baseflag: string
start: string
end: string
icdcout: string
startValueType: string
endValueType: string
}
@@ -317,8 +322,8 @@ const filteredSequenceRows = computed(() => {
if (!keyword) return sequenceConfigRows.value
return sequenceConfigRows.value.filter(row =>
[row.topKey, row.topDesc, row.desc, row.parentDesc, row.name, row.pathText, row.start, row.end].some(value =>
value.toLowerCase().includes(keyword)
[row.topKey, row.topDesc, row.desc, row.parentDesc, row.name, row.baseflag, row.pathText, row.start, row.end].some(
value => value.toLowerCase().includes(keyword)
)
)
})
@@ -368,12 +373,6 @@ const toDisplayText = (value: unknown, fallback: string) => {
return fallback
}
const isZeroValue = (value: unknown) => {
if (typeof value === 'number') return value === 0
if (typeof value === 'string') return Number(value.trim()) === 0
return false
}
const getPathText = (path: JsonPath) => (path.length ? path.map(item => String(item)).join(' / ') : '$')
const getTopKey = (path: JsonPath) => (path.length ? String(path[0]) : '$')
@@ -386,6 +385,13 @@ const resolveTopDesc = (source: unknown, path: JsonPath) => {
return isRecord(topValue) ? toDisplayText(topValue.desc, '') : ''
}
const isConfigurableBaseflag = (value: unknown) => {
if (typeof value === 'number') return value === 1 || value === 2
if (typeof value !== 'string') return false
return ['1', '2'].includes(value.trim())
}
const collectSequenceRows = (source: unknown, path: JsonPath = [], parentDesc = '', rootSource = source): SequenceConfigRow[] => {
if (Array.isArray(source)) {
return source.flatMap((item, index) => collectSequenceRows(item, [...path, index], parentDesc, rootSource))
@@ -402,7 +408,7 @@ const collectSequenceRows = (source: unknown, path: JsonPath = [], parentDesc =
const hasEnd = Object.prototype.hasOwnProperty.call(source, 'end')
if (!hasStart || !hasEnd) return childrenRows
if (isZeroValue(source.start) && isZeroValue(source.end)) return childrenRows
if (!isConfigurableBaseflag(source.baseflag)) return childrenRows
return [
{
@@ -414,8 +420,10 @@ const collectSequenceRows = (source: unknown, path: JsonPath = [], parentDesc =
parentDesc: parentDesc || '未配置上层描述',
desc: toDisplayText(source.desc, '未命名序列'),
name: toDisplayText(source.name, '未配置 name'),
baseflag: toDisplayText(source.baseflag, ''),
start: source.start === undefined || source.start === null ? '' : String(source.start),
end: source.end === undefined || source.end === null ? '' : String(source.end),
icdcout: toDisplayText(source.icdcout, ''),
startValueType: typeof source.start,
endValueType: typeof source.end
},
@@ -829,7 +837,7 @@ const confirmSequenceConfig = () => {
.sequence-config-item {
display: grid;
grid-template-columns: minmax(0, 1fr) 300px;
grid-template-columns: minmax(0, 1fr) 420px;
gap: 16px;
padding: 8px 0;
border: 1px solid #dbe3f0;
@@ -872,7 +880,7 @@ const confirmSequenceConfig = () => {
.sequence-config-form {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 12px;
}