@@ -8,7 +8,6 @@
stripe
style="width: 100%; margin-top: 20px;"
:span-method="objectSpanMethod"
- show-summary
height="500"
>
@@ -162,17 +161,19 @@ export default {
}
},
methods: {
- // 添加表格合并方法
+ // 修改表格合并方法
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
// 部门标题行合并
if (row.isDeptTitle) {
if (columnIndex === 0) {
- // 第一列显示部门名称,合并所有列
- const totalColumns = 24;
- return [1, totalColumns];
+ // 第一列显示部门名称
+ return [1, 1];
} else {
- // 其他列不显示
- return [0, 0];
+ // 其他列不显示内容(保持空白)
+ return {
+ rowspan: 0,
+ colspan: 0
+ };