index.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981
  1. <template>
  2. <div class="dustMonitor">
  3. <customHeader>束管日报分析</customHeader>
  4. <div class="content-container">
  5. <div class="file-list">
  6. <ul>
  7. <li v-for="item in selectList" :key="item.id" :class="{ selected: item.id === selectedFileId }" @click="handleFileClick(item)">
  8. {{ item.fileName }}
  9. </li>
  10. </ul>
  11. </div>
  12. <div class="table-container">
  13. <a-table :columns="computedColumns" :data-source="tableData" size="small" :pagination="false" :scroll="{ y: 250 }" class="tableW">
  14. <template #bodyCell="{ column, record }">
  15. <template v-if="column.dataIndex === 'action'">
  16. <a class="action-link" @click="toDetail(record)">数据分析</a>
  17. </template>
  18. <template v-else>
  19. <template v-if="record[column.dataIndex] === null">
  20. <span>-</span>
  21. </template>
  22. </template>
  23. </template>
  24. </a-table>
  25. <div class="data-container">
  26. <div id="barChart" class="bar-chart"></div>
  27. <div class="data-content">
  28. <div class="title">煤自燃阶段统计分析</div>
  29. <div class="explain">测点共计{{ total }}个</div>
  30. <div class="progress-label">潜伏期阶段:{{ qfqCount }}</div>
  31. <Progress :percent="qfqPercent" size="default" strokeColor="green" :show-info="true" :format="() => qfqCount" />
  32. <div class="progress-label">缓慢氧化升温阶段:{{ latentCount }}</div>
  33. <Progress :percent="latentPercent" size="default" strokeColor="yellow" :show-info="true" :format="() => latentCount" />
  34. <div class="progress-label">加速氧化升温阶段:{{ selfHeatingCount }}</div>
  35. <Progress :percent="selfHeatingPercent" size="default" strokeColor="orange‌" :show-info="true" :format="() => selfHeatingCount" />
  36. <div class="progress-label">剧烈氧化升温阶段:{{ combustionCount }}</div>
  37. <Progress :percent="combustionPercent" size="default" strokeColor="red" :show-info="true" :format="() => combustionCount" />
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. <a-modal style="width: 60%; height: 300px" title="爆炸三角形" v-model:visible="modalVisible" :draggable="true" :footer="null">
  43. <div class="blast-delta-container">
  44. <BlastDelta :posMonitor="posMonitor" style="width: calc(50% - 20px)" />
  45. <BlastDelta1 :posMonitor="posMonitor" style="width: calc(50% - 20px)" />
  46. </div>
  47. </a-modal>
  48. </div>
  49. </template>
  50. <script setup lang="ts">
  51. import { ref, onMounted, computed, shallowRef, reactive, nextTick } from 'vue';
  52. import { columns, Hjtcolumns, Bdcolumns, Bltcolumns, Sgtcolumns, Yjlcolumns } from './bundle-table.data';
  53. import { getBundleInfoList, getAllFileList, getAllFileListById } from './bundle-table.api';
  54. import customHeader from '/@/components/vent/customHeader.vue';
  55. // import { blastDelta } from './modal/blastDelta.vue';
  56. import BlastDelta from './modal/blastDelta.vue';
  57. import BlastDelta1 from './modal/blastDelta1.vue';
  58. import * as echarts from 'echarts';
  59. import { Progress } from 'ant-design-vue';
  60. import { useGlobSetting } from '/@/hooks/setting';
  61. // import 'ant-design-vue/dist/antd.css'; // 引入样式
  62. let selectList = ref<any[]>([]);
  63. let jcddArr = ref<any[]>([]);
  64. let formSearch = reactive({
  65. pageNum: 1,
  66. pageSize: 1000,
  67. id: '',
  68. fileName: '',
  69. });
  70. const total = ref(0);
  71. const { sysOrgCode } = useGlobSetting();
  72. const qfqCount = ref(0); // 潜伏期
  73. const latentCount = ref(0); // 缓慢氧化阶段(潜伏期)
  74. const selfHeatingCount = ref(0); // 加速氧化阶段(自热期)
  75. const combustionCount = ref(0); // 剧烈氧化阶段(燃烧期)
  76. const qfqPercent = ref(0); // 潜伏期(潜伏期)
  77. const latentPercent = ref(0); // 缓慢氧化阶段(潜伏期)
  78. const selfHeatingPercent = ref(0); // 加速氧化阶段(自热期)
  79. const combustionPercent = ref(0); // 剧烈氧化阶段(燃烧期)
  80. let tableData = ref<any[]>([]);
  81. let modalVisible = ref(false);
  82. let selectedFileId = ref<string | null>(null);
  83. const posMonitor = shallowRef({});
  84. const computedColumns = computed(() => {
  85. switch (sysOrgCode) {
  86. case 'sdmtjtdltmkhjtj':
  87. return Hjtcolumns; // 活鸡兔对应的列配置
  88. case 'sdmtjtBdmk':
  89. return Bdcolumns; // 保德对应的列配置
  90. case 'sdmtjtbltmk':
  91. return Bltcolumns; // 补连塔对应的列配置
  92. case 'sdmtjtsgtmk':
  93. return Sgtcolumns; // 石圪台对应的列配置
  94. case 'sdmtjtyjlmk':
  95. return Yjlcolumns; // 榆家梁对应的列配置
  96. default:
  97. return Sgtcolumns; // 默认情况下返回的列配置
  98. }
  99. });
  100. function updateChart(data: any) {
  101. const chartDom = document.getElementById('barChart');
  102. const myChart = echarts.init(chartDom);
  103. const categories = data.map((item: any) => item.jcdd);
  104. const c2h2MaxValues = data.map((item: any) => parseFloat(item.c2h2_max));
  105. const c2h2MinValues = data.map((item: any) => parseFloat(item.c2h2_min));
  106. const c2h2AveValues = data.map((item: any) => parseFloat(item.c2h2_ave));
  107. const c2h4MaxValues = data.map((item: any) => parseFloat(item.c2h4_max));
  108. const c2h4MinValues = data.map((item: any) => parseFloat(item.c2h4_min));
  109. const c2h4AveValues = data.map((item: any) => parseFloat(item.c2h4_ave));
  110. const ch4MaxValues = data.map((item: any) => parseFloat(item.ch4_max));
  111. const ch4MinValues = data.map((item: any) => parseFloat(item.ch4_min));
  112. const ch4AveValues = data.map((item: any) => parseFloat(item.ch4_ave));
  113. const co2MaxValues = data.map((item: any) => parseFloat(item.co2_max));
  114. const co2MinValues = data.map((item: any) => parseFloat(item.co2_min));
  115. const co2AveValues = data.map((item: any) => parseFloat(item.co2_ave));
  116. const coMaxValues = data.map((item: any) => parseFloat(item.co_max));
  117. const coMinValues = data.map((item: any) => parseFloat(item.co_min));
  118. const coAveValues = data.map((item: any) => parseFloat(item.co_ave));
  119. const o2MaxValues = data.map((item: any) => parseFloat(item.o2_max));
  120. const o2MinValues = data.map((item: any) => parseFloat(item.o2_min));
  121. const o2AveValues = data.map((item: any) => parseFloat(item.o2_ave));
  122. const n2MaxValues = data.map((item: any) => parseFloat(item.n2_max));
  123. const n2MinValues = data.map((item: any) => parseFloat(item.n2_min));
  124. const n2AveValues = data.map((item: any) => parseFloat(item.n2_ave));
  125. const no2MaxValues = data.map((item: any) => parseFloat(item.no2_max));
  126. const no2MinValues = data.map((item: any) => parseFloat(item.no2_min));
  127. const no2AveValues = data.map((item: any) => parseFloat(item.no2_ave));
  128. const h2MaxValues = data.map((item: any) => parseFloat(item.h2_max));
  129. const h2MinValues = data.map((item: any) => parseFloat(item.h2_min));
  130. const h2AveValues = data.map((item: any) => parseFloat(item.h2_ave));
  131. const getSeriesConfig = (sysOrgCode) => {
  132. switch (sysOrgCode) {
  133. case 'sdmtjtdltmkhjtj':
  134. return [
  135. {
  136. name: 'CO₂最大值',
  137. data: co2MaxValues,
  138. type: 'bar',
  139. },
  140. {
  141. name: 'CO₂平均值',
  142. data: co2AveValues,
  143. type: 'bar',
  144. },
  145. {
  146. name: 'CO最大值',
  147. data: coMaxValues,
  148. type: 'bar',
  149. },
  150. {
  151. name: 'CO平均值',
  152. data: coAveValues,
  153. type: 'bar',
  154. },
  155. {
  156. name: 'O₂最小值',
  157. data: o2MinValues,
  158. type: 'bar',
  159. },
  160. {
  161. name: 'O₂平均值',
  162. data: o2AveValues,
  163. type: 'bar',
  164. },
  165. {
  166. name: 'CH₄最大值',
  167. data: ch4MaxValues,
  168. type: 'bar',
  169. },
  170. {
  171. name: 'CH₄平均值',
  172. data: ch4AveValues,
  173. type: 'bar',
  174. },
  175. {
  176. name: 'N₂最大值',
  177. data: n2MaxValues,
  178. type: 'bar',
  179. },
  180. {
  181. name: 'N₂平均值',
  182. data: n2AveValues,
  183. type: 'bar',
  184. },
  185. {
  186. name: 'C₂H₂最大值',
  187. data: c2h2MaxValues,
  188. type: 'bar',
  189. },
  190. {
  191. name: 'C₂H₂平均值',
  192. data: c2h2AveValues,
  193. type: 'bar',
  194. },
  195. {
  196. name: 'C₂H₄最大值',
  197. data: c2h4MaxValues,
  198. type: 'bar',
  199. },
  200. {
  201. name: 'C₂H₄平均值',
  202. data: c2h4AveValues,
  203. type: 'bar',
  204. },
  205. ];
  206. case 'sdmtjtswmk':
  207. return [
  208. {
  209. name: 'C₂H₂最大值',
  210. data: c2h2MaxValues,
  211. type: 'bar',
  212. },
  213. {
  214. name: 'C₂H₂平均值',
  215. data: c2h2AveValues,
  216. type: 'bar',
  217. },
  218. {
  219. name: 'C₂H₄最大值',
  220. data: c2h4MaxValues,
  221. type: 'bar',
  222. },
  223. {
  224. name: 'C₂H₄平均值',
  225. data: c2h4AveValues,
  226. type: 'bar',
  227. },
  228. {
  229. name: 'CH₄最大值',
  230. data: ch4MaxValues,
  231. type: 'bar',
  232. },
  233. {
  234. name: 'CH₄平均值',
  235. data: ch4AveValues,
  236. type: 'bar',
  237. },
  238. {
  239. name: 'CO₂最大值',
  240. data: co2MaxValues,
  241. type: 'bar',
  242. },
  243. {
  244. name: 'CO₂平均值',
  245. data: co2AveValues,
  246. type: 'bar',
  247. },
  248. {
  249. name: 'CO最大值',
  250. data: coMaxValues,
  251. type: 'bar',
  252. },
  253. {
  254. name: 'CO平均值',
  255. data: coAveValues,
  256. type: 'bar',
  257. },
  258. {
  259. name: 'O₂最小值',
  260. data: o2MinValues,
  261. type: 'bar',
  262. },
  263. {
  264. name: 'O₂平均值',
  265. data: o2AveValues,
  266. type: 'bar',
  267. },
  268. {
  269. name: 'N₂最大值',
  270. data: n2MaxValues,
  271. type: 'bar',
  272. },
  273. {
  274. name: 'N₂平均值',
  275. data: n2AveValues,
  276. type: 'bar',
  277. },
  278. {
  279. name: 'NO₂最大值',
  280. data: no2MaxValues,
  281. type: 'bar',
  282. },
  283. {
  284. name: 'NO₂平均值',
  285. data: no2AveValues,
  286. type: 'bar',
  287. },
  288. ];
  289. case 'sdmtjtBdmk':
  290. return [
  291. {
  292. name: 'O₂最大值',
  293. data: o2MaxValues,
  294. type: 'bar',
  295. },
  296. {
  297. name: 'O₂最小值',
  298. data: o2MinValues,
  299. type: 'bar',
  300. },
  301. {
  302. name: 'O₂平均值',
  303. data: o2AveValues,
  304. type: 'bar',
  305. },
  306. {
  307. name: 'N₂最大值',
  308. data: n2MaxValues,
  309. type: 'bar',
  310. },
  311. {
  312. name: 'N₂最小值',
  313. data: n2MinValues,
  314. type: 'bar',
  315. },
  316. {
  317. name: 'N₂平均值',
  318. data: n2AveValues,
  319. type: 'bar',
  320. },
  321. {
  322. name: 'CO最大值',
  323. data: coMaxValues,
  324. type: 'bar',
  325. },
  326. {
  327. name: 'CO最小值',
  328. data: coMinValues,
  329. type: 'bar',
  330. },
  331. {
  332. name: 'CO平均值',
  333. data: coAveValues,
  334. type: 'bar',
  335. },
  336. {
  337. name: 'CO₂最大值',
  338. data: co2MaxValues,
  339. type: 'bar',
  340. },
  341. {
  342. name: 'CO₂最小值',
  343. data: co2MinValues,
  344. type: 'bar',
  345. },
  346. {
  347. name: 'CO₂平均值',
  348. data: co2AveValues,
  349. type: 'bar',
  350. },
  351. {
  352. name: 'CH₄最大值',
  353. data: ch4MaxValues,
  354. type: 'bar',
  355. },
  356. {
  357. name: 'CH₄最小值',
  358. data: ch4MinValues,
  359. type: 'bar',
  360. },
  361. {
  362. name: 'CH₄平均值',
  363. data: ch4AveValues,
  364. type: 'bar',
  365. },
  366. {
  367. name: 'C₂H₄最大值',
  368. data: c2h4MaxValues,
  369. type: 'bar',
  370. },
  371. {
  372. name: 'C₂H₄最小值',
  373. data: c2h4MinValues,
  374. type: 'bar',
  375. },
  376. {
  377. name: 'C₂H₄平均值',
  378. data: c2h4AveValues,
  379. type: 'bar',
  380. },
  381. {
  382. name: 'C₂H₂最大值',
  383. data: c2h2MaxValues,
  384. type: 'bar',
  385. },
  386. {
  387. name: 'C₂H₂最小值',
  388. data: c2h2MinValues,
  389. type: 'bar',
  390. },
  391. {
  392. name: 'C₂H₂平均值',
  393. data: c2h2AveValues,
  394. type: 'bar',
  395. },
  396. {
  397. name: 'H₂最大值',
  398. data: h2MaxValues,
  399. type: 'bar',
  400. },
  401. {
  402. name: 'H₂最小值',
  403. data: h2MinValues,
  404. type: 'bar',
  405. },
  406. {
  407. name: 'H₂平均值',
  408. data: h2AveValues,
  409. type: 'bar',
  410. },
  411. {
  412. name: 'NO₂最大值',
  413. data: no2MaxValues,
  414. type: 'bar',
  415. },
  416. {
  417. name: 'NO₂最小值',
  418. data: no2MinValues,
  419. type: 'bar',
  420. },
  421. {
  422. name: 'NO₂平均值',
  423. data: no2AveValues,
  424. type: 'bar',
  425. },
  426. ];
  427. case 'sdmtjtBltmk':
  428. return [
  429. {
  430. name: 'O₂最大值',
  431. data: o2MaxValues,
  432. type: 'bar',
  433. },
  434. {
  435. name: 'O₂最小值',
  436. data: o2MinValues,
  437. type: 'bar',
  438. },
  439. {
  440. name: 'O₂平均值',
  441. data: o2AveValues,
  442. type: 'bar',
  443. },
  444. {
  445. name: 'N₂最大值',
  446. data: n2MaxValues,
  447. type: 'bar',
  448. },
  449. {
  450. name: 'N₂最小值',
  451. data: n2MinValues,
  452. type: 'bar',
  453. },
  454. {
  455. name: 'N₂平均值',
  456. data: n2AveValues,
  457. type: 'bar',
  458. },
  459. {
  460. name: 'CO最大值',
  461. data: coMaxValues,
  462. type: 'bar',
  463. },
  464. {
  465. name: 'CO最小值',
  466. data: coMinValues,
  467. type: 'bar',
  468. },
  469. {
  470. name: 'CO平均值',
  471. data: coAveValues,
  472. type: 'bar',
  473. },
  474. {
  475. name: 'CO₂最大值',
  476. data: co2MaxValues,
  477. type: 'bar',
  478. },
  479. {
  480. name: 'CO₂最小值',
  481. data: co2MinValues,
  482. type: 'bar',
  483. },
  484. {
  485. name: 'CO₂平均值',
  486. data: co2AveValues,
  487. type: 'bar',
  488. },
  489. {
  490. name: 'CH₄最大值',
  491. data: ch4MaxValues,
  492. type: 'bar',
  493. },
  494. {
  495. name: 'CH₄最小值',
  496. data: ch4MinValues,
  497. type: 'bar',
  498. },
  499. {
  500. name: 'CH₄平均值',
  501. data: ch4AveValues,
  502. type: 'bar',
  503. },
  504. {
  505. name: 'C₂H₄最大值',
  506. data: c2h4MaxValues,
  507. type: 'bar',
  508. },
  509. {
  510. name: 'C₂H₄最小值',
  511. data: c2h4MinValues,
  512. type: 'bar',
  513. },
  514. {
  515. name: 'C₂H₄平均值',
  516. data: c2h4AveValues,
  517. type: 'bar',
  518. },
  519. {
  520. name: 'C₂H₂最大值',
  521. data: c2h2MaxValues,
  522. type: 'bar',
  523. },
  524. {
  525. name: 'C₂H₂最小值',
  526. data: c2h2MinValues,
  527. type: 'bar',
  528. },
  529. {
  530. name: 'C₂H₂平均值',
  531. data: c2h2AveValues,
  532. type: 'bar',
  533. },
  534. ];
  535. case 'sdmtjtyjlmk':
  536. return [
  537. {
  538. name: 'O₂',
  539. data: o2AveValues,
  540. yAxisIndex: 0,
  541. type: 'bar',
  542. },
  543. {
  544. name: 'N₂',
  545. data: n2AveValues,
  546. yAxisIndex: 0,
  547. type: 'bar',
  548. },
  549. {
  550. name: 'CO',
  551. data: coAveValues,
  552. yAxisIndex: 1,
  553. type: 'bar',
  554. },
  555. {
  556. name: 'CO₂',
  557. data: co2AveValues,
  558. yAxisIndex: 1,
  559. type: 'bar',
  560. },
  561. {
  562. name: 'CH₄',
  563. data: ch4AveValues,
  564. yAxisIndex: 1,
  565. type: 'bar',
  566. },
  567. {
  568. name: 'C₂H₄',
  569. data: c2h4AveValues,
  570. type: 'bar',
  571. yAxisIndex: 1,
  572. },
  573. {
  574. name: 'C₂H₂',
  575. data: c2h2AveValues,
  576. type: 'bar',
  577. yAxisIndex: 1,
  578. },
  579. ];
  580. default:
  581. return [
  582. {
  583. name: 'C₂H₂最大值',
  584. data: c2h2MaxValues,
  585. type: 'bar',
  586. },
  587. {
  588. name: 'C₂H₂平均值',
  589. data: c2h2AveValues,
  590. type: 'bar',
  591. },
  592. {
  593. name: 'C₂H₄最大值',
  594. data: c2h4MaxValues,
  595. type: 'bar',
  596. },
  597. {
  598. name: 'C₂H₄平均值',
  599. data: c2h4AveValues,
  600. type: 'bar',
  601. },
  602. {
  603. name: 'CH₄最大值',
  604. data: ch4MaxValues,
  605. type: 'bar',
  606. },
  607. {
  608. name: 'CH₄平均值',
  609. data: ch4AveValues,
  610. type: 'bar',
  611. },
  612. {
  613. name: 'CO₂最大值',
  614. data: co2MaxValues,
  615. type: 'bar',
  616. },
  617. {
  618. name: 'CO₂平均值',
  619. data: co2AveValues,
  620. type: 'bar',
  621. },
  622. {
  623. name: 'CO最大值',
  624. data: coMaxValues,
  625. type: 'bar',
  626. },
  627. {
  628. name: 'CO平均值',
  629. data: coAveValues,
  630. type: 'bar',
  631. },
  632. {
  633. name: 'O₂最小值',
  634. data: o2MinValues,
  635. type: 'bar',
  636. },
  637. {
  638. name: 'O₂平均值',
  639. data: o2AveValues,
  640. type: 'bar',
  641. },
  642. // {
  643. // name: 'N₂最大值',
  644. // data: n2MaxValues,
  645. // type: 'bar',
  646. // },
  647. // {
  648. // name: 'N₂平均值',
  649. // data: n2AveValues,
  650. // type: 'bar',
  651. // },
  652. // {
  653. // name: 'NO₂最大值',
  654. // data: no2MaxValues,
  655. // type: 'bar',
  656. // },
  657. // {
  658. // name: 'NO₂平均值',
  659. // data: no2AveValues,
  660. // type: 'bar',
  661. // },
  662. ];
  663. }
  664. };
  665. const seriesConfig = getSeriesConfig(sysOrgCode);
  666. const option = {
  667. tooltip: {
  668. trigger: 'axis',
  669. backgroundColor: 'rgba(28, 72, 105, 0.5)', // 设置 tooltip 背景为透明
  670. textStyle: {
  671. color: '#ffffff', // 设置 tooltip 字体颜色为白色
  672. },
  673. axisPointer: {
  674. type: 'shadow',
  675. label: {
  676. show: true,
  677. backgroundColor: '#1c4869',
  678. },
  679. },
  680. },
  681. legend: {
  682. top: '2%',
  683. textStyle: {
  684. color: '#ffffffff',
  685. },
  686. width: '80%', // 设置图例的宽度
  687. orient: 'horizontal', // 水平布局
  688. pageIconColor: '#ffffff', // 设置翻页图标颜色
  689. pageTextStyle: {
  690. color: '#ffffff', // 设置翻页文字颜色
  691. },
  692. },
  693. xAxis: {
  694. type: 'category',
  695. data: categories,
  696. splitLine: { show: true, lineStyle: { color: 'rgba(28, 72, 105, 0.5)' } },
  697. axisLabel: {
  698. interval: 0, // 显示所有标签
  699. color: '#ffffff', // 设置 x 轴字体颜色
  700. formatter: function (value: string) {
  701. return value.length > 8 ? value.slice(0, 8) + '...' : value; // 截断长标签
  702. },
  703. },
  704. },
  705. yAxis: {
  706. type: 'value',
  707. splitLine: { show: true, lineStyle: { color: 'rgba(28, 72, 105, 0.5)' } },
  708. axisLabel: {
  709. color: '#ffffff',
  710. },
  711. },
  712. dataZoom: [
  713. {
  714. type: 'slider', // 会创建一个滑块来选择要显示的区域
  715. start: 0, // 初始选中范围的起始百分比
  716. end: (5 / categories.length) * 100, // 初始选中范围的结束百分比,根据数据条数调整
  717. minSpan: (5 / categories.length) * 100, // 最小选中范围,根据数据条数调整
  718. maxSpan: (5 / categories.length) * 100, // 最大选中范围,根据数据条数调整
  719. show: true,
  720. height: 10, // 设置滑块高度
  721. bottom: 1, // 设置滑块距离容器底部的距离
  722. borderColor: 'transparent', // 设置边框颜色为透明
  723. backgroundColor: '#F6F7FB', // 设置背景颜色
  724. handleIcon: 'path://M512,512m-448,0a448,448,0,1,0,896,0a448,448,0,1,0,-896,0Z', // 设置手柄图标为圆形
  725. handleColor: '#C2D2FF', // 设置手柄颜色
  726. handleSize: 13, // 设置手柄大小
  727. handleStyle: {
  728. borderColor: '#C2D2FF', // 设置手柄边框颜色
  729. },
  730. fillerColor: '#C2D2FF', // 设置选中范围的填充颜色
  731. },
  732. ],
  733. grid: {
  734. top: '21%', // 设置 grid 距离顶部的距离,增加间隔
  735. left: '3%',
  736. right: '4%',
  737. bottom: '3%',
  738. containLabel: true,
  739. },
  740. series: seriesConfig,
  741. };
  742. myChart.setOption(option);
  743. }
  744. //跳转到爆炸三角形
  745. function toDetail(record: any) {
  746. posMonitor.value = record;
  747. modalVisible.value = true;
  748. }
  749. //获取束管日报
  750. async function getTableList(params: any) {
  751. let res = await getBundleInfoList({ type: 'bundle', ...params });
  752. const content = res.content;
  753. let contentArr = JSON.parse(content);
  754. // const contentNewArr = computed(() => {
  755. // return contentArr.map((item) => {
  756. // let internalFireWarnLevel = '';
  757. // const co = item.co_ave;
  758. // const co2 = item.co2_ave;
  759. // const c2h4 = item.c2h4_ave;
  760. // const c2h2 = item.c2h2_ave;
  761. // const coRatio = co / co2;
  762. // if (co >= 0 && co <= 13.75) {
  763. // internalFireWarnLevel = '潜伏期阶段';
  764. // } else if (co > 13.75 && co < 67.2 && coRatio < 0.095) {
  765. // internalFireWarnLevel = '缓慢氧化升温阶段';
  766. // } else if ((co >= 67.2 && co < 1606.3) || (coRatio >= 0.095 && coRatio < 0.322) || c2h4 < 2) {
  767. // internalFireWarnLevel = '加速氧化阶段';
  768. // } else if (co >= 1606.3 || coRatio >= 0.322 || c2h4 >= 2 || c2h2 > 0) {
  769. // internalFireWarnLevel = '剧烈氧化阶段';
  770. // }
  771. // return { ...item, internalFireWarnLevel };
  772. // });
  773. // });
  774. total.value = contentArr.length;
  775. qfqCount.value = contentArr.filter((item: any) => item.internalFireWarnLevel === '潜伏期阶段').length;
  776. latentCount.value = contentArr.filter((item: any) => item.internalFireWarnLevel === '缓慢氧化升温阶段').length;
  777. selfHeatingCount.value = contentArr.filter((item: any) => item.internalFireWarnLevel === '加速氧化升温阶段').length;
  778. combustionCount.value = contentArr.filter((item: any) => item.internalFireWarnLevel === '剧烈氧化升温阶段').length;
  779. qfqPercent.value = (qfqCount.value / total.value) * 100;
  780. latentPercent.value = (latentCount.value / total.value) * 100;
  781. selfHeatingPercent.value = (selfHeatingCount.value / total.value) * 100;
  782. combustionPercent.value = (combustionCount.value / total.value) * 100;
  783. tableData.value = contentArr;
  784. nextTick(() => {
  785. updateChart(contentArr);
  786. });
  787. }
  788. async function getTableListById(params: any) {
  789. let res = await getAllFileListById({ ...params });
  790. const content = res.content;
  791. let contentArr = JSON.parse(content);
  792. total.value = contentArr.length;
  793. qfqCount.value = contentArr.filter((item: any) => item.internalFireWarnLevel === '潜伏期阶段').length;
  794. latentCount.value = contentArr.filter((item: any) => item.internalFireWarnLevel === '缓慢氧化升温阶段').length;
  795. selfHeatingCount.value = contentArr.filter((item: any) => item.internalFireWarnLevel === '加速氧化升温阶段').length;
  796. combustionCount.value = contentArr.filter((item: any) => item.internalFireWarnLevel === '剧烈氧化升温阶段').length;
  797. qfqPercent.value = (qfqCount.value / total.value) * 100;
  798. latentPercent.value = (latentCount.value / total.value) * 100;
  799. selfHeatingPercent.value = (selfHeatingCount.value / total.value) * 100;
  800. combustionPercent.value = (combustionCount.value / total.value) * 100;
  801. tableData.value = contentArr;
  802. nextTick(() => {
  803. updateChart(contentArr);
  804. });
  805. }
  806. //获取所有文件列表
  807. async function getAllFile() {
  808. let res = await getAllFileList({ type: 'bundle' });
  809. selectList.value = res.records.map((item: any) => ({
  810. id: item.id,
  811. fileName: item.fileName,
  812. }));
  813. jcddArr.value = res.records.map((item: any) => ({
  814. id: item.jcdd,
  815. }));
  816. if (selectList.value.length > 0) {
  817. formSearch.id = selectList.value[0].id;
  818. getSearch();
  819. }
  820. }
  821. // 处理文件点击事件
  822. function handleFileClick(item: any) {
  823. formSearch.id = item.id;
  824. formSearch.fileName = item.fileName;
  825. selectedFileId.value = item.id;
  826. getSearch();
  827. }
  828. //查询
  829. function getSearch() {
  830. // const selectedFile = selectList.value.find((item) => item.id === formSearch.id);
  831. const params = {
  832. id: formSearch.id,
  833. // fileName: selectedFile ? selectedFile.fileName : '',
  834. };
  835. getTableListById(params);
  836. }
  837. onMounted(() => {
  838. getTableList({ type: 'bundle' });
  839. getAllFile().then(() => {
  840. if (selectList.value.length > 0) {
  841. formSearch.id = selectList.value[0].id;
  842. selectedFileId.value = selectList.value[0].id;
  843. getSearch();
  844. }
  845. });
  846. });
  847. </script>
  848. <style lang="less" scoped>
  849. @import '/@/design/theme.less';
  850. .content-container {
  851. display: flex;
  852. width: 100%;
  853. height: 100%;
  854. padding-top: 54px;
  855. }
  856. .file-list {
  857. width: 20%;
  858. padding: 10px;
  859. margin-right: 10px;
  860. margin-bottom: 50px;
  861. border: 1px solid #99e8ff66;
  862. background: #27546e1a;
  863. box-shadow: 0px 0px 20px 7px rgba(145, 233, 254, 0.7) inset;
  864. -moz-box-shadow: 0px 0px 20px 7px rgba(145, 233, 254, 0.7) inset;
  865. -webkit-box-shadow: 0px 0px 50px 1px rgb(149 235 255 / 5%) inset;
  866. }
  867. .file-list ul {
  868. list-style: none;
  869. padding: 0;
  870. }
  871. .file-list li {
  872. color: #fff;
  873. padding: 5px;
  874. cursor: pointer;
  875. }
  876. .file-list li:hover,
  877. .file-list li.selected {
  878. background: #1c4869;
  879. }
  880. .table-container {
  881. margin-top: 10px;
  882. width: 80%;
  883. box-sizing: border-box;
  884. }
  885. .data-container {
  886. margin-top: 40px;
  887. display: flex;
  888. width: 100%;
  889. height: 100%;
  890. }
  891. .bar-chart {
  892. flex: 3; /* 占据 3/4 的空间 */
  893. width: 100%;
  894. height: 400px;
  895. }
  896. .data-content {
  897. flex: 1; /* 占据 1/4 的空间 */
  898. height: 400px;
  899. display: flex;
  900. flex-direction: column; /* 垂直排列进度条 */
  901. // align-items: center; /* 水平居中 */
  902. margin: 10px;
  903. .title {
  904. font-size: 18px;
  905. font-weight: 600;
  906. color: #fff;
  907. margin-bottom: 20px;
  908. }
  909. .explain {
  910. color: var(--vent-table-action-link);
  911. margin-top: 18px;
  912. }
  913. }
  914. .dustMonitor {
  915. width: 100%;
  916. height: 100%;
  917. padding: 10px 10px 15px 10px;
  918. box-sizing: border-box;
  919. position: relative;
  920. }
  921. .yellow-progress .ant-progress-bg {
  922. background-color: yellow !important;
  923. }
  924. :deep(.zxm-table-thead > tr > th:last-child) {
  925. border-right: 1px solid #91e9fe !important;
  926. }
  927. :deep(.zxm-picker-input > input) {
  928. color: #fff;
  929. }
  930. :deep(.zxm-select:not(.zxm-select-customize-input) .zxm-select-selector) {
  931. border: 1px solid var(--vent-form-item-border) !important;
  932. background-color: #ffffff00 !important;
  933. }
  934. :deep(.zxm-select-selection-item) {
  935. color: #fff !important;
  936. }
  937. .blast-delta-container {
  938. margin: 50px;
  939. display: flex;
  940. justify-content: space-between;
  941. }
  942. .progress {
  943. width: 100%;
  944. height: 20px;
  945. margin-top: 10px;
  946. }
  947. .progress-label {
  948. margin-top: 20px;
  949. text-align: left;
  950. margin-bottom: 5px;
  951. color: #fff;
  952. }
  953. ::deep .progress-text {
  954. color: #fff !important; /* 自定义百分比文字颜色 */
  955. }
  956. </style>