fireWork.vue 18 KB

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