feat: 全端体验与稳定性整改(帮助文档清理/收集式报错/操作列统一/托盘与WS通知/物料同步重推)

- 移除 bj_power_dashboard 旧 React 大屏源码(迁移至 2D SVG 方案)
- MES/WMS/工位终端前端:清理 help.js 与 PageHelp 帮助文档,统一操作列与布局,接入请求拦截器
- 新增收集式校验错误弹窗(ErrorListDialog 统一拦截 3015,逐条列现象+建议)
- 新增托盘程序(tray)与 WebSocket(ws) 实时通知模块(三端共用)
- MES/WMS 物料档案新增同步状态字段,补齐双向失败重推与默认角色 seed
- 工单/产能/产品工艺/日排产逻辑调整;拧紧枪按工位配置
- 新增迁移 SQL:扭矩按工位、sysconfig 序列修复
- 更新 技术约束/案例/部署手册/项目说明 等文档
This commit is contained in:
SunYF
2026-11-10 23:42:50 +08:00
parent af554cea75
commit 619fc8983d
219 changed files with 8565 additions and 10739 deletions
+44
View File
@@ -87,6 +87,50 @@ func sendExcel(w http.ResponseWriter, filename string, headers []string, rows []
_, _ = w.Write(buf.Bytes())
}
// sendExcelWithGuide 生成带「填写说明」页的导入模板(2026-11-10:与 MES 模板对齐,含示例行+字段说明)。
// 数据页仍用 buildXlsx,额外追加一个说明 sheet;导入端只读第一个 sheet,说明页不影响解析。
func sendExcelWithGuide(w http.ResponseWriter, filename string, headers []string, rows [][]any, guides []string) {
buf, err := buildXlsx(headers, rows)
if err != nil {
fail(w, http.StatusInternalServerError, "生成 Excel 失败: "+err.Error())
return
}
f, err := excelize.OpenReader(bytes.NewReader(buf.Bytes()))
if err != nil {
fail(w, http.StatusInternalServerError, "生成 Excel 说明页失败: "+err.Error())
return
}
defer f.Close()
if _, err = f.NewSheet("填写说明"); err != nil {
fail(w, http.StatusInternalServerError, "生成 Excel 说明页失败: "+err.Error())
return
}
for i, g := range guides {
cell, _ := excelize.CoordinatesToCellName(1, i+1)
_ = f.SetCellValue("填写说明", cell, g)
}
_ = f.SetColWidth("填写说明", "A", "A", 110)
out, err := f.WriteToBuffer()
if err != nil {
fail(w, http.StatusInternalServerError, "生成 Excel 失败: "+err.Error())
return
}
asciiName := "export.xlsx"
encName := ""
if utf8.ValidString(filename) {
encName = "filename*=UTF-8''" + url.QueryEscape(filename)
}
w.Header().Set("Content-Type", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
cd := fmt.Sprintf("attachment; filename=\"%s\"", asciiName)
if encName != "" {
cd += "; " + encName
}
w.Header().Set("Content-Disposition", cd)
w.Header().Set("X-Excel-Filename", url.QueryEscape(filename))
w.WriteHeader(http.StatusOK)
_, _ = w.Write(out.Bytes())
}
// buildXlsx 生成 xlsx 字节流(含表头样式、列宽自适应)
func buildXlsx(headers []string, rows [][]any) (*bytes.Buffer, error) {
f := excelize.NewFile()