- 新增 PayRoll(工资)、Wms(仓储)、Prod(车速/缫丝/考勤/丝片检测/丝片台账/纤检日报/质量日报) 模块 - 新增对应 Domain 实体、Application DTO/Service、Api Controller 与前端页面 - 移除旧 Attendance 考勤模块(Controller/Service/Entity/DTO 及 5 个前端页面),由 Prod/Kaoqin 取代 - 调整路由、仪表盘、Lsjl 流丝记录实体与服务 - 更新业务种子数据与 DbSeeder - 补充工作进度文档 14-27
79 lines
4.3 KiB
Markdown
79 lines
4.3 KiB
Markdown
# 工作进度-24:重启前后端 + 修复「报表设计管理器」打不开
|
||
|
||
> **协作规则(长期生效)**:**每次对话结尾都要生成工作进度**。
|
||
> 即在每轮对话结束前,把本轮完成的内容追加为 `工作进度/工作进度-N.md`,并在文档中保留本条规则,方便下一轮接续。
|
||
|
||
## 一、重启前后端 ✅
|
||
|
||
| 服务 | 端口 | 重启后 PID |
|
||
| --- | --- | --- |
|
||
| 后端 `F9WebAiTest.Api` | 3000 | 26028 |
|
||
| 前端 vite | 5173 | 25640 |
|
||
|
||
(复用 22 轮方法:按端口定位 PID → `Stop-Process` → `dotnet run` + node 完整路径启动 vite。
|
||
npm/node 不在 PATH,必须用 `C:\Users\32453\.workbuddy\binaries\node\versions\22.22.2-6\node.exe`。)
|
||
|
||
## 二、报表设计管理器:根因与修复 ✅
|
||
|
||
### 调用链
|
||
|
||
```
|
||
报表管理中心 views/report/manage/index.vue 点列表行「设计」
|
||
→ openDesign(row):designOnOpen=true、selectedId=row.id、designerKey++
|
||
→ components/report/ReportEditor.vue 的 init() 末尾:
|
||
if (props.openDesign && savedId.value) designVisible.value = true;
|
||
→ 全屏 el-dialog 渲染 components/report/ReportDesign.vue(v-if="designVisible && savedId")
|
||
→ ReportDesign 内「用本机锐浪 7 设计器编辑」按钮 → openGridDesigner()
|
||
window.location.href = 'f9designer://open?base=..&rid=..&token=..&code=..'
|
||
```
|
||
|
||
### 根因(实测逐层排查得出)
|
||
|
||
| 环节 | 实测结果 |
|
||
| --- | --- |
|
||
| `f9designer://` 协议注册 | ✅ **已注册**(`HKCR\f9designer`,含 `URL Protocol`) |
|
||
| 协议 command | `powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -File "D:\f9webaitest\f9-web-ai-test\tools\report-designer\F9ReportDesignerHandler.ps1" "%1"` |
|
||
| **该宿主脚本** | ❌ **不存在**(`tools\report-designer\` 整个目录都没有)→ **根因** |
|
||
| 锐浪设计器 `gr7designer64.exe` | ✅ 已安装:`D:\GridReport7\gr7designer64.exe` |
|
||
| 后端接口 | ✅ 齐全(见下) |
|
||
|
||
因为用了 `-WindowStyle Hidden`,powershell 启动失败时**没有任何提示** → 用户看到的就是"点了没反应/打不开"。
|
||
|
||
> 修正:此前 24 轮初稿判断"项目内没有配套协议注册文件"不准确 —— 协议已注册,
|
||
> 缺的只是被协议指向的那个**宿主脚本**(属于应入库但漏掉的资产)。
|
||
|
||
### 后端接口(脚本依赖)
|
||
|
||
| 用途 | 接口 | 说明 |
|
||
| --- | --- | --- |
|
||
| 下载模板 | `GET /api/sys/report/{id}/template?access_token={token}` | `[AllowAnonymous]`,token 走 query;另有 `.grf` / `.json` 别名 |
|
||
| 上传模板 | `POST /api/sys/report/{id}/template` | `IFormFile` 参数名 **`file`**;注释明确"保留给 f9designer:// 协议回传使用" |
|
||
|
||
### 修复:新建宿主脚本
|
||
|
||
`tools/report-designer/F9ReportDesignerHandler.ps1`(4434 字节,PowerShell 语法检查通过):
|
||
|
||
1. 解析 `f9designer://open?base=&rid=&token=&code=`(URL 解码)
|
||
2. 定位设计器:默认 `D:\GridReport7\gr7designer64.exe`,可用环境变量 `F9_GR7_DESIGNER` 覆盖
|
||
3. 下载模板到 `%TEMP%`(下载失败则建空白模板,兼容"新报表无模板")
|
||
4. `Start-Process -Wait` 打开设计器并**阻塞等待关闭**
|
||
5. 关闭后用 `System.Net.Http.MultipartFormDataContent` 上传(带 `Authorization: Bearer`)
|
||
6. 全程写日志 `tools/report-designer/logs/designer_yyyyMMdd.log`
|
||
|
||
> 兼容性说明:用 .NET `HttpClient` 手工构造 multipart,而不是 PowerShell 7 的 `-Form`,
|
||
> 因为注册表里调用的是 `powershell.exe`(Windows PowerShell 5.1 不支持 `-Form`)。
|
||
|
||
### 待用户验证
|
||
|
||
在报表中心点「设计」→「用本机锐浪 7 设计器编辑」,应弹出锐浪设计器;关闭后模板自动回传。
|
||
若仍无反应,看 `tools/report-designer/logs/designer_yyyyMMdd.log`。
|
||
|
||
## 三、下次接续提示
|
||
|
||
- 报表相关文件:`views/report/manage/index.vue`、`views/report/center/index.vue`、
|
||
`components/report/ReportEditor.vue`、`components/report/ReportDesign.vue`、`utils/gridreport/*`、
|
||
后端 `Services/Reports/ReportService.cs` + `Controllers/SysReportController.cs`
|
||
- 设计面板打开前提:报表**必须已保存**(`v-if="designVisible && savedId"`),未保存的报表点了无反应
|
||
- 设计面板有两条路径:① 可视化画布(纯前端、无外部依赖)② 本机锐浪设计器(需本协议链)
|
||
- **每轮对话结尾记得生成本工作进度文档**
|