monitor.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. <template>
  2. <div class="device-monitor color-font">
  3. <div class="device-monitor-box">
  4. <div class="monitor-top">
  5. <div class="monitor-number">
  6. <div class="number-all">
  7. <div class="test-icon">
  8. <i class="iconfont huifont-yunhang"></i>
  9. </div>
  10. <div class="test-label">
  11. <div class="test-name">设备总数</div>
  12. <div class="test-value alibaba">{{testCount.totalNumber}}</div>
  13. </div>
  14. </div>
  15. <div class="number-list">
  16. <div class="hui-chart-title">
  17. 设备状态
  18. </div>
  19. <div class="number-item" style="margin-top: 16px;">
  20. <div class="number-icon green">
  21. <i class="iconfont huifont-kaiqi"></i>
  22. </div>
  23. <div class="number-label">开启</div>
  24. <div class="alibaba color-green">{{testCount.openNumber}}</div>
  25. </div>
  26. <div class="number-item">
  27. <div class="number-icon red">
  28. <i class="iconfont huifont-jinggao"></i>
  29. </div>
  30. <div class="number-label">故障</div>
  31. <div class="alibaba color-red">{{testCount.faultNumber}}</div>
  32. </div>
  33. <div class="number-item">
  34. <div class="number-icon gray">
  35. <i class="iconfont huifont-guanbi1"></i>
  36. </div>
  37. <div class="number-label">关闭</div>
  38. <div class="alibaba">{{testCount.closeNumber}}</div>
  39. </div>
  40. </div>
  41. </div>
  42. <div class="device-list hui-flex hui-content">
  43. <div class="hui-content-title">
  44. <div :class="'hui-title-item '+(nowDevice.id == item.id ? 'active' : '')"
  45. v-for="item in deviceData" :key="item.id" @click="changeDeviceSystem(item)">
  46. {{item.name}}
  47. </div>
  48. </div>
  49. <div class="hui-flex-box">
  50. <div class="device-type-list">
  51. <div class="device-type-item" v-for="(item,index) in nodeList" :key="item.id">
  52. <div class="device-type-title">
  53. <span class="label">{{item.name}}</span>
  54. <span class="alibaba color-cyan number">{{item.totalNumber}}</span>
  55. </div>
  56. <div class="device-type-content">
  57. <div class="device-types-item" v-for="(node,index) in item.children" :key="node.id">
  58. <div class="device-types-label">{{node.name}}</div>
  59. <div class="device-types-content">
  60. <div class="device-types-number">
  61. <span>开启</span>
  62. <span class="alibaba color-green">{{node.openNumber}}</span>
  63. </div>
  64. <div class="device-types-number">
  65. <span>故障</span>
  66. <span class="alibaba color-red">{{node.faultNumber}}</span>
  67. </div>
  68. <div class="device-types-number">
  69. <span>关闭</span>
  70. <span class="alibaba">{{node.closeNumber}}</span>
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="monitor-bottom">
  81. <div class="params-title">
  82. <div class="hui-chart-title">
  83. 设备监测
  84. </div>
  85. <div class="params-item">
  86. <div class="params-date">记录时间</div>
  87. <div class="params-td">控制温度</div>
  88. <div class="params-td">供水温度(°C)</div>
  89. <div class="params-td">回水温度(°C)</div>
  90. <div class="params-td">非烟温度</div>
  91. <div class="params-td">介质压力</div>
  92. <div class="params-td">介质温度</div>
  93. <div class="params-td">瞬时流量</div>
  94. <div class="params-td">机组负荷</div>
  95. <div class="params-td">故障</div>
  96. <div class="params-td">设定温度(°C)</div>
  97. <div class="params-td">设启停状态</div>
  98. </div>
  99. </div>
  100. <div class="params-box">
  101. <div class="params-item params-tr" v-for="(item,index) in list" :key="item.id">
  102. <div class="params-date">{{item.date}}</div>
  103. <div class="params-td">{{item.controlTemperature}}</div>
  104. <div class="params-td">{{item.supplyWaterTemperature}}</div>
  105. <div class="params-td">{{item.backWaterTemperature}}</div>
  106. <div class="params-td">{{item.nonSmokingTemperature}}</div>
  107. <div class="params-td">{{item.mediumPressure}}</div>
  108. <div class="params-td">{{item.mediumTemperature}}</div>
  109. <div class="params-td">{{item.instantaneousFlowRate}}</div>
  110. <div class="params-td">{{item.unitLoad}}</div>
  111. <div class="params-td">{{item.fault}}</div>
  112. <div class="params-td">{{item.setTemperature}}</div>
  113. <div class="params-td">
  114. <div class="color-gray" v-if="!item.state">关闭</div>
  115. <div class="color-green" v-else-if="item.state === 1">开启</div>
  116. <div class="color-orange" v-else="item.state === 2">故障</div>
  117. </div>
  118. </div>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123. </template>
  124. <script>
  125. import {
  126. getMonitoringList,
  127. getDeviceLevelList
  128. } from '@/httpApi/test'
  129. export default {
  130. data() {
  131. return {
  132. list: [],
  133. deviceData: [],
  134. testCount: {
  135. totalNumber: 0,
  136. openNumber: 0,
  137. faultNumber: 0,
  138. closeNumber: 0
  139. },
  140. nowDevice: {},
  141. nodeList: []
  142. }
  143. },
  144. created() {
  145. this.init();
  146. },
  147. methods: {
  148. init() {
  149. getDeviceLevelList(this.$store.getters.project.id).then(res => {
  150. if (res.state) {
  151. this.changeDeviceSystem(res.data[0])
  152. this.deviceData = res.data;
  153. for (let i = 0; i < res.data.length; i++) {
  154. this.testCount.totalNumber += res.data[i].totalNumber;
  155. this.testCount.openNumber += res.data[i].openNumber;
  156. this.testCount.faultNumber += res.data[i].faultNumber;
  157. this.testCount.closeNumber += res.data[i].closeNumber;
  158. }
  159. }
  160. })
  161. getMonitoringList({
  162. projectId: this.$store.getters.project.id
  163. }).then(res => {
  164. if (res.state) {
  165. this.list = res.data;
  166. }
  167. })
  168. },
  169. changeDeviceSystem(item) {
  170. this.nowDevice = item;
  171. this.nodeList = this.nowDevice.children;
  172. }
  173. },
  174. }
  175. </script>
  176. <style lang="scss">
  177. .device-monitor {
  178. width: 100%;
  179. height: 100%;
  180. padding: 20px;
  181. overflow: auto;
  182. .device-monitor-box {
  183. display: flex;
  184. flex-direction: column;
  185. width: 100%;
  186. height: 100%;
  187. min-width: 1256px;
  188. min-height: 700px;
  189. }
  190. .select-box {
  191. display: flex;
  192. .hui-tag {
  193. cursor: pointer;
  194. }
  195. .el-select {
  196. width: 200px;
  197. margin-right: 8px;
  198. }
  199. .el-range-editor--mini {
  200. width: 220px;
  201. }
  202. .hui-tag {
  203. margin-left: 8px;
  204. }
  205. .el-button {
  206. margin-left: 8px;
  207. }
  208. }
  209. .monitor-bottom {
  210. flex: 1;
  211. height: 0;
  212. background: #141A24;
  213. margin-top: 12px;
  214. padding: 20px 0;
  215. display: flex;
  216. flex-direction: column;
  217. .params-title {
  218. padding: 0px 20px 0px 20px;
  219. }
  220. .params-box {
  221. flex: 1;
  222. height: 0;
  223. padding: 0 20px;
  224. overflow-y: auto;
  225. }
  226. .params-item {
  227. height: 36px;
  228. display: flex;
  229. align-items: center;
  230. padding: 0 20px;
  231. font-size: 12px;
  232. }
  233. .params-tr {
  234. background: rgba(97, 133, 214, 0.05);
  235. margin-bottom: 4px;
  236. }
  237. .params-tr:last-child {
  238. margin-bottom: 0px;
  239. }
  240. .params-td {
  241. flex: 1;
  242. }
  243. .params-date {
  244. width: 140px;
  245. }
  246. }
  247. .device-type-item {
  248. font-size: 12px;
  249. background: #181F2D;
  250. border: 1px solid rgba(97, 133, 214, 0.15);
  251. margin-bottom: 12px;
  252. .device-type-title {
  253. height: 36px;
  254. background: rgba(97, 133, 214, 0.08);
  255. padding-left: 16px;
  256. display: flex;
  257. align-items: center;
  258. .label {
  259. margin-right: 20px;
  260. }
  261. .number {
  262. font-size: 16px;
  263. }
  264. }
  265. .device-type-content {
  266. padding: 3px 5px 13px 15px;
  267. display: flex;
  268. flex-wrap: wrap;
  269. }
  270. .device-types-item {
  271. padding: 11px;
  272. border: 1px solid rgba(97, 133, 214, 0.15);
  273. margin-right: 10px;
  274. margin-top: 10px;
  275. }
  276. .device-types-label {
  277. font-weight: 600;
  278. }
  279. .device-types-content {
  280. display: flex;
  281. margin-top: 6px;
  282. .device-types-number {
  283. margin-right: 25px;
  284. }
  285. .alibaba {
  286. font-size: 14px;
  287. margin-left: 7px;
  288. }
  289. }
  290. }
  291. .monitor-top {
  292. display: flex;
  293. height: 445px;
  294. .device-list {
  295. flex: 1;
  296. width: 0;
  297. background: #141A24;
  298. .hui-flex-box {
  299. padding: 20px 0;
  300. }
  301. .device-type-list {
  302. height: 100%;
  303. padding: 0 20px;
  304. overflow-y: auto;
  305. }
  306. }
  307. .hui-content-title {
  308. color: #617491;
  309. }
  310. .hui-title-item.active,
  311. .hui-title-item:hover {
  312. font-weight: 600;
  313. }
  314. }
  315. .monitor-number {
  316. width: 350px;
  317. margin-right: 12px;
  318. }
  319. .number-list {
  320. padding: 20px;
  321. background: #141A24;
  322. margin-top: 12px;
  323. .number-item {
  324. height: 68px;
  325. background: #181F2D;
  326. display: flex;
  327. align-items: center;
  328. padding: 0 24px 0 20px;
  329. margin-top: 12px;
  330. .alibaba {
  331. font-size: 20px;
  332. }
  333. }
  334. .number-label {
  335. flex: 1;
  336. }
  337. .number-icon {
  338. width: 36px;
  339. height: 36px;
  340. text-align: center;
  341. line-height: 36px;
  342. border-radius: 12px;
  343. margin-right: 10px;
  344. .iconfont {
  345. font-size: 25px;
  346. }
  347. }
  348. .green {
  349. background: $--color-green;
  350. }
  351. .red {
  352. background: $--color-red;
  353. }
  354. .gray {
  355. background: $--color-common;
  356. }
  357. }
  358. .number-all {
  359. height: 120px;
  360. background: #141A24;
  361. display: flex;
  362. align-items: center;
  363. padding-left: 32px;
  364. .test-label {
  365. flex: 1;
  366. width: 0;
  367. overflow: hidden;
  368. }
  369. .test-value {
  370. font-size: 24px;
  371. margin-top: 5px;
  372. }
  373. .test-icon {
  374. width: 56px;
  375. height: 56px;
  376. background: #3371FF;
  377. border-radius: 20px;
  378. display: flex;
  379. align-items: center;
  380. justify-content: center;
  381. margin-right: 16px;
  382. i {
  383. font-size: 32px;
  384. color: #e6e6e6;
  385. }
  386. }
  387. }
  388. }
  389. </style>