fireWork.vue 14 KB

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