fireWork.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472
  1. <template>
  2. <div class="fireWork">
  3. <!-- 顶部区域 -->
  4. <div class="work-nav">
  5. <div class="nav" v-for="(item, index) in topList" :key="index">
  6. <div class="pic" v-if="item.imgSrc">
  7. <img :src="imgUrl" alt="" />
  8. </div>
  9. <div class="content" v-if="item.label && item.value">
  10. <span>{{ item.label }}</span>
  11. <span>{{ item.value }}</span>
  12. </div>
  13. <div class="text" v-if="item.text">{{ item.text }}</div>
  14. <div class="percent" v-if="item.list.length != 0">
  15. <div class="title">{{ item.label }}</div>
  16. <div class="value">
  17. <div class="content-box" v-for="(items, ind) in item.list" :key="ind">
  18. <span style="color: #b3b8cc">{{ `${items.label} :` }}</span>
  19. <span style="color: #3df6ff; margin-left: 10px">{{ `${items.value}%` }}</span>
  20. </div>
  21. </div>
  22. </div>
  23. </div>
  24. </div>
  25. <!-- 中间区域 -->
  26. <div class="center-echart">
  27. <div class="nav-title">
  28. <div class="title">光纤测温系统温度实时监测</div>
  29. </div>
  30. <div class="echart-box">
  31. <echartLine :echartDataGq="echartDataGq" :maxY="maxY" :echartDw="echartDw"></echartLine>
  32. </div>
  33. </div>
  34. <!-- 底部区域 -->
  35. <div class="bot-content">
  36. <div class="title">
  37. <div class="text">束管系统监测</div>
  38. </div>
  39. <div class="content">
  40. <div class="content-box" v-for="(item, index) in contentList" :key="index">
  41. <div class="box-item" v-for="(items, ind) in item.list" :key="ind" @click="getSgClick(items)">
  42. <div class="content-title">{{ items.title }}</div>
  43. <div class="content-item">
  44. <span>{{ items.label }}</span>
  45. <span class="bolds">{{ items.value }}</span>
  46. </div>
  47. <div class="content-item">
  48. <span>{{ items.label1 }}</span>
  49. <span class="bolds">{{ items.time }}</span>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. <div class="echart-box">
  55. <echartLine1 :echartDataSg="echartDataSg"></echartLine1>
  56. </div>
  57. </div>
  58. </div>
  59. </template>
  60. <script lang="ts" setup>
  61. import { onMounted, ref, reactive, watch, defineProps } from 'vue';
  62. import imgUrl from '../../../../../assets/images/fire/pie.png'
  63. import echartLine from './common/echartLine.vue'
  64. import echartLine1 from './common/echartLine1.vue'
  65. import { topList, contentList, } from '../fire.data'
  66. let props = defineProps({
  67. listData: Object,
  68. });
  69. let maxY = ref(2000)
  70. let echartDw = ref('(­°C)')
  71. //光钎测温-图表数据
  72. let echartDataGq = reactive({
  73. maxData: {
  74. lengedData: '当前温度',
  75. data: []
  76. },
  77. xData: [],
  78. })
  79. //束管监测-图表数据
  80. let echartDataSg = reactive({
  81. xData: [],
  82. yData: [],
  83. lengedData: 'O₂',
  84. })
  85. let echartDataSgList = reactive<any[]>([])
  86. //束管实时数据选项点击
  87. function getSgClick(items) {
  88. echartDataSg.xData.length = 0
  89. echartDataSg.yData.length = 0
  90. echartDataSg.lengedData = items.title
  91. switch (items.title) {
  92. case 'O₂':
  93. echartDataSgList.forEach(el => {
  94. echartDataSg.xData.push(el.time)
  95. echartDataSg.yData.push(el.o2val)
  96. })
  97. break;
  98. case 'C₂H₄':
  99. echartDataSgList.forEach(el => {
  100. echartDataSg.xData.push(el.time)
  101. echartDataSg.yData.push(el.ch2val)
  102. })
  103. break;
  104. case 'CO':
  105. echartDataSgList.forEach(el => {
  106. echartDataSg.xData.push(el.time)
  107. echartDataSg.yData.push(el.coval)
  108. })
  109. break;
  110. case 'CH₄':
  111. echartDataSgList.forEach(el => {
  112. echartDataSg.xData.push(el.time)
  113. echartDataSg.yData.push(el.chval)
  114. })
  115. break;
  116. case 'CO₂':
  117. echartDataSgList.forEach(el => {
  118. echartDataSg.xData.push(el.time)
  119. echartDataSg.yData.push(el.co2val)
  120. })
  121. break;
  122. case 'C₂H₂':
  123. echartDataSgList.forEach(el => {
  124. echartDataSg.xData.push(el.time)
  125. echartDataSg.yData.push(el.gasval)
  126. })
  127. break;
  128. }
  129. }
  130. watch(() => props.listData, (val, val1) => {
  131. console.log(val, '火灾详情')
  132. if (JSON.stringify(val) != '{}') {
  133. echartDataGq.xData.length = 0
  134. echartDataGq.maxData.data.length = 0
  135. echartDataSgList.length = 0
  136. echartDataSg.xData.length = 0
  137. echartDataSg.yData.length = 0
  138. if (val.fiber.length != 0) {
  139. topList[0].value = val.fiber[0].readData.fmax
  140. topList[1].value = val.fiber[0].readData.fmin
  141. topList[2].value = val.fiber[0].readData.favg
  142. topList[3].text = val.fiber[0].warnFlag ? '报警' : '正常'
  143. JSON.parse(val.fiber[0].readData.fibreTemperature).forEach(el => {
  144. echartDataGq.xData.push(el.pos)
  145. echartDataGq.maxData.data.push(el.value)
  146. })
  147. } else {
  148. topList[0].value = '--'
  149. topList[1].value = '--'
  150. topList[2].value = '--'
  151. topList[3].text = '正常'
  152. }
  153. if (val.bundletube.length != 0) {
  154. contentList[0].list[0].value = val.bundletube[0].readData.o2val
  155. contentList[0].list[1].value = val.bundletube[0].readData.ch2val
  156. contentList[1].list[0].value = val.bundletube[0].readData.coval
  157. contentList[1].list[1].value = val.bundletube[0].readData.chval
  158. contentList[2].list[0].value = val.bundletube[0].readData.co2val
  159. contentList[2].list[1].value = val.bundletube[0].readData.gasval
  160. contentList.forEach(el => {
  161. el.list.forEach(v => {
  162. v.time = val.bundletube[0].readTime.substring(0, val.bundletube[0].readTime.lastIndexOf(':'))
  163. })
  164. })
  165. val.bundletube[0].history.forEach(el => {
  166. echartDataSg.xData.push(el.time)
  167. if (echartDataSg.lengedData == 'O₂') {
  168. echartDataSg.yData.push(el.o2val)
  169. } else if (echartDataSg.lengedData == 'C₂H₄') {
  170. echartDataSg.yData.push(el.ch2val)
  171. } else if (echartDataSg.lengedData == 'C₂H₂') {
  172. echartDataSg.yData.push(el.gasval)
  173. } else if (echartDataSg.lengedData == 'CH₄') {
  174. echartDataSg.yData.push(el.chval)
  175. } else if (echartDataSg.lengedData == 'CO') {
  176. echartDataSg.yData.push(el.coval)
  177. } else if (echartDataSg.lengedData == 'CO₂') {
  178. echartDataSg.yData.push(el.co2val)
  179. }
  180. echartDataSgList.push(el)
  181. })
  182. }else {
  183. contentList[0].list[0].value = '--'
  184. contentList[0].list[1].value = '--'
  185. contentList[1].list[0].value = '--'
  186. contentList[1].list[1].value = '--'
  187. contentList[2].list[0].value = '--'
  188. contentList[2].list[1].value ='--'
  189. contentList.forEach(el => {
  190. el.list.forEach(v => {
  191. v.time = '--'
  192. })
  193. })
  194. }
  195. }
  196. }, { deep: true })
  197. </script>
  198. <style lang="less" scoped>
  199. .fireWork {
  200. width: 100%;
  201. height: 100%;
  202. padding: 20px;
  203. box-sizing: border-box;
  204. .work-nav {
  205. height: 15%;
  206. width: 100%;
  207. margin-bottom: 20px;
  208. background: url('../../../../../assets/images/fire/bj1.png') no-repeat center;
  209. background-size: 100% 100%;
  210. display: flex;
  211. justify-content: space-between;
  212. align-items: center;
  213. .nav {
  214. display: flex;
  215. justify-content: center;
  216. align-items: center;
  217. &:nth-child(1) {
  218. flex: 1;
  219. height: 100%;
  220. border-right: 2px solid;
  221. border-image: linear-gradient(to bottom, transparent, rgba(2, 70, 136, 1), transparent) 1 1 1;
  222. }
  223. &:nth-child(2) {
  224. flex: 1;
  225. height: 100%;
  226. border-right: 2px solid;
  227. border-image: linear-gradient(to bottom, transparent, rgba(2, 70, 136, 1), transparent) 1 1 1;
  228. }
  229. &:nth-child(3) {
  230. flex: 1;
  231. height: 100%;
  232. border-right: 2px solid;
  233. border-image: linear-gradient(to bottom, transparent, rgba(2, 70, 136, 1), transparent) 1 1 1;
  234. }
  235. &:nth-child(4) {
  236. flex: 0.6;
  237. color: #b3b8cc;
  238. font-size: 16px;
  239. height: 100%;
  240. border-right: 2px solid;
  241. border-image: linear-gradient(to bottom, transparent, rgba(2, 70, 136, 1), transparent) 1 1 1;
  242. }
  243. &:nth-child(5) {
  244. flex: 1.4;
  245. height: 100%;
  246. .percent {
  247. width: 100%;
  248. height: 82%;
  249. padding: 0px 20px;
  250. box-sizing: border-box;
  251. display: flex;
  252. flex-direction: column;
  253. justify-content: space-around;
  254. .title {
  255. font-size: 14px;
  256. padding: 5px 0px;
  257. color: #b3b8cc;
  258. text-align: center;
  259. }
  260. .value {
  261. display: flex;
  262. justify-content: space-between;
  263. span {
  264. font-family: 'douyuFont';
  265. font-size: 18px;
  266. }
  267. }
  268. }
  269. }
  270. .pic {
  271. width: 30%;
  272. height: 82%;
  273. img {
  274. width: 100%;
  275. height: 100%;
  276. }
  277. }
  278. .content {
  279. height: 82%;
  280. margin-left: 15px;
  281. color: #fff;
  282. display: flex;
  283. flex-direction: column;
  284. justify-content: space-around;
  285. span {
  286. font-size: 14px;
  287. &:nth-child(1) {
  288. padding: 5px 0px;
  289. color: #b3b8cc;
  290. }
  291. &:nth-child(2) {
  292. font-family: 'douyuFont';
  293. font-size: 24px;
  294. color: #3df6ff;
  295. }
  296. }
  297. }
  298. }
  299. .nav:nth-child(1) .pic {
  300. background: url('../../../../../assets/images/fire/max.svg') no-repeat center;
  301. background-size: 50% 50%;
  302. }
  303. .nav:nth-child(2) .pic {
  304. background: url('../../../../../assets/images/fire/min.svg') no-repeat center;
  305. background-size: 50% 50%;
  306. }
  307. .nav:nth-child(3) .pic {
  308. background: url('../../../../../assets/images/fire/pj.svg') no-repeat center;
  309. background-size: 50% 50%;
  310. }
  311. }
  312. .center-echart {
  313. width: 100%;
  314. height: 32%;
  315. padding: 15px;
  316. margin-bottom: 20px;
  317. box-sizing: border-box;
  318. background: url('../../../../../assets/images/fire/bj1.png') no-repeat center;
  319. background-size: 100% 100%;
  320. .nav-title {
  321. height: 30px;
  322. display: flex;
  323. justify-content: space-between;
  324. align-items: center;
  325. .title {
  326. font-family: 'douyuFont';
  327. font-size: 16px;
  328. color: #3df6ff;
  329. }
  330. }
  331. .echart-box {
  332. width: 100%;
  333. height: calc(100% - 30px);
  334. }
  335. }
  336. .bot-content {
  337. position: relative;
  338. width: 100%;
  339. height: calc(53% - 40px);
  340. padding: 15px 15px 0px 15px;
  341. box-sizing: border-box;
  342. background: url('../../../../../assets/images/fire/bj1.png') no-repeat center;
  343. background-size: 100% 100%;
  344. .title {
  345. height: 30px;
  346. display: flex;
  347. justify-content: space-between;
  348. .text {
  349. height: 30px;
  350. line-height: 30px;
  351. font-family: 'douyuFont';
  352. font-size: 16px;
  353. color: #3df6ff;
  354. }
  355. }
  356. .content {
  357. height: calc(100% - 30px);
  358. display: flex;
  359. flex-direction: column;
  360. justify-content: space-between;
  361. .content-box {
  362. width: 100%;
  363. height: 29%;
  364. display: flex;
  365. justify-content: space-between;
  366. margin-top: 0px !important;
  367. .box-item {
  368. position: relative;
  369. width: 16%;
  370. height: 100%;
  371. background: url('../../../../../assets/images/fire/14174.png') no-repeat center;
  372. background-size: 100% 100%;
  373. cursor: pointer;
  374. .content-title {
  375. position: absolute;
  376. left: 50%;
  377. top: 0;
  378. transform: translate(-50%);
  379. color: #fff;
  380. font-size: 14px;
  381. }
  382. .content-item {
  383. position: absolute;
  384. width: 93%;
  385. height: 27%;
  386. display: flex;
  387. align-items: center;
  388. padding: 0px 10px;
  389. box-sizing: border-box;
  390. background: url('../../../../../assets/images/fire/contetn.png') no-repeat center;
  391. background-size: 100% 100%;
  392. &:nth-child(2) {
  393. left: 50%;
  394. top: 28%;
  395. transform: translate(-50%);
  396. display: flex;
  397. justify-content: space-between;
  398. }
  399. &:nth-child(3) {
  400. left: 50%;
  401. top: 62%;
  402. transform: translate(-50%);
  403. display: flex;
  404. justify-content: space-between;
  405. }
  406. .bolds {
  407. font-family: 'douyuFont';
  408. color: #3df6ff;
  409. font-size: 12px;
  410. }
  411. }
  412. }
  413. }
  414. }
  415. .echart-box {
  416. position: absolute;
  417. left: 50%;
  418. top: 50px;
  419. transform: translate(-50%, 0);
  420. width: 66%;
  421. height: calc(100% - 50px);
  422. }
  423. }
  424. }
  425. </style>