Browse Source

Merge branch 'master' of http://182.92.126.35:3000/hrx/mky-vent-base

lxh 5 days ago
parent
commit
3de7302fb9

+ 6 - 1
src/views/vent/monitorManager/comment/HistoryTable.vue

@@ -155,6 +155,7 @@
   watch(historyType, (type) => {
     if (!type) return;
     // if (historyTable.value) getForm().resetFields()
+
     const column = getTableHeaderColumns(type.includes('_history') ? type : type + '_history');
     if (column && column.length < 1) {
       const arr = type.split('_');
@@ -252,7 +253,11 @@
       });
 
       stationType.value = deviceOptions.value[0]['stationtype'];
-      historyType.value = deviceOptions.value[0]['strtype'] || deviceOptions.value[0]['devicekind'];
+      if (props.deviceType.startsWith('vehicle')) {
+        historyType.value = 'vehicle';
+      } else {
+        historyType.value = deviceOptions.value[0]['strtype'] || deviceOptions.value[0]['devicekind'];
+      }
     }
     if (VENT_PARAM.historyIsMultiple) {
       await getForm().setFieldsValue({

+ 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'];

+ 34 - 32
src/views/vent/monitorManager/deviceMonitor/components/device/index.vue

@@ -125,17 +125,22 @@
           <FullscreenExitOutlined style="font-size: 18px" />
         </div>
         <!-- 是人员定位表单代码,由于放在tab中,表格对已知刷新,导致表单数据也在刷寻,造成输入一半的中文时会清空输入框的内容,导致的输入不上数据 -->
-        <div v-if="deviceType.startsWith('location') && activeKey == '1'" class="location-form"
-          style="position: absolute; z-index: 9999; top: 50px">
+        <div v-if="(deviceType.startsWith('location') || deviceType.startsWith('vehicle')) && activeKey == '1'" class="location-form" style="position: absolute; z-index: 9999; top: 50px">
           <div class="location-form-item">
-            <span class="location-form-label">人员名称:</span>
+            <span class="location-form-label">{{ deviceType.startsWith('location') ? '人员名称:' : '车辆名称' }}</span>
             <Input style="width: 200px" v-model:value="locationForm.strname" />
           </div>
-          <div class="location-form-item">
+          <!-- <div class="location-form-item">
             <span class="location-form-label">所属部门:</span>
-            <MTreeSelect style="width: 200px" v-model:value="locationForm.department" placeholder="请选择所属部门"
-              api="/monitor/getDepartmentInfo" :virtual="false" :isGetPopupContainer="false" />
-          </div>
+            <MTreeSelect
+              style="width: 200px"
+              v-model:value="locationForm.department"
+              placeholder="请选择所属部门"
+              api="/monitor/getDepartmentInfo"
+              :virtual="false"
+              :isGetPopupContainer="false"
+            />
+          </div> -->
           <div class="location-form-item">
             <span class="location-form-label">分站名称:</span>
             <Input style="width: 200px" v-model:value="locationForm.stationname" />
@@ -233,9 +238,18 @@
               </MonitorTable>
             </template>
             <template v-else-if="deviceType.startsWith('vehicle') && activeKey == '1'">
-              <MonitorTable ref="monitorTable" :columnsType="`${deviceType}_monitor`" :deviceType="deviceType"
-                :dataSource="dataSource" design-scope="device_monitor" :isShowActionColumn="true" :isShowSelect="false"
-                title="设备监测" :form-config="vehicleFormConfig" :scroll="{ y: scroll.y - 110 }">
+              <MonitorTable
+                ref="monitorTable"
+                :columnsType="`${deviceType}_monitor`"
+                :deviceType="deviceType"
+                :dataSource="dataSource"
+                design-scope="device_monitor"
+                :isShowActionColumn="true"
+                :isShowSelect="false"
+                title="设备监测"
+                :scroll="{ y: scroll.y - 110 }"
+                style="margin-top: 60px"
+              >
                 <template v-if="!noLocationList.includes('location')" #action="{ record }">
                   <TableAction :actions="[
                     {
@@ -456,8 +470,10 @@
                   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 ref="historyTable" :sysId="systemID" :columns-type="`${deviceType}`"
@@ -465,6 +481,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 ref="alarmHistoryTable" v-if="activeKey == '3'" :sysId="systemID" columns-type="alarm"
@@ -510,6 +531,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';
@@ -1064,26 +1086,6 @@ function goDetail(record?) {
     }
   }
 }
-// function goGasDayReport() {
-//   const newPage = router.resolve({ path: '/gas/gas-report-inspect/home' });
-//   window.open(newPage.href, '_blank');
-// }
-// function gogasDayReportHis() {
-//   const newPage = router.resolve({ path: '/gas/gasDayReport/home' });
-//   window.open(newPage.href, '_blank');
-// }
-// function goDustDayReport() {
-//   const newPage = router.resolve({ path: '/dustDayReport/home' });
-//   window.open(newPage.href, '_blank');
-// }
-// function goBundleDayReport() {
-//   const newPage = router.resolve({ path: '/bundleDayReport/home' });
-//   window.open(newPage.href, '_blank');
-// }
-// function goBundleSpyDayReport() {
-//   const newPage = router.resolve({ path: '/bundleSpyDayReport/home' });
-//   window.open(newPage.href, '_blank');
-// }
 function exportXls() {
   handleExportXls('瓦斯巡检记录', getExportUrl, { devicetype: deviceType.value });
 }

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

@@ -0,0 +1,239 @@
+<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'],
+        showQuickJumper: false,
+      },
+    },
+  });
+  //注册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>