sync from WSL host via Gitea: align to origin/main

This commit is contained in:
2026-07-14 16:59:38 +08:00
parent 8865fb5aa7
commit 0b0daf4e66
153 changed files with 24711 additions and 37 deletions
@@ -0,0 +1 @@
{"type":"memory.recall.recorded","timestamp":"2026-05-14T03:42:55.739Z","query":"前端项目 工作目录 报表 交易列表","resultCount":1,"results":[{"path":"memory/2026-04-29.md","startLine":1,"endLine":27,"score":1}]}
@@ -0,0 +1,37 @@
{
"version": 1,
"updatedAt": "2026-05-14T03:42:55.739Z",
"entries": {
"memory:memory/2026-04-29.md:1:27": {
"key": "memory:memory/2026-04-29.md:1:27",
"path": "memory/2026-04-29.md",
"startLine": 1,
"endLine": 27,
"source": "memory",
"snippet": "# 2026-04-29 工作日志 ## cc-square 项目 — 报表页面迁移 & 鉴权 & 优化 ### 项目路径 - `cc-square`: `/home/yangxuan/Projects/WebstormProjects/cc-square` ### 核心文件(已迁移 / 修改) | 文件 | 说明 | |------|------| | `src/pages/report/index.vue` | 报表主页面,基于 RuoYi JSP 迁移,含 ECharts | | `src/pages/report/LoginModal.vue` | 登录模态框,支持 Key 登录和账号密码登录 | | `src/request/api/report.js` | 7 个报表 API 端点封装 | | `src/request/api/auth.js` | 登录/登出 API 封装 | | `src/styles/report.less` | 报表页面样式(含 ECharts 图表样式) | | `src/store/store.js` | 增加 `clearAuth` mutation、`logout` action | | `src/request/http.js` | 修复 `message.error` 未定义 + `out` action 不存在问题 | | `docs/report-dev-plan.md` | 开发方案文档(P0-P3 优先级规划) | | `docs/报表页面迁移.md` | 迁移主文档(含 7 个报表 API 清单 + 鉴权集成说明",
"recallCount": 1,
"dailyCount": 0,
"groundedCount": 0,
"totalScore": 1,
"maxScore": 1,
"firstRecalledAt": "2026-05-14T03:42:55.739Z",
"lastRecalledAt": "2026-05-14T03:42:55.739Z",
"queryHashes": [
"f38382667d09"
],
"recallDays": [
"2026-05-14"
],
"conceptTags": [
"cc-square",
"src/pages/report/index.vue",
"src/pages/report/loginmodal.vue",
"src/request/api/report.js",
"src/request/api/auth.js",
"登录/登出",
"src/styles/report.less",
"src/store/store.js"
]
}
}
}
+45
View File
@@ -0,0 +1,45 @@
# 2026-04-29 工作日志
## cc-square 项目 — 报表页面迁移 & 鉴权 & 优化
### 项目路径
- `cc-square`: `/home/yangxuan/Projects/WebstormProjects/cc-square`
### 核心文件(已迁移 / 修改)
| 文件 | 说明 |
|------|------|
| `src/pages/report/index.vue` | 报表主页面,基于 RuoYi JSP 迁移,含 ECharts |
| `src/pages/report/LoginModal.vue` | 登录模态框,支持 Key 登录和账号密码登录 |
| `src/request/api/report.js` | 7 个报表 API 端点封装 |
| `src/request/api/auth.js` | 登录/登出 API 封装 |
| `src/styles/report.less` | 报表页面样式(含 ECharts 图表样式) |
| `src/store/store.js` | 增加 `clearAuth` mutation、`logout` action |
| `src/request/http.js` | 修复 `message.error` 未定义 + `out` action 不存在问题 |
| `docs/report-dev-plan.md` | 开发方案文档(P0-P3 优先级规划) |
| `docs/报表页面迁移.md` | 迁移主文档(含 7 个报表 API 清单 + 鉴权集成说明等) |
### 已完成的工作
1. **报表页面迁移**: 将 RuoYi 的 JSP 报表页面(6 张 ECharts 图表)迁移到 Vue 3 + Vite,包含 7 个 API 端点接入
2. **页面鉴权**P0:
- 新增 `LoginModal.vue` 组件:弹窗式登录
- 两种登录方式:Key 登录(cc-square 原生机制)和账号密码登录(调用 RuoYi `/system/auth/login`
- 无 token → 弹登录框 → 登录后加载数据 → 取消返回首页
- 登录态通过 `store.state.token` 保持,API 请求自动携带 token
3. **http.js 修复**:
- 替换 `message.error()``console.error()`element-ui 不存在)
- 修复 `dispatch('out')``dispatch('logout')` + store 补齐该 action
4. **布局优化**: 三处 `<table>` 布局替换为 CSS Grid / Flexbox
- 页面头部 → Flexbox (`.header-layout`)
- overview 四卡片 → Grid 4列 (`.grid-4`, 响应式 2列→1列)
- insight 双列 → Grid 2列 (`.grid-2`)
- monthlyStats 三列 → Grid 3列 (`.grid-3`)
5. **开发方案文档**: 生成 `docs/report-dev-plan.md`
### 已知问题/待完成
- **P0 鉴权问题**: LoginModal 没有正常弹出(`hasToken: false` 但不显示模态框)。需要排查:
1. LoginModal 懒加载是否正常
2. `import()` 引用路径是否正确
3. Vuex store 注入是否在懒加载组件可用
- 待开发:P1 错误状态处理、骨架屏加载;P2 ECharts 按需导入;P3 响应式深适配
+6
View File
@@ -0,0 +1,6 @@
# 2026-05-13
## 交互偏好
- 用户要求在记录管理页面使用中文交互(全部提示文案、标签等用中文)
- 排序参数改用 `sortingFields` 数组格式
- `GET /wellness/contract-record/summary` 接口:列表页顶部展示统计概览(el-tag 标签条)
+64
View File
@@ -0,0 +1,64 @@
# 2026-05-14
## 工作范围约定
默认只关注以下两个前端项目,没有特殊说明不涉及其他:
1. **cc-square**`/home/yangxuan/Projects/WebstormProjects/cc-square`
2. **yudao-admin**`/home/yangxuan/Projects/WebstormProjects/yudao-ui-admin-vue3`
## 前端项目注册
记录了两个前端项目:
1. **yudao-admin**`/home/yangxuan/Projects/WebstormProjects/yudao-ui-admin-vue3`
- RuoYi / 若依体系后台管理项目(Vue 3)
2. **cc-squaretab 首页项目)**`/home/yangxuan/Projects/WebstormProjects/cc-square`
- 已有的报表页面迁移项目,详见 2026-04-29.md
## report 页面接口改造(2026-05-14
- **接口文档位置**: `/home/yangxuan/Projects/IdeaProjects/ruoyi-vue-pro/yudao-module-family/docs/财务报表-接口文档.md`
- **改造概要**: 按接口文档适配独立 DTO 接口
- 月度趋势 → 独立接口 `expense/trend/{year}`
- 交易类型排名 → 独立接口 `ranking/trade-type/{year}`
- 交易对方排名 → 独立接口 `ranking/counterparty/{year}`
- 月度详情 → 独立接口 `expense/month/{year}/{month}`
- **修改文件**:
- `src/request/api/report.js` — 新增 4 个接口函数
- `src/pages/report/index.vue` — 改造 import + 对应模块加载
- **改造文档**: `docs/report-api-refactor-plan.md`
- **报表页面目录**: `/home/yangxuan/Projects/WebstormProjects/cc-square/src/pages/report`
## cc-square 技术栈
- **版本**: 1.1.0
- **构建**: Vite 5
- **框架**: Vue 3 (vue-router 4, vuex 4)
- **UI**: @ant-design/icons-vue
- **网络**: axios 1.x, qs
- **图表**: echarts 6.x
- **样式**: less
- **插件**: @vitejs/plugin-vue, unplugin-vue-components, babel-plugin-import
- **优化**: rollup-plugin-external-globals, rollup-plugin-visualizer, terser
## yudao-admin 技术栈
- **版本**: 2026.01-snapshot
- **构建**: Vite 5.1.4, pnpm
- **框架**: Vue 3.5.12 (vue-router 4.4.5, pinia 2.1.7)
- **UI**: Element Plus 2.11.1 (@element-plus/icons-vue)
- **样式**: sass, unocss, postcss
- **语言**: TypeScript 5.3.3
- **国际化**: vue-i18n 9.10.2 (@intlify/unplugin-vue-i18n)
- **网络**: axios 1.9.0, qs
- **图表**: echarts 5.5.0 + echarts-wordcloud
- **流程**: bpmn-js 17.9.2, diagram-js, snabbdom
- **富文本**: @wangeditor-next/editor
- **表单设计**: @form-create/designer + element-ui
- **工具库**: @vueuse/core, dayjs, crypto-js, lodash-es, mitt, sortablejs, driver.js
- **其他**: video.js, cropperjs, qrcode, jsbarcode, jsoneditor, markmap (思维导图), dhtmlx-gantt (甘特图)
- **插件**: unplugin-auto-import, unplugin-vue-components, unplugin-element-plus, vite-plugin-svg-icons-ng, vite-plugin-compression, vite-plugin-top-level-await
- **工程建设**: eslint + stylelint + prettier + commitlint + lint-staged, husky + git hooks
- **要求**: node >= 16, pnpm >= 8.6
- **本地环境**: node v25.2.0, npm 11.6.2
+42
View File
@@ -0,0 +1,42 @@
# 2026-05-27 工作日志
## 今日工作
### 1. 🔄 首页退出登录入口改造
- 从明显的退出按钮 → 右上角 `⋯` 更多菜单
- 点击弹出 ActionSheet,选"退出登录"再确认
- 后续可扩展其他选项(个人设置等)
- **文件:** `pages/index/index.vue`
### 2. 🐛 物料选择器切换分类时已选物料清空
- **原因:** `loadMaterialList()` 从接口重新拉数据,`materialList` 被重建为初始值(`quantity: 0, price: 0`
- **修复:** `selectCategory` 切换前保存已选物料 → `_buildSavedMap` 在新列表加载后恢复
- 4 个页面统一修复:`purchase.vue`, `production.vue`, `material.vue`, `sales.vue`
- 额外恢复已选保存逻辑(因 HMR 替换丢失过一次,重新补回)
### 3. 💰 单价回填方案变更
- **最初方案:** localStorage 缓存 `lastPrice_purchase_{materialId}` / `lastPrice_sales_{materialId}`
- **修正方案:** `StockPageDTO` 接口原生带 `lastInboundPrice` / `lastOutboundPrice`,直接读接口字段
- 去掉 localStorage 缓存代码
- **文件:** `pages/inbound/purchase.vue`, `pages/outbound/sales.vue`
- 采购映射 `item.lastInboundPrice || 0`
- 销售映射 `item.lastOutboundPrice || 0`
### 4. 💰 单价必须校验
- `handleDirectSubmit` 加必填校验(采购/销售)
- 提交时如果某物料单价为空 → Toast 提示 + 阻止提交
### 5. 工具/环境
- 项目路径:`/mnt/d/Projects/HBuilderProjects/erp-app/`
- 使用 sed/node 处理 CRLF 换行问题(WSL 挂载的 Windows 文件系统)
- HMR 热更新后有时需要手动 F5 刷新
## 重要决策
- **单价来源:** 优先使用接口返回数据,避免客户端缓存不一致
- `StockPageDTO.lastInboundPrice` → 采购入库上次单价
- `StockPageDTO.lastOutboundPrice` → 销售出库上次单价
- 生产入库/领料出库无单价需求,保持原样
## 未完成 / 待验证
- HBuilderX 运行测试以上所有改动
- H5 浏览器验证分类切换 + 单价回填 + 提交校验
+64
View File
@@ -0,0 +1,64 @@
# 2026-05-28 记录
## 关爱模式(Care Mode)开发日志
### 已完成
#### 基础设施
- [x] `stores/careMode.js` — Pinia storestate 含 enabledaction 含 toggle/enable/disable/restore,持久化到 uni.setStorageSync
- [x] JS 注入 CSS 变量方案:store `_syncRootClass()``document.documentElement.style.setProperty()` 逐条注入 px 值,绕过 uni-app H5 编译 rpx 问题
- [x] `restore()``App.vue onLaunch` 调用,加载持久化状态并同步 DOM
- [x] `uni.scss` 重构:`:root` 为基础变量,`:root.care-mode` 为 1.5x 覆盖;去掉了 `page` 选择器防止继承链断裂
- [x] 常量 `NORMAL_VARS` / `CARE_VARS` 定义在模块顶层,含完整 CSS 变量集(font-size, spacing, color, btn-min-height, input-height, border-radius 等)
- [x] 辅助函数 `getRpxRatio()` (screenWidth / 750) 和 `buildPxVars()` 动态转 px
- [x] `uni.scss` 中所有 H5 CSS 变量值用 px(非 rpx),因浏览器不认 rpx 作为 CSS 变量值
- [x] 调试用全局函数 `__toggleCareMode()` 挂载到 window,可在 console 直接调用
- [x] `stores/index.js` 中 export careMode
- [x] 登录按钮使用 computed `buttonStyle`(因 `u-button` `custom-style` 不支持 CSS 变量)
#### 登录页 (`pages/login/login.vue`)
- [x] 所有硬编码样式 -> `var(--xxx)` 替换(~11 处)
- [x] 登录按钮 width 使用 `buttonWidth: '80%'`(不变),font-size/input-height 通过 CSS 变量控制
#### 首页 (`pages/index/index.vue`)
- [x] 53 处 `var(--)` 替换
- [x] `showMoreActions()` 使用 ActionSheet:两选项「开启/关闭关爱模式」「退出登录」
- [x] 文字描述全部 1.5x 显示
#### 入库出库选器改造(4 个文件)
- [x] `pages/inbound/production.vue` — 68 处 CSS 变量,生产入库(无价格逻辑)
- [x] `pages/inbound/purchase.vue` — 90 处 CSS 变量,采购入库(含价格/金额/供应商选器)
- [x] `pages/outbound/material.vue` — 68 处 CSS 变量,领料出库(无价格逻辑)
- [x] `pages/outbound/sales.vue` — 93 处 CSS 变量,销售出库(含价格/金额/客户选器)
### 技术决策
- **CSS class → JS 注入转换**:因 `:root.care-mode` 在 uni-app H5 编译后 `page` 元素阻断了继承链,改用 JS 对 `document.documentElement.style.setProperty()` 直接注入
- **删除 `uni.scss``page` 选择器**`page` 作为中间元素接收 CSS 变量但不会传递给子元素,导致页面 `var(--)` 都落在 fallback
- **1.5x 缩放系数**:用户指定的比值;`CARE_VARS = NORMAL_VARS × 1.5`
- **`u-button` custom-style 不支持 CSS 变量**:改用 computed 返回样式对象
### 待办
- [ ] 7 个已回滚页面需要重新 CSS 变量改造(首页和 4 个选器已重做完成,仍需检查 stocktake, inventory 等)
- [ ] 检查 `/pages/inbound/history`, `/pages/inventory/inventory`, `/pages/inventory/stock`, `/pages/supplier/index`, `/pages/supplier/supplierDetail`, `/pages/outbound/history`, `/pages/inventory/warehouse` 是否需要 Care Mode 支持
- [ ] 添加其他页面的 manual toggle 入口(actionSheet
- [ ] 小程序 `<page-meta>` 支持(未来事项)
### 当前焦点
用户已确认登录页 OK,首页改造完成,4 个入库出库选器改造完成。等待用户反馈看 H5 效果,再决定下一步。
#### 入库出库历史记录(2 个文件)
- [x] `pages/inbound/history.vue` — 67 处 CSS 变量,含搜索、卡片列表、撤销按钮、空状态
- [x] `pages/outbound/history.vue` — 66 处 CSS 变量,含客户/价格/金额展示
#### 库存与安全库存(2 个文件)
- [x] `pages/inventory/index.vue` — 42 处 CSS 变量,含搜索、分类筛选、库存卡片、低库存 tag
- [x] `pages/inventory/safe-stock.vue` — 30 处 CSS 变量,含信息卡片、表单输入、保存/删除按钮
#### 库存盘点(2 个文件)
- [x] `pages/stocktake/index.vue` — 75 处 CSS 变量,含搜索、分类筛选、盘点卡片、实盘输入、底部操作栏
- [x] `pages/stocktake/history.vue` — 60 处 CSS 变量,含时间筛选 tabs、历史卡片、空状态
### 未检查页面(待确认是否需要 Care Mode 支持)
- `/pages/inventory/stock` (不存在)
- `/pages/inventory/warehouse` (不存在)
- `/pages/supplier/index`
- `/pages/supplier/supplierDetail`
+86
View File
@@ -0,0 +1,86 @@
# ERP 后端接口文档参考
> 来源:`http://localhost:8081/erp/v3/api-docs`Swagger OpenAPI 3.0
> 更新日期:2026-05-27
## 基础路径
```
http://localhost:8081/erp
```
## 通用响应结构
```json
{
"code": 200,
"message": "操作成功",
"data": {}
}
```
## 关键 DTO 字段
### StockPageDTO — 库存/物料选择器返回结构
用于接口:`/im/inbound/material-selector``/im/outbound/material-selector`
```json
{
"id": "int64",
"warehouseId": "int64",
"warehouseName": "string",
"materialId": "int64",
"materialCode": "string",
"materialName": "string",
"spec": "string",
"unit": "string",
"categoryId": "int64",
"categoryName": "string",
"materialType": "string",
"materialTypeName": "string",
"quantity": "number", // ← 库存数量(关键字段!)
"minSafeQty": "number", // 安全库存
"isLowStock": "boolean" // 是否低库存预警
}
```
### MaterialPageDTO — 物料分页返回结构
接口:`/md/material/page`
```json
{
"id": "int64",
"materialCode": "string",
"materialName": "string",
"spec": "string",
"unit": "string",
"categoryId": "int64",
"categoryName": "string",
"materialType": "string",
"materialTypeName": "string",
"stockQty": "number", // ← 库存数量(这里的字段名不一样!)
"price": "number",
"status": "int32",
"remark": "string"
}
```
## 前端字段映射对照
| 场景 | 接口 | 库存字段 |
|------|------|---------|
| 物料选择器(入库/出库) | `/im/*/material-selector` | `quantity` |
| 库存列表页面 | `/im/stock/page` | `quantity` |
| 物料管理分页 | `/md/material/page` | `stockQty` |
| 安全库存设置 | `/im/stock/safe-qty` | `minSafeQty` |
## 涉及改动的页面
- `pages/inbound/production.vue` — 生产入库物料选择
- `pages/inbound/purchase.vue` — 采购入库物料选择
- `pages/outbound/material.vue` — 领料出库物料选择
- `pages/outbound/sales.vue` — 销售出库物料选择
以上 4 个页面库存字段已统一改为 `item.quantity`