|
|
@@ -0,0 +1,84 @@
|
|
|
+# CLAUDE.md
|
|
|
+
|
|
|
+This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
|
+
|
|
|
+## Project Overview
|
|
|
+
|
|
|
+webCRM (yos_manage) — 企业级 CRM 系统,面向工业阀门/设备行业。支持中/英/俄三语。使用微前端架构(micro-app)可独立部署,也可作为子应用嵌入。
|
|
|
+
|
|
|
+## Commands
|
|
|
+
|
|
|
+```bash
|
|
|
+npm run serve # 开发服务器 (端口 8000, 代理 /apis -> http://61.164.207.46:8000)
|
|
|
+npm run build # 生产构建,输出到 yos/ 目录,postbuild 自动生成 yos.zip
|
|
|
+npm run lint # ESLint 检查 (airbnb + vue/essential)
|
|
|
+npm run fix-memory-limit # 内存不足时使用,提升构建内存到 10GB
|
|
|
+```
|
|
|
+
|
|
|
+## Tech Stack
|
|
|
+
|
|
|
+- Vue 2.6 + Vue Router 3 (hash mode) + Vuex 3(单例 store,无模块化)
|
|
|
+- Element UI 2.15(主 UI 库)+ Ant Design Vue 1.7(仅 Steps/Table)
|
|
|
+- Vue CLI 5 + Webpack 5(filesystem cache),开发时可用 Vite 加速
|
|
|
+- Axios,vue-i18n,@antv/g2/g6,xlsx,dhtmlx-gantt,@wangeditor
|
|
|
+
|
|
|
+## Architecture
|
|
|
+
|
|
|
+### API 调用模式(RPC 风格)
|
|
|
+
|
|
|
+所有业务请求走同一个 `requested` 端点,通过 `classname` + `method` 分发:
|
|
|
+
|
|
|
+```js
|
|
|
+this.$api.requested({
|
|
|
+ classname: "webmanage.department.department",
|
|
|
+ method: "querydepartment",
|
|
|
+ content: {}
|
|
|
+})
|
|
|
+```
|
|
|
+
|
|
|
+全局通过 `Vue.prototype.$api` 访问,同理还有 `this.$tool`、`this.$basicData`、`this.$fileType`、`this.$upload`。
|
|
|
+
|
|
|
+请求拦截器自动注入 `accesstoken`(来自 sessionStorage)、`languagecode`、`systemappid`。响应 code 为 -1 时自动跳转登录页。
|
|
|
+
|
|
|
+### 路由结构
|
|
|
+
|
|
|
+路由按业务域拆分为 8 个模块文件,在 `src/router/index.js` 中合并:
|
|
|
+
|
|
|
+| 文件 | 业务域 |
|
|
|
+|------|--------|
|
|
|
+| `HManagement.js` | H端管理(营销、档案、部门、线索、任务、站点) |
|
|
|
+| `SManagement.js` | S端管理(公告、档案、订单线索、目标、销售预测) |
|
|
|
+| `HDrpManagement.js` | H端分销(客户、项目、竞品、合同、订单、发票、物流、财务) |
|
|
|
+| `SDrpManagement.js` | S端分销(报价、订单、客户、发票、物流) |
|
|
|
+| `WebsiteManagement.js` | 网站管理(咨询、案例、服务预约) |
|
|
|
+| `optionSystem.js` | 选型系统(节流件、阀门) |
|
|
|
+| `bgj.js` | 服务平台(工单、服务物料、预约、质保、积分) |
|
|
|
+| `AIManagement.js` | AI 管理(知识库) |
|
|
|
+
|
|
|
+### 全局注册组件
|
|
|
+
|
|
|
+17 个布局/模板组件在 `main.js` 全局注册,各页面直接使用无需 import:
|
|
|
+`tableLayout`, `tableNewLayout`, `tableMainLayout`, `tableDetailLayout`, `tableDetail`, `basicLayout`, `basicDetails`, `normalLayout`, `deleteBtn`, `btnDelete`, `customBtn`, `selectTemp`, `treeTable`, `confirmSelection`, `popoverTemp`, `sort`, `tagPanl`
|
|
|
+
|
|
|
+### 关键工具函数 (`src/utils/tool.js`)
|
|
|
+
|
|
|
+- `checkAuth(moduleid)` — 权限校验
|
|
|
+- `tabelCol(tablename)` — 获取表格列配置
|
|
|
+- `getBaseUrl()` — 动态获取 API 基础 URL
|
|
|
+- `exportExcel()` — Excel 导出
|
|
|
+- `createMenu()` — 省/市/区三级联动数据
|
|
|
+
|
|
|
+### Vuex Store
|
|
|
+
|
|
|
+单例扁平 store(`src/store/index.js`),无模块化。`statusColorList` 包含 60+ 条 CRM 状态颜色映射。`activeApp` 切换时持久化到 sessionStorage。
|
|
|
+
|
|
|
+## Coding Conventions
|
|
|
+
|
|
|
+- **UI 框架:** 只用 Element UI,不用其他 UI 库
|
|
|
+- **Vue 版本:** Vue 2 语法(Options API),不要用 Vue 3 Composition API
|
|
|
+- **路径别名:** `@/*` 映射到 `src/*`
|
|
|
+- **换行符:** LF(`.gitattributes` 已配置,`core.autocrlf=input`)
|
|
|
+- **按钮 loading:** 编辑/新建/删除等确定操作按钮必须加 `:loading` 防重复提交,成功后延时 500ms 关闭
|
|
|
+- **状态变更操作:** 启用/停用等开关操作需先弹 `this.$confirm` 确认框
|
|
|
+- **i18n:** 页面中使用 `this.$t('key')` 做国际化,翻译数据从 API 动态加载
|
|
|
+- **浏览器兼容:** Chrome/Edge/Firefox >= 80,Safari >= 13
|