diff --git a/bj_power_mes/frontend/src/pages/EventLog.vue b/bj_power_mes/frontend/src/pages/EventLog.vue index f897224..c31f365 100644 --- a/bj_power_mes/frontend/src/pages/EventLog.vue +++ b/bj_power_mes/frontend/src/pages/EventLog.vue @@ -87,6 +87,8 @@ const EVENT_FAMILIES = [ { label: '角色', value: 'role.' }, { label: '权限', value: 'rbac.' }, { label: '物料档案', value: 'material.' }, + { label: '产品工艺', value: 'product.process.' }, + { label: '附件', value: 'attachment.' }, { label: '预警规则', value: 'alert.rule.' } ] // B3.4 对象类型筛选选项(与后端 entityType 写入值一致) @@ -107,6 +109,7 @@ const ENTITY_TYPES = [ { label: '权限', value: 'permission' }, { label: '物料', value: 'material' }, { label: '预警规则', value: 'alert_rule' }, + { label: '产品工艺', value: 'product_process' }, { label: '附件', value: 'attachment' } ] const FAMILY_LABEL = Object.fromEntries(EVENT_FAMILIES.map((f) => [f.value, f.label])) @@ -115,16 +118,27 @@ const FAMILY_TAG = { 'material.request.': 'warning', 'process.flow.': 'info', 'station.': 'info', 'plc.': 'danger', 'torque.': 'info', 'scan.': 'success', 'workpiece.': 'success', 'inspection.': 'warning', 'semi.': 'info', - 'user.': 'primary', 'role.': 'warning', 'rbac.': 'danger', 'material.': 'success', 'alert.rule.': 'info' + 'user.': 'primary', 'role.': 'warning', 'rbac.': 'danger', 'material.': 'success', 'alert.rule.': 'info', + 'product.process.': 'success', 'attachment.': 'info' } const ENTITY_LABEL = { work_order: '工单', material_request: '备料单', process_flow: '工艺', station: '工位', workpiece: '工件', torque: '拧紧', inspection: '检验', scan: '报工', daily_plan: '日排产', plc: '下发', semi: '半成品', - user: '账号', role: '角色', permission: '权限', material: '物料', alert_rule: '预警规则', attachment: '附件' + user: '账号', role: '角色', permission: '权限', material: '物料', alert_rule: '预警规则', product_process: '产品工艺', attachment: '附件' } +// 事件类型精确中文名:覆盖后端实际写入的全部 event_type(前缀+动作直译,用业务语言)。 +// 命中后优先于上面的族前缀映射,使「product.process.save」显示「保存产品工艺」而非仅「产品工艺」。 +const EVENT_TYPE_NAMES = { + 'product.process.save': '保存产品工艺', + 'product.process.delete': '删除产品工艺', + 'product.process.status': '产品工艺状态变更', + 'product.process.copy': '复制产品工艺', + 'attachment.upload': '上传附件' +} function familyName(evt) { + if (evt && EVENT_TYPE_NAMES[evt]) return EVENT_TYPE_NAMES[evt] const k = Object.keys(FAMILY_LABEL).find((p) => evt && evt.startsWith(p)) return k ? FAMILY_LABEL[k] : (evt || '-') } diff --git a/bj_power_mes/internal/handler/upload.go b/bj_power_mes/internal/handler/upload.go index e69c6c2..e5f5415 100644 --- a/bj_power_mes/internal/handler/upload.go +++ b/bj_power_mes/internal/handler/upload.go @@ -280,9 +280,17 @@ func serveUploadFile(w http.ResponseWriter, r *http.Request, dir, name string) { ct = "application/vnd.ms-excel" } w.Header().Set("Content-Type", ct) - // 统一强制下载(Content-Disposition: attachment):文件名按 RFC 5987 编码(中文安全), - // 浏览器直接下载不预览;/