Commit b6e296d7 authored by 何远江's avatar 何远江

bug 修改

parent 4a5cc487
......@@ -57,6 +57,8 @@ export function handleRangeTitle(range: any, dataArea: Recordable) {
const titles: Recordable[] = []
let isVertical = false
console.log('handleRangeTitle', range, dataArea)
// 只有一行,只能横向
if (rowLen == 1) {
isVertical = false
......@@ -82,6 +84,7 @@ export function handleRangeTitle(range: any, dataArea: Recordable) {
}
for (let r = 0; r < (isVertical ? columnLen : rowLen); r++) {
const cell = isVertical ? range[c][r] : range[r][c]
console.log('cell', cell, r,c)
let v = ''
// 如果获取值报错,那么断定单元格值为空,直接取上一个单元格的值
try {
......@@ -91,13 +94,15 @@ export function handleRangeTitle(range: any, dataArea: Recordable) {
}
// 如果有单元格合并,跳过单元格
if (cell?.mc) {
r += isVertical ? cell.mc.rs - 1 : cell.mc.cs - 1
c += isVertical ? cell.mc.cs - 1 : cell.mc.rs - 1
r += isVertical ? cell.mc.cs - 1 : cell.mc.rs - 1
c += isVertical ? cell.mc.rs - 1 : cell.mc.cs - 1
}
title.title = v.replaceAll(' ', '')
title.colum = +beginColum + (isVertical ? r : c)
title.row = +beginRow + (isVertical ? c : r)
}
console.log('title', title)
titles.push(title)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment