DeviceDetailsControl.cs 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. using UnityEngine.UI;
  2. using Blue;
  3. using GHZLangChao;
  4. using TMPro;
  5. using System.Collections.Generic;
  6. using UnityEngine;
  7. /// <summary>
  8. /// 设备信息控制面板
  9. /// </summary>
  10. public class DeviceDetailsControl : AbstractController
  11. {
  12. //public Text deviceId; // 设备ID
  13. //public Text deviceName; // 设备名称
  14. public TextMeshProUGUI deviceModel; // 设备型号
  15. public TextMeshProUGUI deviceType; // 设备类型
  16. public TextMeshProUGUI assetTagNumber; // 资产标签号
  17. public TextMeshProUGUI serialNumber; // 序列号
  18. public TextMeshProUGUI equipmentNumber; // 设备编码
  19. public TextMeshProUGUI assetStatus; // 资产状态
  20. public TextMeshProUGUI deviceStatus; // 设备状态
  21. public TextMeshProUGUI deliveryData; // 交付日期
  22. public TextMeshProUGUI enabledDate; // 启用日期
  23. public TextMeshProUGUI serverUsageType; // 服务器使用类型
  24. public TextMeshProUGUI typicalModel; // 典配模型
  25. public TextMeshProUGUI equipmentBrand; // 设备品牌
  26. public TextMeshProUGUI manufacturer; // 生产厂商
  27. public TextMeshProUGUI equipmentWeight; // 设备重量(KG)
  28. public TextMeshProUGUI equipmentPower; // 设备功率(W)
  29. public TextMeshProUGUI originType; // 产地类型
  30. public TextMeshProUGUI collectionCPName; // 集采目录产品名称
  31. public TextMeshProUGUI resourcePool; // 所在资源池
  32. public TextMeshProUGUI wherePOD; // 所在POD
  33. public TextMeshProUGUI networkDomain; // 所在网络域
  34. public TextMeshProUGUI city; // 所在城市
  35. public TextMeshProUGUI building; // 所在楼宇
  36. public TextMeshProUGUI floor; // 所在楼层
  37. public TextMeshProUGUI computerRoomName; // 所在机房名称
  38. public TextMeshProUGUI computerRoomCoding; // 所在机房编码
  39. public TextMeshProUGUI cabinetNumber; // 机柜编号
  40. public TextMeshProUGUI uMessage; // U位信息
  41. public TextMeshProUGUI deviceOrientation; // 设备朝向
  42. public TextMeshProUGUI manageIP; // 管理IP
  43. public TextMeshProUGUI saveIP; // 存储IP
  44. public TextMeshProUGUI iPMIIP; // IPMIP
  45. public TextMeshProUGUI businessIP; // 业务IP
  46. public TextMeshProUGUI projectName; // 项目名称
  47. public TextMeshProUGUI equipmentSupplier; // 设备供货商
  48. public TextMeshProUGUI assetOwner; // 资产责任人
  49. public TextMeshProUGUI territorialPAManager; // 属地省资产负责人
  50. public TextMeshProUGUI equipmentBTTOrganization; // 设备归属组织
  51. public TextMeshProUGUI facilityManagementOrganization; // 设备管理组织
  52. public TextMeshProUGUI equipmentMaintenanceOrganization; // 设备维护组织
  53. public TextMeshProUGUI businessSystem; // 业务系统
  54. public DataItem item;
  55. public void UpdateData(DeviceParameters DeviceParameter, DataItem item)
  56. {
  57. this.item = item;
  58. if (item != null)
  59. item.gameObject.SetActive(false);
  60. //deviceId.text = DeviceParameter.deviceId.ToString();
  61. //deviceName.text = DeviceParameter.deviceName;
  62. if (string.IsNullOrEmpty(DeviceParameter.deviceModel))
  63. deviceModel.text = "--";
  64. else
  65. deviceModel.text = DeviceParameter.deviceModel;
  66. if (string.IsNullOrEmpty(DeviceParameter.assetNumber))
  67. assetTagNumber.text = "--";
  68. else
  69. assetTagNumber.text = DeviceParameter.assetNumber;
  70. if (string.IsNullOrEmpty(DeviceParameter.serialNumber))
  71. serialNumber.text = "--";
  72. else
  73. serialNumber.text = DeviceParameter.serialNumber;
  74. if (string.IsNullOrEmpty(DeviceParameter.deviceNumber))
  75. equipmentNumber.text = "--";
  76. else
  77. equipmentNumber.text = DeviceParameter.deviceNumber;
  78. if (string.IsNullOrEmpty(DeviceParameter.assetStatus))
  79. assetStatus.text = "--";
  80. else
  81. assetStatus.text = DeviceParameter.assetStatus;
  82. if (string.IsNullOrEmpty(DeviceParameter.deviceStatus))
  83. deviceStatus.text = "--";
  84. else
  85. deviceStatus.text = DeviceParameter.deviceStatus;
  86. if (string.IsNullOrEmpty(DeviceParameter.deliveryDate))
  87. deliveryData.text = "--";
  88. else
  89. deliveryData.text = DeviceParameter.deliveryDate;
  90. if (string.IsNullOrEmpty(DeviceParameter.activationDate))
  91. enabledDate.text = "--";
  92. else
  93. enabledDate.text = DeviceParameter.activationDate;
  94. if (string.IsNullOrEmpty(DeviceParameter.serverUsageType))
  95. serverUsageType.text = "--";
  96. else
  97. serverUsageType.text = DeviceParameter.serverUsageType;
  98. if (string.IsNullOrEmpty(DeviceParameter.typical))
  99. typicalModel.text = "--";
  100. else
  101. typicalModel.text = DeviceParameter.typical;
  102. if (string.IsNullOrEmpty(DeviceParameter.deviceNumber))
  103. equipmentBrand.text = "--";
  104. else
  105. equipmentBrand.text = DeviceParameter.deviceNumber;
  106. if (string.IsNullOrEmpty(DeviceParameter.manufacturer))
  107. manufacturer.text = "--";
  108. else
  109. manufacturer.text = DeviceParameter.manufacturer;
  110. if (string.IsNullOrEmpty(DeviceParameter.eight))
  111. equipmentWeight.text = "--";
  112. else
  113. equipmentWeight.text = DeviceParameter.eight;
  114. if (string.IsNullOrEmpty(DeviceParameter.power))
  115. equipmentPower.text = "--";
  116. else
  117. equipmentPower.text = DeviceParameter.power;
  118. if (string.IsNullOrEmpty(DeviceParameter.origin))
  119. originType.text = "--";
  120. else
  121. originType.text = DeviceParameter.origin;
  122. if (string.IsNullOrEmpty(DeviceParameter.catalogProductName))
  123. collectionCPName.text = "--";
  124. else
  125. collectionCPName.text = DeviceParameter.catalogProductName;
  126. if (string.IsNullOrEmpty(DeviceParameter.resourcePool))
  127. resourcePool.text = "--";
  128. else
  129. resourcePool.text = DeviceParameter.resourcePool;
  130. if (string.IsNullOrEmpty(DeviceParameter.pod))
  131. wherePOD.text = "--";
  132. else
  133. wherePOD.text = DeviceParameter.pod;
  134. if (string.IsNullOrEmpty(DeviceParameter.network))
  135. networkDomain.text = "--";
  136. else
  137. networkDomain.text = DeviceParameter.network;
  138. if (string.IsNullOrEmpty(DeviceParameter.province))
  139. city.text = "--";
  140. else
  141. city.text = DeviceParameter.province;
  142. if (string.IsNullOrEmpty(DeviceParameter.building))
  143. building.text = "--";
  144. else
  145. building.text = DeviceParameter.building;
  146. if (string.IsNullOrEmpty(DeviceParameter.floor))
  147. floor.text = "--";
  148. else
  149. floor.text = DeviceParameter.floor;
  150. if (string.IsNullOrEmpty(DeviceParameter.engineRoomName))
  151. computerRoomName.text = "--";
  152. else
  153. computerRoomName.text = DeviceParameter.engineRoomName;
  154. if (string.IsNullOrEmpty(DeviceParameter.cabinetNumber))
  155. cabinetNumber.text = "--";
  156. else
  157. cabinetNumber.text = DeviceParameter.cabinetNumber;
  158. if (string.IsNullOrEmpty(DeviceParameter.u))
  159. uMessage.text = "--";
  160. else
  161. uMessage.text = DeviceParameter.u;
  162. if (string.IsNullOrEmpty(DeviceParameter.deviceOrientation))
  163. deviceOrientation.text = "--";
  164. else
  165. deviceOrientation.text = DeviceParameter.deviceOrientation;
  166. if (string.IsNullOrEmpty(DeviceParameter.managementIP))
  167. manageIP.text = "--";
  168. else
  169. manageIP.text = DeviceParameter.managementIP;
  170. if (string.IsNullOrEmpty(DeviceParameter.saveIP))
  171. saveIP.text = "--";
  172. else
  173. saveIP.text = DeviceParameter.saveIP;
  174. if (string.IsNullOrEmpty(DeviceParameter.iPMIIP))
  175. iPMIIP.text = "--";
  176. else
  177. iPMIIP.text = DeviceParameter.iPMIIP;
  178. if (string.IsNullOrEmpty(DeviceParameter.businessIP))
  179. businessIP.text = "--";
  180. else
  181. businessIP.text = DeviceParameter.businessIP;
  182. if (string.IsNullOrEmpty(DeviceParameter.supplier))
  183. equipmentSupplier.text = "--";
  184. else
  185. equipmentSupplier.text = DeviceParameter.supplier;
  186. if (string.IsNullOrEmpty(DeviceParameter.provincePrincipal))
  187. territorialPAManager.text = "--";
  188. else
  189. territorialPAManager.text = DeviceParameter.provincePrincipal;
  190. if (string.IsNullOrEmpty(DeviceParameter.ownershipOrganization))
  191. equipmentBTTOrganization.text = "--";
  192. else
  193. equipmentBTTOrganization.text = DeviceParameter.ownershipOrganization;
  194. if (string.IsNullOrEmpty(DeviceParameter.managementOrganization))
  195. facilityManagementOrganization.text = "--";
  196. else
  197. facilityManagementOrganization.text = DeviceParameter.managementOrganization;
  198. if (string.IsNullOrEmpty(DeviceParameter.maintenanceOrganization))
  199. equipmentMaintenanceOrganization.text = "--";
  200. else
  201. equipmentMaintenanceOrganization.text = DeviceParameter.maintenanceOrganization;
  202. if (string.IsNullOrEmpty(DeviceParameter.businessSystem))
  203. businessSystem.text = "--";
  204. else
  205. businessSystem.text = DeviceParameter.businessSystem;
  206. }
  207. public void CloseOnClick()
  208. {
  209. gameObject.SetActive(false);
  210. if (item != null)
  211. {
  212. item.gameObject.SetActive(true);
  213. item = null;
  214. }
  215. }
  216. }