本文档用于约束 AI 在本项目中生成、修改和审查代码时的行为。所有 AI 输出应优先保持现有实现方式、目录组织和编码风格一致,避免引入不必要的新架构。
pref-web / performance-test)。server/:Express + mysql2 的数据库读取服务。downLoadServer/:Express 图表/报告下载服务,包含 ECharts、Plotly、Puppeteer、MinIO、DOCX 等能力。.env.* 与 vue.config.js 代理区分不同环境和客户模式。^2.6.14^3.5.1^3.6.2~5.0.0^2.15.14src/styles/index.scss^5.5.1、ECharts GL ^2.0.9ol ^9.2.3^1.6.8server/:Node.js ESM、Express ^4.21.1、mysql2 ^3.11.5downLoadServer/:Node.js ESM、Express ^4.19.1、CORS、dotenv、multer、archiver、docx/docxtemplater、Puppeteer、MinIO、Plotly/EChartssrc/main.js:Vue 入口,注册 Element UI、全局组件、指令、主题、日期工具和路由守卫。src/router/index.js:Vue Router 配置,按环境变量切换驾驶舱组件。src/store/:Vuex 模块,使用 vuex-persistedstate 持久化部分模块。src/api/:前端接口封装,优先通过 @/utils/request 统一请求。src/utils/request.js:Axios 实例、token 注入、响应错误处理和统一请求函数。src/views/:业务页面,按模块组织,如 admin/cockpitManage、performance、health、overview。src/components/:通用组件,包括地图、虚拟列表、富文本、SVG 等。src/assets/js/constants/echarts-config/:图表配置模板。src/styles/、src/themes/:全局样式和主题样式。server/index.js:数据库读取服务入口。downLoadServer/src/server/:下载服务入口、路由、控制器、中间件和图表工具。public/runtime-config.js:运行时配置。data、computed、watch、methods、生命周期钩子)。.vue 文件通常采用单文件组件结构:template、script、style lang="scss"。export function getWindFieldNames(data) { ... }。html[data-theme="tech-blue"]。cockpit-dashboard.scss,该文件为全局样式,不能随意改为 scoped。package.json:
serve:dev、serve:hd、serve:dt、serve:demo、serve:jlbuild:dev、build:hd、build:dt、build:demo、build:jlvue.config.js 使用 Vue CLI 配置:
@ 指向 srcsvg-sprite-loader 处理 src/iconsdevServer.proxy 代理 /api、/WZLapi、/ETLapi、/tiles、/AnalysisMulti、/transDataWeb、/sAlgorithm、/databaseApi、/downLoadChartsrc/utils/request.js。request 默认 baseURL 为 window?._BASE_CONFIG?.API || "/api"。sessionStorage.vuex.auth.userInfo.token 注入 headers.token。code === 200,否则使用 Element UI Message 提示并 reject。src/api/*.js 按业务模块组织 API 函数。axios.get/post,修改时优先保持局部兼容,不应大范围重写。server/index.js 使用 mysql2/promise 动态创建连接池。IP、host、baseName、username、password)。SHOW TABLES、DESCRIBE、SHOW COLUMNS、SELECT ... LIMIT 500。.env*、downLoadServer/.env 中的敏感内容复制到回答或新文件。public/runtime-config.js、环境变量、代理目标或构建/部署命令。src/api/*.js,除非所在模块已有直接 axios 风格。cockpit-dashboard.scss 的主题结构。src/themes/<name>.scss 与对应的 html[data-theme="<name>"] 样式块;不得修改已有主题(尤其 tech-blue)的变量与选择器来适配新主题。详见 .cursor/rules/theme-rules.mdc。.env 内容中的具体敏感值。.cursor/rules/project-rules.mdc:全项目通用规则、复用原则和生产安全底线。.cursor/rules/frontend-rules.mdc:Vue 2 前端、样式、请求、路由、状态、图表与大屏页面规则。.cursor/rules/theme-rules.mdc:多主题隔离规范;新增主题不得影响已有主题(尤其 tech-blue)。.cursor/rules/backend-rules.mdc:server/ 与 downLoadServer/ 的 Express、数据库、文件上传、图表导出与安全规则。