123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577 |
- <template>
- <div class="dustMonitor">
- <customHeader>色谱仪报表分析</customHeader>
- <div class="content-container">
- <div class="file-list">
- <ul>
- <li v-for="item in selectList" :key="item.id" :class="{ selected: item.id === selectedFileId }" @click="handleFileClick(item)">
- {{ item.fileName }}
- </li>
- </ul>
- </div>
- <div class="table-container">
- <a-table :columns="computedColumns" :data-source="tableData" size="small" :pagination="false" :scroll="{ y: 300 }" class="tableW">
- <template #bodyCell="{ column, record }">
- <template v-if="column.dataIndex === 'action'">
- <a class="action-link" @click="toDetail(record)">数据分析</a>
- </template>
- </template>
- </a-table>
- <div class="data-container">
- <div id="lineChart" class="line-chart"></div>
- <div class="data-content">
- <div class="title">煤自燃阶段统计分析</div>
- <div class="explain">测点共计{{ total }}个</div>
- <div class="progress-label">潜伏期阶段:{{ qfqCount }}</div>
- <Progress :percent="qfqPercent" size="default" strokeColor="green" :show-info="true" :format="() => qfqCount" />
- <div class="progress-label">缓慢氧化升温阶段:{{ latentCount }}</div>
- <Progress :percent="latentPercent" size="default" strokeColor="yellow" :show-info="true" :format="() => latentCount" />
- <div class="progress-label">加速氧化升温阶段:{{ selfHeatingCount }}</div>
- <Progress :percent="selfHeatingPercent" size="default" strokeColor="orange" :show-info="true" :format="() => selfHeatingCount" />
- <div class="progress-label">剧烈氧化升温阶段:{{ combustionCount }}</div>
- <Progress :percent="combustionPercent" size="default" strokeColor="red" :show-info="true" :format="() => combustionCount" />
- </div>
- </div>
- </div>
- </div>
- <a-modal style="width: 600px; height: 300px" title="爆炸三角形" v-model:visible="modalVisible" :draggable="true" :footer="null">
- <div class="blast-delta-container">
- <BlastDelta :posMonitor="posMonitor" />
- </div>
- </a-modal>
- </div>
- </template>
- <script setup lang="ts">
- import { ref, onMounted, computed, reactive, shallowRef } from 'vue';
- import { columns, Hjtcolumns, Bdcolumns, Bltcolumns, Sgtcolumns } from './bundleSpy-table.data';
- import { getbundleSpyInfoList, getAllFileList, getAllFileListById } from './bundleSpy-table.api';
- import customHeader from '/@/components/vent/customHeader.vue';
- import * as echarts from 'echarts';
- import BlastDelta from './modal/blastDelta.vue';
- import { Progress } from 'ant-design-vue';
- import { useGlobSetting } from '/@/hooks/setting';
- let selectList = ref<any[]>([]);
- let formSearch = reactive({
- pageNum: 1,
- pageSize: 1000,
- id: '',
- fileName: '',
- });
- const total = ref(0);
- const { sysOrgCode } = useGlobSetting();
- const qfqCount = ref(0);
- const latentCount = ref(0);
- const selfHeatingCount = ref(0);
- const combustionCount = ref(0);
- const qfqPercent = ref(0);
- const latentPercent = ref(0);
- const selfHeatingPercent = ref(0);
- const combustionPercent = ref(0);
- let tableData = ref<any[]>([]);
- let selectedFileId = ref<string | null>(null);
- let modalVisible = ref(false);
- const posMonitor = shallowRef({});
- const computedColumns = computed(() => {
- switch (sysOrgCode) {
- case 'sdmtjtdltmkhjtj':
- return Hjtcolumns;
- case 'sdmtjtBdmk':
- return Bdcolumns;
- case 'sdmtjtbltmk':
- return Bltcolumns;
- case 'sdmtjtsgtmk':
- return Sgtcolumns;
- default:
- return Bdcolumns;
- }
- });
- async function getTableList(params: any) {
- let res = await getbundleSpyInfoList({ type: 'bundleSpy', ...params });
- const content = res.content;
- let contentArr = JSON.parse(content);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- total.value = contentArr.length;
- qfqCount.value = contentArr.filter((item: any) => item.internalFireWarnLevel === '潜伏期阶段').length;
- latentCount.value = contentArr.filter((item: any) => item.internalFireWarnLevel === '缓慢氧化升温阶段').length;
- selfHeatingCount.value = contentArr.filter((item: any) => item.internalFireWarnLevel === '加速氧化升温阶段').length;
- combustionCount.value = contentArr.filter((item: any) => item.internalFireWarnLevel === '剧烈氧化升温阶段').length;
- qfqPercent.value = (qfqCount.value / total.value) * 100;
- latentPercent.value = (latentCount.value / total.value) * 100;
- selfHeatingPercent.value = (selfHeatingCount.value / total.value) * 100;
- combustionPercent.value = (combustionCount.value / total.value) * 100;
- tableData.value = contentArr;
- updateChart(contentArr);
- }
- async function getTableListById(params: any) {
- let res = await getAllFileListById({ ...params });
- const content = res.content;
- let contentArr = JSON.parse(content);
- total.value = contentArr.length;
- qfqCount.value = contentArr.filter((item: any) => item.internalFireWarnLevel === '潜伏期阶段').length;
- latentCount.value = contentArr.filter((item: any) => item.internalFireWarnLevel === '缓慢氧化升温阶段').length;
- selfHeatingCount.value = contentArr.filter((item: any) => item.internalFireWarnLevel === '加速氧化升温阶段').length;
- combustionCount.value = contentArr.filter((item: any) => item.internalFireWarnLevel === '剧烈氧化升温阶段').length;
- qfqPercent.value = (qfqCount.value / total.value) * 100;
- latentPercent.value = (latentCount.value / total.value) * 100;
- selfHeatingPercent.value = (selfHeatingCount.value / total.value) * 100;
- combustionPercent.value = (combustionCount.value / total.value) * 100;
- tableData.value = contentArr;
- updateChart(contentArr);
- }
- function toDetail(record: any) {
- posMonitor.value = record;
- console.log(posMonitor.value);
- modalVisible.value = true;
- }
- function updateChart(data: any) {
- const chartDom = document.getElementById('lineChart');
- const myChart = echarts.init(chartDom);
- const categories = data.map((item: any) => item.jcdd);
- const c2h2AveValues = data.map((item: any) => parseFloat(item.c2h2_ave));
- const c2h4AveValues = data.map((item: any) => parseFloat(item.c2h4_ave));
- const ch4AveValues = data.map((item: any) => parseFloat(item.ch4_ave));
- const co2AveValues = data.map((item: any) => parseFloat(item.co2_ave));
- const coAveValues = data.map((item: any) => parseFloat(item.co_ave));
- const o2AveValues = data.map((item: any) => parseFloat(item.o2_ave));
- const n2AveValues = data.map((item: any) => parseFloat(item.n2_ave));
- const c2h6AveValues = data.map((item: any) => parseFloat(item.c2h6_ave));
- const c3h8AveValues = data.map((item: any) => parseFloat(item.c3h8_ave));
- const ch4AveBqValues = data.map((item: any) => parseFloat(item.ch4_ave_bq));
- const o2AveBqValues = data.map((item: any) => parseFloat(item.o2_ave_bq));
- const getSeriesConfig = (sysOrgCode) => {
- switch (sysOrgCode) {
- case 'sdmtjtdltmkhjtj':
- return [
- {
- name: 'CH₄闭内',
- data: ch4AveValues,
- yAxisIndex: 1,
- type: 'bar',
- },
- {
- name: 'O₂闭内',
- data: ch4AveValues,
- yAxisIndex: 1,
- type: 'bar',
- },
- {
- name: 'CO₂闭内',
- data: co2AveValues,
- yAxisIndex: 1,
- type: 'bar',
- },
- {
- name: 'CO闭内',
- data: coAveValues,
- yAxisIndex: 1,
- type: 'bar',
- },
- {
- name: 'CH₄闭前',
- data: ch4AveBqValues,
- yAxisIndex: 1,
- type: 'bar',
- },
- {
- name: 'O₂闭前',
- data: o2AveBqValues,
- yAxisIndex: 1,
- type: 'bar',
- },
- ];
- case 'sdmtjtBdmk':
- return [
- {
- name: 'O₂',
- data: o2AveValues,
- yAxisIndex: 0,
- type: 'bar',
- },
- {
- name: 'N₂',
- data: n2AveValues,
- yAxisIndex: 0,
- type: 'bar',
- },
- {
- name: 'CO',
- data: coAveValues,
- yAxisIndex: 1,
- type: 'bar',
- },
- {
- name: 'CO₂',
- data: co2AveValues,
- yAxisIndex: 1,
- type: 'bar',
- },
- {
- name: 'CH₄',
- data: ch4AveValues,
- yAxisIndex: 1,
- type: 'bar',
- },
- {
- name: 'C2H6',
- data: c2h6AveValues,
- yAxisIndex: 1,
- type: 'bar',
- },
- {
- name: 'C3H8',
- data: c3h8AveValues,
- yAxisIndex: 1,
- type: 'bar',
- },
- {
- name: 'C₂H₄',
- data: c2h4AveValues,
- type: 'bar',
- yAxisIndex: 1,
- },
- {
- name: 'C₂H₂',
- data: c2h2AveValues,
- type: 'bar',
- yAxisIndex: 1,
- },
- ];
- default:
- return [
- {
- name: 'C₂H₂',
- data: c2h2AveValues,
- type: 'bar',
- yAxisIndex: 1,
- },
- {
- name: 'C₂H₄',
- data: c2h4AveValues,
- type: 'bar',
- yAxisIndex: 1,
- },
- {
- name: 'CH₄',
- data: ch4AveValues,
- yAxisIndex: 1,
- type: 'bar',
- },
- {
- name: 'CO₂',
- data: co2AveValues,
- yAxisIndex: 1,
- type: 'bar',
- },
- {
- name: 'CO',
- data: coAveValues,
- yAxisIndex: 1,
- type: 'bar',
- },
- {
- name: 'O₂',
- data: o2AveValues,
- yAxisIndex: 0,
- type: 'bar',
- },
- {
- name: 'N₂',
- data: n2AveValues,
- yAxisIndex: 0,
- type: 'bar',
- },
- {
- name: 'C2H6',
- data: c2h6AveValues,
- yAxisIndex: 1,
- type: 'bar',
- },
- ];
- }
- };
- const seriesConfig = getSeriesConfig(sysOrgCode);
- const option = {
- tooltip: {
- trigger: 'axis',
- backgroundColor: 'rgba(28, 72, 105, 0.5)',
- textStyle: {
- color: '#ffffff',
- },
- axisPointer: {
- label: {
- show: true,
- backgroundColor: '#071c44',
- },
- },
- },
- legend: {
- top: '5%',
- textStyle: {
- color: '#ffffffff',
- },
- width: '80%',
- orient: 'horizontal',
- pageIconColor: '#ffffff',
- pageTextStyle: {
- color: '#ffffff',
- },
- },
- xAxis: {
- type: 'category',
- data: categories,
- splitLine: { show: true, lineStyle: { color: 'rgba(28, 72, 105, 0.5)' } },
- axisLabel: {
- interval: 0,
- color: '#ffffff',
- formatter: function (value: string) {
- return value.length > 12 ? value.slice(0, 12) + '...' : value;
- },
- },
- },
- yAxis: [
- {
- type: 'value',
- name: 'O₂/N₂',
- max: 100,
- splitLine: { show: true, lineStyle: { color: 'rgba(21,80,126,.5)' } },
- axisLabel: {
- color: '#ffffff',
- },
- },
- {
- type: 'value',
- name: '其他气体',
- splitLine: { show: true, lineStyle: { color: 'rgba(21,80,126,.5)' } },
- axisLabel: {
- color: '#ffffff',
- },
- },
- ],
- dataZoom: [
- {
- type: 'slider',
- start: 0,
- end: (5 / categories.length) * 100,
- minSpan: (5 / categories.length) * 100,
- maxSpan: (5 / categories.length) * 100,
- show: true,
- height: 10,
- bottom: 1,
- borderColor: 'transparent',
- backgroundColor: '#F6F7FB',
- handleIcon: 'path://M512,512m-448,0a448,448,0,1,0,896,0a448,448,0,1,0,-896,0Z',
- handleColor: '#C2D2FF',
- handleSize: 13,
- handleStyle: {
- borderColor: '#C2D2FF',
- },
- fillerColor: '#C2D2FF',
- },
- ],
- grid: {
- top: '21%',
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true,
- },
- series: seriesConfig,
- };
- myChart.setOption(option);
- }
- async function getAllFile() {
- let res = await getAllFileList({ type: 'bundleSpy' });
- selectList.value = res.records.map((item: any) => ({
- id: item.id,
- fileName: item.fileName,
- }));
- if (selectList.value.length > 0) {
- formSearch.id = selectList.value[0].id;
- getSearch();
- }
- }
- function handleFileClick(item: any) {
- formSearch.id = item.id;
- formSearch.fileName = item.fileName;
- selectedFileId.value = item.id;
- getSearch();
- }
- function getSearch() {
-
- const params = {
- id: formSearch.id,
-
- };
- getTableListById(params);
- }
- onMounted(() => {
- getTableList({ type: 'bundleSpy' });
- getAllFile().then(() => {
- if (selectList.value.length > 0) {
- formSearch.id = selectList.value[0].id;
- selectedFileId.value = selectList.value[0].id;
- getSearch();
- }
- });
- });
- </script>
- <style lang="less" scoped>
- @import '/@/design/theme.less';
- .content-container {
- display: flex;
- width: 100%;
- height: 100%;
- padding-top: 54px;
- }
- .file-list {
- width: 20%;
- padding: 10px;
- margin-right: 10px;
- margin-bottom: 50px;
- border: 1px solid #99e8ff66;
- background: #27546e1a;
- box-shadow: 0px 0px 20px 7px rgba(145, 233, 254, 0.7) inset;
- -moz-box-shadow: 0px 0px 20px 7px rgba(145, 233, 254, 0.7) inset;
- -webkit-box-shadow: 0px 0px 50px 1px rgb(149 235 255 / 5%) inset;
- }
- .file-list ul {
- list-style: none;
- padding: 0;
- }
- .file-list li {
- color: #fff;
- padding: 5px;
- cursor: pointer;
- }
- .file-list li:hover,
- .file-list li.selected {
- background: #1c4869;
- }
- .table-container {
- margin-top: 10px;
- width: 80%;
- box-sizing: border-box;
- }
- .dustMonitor {
- width: 100%;
- height: 100%;
- padding: 10px 10px 15px 10px;
- box-sizing: border-box;
- position: relative;
- }
- :deep(.zxm-table-thead > tr > th:last-child) {
- border-right: 1px solid #91e9fe !important;
- }
- :deep(.zxm-picker-input > input) {
- color: #fff;
- }
- :deep(.zxm-select:not(.zxm-select-customize-input) .zxm-select-selector) {
- border: 1px solid var(--vent-form-item-border) !important;
- background-color: #ffffff00 !important;
- }
- :deep(.zxm-select-selection-item) {
- color: #fff !important;
- }
- .data-container {
- margin-top: 40px;
- display: flex;
- width: 100%;
- height: 100%;
- }
- .line-chart {
- flex: 3; /* 占据 3/4 的空间 */
- width: 100%;
- height: 400px;
- }
- .data-content {
- flex: 1; /* 占据 1/4 的空间 */
- height: 400px;
- display: flex;
- flex-direction: column; /* 垂直排列进度条 */
- // align-items: center; /* 水平居中 */
- margin: 10px;
- .title {
- font-size: 18px;
- font-weight: 600;
- color: #fff;
- margin-bottom: 20px;
- }
- .explain {
- color: var(--vent-table-action-link);
- margin-top: 18px;
- }
- }
- .progress {
- width: 100%;
- height: 20px;
- margin-top: 10px;
- }
- .progress-label {
- margin-top: 20px;
- text-align: left;
- margin-bottom: 5px;
- color: #fff;
- }
- ::deep .progress-text {
- color: #fff !important; /* 自定义百分比文字颜色 */
- }
- .blast-delta-container {
- margin: 50px;
- }
- .yellow-progress .ant-progress-bg {
- background-color: yellow !important;
- }
- :deep(.zxm-table-thead > tr > th:last-child) {
- border-right: 1px solid #91e9fe !important;
- }
- </style>
|