Browse Source

色谱仪报表分析页面开发

bobo04052021@163.com 4 tháng trước cách đây
mục cha
commit
3ec5603dc3

+ 12 - 0
src/views/vent/bundleSpy/bundleSpyTable/bundleSpy-table.data.ts

@@ -91,4 +91,16 @@ export const columns: BasicColumn[] = [
     width: 100,
     align: 'center',
   },
+  {
+    title: '煤自燃阶段',
+    dataIndex: 'internalFireWarnLevel',
+    width: 100,
+    align: 'center',
+  },
+  {
+    title: '操作',
+    dataIndex: 'action',
+    width: 100,
+    align: 'center',
+  },
 ];

+ 336 - 229
src/views/vent/bundleSpy/bundleSpyTable/index.vue

@@ -10,274 +10,381 @@
         </ul>
       </div>
       <div class="table-container">
-        <a-table :columns="columns" :data-source="tableData" size="small" :scroll="{ y: 300 }" class="tableW" />
-        <div id="lineChart" class="line-chart"></div>
+        <a-table :columns="columns" :data-source="tableData" size="small" :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">测点共计{{ combustionCount + selfHeatingCount + latentCount }}个</div>
+            <div class="progress-label">剧烈氧化阶段(燃烧期):</div>
+            <Progress :percent="combustionPercent" size="default" strokeColor="red" :show-info="true" :format="() => combustionCount" />
+            <div class="progress-label">加速氧化阶段(自热期):</div>
+            <Progress :percent="selfHeatingPercent" size="default" strokeColor="yellow" :show-info="true" :format="() => selfHeatingCount" />
+            <div class="progress-label">缓慢氧化阶段(潜伏期):</div>
+            <Progress :percent="latentPercent" size="default" strokeColor="green" :show-info="true" :format="() => latentCount" />
+          </div>
+        </div>
       </div>
     </div>
+    <a-modal style="width: 26%; 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, reactive } from 'vue';
-  import { columns } from './bundleSpy-table.data';
-  import { getbundleSpyInfoList, getAllFileList } from './bundleSpy-table.api';
-  import customHeader from '/@/components/vent/customHeader.vue';
-  import * as echarts from 'echarts';
-
-  let selectList = ref<any[]>([]);
+import { ref, onMounted, reactive, shallowRef } from 'vue';
+import { columns } from './bundleSpy-table.data';
+import { getbundleSpyInfoList, getAllFileList } 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 'ant-design-vue/dist/antd.css'; // 引入样式
+let selectList = ref<any[]>([]);
 
-  let formSearch = reactive({
-    pageNum: 1,
-    pageSize: 1000,
-    fileId: '',
-    fileName: '',
-  });
-  let tableData = ref<any[]>([]);
-  let selectedFileId = ref<string | null>(null);
-  //获取色谱仪报表
-  async function getTableList(params: any) {
-    let res = await getbundleSpyInfoList({ type: 'bundleSpy', ...params });
-    const content = res.content;
-    let contentArr = JSON.parse(content);
-    tableData.value = contentArr;
-    console.log(contentArr, 'contentArr');
-    updateChart(contentArr);
-  }
+let formSearch = reactive({
+  pageNum: 1,
+  pageSize: 1000,
+  fileId: '',
+  fileName: '',
+});
+const latentCount = ref(0); // 缓慢氧化阶段(潜伏期)
+const selfHeatingCount = ref(0); // 加速氧化阶段(自热期)
+const combustionCount = 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({});
+//获取色谱仪报表
+async function getTableList(params: any) {
+  let res = await getbundleSpyInfoList({ type: 'bundleSpy', ...params });
+  const content = res.content;
+  let contentArr = JSON.parse(content);
+  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;
+  const total = contentArr.length;
+  latentPercent.value = (latentCount.value / total) * 100;
+  selfHeatingPercent.value = (selfHeatingCount.value / total) * 100;
+  combustionPercent.value = (combustionCount.value / total) * 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));
 
