Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tubiaoge committed Oct 30, 2020
2 parents 927ff46 + f4ea6a3 commit f860b49
Show file tree
Hide file tree
Showing 40 changed files with 2,173 additions and 704 deletions.
35 changes: 25 additions & 10 deletions README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ npm run build

- [鲁班h5](https://github.com/ly525/luban-h5)
- [excelize](https://github.com/360EntSecGroup-Skylar/excelize)
- [h5-Dooring](https://github.com/MrXujiang/h5-Dooring)

## 加入共建

Expand Down Expand Up @@ -190,6 +191,30 @@ npm run build

[英文社群](./README.md)

## 赞助

如果你感觉这个项目对你有用或者有所启发,可以请作者喝杯果汁:

注意事项:
1. 付款留言请备注:昵称,您的网站地址
2. 默认会将您加入到下方的赞助者列表。如果您想匿名赞助,付款留言请备注:匿名
3. 如果您忘记留言昵称或者网站地址,请联系小编email: [email protected]或者微信:dushusir2。

| 微信 | 支付宝 |
|---|---|
| <img src="https://minio.cnbabylon.com/public/luckysheet/wechat.jpg" width="140" />| <img src="https://minio.cnbabylon.com/public/luckysheet/alipay.jpg" width="130" /> |

### [Paypal Me](https://www.paypal.me/wbfsa)

## 赞助者列表
(按时间顺序排列)
- *勇 ¥ 30
- 虚我 ¥ 200
- 甜党 ¥ 50
- Alphabet(Google)-gcf ¥ 1
- **平 ¥ 100
- **东 ¥ 10

## 贡献者和感谢

### 团队成员
Expand All @@ -207,16 +232,6 @@ npm run build
- [@gsw945](https://github.com/gsw945)
- [@swen-xiong](https://github.com/swen-xiong)

## 捐赠

如果你感觉这个项目对你有用或者有所启发,可以请作者喝杯果汁:

| 微信 | 支付宝 |
|---|---|
| <img src="https://minio.cnbabylon.com/public/luckysheet/wechat.jpg" width="140" />| <img src="https://minio.cnbabylon.com/public/luckysheet/alipay.jpg" width="130" /> |

[Paypal Me](https://www.paypal.me/wbfsa)

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

Expand Down
32 changes: 25 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ Create a table

- [luban-h5](https://github.com/ly525/luban-h5)
- [excelize](https://github.com/360EntSecGroup-Skylar/excelize)
- [h5-Dooring](https://github.com/MrXujiang/h5-Dooring)

## Co-construction

Expand All @@ -183,6 +184,30 @@ Create a table

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

## Sponsor

If you find this project useful, you can buy author a glass of juice:

Note:
1. Please note the payment message: nickname, your website address
2. By default, you will be added to the sponsor list below. If you want to sponsor anonymously, please leave a note on payment: anonymous
3. If you forget your nickname or website address, please contact the editor email: [email protected] or WeChat: dushusir2.

| WeChat | Alipay |
|---|---|
| <img src="https://minio.cnbabylon.com/public/luckysheet/wechat.jpg" width="140" />| <img src="https://minio.cnbabylon.com/public/luckysheet/alipay.jpg" width="130" /> |

### [Paypal Me](https://www.paypal.me/wbfsa)

## Sponsors List
(Sort by time)
- *勇 ¥ 30
- 虚我 ¥ 200
- 甜党 ¥ 50
- Alphabet(Google)-gcf ¥ 1
- **平 ¥ 100
- **东 ¥ 10

## Authors and acknowledgment

### Team
Expand All @@ -202,13 +227,6 @@ Create a table

## Donate

If you find this project useful, you can buy author a glass of juice:

| WeChat | Alipay |
|---|---|
| <img src="https://minio.cnbabylon.com/public/luckysheet/wechat.jpg" width="140" />| <img src="https://minio.cnbabylon.com/public/luckysheet/alipay.jpg" width="130" /> |

[Paypal Me](https://www.paypal.me/wbfsa)


## License
Expand Down
3 changes: 3 additions & 0 deletions deploy.bat
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ npm publish

# only publish
npm run build
git add .
npm run commit
npm version patch
git push -u origin master
npm publish
24 changes: 14 additions & 10 deletions docs/guide/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

**<span style="font-size:20px;">A</span>**: Use one-dimensional array format [celldata](/zh/guide/sheet.html#celldata), after the initialization is completed, the data converted into a two-dimensional array format is used for storage and update, and celldata is no longer used.

If you need to take out data as initial data, you need to execute `luckysheet.getGridData(data)` to convert it to celldata data.
Among them, the celldata in `{ r, c, v }` format is converted to a two-dimensional array using `luckysheet.buildGridData(luckysheetfile)`, and the input parameter is the table data object `luckysheetfile`
If you need to take out `data` as initial data, you need to execute [transToCellData(data)](/guide/api.html#transtocelldata-data-setting) to convert it to celldata data.
Among them, the celldata in `{ r, c, v }` format is converted to a two-dimensional array using [transToData(celldata)](/guide/api.html#transtodata-celldata-setting)

Summarized as follows:
```js
// data => celldata two-dimensional array data is converted into {r, c, v} format one-dimensional array, the input parameter is two-dimensional data
luckysheet.getGridData(data)
// data => celldata two-dimensional array data into {r, c, v} format one-dimensional array
luckysheet.transToCellData(data)

// celldata => data The two-dimensional array required to generate the table, the input parameter is the table data object file
luckysheet.buildGridData(luckysheetfile)
// celldata => data to generate the two-dimensional array required for the table
luckysheet.transToData(celldata)
```

------------
Expand Down Expand Up @@ -63,14 +63,17 @@ Note: Initial data needs to be configured with loadUrl and loadSheetUrl paramete

## **<span style="font-size:20px;">Q</span>** How to import and export excel?

**<span style="font-size:20px;">A</span>**: The excel import and export library developed with Luckysheet-[Luckyexcel](https://github.com/mengshukeji/Luckyexcel) has realized the excel import function, and the export function is under development. You can refer to this blog post for excel export at this stage: https://www.cnblogs.com/recode-hyh/p/13168226.html.
**<span style="font-size:20px;">A</span>**: The excel import and export library developed with Luckysheet-[Luckyexcel](https://github.com/mengshukeji/Luckyexcel) has realized the excel import function, and the export function is under development.You can refer to these 2 blog posts for excel export at this stage:

- [Development of Excel download function based on LuckySheet online form](https://www.cnblogs.com/recode-hyh/p/13168226.html)
- [Use exceljs to export luckysheet form](https://blog.csdn.net/csdn_lsy/article/details/107179708)

------------

## **<span style="font-size:20px;">Q</span>** How to merge cells during initialization?

**<span style="font-size:20px;">A</span>**: Refer to the following case
- Luckysheet initializes data with merged cells: https://www.cnblogs.com/DuShuSir/p/13272397.html
**<span style="font-size:20px;">A</span>**: Refer to the following case:
- [How Luckysheet initializes the data with merged cells](https://www.cnblogs.com/DuShuSir/p/13272397.html)

------------

Expand All @@ -80,7 +83,8 @@ Note: Initial data needs to be configured with loadUrl and loadSheetUrl paramete

- 1. after the table operation is completed, you can use `luckysheet.getAllSheets()` to get all sheet data that stroed in the back-end.
- 2. enable the collaborative editing function to transmit data to the back-end in real-time.
refer this article:https://www.cnblogs.com/DuShuSir/p/13857874.html
refer this article:
[How Luckysheet saves the data in the table to the database](https://www.cnblogs.com/DuShuSir/p/13857874.html)

------------

Expand Down
10 changes: 8 additions & 2 deletions docs/guide/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1823,7 +1823,6 @@ Use note:

### getAllSheets()

[todo]

- **Explanation**

Expand All @@ -1844,6 +1843,13 @@ Use note:

Returns a one-dimensional array `luckysheetfile` of all table data structures. Unlike the `getAllSheets` method, the worksheet parameters obtained by this method will contain many internal variables. The most obvious difference is that the table data operation will maintain `luckysheetfile[i]. data`, and the initialization data uses `options.data[i].celldata`, so `luckysheetfile` can be used for debugging, but the initialization table is not applicable.

In addition, a `load = 1` will be added to the loaded worksheet parameters, this parameter needs to be set to 0 when initializing the data. Therefore, to initialize the workbook with the data obtained by `getLuckysheetfile()`, two tasks need to be done:

- Convert celldata to data, refer to: [transToData](/zh/guide/api.html#transtodata-celldata-setting)
- Load reset to 0 or delete this field

Now there is `getAllSheets` to complete this work, no need to manually convert the data.

- **Usage**:

- Get all the debugging information of the first worksheet
Expand Down Expand Up @@ -1922,7 +1928,7 @@ Use note:
- **Parameter**

- {PlainObject} [setting]: optional parameters
+ {Object} [sheetObject]: The data of the newly added worksheet; the default value is an empty object
+ {Object} [sheetObject]: The data of the newly added worksheet; the default value is an empty object.Worksheet data format reference [options.data](/guide/sheet.html#initial)
+ {Number} [order]: New worksheet subscript; the default value is the last subscript
+ {Function} [success]: callback function for the end of the operation

Expand Down
83 changes: 66 additions & 17 deletions docs/guide/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,9 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
------------
### showtoolbarConfig

[todo]

- Type: Object
- Default: {}
- Usage: Custom configuration toolbar
- Usage: Custom configuration toolbar,can be used in conjunction with `showtoolbar`, `showtoolbarConfig` has a higher priority.
- Format:
```json
{
Expand All @@ -214,19 +212,48 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
verticalAlignMode: false, //'Vertical alignment'
textWrapMode: false, //'Wrap mode'
textRotateMode: false, //'Text Rotation Mode'
frozenMode: false, //'freeze mode'
sort: false, //'sort'
filter: false, //'filter'
findAndReplace: false, //'Find and Replace'
function: false, //'formula'
conditionalFormat: false, //'Conditional Format'
postil: false, //'comment'
pivotTable: false, //'PivotTable'
chart: false, //'chart' (the icon is hidden, but if the chart plugin is configured, you can still create a new chart by right click)
screenshot: false, //'screenshot'
splitColumn: false, //'Split column'
image:false, // 'Insert picture'
link:false, // 'Insert link'
chart: false, //'chart' (the icon is hidden, but if the chart plugin is configured, you can still create a new chart by right click)
postil: false, //'comment'
pivotTable: false, //'PivotTable'
function: false, //'formula'
frozenMode: false, //'freeze mode'
sortAndFilter: false, //'Sort and filter'
conditionalFormat: false, //'Conditional Format'
dataVerification: false, // 'Data Verification'
splitColumn: false, //'Split column'
screenshot: false, //'screenshot'
findAndReplace: false, //'Find and Replace'
protection:false, // 'Worksheet protection'
print:false, // 'print'
}
```
- Example:
- Show only the `undo/redo` and `font` buttons:

```js
//options
{
showtoolbar: false,
showtoolbarConfig:{
undoRedo: true,
font: true,
}
}
```
- Hide only the `image` and `print` buttons:

```js
//options
{
showtoolbar: true, // The default is true, you can leave it unset
showtoolbarConfig:{
image: false,
print: false,
}
}
```

------------
### showinfobar
Expand All @@ -243,11 +270,9 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
------------
### showsheetbarConfig

[todo]

- Type: Object
- Default: {}
- Usage: Custom configuration bottom sheet button
- Usage: Custom configuration bottom sheet button, can be used in conjunction with `showsheetbar`, `showsheetbarConfig` has a higher priority.
- Format:
```json
{
Expand All @@ -256,6 +281,30 @@ Note that you also need to configure `loadUrl` and `loadSheetUrl` to take effect
sheet: false //Worksheet display
}
```
- Example:
- Only display the `Add worksheet` button:

```js
//options
{
showsheetbar: false,
showsheetbarConfig:{
add: true,
}
}
```
- Only hide the `Add worksheet` and `Worksheet management menu` buttons:

```js
//options
{
showsheetbar: true, // The default is true, you can leave it unset
showsheetbarConfig:{
add: false,
menu: false,
}
}
```

------------
### showstatisticBar
Expand Down
21 changes: 12 additions & 9 deletions docs/zh/guide/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@

**<span style="font-size:20px;">A</span>** : 表格初始化时使用一维数组格式的 [celldata](/zh/guide/sheet.html#celldata),初始化完成后转化为二维数组格式的data作为存储更新使用,celldata不再使用。

如果需要将data拿出来作为初始化数据,则需要执行 `luckysheet.getGridData(data)`转换为celldata数据。
其中`{ r, c, v }`格式的celldata转换为二维数组使用的是`luckysheet.buildGridData(luckysheetfile)`,传入参数为表格数据对象`luckysheetfile`
如果需要将`data`拿出来作为初始化数据,则需要执行 [transToCellData(data)](/zh/guide/api.html#transtocelldata-data-setting)转换为celldata数据。
其中`{ r, c, v }`格式的celldata转换为二维数组使用的是[transToData(celldata)](/zh/guide/api.html#transtodata-celldata-setting)

总结如下:
```js
// data => celldata 二维数组数据 转化成 {r, c, v}格式 一维数组,传入参数为二维数据data
luckysheet.getGridData(data)
// data => celldata 二维数组数据 转化成 {r, c, v}格式 一维数组
luckysheet.transToCellData(data)

// celldata => data 生成表格所需二维数组,传入参数为表格数据对象file
luckysheet.buildGridData(luckysheetfile)
// celldata => data 生成表格所需二维数组
luckysheet.transToData(celldata)
```

------------
Expand Down Expand Up @@ -65,14 +65,17 @@ luckysheet.buildGridData(luckysheetfile)

## **<span style="font-size:20px;">Q</span>** excel导入导出怎么做?

**<span style="font-size:20px;">A</span>** :配合Luckysheet开发的excel导入导出库-[Luckyexcel](https://github.com/mengshukeji/Luckyexcel)已经实现了excel导入功能,导出功能正在开发当中。现阶段excel导出可以参考这篇博文: https://www.cnblogs.com/recode-hyh/p/13168226.html。
**<span style="font-size:20px;">A</span>** :配合Luckysheet开发的excel导入导出库-[Luckyexcel](https://github.com/mengshukeji/Luckyexcel)已经实现了excel导入功能,导出功能正在开发当中。现阶段excel导出可以参考这2篇博文:

- [基于LuckySheet在线表格的Excel下载功能开发](https://www.cnblogs.com/recode-hyh/p/13168226.html)
- [使用exceljs导出luckysheet表格](https://blog.csdn.net/csdn_lsy/article/details/107179708)

------------

## **<span style="font-size:20px;">Q</span>** 初始化时合并单元格怎么做?

**<span style="font-size:20px;">A</span>** :参考以下案例
- Luckysheet初始化含合并单元格的数据: https://www.cnblogs.com/DuShuSir/p/13272397.html
- [Luckysheet如何初始化含合并单元格的数据](https://www.cnblogs.com/DuShuSir/p/13272397.html)

------------

Expand All @@ -82,7 +85,7 @@ luckysheet.buildGridData(luckysheetfile)

- 一是表格操作完成后,使用`luckysheet.getAllSheets()`方法获取到全部的工作表数据,全部发送到后台存储。
- 二是开启协同编辑功能,实时传输数据给后端。
具体的操作步骤参考这篇文章:https://www.cnblogs.com/DuShuSir/p/13857874.html
具体的操作步骤参考这篇文章:[Luckysheet如何把表格里的数据保存到数据库](https://www.cnblogs.com/DuShuSir/p/13857874.html)

------------

Expand Down
Loading

0 comments on commit f860b49

Please sign in to comment.