本帖最后由 阴险狡诈派大星 于 2019-3-29 15:22 编辑
- import '@grapecity/spread-sheets/styles/gc.spread.sheets.excel2013white.css'
- import GC from '@grapecity/spread-sheets'
- import '@grapecity/spread-sheets-resources-zh'
- import {SpreadSheets} from '@grapecity/spread-sheets-react'
- import Excel from 'util/Excel.jsx'
- import * as Excelio from '@grapecity/spread-excelio'
- import * as FileSaver from 'file-saver'
- GC.Spread.Sheets.LicenseKey = Excelio.LicenseKey = constant.LICENSEKEY
- GC.Spread.Common.CultureManager.culture('zh-cn')
- exportExcel() {
- const excelIO = new Excelio.IO(),
- {spread} = this.state,
- json = spread.toJSON({
- includeBindingSource: true,
- columnHeadersAsFrozenRows: true,
- })
- excelIO.save(json, (blob) => {
- FileSaver.saveAs(blob, `${spread.getActiveSheet().name()}.xlsx`)
- }, error => {
- message.error(error)
- })
- }
- <SpreadSheets allowInsertRows={false}
- backColor="aliceblue"
- hostStyle={{width: `${tableWidth}px`, height: '600px'}}
- workbookInitialized={spread => this.init(spread)}>
- </SpreadSheets>
复制代码
|
-
本地部署时的授权提示
-
部署到线上后的授权提示
-
-
index.jsx
13 KB, 阅读权限: 150, 下载次数: 1
|