ventilate.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. <template>
  2. <div class="dustPage">
  3. <div class="top-area">
  4. <div class="top-box" v-for="(item, index) in topAreaList" :key="index">
  5. <div class="top-title">{{ item.title }}</div>
  6. <div class="top-content">
  7. <div class="content-item" v-for="(items, ind) in item.content" :key="ind">
  8. <span class="item-label">{{ items.label }}</span>
  9. <span :class="{
  10. 'item-value1': items.value == 0,
  11. 'item-value2': items.value == 101,
  12. 'item-value3': items.value == 102,
  13. 'item-value4': items.value == 103,
  14. 'item-value5': items.value == 104,
  15. 'item-value6': items.value == 201,
  16. 'item-value': items.value != 0 && items.value != 101 && items.value != 102 && items.value != 103 && items.value != 104 && items.value != 201,
  17. }">{{ items.value == 0 ? '正常' : items.value == 101 ? '较低风险' : items.value == 102 ? '低风险' : items.value ==
  18. 103 ?
  19. '中风险' : items.value == 104 ? '高风险' : items.value == 201 ? '报警' : items.value }}</span>
  20. </div>
  21. </div>
  22. </div>
  23. </div>
  24. <div class="center-area">
  25. <div class="center-t">
  26. <div class="t-box" v-for="(item, index) in centerAreaListT1" :key="index">
  27. <div class="box-label">{{ item.label }}</div>
  28. </div>
  29. </div>
  30. <div class="center-b">
  31. <div class="b-box" v-for="(item, index) in centerAreaListB1" :key="index">
  32. <div class="box-label">{{ item.content }}</div>
  33. </div>
  34. </div>
  35. </div>
  36. <div class="bot-area">
  37. <echartLine :echartDataGq="echartDataFc1" :maxY="maxY" :echartDw="echartDw" />
  38. </div>
  39. </div>
  40. </template>
  41. <script lang="ts" setup>
  42. import { ref, nextTick, reactive, watch, defineProps } from 'vue';
  43. import { centerAreaListT1, centerAreaListB1 } from '../fire.data';
  44. import echartLine from './common/echartLine.vue';
  45. let props = defineProps({
  46. listData: Object,
  47. });
  48. let maxY = ref(2000)
  49. let echartDw=ref('(m³/min)')
  50. //报警区域数据
  51. let topAreaList = reactive<any[]>([]);
  52. //通风图表数据
  53. const echartDataFc1 = reactive({
  54. maxData: {
  55. lengedData: '进风量',
  56. data: []
  57. },
  58. minData: {
  59. lengedData: '回风量',
  60. data: []
  61. },
  62. xData: [],
  63. });
  64. watch(
  65. () => props.listData,
  66. (val) => {
  67. console.log(val, '详情数据');
  68. if (JSON.stringify(val.common) != '{}') {
  69. echartDataFc1.maxData.data.length = 0;
  70. echartDataFc1.minData.data.length = 0;
  71. echartDataFc1.xData.length = 0;
  72. topAreaList.length = 0;
  73. if (val.common.warnDevices.length != 0) {
  74. val.common.warnDevices.forEach((el) => {
  75. topAreaList.push({
  76. title: el.typeName,
  77. content: [
  78. { ids: 0, label: '设备类型', value: el.datalist[0].typeName },
  79. {
  80. ids: 1,
  81. label: '报警等级',
  82. value: el.datalist[0].warnLevel,
  83. },
  84. { ids: 2, label: '报警描述', value: el.datalist[0].warnDes },
  85. ],
  86. });
  87. });
  88. } else {
  89. topAreaList.push({
  90. title: '工作面',
  91. content: [
  92. { ids: 0, label: '设备类型', value: '--' },
  93. {
  94. ids: 1,
  95. label: '报警等级',
  96. value: val.common.warnLevel,
  97. },
  98. { ids: 2, label: '报警描述', value: '--' },
  99. ],
  100. });
  101. }
  102. centerAreaListB1[0].content = val.common.jin;
  103. centerAreaListB1[1].content = val.common.hui;
  104. centerAreaListB1[2].content = val.common.xufengliang;
  105. val.common.history.forEach((v) => {
  106. echartDataFc1.maxData.data.push(parseFloat(v.jin));
  107. echartDataFc1.minData.data.push(parseFloat(v.hui));
  108. echartDataFc1.xData.push(v.time);
  109. });
  110. }
  111. },
  112. { deep: true }
  113. );
  114. </script>
  115. <style lang="less" scoped>
  116. .dustPage {
  117. width: 100%;
  118. height: 100%;
  119. padding: 20px;
  120. box-sizing: border-box;
  121. .top-area {
  122. height: 183px;
  123. display: flex;
  124. justify-content: space-between;
  125. margin-bottom: 10px;
  126. padding: 0px 15px;
  127. box-sizing: border-box;
  128. .top-box {
  129. position: relative;
  130. width: 480px;
  131. height: 160px;
  132. background: url('../../../../../assets//images/fire/fc-t.png') no-repeat;
  133. .top-title {
  134. position: absolute;
  135. left: 50%;
  136. top: 6px;
  137. transform: translate(-50%, 0);
  138. }
  139. .top-content {
  140. position: absolute;
  141. top: 33px;
  142. left: 0;
  143. width: 100%;
  144. height: calc(100% - 33px);
  145. display: flex;
  146. justify-content: flex-start;
  147. align-items: flex-start;
  148. flex-wrap: wrap;
  149. cursor: pointer;
  150. .content-item {
  151. position: relative;
  152. width: 50%;
  153. height: 50%;
  154. background: url('../../../../../assets/images/fire/content-item.png') no-repeat center;
  155. .item-label {
  156. position: absolute;
  157. left: 52px;
  158. top: 50%;
  159. transform: translate(0, -44%);
  160. font-size: 12px;
  161. }
  162. .item-value {
  163. position: absolute;
  164. right: 52px;
  165. top: 50%;
  166. transform: translate(0, -32%);
  167. font-size: 12px;
  168. font-family: 'douyuFont';
  169. color: #3df6ff;
  170. }
  171. .item-value1 {
  172. position: absolute;
  173. right: 52px;
  174. top: 50%;
  175. transform: translate(0, -32%);
  176. font-size: 12px;
  177. font-family: 'douyuFont';
  178. color: rgb(145, 230, 9);
  179. }
  180. .item-value2 {
  181. position: absolute;
  182. right: 52px;
  183. top: 50%;
  184. transform: translate(0, -32%);
  185. font-size: 12px;
  186. font-family: 'douyuFont';
  187. color: rgb(0, 242, 255);
  188. }
  189. .item-value3 {
  190. position: absolute;
  191. right: 52px;
  192. top: 50%;
  193. transform: translate(0, -32%);
  194. font-size: 12px;
  195. font-family: 'douyuFont';
  196. color: #ffff35;
  197. }
  198. .item-value4 {
  199. position: absolute;
  200. right: 52px;
  201. top: 50%;
  202. transform: translate(0, -32%);
  203. font-size: 12px;
  204. font-family: 'douyuFont';
  205. color: #ffbe69;
  206. }
  207. .item-value5 {
  208. position: absolute;
  209. right: 52px;
  210. top: 50%;
  211. transform: translate(0, -32%);
  212. font-size: 12px;
  213. font-family: 'douyuFont';
  214. color: #ff6f00;
  215. }
  216. .item-value6 {
  217. position: absolute;
  218. right: 52px;
  219. top: 50%;
  220. transform: translate(0, -32%);
  221. font-size: 12px;
  222. font-family: 'douyuFont';
  223. color: #ff0000;
  224. }
  225. }
  226. }
  227. }
  228. }
  229. .center-area {
  230. height: 258px;
  231. margin-bottom: 20px;
  232. background: url('../../../../../assets/images/fire/bj1.png') no-repeat;
  233. background-size: 100% 100%;
  234. .center-t {
  235. height: 50%;
  236. // padding: 0px 80px;
  237. display: flex;
  238. justify-content: space-around;
  239. align-items: center;
  240. background: url('../../../../../assets/images/fire/dz.png') no-repeat;
  241. background-size: 100% 100%;
  242. // box-sizing: border-box;
  243. .t-box {
  244. width: 218px;
  245. height: 97px;
  246. background: url('../../../../../assets/images/fire/dz1.png') no-repeat;
  247. .box-label {
  248. text-align: center;
  249. }
  250. }
  251. }
  252. .center-b {
  253. height: 50%;
  254. // padding: 0px 80px;
  255. display: flex;
  256. justify-content: space-around;
  257. align-items: center;
  258. // box-sizing: border-box;
  259. .b-box {
  260. width: 218px;
  261. height: 97px;
  262. display: flex;
  263. flex-direction: column;
  264. justify-content: center;
  265. align-items: center;
  266. .box-label {
  267. width: 169px;
  268. height: 42px;
  269. line-height: 42px;
  270. text-align: center;
  271. margin-bottom: 5px;
  272. color: #3df6ff;
  273. font-family: 'douyuFont';
  274. background: url('../../../../../assets/images/fire/dz2.png') no-repeat;
  275. }
  276. }
  277. }
  278. }
  279. .bot-area {
  280. height: calc(100% - 471px);
  281. background: url('../../../../../assets/images/fire/bj1.png') no-repeat;
  282. background-size: 100% 100%;
  283. }
  284. .bot-area1 {
  285. height: calc(100% - 278px);
  286. background: url('../../../../../assets/images/fire/bj1.png') no-repeat;
  287. background-size: 100% 100%;
  288. }
  289. }
  290. </style>