{"is_fixed_template": false, "template_name": "dataTable", "template_doc": "## dataTable.html — 数据表格通用模板\n\n### 适用场景\n用于展示任何需要表格形式呈现的列表数据，如企业列表、设备列表、能耗记录、用户列表等。\n**表头列数完全动态**，根据 `TABLE_COLUMNS` 自动生成；分页、每页条数切换、页码跳转均由 JS 自动处理，无需手动生成 HTML。\n\n### 所需 JSON 数据格式\n\n```json\n{\n  \"page_title\": \"企业列表\",\n  \"data\": {\n    \"js_variables\": {\n      \"TABLE_TITLE\": \"企业列表\",\n      \"TABLE_COLUMNS\": [\n        { \"label\": \"企业名称\",   \"key\": \"enterprise_name\" },\n        { \"label\": \"行业类型\",   \"key\": \"industry_type\" },\n        { \"label\": \"法定代表人\", \"key\": \"legal_person\" },\n        { \"label\": \"联系电话\",   \"key\": \"contact_phone\" },\n        { \"label\": \"智能管理设备数\", \"key\": \"device_count\" },\n        { \"label\": \"在线设备数\", \"key\": \"online_device_count\" },\n        { \"label\": \"企业状态\",   \"key\": \"status\" }\n      ],\n      \"TABLE_ROWS_DATA\": [\n        {\n          \"enterprise_name\": \"测试企业A\",\n          \"industry_type\": \"制造业\",\n          \"legal_person\": \"张三\",\n          \"contact_phone\": \"13800000001\",\n          \"device_count\": 18,\n          \"online_device_count\": 18,\n          \"status\": \"正常\"\n        },\n        {\n          \"enterprise_name\": \"测试企业B\",\n          \"industry_type\": \"采矿业\",\n          \"legal_person\": \"李四\",\n          \"contact_phone\": \"13800000002\",\n          \"device_count\": 4,\n          \"online_device_count\": 4,\n          \"status\": \"正常\"\n        }\n      ],\n      \"DEFAULT_PAGE_SIZE\": 10\n    }\n  }\n}\n```\n\n### 字段说明\n\n| 字段 | 类型 | 说明 |\n|------|------|------|\n| TABLE_TITLE | 字符串 | 表格卡片标题 |\n| TABLE_COLUMNS | 数组 | 列定义，每个元素包含 `label`（表头显示文字）和 `key`（对应 TABLE_ROWS_DATA 中的字段名） |\n| TABLE_ROWS_DATA | 数组 | 所有数据行，每个元素是一个对象，字段名与 TABLE_COLUMNS 中的 key 对应 |\n| DEFAULT_PAGE_SIZE | 整数 | 默认每页显示条数，建议值：10、20、50、100 |\n\n### 关键规则\n\n1. **TABLE_COLUMNS 的 key 必须与 TABLE_ROWS_DATA 中的字段名完全一致**（区分大小写）\n2. **TABLE_ROWS_DATA 包含全部数据行**，分页由前端 JS 自动处理，无需手动截断\n3. **不需要**填写 TABLE_HEADERS、TABLE_ROWS、PAGE_BUTTONS 等 HTML 字符串，模板完全由 JS 动态生成\n4. 列数不限，JS 会根据 TABLE_COLUMNS 的长度自动生成对应数量的表头和单元格\n5. 如果某行某字段值为 null 或 undefined，自动显示为 `-`\n\n### 分页功能说明\n\n模板内置完整分页功能，无需额外配置：\n- 支持每页 10 / 20 / 50 / 100 条切换（下拉选择器）\n- 自动生成页码按钮（超过 7 页时显示省略号）\n- 支持输入页码直接跳转（按 Enter 确认）\n- 显示\"共 N 条，显示第 X–Y 条\"信息\n\n---\n", "rows": [{"rule_id": 1, "is_enabled": true, "fault_name": "电芯过压", "create_time": "2026-03-31 10:37:56", "action_advice": "预警：检查充电参数设置；告警：立即停止充电，排查 BMS 充电保护回路", "comparison_operator": ">", "critical_threshold": 14.8, "fault_code": "CELL_OV", "target_column": "voltage", "warning_threshold": 14.4, "root_cause": "充电器限压失效、BMS 充电截止逻辑异常"}, {"rule_id": 2, "is_enabled": true, "fault_name": "电芯欠压", "create_time": "2026-03-31 10:37:56", "action_advice": "预警：限制放电深度；告警：立即停止放电，检查单体容量及采样回路", "comparison_operator": "<", "critical_threshold": 11.5, "fault_code": "CELL_UV", "target_column": "voltage", "warning_threshold": 11.8, "root_cause": "过度放电、单体容量衰减严重、采样线接触不良"}, {"rule_id": 3, "is_enabled": true, "fault_name": "单体过温", "create_time": "2026-03-31 10:37:56", "action_advice": "预警：降低充放电功率，检查散热系统；告警：立即停机，启动散热，排查内短路风险", "comparison_operator": ">", "critical_threshold": 55.0, "fault_code": "CELL_OT", "target_column": "battery_temperature", "warning_threshold": 45.0, "root_cause": "散热不良、充放电倍率过高、环境温度过高、内部短路"}, {"rule_id": 4, "is_enabled": true, "fault_name": "组内温差过大", "create_time": "2026-03-31 10:37:56", "action_advice": "预警：检查散热风道是否堵塞；告警：停机检查，定位高温单体，排查内阻异常", "comparison_operator": ">", "critical_threshold": 10.0, "fault_code": "GROUP_TD", "target_column": "max_temp_diff", "warning_threshold": 5.0, "root_cause": "散热不均、局部热点、某节电池内阻异常偏高"}, {"rule_id": 5, "is_enabled": true, "fault_name": "单体电压一致性差", "create_time": "2026-03-31 10:37:56", "action_advice": "预警：记录离群单体，安排均衡充电；告警：停机检查，排查采样线及单体内短路", "comparison_operator": "<", "critical_threshold": -0.5, "fault_code": "CELL_VD", "target_column": "v_diff_from_avg", "warning_threshold": -0.3, "root_cause": "单体容量衰减不一致、内短路、BMS 采样线松动"}, {"rule_id": 6, "is_enabled": true, "fault_name": "单体内阻老化", "create_time": "2026-03-31 10:37:56", "action_advice": "预警：缩短维护周期，评估更换计划；告警：该单体建议退役，避免影响整组性能", "comparison_operator": ">", "critical_threshold": 0.5, "fault_code": "CELL_RI", "target_column": "res_deviation_rate", "warning_threshold": 0.3, "root_cause": "电池循环寿命耗尽、电解液干涸、极片腐蚀"}, {"rule_id": 7, "is_enabled": true, "fault_name": "深度放电风险", "create_time": "2026-03-31 10:37:56", "action_advice": "预警：限制放电，尽快补充电量；告警：立即停止放电，防止电池永久性损坏", "comparison_operator": "<", "critical_threshold": 10.0, "fault_code": "CELL_OD", "target_column": "soc", "warning_threshold": 15.0, "root_cause": "负载过大、SOC 估算偏差、长期搁置自放电"}, {"rule_id": 8, "is_enabled": true, "fault_name": "设备离线", "create_time": "2026-03-31 10:37:56", "action_advice": "检查网络连接及采集终端供电，确认设备是否正常运行", "comparison_operator": "=", "critical_threshold": null, "fault_code": "DEV_OFFLINE", "target_column": "connection_status", "warning_threshold": null, "root_cause": "网络中断、采集器故障、设备断电"}], "sql": "SELECT `rule_id`, `fault_code`, `fault_name`, `target_column`, `comparison_operator`, `warning_threshold`, `critical_threshold`, `root_cause`, `action_advice`, `is_enabled`, MAX(`create_time`) AS `create_time` FROM `单体电池告警规则` GROUP BY `rule_id`, `fault_code`, `fault_name`, `target_column`, `comparison_operator`, `warning_threshold`, `critical_threshold`, `root_cause`, `action_advice`, `is_enabled` ORDER BY `create_time` LIMIT 500"}