Ver código fonte

束管日报表 粉尘监测报表

bobo04052021@163.com 3 meses atrás
pai
commit
3f0eb7cf26

+ 10 - 0
src/views/vent/bundle/bundleMonitorTable/bundle-table.api.ts

@@ -0,0 +1,10 @@
+import { defHttp } from '/@/utils/http/axios';
+
+enum Api {
+  getBundleInfo = '/ventanaly-device/safety/reportLocalData/queryReportData',
+}
+/**
+ *
+ * @param params
+ */
+export const getBundleInfoList = (params) => defHttp.post({ url: Api.getBundleInfo, params });

+ 138 - 0
src/views/vent/bundle/bundleMonitorTable/bundle-table.data.ts

@@ -0,0 +1,138 @@
+import { BasicColumn } from '/@/components/Table';
+export const columns: BasicColumn[] = [
+  {
+    title: '序号',
+    width: 60,
+    align: 'center',
+    dataIndex: 'xh',
+    key: 'xh',
+  },
+  {
+    title: '测点名称',
+    dataIndex: 'jcdd',
+    key: 'jcdd',
+    width: 130,
+    align: 'center',
+  },
+  {
+    title: '分析次数',
+    dataIndex: 'fxcs',
+    key: 'fxcs',
+    width: 60,
+    align: 'center',
+  },
+  {
+    title: 'CO(PPM)',
+    children: [
+      {
+        title: '最大值',
+        dataIndex: 'co_max',
+        key: 'co_max',
+        width: 100,
+        align: 'center',
+      },
+      {
+        title: '平均值',
+        dataIndex: 'co_ave',
+        key: 'co_ave',
+        width: 120,
+        align: 'center',
+      },
+    ],
+  },
+  {
+    title: 'CO2(%)',
+    children: [
+      {
+        title: '最大值',
+        dataIndex: 'co2_max',
+        key: 'co2_max',
+        width: 100,
+        align: 'center',
+      },
+      {
+        title: '平均值',
+        dataIndex: 'co2_ave',
+        key: 'co2_ave',
+        width: 120,
+        align: 'center',
+      },
+    ],
+  },
+  {
+    title: 'O2(%)',
+    children: [
+      {
+        title: '最小值',
+        dataIndex: 'o2_min',
+        key: 'o2_min',
+        width: 100,
+        align: 'center',
+      },
+      {
+        title: '平均值',
+        dataIndex: 'o2_ave',
+        key: 'o2_ave',
+        width: 120,
+        align: 'center',
+      },
+    ],
+  },
+  {
+    title: 'CH4(%)',
+    children: [
+      {
+        title: '最大值',
+        dataIndex: 'ch4_max',
+        key: 'ch4_max',
+        width: 100,
+        align: 'center',
+      },
+      {
+        title: '平均值',
+        dataIndex: 'ch4_ave',
+        key: 'ch4_ave',
+        width: 120,
+        align: 'center',
+      },
+    ],
+  },
+  {
+    title: 'C2H2(PPM)',
+    children: [
+      {
+        title: '最大值',
+        dataIndex: 'c2h2_max',
+        key: 'c2h2_max',
+        width: 100,
+        align: 'center',
+      },
+      {
+        title: '平均值',
+        dataIndex: 'c2h2_ave',
+        key: 'c2h2_ave',
+        width: 120,
+        align: 'center',
+      },
+    ],
+  },
+  {
+    title: 'C2H4(PPM)',
+    children: [
+      {
+        title: '最大值',
+        dataIndex: 'c2h4_max',
+        key: 'c2h4_max',
+        width: 100,
+        align: 'center',
+      },
+      {
+        title: '平均值',
+        dataIndex: 'c2h4_ave',
+        key: 'c2h4_ave',
+        width: 120,
+        align: 'center',
+      },
+    ],
+  },
+];

+ 69 - 0
src/views/vent/bundle/bundleMonitorTable/index.vue

