20260916231505

This commit is contained in:
oneao committed 2026-09-16 23:15:06 +08:00
1 parent de05498552
commit 182ed86966
126 files changed
+5900 -766

No files matched your search

@@ -83,6 +83,28 @@ describe('schemaModel:view/edit 配置 ↔ 编辑器草稿', () => {
const back = editorToSchema('view', rows, groups, schema)
expect(back.columns[0]).toMatchObject({ field: 'name', fixed: 'left', format: 'money' })
})
it('view:合计(summary)与行属性互转,无合计不写出该属性', () => {
const schema = {
schemaVersion: 1,
columns: [{ field: 'amount', width: 110, summary: 'sum' }, { field: 'name' }],
}
const { rows, groups } = schemaToEditor('view', schema, 'm1')
expect(rows[0].b_summary).toBe('sum')
expect(rows[1].b_summary).toBe('')
const back = editorToSchema('view', rows, groups, schema)
expect(back.columns[0].summary).toBe('sum')
expect(back.columns[1].summary).toBeUndefined()
// 改成计数 → 写回 count;清空 → 删除属性
rows[0].b_summary = 'count'
const counted = editorToSchema('view', rows, groups, schema)
expect(counted.columns[0].summary).toBe('count')
rows[0].b_summary = ''
const cleared = editorToSchema('view', rows, groups, schema)
expect(cleared.columns[0].summary).toBeUndefined()
})
})
describe('schemaModel:字段参与节点操作', () => {