// ---------- 数据模型 ---------- export interface Project { id: string name: string region: string // 如 "浙江·杭州" keywords: string[] budget: number | null // 预算(万元),null = 公告未披露 publishDate: string // 公告发布日期 YYYY-MM-DD regDeadline: string | null // 报名截止 YYYY-MM-DD,null = 未披露/不适用 bidDeadline: string | null // 投标截止 purchaser: string // 采购单位 noticeType: string // 招标公告 / 竞争性磋商 / 更正公告 等 sourceName: string // 来源平台名称 sourceUrl: string | null // 来源网址,null = 链接暂未收录 summary: string // 列表简析(一句项目概述或需关注事项) detail: string // 项目内容(供 AI 分析引用) requirements: string[] // 公告参与条件 } export interface SearchConditions { keyword: string region: string budgetMin: string // 万元,'' 表示不限 budgetMax: string publishRange: '7d' | '30d' | '90d' | 'all' } export interface SearchBatch { id: string conditions: SearchConditions executedAt: string projectIds: string[] total: number } export type WatchStatus = | '已关注' | '准备投标' | '已报名' | '已提交投标文件' | '已中标' | '未中标' | '已流标' | '暂不考虑' export const WATCH_STATUSES: WatchStatus[] = [ '已关注', '准备投标', '已报名', '已提交投标文件', '已中标', '未中标', '已流标', '暂不考虑', ] export const RESULT_STATUSES: WatchStatus[] = ['已中标', '未中标', '已流标'] export const SKIPPED_STATUSES: WatchStatus[] = ['暂不考虑'] export const HISTORY_STATUSES: WatchStatus[] = [...RESULT_STATUSES, ...SKIPPED_STATUSES] /** 每个状态的含义与边界说明,在变更状态弹窗中展示 */ export const WATCH_STATUS_DESC: Record = { 已关注: '先放进清单观望,还没决定是否参与', 准备投标: '决定参与,正在准备报名材料或投标文件', 已报名: '已在招标平台完成报名,等待递交标书', 已提交投标文件: '标书已递交,等待开标与评标结果', 已中标: '结果公告:我方中标', 未中标: '结果公告:我方未中标', 已流标: '招标方公告流标,或项目已终止', 暂不考虑: '我方主动放弃跟进(与项目结果无关),可随时转回', } export interface StatusChange { status: WatchStatus time: string /** 状态变更那一刻的备注快照 */ note?: string } export interface WatchRecord { projectId: string status: WatchStatus note: string /** 用户自定义分类标签 */ tags: string[] createdAt: string history: StatusChange[] } export interface TaskRun { time: string status: 'success' | 'failed' count: number error?: string } export interface ScheduleTask { id: string name: string conditions: SearchConditions frequency: 'daily' | 'once' time: string // HH:mm(北京时间) createdAt: string runs: TaskRun[] } export interface MatchWeights { /** 业务贴合(%) */ business: number /** 服务地区(%) */ region: number /** 金额匹配(%) */ amount: number /** 业绩与资质(%) */ track: number } /** 匹配度四个维度的显示名称,用户可自定义 */ export interface MatchDimNames { business: string region: string amount: string track: string } export const defaultMatchDimNames: MatchDimNames = { business: '业务贴合', region: '服务地区', amount: '金额匹配', track: '业绩与资质', } export interface CompanyProfile { companyName: string intro: string mainBusiness: string products: string advantages: string serviceRegions: string customerTypes: string projectTypes: string amountPreference: string qualifications: string trackRecord: string delivery: string bidPreparation: string boundaries: string /** 匹配度四个维度的权重,用户可自配置 */ matchWeights: MatchWeights /** 匹配度维度的自定义名称 */ matchDimNames: MatchDimNames completed: boolean version: number updatedAt: string | null } export const defaultMatchWeights: MatchWeights = { business: 40, region: 20, amount: 20, track: 20 } export const emptyProfile: CompanyProfile = { companyName: '', intro: '', mainBusiness: '', products: '', advantages: '', serviceRegions: '', customerTypes: '', projectTypes: '', amountPreference: '', qualifications: '', trackRecord: '', delivery: '', bidPreparation: '', boundaries: '', matchWeights: { ...defaultMatchWeights }, matchDimNames: { ...defaultMatchDimNames }, completed: false, version: 0, updatedAt: null, } /** 演示用公司档案:首次使用或档案为空时载入,让匹配度打分与 AI 分析报告可直接演示 */ export const demoProfile: CompanyProfile = { companyName: '杭州澜清水务科技有限公司', intro: '成立于 2016 年,专注智慧水务领域,服务长三角地区水务集团与政府监管部门。', mainBusiness: '智慧水务平台建设、供水管网漏损控制、水质监测设备', products: 'DMA 分区计量系统、管网漏损分析平台、水质在线监测设备、二次供水监控系统', advantages: '自研漏损分析算法、本地化交付团队、7×24 响应', serviceRegions: '浙江、江苏、上海', customerTypes: '水务集团、住建局、园区管委会', projectTypes: '软件平台、监测设备、运营服务', amountPreference: '100-2000 万元', qualifications: '电子与智能化工程专业承包二级(有效期至 2028-06);软件著作权 6 项;ISO9001 质量管理体系认证', trackRecord: '2025 年某市供水管网漏损治理项目(540 万元,已通过验收);2024 年某县智慧水务平台建设项目(860 万元)', delivery: '自有实施团队 12 人,支持驻场;提供 7×24 响应', bidPreparation: '常规标书准备约 7 天,涉及现场勘察需 10 天以上', boundaries: '不参与需要垫资的工程施工总承包项目', matchWeights: { ...defaultMatchWeights }, matchDimNames: { ...defaultMatchDimNames }, completed: true, version: 1, updatedAt: null, } export interface ChatMessage { role: 'user' | 'assistant' content: string skillTrace?: string[] // 实际发生的 Skill 调用记录 time: string } export interface ResearchConversation { id: string title: string createdAt: string messages: ChatMessage[] } export type AiPanelState = | { kind: 'closed' } | { kind: 'project'; projectId: string } | { kind: 'search'; batchId: string } export type PageKey = 'discover' | 'watch' | 'research' | 'profile'