feat: 风险可见性控制与差旅详情页交互优化
- 新增风险可见性工具函数与风险日趋势图表组件 - 优化差旅请求详情页费用模型与视图交互 - 完善顶部导航栏样式与应用壳路由逻辑 - 补充风险可见性、风险看板与差旅详情测试覆盖
This commit is contained in:
14
web/src/utils/dateRangeDefaults.js
Normal file
14
web/src/utils/dateRangeDefaults.js
Normal file
@@ -0,0 +1,14 @@
|
||||
export function formatDateValue(date = new Date()) {
|
||||
const year = date.getFullYear()
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0')
|
||||
const day = String(date.getDate()).padStart(2, '0')
|
||||
return `${year}-${month}-${day}`
|
||||
}
|
||||
|
||||
export function createCurrentYearDateRange(now = new Date()) {
|
||||
const year = now.getFullYear()
|
||||
return {
|
||||
start: `${year}-01-01`,
|
||||
end: formatDateValue(now)
|
||||
}
|
||||
}
|
||||
@@ -235,6 +235,13 @@ export function canViewRiskForContext(flag, options = {}) {
|
||||
return context.isDirectManagerReviewer || context.canViewApprovalRiskAdvice || context.isBudgetReviewer
|
||||
}
|
||||
|
||||
const isReimbursementSubmitterFixableRisk = (
|
||||
(actionability === 'fixable_by_submitter' || visibilityScope === 'submitter') &&
|
||||
!['budget', 'profile'].includes(riskDomain)
|
||||
)
|
||||
if (isReimbursementSubmitterFixableRisk) {
|
||||
return true
|
||||
}
|
||||
if (context.isCurrentApplicant) {
|
||||
return actionability === 'fixable_by_submitter' || visibilityScope === 'submitter'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user