Commit 863758b0 authored by 何远江's avatar 何远江

优化回显标记区域

parent 07d14cda
......@@ -1013,11 +1013,11 @@ const loadExcel = () => {
},
sheetActivate: (index: any) => {
const sheet = luckysheet.getSheet({ index })
setSheetAreaMark(sheet)
nextTick(() => setSheetAreaMark(sheet))
},
workbookCreateAfter: () => {
const sheet = luckysheet.getSheet()
setSheetAreaMark(sheet)
nextTick(() => setSheetAreaMark(sheet))
}
}
})
......@@ -1035,64 +1035,56 @@ const setSheetAreaMark = (sheet: any) => {
if (locaExcelAreaMarks[sheet.order].length) {
locaExcelAreaMarks[sheet.order].forEach((item: any) => {
// 设置数据区标记
setTimeout(() => {
luckysheet.menuButton.customUpdateFormat(
null,
'bg',
areaMarksColor['data'],
item.beginRow,
item.endRow,
item.beginColum,
item.endColum,
false
)
}, 50)
luckysheet.menuButton.customUpdateFormat(
null,
'bg',
areaMarksColor['data'],
item.beginRow,
item.endRow,
item.beginColum,
item.endColum,
false
)
if (item.excelAreaTitle.length) {
const areas = JSON.parse(item.titleArea)
areas.forEach((area: any) => {
setTimeout(() => {
luckysheet.menuButton.customUpdateFormat(
null,
'bg',
areaMarksColor['head'],
area.sr,
area.er,
area.sc,
area.ec,
false
)
}, 50)
luckysheet.menuButton.customUpdateFormat(
null,
'bg',
areaMarksColor['head'],
area.sr,
area.er,
area.sc,
area.ec,
false
)
})
}
if (item.desGroups.length) {
item.desGroups.forEach((area) => {
setTimeout(() => {
luckysheet.menuButton.customUpdateFormat(
null,
'bg',
areaMarksColor['attch'],
area.beginRow,
area.endRow,
area.beginColum,
area.endColum,
false
)
}, 50)
luckysheet.menuButton.customUpdateFormat(
null,
'bg',
areaMarksColor['attch'],
area.beginRow,
area.endRow,
area.beginColum,
area.endColum,
false
)
if (area.titles.length) {
area.titles.forEach((a) => {
setTimeout(() => {
luckysheet.menuButton.customUpdateFormat(
null,
'bg',
areaMarksColor['attch_head'],
a.row,
a.row,
a.colum,
a.colum,
false
)
}, 50)
luckysheet.menuButton.customUpdateFormat(
null,
'bg',
areaMarksColor['attch_head'],
a.row,
a.row,
a.colum,
a.colum,
false
)
})
}
})
......
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