feat: 本体字段治理与风险规则模板执行器重构

- 新增本体字段注册表与字段治理审计脚本
- 重构风险规则模板执行器、DSL 验证与清单分类器
- 完善票据夹服务与差旅请求详情页交互
- 优化趋势图表与总览页数据展示
- 增强报销平台风险分级与模拟公司筛选
- 补充本体字段、风险规则生成与票据夹服务测试覆盖
This commit is contained in:
caoxiaozhu
2026-06-03 15:46:56 +08:00
parent e12b140508
commit 34457f9c3e
81 changed files with 4858 additions and 1073 deletions

View File

@@ -21,6 +21,10 @@ const barChart = readFileSync(
fileURLToPath(new URL('../src/components/charts/BarChart.vue', import.meta.url)),
'utf8'
)
const trendChart = readFileSync(
fileURLToPath(new URL('../src/components/charts/TrendChart.vue', import.meta.url)),
'utf8'
)
test('finance dashboard keeps legacy ranking range constants for backend compatibility', () => {
assert.deepEqual(departmentRangeOptions, [
@@ -57,3 +61,33 @@ test('finance ranking bar chart can display ranking metadata', () => {
assert.match(overviewViewModel, /meta: `\$\{Number\(item\.employeeCount/)
assert.match(overviewViewModel, /meta: `\$\{item\.department/)
})
test('daily amount trend uses stacked category bars with clear unit and legend', () => {
assert.match(overviewView, /:category-amount-series="activeTrend\.categoryAmountSeries"/)
assert.match(overviewView, /:key="`finance-amount-\$\{financeDashboardRenderKey\}`"/)
assert.match(overviewView, /:key="`finance-count-\$\{financeDashboardRenderKey\}`"/)
assert.match(overviewView, /return financeDashboardLoading\.value\s*\n\}/)
assert.doesNotMatch(overviewView, /financeDashboardLoading\.value && !financeDashboardLoaded\.value/)
assert.match(overviewViewModel, /categoryAmountSeries: \[\]/)
assert.match(overviewViewModel, /financeDashboardRenderKey/)
assert.match(overviewViewModel, /financeDashboardRequestSeq/)
assert.match(overviewViewModel, /requestSeq !== financeDashboardRequestSeq/)
assert.match(overviewViewModel, /financeDashboardRenderKey\.value \+= 1/)
assert.match(trendChart, /categoryAmountSeries/)
assert.match(trendChart, /CustomChart as EChartsCustomChart/)
assert.match(trendChart, /type: 'custom'/)
assert.match(trendChart, /renderStackedAmountBar/)
assert.match(trendChart, /resolveCategoryColor/)
assert.match(trendChart, /expenseCategoryColorMap/)
assert.match(trendChart, /clipPath/)
assert.match(trendChart, /enterFrom/)
assert.match(trendChart, /originY: zeroY/)
assert.match(trendChart, /scaleY: 0/)
assert.match(trendChart, /chart-unit/)
assert.match(trendChart, /unitLabel/)
assert.match(trendChart, /legendItems/)
assert.match(trendChart, /单位:元/)
assert.match(trendChart, /单位:单/)
assert.doesNotMatch(trendChart, /name:\s*isCountMode\.value/)
assert.doesNotMatch(trendChart, /stack: 'expenseAmount'/)
})