Commit 835f83a5 authored by 麻笑宇's avatar 麻笑宇

fix(statistics): 修复统计模块单位类型枚举的值和键的映射关系

修改了 UnitTypeEnum 类中生成 JSON 数组的代码,将枚举值(value)和键(key)的映射关系进行了调整: - 将 value 字段的值从 code改为 name - 保持 key 字段的值为 code 这一修改确保了枚举类型的正确映射,解决了可能存在的映射错误问题。
parent 90cfc32e
...@@ -43,7 +43,7 @@ public enum UnitTypeEnum { ...@@ -43,7 +43,7 @@ public enum UnitTypeEnum {
for (UnitTypeEnum e : UnitTypeEnum.values()) { for (UnitTypeEnum e : UnitTypeEnum.values()) {
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("label",e.name); jsonObject.put("label",e.name);
jsonObject.put("value",e.code); jsonObject.put("value",e.name);
jsonObject.put("key",e.code); jsonObject.put("key",e.code);
jsonArray.add(jsonObject); jsonArray.add(jsonObject);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment