微调
This commit is contained in:
@@ -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, // 合并行数
|
||||
|
||||
Reference in New Issue
Block a user