fireWork.vue 15 KB

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