Commit 302372db authored by ZZH's avatar ZZH

fix hardware alarm set support mult lang 2024-06-04

parent 8236a17b
...@@ -93,7 +93,7 @@ async def post_point_alarm_setting(req, body: PointAlarmSettingRequest) \ ...@@ -93,7 +93,7 @@ async def post_point_alarm_setting(req, body: PointAlarmSettingRequest) \
etype_name = load_e_type_name(res.get("etype"), lang) etype_name = load_e_type_name(res.get("etype"), lang)
if item != "default": if item != "default":
item_lang = PHASE_LINE_LANG.get(item, {}).get(lang, "") item_lang = PHASE_LINE_LANG.get(item, {}).get(lang, "")
etype_name = f"{item_lang}{etype_name}" etype_name = f"{item_lang} {etype_name}"
else: else:
etype_name = f"{item}{name}" if item != "default" else name etype_name = f"{item}{name}" if item != "default" else name
alarm_setting = AlarmSetting( alarm_setting = AlarmSetting(
......
...@@ -260,14 +260,12 @@ async def load_aiao_max(user_id, cid, s_dts, e_dts, filed): ...@@ -260,14 +260,12 @@ async def load_aiao_max(user_id, cid, s_dts, e_dts, filed):
item_name = "漏电流" if datas['item'] == 'default' else datas['item'] item_name = "漏电流" if datas['item'] == 'default' else datas['item']
if lang != "zh_CN": if lang != "zh_CN":
item_name = PHASE_LINE_LANG.get(datas["item"], {}).get(lang, "") item_name = PHASE_LINE_LANG.get(datas["item"], {}).get(lang, "")
location_name = f"{mtr_name}_{item_name}"
loc_name = f"{mtr_name}_{item_name}" if item_name else mtr_name
occur_time = datas.get("value_max_time") occur_time = datas.get("value_max_time")
occur_time = str(occur_time) if occur_time else None occur_time = str(occur_time) if occur_time else None
return MaxResidualCurrent( return MaxResidualCurrent(max=value_max, location_name=loc_name,
max=value_max, occur_time=occur_time)
location_name=location_name,
occur_time=occur_time,
)
async def company_power_use_info(company_id, start, end): async def company_power_use_info(company_id, start, end):
......
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