如上图,闪了这个空白页之后才会出来加载了数据的页面
代码:
- async initSpread (spread) {
- debugger
- this.spread = spread;//赋值
- var sheet = spread.getActiveSheet();
- // spread.options.backColor = '#eaeaea' // 表格背景色
- spread.options.grayAreaBackColor = '#FFFFFF' // 工作区背景色
- spread.options.newTabVisible = false // 不显添加表单
- spread.options.tabStripVisible = false // 不显示底部表名
- spread.options.showVerticalScrollbar = false // y不显示滚动条
- spread.options.showHorizontalScrollbar = true // x不显示滚动条
- debugger
- sheet.suspendPaint();
- sheet.options.allowCellOverflow = true;
- //上下不滚动
- spread.options.scrollbarMaxAlign = true;
- debugger
- await this.query()//初始化列表数据
- debugger
- console.log("tableData:" + this.tableData);
- var colInfos = [
- { name: "createBy", displayName: "开票申请人", size: 180 },
- { name: "invoiceTitle", displayName: "**抬头", size: 200 },
- { name: "invoiceMoneyDouble", displayName: "开票金额", size: 80 },
- { name: "orderDealTotalMoneyStr", displayName: "订单金额", size: 80 },
- { name: "invoiceNo", displayName: "**号", size: 200 },
- { name: "invoiceApplyTime", displayName: "开票时间", size: 120 },
- { name: "invoiceTypeStr", displayName: "**类型", size: 80 },
- { name: "invoiceCompanyName", displayName: "开票系统", size: 120 },
- ];//表头
- sheet.setDataSource(this.tableData);
- debugger
- var filter = new GC.Spread.Sheets.Filter.HideRowFilter(new GC.Spread.Sheets.Range(0, 0, this.tableData.length, 8));
- sheet.rowFilter(filter);
- for (let i = 0; i < this.tableData.length; i++) {
- sheet.getCell(i, 4).wordWrap(true);
- }
- //设置表头高度
- sheet.setRowHeight(0, 40.0, GC.Spread.Sheets.SheetArea.colHeader);
- //设置表头颜色
- var style = new GC.Spread.Sheets.Style();
- style.backColor = "lightgreen";
- for (let i = 0; i < colInfos.length; i++) {
- sheet.setStyle(0, i, style, GC.Spread.Sheets.SheetArea.colHeader);
- }
- this.filter = filter;
- sheet.defaults.rowHeight = 30;
- sheet.defaults.locked = true;
- // this.initOutlineColumnFilter(sheet);
- sheet.bindColumns(colInfos);
- // setting printInfo
- this.setPrintInfo(spread);
- spread.resumePaint();
- },
复制代码
|