解决了。需要这样写
const totalStyle = new spreadNS.Style()
totalStyle.backColor = "rgb(222, 243, 242)"
totalStyle.font = "10pt Calibri"
totalStyle.foreColor = "#000000"
//顶部小数点
totalStyle.formatter = "#,##0.0"
sheet.setStyle(0, -1, totalStyle, GC.Spread.Sheets.SheetArea.colHeader);
const headerStyle = new spreadNS.Style()
const headerColor = 'rgb(29, 90, 172)'
headerStyle.backColor = headerColor
headerStyle.foreColor = "#ffffff"
headerStyle.font = "10pt Calibri"
sheet.setStyle(-1, -1, headerStyle, GC.Spread.Sheets.SheetArea.colHeader) |