fireWork.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  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. }
  148. if (val.bundletube.length != 0) {
  149. contentList[0].list[0].value = val.bundletube[0].readData.o2val
  150. contentList[0].list[1].value = val.bundletube[0].readData.ch2val
  151. contentList[1].list[0].value = val.bundletube[0].readData.coval
  152. contentList[1].list[1].value = val.bundletube[0].readData.chval
  153. contentList[2].list[0].value = val.bundletube[0].readData.co2val
  154. contentList[2].list[1].value = val.bundletube[0].readData.gasval
  155. contentList.forEach(el => {
  156. el.list.forEach(v => {
  157. v.time = val.bundletube[0].readTime.substring(0, val.bundletube[0].readTime.lastIndexOf(':'))
  158. })
  159. })
  160. val.bundletube[0].history.forEach(el => {
  161. echartDataSg.xData.push(el.time)
  162. if (echartDataSg.lengedData == 'O₂') {
  163. echartDataSg.yData.push(el.o2val)
  164. } else if (echartDataSg.lengedData == 'C₂H₄') {
  165. echartDataSg.yData.push(el.ch2val)
  166. } else if (echartDataSg.lengedData == 'C₂H₂') {
  167. echartDataSg.yData.push(el.gasval)
  168. } else if (echartDataSg.lengedData == 'CH₄') {
  169. echartDataSg.yData.push(el.chval)
  170. } else if (echartDataSg.lengedData == 'CO') {
  171. echartDataSg.yData.push(el.coval)
  172. } else if (echartDataSg.lengedData == 'CO₂') {
  173. echartDataSg.yData.push(el.co2val)
  174. }
  175. echartDataSgList.push(el)
  176. })
  177. }
  178. }
  179. }, { deep: true })
  180. </script>
  181. <style lang="less" scoped>
  182. .fireWork {
  183. width: 100%;
  184. height: 100%;
  185. padding: 20px;
  186. box-sizing: border-box;
  187. .work-nav {
  188. height: 15%;
  189. width: 100%;
  190. margin-bottom: 20px;
  191. background: url('../../../../../assets/images/fire/bj1.png') no-repeat center;
  192. background-size: 100% 100%;
  193. display: flex;
  194. justify-content: space-between;
  195. align-items: center;
  196. .nav {
  197. display: flex;
  198. justify-content: center;
  199. align-items: center;
  200. &:nth-child(1) {
  201. flex: 1;
  202. height: 100%;
  203. border-right: 2px solid;
  204. border-image: linear-gradient(to bottom, transparent, rgba(2, 70, 136, 1), transparent) 1 1 1;
  205. }
  206. &:nth-child(2) {
  207. flex: 1;
  208. height: 100%;
  209. border-right: 2px solid;
  210. border-image: linear-gradient(to bottom, transparent, rgba(2, 70, 136, 1), transparent) 1 1 1;
  211. }
  212. &:nth-child(3) {
  213. flex: 1;
  214. height: 100%;
  215. border-right: 2px solid;
  216. border-image: linear-gradient(to bottom, transparent, rgba(2, 70, 136, 1), transparent) 1 1 1;
  217. }
  218. &:nth-child(4) {
  219. flex: 0.6;
  220. color: #b3b8cc;
  221. font-size: 16px;
  222. height: 100%;
  223. border-right: 2px solid;
  224. border-image: linear-gradient(to bottom, transparent, rgba(2, 70, 136, 1), transparent) 1 1 1;
  225. }
  226. &:nth-child(5) {
  227. flex: 1.4;
  228. height: 100%;
  229. .percent {
  230. width: 100%;
  231. height: 82%;
  232. padding: 0px 20px;
  233. box-sizing: border-box;
  234. display: flex;
  235. flex-direction: column;
  236. justify-content: space-around;
  237. .title {
  238. font-size: 14px;
  239. padding: 5px 0px;
  240. color: #b3b8cc;
  241. text-align: center;
  242. }
  243. .value {
  244. display: flex;
  245. justify-content: space-between;
  246. span {
  247. font-family: 'douyuFont';
  248. font-size: 18px;
  249. }
  250. }
  251. }
  252. }
  253. .pic {
  254. width: 30%;
  255. height: 82%;
  256. img {
  257. width: 100%;
  258. height: 100%;
  259. }
  260. }
  261. .content {
  262. height: 82%;
  263. margin-left: 15px;
  264. color: #fff;
  265. display: flex;
  266. flex-direction: column;
  267. justify-content: space-around;
  268. span {
  269. font-size: 14px;
  270. &:nth-child(1) {
  271. padding: 5px 0px;
  272. color: #b3b8cc;
  273. }
  274. &:nth-child(2) {
  275. font-family: 'douyuFont';
  276. font-size: 24px;
  277. color: #3df6ff;
  278. }
  279. }
  280. }
  281. }
  282. .nav:nth-child(1) .pic {
  283. background: url('../../../../../assets/images/fire/max.svg') no-repeat center;
  284. background-size: 50% 50%;
  285. }
  286. .nav:nth-child(2) .pic {
  287. background: url('../../../../../assets/images/fire/min.svg') no-repeat center;
  288. background-size: 50% 50%;
  289. }
  290. .nav:nth-child(3) .pic {
  291. background: url('../../../../../assets/images/fire/pj.svg') no-repeat center;
  292. background-size: 50% 50%;
  293. }
  294. }
  295. .center-echart {
  296. width: 100%;
  297. height: 32%;
  298. padding: 15px;
  299. margin-bottom: 20px;
  300. box-sizing: border-box;
  301. background: url('../../../../../assets/images/fire/bj1.png') no-repeat center;
  302. background-size: 100% 100%;
  303. .nav-title {
  304. height: 30px;
  305. display: flex;
  306. justify-content: space-between;
  307. align-items: center;
  308. .title {
  309. font-family: 'douyuFont';
  310. font-size: 16px;
  311. color: #3df6ff;
  312. }
  313. }
  314. .echart-box {
  315. width: 100%;
  316. height: calc(100% - 30px);
  317. }
  318. }
  319. .bot-content {
  320. position: relative;
  321. width: 100%;
  322. height: calc(53% - 40px);
  323. padding: 15px 15px 0px 15px;
  324. box-sizing: border-box;
  325. background: url('../../../../../assets/images/fire/bj1.png') no-repeat center;
  326. background-size: 100% 100%;
  327. .title {
  328. height: 30px;
  329. display: flex;
  330. justify-content: space-between;
  331. .text {
  332. height: 30px;
  333. line-height: 30px;
  334. font-family: 'douyuFont';
  335. font-size: 16px;
  336. color: #3df6ff;
  337. }
  338. }
  339. .content {
  340. height: calc(100% - 30px);
  341. display: flex;
  342. flex-direction: column;
  343. justify-content: space-between;
  344. .content-box {
  345. width: 100%;
  346. height: 29%;
  347. display: flex;
  348. justify-content: space-between;
  349. margin-top: 0px !important;
  350. .box-item {
  351. position: relative;
  352. width: 16%;
  353. height: 100%;
  354. background: url('../../../../../assets/images/fire/14174.png') no-repeat center;
  355. background-size: 100% 100%;
  356. cursor: pointer;
  357. .content-title {
  358. position: absolute;
  359. left: 50%;
  360. top: 0;
  361. transform: translate(-50%);
  362. color: #fff;
  363. font-size: 14px;
  364. }
  365. .content-item {
  366. position: absolute;
  367. width: 93%;
  368. height: 27%;
  369. display: flex;
  370. align-items: center;
  371. padding: 0px 10px;
  372. box-sizing: border-box;
  373. background: url('../../../../../assets/images/fire/contetn.png') no-repeat center;
  374. background-size: 100% 100%;
  375. &:nth-child(2) {
  376. left: 50%;
  377. top: 28%;
  378. transform: translate(-50%);
  379. display: flex;
  380. justify-content: space-between;
  381. }
  382. &:nth-child(3) {
  383. left: 50%;
  384. top: 62%;
  385. transform: translate(-50%);
  386. display: flex;
  387. justify-content: space-between;
  388. }
  389. .bolds {
  390. font-family: 'douyuFont';
  391. color: #3df6ff;
  392. font-size: 12px;
  393. }
  394. }
  395. }
  396. }
  397. }
  398. .echart-box {
  399. position: absolute;
  400. left: 50%;
  401. top: 50px;
  402. transform: translate(-50%, 0);
  403. width: 66%;
  404. height: calc(100% - 50px);
  405. }
  406. }
  407. }
  408. </style>