forked from wangerzi/layui-excel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
4,854 additions
and
1,892 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Summary | ||
|
||
* [概览](README.md) | ||
* [功能概览](docs/功能概览.md) | ||
* [赞赏支持](docs/赞赏支持.md) | ||
* [贡献DEMO](docs/贡献DEMO.md) | ||
* [常见问题](docs/常见问题.md) | ||
* [参与开发](docs/参与开发.md) | ||
* [更新记录](docs/更新记录.md) | ||
* [快速上手](docs/快速上手.md) | ||
* [函数列表](docs/函数列表/README.md) | ||
* [重要函数参数配置](docs/函数列表/重要函数参数配置.md) | ||
* [EXCEL时间处理函数](docs/函数列表/EXCEL时间处理函数.md) | ||
* [样式设置专区](docs/样式设置专区.md) | ||
* [交流反馈](docs/交流反馈.md) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"author": "Jeffrey Wang <[email protected]>", | ||
"description": "This is a doc created by gitbook", | ||
"extension": null, | ||
"generator": "site", | ||
"isbn": "", | ||
"links": { | ||
"sharing": { | ||
"all": null, | ||
"facebook": null, | ||
"google": null, | ||
"twitter": null, | ||
"weibo": null | ||
}, | ||
"sidebar": { | ||
"作者博客": "https://blog.wj2015.com", | ||
"功能演示": "http://excel.wj2015.com" | ||
} | ||
}, | ||
"output": null, | ||
"pdf": { | ||
"fontSize": 12, | ||
"footerTemplate": null, | ||
"headerTemplate": null, | ||
"margin": { | ||
"bottom": 36, | ||
"left": 62, | ||
"right": 62, | ||
"top": 36 | ||
}, | ||
"pageNumbers": false, | ||
"paperSize": "a4" | ||
}, | ||
"plugins": [], | ||
"title": "LAY-EXCEL 插件文档", | ||
"variables": {} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# 交流反馈 | ||
|
||
##### 作者邮箱:[[email protected]](mailto:[email protected]) | ||
|
||
**QQ群号:** 555056599 | ||
|
||
![QQ交流群](../qq_group_qrcode.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# EXCEL时间处理函数 | ||
|
||
> 时间在 Excel 中以数字的形式存在,具体意义是与 1990-01-01 00:00:00 相比的第几天,比如 1990-01-01 00:00:00 就存为1,1990-01-02 00:00:00 就存为2。为方便操作,插件提供了对应辅助方法:dateCodeFormat('存储的数字', '格式') 、dateFormat('Date对象', '格式')、dateCodeToDate('存储的数字') 方便操作。 | ||
#### dateCodeToDate参数配置 | ||
|
||
> 辅助方法:用于将EXCEL中的时间数字转换为 Date 对象 | ||
##### 传入参数 | ||
|
||
| 参数名称 | 描述 | 默认值 | | ||
| -------- | --------------------- | ------ | | ||
| code | EXCEL中存储的时间数字 | | | ||
|
||
##### 返回参数 | ||
|
||
转换过后的Date对象 | ||
|
||
##### 使用样例 | ||
|
||
```javascript | ||
var date = LAY_EXCEL.dateCodeToDate(43737.54167824074) | ||
console.log(date); // Sun Sep 29 2019 13:00:01 GMT+0800 (中国标准时间) | ||
``` | ||
|
||
#### dateCodeFormat参数配置 | ||
|
||
> 辅助方法:用于将EXCEL中的时间数字转换为对应格式的时间字符串 | ||
##### 传入参数 | ||
|
||
| 参数名称 | 描述 | 默认值 | | ||
| -------- | --------------------- | ------------------- | | ||
| code | EXCEL中存储的时间数字 | | | ||
| format | 日期格式 | YYYY-MM-DD HH:ii:ss | | ||
|
||
##### 返回参数 | ||
|
||
转换后的字符串 | ||
|
||
##### 支持的替换参数 | ||
|
||
可以将 format 中的字符串转换为特定含义的数字 | ||
|
||
| 替换参数 | 含义 | | ||
| -------- | --------------------- | | ||
| YY | 二位数的年 | | ||
| YYYY | 四位数的年 | | ||
| MM | 二位数的月(补全0) | | ||
| M | 自然数的月(不补全0) | | ||
| DD | 二位数的日(补全0) | | ||
| D | 自然数的日 | | ||
| HH | 二位数的时(补全0) | | ||
| H | 自然数的时 | | ||
| ii | 二位数的分 | | ||
| i | 自然数的分 | | ||
| ss | 二位数的秒 | | ||
| s | 自然数的秒 | | ||
|
||
##### 使用样例 | ||
|
||
```javascript | ||
var date = LAY_EXCEL.dateCodeFormat(43737.54167824074, 'YYYY-MM-DD HH:ii:ss') | ||
console.log(date) // "2019-08-00 13:00:01" | ||
``` | ||
|
||
#### dateFormat参数配置 | ||
|
||
> 辅助方法:用于将Date对象转换为对应格式的时间字符串 | ||
##### 传入参数 | ||
|
||
| 参数名称 | 描述 | 默认值 | | ||
| -------- | -------- | ------------------- | | ||
| date | Date对象 | | | ||
| format | 日期格式 | YYYY-MM-DD HH:ii:ss | | ||
|
||
##### 返回参数 | ||
|
||
转换后的字符串 | ||
|
||
##### 支持的替换参数 | ||
|
||
与上文相同 | ||
|
||
##### 使用样例 | ||
|
||
```javascript | ||
var date = LAY_EXCEL.dateCodeFormat(new Date(), 'YYYY-MM-DD HH:ii:ss') | ||
console.log(date) // "2019-09-04 22:39:25" | ||
``` | ||
|
||
## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# 函数列表 | ||
|
||
> 仅做函数用途介绍,具体使用方法请见 『[重要函数参数配置](重要函数参数配置.md)』 | ||
| 函数名 | 描述 | 索引 | | ||
| --------------------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------ | | ||
| **exportExcel(data, filename, type, opt)** | 导出数据,并弹出指定文件名的下载框 | [exportExcel参数配置](重要函数参数配置.md#exportexcel%E5%8F%82%E6%95%B0%E9%85%8D%E7%BD%AE) | | ||
| downloadExl(data, filename, type) | 快速导出excel,无需指定 sheet_name 和文件后缀 | [downloadExl参数配置](重要函数参数配置.md#downloadexl%E5%8F%82%E6%95%B0%E9%85%8D%E7%BD%AE) | | ||
| **filterExportData(data, fields)** | 梳理导出的数据,包括字段排序和多余数据 | [filterExportData参数配置](重要函数参数配置.md#filterexportdata%E5%8F%82%E6%95%B0%E9%85%8D%E7%BD%AE) | | ||
| **importExcel(files, opt, callback)** | 读取Excel,支持多文件多表格读取 | [importExcel参数配置](重要函数参数配置.md#importexcel%E5%8F%82%E6%95%B0%E9%85%8D%E7%BD%AE) | | ||
| **makeMergeConfig(origin)** | 生成合并的配置参数,返回结果需放置于opt.extend['!merges']中 | [makeMergeConfig参数配置](重要函数参数配置.md#makemergeconfig%E5%8F%82%E6%95%B0%E9%85%8D%E7%BD%AE) | | ||
| **setExportCellStyle(data, range, config, filter)** | 为sheet级别数据批量设置单元格属性 | [setExportCellStyle参数配置](重要函数参数配置.md#setExportCellStyle%E5%8F%82%E6%95%B0%E9%85%8D%E7%BD%AE) | | ||
| makeColConfig(data, defaultNum) | 生成列宽配置,返回结果需放置于opt.extend['!cols']中 | [makeColConfig参数配置](重要函数参数配置.md#makecolconfig%E5%8F%82%E6%95%B0%E9%85%8D%E7%BD%AE) | | ||
| makeRowConfig(data, defaultNum) | 生成行高配置,返回结果需放置于opt.extend['!rows'] | [makeRowConfig参数配置](重要函数参数配置.md#makerowconfig%E5%8F%82%E6%95%B0%E9%85%8D%E7%BD%AE) | | ||
| tableToJson(dom) | 将原生table转换为JSON格式 | [tableToJson参数配置](重要函数参数配置.md#tabletojson%E5%8F%82%E6%95%B0%E9%85%8D%E7%BD%AE) | | ||
| **setRoundBorder(data, range ,config)** | 设置范围环绕的边框 | [setRoundBorder参数配置](重要函数参数配置.md#setRoundBorder%E5%8F%82%E6%95%B0%E9%85%8D%E7%BD%AE) | | ||
| dateCodeToDate(code) | EXCEL日期码转换为Date对象 | [dateCodeToDate参数配置](重要函数参数配置.md#dateCodeToDate%E5%8F%82%E6%95%B0%E9%85%8D%E7%BD%AE) | | ||
| dateFormat(date, format) | Date 对象格式化 | [dateFormat参数配置](重要函数参数配置.md#dateFormat%E5%8F%82%E6%95%B0%E9%85%8D%E7%BD%AE) | | ||
| dateCodeFormat(code, format) | EXCEL日期码转换为格式化字符串 | [dateCodeFormat参数配置](重要函数参数配置.md#dateCodeFormat%E5%8F%82%E6%95%B0%E9%85%8D%E7%BD%AE) | | ||
| filterDataToAoaData(sheet_data) | 将单个sheet的映射数组数据转换为加速导出效率的aoa数据 | 无 | | ||
| filterImportData(data, fields) | 梳理导入的数据,字段含义与 filterExportData 类似 | 无 | | ||
| numToTitle(num) | 将1/2/3...转换为A/B/C/D.../AA/AB/.../ZZ/AAA形式 | 无 | | ||
| titleToNum(title) | 将A、B、AA、ABC转换为 1、2、3形式的数字 | 无 | | ||
| splitPosition(pos) | 将A1分离成 {c: 0, r: 1} 格式的数据 | 无 | |
Oops, something went wrong.