GM-Excel
## 启动项目
yarn
yarn start
# block
# - {type, id, customer, block: {style, rows : {columns:[]}}}
# - customer表示是否该区域自定义单元格合并大小 size: [x行, y列]表示需要x行y列大小
# - 详细见下例
#
# table
# - {type, id, columns}
# block
# {
# id: 'mul_block1',
# type: 'block',
# customer: true,
# block: {
# style: {},
# rows: [
# {
# columns: [
# {
# key: 'leibie',
# size: [1, 2]
# },
# {
# key: 'num'
# },
# ....
# ]
# }
# ]
# }
# }
# table 本质是特殊的block
# {
# id: 'table1',
# type: 'table',
# style: {},
# columns: [
# {
# key: 'fresh',
# header: '生鲜'
# },
# ....
# ]
# }
# 样式设置说明
# alignment - 常用:{ horizontal, vertical, wrapText }, 所有单元格默认靠左
# - horizontal - 水平分布, string, 常用:{ left, right, center }
# - vertical - 垂直分布, string, 常用:{ top, bottom, middle }
# - wrapText - 控制单元格文字换行, bool, { true, false }
# border - { top, left, bottom, right } bool, 默认设置 'thin'细线条样式
# font - 常用:{ size, color, bold }
# - size - 字体大小, number
# - bold - 粗体展示, bool
# 其它字段说明
# layout - 行分布设置
# - average, 根据字段均分单元格设置
# - inOrder, 根据字段及字段值,只合并字段值
# - all, 独占1行
# style - 可选设置, 表格的表头默认居中, style最终设置由小单元格往大覆盖
# decisiveColumn - 能够决定整个sheet总列数, bool
# colWidth - number, 定义每个单元格宽度
# rowHeight - number, 定义每行高度
详见config/config.js config/config_v2.js
详见代码
doExport(sheets, options)
-- 通过json数组生成普通表格模板
doImport(file)
-- 解析模板文件,生成json数组
diyExport(sheets, options)
-- 自定义导出表格模板, 具体见 config 文件夹
doExportV2(sheets, options)
-- 自定义导出,模板配置更自由, 具体见 config文件夹
Author: gmfe
Source Code: https://github.com/gmfe/gm-excel
License: ISC