This commit is contained in:
2025-01-10 15:07:05 +08:00
parent 43ba33062b
commit 19dbe38458
27 changed files with 3498 additions and 527 deletions

View File

@@ -12,7 +12,9 @@
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<div v-if="tableList.length" class="tables">
<div
v-if="tableList.length"
class="tables">
<div class="custom-table" v-for="table in tableList" :key="table.key">
<!-- {{ JSON.stringify(spanMethod) }} -->
<base-table
@@ -44,6 +46,7 @@
import LocalDataManager from './utils/local-data-manager';
// import response from './response';
import moment from 'moment';
import { parseTime } from '@/filter/code-filter';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
export default {
@@ -76,14 +79,13 @@ export default {
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange', // datetimerange
dateType: 'datetimerange', // datetimerange
format: 'yyyy-MM-dd HH:mm:ss',
// valueFormat: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'timestamp',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
// valueFormat: 'timestamp',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
defaultTime: ['00:00:00', '23:59:59'],
param: 'timeVal',
width: 350,
// defaultSelect: [new Date(aWeekAgo), new Date(today)],
@@ -97,7 +99,7 @@ export default {
],
queryParams: {
equipmentId: null,
time: [new Date(aWeekAgo), new Date(today)],
recordTime: null,
},
tableList: [
// {
@@ -128,7 +130,12 @@ export default {
this.$set(this.searchBarFormConfig[0], 'defaultSelect', this.code);
if (this.name)
this.$set(this.searchBarFormConfig[1], 'defaultSelect', this.name);
const end = new Date();
const start = new Date() - 1800 * 1000;
this.queryParams.recordTime = [parseTime(start), parseTime(end)];
this.searchBarFormConfig[2].startPlaceholder = parseTime(start);
this.searchBarFormConfig[2].endPlaceholder = parseTime(end);
this.handleQuery();
// this.handleResponse();
},
methods: {
@@ -238,10 +245,12 @@ export default {
},
async handleSearchBarBtnClick({ btnName, timeVal }) {
this.searchBarFormConfig[2].startPlaceholder = '开始时间';
this.searchBarFormConfig[2].endPlaceholder = '结束时间';
if (timeVal && timeVal.length > 0) {
this.queryParams.time = timeVal;
this.queryParams.recordTime = timeVal;
} else {
this.queryParams.time = [];
this.queryParams.recordTime = [];
}
await this.handleQuery();
},
@@ -270,7 +279,6 @@ export default {
grid-template-columns: 1fr 1fr;
gap: 18px;
}
.tables >>> .baseTable {
overflow-x: hidden;
}