feat(front-end): 初始化STP前端工程并提交页面框架

引入前端项目基础结构、页面骨架和UI组件,建立可运行的开发与构建配置,方便后续按模块迭代。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-22 14:25:22 +08:00
parent f6ff2e3625
commit 7f0f79420c
107 changed files with 18103 additions and 0 deletions
+226
View File
@@ -0,0 +1,226 @@
import type { RoleId } from "../roles";
export interface WbStat {
label: string;
value: string;
alert?: boolean;
}
export interface WbTodo {
title: string;
count: number;
project?: string;
link: string;
priority?: "高" | "中" | "低";
ai?: boolean;
}
export interface WbGroup {
stage: string;
todos: WbTodo[];
}
export interface WbConfig {
greeting: string;
stats: WbStat[];
groups: WbGroup[];
/** 角色专属附加组件标识 */
extra?: "specialist" | "supplier" | "admin" | "auditor" | "committee" | "expert" | "approver";
primaryAction?: { label: string; link: string };
}
export const WORKBENCH: Record<RoleId, WbConfig> = {
requester: {
greeting: "您可以用自然语言快速发起采购需求,AI 将为您自动生成委托单。",
stats: [
{ label: "进行中项目", value: "4" },
{ label: "已定标", value: "7" },
{ label: "被驳回", value: "1", alert: true },
],
primaryAction: { label: "✨ AI 发起新委托", link: "/app/delegation" },
groups: [
{
stage: "我的待办",
todos: [
{ title: "待确认的 AI 预填委托单", count: 2, project: "氯碱车间耐腐蚀阀门采购", link: "/app/delegation", ai: true, priority: "高" },
{ title: "待参与的技术标评审", count: 1, project: "DCS 控制系统升级采购", link: "/app/projects/P2026001/evaluation", priority: "中" },
{ title: "待补充需求资料", count: 1, project: "污水处理提标改造工程", link: "/app/projects/P2026004", priority: "低" },
],
},
],
},
specialist: {
greeting: "您当前有多项流程任务待处理,AI 已为您按阶段智能归类。",
stats: [
{ label: "进行中项目", value: "24" },
{ label: "本月定标", value: "8" },
{ label: "待处理任务", value: "12" },
{ label: "超时预警", value: "2", alert: true },
],
extra: "specialist",
primaryAction: { label: "+ 新建招标项目", link: "/app/delegation" },
groups: [
{
stage: "需求阶段",
todos: [
{ title: "待确认委托单", count: 3, link: "/app/delegation", ai: true, priority: "高" },
{ title: "待合并招标建议", count: 1, link: "/app/merge", ai: true, priority: "中" },
],
},
{
stage: "寻源阶段",
todos: [
{ title: "待确认 AI 寻源结果", count: 1, link: "/app/projects/P2026005/sourcing", ai: true, priority: "高" },
{ title: "待评审报名单位", count: 5, link: "/app/projects/P2026004/shortlist", ai: true, priority: "中" },
],
},
{
stage: "评标阶段",
todos: [
{ title: "待确认专家抽取", count: 1, link: "/app/experts", priority: "高" },
{ title: "待处理评标异常", count: 1, link: "/app/projects/P2026001/evaluation", priority: "高" },
],
},
{
stage: "定标阶段",
todos: [
{ title: "待生成评标报告", count: 1, link: "/app/projects/P2026003/award", ai: true, priority: "中" },
{ title: "待发起定标审批", count: 1, link: "/app/projects/P2026003/award", priority: "高" },
],
},
],
},
purchaser: {
greeting: "中标结果确认、合同生成与保证金管理一站式处理。",
stats: [
{ label: "待签约合同", value: "3" },
{ label: "本月应入库供应商", value: "5" },
{ label: "保证金应收(万元)", value: "126" },
],
primaryAction: { label: "✨ AI 生成合同", link: "/app/contracts" },
groups: [
{
stage: "我的待办",
todos: [
{ title: "待确认中标结果", count: 1, project: "环氧丙烷装置大修工程", link: "/app/projects/P2026003/award", priority: "高" },
{ title: "待生成合同", count: 2, link: "/app/contracts", ai: true, priority: "高" },
{ title: "待收取履约保证金", count: 3, link: "/app/deposits", priority: "中" },
{ title: "待发起供应商入库", count: 5, link: "/app/inbound", priority: "中" },
],
},
],
},
expert: {
greeting: "您有评标邀请待确认,请按截止时间及时完成盲评。",
stats: [
{ label: "本月受邀", value: "3" },
{ label: "已评标", value: "2" },
{ label: "累计评审费(元)", value: "12,000" },
],
extra: "expert",
groups: [
{
stage: "我的评标任务",
todos: [
{ title: "待确认评标邀请", count: 1, project: "DCS 控制系统升级采购", link: "/app/expert-tasks", priority: "高" },
{ title: "待签署评标承诺书", count: 1, project: "DCS 控制系统升级采购", link: "/app/expert-tasks", priority: "高" },
{ title: "待完成评标任务", count: 1, project: "DCS 控制系统升级采购", link: "/app/projects/P2026001/evaluation", priority: "高" },
],
},
],
},
committee: {
greeting: "请及时处理触发异常规则的评标事项与废标申请。",
stats: [
{ label: "待审批废标", value: "1", alert: true },
{ label: "待决策异常", value: "2", alert: true },
{ label: "本月已处理", value: "6" },
],
extra: "committee",
groups: [
{
stage: "异常决策待办",
todos: [
{ title: "待决策:有效投标人不足3家", count: 1, project: "实验室耗材集采", link: "/app/exceptions", ai: true, priority: "高" },
{ title: "待审批废标申请", count: 1, project: "厂区绿化养护服务", link: "/app/exceptions", priority: "高" },
{ title: "待审批特殊评标事项", count: 1, project: "信息系统等保测评", link: "/app/exceptions", priority: "中" },
],
},
],
},
approver: {
greeting: "AI 已为每项审批提炼关键信息,助您高效决策。",
stats: [
{ label: "待审批总数", value: "12" },
{ label: "平均审批耗时", value: "2.4h" },
{ label: "本月已审批", value: "38" },
],
extra: "approver",
groups: [
{
stage: "按类型分组",
todos: [
{ title: "待审批委托", count: 4, link: "/app/approvals", priority: "中" },
{ title: "待审批立项", count: 3, link: "/app/approvals", priority: "中" },
{ title: "待审批公告", count: 2, link: "/app/approvals", priority: "高" },
{ title: "待审批定标", count: 3, link: "/app/approvals", priority: "高" },
],
},
],
},
supplier: {
greeting: "AI 已为您推荐高匹配度项目,请关注报名与投标截止时间。",
stats: [
{ label: "进行中投标", value: "2" },
{ label: "历史中标", value: "7" },
{ label: "保证金在途(万元)", value: "25" },
],
extra: "supplier",
primaryAction: { label: "进入投标中心", link: "/app/bidding" },
groups: [
{
stage: "我的待办",
todos: [
{ title: "待报名项目", count: 1, project: "污水处理提标改造工程", link: "/app/bidding", priority: "中" },
{ title: "待缴纳保证金", count: 1, project: "智能巡检机器人系统建设", link: "/app/bidding", priority: "高" },
{ title: "待上传投标文件", count: 1, project: "DCS 控制系统升级采购", link: "/app/bidding", priority: "高" },
],
},
],
},
admin: {
greeting: "系统运行平稳,请关注权限申请与异常告警。",
stats: [
{ label: "今日活跃用户", value: "186" },
{ label: "API 可用率", value: "99.98%" },
{ label: "待处理告警", value: "2", alert: true },
],
extra: "admin",
groups: [
{
stage: "待处理事项",
todos: [
{ title: "用户权限申请", count: 3, link: "/app/admin/users", priority: "中" },
{ title: "流程配置变更", count: 1, link: "/app/admin/process", priority: "中" },
{ title: "密钥漂移待执行", count: 1, link: "/app/admin/keys", priority: "高" },
],
},
],
},
auditor: {
greeting: "请关注高风险预警项目,按需开展审计与存证验证。",
stats: [
{ label: "本月新增项目", value: "24" },
{ label: "高风险预警", value: "3", alert: true },
{ label: "待审计项目", value: "5" },
],
extra: "auditor",
groups: [
{
stage: "审计待办",
todos: [
{ title: "围串标风险待核查", count: 3, link: "/app/collusion", ai: true, priority: "高" },
{ title: "待审计项目", count: 5, link: "/app/audit-logs", priority: "中" },
{ title: "待出具存证验证", count: 2, link: "/app/evidence", priority: "中" },
],
},
],
},
};