回复 2楼CCKan的帖子
function initSpread(spread) {
var spreadNS = GcSpread.Sheets;
var sheet = spread.getSheet(0);
sheet.isPaintSuspended(true);
sheet.setName("项目执行过程管理表");
sheet.setRowCount(25);
sheet.setColumnCount(11);
sheet.addSpan(0, 0, 1, 11);
sheet.setValue(0, 0, "项目基础信息");
sheet.getCells(0, 0, 1, 11).hAlign(spreadNS.HorizontalAlign.center);
sheet.getRow(1).hAlign(spreadNS.HorizontalAlign.center);
sheet.getRow(1).vAlign(spreadNS.VerticalAlign.center)
sheet.setValue(1, 0, "项目名称");
sheet.setValue(1, 1, "项目编号");
sheet.setValue(1, 2, "项目经理");
sheet.setValue(1, 3, "项目联系人");
sheet.setValue(1, 4, "项目联系方式");
sheet.setValue(1, 5, "项目项目类型");
sheet.setValue(1, 6, "项目状态");
sheet.setValue(1, 7, "项目开始时间");
sheet.setValue(1, 8, "项目结束时间");
sheet.setValue(1, 9, "项目质保期");
sheet.setValue(1, 10, "备注问题/下一步重点工作");
//设置列的宽度
sheet.setColumnWidth(0, 194);
sheet.setColumnWidth(1, 100);
sheet.setColumnWidth(2, 78);
sheet.setColumnWidth(3, 104);
sheet.setColumnWidth(4, 109);
sheet.setColumnWidth(5, 97);
sheet.setColumnWidth(6, 177);
sheet.setColumnWidth(7, 116);
sheet.setColumnWidth(8, 98);
sheet.setColumnWidth(9, 100);
sheet.setColumnWidth(10, 205);
//赋值
//居中
sheet.getRow(2).hAlign(spreadNS.VerticalAlign.center);
sheet.getRow(2).vAlign(spreadNS.VerticalAlign.center)
sheet.setValue(2, 0, "大庆油田伊拉克鲁迈拉项目部营地带宽租赁项目2015年");
sheet.getCell(2, 0).wordWrap(true);
sheet.setValue(2, 1, "2014444ZL004");
sheet.setValue(2, 2, "石头 ");
sheet.setValue(2, 3, "石头");
sheet.setValue(2, 4, "010-82766699");
sheet.setValue(2, 5, "租赁");
sheet.setValue(2, 6, "C.已签合同,项目正常实施中(含正在验收) ");
sheet.setValue(2, 7, "2015年2月1日");
sheet.setValue(2, 8, "2016年1月31日");
sheet.setValue(2, 9, "无");
sheet.setValue(2, 10, "跟进并沟通主站迁址");
//自动换行
sheet.getRow(2).wordWrap(true);
//自动高度适应
sheet.bind(GcSpread.Sheets.Events.EditEnded, function (sender, args) {
sheet.autoFitRow(args.row);
});
//设置边框线
sheet.setBorder(new spreadNS.Range(0, 0, sheet.getRowCount(), sheet.getColumnCount()), new spreadNS.LineBorder("Black", spreadNS.LineStyle.thin), { all: true });
//设置选择一行
sheet.selectionUnit(1);
//设置是否可编辑
//绘制grid
sheet.isPaintSuspended(false);
}; |