index.vue 27 KB

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