Skip to content

Commit

Permalink
inir
Browse files Browse the repository at this point in the history
  • Loading branch information
Dushusir committed Aug 31, 2020
0 parents commit 0a1d767
Show file tree
Hide file tree
Showing 127 changed files with 75,711 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.DS_Store
node_modules

# local env files
.env.local
.env.*.local

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
9 changes: 9 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"ExpandedNodes": [
"",
"\\src",
"\\src\\toluckySheet"
],
"SelectedNode": "\\src\\toluckySheet\\luckyFreezen.ts",
"PreviewInSolutionExplorer": false
}
Binary file added .vs/slnx.sqlite
Binary file not shown.
93 changes: 93 additions & 0 deletions README-zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
简体中文 | [English](./README.md)

## 介绍
Luckyexcel,是一个适配 [Luckysheet](https://github.com/mengshukeji/Luckysheet) 的excel导入导出库,只支持.xlsx格式文件(不支持.xls)。

## 演示
[Demo](https://mengshukeji.github.io/LuckysheetDemo/)

## 特性
支持excel文件导入到Luckysheet适配列表

- 单元格样式
- 单元格边框
- 单元格格式,如数字格式、日期、百分比等
- 公式

### 计划

目标是支持所有Luckysheet支持的特性

- 条件格式
- 数据透视表
- 图表
- 排序
- 筛选
- 批注
- excel导出

## 环境
[Node.js](https://nodejs.org/en/) Version >= 6

## 安装
```
npm install -g gulp-cli
npm install
gulp
```

## 用法(改进中)

#### 第一步
`gulp build``dist`文件夹下的bundle.js复制到项目目录,bundle.js即为项目核心代码

#### 第二步

导入bundle.js,界面上指定一个文件上传组件,编写类似如下的监听方法,调用`LuckyExcel.transformExcelToLucky`,然后在回调中获取到转换后的JSON数据,此JSON数据即是Luckysheet可识别的格式,使用Luckysheet初始化即可。
```js
function demoHandler(){
let upload = document.getElementById("Luckyexcel-demo-file");
if(upload){

window.onload = () => {

upload.addEventListener("change", function(evt){
var files:FileList = (evt.target as any).files;
LuckyExcel.transformExcelToLucky(files[0], function(exportJson:any){

window.luckysheet.destroy();

window.luckysheet.create({
container: 'luckysheet', //luckysheet is the container id
data:exportJson.sheets,
title:exportJson.info.name,
userInfo:exportJson.info.name.creator
});
});
});
}
}
}
```

## 交流
- 任何疑问或者建议,欢迎提交[Issues](https://github.com/mengshukeji/Luckyexcel/issues/)

- 添加小编微信,拉你进Luckysheet开发者交流微信群,备注:加群

<img src="/docs/.vuepress/public/img/%E5%BE%AE%E4%BF%A1%E4%BA%8C%E7%BB%B4%E7%A0%81.jpg" width = "200" alt="微信群" align="center" />

- 加入Luckysheet开发者交流QQ群

<img src="/docs/.vuepress/public/img/QQ%E7%BE%A4%E4%BA%8C%E7%BB%B4%E7%A0%81.jpg" width = "200" alt="微信群" align="center" />


## 贡献者和感谢
- [@wbfsa](https://github.com/wbfsa)
- [@wpxp123456](https://github.com/wpxp123456)
- [@Dushusir](https://github.com/Dushusir)

## 版权信息
[MIT](http://opensource.org/licenses/MIT)

Copyright (c) 2020-present, mengshukeji
88 changes: 88 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
English| [简体中文](./README-zh.md)

## Introduction
Luckyexcel is an excel import and export library adapted to [Luckysheet](https://github.com/mengshukeji/Luckysheet). It only supports .xlsx format files (not .xls).

## Demo
[Demo](https://mengshukeji.github.io/LuckysheetDemo/)

## Features
Support excel file import to Luckysheet adaptation list

- Cell style
- Cell border
- Cell format, such as number format, date, percentage, etc.
- Formula

### Plan
The goal is to support all features supported by Luckysheet

- Conditional Formatting
- Pivot table
- Chart
- Sort
- Filter
- Annotation
- Excel export

## Requirements
[Node.js](https://nodejs.org/en/) Version >= 6

## Installation
```
npm install -g gulp-cli
npm install
gulp
```

## Usage (under improvement)

#### Step 1
After `gulp build`, copy bundle.js in the `dist` folder to the project directory, and bundle.js is the core code of the project

#### Step 2

Import bundle.js, specify a file upload component on the interface, write a monitoring method similar to the following, call `LuckyExcel.transformExcelToLucky`, and then get the converted JSON data in the callback. This JSON data is in a format that Luckysheet can recognize. Use Luckysheet to initialize.
```js
function demoHandler(){
let upload = document.getElementById("Luckyexcel-demo-file");
if(upload){

window.onload = () => {

upload.addEventListener("change", function(evt){
var files:FileList = (evt.target as any).files;
LuckyExcel.transformExcelToLucky(files[0], function(exportJson:any){

window.luckysheet.destroy();

window.luckysheet.create({
container:'luckysheet', //luckysheet is the container id
data:exportJson.sheets,
title:exportJson.info.name,
userInfo:exportJson.info.name.creator
});
});
});
}
}
}
```

## Communication

- Any questions or suggestions are welcome to submit [Issues](https://github.com/mengshukeji/Luckyexcel/issues/)

- [Gitter](https://gitter.im/mengshukeji/Luckysheet)

[Chinese community](./README-zh.md)

## Authors and acknowledgment
- [@wbfsa](https://github.com/wbfsa)
- [@wpxp123456](https://github.com/wpxp123456)
- [@Dushusir](https://github.com/Dushusir)

## License
[MIT](http://opensource.org/licenses/MIT)

Copyright (c) 2020-present, mengshukeji
Binary file added assets/luckysheet/css/EwaAntH.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/luckysheet/css/EwaAntV.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/luckysheet/css/arrow-down.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/luckysheet/css/loading.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions assets/luckysheet/css/luckysheet.css

Large diffs are not rendered by default.

Loading

0 comments on commit 0a1d767

Please sign in to comment.