|
|
@ -5,7 +5,7 @@ |
|
|
|
bordered |
|
|
|
:pagination="false" |
|
|
|
style="width: 99%; height: 75%; margin-left: 0.5%" |
|
|
|
:scroll="{ x: 2000, y: 450 }" /> |
|
|
|
:scroll="{ x: x, y: 450 }" /> |
|
|
|
<a-pagination |
|
|
|
:total="total" |
|
|
|
:show-total="(total, range) => ` 共 ${total} 条`" |
|
|
@ -36,6 +36,8 @@ |
|
|
|
const total = ref<number>(); |
|
|
|
// 分页后的展示数据 |
|
|
|
let data = ref<any[]>([]); |
|
|
|
|
|
|
|
const x = ref(2000); |
|
|
|
// 原始数据 |
|
|
|
let dataList = ref<any[]>([]); |
|
|
|
let columns = ref<TableColumnType[]>([]); |
|
|
@ -97,6 +99,7 @@ |
|
|
|
{ |
|
|
|
title: '序号', |
|
|
|
width: 50, |
|
|
|
align: 'center', |
|
|
|
customRender: ({ record, index }) => { |
|
|
|
// 自定义单元格内容,这里返回序号 |
|
|
|
if (index == 0) { |
|
|
@ -139,6 +142,8 @@ |
|
|
|
{ |
|
|
|
title: '设备名称', |
|
|
|
dataIndex: 'deviceName', |
|
|
|
width: 100, |
|
|
|
align: 'center', |
|
|
|
customCell: (record, rowIndex) => { |
|
|
|
if (rowIndex == undefined) { |
|
|
|
return { |
|
|
@ -161,6 +166,8 @@ |
|
|
|
{ |
|
|
|
title: '设备点位', |
|
|
|
dataIndex: 'devicePositionName', |
|
|
|
width: 100, |
|
|
|
align: 'center', |
|
|
|
customCell: (record, rowIndex) => { |
|
|
|
if (rowIndex == undefined) { |
|
|
|
return { |
|
|
@ -187,6 +194,8 @@ |
|
|
|
{ |
|
|
|
title: '计量单位', |
|
|
|
dataIndex: 'devicePositionUnit', |
|
|
|
width: 100, |
|
|
|
align: 'center', |
|
|
|
customCell: (record, rowIndex) => { |
|
|
|
if (rowIndex == undefined) { |
|
|
|
return { |
|
|
@ -217,6 +226,8 @@ |
|
|
|
{ |
|
|
|
title: '日期', |
|
|
|
dataIndex: 'time', |
|
|
|
width: 100, |
|
|
|
align: 'center', |
|
|
|
}, |
|
|
|
]; |
|
|
|
|
|
|
@ -227,8 +238,9 @@ |
|
|
|
let columnA: any[] = [...column]; |
|
|
|
let columnB: any[] = []; |
|
|
|
pageData.tableColumns.forEach((item) => { |
|
|
|
columnB.push({ title: item, dataIndex: item }); |
|
|
|
columnB.push({ title: item, dataIndex: item, width: 60, align: 'center' }); |
|
|
|
}); |
|
|
|
x.value = 450 + pageData.tableColumns.length * 60; |
|
|
|
columnA.push(...columnB); |
|
|
|
columns.value = columnA; |
|
|
|
total.value = dataList.value.length; |
|
|
@ -244,9 +256,14 @@ |
|
|
|
pageData, |
|
|
|
total, |
|
|
|
onChange, |
|
|
|
x, |
|
|
|
}; |
|
|
|
}, |
|
|
|
}); |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="less" scoped></style> |
|
|
|
<style lang="less" scoped> |
|
|
|
::v-deep .ant-table-container table > thead > tr:first-child th:last-child { |
|
|
|
display: none !important; |
|
|
|
} |
|
|
|
</style> |
|
|
|