浏览代码

1. 替换注氮历史查询组件
2. 束管历史echarts接口设备类型参数动态获取

hongrunxia 10 月之前
父节点
当前提交
ff890d2a97

+ 63 - 13
src/views/vent/comment/history/HistoryTable.vue

@@ -1,17 +1,19 @@
 <template>
-  <BasicTable ref="historyTable" @register="register" :data-source="data">
-    <template #bodyCell="{ column, record }">
-      <a-tag v-if="column.dataIndex === 'warnFlag'" :color="record.warnFlag == '0' ? 'green' : 'red'">
-        {{ record.warnFlag == '0' ? '正常' : '报警' }}
-      </a-tag>
-      <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == '0' ? '#f00' : 'green'">
-        {{ record.netStatus == '0' ? '断开' : '连接' }}
-      </a-tag>
-    </template>
-    <template #form-submitBefore>
-      <a-button type="primary" preIcon="ant-design:search-outlined" @click="search">查询</a-button>
-    </template>
-  </BasicTable>
+  <div class="history-table">
+    <BasicTable ref="historyTable" @register="register" :data-source="data">
+      <template #bodyCell="{ column, record }">
+        <a-tag v-if="column.dataIndex === 'warnFlag'" :color="record.warnFlag == '0' ? 'green' : 'red'">
+          {{ record.warnFlag == '0' ? '正常' : '报警' }}
+        </a-tag>
+        <a-tag v-if="column.dataIndex === 'netStatus'" :color="record.netStatus == '0' ? '#f00' : 'green'">
+          {{ record.netStatus == '0' ? '断开' : '连接' }}
+        </a-tag>
+      </template>
+      <template #form-submitBefore>
+        <a-button type="primary" preIcon="ant-design:search-outlined" @click="search">查询</a-button>
+      </template>
+    </BasicTable>
+  </div>
 </template>
 
 <script lang="ts" setup>
@@ -222,4 +224,52 @@
 
 <style scoped lang="less">
   @import '/@/design/vent/color.less';
+
+  :deep(.@{ventSpace}-table-body) {
+    height: auto !important;
+  }
+  :deep(.zxm-picker) {
+    height: 30px !important;
+  }
+  .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;
+      }
+    }
+    .pagination-box {
+      display: flex;
+      justify-content: flex-end;
+      align-items: center;
+      .page-num {
+        border: 1px solid #0090d8;
+        padding: 4px 8px;
+        margin-right: 5px;
+        color: #0090d8;
+      }
+      .btn {
+        margin-right: 10px;
+      }
+    }
+  }
 </style>

+ 1 - 1
src/views/vent/comment/history/history.data.ts

@@ -64,7 +64,7 @@ export const getDefaultSchemas: (dictCode: any[], deviceOptions: any[]) => FormS
     component: 'Select',
     required: Boolean(dictOptions.length),
     show: Boolean(dictOptions.length),
-    defaultValue: dictOptions[0].value,
+    defaultValue: dictOptions[0] ? dictOptions[0].value : '',
     componentProps: {
       options: dictOptions,
       // onChange: (e, option) => {

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

@@ -18,7 +18,7 @@
   </div>
 </template>
 
-<script lang="ts" name="system-user" setup>
+<script lang="ts" setup>
   //ts语法
   import { watchEffect, ref, watch, defineExpose, inject, nextTick } from 'vue';
   import { FormSchema } from '/@/components/Form/index';

+ 2 - 1
src/views/vent/monitorManager/deviceMonitor/components/device/modal/bundle.modal.vue

@@ -208,7 +208,7 @@
           const pageNo = 1;
           const pageSize = 100;
           const skip = 8;
-          const strtype = 'bundletube_auto';
+          const strtype = posMonitor.value.deviceType;
           let res = await listdays({ ttime_begin, ttime_end, pageNo, pageSize, skip, strtype, gdeviceid: activeDeviceID.value });
           console.log(res, '束管历史数据');
           let data = res.datalist.records;
@@ -258,6 +258,7 @@
             item.readTime = item.readTime?.substring(11);
             return item;
           });
+          debugger;
         },
         { immediate: true }
       );

+ 3 - 4
src/views/vent/monitorManager/nitrogen/components/nitrogenHistory.vue

@@ -1,12 +1,11 @@
 <template>
   <div class="nitrogen-history">
-    <!-- <HistoryTable columns-type="forcFan" device-type="forcFan" designScope="forcFan_history" :scroll="{ y: 650 }" /> -->
-    <HistoryTable device-code="forcFan" dict-code="forcFan_dict" columns-code="forcFan_history" />
+    <HistoryTable columns-type="forcFan" device-type="forcFan" designScope="forcFan_history" />
+    <!-- <HistoryTable device-code="forcFan" dict-code="forcFan_dict" columns-code="forcFan_history" /> -->
   </div>
 </template>
 <script setup lang="ts">
-  // import HistoryTable from '../../comment/HistoryTable.vue';
-  import HistoryTable from '/@/views/vent/comment/history/HistoryTable.vue';
+  import HistoryTable from '/@/views/vent/monitorManager/comment/HistoryTable.vue';
 </script>
 <style lang="less" scoped>
   .nitrogen-history {