Browse Source

内因火灾预警评判需求

bobo04052021@163.com 3 months ago
parent
commit
f13582a9ca

+ 44 - 14
src/views/vent/bundle/bundleMonitorTable/index.vue

@@ -26,13 +26,13 @@
           <div id="barChart" class="bar-chart"></div>
           <div class="data-content">
             <div class="title">煤自燃阶段统计分析</div>
-            <div class="explain">测点共计{{ combustionCount + selfHeatingCount + latentCount }}个</div>
-            <div class="progress-label">潜伏期阶段:{{ latentCount }}</div>
-            <Progress :percent="latentPercent" size="default" strokeColor="green" :show-info="true" :format="() => latentCount" />
+            <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="green" :show-info="true" :format="() => latentCount" />
+            <Progress :percent="latentPercent" size="default" strokeColor="yellow" :show-info="true" :format="() => latentCount" />
             <div class="progress-label">加速氧化阶段:{{ selfHeatingCount }}</div>
-            <Progress :percent="selfHeatingPercent" size="default" strokeColor="yellow" :show-info="true" :format="() => selfHeatingCount" />
+            <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>
@@ -49,7 +49,7 @@
 </template>
 
 <script setup lang="ts">
-import { ref, onMounted, shallowRef, reactive, nextTick } from 'vue';
+import { ref, onMounted, computed, shallowRef, reactive, nextTick } from 'vue';
 import { columns } from './bundle-table.data';
 import { getBundleInfoList, getAllFileList } from './bundle-table.api';
 import customHeader from '/@/components/vent/customHeader.vue';
@@ -58,6 +58,7 @@ import BlastDelta from './modal/blastDelta.vue';
 import BlastDelta1 from './modal/blastDelta1.vue';
 import * as echarts from 'echarts';
 import { Progress } from 'ant-design-vue';
+import { useGlobSetting } from '/@/hooks/setting';
 // import 'ant-design-vue/dist/antd.css'; // 引入样式
 let selectList = ref<any[]>([]);
 let jcddArr = ref<any[]>([]);
