yudao-dev/src/views/Environmental/Environmental-log.vue
2024-12-13 12:56:40 +08:00

126 lines
2.7 KiB
Vue

<!--
* @Author: zwq
* @Date: 2024-11-13 14:01:16
* @LastEditors: zwq
* @LastEditTime: 2024-11-13 15:36:35
* @Description:
-->
<template>
<div>
<div class="app-container">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-props="tableProps"
:table-data="tableData"
:max-height="tableH" />
<pagination
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</div>
</template>
<script>
import basicPage from '@/mixins/basic-page';
import { getCostEnviHisPage } from '@/api/environmental/environmentalLog';
import { parseTime } from '@/filter/code-filter';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
const tableProps = [
{
prop: 'recTime',
label: '记录时间',
filter: parseTime,
minWidth: 150,
},
{
prop: 'remark',
label: '备注',
},
{
prop: 'envi1',
label: '二氧化硫mg/Nm3',
},
{
prop: 'envi2',
label: '氮氧化物mg/Nm3',
},
{
prop: 'envi3',
label: '粉尘mg/Nm3',
},
];
export default {
name: '',
mixins: [basicPage, tableHeightMixin],
data() {
return {
urlOptions: {
getDataListURL: getCostEnviHisPage,
},
formConfig: [
{
type: 'datePicker',
label: '时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
width: 350,
param: 'searchTime',
clearable: false,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
],
listQuery: {
statisticType: 1,
},
tableProps,
tableData: [],
};
},
components: {},
created() {
const end = new Date();
const start = new Date();
this.listQuery.startTime = parseTime(start).substr(0, 10) + ' 00:00:00';
this.listQuery.endTime = parseTime(end).substr(0, 10) + ' 23:59:59';
this.formConfig[0].startPlaceholder = parseTime(start).substr(0, 10);
this.formConfig[0].endPlaceholder = parseTime(end).substr(0, 10);
},
methods: {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.statisticType = 1;
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
this.listQuery.endTime = val.searchTime ? val.searchTime[1] : null;
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>
<style lang="scss"></style>