index.vue 27 KB

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