Browse Source

[Feat 0000] 新增自然风压历史数据查询功能

hongrunxia 6 days ago
parent
commit
348af0fb6b

+ 2 - 2
src/views/vent/monitorManager/deviceMonitor/components/device/device.data.ts

@@ -558,5 +558,5 @@ export const noLocationArr = () => {
 };
 export const noHistoryArr = () =>
   History_Type['type'] == 'remote'
-    ? ['surface_history', 'majorpath', 'gasDayReport', 'dustDayReport', 'bundleDayReport', 'bundleSpyDayReport', 'gasDay', 'gate_linkdlfm']
-    : ['majorpath', 'gasDayReport', 'dustDayReport', 'bundleDayReport', 'bundleSpyDayReport', 'gate_linkdlfm', 'gasDay', 'substation_normal'];
+    ? ['surface_history', 'gasDayReport', 'dustDayReport', 'bundleDayReport', 'bundleSpyDayReport', 'gasDay', 'gate_linkdlfm']
+    : ['gasDayReport', 'dustDayReport', 'bundleDayReport', 'bundleSpyDayReport', 'gate_linkdlfm', 'gasDay', 'substation_normal'];

+ 10 - 1
src/views/vent/monitorManager/deviceMonitor/components/device/index.vue

@@ -542,7 +542,10 @@
                 <HistoryTableNew class="w-100% h-100%" :device-code="`${deviceType}`" :scroll="scroll" dict-code="fan_dict" />
               </template>
               <template v-else-if="deviceType.startsWith('fanlocal')">
-                <HistoryTableNew class="w-100% h-100%" :device-code="`${deviceType}`" :scroll="scroll" dict-code="fanlocal_dict" />
+                <HistoryTableNew class="w-100% hM-100%" :device-code="`${deviceType}`" :scroll="scroll" dict-code="fanlocal_dict" />
+              </template>
+              <template v-else-if="deviceType.startsWith('majorpath')">
+                <HistoryTableMajorPath class="w-100% h-100%" :sysId="`${systemID}`" :scroll="scroll" columnsType="sys_majorpath" type="table" />
               </template>
               <template v-else>
                 <HistoryTable
@@ -556,6 +559,11 @@
               </template>
             </div>
           </a-tab-pane>
+          <!-- <a-tab-pane key="5" tab="历史曲线" v-if="deviceType.startsWith('majorpath')">
+            <div class="tab-item">
+              <HistoryTableMajorPath class="w-100% h-100%" :sysId="`${systemID}`" :scroll="scroll" columnsType="sys_majorpath" type="chart" />
+            </div>
+          </a-tab-pane> -->
           <a-tab-pane key="3" tab="报警历史" v-if="!noWarningArr.find((item) => deviceType.startsWith(item))">
             <div class="tab-item">
               <AlarmHistoryTable
@@ -615,6 +623,7 @@ import bundleMonitorTable from '../../../comment/bundleMonitorTable.vue';
 import gasInspectDialog from '../../../comment/gasInspectDialog.vue';
 import DustingTable from '../../../comment/DustingTable.vue';
 import bundleSpyMonitorTable from '../../../comment/bundleSpyMonitorTable.vue';
+import HistoryTableMajorPath from './modal/HistoryTableMajorPath.vue';
 import HistoryBall from './modal/history-ball.vue';
 import { TreeProps, message, Progress, Input, Select } from 'ant-design-vue';
 import { TableAction } from '/@/components/Table';

+ 238 - 0
src/views/vent/monitorManager/deviceMonitor/components/device/modal/HistoryTableMajorPath.vue

