setIndiPageBorder(flag) {
let border = flag ? new GC.Spread.Sheets.LineBorder("#8A2BE2", GC.Spread.Sheets.LineStyle.dashed) : new GC.Spread.Sheets.LineBorder("#000", GC.Spread.Sheets.LineStyle.empty)
const workbook = this.designer.getWorkbook()
workbook.suspendPaint()
workbook.suspendEvent()
let activeSheetName = workbook.getSheetFromName('Sheet1')
activeSheetName.getRange(6, 14, 21, 9, GC.Spread.Sheets.SheetArea.viewport).setBorder(border,
{
top: true,
bottom: true,
left: true,
right: true
},
);
// 打开绘制
workbook.resumeCalcService(true)
workbook.resumeEvent()
workbook.resumePaint()
}
第一步 this.setIndiPageBorder(true)
第二步 this.setIndiPageBorder(false)
第三步 this.setIndiPageBorder(true)
边框样式就会错乱
|