Commit 794264b8 authored by ZZH's avatar ZZH

fix cid switch 2024-06-04

parent fa34ba33
...@@ -277,8 +277,9 @@ async def pack_alarm_records(records, pid, lang): ...@@ -277,8 +277,9 @@ async def pack_alarm_records(records, pid, lang):
event_msg = r.get("message") event_msg = r.get("message")
phase_line = load_phase_line(mtr_name, lang) phase_line = load_phase_line(mtr_name, lang)
name = mtr_names[r["mtid"]] name = mtr_names.get([r["mtid"]])
mtr_name = f"{name}{phase_line}" if phase_line else name if name:
mtr_name = f"{name}{phase_line}" if phase_line else name
alarm = Alarm( alarm = Alarm(
name=mtr_name, name=mtr_name,
......
...@@ -252,7 +252,7 @@ async def load_aiao_max(user_id, cid, s_dts, e_dts, filed): ...@@ -252,7 +252,7 @@ async def load_aiao_max(user_id, cid, s_dts, e_dts, filed):
mtid = datas["mtid"] mtid = datas["mtid"]
if lang != "zh_CN": if lang != "zh_CN":
mtr_names = await load_monitor_names([mtid], lang) mtr_names = await load_monitor_names([mtid], lang)
mtr_name = mtr_names[mtid] mtr_name = mtr_names.get(mtid) or datas["name"]
else: else:
mtr_name = datas["name"] mtr_name = datas["name"]
......
...@@ -199,7 +199,7 @@ async def load_hardware_info(cid, pg, pg_size, user_id): ...@@ -199,7 +199,7 @@ async def load_hardware_info(cid, pg, pg_size, user_id):
) )
wiring_type = "两表法" if data["ctnum"] == 2 else "三表法" wiring_type = "两表法" if data["ctnum"] == 2 else "三表法"
name = data.get("name") or '' name = data.get("name") or ''
mtr_name = name if lang == "zh_CN" else mtr_names.get(mtid, "") mtr_name = name if lang == "zh_CN" else mtr_names.get(mtid, name)
results.append({ results.append({
"installed_location": mtr_name, "installed_location": mtr_name,
"device_number": data.get("sid") or '', "device_number": data.get("sid") or '',
......
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