فهرست منبع

安全监控分站管理历史数据问题修改

bobo04052021@163.com 4 ماه پیش
والد
کامیت
8189c0fc16
2فایلهای تغییر یافته به همراه13 افزوده شده و 21 حذف شده
  1. 9 19
      src/views/vent/safetyList/common/HistoryTable.vue
  2. 4 2
      src/views/vent/safetyList/common/detail.vue

+ 9 - 19
src/views/vent/safetyList/common/HistoryTable.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="history-table" v-if="loading">
-    <BasicTable ref="historyTable" @register="registerTable" :data-source="dataSource" :columns="historyColumns">
+    <BasicTable ref="historyTable" @register="registerTable" :data-source="dataSource">
       <template #form-submitBefore>
         <a-button type="primary" preIcon="ant-design:search-outlined" @click="getDataSource">查询</a-button>
         <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXlsFn">导出</a-button>
@@ -13,7 +13,7 @@
 //ts语法
 import { watchEffect, ref, watch, defineExpose, inject, nextTick, onMounted, computed } from 'vue';
 import { subStationList } from '../safetyList.api';
-import { historyColumns } from '../historyLsit.data';
+// import { historyColumns } from '../historyLsit.data';
 import { FormSchema } from '/@/components/Form/index';
 import { BasicTable } from '/@/components/Table';
 import { useListPage } from '/@/hooks/system/useListPage';
@@ -50,21 +50,15 @@ const props = defineProps({
 });
 const postExportXlsUrl = '/safety/ventanalySubStation/export158StatusLog';
 //获取分站数据
-const getDeviceListApi = (params) => defHttp.get({ url: '/safety/ventanalySubStation/alllist', params });
 const historyTable = ref();
 const loading = ref(false);
 const dataSource = ref([]);
 
 const emit = defineEmits(['change']);
 
-const historyType = ref('');
 const deviceKide = ref('');
 const columns = ref([]);
 const tableScroll = props.scroll.y ? ref({ y: props.scroll.y - 100 }) : ref({});
-const statusMap = new Map([
-  ['1', '连接成功'],
-  ['0', '连接失败'],
-]);
 loading.value = true;
 
 watch(
@@ -134,18 +128,14 @@ async function getDataSource() {
     { url: '/safety/ventanalySubStation/get158StatusLog', params: params },
     { joinParamsToUrl: true, isTransformResponse: false }
   );
-  dataSource.value = result['records'];
+  if (result['records'].length > 0) {
+    dataSource.value = result['records'];
+  } else {
+    dataSource.value = [];
+  }
+  // dataSource.value = result['records'];
   setLoading(false);
 }
-//导出
-// async function onExportXlsFn() {
-//   const params = await resetFormParam();
-//   await defHttp.post({ url: postExportXlsUrl, params: params }, { joinParamsToUrl: true, isTransformResponse: false });
-//   // dataSource.value = result['records'];
-//   // const params = resetFormParam();
-//   // // 判断时间间隔和查询时间区间,数据量下载大时进行提示
-//   // return onExportXlsPost(params);
-// }
 //导入导出方法
 function onExportXlsFn() {
   const { exportXlsPost0 } = useMethods();
@@ -154,7 +144,7 @@ function onExportXlsFn() {
 }
 
 // 列表页面公共参数、方法
-const { tableContext, onExportXlsPost } = useListPage({
+const { tableContext } = useListPage({
   tableProps: {
     // api: list,
     columns: props.historyColumns ? props.historyColumns : (props.historyColumns as any[]),

+ 4 - 2
src/views/vent/safetyList/common/detail.vue

@@ -23,6 +23,9 @@
                   <span class="zd-close">{{ clsoeNum || 0 }}</span>
                 </span>
               </div>
+              <div class="title-btn" style="margin-left: 55%">
+                <a-button type="primary" size="small" @click="getAllShow">显示全部</a-button>
+              </div>
             </div>
             <div class="left-content">
               <div class="card-box" v-for="(item, index) in cardList" :key="index">
@@ -154,7 +157,6 @@
                   <span class="zd-close">{{ clsoeNum || 0 }}</span>
                 </span>
               </div>
-              <a-button type="primary" size="small" @click="getAllShow">显示全部</a-button>
             </div>
             <div class="left-content">
               <div class="card-box" v-for="(item, index) in cardList" :key="index">
@@ -509,7 +511,7 @@ async function getDeviceList() {
 function onChangeTab(tab) {
   activeKey.value = tab;
   if (activeKey.value == 'device') {
-    clearTimeout(timer1);
+    // clearTimeout(timer1);
     getSubStationList();
     getStationList1();
   } else {