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