success: () => {
this.spread = new GC.Spread.Sheets.Workbook(this.refs.spreadRef, {
sheetCount: 1,
newTabVisible: false,
tabEditable: false
})
// this.excelIo = new GC.Spread.Excel.IO()
this.initSpread(props)
},
initSpread(props) {
const showData = props.showData,
groupList = props.groupList,
spread = this.spread,
excelIo = this.excelIo
if (!_.isEmpty(showData)) {
spread.options.showVerticalScrollbar=true
spread.options.tabNavigationVisible=false
spread.options.tabStripVisible=false
spread.options.showHorizontalScrollbar=true
spread.options.grayAreaBackColor='white'
spread.options.showScrollTip=GC.Spread.Sheets.ShowScrollTip.Horizontal
spread.options.allowContextMenu = true
this.spreadProtected(spread)
this.loadData(showData)
}}
spreadProtected=(spread) => {
const activeSheet = spread.getActiveSheet()
// 设置 isProtected 属性来保护表单不被用户编辑
activeSheet.options.isProtected=true
activeSheet.options.protectionOptions={
allowResizeRows: true, // 允许改变行高
allowResizeColumns: true, // 允许改变列宽
allowFilter: true, // 允许对一片单元格区域进行筛选
allowSort: true, // 允许对一片单元格区域进行排序
allowEditObjects: false // 允许编辑浮动元素
}
}
|