审批流程管理(系统管理员)+ 系统管理员去首页

- 审批规则引擎 evaluateApproval(纯函数+8单测):有序条件规则决定风控通过后是否需管理层终审
- approval_config 表 + 持久化 + 默认规则种子(红线/不可接受/高风险/低毛利/大合同→需管理层;低风险达标→风控终批)
- 风控审核接入规则:低风险达标可风控终批,否则转管理层;审计记录命中规则
- GET/PUT /api/approval-config(PUT 限系统管理员);overdue SLA 改为读配置
- 审批流程配置页 WorkflowManagement(全局SLA/默认/驳回去向 + 规则与条件编辑器)
- 系统管理员去掉首页,登录落地用户管理;导航=用户管理+审批流程
This commit is contained in:
freedakgmail
2026-06-13 17:55:28 +08:00
parent 6562208b13
commit 757b9c4a69
11 changed files with 632 additions and 13 deletions
+11 -2
View File
@@ -12,6 +12,7 @@ import { RateManagement } from './pages/RateManagement.js';
import { RedlineManagement } from './pages/RedlineManagement.js';
import { CustomerManagement } from './pages/CustomerManagement.js';
import { UserManagement } from './pages/UserManagement.js';
import { WorkflowManagement } from './pages/WorkflowManagement.js';
/** 路由守卫:未登录重定向到登录页。 */
function ProtectedRoute(): JSX.Element {
@@ -26,6 +27,13 @@ function RoleRoute({ allow }: { readonly allow: readonly string[] }): JSX.Elemen
return allow.includes(role) ? <Outlet /> : <Navigate to="/" replace />;
}
/** 首页:系统管理员不关心业务,重定向到用户管理;其余角色看评估看板。 */
function HomeRoute(): JSX.Element {
const { user } = useAuthStore();
if (user?.role === '系统管理员') return <Navigate to="/users" replace />;
return <Dashboard />;
}
export function App(): JSX.Element {
return (
<BrowserRouter
@@ -38,7 +46,7 @@ export function App(): JSX.Element {
<Route path="/login" element={<Login />} />
<Route element={<ProtectedRoute />}>
<Route element={<AppShell />}>
<Route path="/" element={<Dashboard />} />
<Route path="/" element={<HomeRoute />} />
<Route path="/new" element={<NewAssessment />} />
<Route path="/assessments/:id" element={<AssessmentDetail />} />
{/* 费率/红线管理:仅管理层 */}
@@ -50,9 +58,10 @@ export function App(): JSX.Element {
<Route element={<RoleRoute allow={['商务/销售', '管理层']} />}>
<Route path="/customers" element={<CustomerManagement />} />
</Route>
{/* 用户管理:系统管理员 */}
{/* 用户管理 + 审批流程:系统管理员 */}
<Route element={<RoleRoute allow={['系统管理员']} />}>
<Route path="/users" element={<UserManagement />} />
<Route path="/workflow" element={<WorkflowManagement />} />
</Route>
</Route>
</Route>