using TMPro; using UnityEngine; public class WarningInfoItem : MonoBehaviour { public GameObject[] warningLevel; public TextMeshProUGUI level;// 告警级别 public TextMeshProUGUI wangyuanName; // 网元名称 public TextMeshProUGUI wangyuanIP; // 网元IP public TextMeshProUGUI equipmentAlarmTime; // 设备告警时间 public TextMeshProUGUI clearStatus; // 清除状态 public TextMeshProUGUI dingweiDuixiangName; // 定位对象名称 public TextMeshProUGUI dingweiInfo; // 定位信息 public TextMeshProUGUI caijiFangshi; // 设备ID public TextMeshProUGUI laiYuan; // 来源 public TextMeshProUGUI Pod; // 设备ID public TextMeshProUGUI type; // 告警类型 public TextMeshProUGUI wangyuanType; // 网元类型 public TextMeshProUGUI caijiTime; // 采集时间 public TextMeshProUGUI deviceClearAlarmTime; // 设备清除告警时间 public TextMeshProUGUI targetObjectType; // 定位对象类型 public TextMeshProUGUI gongdanState; // 工单状态 public TextMeshProUGUI gaojingZhengwen; // 告警正文 public TextMeshProUGUI changjiaName; // 厂家名称 public TextMeshProUGUI wangyuanzileixing; // 网元子类型 public TextMeshProUGUI pingci; // 频次 public void Init(AlarmData AlarmData) { level.text = "--"; wangyuanName.text = "--"; wangyuanIP.text = "--"; equipmentAlarmTime.text = "--"; clearStatus.text = "--"; dingweiDuixiangName.text = "--";// 定位对象名称 dingweiInfo.text = "--"; caijiFangshi.text = "--"; laiYuan.text = "--"; Pod.text = "--"; type.text = "--"; // 告警类型 wangyuanType.text = "--"; caijiTime.text = "--"; deviceClearAlarmTime.text = "--"; targetObjectType.text = "--"; gongdanState.text = "--"; // 设备名称 gaojingZhengwen.text = "--"; changjiaName.text = "--"; wangyuanzileixing.text = "--"; pingci.text = "--"; if (!string.IsNullOrEmpty(AlarmData.level)) // 告警级别 { if (AlarmData.level == "重大告警") warningLevel[0].SetActive(true); else warningLevel[1].SetActive(true); level.text = AlarmData.level; } if (!string.IsNullOrEmpty(AlarmData.type)) // 告警类型 { type.text = AlarmData.type; } if (!string.IsNullOrEmpty(AlarmData.equipmentAlarmTime)) // 设备告警时间 { equipmentAlarmTime.text = AlarmData.equipmentAlarmTime; } if (!string.IsNullOrEmpty(AlarmData.deviceClearAlarmTime)) // 设备清除告警时间 { deviceClearAlarmTime.text = AlarmData.deviceClearAlarmTime; } if (!string.IsNullOrEmpty(AlarmData.clearStatus)) // 清除状态 { clearStatus.text = AlarmData.clearStatus; } if (!string.IsNullOrEmpty(AlarmData.targetObjectType)) // 定位对象类型 { targetObjectType.text = AlarmData.targetObjectType; } } }