<template>
|
<div class="device_list">
|
<!-- 查询区域 -->
|
<div class="table-page-search-wrapper">
|
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
<a-row :gutter="24">
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-form-item label="设备编号">
|
<a-input placeholder="请输入设备编号" v-model="queryParam.equipmentId"/>
|
</a-form-item>
|
</a-col>
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-form-item label="日期">
|
<a-range-picker value-format="YYYY-MM-DD" v-model="queryParam.dates" @change="dateParamChange"
|
:disabled-date="disabledDate"/>
|
</a-form-item>
|
</a-col>
|
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
<a-space>
|
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
<a-button type="primary" @click="searchReset" icon="reload">重置</a-button>
|
</a-space>
|
</a-col>
|
</a-row>
|
</a-form>
|
</div>
|
<!-- 查询区域-END -->
|
|
<!-- 操作按钮区域 -->
|
<div class="table-operator">
|
<a-button type="primary" icon="download" @click="handleExportXls('倍率报表')">导出</a-button>
|
</div>
|
|
<!-- table区域-begin -->
|
<div id="DeviceList" style="flex: 1;overflow: hidden">
|
<a-table :scroll="{x:'max-content',y:scrollY}" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
|
:pagination="ipagination" :loading="loading" @change="handleTableChange"/>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import moment from 'moment'
|
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
export default {
|
name: 'MagnificationReportList',
|
mixins: [JeecgListMixin],
|
components: {},
|
props: { nodeTree: '', Type: '', nodePeople: '' },
|
data() {
|
return {
|
disableMixinCreated: true,
|
/* 分页参数 */
|
ipagination: {
|
current: 1,
|
pageSize: 30,
|
pageSizeOptions: ['30', '50', '100'],
|
showTotal: (total, range) => {
|
return range[0] + '-' + range[1] + ' 共' + total + '条'
|
},
|
showQuickJumper: true,
|
showSizeChanger: true,
|
total: 0
|
},
|
queryParam: {
|
dates: [moment().subtract(1, 'day').startOf('day'), moment().subtract(1, 'day').endOf('day')]
|
},
|
// 表头
|
columns: [
|
{
|
title: '#',
|
dataIndex: '',
|
key: 'rowIndex',
|
width: 60,
|
align: 'center',
|
customRender: function(t, r, index) {
|
return parseInt(index) + 1
|
}
|
},
|
{
|
title: '设备编号',
|
align: 'center',
|
dataIndex: 'equipmentId',
|
width: 300
|
},
|
{
|
title: '主轴倍率平均值',
|
align: 'center',
|
dataIndex: 'spindlebeilv'
|
},
|
{
|
title: '进给倍率平均值',
|
align: 'center',
|
dataIndex: 'feedbeilv'
|
},
|
{
|
title: '日期',
|
align: 'center',
|
dataIndex: 'theDate',
|
width: 300
|
}
|
],
|
scrollY: 465,
|
url: {
|
list: '/mdc/magnification/list',
|
exportXlsUrl: '/mdc/magnification/exportXls'
|
}
|
}
|
},
|
watch: {
|
Type(valmath) {
|
this.dataList = []
|
this.queryParam.typeTree = valmath
|
},
|
nodeTree(val) { //监听currSelected 变化,将变化后的数值传递给 getCurrSelected 事件
|
if (JSON.stringify(val) != '{}') {
|
if (val.equipmentId) {
|
this.queryParam.parentId = ''
|
this.queryParam.equipmentId = val.equipmentId
|
} else {
|
this.queryParam.parentId = val.key
|
this.queryParam.equipmentId = ''
|
}
|
this.searchQuery()
|
}
|
},
|
nodePeople(val) {
|
if (JSON.stringify(val) != '{}') {
|
if (val.equipmentId) {
|
this.queryParam.parentId = ''
|
this.queryParam.equipmentId = val.equipmentId
|
} else {
|
this.queryParam.parentId = val.key
|
this.queryParam.equipmentId = ''
|
}
|
this.searchQuery()
|
}
|
}
|
},
|
created() {
|
this.queryParam.startTime = moment(this.queryParam.dates[0]).format('YYYY-MM-DD')
|
this.queryParam.endTime = moment(this.queryParam.dates[1]).format('YYYY-MM-DD')
|
this.loadData(1)
|
},
|
mounted() {
|
window.addEventListener('resize', this.handleWindowResize)
|
this.handleWindowResize()
|
},
|
beforeDestroy() {
|
window.removeEventListener('resize', this.handleWindowResize)
|
},
|
methods: {
|
dateParamChange(dateArray) {
|
this.queryParam.startTime = dateArray[0]
|
this.queryParam.endTime = dateArray[1]
|
},
|
|
disabledDate(current) {
|
// Can not select days before today and today
|
return current > moment().subtract(1, 'day').endOf('day')
|
},
|
|
/**
|
* 当浏览器可视窗口尺寸发生改变时触发
|
*/
|
handleWindowResize() {
|
const boxHeight = +window.getComputedStyle(document.getElementById('DeviceList')).height.slice(0, -2)
|
const tableHeadHeight = +window.getComputedStyle(document.querySelector('.ant-table-thead th')).height.slice(0, -2)
|
this.scrollY = boxHeight - tableHeadHeight - 100
|
}
|
}
|
}
|
</script>
|
<style scoped>
|
@import '~@assets/less/common.less';
|
|
.device_list {
|
display: flex;
|
flex-direction: column;
|
overflow: hidden;
|
}
|
|
@media screen and (min-width: 1920px) {
|
.device_list {
|
height: 811px !important;
|
}
|
}
|
|
@media screen and (min-width: 1680px) and (max-width: 1920px) {
|
.device_list {
|
height: 811px !important;
|
}
|
}
|
|
@media screen and (min-width: 1400px) and (max-width: 1680px) {
|
.device_list {
|
height: 663px !important;
|
}
|
}
|
|
@media screen and (min-width: 1280px) and (max-width: 1400px) {
|
.device_list {
|
height: 564px !important;
|
}
|
}
|
|
@media screen and (max-width: 1280px) {
|
.device_list {
|
height: 564px !important;
|
}
|
}
|
</style>
|