Commit 794264b8 authored by ZZH's avatar ZZH

fix cid switch 2024-06-04

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