feat(dashboard): reorganize budget and risk cards

This commit is contained in:
caoxiaozhu
2026-06-03 10:47:11 +08:00
parent faa39e6c06
commit 27dd2f0a0d
10 changed files with 554 additions and 564 deletions

View File

@@ -22,27 +22,33 @@ const barChart = readFileSync(
'utf8'
)
test('finance dashboard ranking range options support month quarter year and all', () => {
assert.deepEqual(departmentRangeOptions, ['本月', '本季度', '本年', '全部'])
test('finance dashboard keeps legacy ranking range constants for backend compatibility', () => {
assert.deepEqual(departmentRangeOptions, [
'\u672c\u6708',
'\u672c\u5b63\u5ea6',
'\u672c\u5e74',
'\u5168\u90e8'
])
assert.match(analyticsService, /department_employee_mix/)
assert.match(analyticsService, /departmentEmployeeMix/)
assert.match(analyticsService, /department_range/)
})
test('finance dashboard renders shared ranking filters and department employee mix chart', () => {
assert.match(overviewView, /<h3>部门报销排行/)
assert.match(overviewView, /aria-label="部门排行时间范围"/)
assert.match(overviewView, /<h3>个人报销排行/)
assert.match(overviewView, /aria-label="个人排行时间范围"/)
assert.doesNotMatch(overviewView, /个人报销排行(本月)/)
assert.match(overviewView, /<h3>高额单据/)
assert.doesNotMatch(overviewView, /本月高额单据/)
assert.match(overviewView, /class="top-claim-split"/)
test('finance dashboard rankings follow top range and render department employee mix chart', () => {
assert.match(overviewView, /departmentEmployeeLegend/)
assert.match(overviewView, /departmentEmployeeCenterValue/)
assert.match(overviewView, /class="top-claim-split"/)
assert.match(overviewView, /card-range-chip/)
assert.doesNotMatch(overviewView, /aria-label="\u90e8\u95e8\u6392\u884c\u65f6\u95f4\u8303\u56f4"/)
assert.doesNotMatch(overviewView, /aria-label="\u4e2a\u4eba\u6392\u884c\u65f6\u95f4\u8303\u56f4"/)
assert.doesNotMatch(overviewView, /v-model="activeDepartmentRange"/)
assert.doesNotMatch(overviewView, /v-model="activeTrendRange"/)
assert.match(overviewViewModel, /financeDepartmentEmployeeMix/)
assert.match(overviewViewModel, /departmentEmployeeLegend/)
assert.match(overviewViewModel, /employeeCount/)
assert.match(overviewViewModel, /trendRange: resolveTopRangeKey/)
assert.match(overviewViewModel, /departmentRange: resolveTopRangeKey/)
assert.match(overviewViewModel, /const topRangeDays = computed/)
})
test('finance ranking bar chart can display ranking metadata', () => {