@@ -0,0 +1,238 @@
+<template>
+  <div class="alarm-history-table">
+    <BasicTable v-if="type == 'table'" @register="registerTable">
+      <template #form-submitBefore>
+        <a-button type="primary" preIcon="ant-design:search-outlined" @click="getDataSource">查询</a-button>
+      </template>
+      <template #bodyCell="{ column, record }">
+        <template v-if="column.dict">
+          <span>
+            {{ render.renderDictText(record[column.dataIndex], column.dict) || '-' }}
+          </span>
+        </template>
+      </template>
+    </BasicTable>
+    <BarAndLine
+      v-else
+      class="echarts-line"
+      xAxisPropType="createTime"
+      :dataSource="dataSource"
+      height="300px"
+      :chartsColumns="chartColumns"
+      :option="echatsOption"
+    />
+  </div>
+</template>
+
+<script lang="ts" name="system-user" setup>
+  //ts语法
+  import { watch, ref, defineExpose, inject, onMounted } from 'vue';
+  import { BasicTable } from '/@/components/Table';
+  import { useListPage } from '/@/hooks/system/useListPage';
+  import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
+  import { defHttp } from '/@/utils/http/axios';
+  import dayjs from 'dayjs';
+  import { getAutoScrollContainer } from '/@/utils/common/compUtils';
+  import { render } from '/@/utils/common/renderUtils';
+  import BarAndLine from '/@/components/chart/BarAndLine.vue';
+
+  const props = defineProps({
+    sysId: {
+      type: String,
+      required: true,
+    },
+    columnsType: {
+      type: String,
+      required: true,
+    },
+    list: {
+      type: Function,
+      default: (params) => defHttp.post({ url: '/ventanaly-device/safety/ventanalyDeviceInfo/getZrfyInfoLogList', params }),
+    },
+    scroll: {
+      type: Object,
+      default: { y: 0 },
+    },
+    type: {
+      type: String,
+      required: true,
+    },
+  });
+  const echatsOption = {
+    grid: {
+      top: '35',
+      left: '30',
+      right: '45',
+      bottom: '25',
+      containLabel: true,
+    },
+    toolbox: {
+      feature: {},
+    },
+  };
+  const dataSource = ref();
+  const columns = ref([]);
+  const chartColumns = ref([]);
+  const deviceOptions = ref([]);
+  const tableScroll = props.scroll.y ? ref({ y: props.scroll.y - 100 }) : ref({});
+
+  async function getDataSource() {
+    const pagination = getPaginationRef();
+    const res = await defHttp.post({
+      url: '/ventanaly-device/safety/ventanalyDeviceInfo/getZrfyInfoLogList',
+      data: { sysId: props.sysId, pageNo: pagination['current'], pageSize: pagination['pageSize'] },
+    });
+    setPagination({
+      total: res['total'] || 0,
+      current: res['current'] || 1,
+      pageSize: res['size'] || 1,
+      size: res['pages'] || 1,
+    });
+    if (res.records && res.records.length > 0) {
+      dataSource.value = res.records;
+    }
+  }
+  watch(
+    () => {
+      return props.columnsType;
+    },
+    async (newVal) => {
+      if (!newVal) return;
+
+      const column = getTableHeaderColumns(newVal + '_history');
+      const chartColumnList = getTableHeaderColumns(newVal + '_chart');
+      if (column && column.length < 1) {
+        const arr = newVal.split('_');
+        columns.value = getTableHeaderColumns(arr[0] + '_history');
+        chartColumns.value = getTableHeaderColumns(arr[0] + '_chart');
+      } else {
+        columns.value = column;
+        chartColumns.value = chartColumnList;
+      }
+    },
+    {
+      immediate: true,
+    }
+  );
+
+  watch(
+    () => props.scroll.y,
+    (newVal) => {
+      if (newVal) {
+        tableScroll.value = { y: newVal - 100 };
+      } else {
+        tableScroll.value = {};
+      }
+    }
+  );
+
+  // 列表页面公共参数、方法
+  const { tableContext } = useListPage({
+    tableProps: {
+      dataSource: dataSource,
+      columns: columns,
+      canResize: true,
+      showTableSetting: false,
+      showActionColumn: false,
+
+      bordered: false,
+      size: 'small',
+      scroll: tableScroll,
+      showIndexColumn: true,
+      formConfig: {
+        labelAlign: 'left',
+        showAdvancedButton: false,
+        showSubmitButton: false,
+        schemas: [
+          {
+            field: 'createTime_begin',
+            label: '开始时间',
+            component: 'DatePicker',
+            defaultValue: dayjs().add(-30, 'day').format('YYYY-MM-DD HH:mm:ss'),
+            required: true,
+            componentProps: {
+              showTime: true,
+              valueFormat: 'YYYY-MM-DD HH:mm:ss',
+              getPopupContainer: getAutoScrollContainer,
+            },
+            colProps: {
+              span: 4,
+            },
+          },
+          {
+            field: 'createTime_end',
+            label: '结束时间',
+            component: 'DatePicker',
+            defaultValue: dayjs(),
+            required: true,
+            componentProps: {
+              showTime: true,
+              valueFormat: 'YYYY-MM-DD HH:mm:ss',
+              getPopupContainer: getAutoScrollContainer,
+            },
+            colProps: {
+              span: 4,
+            },
+          },
+        ],
+      },
+      fetchSetting: {
+        listField: 'records',
+      },
+      pagination: {
+        current: 1,
+        pageSize: 10,
+        pageSizeOptions: ['10', '30', '50', '100'],
+      },
+    },
+  });
+  //注册table数据
+  const [registerTable, { reload, setLoading, setPagination, getPaginationRef }] = tableContext;
+
+  onMounted(async () => {
+    await getDataSource();
+    watch([() => getPaginationRef()['current'], () => getPaginationRef()['pageSize']], async () => {
+      await getDataSource();
+    });
+  });
+
+  defineExpose({ setLoading });
+</script>
+
+<style scoped lang="less">
+  @ventSpace: zxm;
+
+  :deep(.ventSpace-table-body) {
+    height: auto !important;
+  }
+  :deep(.zxm-picker) {
+    height: 30px !important;
+  }
+  .alarm-history-table {
+    width: 100%;
+    :deep(.jeecg-basic-table-form-container) {
+      .@{ventSpace}-form {
+        padding: 0 !important;
+        border: none !important;
+        margin-bottom: 0 !important;
+        .@{ventSpace}-picker,
+        .@{ventSpace}-select-selector {
+          width: 100% !important;
+          background: #00000017;
+          border: 1px solid #b7b7b7;
+          input,
+          .@{ventSpace}-select-selection-item,
+          .@{ventSpace}-picker-suffix {
+            color: #fff;
+          }
+          .@{ventSpace}-select-selection-placeholder {
+            color: #ffffffaa;
+          }
+        }
+      }
+      .@{ventSpace}-table-title {
+        min-height: 0 !important;
+      }
+    }
+  }
+</style>