产品一张表luckysheet前端代码库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

148 lines
3.7 KiB

5 years ago
# Get started
5 years ago
5 years ago
## Introduction
Luckysheet is an online spreadsheet like excel that is powerful, simple to configure, and completely open source.
5 years ago
5 years ago
### Features
1. Support table settings including freezing columns, merging cells, filtering, sorting, querying, conditional formatting, and annotations
2. Support data analysis functions including pivottables, charts, columns, matrix operations, built-in 385 calculation functions
3. Support one-click screenshots, data copying as json,shared editing, and free data copying and pasting between excel and luckysheet
4. Support mobile viewing
5. Support sparkLine
6. Drop down copy
7. keyboard shortcuts
5 years ago
5 years ago
![Demo](https://minio.cnbabylon.com/public/luckysheet/LuckysheetDemo.gif)
5 years ago
### Demo
5 years ago
[Online demo](https://mengshukeji.github.io/LuckysheetDemo/)
5 years ago
5 years ago
## Development model
5 years ago
5 years ago
### Requirements
5 years ago
[Node.js](https://nodejs.org/en/) Version >= 6
5 years ago
### Installation
5 years ago
```shell
npm install
npm install gulp -g
```
5 years ago
### Development
5 years ago
```shell
npm run dev
```
5 years ago
### Package
5 years ago
```shell
npm run build
```
5 years ago
## Steps for usage
5 years ago
5 years ago
### First step
After `npm run build`, all files in the `dist` folder are copied to the project directory
5 years ago
5 years ago
### Second step
Introduce dependencies
5 years ago
```html
<link rel="stylesheet" href="plugins/css/pluginsCss.min.css">
<link rel="stylesheet" href="plugins/plugins.min.css">
<link rel="stylesheet" href="css/main.min.css">
<script src="plugins/js/plugin.min.js"></script>
<script src="main.min.js"></script>
```
5 years ago
### Third step
Specify a table container
5 years ago
```html
<div id="luckysheet" style="margin:0px;padding:0px;position:absolute;width:100%;height:100%;left: 0px;top: 0px;"></div>
```
5 years ago
### Fourth step
Create a table
5 years ago
```javascript
<script>
$(function () {
5 years ago
//Configuration item
5 years ago
var options = {
5 years ago
container: 'luckysheet' //luckysheet is the container id
5 years ago
}
luckysheet.create(options)
})
</script>
```
5 years ago
## Structure
5 years ago
5 years ago
### Format
5 years ago
5 years ago
The data format of a complete Luckysheet table file is: luckysheetfile, a table file contains several sheet files, corresponding to excel sheet0, sheet1, etc.
5 years ago
5 years ago
An example of a Luckysheet file is as follows, the table contains 3 sheets:`
luckysheetfile = [{sheet1 settings}, {sheet2 settings}, {sheet3 settings}]`
Equivalent to 3 sheets of excel
5 years ago
![excel sheet](https://minio.cnbabylon.com/public/luckysheet/excel.png)
5 years ago
An example of a sheet in the file is as follows:
5 years ago
```javascript
luckysheetfile[0] =
{
5 years ago
"name": "Supermarket sales",
5 years ago
"color": "",
"chart": [],
"status": 0,
"order": 0,
"celldata": [],
"row":90,
"column":100,
"index": 0,
"visibledatarow": [],
"visibledatacolumn": [],
"rowsplit": [],
"ch_width": 4629,
"rh_height": 1681,
"luckysheet_select_save": {},
"luckysheet_selection_range": {},
"scrollLeft": 0,
"scrollTop": 0,
"load": "1",
"config": {
"columlen": {},
"rowhidden": {}
}
,
"pivotTable": {},
"isPivotTable": true,
"calcChain": [],
"filter":{key1:value1, key2:value2},
"filter_select": {}
}
```
5 years ago
### View method
View in chrome's console
5 years ago
`luckysheet.getluckysheetfile()`
5 years ago
You can see the complete settings
`[{shee1}, {sheet2}, {sheet3}]`
5 years ago
## Keyboard shortcuts
5 years ago
| Keyboard shortcuts | Features |
| ------------ | ------------ |
5 years ago
| CTRL + C | Copy cell |
| CTRL + V | Paste cell |
| CTRL + X | Cut cell |
| CTRL + Z | Undo |
| CTRL + Y | Redo |
| CTRL + A | Select all |
| CTRL + B | Bold |
| CTRL + F | Find |
| CTRL + H | Replace |
| CTRL + I | Italic |
| CTRL + UP/DOWN/LEFT/RIGHT | Quickly adjust cell marquee |
| SHIFT + UP/DOWN/LEFT/RIGHT | Adjust selection area |
| CTRL + Left mouse click | Multiple selection cell |
| SHIFT + Left mouse click | Adjust selection area |
| UP/DOWN/LEFT/RIGHT | Single move adjustment cell selection box |
| ENTER | Edit cell |
| DELETE | Clear cell data |