@@ -67,9 +68,13 @@ let formSearch = reactive({
   fileId: '',
   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); // 剧烈氧化阶段(燃烧期)
@@ -230,14 +235,39 @@ async function getTableList(params: any) {
   let res = await getBundleInfoList({ type: 'bundle', ...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;
+  const contentNewArr = computed(() => {
+    return contentArr.map((item) => {
+      let internalFireWarnLevel = '';
+
+      const co = item.co_ave;
+      const co2 = item.co2_ave;
+      const c2h4 = item.c2h4_ave;
+      const c2h2 = item.c2h2_ave;
+      const coRatio = co / co2;
+
+      if (co >= 0 && co <= 13.75) {
+        internalFireWarnLevel = '潜伏期阶段';
+      } else if (co > 13.75 && co < 67.2 && coRatio < 0.095) {
+        internalFireWarnLevel = '缓慢氧化升温阶段';
+      } else if ((co >= 67.2 && co < 1606.3) || (coRatio >= 0.095 && coRatio < 0.322) || c2h4 < 2) {
+        internalFireWarnLevel = '加速氧化阶段';
+      } else if (co >= 1606.3 || coRatio >= 0.322 || c2h4 >= 2 || c2h2 > 0) {
+        internalFireWarnLevel = '剧烈氧化阶段';
+      }
+
+      return { ...item, internalFireWarnLevel };
+    });
+  });
+  total.value = contentArr.length;
+  qfqCount.value = contentNewArr.value.filter((item: any) => item.internalFireWarnLevel === '潜伏期阶段').length;
+  latentCount.value = contentNewArr.value.filter((item: any) => item.internalFireWarnLevel === '缓慢氧化升温阶段').length;
+  selfHeatingCount.value = contentNewArr.value.filter((item: any) => item.internalFireWarnLevel === '加速氧化阶段').length;
+  combustionCount.value = contentNewArr.value.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 = contentNewArr.value;
   nextTick(() => {
     updateChart(contentArr);
   });

+ 45 - 19
src/views/vent/bundleSpy/bundleSpyTable/index.vue

@@ -15,24 +15,19 @@
             <template v-if="column.dataIndex === 'action'">
               <a class="action-link" @click="toDetail(record)">数据分析</a>
             </template>
-            <template v-else>
-              <template v-if="record[column.dataIndex] === null">
-                <span>-</span>
-              </template>
-            </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">潜伏期阶段:{{ latentCount }}</div>
-            <Progress :percent="latentPercent" size="default" strokeColor="green" :show-info="true" :format="() => latentCount" />
+            <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="green" :show-info="true" :format="() => latentCount" />
+            <Progress :percent="latentPercent" size="default" strokeColor="yellow" :show-info="true" :format="() => latentCount" />
             <div class="progress-label">加速氧化阶段:{{ selfHeatingCount }}</div>
-            <Progress :percent="selfHeatingPercent" size="default" strokeColor="yellow" :show-info="true" :format="() => selfHeatingCount" />
+            <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>
@@ -48,13 +43,14 @@
 </template>
 
 <script setup lang="ts">
-import { ref, onMounted, reactive, shallowRef } from 'vue';
+import { ref, onMounted, computed, 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 { useGlobSetting } from '/@/hooks/setting';
 // import 'ant-design-vue/dist/antd.css'; // 引入样式
 let selectList = ref<any[]>([]);
 
@@ -64,9 +60,13 @@ let formSearch = reactive({
   fileId: '',
   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); // 剧烈氧化阶段(燃烧期)
@@ -79,16 +79,42 @@ 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;
+  const contentNewArr = computed(() => {
+    return contentArr.map((item) => {
+      let internalFireWarnLevel = '';
+
+      const co = item.co_ave;
+      const co2 = item.co2_ave;
+      const c2h4 = item.c2h4_ave;
+      const c2h2 = item.c2h2_ave;
+      const coRatio = co / co2;
+
+      if (co >= 0 && co <= 13.75) {
+        internalFireWarnLevel = '潜伏期阶段';
+      } else if (co > 13.75 && co < 67.2 && coRatio < 0.095) {
+        internalFireWarnLevel = '缓慢氧化升温阶段';
+      } else if ((co >= 67.2 && co < 1606.3) || (coRatio >= 0.095 && coRatio < 0.322) || c2h4 < 2) {
+        internalFireWarnLevel = '加速氧化阶段';
+      } else if (co >= 1606.3 || coRatio >= 0.322 || c2h4 >= 2 || c2h2 > 0) {
+        internalFireWarnLevel = '剧烈氧化阶段';
+      }
+
+      return { ...item, internalFireWarnLevel };
+    });
+  });
+  total.value = contentArr.length;
+  qfqCount.value = contentNewArr.value.filter((item: any) => item.internalFireWarnLevel === '潜伏期阶段').length;
+  latentCount.value = contentNewArr.value.filter((item: any) => item.internalFireWarnLevel === '缓慢氧化升温阶段').length;
+  selfHeatingCount.value = contentNewArr.value.filter((item: any) => item.internalFireWarnLevel === '加速氧化阶段').length;
+  combustionCount.value = contentNewArr.value.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 = contentNewArr.value;
   updateChart(contentArr);
 }
+
 //跳转到爆炸三角形
 function toDetail(record: any) {
   posMonitor.value = record;

+ 78 - 0
src/views/vent/dust/dustMonitorTable/dust-table.data.ts

@@ -128,6 +128,84 @@ export const columns = [
     ],
   },
 ];
+export const Dltcolumns = [
+  {
+    title: '序号',
+    width: 60,
+    align: 'center',
+    customRender: ({ index }: { index: number }) => `${index + 1}`,
+  },
+  {
+    title: '监测地点',
+    dataIndex: 'jcdd',
+    key: 'jcdd',
+    width: 100,
+    align: 'center',
+  },
+  {
+    title: '粉尘种类',
+    dataIndex: 'fczl',
+    key: 'fczl',
+    width: 80,
+    align: 'center',
+  },
+  {
+    title: '总尘(短时间监测浓度,单位:mg/m³)',
+    width: 100,
+    align: 'center',
+    children: [
+      {
+        title: '作业工序-生产',
+        dataIndex: 'sc_zcds',
+        key: 'sc_zcds',
+        width: 100,
+        align: 'center',
+      },
+      {
+        title: '作业工序-检修',
+        dataIndex: 'jx_zcds',
+        key: 'jx_zcds',
+        width: 100,
+        align: 'center',
+      },
+    ],
+  },
+  {
+    title: '呼尘(短时间监测浓度,单位:mg/m³)',
+    width: 100,
+    align: 'center',
+    children: [
+      {
+        title: '作业工序-生产',
+        dataIndex: 'sc_hcds',
+        key: 'sc_hcds',
+        width: 100,
+        align: 'center',
+      },
+      {
+        title: '作业工序-检修',
+        dataIndex: 'jx_hcds',
+        key: 'jx_hcds',
+        width: 100,
+        align: 'center',
+      },
+    ],
+  },
+  {
+    title: '总尘(时间加权平均浓度,单位:mg/m³)',
+    dataIndex: 'zcjqpj',
+    key: 'zcjqpj',
+    width: 100,
+    align: 'center',
+  },
+  {
+    title: '呼尘(时间加权平均浓度,单位:mg/m³)',
+    dataIndex: 'hcjqpj',
+    key: 'hcjqpj',
+    width: 100,
+    align: 'center',
+  },
+];
 export const fieldMapping = {
   sc_zcds: '总尘-作业工序-生产(短时间监测浓度,mg/m³)',
   jx_zcds: '总尘-作业工序-检修(短时间监测浓度,mg/m³)',

+ 16 - 4
src/views/vent/dust/dustMonitorTable/index.vue

@@ -10,7 +10,7 @@
         </ul>
       </div>
       <div class="table-container">
-        <a-table :columns="columns" :data-source="tableData" size="small" :scroll="{ y: 250 }" class="tableW">
+        <a-table :columns="computedColumns" :data-source="tableData" size="small" :scroll="{ y: 250 }" class="tableW">
           <template #bodyCell="{ record, column }">
             <template v-if="record[column.dataIndex] === null">
               <span>-</span>
@@ -22,6 +22,7 @@
             <a-tab-pane key="workplace" class="tab1" tab="监测地点粉尘情况分析">
               <div class="filter-container" v-if="workplaceList.length > 0">
                 <a-select
+                  v-if="sysOrgCode != 'sdmtjtdltmk'"
                   :key="DefaultValue"
                   :default-value="DefaultValue"
                   v-model="selectedWorkplace"
@@ -48,12 +49,12 @@
 
 <script setup lang="ts">
 import { ref, onMounted, reactive, computed, watch, nextTick } from 'vue';
-import { columns, dataColumns, AllDataColumns } from './dust-table.data';
+import { columns, Dltcolumns, dataColumns, AllDataColumns } from './dust-table.data';
 import { getDustInfoList, getAllFileList } from './dsut-table.api';
 import customHeader from '/@/components/vent/customHeader.vue';
 import { result } from 'lodash-es';
 // import { nextTick } from 'process';
-
+import { useGlobSetting } from '/@/hooks/setting';
 let tableData = ref<any[]>([]);
 let selectList = ref<any[]>([]);
 let resultByWorkplace = ref<any[]>([]);
@@ -64,13 +65,24 @@ let activeTab = ref<string>('workplace');
 let selectedFileId = ref<string | null>(null);
 let selectedWorkplace = ref<string | null>(null);
 let DefaultValue = ref<string | null>(null);
+const { sysOrgCode } = useGlobSetting();
 let formSearch = reactive({
   pageNum: 1,
   pageSize: 1000,
   fileId: '',
   fileName: '',
 });
-
+//获取粉尘监测列展示数据
+const computedColumns = computed(() => {
+  switch (sysOrgCode) {
+    case 'sdmtjtbetmk':
+      return columns; // 布尔台对应的列配置
+    case 'sdmtjtdltmk':
+      return Dltcolumns; // 布尔台对应的列配置
+    default:
+      return columns; // 默认情况下返回的列配置
+  }
+});
 //获取粉尘监测结果数据
 async function getTableList(params: any) {
   let res = await getDustInfoList({ type: 'smoke', ...params });