|
@@ -1,14 +1,6 @@
|
|
|
<template>
|
|
|
<div class="history-table">
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- <BasicTable v-if="globalConfig.History_Type == 'vent'" ref="historyTable" @register="registerTable" >
|
|
|
- <template #bodyCell="{ column, record }">
|
|
|
- <slot name="filterCell" v-bind="{ column, record }"></slot>
|
|
|
- </template>
|
|
|
- </BasicTable>
|
|
|
- <BasicTable v-else ref="historyTable" @register="registerTable" >
|
|
|
+ <BasicTable ref="historyTable" @register="registerTable" >
|
|
|
<template #bodyCell="{ column, record }">
|
|
|
<slot name="filterCell" v-bind="{ column, record }"></slot>
|
|
|
</template>
|
|
@@ -25,8 +17,10 @@
|
|
|
import { getTableHeaderColumns } from '/@/hooks/web/useWebColumns';
|
|
|
import { defHttp } from '/@/utils/http/axios';
|
|
|
import dayjs from 'dayjs';
|
|
|
- const globalConfig = inject('globalConfig');
|
|
|
+ import { getAutoScrollContainer } from '/@/utils/common/compUtils';
|
|
|
|
|
|
+ const globalConfig = inject('globalConfig');
|
|
|
+
|
|
|
const historyTable = ref();
|
|
|
const dataSource = ref([])
|
|
|
|
|
@@ -53,7 +47,6 @@
|
|
|
},
|
|
|
deviceListApi: {
|
|
|
type: Function,
|
|
|
- required: true,
|
|
|
},
|
|
|
designScope: {
|
|
|
type: String,
|
|
@@ -109,6 +102,7 @@
|
|
|
}
|
|
|
})
|
|
|
|
|
|
+
|
|
|
// 列表页面公共参数、方法
|
|
|
const { tableContext } = useListPage(
|
|
|
globalConfig.History_Type == 'vent' ? {
|
|
@@ -141,6 +135,9 @@
|
|
|
field: 'tData',
|
|
|
component: 'DatePicker',
|
|
|
defaultValue: dayjs(),
|
|
|
+ colProps: {
|
|
|
+ span: 4,
|
|
|
+ },
|
|
|
componentProps: {
|
|
|
valueFormat: 'YYYY-MM-DD',
|
|
|
},
|
|
@@ -153,6 +150,9 @@
|
|
|
placeholder: ['开始时间', '结束时间'],
|
|
|
valueFormat: 'HH:mm:ss',
|
|
|
},
|
|
|
+ colProps: {
|
|
|
+ span: 4,
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
label: '查询设备',
|
|
@@ -166,6 +166,9 @@
|
|
|
valueField: 'id',
|
|
|
// numberToString: true,
|
|
|
},
|
|
|
+ colProps: {
|
|
|
+ span: 4,
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
label: '间隔时间',
|
|
@@ -195,18 +198,22 @@
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
+ colProps: {
|
|
|
+ span: 4,
|
|
|
+ },
|
|
|
},
|
|
|
],
|
|
|
fieldMapToTime: [['tickectDate', ['ttime_begin', 'ttime_end'], '']],
|
|
|
},
|
|
|
fetchSetting: {
|
|
|
- listField: globalConfig.History_Type == 'iot'? 'records': globalConfig.History_Type == 'records'? '': 'datalist.records',
|
|
|
- totalField: globalConfig.History_Type == 'iot' ? 'total' : globalConfig.History_Type == 'total' ? 'total' : 'datalist.total',
|
|
|
+ listField: 'datalist',
|
|
|
+ totalField: 'datalist.total',
|
|
|
},
|
|
|
pagination: {
|
|
|
current: 1,
|
|
|
- pageSize: 20,
|
|
|
- pageSizeOptions: ['20', '50', '100'],
|
|
|
+ pageSize: 10,
|
|
|
+ pageSizeOptions: ['10', '30', '50', '100'],
|
|
|
+ showQuickJumper: false
|
|
|
},
|
|
|
beforeFetch(params) {
|
|
|
params.strtype = props.deviceType + '*';
|
|
@@ -214,10 +221,12 @@
|
|
|
params.sysId = props.sysId;
|
|
|
}
|
|
|
},
|
|
|
- afterFetch(resultItems) {
|
|
|
+ afterFetch(result) {
|
|
|
+ const resultItems = result['records']
|
|
|
resultItems.map((item) => {
|
|
|
Object.assign(item, item['readData']);
|
|
|
});
|
|
|
+ console.log('result---------------->', result)
|
|
|
return resultItems;
|
|
|
},
|
|
|
},
|
|
@@ -247,12 +256,25 @@
|
|
|
},
|
|
|
schemas: props.formSchemas.length > 0 ? props.formSchemas : [
|
|
|
{
|
|
|
- label: '查询日期',
|
|
|
- field: 'tData',
|
|
|
+ field: 'startTime',
|
|
|
+ label: '开始时间',
|
|
|
component: 'DatePicker',
|
|
|
- defaultValue: dayjs(),
|
|
|
+ required: true,
|
|
|
+ componentProps: {
|
|
|
+ showTime: true,
|
|
|
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
+ getPopupContainer: getAutoScrollContainer,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ field: 'endTime',
|
|
|
+ label: '结束时间',
|
|
|
+ component: 'DatePicker',
|
|
|
+ required: true,
|
|
|
componentProps: {
|
|
|
- valueFormat: 'YYYY-MM-DD hh:mm:ss',
|
|
|
+ showTime: true,
|
|
|
+ valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
|
|
+ getPopupContainer: getAutoScrollContainer,
|
|
|
},
|
|
|
},
|
|
|
{
|
|
@@ -272,7 +294,7 @@
|
|
|
label: '间隔时间',
|
|
|
field: 'interval',
|
|
|
component: 'Select',
|
|
|
- defaultValue: 1,
|
|
|
+ defaultValue: '30s',
|
|
|
componentProps: {
|
|
|
options: [
|
|
|
{
|
|
@@ -311,12 +333,14 @@
|
|
|
},
|
|
|
},
|
|
|
],
|
|
|
- fieldMapToTime: [['tData', ['startTime', 'endTime'], 'YYYY-MM-DD HH:mm:ss']],
|
|
|
},
|
|
|
- pagination: {
|
|
|
- current: 1,
|
|
|
- pageSize: 20,
|
|
|
- pageSizeOptions: ['20', '50', '100'],
|
|
|
+ // pagination: false,
|
|
|
+ fetchSetting: {
|
|
|
+ totalField: 'total',
|
|
|
+ // 每页显示多少条
|
|
|
+ sizeField: 'pageSize',
|
|
|
+ // 请求结果列表字段 支持 a.b.c
|
|
|
+ pageField: 'pageNo'
|
|
|
},
|
|
|
beforeFetch(params) {
|
|
|
params.strtype = props.deviceType + '*';
|
|
@@ -328,28 +352,14 @@
|
|
|
}else{
|
|
|
params.interval = '1m'
|
|
|
}
|
|
|
- if(props.deviceType.startsWith('location')){
|
|
|
- params['isEmployee'] = false
|
|
|
- }else if(props.deviceType.includes('cheliang')){
|
|
|
- params['isEmployee'] = true
|
|
|
- }
|
|
|
},
|
|
|
afterFetch(result) {
|
|
|
- let dataSource = []
|
|
|
- if(result['records'] && result['records'].length >0){
|
|
|
- dataSource = result['records'].map((item) => {
|
|
|
- Object.assign(item, result['deviceId'], result['deviceName'], result['devicePos'] );
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- return dataSource;
|
|
|
+ return result;
|
|
|
},
|
|
|
},
|
|
|
}
|
|
|
);
|
|
|
|
|
|
-
|
|
|
-
|
|
|
//注册table数据
|
|
|
const [registerTable, { getDataSource, reload, setLoading, getForm }] = tableContext;
|
|
|
|
|
@@ -403,5 +413,19 @@
|
|
|
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>
|