@@ -0,0 +1,69 @@
+<template>
+  <div class="dustMonitor">
+    <customHeader>束管日报表</customHeader>
+    <a-table :columns="columns" :data-source="tableData" size="small" :scroll="{ y: 500 }" class="tableW"> </a-table>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { ref, onMounted } from 'vue';
+import { columns } from './bundle-table.data';
+import { getBundleInfoList } from './bundle-table.api';
+import customHeader from '/@/components/vent/customHeader.vue';
+
+let tableData = ref<any[]>([]);
+
+//获取粉尘监测结果数据
+async function getTableList() {
+  let res = await getBundleInfoList({ type: 'bundle' });
+  console.log('API 返回的数据:', res); // 打印 API 返回的完整数据
+  if (res && res.result && typeof res.result.content === 'string') {
+    try {
+      let content = JSON.parse(res.result.content);
+      if (Array.isArray(content)) {
+        content.forEach((element) => {
+          element.zygx = '生产\n检修'; // 新增 zygx 字段
+        });
+        tableData.value = content;
+      } else {
+        console.error('解析后的 content 不是一个数组:', content);
+      }
+    } catch (error) {
+      console.error('解析 content 字符串时出错:', error);
+    }
+  }
+}
+
+onMounted(() => {
+  getTableList();
+});
+</script>
+
+<style lang="less" scoped>
+@import '/@/design/theme.less';
+
+.dustMonitor {
+  width: 100%;
+  height: 100%;
+  padding: 80px 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;
+}
+</style>

+ 10 - 0
src/views/vent/dust/dustMonitorTable/dsut-table.api.ts

@@ -0,0 +1,10 @@
+import { defHttp } from '/@/utils/http/axios';
+
+enum Api {
+  getDustInfo = '/ventanaly-device/safety/reportLocalData/queryReportData',
+}
+/**
+ * 获取粉尘监测结果报表
+ * @param params
+ */
+export const getDustInfoList = (params) => defHttp.post({ url: Api.getDustInfo, params });

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

@@ -0,0 +1,130 @@
+export const columns = [
+  {
+    title: '序号',
+    width: 60,
+    align: 'center',
+    customRender: ({ index }: { index: number }) => `${index + 1}`,
+  },
+  {
+    title: '工作场所',
+    dataIndex: 'gzcs',
+    key: 'gzcs',
+    width: 130,
+    align: 'center',
+  },
+  {
+    title: '工种',
+    dataIndex: 'gz',
+    key: 'gz',
+    width: 100,
+    align: 'center',
+  },
+  {
+    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',
+  },
+  {
+    title: '总尘容许浓度(mg/m³)',
+    children: [
+      {
+        title: '短时间监测浓度',
+        dataIndex: 'zcrxd_ds',
+        key: 'zcrxd_ds',
+        width: 100,
+        align: 'center',
+      },
+      {
+        title: '时间加权平均浓度',
+        dataIndex: 'zcrxd_jqpj',
+        key: 'zcrxd_jqpj',
+        width: 120,
+        align: 'center',
+      },
+    ],
+  },
+  {
+    title: '呼尘容许浓度(mg/m³)',
+    children: [
+      {
+        title: '短时间监测浓度',
+        dataIndex: 'hcrxd_ds',
+        key: 'hcrxd_ds',
+        width: 120,
+        align: 'center',
+      },
+      {
+        title: '时间加权平均浓度',
+        dataIndex: 'hcrxd_jqpj',
+        key: 'hcrxd_jqpj',
+        width: 120,
+        align: 'center',
+      },
+    ],
+  },
+];

+ 54 - 0
src/views/vent/dust/dustMonitorTable/index.vue

@@ -0,0 +1,54 @@
+<template>
+  <div class="dustMonitor">
+    <customHeader>粉尘日常监测报表</customHeader>
+    <a-table :columns="columns" :data-source="tableData" size="small" :scroll="{ y: 500 }" class="tableW"> </a-table>
+  </div>
+</template>
+
+<script setup lang="ts">
+import { ref, onMounted } from 'vue';
+import { columns } from './dust-table.data';
+import { getDustInfoList } from './dsut-table.api';
+import customHeader from '/@/components/vent/customHeader.vue';
+
+let tableData = ref<any[]>([]);
+//获取粉尘监测结果数据
+async function getTableList() {
+  let res = await getDustInfoList({ type: 'smoke' });
+  const content = res.content;
+  let contentArr = JSON.parse(content);
+  tableData.value = contentArr;
+}
+onMounted(() => {
+  getTableList();
+});
+</script>
+
+<style lang="less" scoped>
+@import '/@/design/theme.less';
+
+.dustMonitor {
+  width: 100%;
+  height: 100%;
+  padding: 80px 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;
+}
+</style>