-  //折线图
-  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 option = {
-      title: {
-        text: '色谱仪报表分析',
-        textStyle: {
-          color: '#ffffff', // 设置标题颜色
-        },
+  const option = {
+    title: {
+      text: '色谱仪报表分析',
+      textStyle: {
+        color: '#ffffff', // 设置标题颜色
       },
-      tooltip: {
-        trigger: 'axis',
-        backgroundColor: 'rgba(28, 72, 105, 0.5)', // 设置 tooltip 背景为透明
-        textStyle: {
-          color: '#ffffff', // 设置 tooltip 字体颜色为白色
-        },
-        axisPointer: {
-          label: {
-            show: true,
-            backgroundColor: '#071c44',
-          },
+      left: 'center', // 水平居中
+      top: '0', // 设置标题距离顶部的距离
+    },
+    tooltip: {
+      trigger: 'axis',
+      backgroundColor: 'rgba(28, 72, 105, 0.5)', // 设置 tooltip 背景为透明
+      textStyle: {
+        color: '#ffffff', // 设置 tooltip 字体颜色为白色
+      },
+      axisPointer: {
+        label: {
+          show: true,
+          backgroundColor: '#071c44',
         },
       },
-      legend: {
-        top: 10,
-        textStyle: {
-          color: '#ffffffff',
+    },
+    legend: {
+      top: '9%',
+      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', // 设置 x 轴字体颜色
+        formatter: function (value: string) {
+          return value.length > 12 ? value.slice(0, 12) + '...' : value; // 截断长标签
         },
       },
-      xAxis: {
-        type: 'category',
-        data: categories,
+    },
+    yAxis: [
+      {
+        type: 'value',
+        name: 'O₂/N₂',
+        max: 100,
         splitLine: { show: true, lineStyle: { color: 'rgba(21,80,126,.5)' } },
         axisLabel: {
-          interval: 0, // 显示所有标签
           color: '#ffffff',
-          formatter: function (value: string) {
-            return value.length > 15 ? value.slice(0, 15) + '...' : value; // 截断长标签
-          },
         },
       },
-      yAxis: [
-        {
-          type: 'value',
-          name: 'O₂/N₂',
-          max: 100,
-          splitLine: { show: true, lineStyle: { color: 'rgba(21,80,126,.5)' } },
-          axisLabel: {
-            color: '#ffffff', // 设置 y 轴字体颜色
-          },
-        },
-        {
-          type: 'value',
-          name: '其他气体',
-          splitLine: { show: true, lineStyle: { color: 'rgba(21,80,126,.5)' } },
-          axisLabel: {
-            color: '#ffffff', // 设置 y 轴字体颜色
-          },
-        },
-      ],
-      series: [
-        {
-          name: 'C₂H₂平均值',
-          data: c2h2AveValues,
-          type: 'line',
-          yAxisIndex: 1,
-        },
-        {
-          name: 'C₂H₄平均值',
-          data: c2h4AveValues,
-          type: 'line',
-          yAxisIndex: 1,
-        },
-        {
-          name: 'CH₄平均值',
-          data: ch4AveValues,
-          yAxisIndex: 1,
-          type: 'line',
-        },
-        {
-          name: 'CO₂平均值',
-          data: co2AveValues,
-          yAxisIndex: 1,
-          type: 'line',
-        },
-        {
-          name: 'CO平均值',
-          data: coAveValues,
-          yAxisIndex: 1,
-          type: 'line',
-        },
-        {
-          name: 'O₂平均值',
-          data: o2AveValues,
-          yAxisIndex: 0,
-          type: 'line',
-        },
-        {
-          name: 'N₂平均值',
-          data: n2AveValues,
-          yAxisIndex: 0,
-          type: 'line',
-        },
-        {
-          name: 'C2H6平均值',
-          data: c2h6AveValues,
-          yAxisIndex: 1,
-          type: 'line',
+      {
+        type: 'value',
+        name: '其他气体',
+        splitLine: { show: true, lineStyle: { color: 'rgba(21,80,126,.5)' } },
+        axisLabel: {
+          color: '#ffffff', // 设置 y 轴字体颜色
         },
-      ],
-    };
-    myChart.setOption(option);
+      },
+    ],
+    grid: {
+      top: '21%', // 设置 grid 距离顶部的距离,增加间隔
+      left: '3%',
+      right: '4%',
+      bottom: '3%',
+      containLabel: true,
+    },
+    series: [
+      {
+        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',
+      },
+    ],
+  };
+  myChart.setOption(option);
+}
+//获取所有文件列表
+async function getAllFile() {
+  let res = await getAllFileList({ type: 'bundleSpy' });
+  selectList.value = res.records.map((item: any) => ({
+    fileId: item.fileId,
+    fileName: item.fileName,
+  }));
+  if (selectList.value.length > 0) {
+    formSearch.fileId = selectList.value[0].fileId;
+    getSearch();
   }
-  //获取所有文件列表
-  async function getAllFile() {
-    let res = await getAllFileList({ type: 'bundleSpy' });
-    selectList.value = res.records.map((item: any) => ({
-      fileId: item.fileId,
-      fileName: item.fileName,
-    }));
+}
+// 处理文件点击事件
+function handleFileClick(item: any) {
+  formSearch.fileId = item.fileId;
+  formSearch.fileName = item.fileName;
+  selectedFileId.value = item.fileId;
+  getSearch();
+}
+//查询
+function getSearch() {
+  const selectedFile = selectList.value.find((item) => item.fileId === formSearch.fileId);
+  const params = {
+    fileId: formSearch.fileId,
+    fileName: selectedFile ? selectedFile.fileName : '',
+  };
+  getTableList(params);
+}
+onMounted(() => {
+  getTableList({ type: 'bundleSpy' });
+  getAllFile().then(() => {
     if (selectList.value.length > 0) {
       formSearch.fileId = selectList.value[0].fileId;
+      selectedFileId.value = selectList.value[0].fileId;
       getSearch();
     }
-  }
-  // 处理文件点击事件
-  function handleFileClick(item: any) {
-    formSearch.fileId = item.fileId;
-    formSearch.fileName = item.fileName;
-    selectedFileId.value = item.fileId;
-    getSearch();
-  }
-  //查询
-  function getSearch() {
-    const selectedFile = selectList.value.find((item) => item.fileId === formSearch.fileId);
-    const params = {
-      fileId: formSearch.fileId,
-      fileName: selectedFile ? selectedFile.fileName : '',
-    };
-    getTableList(params);
-  }
-  onMounted(() => {
-    getTableList({ type: 'bundleSpy' });
-    getAllFile().then(() => {
-      if (selectList.value.length > 0) {
-        formSearch.fileId = selectList.value[0].fileId;
-        selectedFileId.value = selectList.value[0].fileId;
-        getSearch();
-      }
-    });
   });
+});
 </script>
 
 <style lang="less" scoped>
-  @import '/@/design/theme.less';
+@import '/@/design/theme.less';
 
-  .content-container {
-    display: flex;
-    width: 100%;
-    height: 100%;
-  }
+.content-container {
+  display: flex;
+  width: 100%;
+  height: 100%;
+}
 
-  .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 {
+  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 ul {
+  list-style: none;
+  padding: 0;
+}
 
-  .file-list li {
-    color: #fff;
-    padding: 5px;
-    cursor: pointer;
-  }
+.file-list li {
+  color: #fff;
+  padding: 5px;
+  cursor: pointer;
+}
 
-  .file-list li:hover,
-  .file-list li.selected {
-    background: #1c4869;
-  }
+.file-list li:hover,
+.file-list li.selected {
+  background: #1c4869;
+}
 
-  .table-container {
-    margin-top: 10px;
-    width: 80%;
-    box-sizing: border-box;
-  }
+.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;
-  }
+.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-table-thead > tr > th:last-child) {
+  border-right: 1px solid #91e9fe !important;
+}
 
-  :deep(.zxm-picker-input > input) {
-    color: #fff;
-  }
+: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: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;
+:deep(.zxm-select-selection-item) {
+  color: #fff !important;
+}
+.data-container {
+  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;
   }
-  .line-chart {
-    width: 100%;
-    height: 400px;
-    margin-top: 50px;
+  .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>

+ 545 - 0
src/views/vent/bundleSpy/bundleSpyTable/modal/blastDelta.vue

@@ -0,0 +1,545 @@
+<template>
+  <div class="blastDelta">
+    <div ref="coord" class="coords">
+      <div class="coord-lineY">
+        <div :style="{ width: '5px', height: `${lengY}px`, 'border-top': '1px solid #0079ff' }" v-for="item in 10" :key="item"></div>
+      </div>
+      <div class="coord-labelY">
+        <div :style="{ width: '20px', height: `${lengY}px`, color: '#fff' }" v-for="(ite, ind) in 10" :key="ind">{{ ind == 0 ? maxY : '' }}</div>
+      </div>
+      <div class="coord-lineX">
+        <div :style="{ height: '5px', width: `${lengY}px`, 'border-right': '1px solid #0079ff' }" v-for="item in 15" :key="item"></div>
+      </div>
+      <div class="coord-labelX">
+        <div :style="{ height: '20px', width: `${lengY}px`, color: '#fff' }" v-for="(ite, ind) in 15" :key="ind">{{ ind == 14 ? maxX : '' }}</div>
+      </div>
+      <div class="line-AB" :style="{ width: 'calc(100% - 10px)', height: 'calc(100% - 10px)' }">
+        <canvas id="myCanvas" :width="canvasSize.width" :height="canvasSize.height"></canvas>
+      </div>
+      <!-- <div class="line-legend">
+        <div class="legend-ite" v-for="ite in 4" :key="ite"></div>
+      </div>
+      <div class="legend-name">
+        <div class="item-name" v-for="item in legendList" :key="item">{{ item.name }}</div>
+      </div> -->
+    </div>
+    <div class="line-legend">
+      <div class="legend-box" v-for="(item, index) in legendList" :key="index">
+        <span class="legend-icon"></span>
+        <span class="legend-label">{{ item.name }}</span>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script lang="ts" setup>
+import { ref, reactive, onMounted, watch, nextTick } from 'vue';
+
+let props = defineProps({
+  posMonitor: {
+    type: Object,
+    default: () => {
+      return {};
+    },
+  },
+  canvasSize: {
+    type: Object,
+    default: () => {
+      return { width: 380, height: 245 };
+    },
+  },
+});
+let coord = ref(null);
+let lengY = ref(0);
+//与x,y轴相交最大值坐标
+let maxY = ref(0);
+let maxX = ref(0);
+let maxY1 = ref(0);
+let maxX1 = ref(0);
+
+//A点坐标
+let coordinateA = reactive({
+  x: 0,
+  y: 0,
+});
+//B点坐标
+let coordinateB = reactive({
+  x: 0,
+  y: 0,
+});
+//E点坐标
+let coordinateE = reactive({
+  x: 0,
+  y: 0,
+});
+//F点坐标
+let coordinateF = reactive({
+  x: 0,
+  y: 0,
+});
+//G点坐标
+let coordinateG = reactive({
+  x: 0,
+  y: 0,
+});
+
+let legendList = ref<any[]>([{ name: '不爆炸' }, { name: '可燃气体不足' }, { name: '可爆炸' }, { name: '氧气不足' }]);
+
+function getAreas() {
+  if (coord.value) {
+    let width = coord.value.offsetWidth;
+    let height = coord.value.offsetHeight;
+    lengY.value = Math.ceil((height - 10) / 10);
+  }
+}
+//根据A,B,E,G等点坐标绘制爆炸三角形
+function getBlast() {
+  maxY.value = getCoordABY(0);
+  // 获取canvas元素
+  let canvas = document.getElementById('myCanvas');
+  let ctx = canvas.getContext('2d');
+  let scalcY, scalcX;
+  if (coordinateB.x < 50) {
+    maxX.value = 50;
+    scalcY = canvas.height / maxY.value;
+    scalcX = canvas.width / maxX.value;
+  } else {
+    maxX.value = parseInt(coordinateB.x + 10);
+    scalcY = canvas.height / maxY.value;
+    scalcX = canvas.width / maxX.value;
+  }
+  //绘制AB点线条
+  ctx.beginPath();
+  ctx.moveTo(coordinateA.x * scalcX, canvas.height - coordinateA.y * scalcY); // 开始绘制的点
+  ctx.lineTo(coordinateB.x * scalcX, canvas.height - coordinateB.y * scalcY); // 结束绘制的点
+  ctx.strokeStyle = '#000';
+  ctx.stroke(); // 进行绘制
+
+  //绘制AE线条
+  ctx.beginPath();
+  ctx.moveTo(coordinateA.x * scalcX, canvas.height - coordinateA.y * scalcY); // 开始绘制的点
+  ctx.lineTo(coordinateE.x * scalcX, canvas.height - coordinateE.y * scalcY); // 结束绘制的点
+  ctx.strokeStyle = '#000';
+  ctx.stroke(); // 进行绘制
+
+  //绘制BE线条
+  ctx.beginPath();
+  ctx.moveTo(coordinateB.x * scalcX, canvas.height - coordinateB.y * scalcY); // 开始绘制的点
+  ctx.lineTo(coordinateE.x * scalcX, canvas.height - coordinateE.y * scalcY); // 结束绘制的点
+  ctx.strokeStyle = '#000';
+  ctx.stroke(); // 进行绘制
+
+  //绘制A点与坐标轴连线
+  ctx.beginPath();
+  ctx.moveTo(0, canvas.height - maxY.value * scalcY); // 开始绘制的点
+  ctx.lineTo(coordinateA.x * scalcX, canvas.height - coordinateA.y * scalcY); // 结束绘制的点
+  ctx.strokeStyle = '#000';
+  ctx.stroke(); // 进行绘制
+
+  //绘制B点c连线
+  ctx.beginPath();
+  ctx.moveTo(coordinateB.x * scalcX, canvas.height - coordinateB.y * scalcY); // 开始绘制的点
+  ctx.lineTo(maxX.value * scalcX, canvas.height - getCoordABY(maxX.value) * scalcY); // 结束绘制的点
+  ctx.strokeStyle = '#000';
+  ctx.stroke(); // 进行绘制
+  //绘制c点与坐标轴连线
+  ctx.beginPath();
+  ctx.moveTo(maxX.value * scalcX, canvas.height - getCoordABY(maxX.value) * scalcY); // 开始绘制的点
+  ctx.lineTo(maxX.value * scalcX, canvas.height); // 结束绘制的点
+  ctx.strokeStyle = '#000';
+  ctx.stroke(); // 进行绘制
+
+  //绘制E,F线条
+  ctx.beginPath();
+  ctx.moveTo(coordinateE.x * scalcX, canvas.height - coordinateE.y * scalcY); // 开始绘制的点
+  ctx.lineTo(coordinateF.x * scalcX, canvas.height - coordinateF.y * scalcY); // 结束绘制的点
+  ctx.strokeStyle = '#000';
+  ctx.stroke(); // 进行绘制
+
+  //绘制GE线条
+  ctx.beginPath();
+  ctx.moveTo(coordinateG.x * scalcX, canvas.height - coordinateG.y * scalcY); // 开始绘制的点
+  ctx.lineTo(coordinateE.x * scalcX, canvas.height - coordinateE.y * scalcY); // 结束绘制的点
+  ctx.strokeStyle = '#000';
+  ctx.stroke(); // 进行绘制
+
+  ctx.clearRect(0, 0, canvas.width, canvas.height);
+  let pointData = [
+    {
+      arr: [
+        { x: coordinateG.x * scalcX, y: canvas.height - coordinateG.y * scalcY }, //G
+        { x: coordinateE.x * scalcX, y: canvas.height - coordinateE.y * scalcY }, //E
+        { x: coordinateA.x * scalcX, y: canvas.height - coordinateA.y * scalcY }, //A
+        { x: 0, y: canvas.height - maxY.value * scalcY },
+      ],
+      color: 'rgb(1, 127, 2, .9)',
+    },
+    {
+      arr: [
+        { x: 0, y: canvas.height }, //原点
+        { x: coordinateF.x * scalcX, y: canvas.height - coordinateF.y * scalcY }, //F
+        { x: coordinateE.x * scalcX, y: canvas.height - coordinateE.y * scalcY }, //E
+        { x: coordinateG.x * scalcX, y: canvas.height - coordinateG.y * scalcY }, //G
+      ],
+      color: 'rgb(127, 254, 2, .9)',
+    },
+    {
+      arr: [
+        { x: coordinateF.x * scalcX, y: canvas.height - coordinateF.y * scalcY }, //F
+        { x: maxX.value * scalcX, y: canvas.height },
+        { x: maxX.value * scalcX, y: canvas.height - getCoordABY(maxX.value) * scalcY },
+        { x: coordinateB.x * scalcX, y: canvas.height - coordinateB.y * scalcY }, //B
+        { x: coordinateE.x * scalcX, y: canvas.height - coordinateE.y * scalcY }, //E
+      ],
+      color: 'rgb(255, 255, 0, .9)',
+    },
+    {
+      arr: [
+        { x: coordinateE.x * scalcX, y: canvas.height - coordinateE.y * scalcY }, //E
+        { x: coordinateB.x * scalcX, y: canvas.height - coordinateB.y * scalcY }, //B
+        { x: coordinateA.x * scalcX, y: canvas.height - coordinateA.y * scalcY }, //A
+      ],
+      color: 'rgb(255, 0, 0, .9)',
+    },
+  ];
+
+  pointData.forEach((item, index) => {
+    ctx.beginPath();
+    ctx.moveTo(item.arr[0].x, item.arr[0].y);
+    item.arr.forEach((items, ind) => {
+      if (ind != 0) {
+        ctx.lineTo(item.arr[ind].x, item.arr[ind].y);
+      }
+    });
+    ctx.closePath();
+    ctx.fillStyle = item.color;
+    ctx.fill();
+    ctx.strokeStyle = 'transparent';
+    ctx.lineWidth = 1;
+    ctx.stroke();
+  });
+
+  // 标记点A
+  ctx.beginPath();
+  ctx.arc(coordinateA.x * scalcX, canvas.height - coordinateA.y * scalcY, 1, 0, 2 * Math.PI);
+  ctx.fillStyle = '#eee';
+  ctx.fill();
+  // 在点附近添加文字
+  ctx.font = '12px Arial';
+  ctx.fillStyle = '#fff';
+  ctx.fillText('A', coordinateA.x * scalcX + 10, canvas.height - coordinateA.y * scalcY); // 文字位置略微偏上,以便于文字与点对齐
+
+  //标记点B
+  ctx.beginPath();
+  ctx.arc(coordinateB.x * scalcX, canvas.height - coordinateB.y * scalcY, 1, 0, 2 * Math.PI);
+  ctx.fillStyle = '#eee';
+  ctx.fill();
+  // 在点附近添加文字
+  ctx.font = '12px Arial';
+  ctx.fillStyle = '#fff';
+  ctx.fillText('B', coordinateB.x * scalcX + 10, canvas.height - coordinateB.y * scalcY); // 文字位置略微偏上,以便于文字与点对齐
+
+  //标记点E
+  ctx.beginPath();
+  ctx.arc(coordinateE.x * scalcX, canvas.height - coordinateE.y * scalcY, 1, 0, 2 * Math.PI);
+  ctx.fillStyle = '#eee';
+  ctx.fill();
+  // 在点附近添加文字
+  ctx.font = '12px Arial';
+  ctx.fillStyle = '#fff';
+  ctx.fillText('E', coordinateE.x * scalcX + 5, canvas.height - coordinateE.y * scalcY + 10); // 文字位置略微偏上,以便于文字与点对齐
+
+  //标记点G
+  ctx.beginPath();
+  ctx.arc(coordinateG.x * scalcX, canvas.height - coordinateG.y * scalcY, 1, 0, 2 * Math.PI);
+  ctx.fillStyle = '#eee';
+  ctx.fill();
+  // 在点附近添加文字
+  ctx.font = '12px Arial';
+  ctx.fillStyle = '#fff';
+  ctx.fillText('G', coordinateG.x * scalcX + 5, canvas.height - coordinateG.y * scalcY); // 文字位置略微偏上,以便于文字与点对齐
+  //标记点F
+  ctx.beginPath();
+  ctx.arc(coordinateF.x * scalcX, canvas.height - coordinateF.y * scalcY, 1, 0, 2 * Math.PI);
+  ctx.fillStyle = '#eee';
+  ctx.fill();
+  // 在点附近添加文字
+  ctx.font = '12px Arial';
+  ctx.fillStyle = '#fff';
+  ctx.fillText('F', coordinateF.x * scalcX + 10, canvas.height - coordinateF.y * scalcY - 10); // 文字位置略微偏上,以便于文字与点对齐
+  //标记点
+  ctx.beginPath();
+  ctx.arc(maxX1.value * scalcX, canvas.height - maxY1.value * scalcY, 5, 0, 2 * Math.PI);
+  ctx.fillStyle = 'blue';
+  ctx.fill();
+  // 在点附近添加文字
+  ctx.font = '12px Arial';
+  ctx.fillStyle = '#fff';
+  ctx.fillText('', maxX1.value * scalcX + 10, canvas.height - maxY1.value * scalcY - 10); // 文字位置略微偏上,以便于文字与点对齐
+}
+//绘制不爆炸三角形
+function getUnblast() {
+  maxY.value = 21;
+  maxX.value = 50;
+  // 获取canvas元素
+  let canvas = document.getElementById('myCanvas');
+  let ctx = canvas.getContext('2d');
+  let scalcY = canvas.height / maxY.value;
+  let scalcX = canvas.width / maxX.value;
+
+  //绘制AB点线条
+  ctx.beginPath();
+  ctx.moveTo(0, canvas.height - maxY.value * scalcY); // 开始绘制的点
+  ctx.lineTo(maxX.value * scalcX, canvas.height); // 结束绘制的点
+  ctx.strokeStyle = '#000';
+  ctx.stroke(); // 进行绘制
+
+  ctx.clearRect(0, 0, canvas.width, canvas.height);
+  let pointData = [
+    {
+      arr: [
+        { x: 0, y: canvas.height }, //原点
+        { x: 0, y: canvas.height - maxY.value * scalcY }, //A
+        { x: maxX.value * scalcX, y: canvas.height }, //B
+      ],
+      color: 'rgb(127, 254, 2, .9)',
+    },
+  ];
+
+  pointData.forEach((item, index) => {
+    ctx.beginPath();
+    ctx.moveTo(item.arr[0].x, item.arr[0].y);
+    item.arr.forEach((items, ind) => {
+      if (ind != 0) {
+        ctx.lineTo(item.arr[ind].x, item.arr[ind].y);
+      }
+    });
+    ctx.closePath();
+    ctx.fillStyle = item.color;
+    ctx.fill();
+    ctx.strokeStyle = 'transparent';
+    ctx.lineWidth = 1;
+    ctx.stroke();
+  });
+
+  // 标记点A
+  ctx.beginPath();
+  ctx.arc(0, canvas.height - maxY.value * scalcY, 1, 0, 2 * Math.PI);
+  ctx.fillStyle = '#eee';
+  ctx.fill();
+  // 在点附近添加文字
+  ctx.font = '12px Arial';
+  ctx.fillStyle = '#fff';
+  ctx.fillText('A', 10, canvas.height - maxY.value * scalcY + 10); // 文字位置略微偏上,以便于文字与点对齐
+  // 标记点B
+  ctx.beginPath();
+  ctx.arc(maxX.value * scalcX, canvas.height, 1, 0, 2 * Math.PI);
+  ctx.fillStyle = '#eee';
+  ctx.fill();
+  // 在点附近添加文字
+  ctx.font = '12px Arial';
+  ctx.fillStyle = '#fff';
+  ctx.fillText('B', maxX.value * scalcX - 10, canvas.height - 10); // 文字位置略微偏上,以便于文字与点对齐
+  //标记点
+  ctx.beginPath();
+  ctx.arc(maxX1.value * scalcX, canvas.height - maxY1.value * scalcY, 5, 0, 2 * Math.PI);
+  ctx.fillStyle = 'blue';
+  ctx.fill();
+  // 在点附近添加文字
+  ctx.font = '12px Arial';
+  ctx.fillStyle = '#fff';
+  ctx.fillText('', maxX1.value * scalcX + 10, canvas.height - maxY1.value * scalcY - 10); // 文字位置略微偏上,以便于文字与点对齐
+}
+//根据横坐标获取直线AB纵坐标
+function getCoordABY(params) {
+  return Math.ceil(
+    ((parseFloat(coordinateB.y) - parseFloat(coordinateA.y)) * params -
+      parseFloat(coordinateA.x) * parseFloat(coordinateB.y) +
+      parseFloat(coordinateB.x) * parseFloat(coordinateA.y)) /
+      (parseFloat(coordinateB.x) - parseFloat(coordinateA.x))
+  );
+}
+//根据纵坐标获取直线AB横坐标
+function getCoordABX(params1) {
+  return Math.floor(
+    ((parseFloat(coordinateB.x) - parseFloat(coordinateA.x)) * params1 +
+      parseFloat(coordinateA.x) * parseFloat(coordinateB.y) -
+      parseFloat(coordinateB.x) * parseFloat(coordinateA.y)) /
+      (parseFloat(coordinateB.y) - parseFloat(coordinateA.y))
+  );
+}
+
+watch(
+  () => props.posMonitor,
+  (newV, oldV) => {
+    if (newV.btTriBlast) {
+      maxY1.value = parseFloat(newV.o2_ave);
+      maxX1.value =
+        parseFloat(newV.co_ave) * 0.0001 + parseFloat(newV.ch4_ave) + parseFloat(newV.c2h2_ave) * 0.0001 + parseFloat(newV.c2h4_ave) * 0.0001;
+      let btTriBlasts = newV.btTriBlast;
+      coordinateA.x = btTriBlasts.A_x;
+      coordinateA.y = btTriBlasts.A_y;
+      coordinateB.x = btTriBlasts.B_x;
+      coordinateB.y = btTriBlasts.B_y;
+      coordinateE.x = btTriBlasts.E_x;
+      coordinateE.y = btTriBlasts.E_y;
+      coordinateF.x = btTriBlasts.F_x;
+      coordinateF.y = btTriBlasts.F_y;
+      coordinateG.x = btTriBlasts.G_x;
+      coordinateG.y = btTriBlasts.G_y;
+      if (
+        !((coordinateA.y - coordinateB.y) / (coordinateA.x - coordinateB.x)) ||
+        (coordinateA.y - coordinateB.y) / (coordinateA.x - coordinateB.x) == 1
+      ) {
+        // 使用 nextTick 为了让 immediate watch 触发时等待组件挂载后执行绘制
+        nextTick(getUnblast);
+      } else {
+        nextTick(getBlast);
+      }
+    }
+  },
+  { deep: true, immediate: true }
+);
+
+onMounted(() => {
+  getAreas();
+});
+</script>
+
+<style lang="less" scoped>
+.blastDelta {
+  position: relative;
+  width: 100%;
+  height: 320px;
+
+  .line-legend {
+    position: absolute;
+    left: 50%;
+    top: 0px;
+    width: 75%;
+    height: 20px;
+    transform: translate(-50%, 0);
+    display: flex;
+    justify-content: space-around;
+
+    .legend-box {
+      display: flex;
+      height: 100%;
+      justify-content: center;
+      align-items: center;
+      font-size: 12px;
+
+      &:nth-child(1) {
+        flex: 1;
+
+        .legend-icon {
+          width: 10px;
+          height: 10px;
+          background-color: #7ffe02;
+          margin-right: 5px;
+        }
+      }
+
+      &:nth-child(2) {
+        flex: 1.5;
+
+        .legend-icon {
+          width: 10px;
+          height: 10px;
+          background-color: #017f02;
+          margin-right: 5px;
+        }
+      }
+
+      &:nth-child(3) {
+        flex: 1;
+
+        .legend-icon {
+          width: 10px;
+          height: 10px;
+          background-color: #ff0000;
+          margin-right: 5px;
+        }
+      }
+
+      &:nth-child(4) {
+        flex: 1;
+
+        .legend-icon {
+          width: 10px;
+          height: 10px;
+          background-color: #ffff00;
+          margin-right: 5px;
+        }
+      }
+    }
+  }
+
+  .coords {
+    position: absolute;
+    left: 50%;
+    top: 50%;
+    width: 90%;
+    height: 80%;
+    border-left: 1px solid #006c9d;
+    border-bottom: 1px solid #006c9d;
+    transform: translate(-45%, -46%);
+
+    .coord-lineY {
+      position: absolute;
+      left: -5px;
+      top: 10px;
+      width: 5px;
+      height: calc(100% - 10px);
+    }
+
+    .coord-labelY {
+      position: absolute;
+      left: -25px;
+      top: -5px;
+      width: 20px;
+      height: 100%;
+    }
+
+    .coord-lineX {
+      display: flex;
+      position: absolute;
+      bottom: -5px;
+      right: 10px;
+      width: calc(100% - 10px);
+      height: 5px;
+    }
+
+    .coord-labelX {
+      display: flex;
+      justify-content: flex-end;
+      position: absolute;
+      bottom: -25px;
+      left: -5px;
+      width: 100%;
+      height: 20px;
+    }
+
+    .line-AB {
+      position: absolute;
+      left: 0;
+      top: 10px;
+    }
+
+    // .legend-name {
+    //   position: absolute;
+    //   right: 0;
+    //   top: 20px;
+    //   height: 80px;
+
+    //   .item-name {
+    //     height: 20px;
+    //     line-height: 20px;
+    //     font-size: 10px;
+    //     color: #fff;
+    //     letter-spacing: 2px;
+    //   }
+    // }
+  }
+}
+</style>