This commit is contained in:
caozehui
2024-12-05 14:37:50 +08:00
parent 3a1cfe0f31
commit 8e2a22cf61
4 changed files with 76 additions and 36 deletions

View File

@@ -4,13 +4,17 @@
<div class="table-container">
<el-table :data="errorData"
height="500"
:header-cell-style="{ textAlign: 'center',backgroundColor: '#003078',color: '#fff' } "
:header-cell-style="rowClass"
:cell-style="{ textAlign: 'center' }"
style="width: 100%"
:span-method="spanMethod"
border
class="custom-table">
<el-table-column prop="measured" label="被测量" />
class="custom-table"
>
<el-table-column label="被测量">
<el-table-column prop="col1"/>
<el-table-column prop="col2"/>
</el-table-column>
<el-table-column prop="deviceLevel" label="检测装置级别" />
<el-table-column prop="measurementType" label="测量类型" />
<el-table-column prop="condition" label="测量条件" />
@@ -57,6 +61,17 @@ interface SpanMethodProps {
columnIndex: number
}
const rowClass = ({row, column, rowIndex, columnIndex}) => {
let res = {
textAlign: 'center', backgroundColor: '#003078', color: '#fff'
}
if (rowIndex === 1) {
res = {...res, display: 'none'}
return res
}
return res
}
const spanMethod = ({
row,
column,
@@ -65,7 +80,7 @@ const spanMethod = ({
}: SpanMethodProps) => {
if (columnIndex === 0 ) { // 检查是否为第一列
if (rowIndex === 2 ||rowIndex === 21) { // 检查是否为第三行
return {
rowspan: 2, // 合并行数