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

优化回显标记区域

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