feat: integrate luckysheet inline and fullscreen

This commit is contained in:
liaibo
2025-11-23 17:22:35 +08:00
parent c8e479aeab
commit 994dd4e67c
529 changed files with 403413 additions and 201 deletions
+147
View File
@@ -0,0 +1,147 @@
module.exports = {
base: '/LuckysheetDocs/',
locales: {
// 键名是该语言所属的子路径
// 作为特例,默认语言可以使用 '/' 作为其路径。
'/': {
lang: 'en-US', // 将会被设置为 <html> 的 lang 属性
title: 'Luckysheet Document',
description: 'Luckysheet is an online spreadsheet like excel that is powerful, simple to configure, and completely open source.This site contains official configuration document, API, and tutorial.'
},
'/zh/': {
lang: 'zh-CN',
title: 'Luckysheet文档',
description: 'Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置简单、完全开源。本站包含官方配置文档,API,教程。'
},
},
themeConfig: {
domain: 'https://dream-num.github.io/LuckysheetDemo',
logo: '/img/logo.png',
author: 'Luckysheet',
// 仓库地址
repo: 'mengshukeji/Luckysheet',
// 允许编辑链接文字
editLinks: true,
// 仓库的文档目录
docsDir: 'docs',
// 页面滚动
smoothScroll: true,
locales: {
'/': {
selectText: 'Languages',
label: 'English',
ariaLabel: 'Select language',
editLinkText: 'Edit this page on GitHub',
lastUpdated: 'Last Updated',
serviceWorker: {
updatePopup: {
message: "New content is available.",
buttonText: "Refresh"
}
},
nav: [
{ text: 'Home', link: '/' },
{ text: 'Guide', link: '/guide/' },
{ text: 'Demo', link: 'https://dream-num.github.io/LuckysheetDemo/' },
{
text: 'More',
ariaLabel: 'More',
items: [
{ text: 'About', link: '/about/' }
]
},
],
// 侧边栏
sidebar: {
'/guide/': [
'',
'config',
'sheet',
'cell',
'operate',
'api',
'resource',
'FAQ',
'contribute'
],
'/about/': [
'',
'sponsor',
'company'
],
},
},
'/zh/': {
// 多语言下拉菜单的标题
selectText: '选择语言',
// 该语言在下拉菜单中的标签
label: '简体中文',
ariaLabel: '选择语言',
// 编辑链接文字
editLinkText: '在 GitHub 上编辑此页',
lastUpdated: '上次更新',
// Service Worker 的配置
serviceWorker: {
updatePopup: {
message: "发现新内容可用.",
buttonText: "刷新"
}
},
// 导航栏
nav: [
{ text: '首页', link: '/zh/' },
{ text: '指南', link: '/zh/guide/' },
{ text: '演示', link: 'https://dream-num.github.io/LuckysheetDemo/' },
{
text: '了解更多',
ariaLabel: '了解更多',
items: [
{ text: '关于', link: '/zh/about/' }
]
},
],
// 侧边栏
sidebar: {
'/zh/guide/': [
'',
'config',
'sheet',
'cell',
'operate',
'api',
'resource',
'FAQ',
'contribute'
],
'/zh/about/': [
'',
'sponsor',
'company'
],
},
},
},
},
plugins: {
'vuepress-plugin-baidu-autopush': {},
'sitemap': {
hostname: 'https://dream-num.github.io/LuckysheetDocs'
},
'vuepress-plugin-code-copy': true,
'seo': {
siteTitle: (_, $site) => $site.title,
title: $page => $page.title,
description: $page => $page.frontmatter.description,
author: (_, $site) => $site.themeConfig.author,
tags: $page => $page.frontmatter.tags,
twitterCard: _ => 'summary_large_image',
type: $page => ['guide'].some(folder => $page.regularPath.startsWith('/' + folder)) ? 'article' : 'website',
url: (_, $site, path) => ($site.themeConfig.domain || '') + path,
image: ($page, $site) => $page.frontmatter.image && (($site.themeConfig.domain && !$page.frontmatter.image.startsWith('http') || '') + $page.frontmatter.image),
publishedAt: $page => $page.frontmatter.date && new Date($page.frontmatter.date),
modifiedAt: $page => $page.lastUpdated && new Date($page.lastUpdated),
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

+15
View File
@@ -0,0 +1,15 @@
---
home: true
heroText: Luckysheet
tagline: Configuration Document · API · Tutorial
actionText: Get Started →
actionLink: /guide/
features:
- title: Powerful Features
details: Contains a large number of commonly used spreadsheet functions to replace your excel
- title: Simple Configuration
details: Get started with minimal configuration
- title: Open Source
details: Community driven, work together to improve your ideas
footer: MIT Licensed | Copyright © 2020-present Mengshukeji
---
+28
View File
@@ -0,0 +1,28 @@
# Meet the Team
Luckysheet is a project led by an individual and jointly developed by several friends with the same interests.
### Active Core Team Members
- [@wbfsa](https://github.com/wbfsa)
- [@eiji-th](https://github.com/eiji-th)
- [@fly-95](https://github.com/fly-95)
- [@tonytonychopper123](https://github.com/tonytonychopper123)
- [@Dushusir](https://github.com/Dushusir)
- [@iamxuchen800117](https://github.com/iamxuchen800117)
- [@wpxp123456](https://github.com/wpxp123456)
- [@c19c19i](https://weibo.com/u/3884623955)
- [@zhangchen915](https://github.com/zhangchen915)
- [@jerry-f](https://github.com/jerry-f)
- [@flowerField](https://github.com/flowerField)
### Community Partners
- [@yiwasheng](https://github.com/yiwasheng)
- [@danielcai1987](https://github.com/danielcai1987)
- [@qq6690876](https://github.com/qq6690876)
- [@javahuang](https://github.com/javahuang)
- [@TimerGang](https://github.com/TimerGang)
- [@gsw945](https://github.com/gsw945)
- [@swen-xiong](https://github.com/swen-xiong)
- [@lzmch](https://github.com/lzmch)
- [@kdevilpf](https://github.com/kdevilpf)
- [@WJWM0316](https://github.com/WJWM0316)
+49
View File
@@ -0,0 +1,49 @@
# Community case
We collected a lot of case feedback from the community, and also discovered Luckysheet usage scenarios that we did not expect before.
It is our responsibility to actively listen to the voice of the community, and to continuously update and iterate with your support and feedback.
## Company Case
<table>
<tbody>
<tr>
<td align="center" valign="middle">
<a href="https://www.zpy360.com/" target="_blank">
<img width="222px" src="https://cdn.jsdelivr.net/npm/luckyresources/assets/img/community_case/Zhiping_Cloud.png">
</a>
<p>雄安智评云数字科技有限公司</p>
</td>
<td align="center" valign="middle">
<a href="https://code-the-future.com/" target="_blank">
<img width="222px" src="https://cdn.jsdelivr.net/npm/luckyresources/assets/img/community_case/code_the_future.png">
</a>
<p>Code the Future</p>
</td>
<td align="center" valign="middle">
<a href="http://www.jackyun.com/" target="_blank">
<img width="222px" src="https://cdn.jsdelivr.net/npm/luckyresources/assets/img/community_case/jackyun.png">
</a>
<p>吉客云</p>
</td>
<td align="center" valign="middle">
<a href="https://www.huawei.com/cn/" target="_blank">
<img width="222px" src="https://cdn.jsdelivr.net/npm/luckyresources/assets/img/community_case/huawei.png">
</a>
<p>华为</p>
</td>
</tr>
<tr>
<td align="center" valign="middle">
</td>
<td align="center" valign="middle">
</td>
<td align="center" valign="middle">
</td>
<td align="center" valign="middle">
</td>
</tr>
</tbody>
</table>
+156
View File
@@ -0,0 +1,156 @@
# Sponsor
## Why sponsor
If you run a business and is using Luckysheet in a revenue-generating product, it would make business sense to sponsor Luckysheet development: it ensures the project that your product relies on stays healthy and actively maintained. It can also help your exposure in the Luckysheet community and more people pay attention to your products.
Of course, individual users are also welcome to buy author a glass of juice if Luckysheet has helped you in your work or personal projects 😋.
## How to sponsor
Luckysheet is an MIT-licensed open source project with its ongoing development made possible entirely by the support of these awesome [**backers**](#sponsors-list). If you'd like to join them, please consider:
- [Become a backer or sponsor on Patreon](https://www.patreon.com/mengshukeji).
- [Become a backer or sponsor on Open Collective](https://opencollective.com/luckysheet).
- One-time donation via PayPal, WeChat or Alipay
| PayPal | WeChat | Alipay |
|---|---|---|
| [Paypal Me](https://www.paypal.me/wbfsa) | <img src="https://minio.cnbabylon.com/public/luckysheet/wechat.jpg" width="140" />| <img src="https://minio.cnbabylon.com/public/luckysheet/alipay.jpg" width="130" /> |
### What's the difference between Patreon and OpenCollective?
Funds donated via Patreon go directly to support mengshukeji's work on Luckysheet. Funds donated via OpenCollective are managed with transparent expenses and will be used for compensating work and expenses for core team members or sponsoring community events. Your name/logo will receive proper recognition and exposure by donating on either platform.
## Sponsors List
(Sort by time)
- *涛 ¥ 200
- popo ¥ 1
- 孔垂善 ¥ 5
- Shawn文 ¥ 99
- 幸运的小路易 ¥ 1
- 冯启俊 ¥ 88
- mxb ¥ 10
- 祭阳 ¥ 20
- *勇 ¥ 30
- 虚我 ¥ 200
- 甜党 ¥ 50
- Alphabet(Google)-gcf ¥ 1
- **平 ¥ 100
- **东 ¥ 10
- debugger ¥ 20
- 烦了烦 ¥ 10
- 文顶顶 ¥ 200
- yangxshn ¥ 10
- 爱乐 ¥ 100
- 小李飞刀刀 ¥ 66
- 张铭 ¥ 200
- 曹治军 ¥ 1
- *特 ¥ 10
- **权 ¥ 9.9
- **sdmq ¥ 20
- *旭 ¥ 10
- Quentin ¥ 20
- 周宇凡 ¥ 100
- *超 ¥ 10
- 维宁 ¥ 100
- hyy ¥ 20
- 雨亭寒江月 ¥ 50
- **功 ¥ 10
- **光 ¥ 20
- terrywan ¥ 100
- 王晓洪 ¥ 10
- Sun ¥ 10
- 忧绣 ¥ 100
- Jasonx ¥ 10
- 国勇 ¥ 66.6
- 郎志 ¥ 100
- 匿名 ¥ 1
- ni ¥ 100
- 苏 ¥ 50
- Mads_chan ¥ 1
- LK ¥ 100
- 智连方舟 李汪石 ¥ 168
- **发 ¥ 260
- *超 ¥ 10
- *勇 ¥ 10
- *腾 ¥ 15
- 名字好难起 ¥ 20
- 大山 ¥ 1
- waiting ¥ 1000
- **宇 ¥ 10.00
- 刘小帅的哥哥 ¥ 20.00
- 宁静致远 ¥ 10.00
- Eleven ¥ 1.00
- **帆 ¥ 188
- henry ¥ 100
- .波罗 ¥ 50
- 花落有家 ¥ 50
- 踏遍南水北山 ¥ 1
- LC ¥ 5
- **明 ¥ 8.80
- *军 ¥ 20
- 张彪 ¥ 50
- 企业文档云@肖敏 ¥ 10
- 匿名 ¥ 50
- 逍遥行 ¥ 10
- z.wasaki ¥ 50
- Make Children ¥ 20
- Foam ¥ 20
- 奥特曼( o|o)ノ三 ¥ 50
- **凯 ¥ 10
- **兵 ¥ 20
- **川 ¥ 1
- 二万 ¥ 50
- 蔚然成林 ¥ 10
- 邹杰 ¥ 10
- 张永强 ¥ 50
- 鱼得水 ¥ 50
- Ccther ¥ 1
- Eric Cheng ¥ 10
- 佚名 ¥ 1
- 花叶 ¥ 50
- GT ¥ 20
- 菜菜心 ¥ 10
- fisher ¥ 1
- JC ¥ 5
- 佚名 ¥ 20
- 独孤一剑 ¥ 50
- mxt ¥ 20
- 一叶迷山 ¥ 100
- Jeff ¥ 100
- 八千多条狗🐶 ¥ 100
- 晓峰 ¥ 10
- 戒 ¥ 1
- 浪里个浪 ¥ 1
- 回调函数 ¥ 50
- 赖瓜子 ¥ 5
- Milo•J ¥ 20
- 可道云 ¥ 200
- *程 ¥ 10
- 来一杯卡布酸奶 ¥ 5
- 刘久胜 ¥ 100
- 快意江湖 ¥ 50
- *新 ¥ 9.9
- **龙 ¥ 100
- **江 ¥ 100
- **威 ¥ 9.8
- **涛 ¥ 500
- **嘉 ¥ 10
- *涛 ¥ 1
- *兵 ¥ 5
- *阳 ¥ 200
- *辉 ¥ 1
- *帆 ¥ 30
- **旺 ¥ 10
- **麟 ¥ 20
- *霖 ¥ 9.9
- *帅 ¥ 10
- *鑫 ¥ 6.66
- ~朴:shu ¥ 29.79
- 未来 ¥ 1
- 国勇 ¥ 0.1
- 用心灵听雨 ¥ 10
- 钊 ¥ 5
- 星稀 ¥ 5
+325
View File
@@ -0,0 +1,325 @@
# FAQ
The content of this chapter collects the common problems that everyone has feedback. If the official documents and this list cant answer your questions, I recommend you to [Official Forum](https://github.com/mengshukeji/Luckysheet/discussions)
## What is the difference between data and celldata in luckysheetfile?
**<span style="font-size:20px;">A</span>**: Use one-dimensional array format [celldata](/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 [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 into {r, c, v} format one-dimensional array
luckysheet.transToCellData(data)
// celldata => data to generate the two-dimensional array required for the table
luckysheet.transToData(celldata)
```
------------
## What are the cell types?
**<span style="font-size:20px;">A</span>**: Refer to [Cell Format List](/guide/cell.html), with examples of available cell formats
------------
## How to use Luckysheet in Vue/React project?
**<span style="font-size:20px;">A</span>**: Check
- Vue case: [luckysheet-vue](https://github.com/mengshukeji/luckysheet-vue)
- React case: [luckysheet-react](https://github.com/mengshukeji/luckysheet-react)
------------
## Why will the formula in the table not be triggered after initialization?
**<span style="font-size:20px;">A</span>**: Refer to [Table data format](/guide/sheet.html#calcchain) ,just set the calcChain corresponding to the cell data.
------------
## Is the remote loading data loadUrl or updateUrl?
**<span style="font-size:20px;">A</span>**: [loadUrl](/guide/config.html#loadurl). Configure loadUrl, Luckysheet will request the entire table data through ajax, and updateUrl will be used as the interface address for collaborative editing in real-time saving.
Note: Initial data needs to be configured with loadUrl parameter, while for collaborative editing, the four parameters of loadUrl, updateUrl and allowUpdate can be configured to take effect.
------------
## What is the difference between `index` and `order` for each sheet page?
**<span style="font-size:20px;">A</span>**: Each sheet page has a unique id, which is `index`, which can be incremented by numbers or a random string. And `order` is the sorting situation of all sheets, starting from 0, can only be numbers `0,1,2...`.
------------
## Why cant I run the project directly under the dist folder?
**<span style="font-size:20px;">A</span>**: Need to start the local server
- [Node build a local server](https://github.com/JacksonTian/anywhere)
- [Python build local server](https://developer.mozilla.org/en-US/docs/Learn/Common_questions/set_up_a_local_testing_server)
------------
## 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 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)
------------
## How to merge cells during initialization?
**<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)
------------
## How does 'Luckysheet' save the data from the table to the database? Is there a soulution for storage and collaboration?
**<span style="font-size:20px;">A</span>**: There are two options:
- 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:
[How Luckysheet saves the data in the table to the database](https://www.cnblogs.com/DuShuSir/p/13857874.html)
------------
## How to monitor cell hover or click events? how to monitor `cellRenderAfter` in real-time?
**<span style="font-size:20px;">A</span>**: We have collected the secondary development requirements for cell events, and planned the cell-related hook functions, refer to [cell hook function](/guide/config.html#cellrenderafter) (the TODO displayed is not yet open)
------------
## How to customize the top toolbar?
**<span style="font-size:20px;">A</span>**:
reference: [options.showtoolbarconfig](/guide/config.html#showtoolbarconfig)(TODO means waiting to developed)
------------
## Does the project use jQuery?
**<span style="font-size:20px;">A</span>**: yes. At the beginning, Luckysheet uses jQuery。The packaging tool will package the jQuery to this file `./plugins/js/plugin.js`
If your project (such as react / Vue) also references jQuery globally and causes conflicts, you can try to remove a jQuery.
if you want to remove jQuery in `Luckysheet`, you can find `jQuery` in source code folder `gulpfile.js`: [src/plugins/js/jquery.min.js](https://github.com/mengshukeji/Luckysheet/blob/master/gulpfile.js)then delete information related to jQuery.
------------
## How to add a field to a cell object?
**<span style="font-size:20px;">A</span>**: reference [cell object format](/guide/cell.html)then read this annotation[src/controllers/postil.js](https://github.com/mengshukeji/Luckysheet/blob/master/src/controllers/postil.js)。the annotation is a configuration in a cell object.
------------
## The toolbar icon is on the loading stage all the time.
**<span style="font-size:20px;">A</span>**: The luckysheet use iconfont icon in this project, if any icon cannot be loaded ,plz check your iconfont.css. we are so sorry that we did not describe it clearly in the old version documents.
Now the documents have been updated.[official documents](/guide/#steps-for-usage)
------------
## Can't run Luckyexcel after package.
**<span style="font-size:20px;">A</span>**: Terminal does not show `end`, but if the `dist` folder has this file `luckyexcel.js`, it is normal.
Lucky excel is an excel import and export library. The project uses `gulp` as a packaging tool. There is a problem with the old version of the packaging tool, but it is fixed now. if this problem still troubles you, plz check the following steps:
1. pull the latest code.
2. `npm i`
3. `npm run build`
more information: [Luckyexcel](https://github.com/mengshukeji/Luckyexcel/)
------------
## How to disable editing of cellsHow to open sheet protection?
**<span style="font-size:20px;">A</span>**: Sheet protection includes disable editing of cells that you need to make some configurations on each sheets. `config.authority`, the latest configurations[sheet protection](/guide/sheet.html#config-authority)。
In order to make it easier for you to understand the function of sheet protection, the following video shows how to make the whole sheet uneditable, but allow a column of cells to be edited:
<iframe frameborder="0" src="https://v.qq.com/txp/iframe/player.html?vid=g3162sacwn6" allowFullScreen="true"></iframe>
In you local browser, you can open the control pannel, use `luckysheet.getLuckysheetfile()[0].config.authority` to get the configuration parameters.
------------
## How to configure data validation?
**<span style="font-size:20px;">A</span>**: there is the configuration of data validation[data validation](/guide/sheet.html#dataVerification)。Also there is the API that you can use `data validation` in any time. [setDataVerification](/guide/api.html#setdataverification-optionitem-setting).
------------
## Is there a case for using Luckysheet with CDN?
**<span style="font-size:20px;">A</span>**: Luckysheet supports CDN. reference: [The case of using luckysheet by CDN](https://www.cnblogs.com/DuShuSir/p/13859103.html)
------------
## how to limit the adaptive height of a picture in a cell
**<span style="font-size:20px;">A</span>**: First of all, you need to move the picture and adjust the cell size, and then there are the following situations:
- if the cell contains a picture and you expand the cell, the picure will not be expanded.
- if the cell contains a picture and you shorten the cell to the edge of the picture, the picture will shrink.
- When the picture exceeds the border of the cell, the size of this picture will change with the size of the cell.
if you want to get the position of the picture, you can overlap the picture with the border of the cell.(in the source code, it needs to overlap more than 2px.)The following demo video shows how to limit the image to the adaptive width and height of the cell.
<iframe frameborder="0" src="https://v.qq.com/txp/iframe/player.html?vid=y3163ya0q6c" allowFullScreen="true"></iframe>
------------
## How to get the default row height and column width of the worksheet?
**<span style="font-size:20px;">A</span>**: There are two ways to get it
- 1. use `luckysheet.getLuckysheetfile()` to get all configuration data, so you can get the `defaultRowHeight` and `defaultColWidth` in the sheet configuration data。
- 2. use API to get the default row height [getDefaultRowHeight](/guide/api.html#getdefaultrowheight-setting) and column width.[getDefaultColWidth](/guide/api.html#getdefaultcolwidth-setting)
------------
## How to hide the add row button and the back to top button below the worksheet?
**<span style="font-size:20px;">A</span>**: Configuration is open
- Allow adding rows [enableAddRow](/guide/config.html#enableaddrow)
- Allow back to top [enableAddBackTop](/guide/config.html#enableAddBackTop)
------------
## How to hide the row and column headings of the worksheet?
**<span style="font-size:20px;">A</span>**: Configuration is open
- The width of the row header area [rowHeaderWidth](/guide/config.html#rowheaderwidth)
- The height of the column header area [columnHeaderHeight](/guide/config.html#columnHeaderHeight)
------------
## What method can be called to set `config.merge`?
**<span style="font-size:20px;">A</span>**: Three methods
- Interface operation
- Use API: [setRangeMerge](/guide/api.html#setrangemerge-type-setting)
- Manually assemble merge parameters
------------
## Why is the official new feature ineffective?
**<span style="font-size:20px;">A</span>**: The first step is to check whether you have used CDN to import,
The CDN link used in the Luckysheet tutorial is the service provided by [jsdelivr](https://www.jsdelivr.com/package/npm/luckysheet), and the code is from [npmjs.com](https://www.npmjs.com/) automatically sync the past, not from [Github](https://github.com/mengshukeji/Luckysheet/). Because our newly submitted code still needs to be tested for a period of time, it will not be released to npm immediately, causing the npm code to lag behind Github.
If you need to try the latest code, we strongly recommend that you pull the code from the [Luckysheet Github](https://github.com/mengshukeji/Luckysheet/) main repository. After our version is stable, we will consider releasing the npm package in real time.
The second step, if it is to import the packaged code of the github repository, test to determine whether there is a bug, you can find the problem and try to fix it, and then [submit a PR](https://github.com/mengshukeji/Luckysheet/pulls), if can't fix it, please [submit issues](https://github.com/mengshukeji/Luckysheet/issues).
------------
## `npm run dev` reported an error: ʻError: Cannot find module'rollup'`?
**<span style="font-size:20px;">A</span>**: It may be a problem with the npm package installation, try the following steps:
1. `npm cache clean --force`
2. `npm i rimraf -g`
3. `rimraf node_modules`
4. Delete the package-lock.json file
5. `npm i`
6. `npm run dev`
Tip: Most other npm installation problems can also be solved by trying above steps.
------------
## How to carry out secondary development of Luckysheet in Vue project?
**<span style="font-size:20px;">A</span>**: The [luckysheet-vue](https://github.com/mengshukeji/luckysheet-vue) case is to provide an application integration solution.
If directly developed locally:
1. Start both the Luckysheet project and your own Vue project. For example, the Luckysheet project is at http://localhost:3001
2. Import Luckysheet to use in the Vue project through `http://localhost:3001`
In this case, after Luckysheet is modified in real time, the changes can be seen in the Vue project
------------
## Error reporting `Store.createChart` when creating chart?
**<span style="font-size:20px;">A</span>**: You need to introduce a chart plugin to use it. You should configure the chart plugin to use when the workbook is initialized. Refer to
- Plugins configuration [plugins](/guide/config.html#plugins)
- 或 官方demo [src/index.html](https://github.com/mengshukeji/Luckysheet/blob/master/src/index.html)
------------
## Can cells add custom attributes?
**<span style="font-size:20px;">A</span>**: The custom attributes directly assigned to the cell object will be filtered. To make the custom attributes take effect, you need to edit the code to remove the filter attributes.
------------
## How to enter text starting with `'='`? For example, `=currentDate('YYYY-MM-DD')`, it will remove the function by default, how to prohibit the function?
**<span style="font-size:20px;">A</span>**: Just add a single quotation mark in front of it, and it will be forcibly recognized as a string, which is consistent with excel. For example: `'=currentDate('YYYY-MM-DD')`
------------
## Why does the create callback have no effect?
**<span style="font-size:20px;">A</span>**: The API method `luckysheet.create()` does not have a callback, but Luckysheet provides a hook function to execute the callback method at a specified location, such as:
- Triggered before the workbook is created [workbookCreateBefore](/guide/config.html#workbookcreatebefore)
- Triggered after the workbook is created [workbookCreateAfter](/guide/config.html#workbookcreateafter)
------------
## When create, the first cell is selected by default, how to remove it?
**<span style="font-size:20px;">A</span>**: When the cell is selected, it is highlighted by default, just remove the highlight, use API: [setRangeShow](/guide/api.html#setrangeshow-range-setting)
```js
luckysheet.setRangeShow("A2",{show:false})
```
------------
## Where is the right-click event bound?
**<span style="font-size:20px;">A</span>**: In the source code [src/controllers/hander.js](https://github.com/mengshukeji/Luckysheet/blob/master/src/controllers/handler.js), search for `event.which == "3"` to find the code executed by the right-click event.
------------
## How to add a custom toolbar?
**<span style="font-size:20px;">A</span>**: No configuration is currently provided, you can refer to the implementation of the print button in the toolbar to modify the source code:
1. Search for `luckysheet-icon-print` globally to find the implementation of the print button, in [src/controllers/constant.js](https://github.com/mengshukeji/Luckysheet/blob/master/src/controllers/constant.js) add a similar template string, you need to customize a unique id
2. Modify [src/controllers/resize.js](https://github.com/mengshukeji/Luckysheet/blob/master/src/controllers/resize.js) and add a new record in the toobarConfig object
3. Modify [src/controllers/menuButton.js](https://github.com/mengshukeji/Luckysheet/blob/master/src/controllers/menuButton.js) to add an event listener
------------
## How to add custom formulas?
**<span style="font-size:20px;">A</span>**: Two source codes need to be modified:
1. Add a formula to the `functionImplementation` object in the [src/function/functionImplementation.js](https://github.com/mengshukeji/Luckysheet/blob/master/src/function/functionImplementation.js) file, format refer to formulas such as `SUM`/`AVERAGE`
2. Modify all the language packs in the [src/locale](https://github.com/mengshukeji/Luckysheet/blob/master/src/locale) file directory, and add the new formula description to the `functionlist` array in. Among them, `t` is the category of the function, `m` is the number of parameters, the minimum number of parameters and the maximum number of parameters.
------------
## Is there a similar loadData interface, I want to load 10 records first, and then dynamically load the data, these data are appended to the table?
**<span style="font-size:20px;">A</span>**: Yes. Our `loadSheetUrl` provides this function, which can be turned on by initializing `options.enablePage = true`.
Searching for `enablePage` in the source code, you can see that there is a `method.addDataAjax` method, which contains an ajax request to dynamically load data, which will be appended to the worksheet.
This function is now hidden in the document, because when we made this interface, the interface parameters were matched according to our actual business, which may not be universal. We are going to abstract and release it for everyone to use. If you want to use it yourself you can change it based on this.
It is recommended that you consider writing your own interface to load the data, and then use `setRangeValue` to append the data at the specified location, which has a higher degree of customization.
------------
+271
View File
@@ -0,0 +1,271 @@
# Luckysheet is no longer maintained, please use [Univer](https://github.com/dream-num/univer) instead!
# Get started
## Introduction
Luckysheet is an online spreadsheet like excel that is powerful, simple to configure, and completely open source.
## Demo
[Online demo](https://dream-num.github.io/LuckysheetDemo/)
![Demo](/LuckysheetDocs/img/LuckysheetDemo.gif)
## Online Case
- [Cooperative editing demo](http://luckysheet.lashuju.com/demo/)(Note: The official Java backend will also be open source after finishing,using OT algorithm. Please do not operate frequently to prevent the server from crashing)
## Features
### 🛠️Formatting
+ **Styling** (Change font style, size, color, or apply effects)
+ **Conditional formatting** (highlight interesting cells or ranges of cells, emphasize unusual values, and visualize data by using data bars, color scales, and icon sets that correspond to specific variations in the data)
+ **Align or rotate text**
+ **Support text truncation, overflow, automatic line wrapping**
+ **Data types**
+ **currency, percentages, decimals, dates**
+ **Custom** (E.g `##,###0.00` , `$1,234.56$##,###0.00_);[Red]($##,###0.00)`, `_($* ##,###0.00_);_(...($* "-"_);_(@_)`, `08-05 PM 01:30MM-dd AM/PM hh:mm` )
+ **Cell segmentation style** (Alt+Enter line break, sub,super, in-cell style)
### 🧬Cells
+ **Move cells by drag and dropping** (Operate on selection)
+ **Fill handle** (For a series like 1, 2, 3, 4, 5..., type 1 and 2 in the first two cells. For the series 2, 4, 6, 8..., type 2 and 4. Support arithmetic sequence, geometric sequence,date, week,chinese numbers)
+ **Auto Fill Options** (Fill copy, sequence, only format, no format, day, month, year)
+ **Multiple selection** (Hold Ctrl Selecting multiple cells, copy and paste)
+ **Find and replace** (Such as a particular number or text string, Support regular expression, whole word, case sensitive)
+ **Location** (Cells can be selected according to the data type)
+ **Merge cells**
+ **Data validation** (Checkbox, drop-down list, datePicker)
### 🖱️Row & columns
+ **Hide, Insert, Delete rows and columns**
+ **Frozen rows and columns** (First row, first column, Frozen to selection, freeze adjustment lever can be dragged)
+ **Split text** (Split text into different columns with the Convert Text to Columns Wizard)
### 🔨Operation
+ **Undo/Redo**
+ **Copy/Paste/Cut** (Copy from excel to Luckysheet with format, vice versa)
+ **Hot key** (The operating experience is consistent with excel, if there are differences or missing, please feedback to us)
+ **Format Painter** (Similar to google sheet)
+ **Selection by drag and dropping** (Change the parameters of formula and chart through selection)
### ⚙️Formulas & functions
+ **Built-in formulas**
+ Math (SUMIFS, AVERAGEIFS, SUMIF, SUM, etc.)
+ Text (CONCATENATE, REGEXMATCH, MID)
+ Date (DATEVALUE, DATEDIF, NOW, WEEKDAY, etc.)
+ Financial (PV, FV, IRR, NPV, etc.)
+ Logical (IF, AND, OR, IFERROR, etc.)
+ Lookup (VLOOKUP, HLOOkUP, INDIRECT, OFFSET, etc.)
+ Dynamic Array (Excel2019 new formulas, SORT,FILTER,UNIQUE,RANDARRAY,SEQUENCE)
+ **Array** (={1,2,3,4,5,6}, Crtl+Shift+Enter)
+ **Remote formulas** (DM_TEXT_TFIDF, DM_TEXT_TEXTRANK,DATA_CN_STOCK_CLOSE etc. Need remote interface, can realize complex calculation)
+ **Custom** (Some formula suitable for use in China have been added. AGE_BY_IDCARD, SEX_BY_IDCARD, BIRTHDAY_BY_IDCARD, PROVINCE_BY_IDCARD, CITY_BY_IDCARD, etc. You can define any formula you want)
### 📐Tables
+ **Filters** (Support color , numerical, date, text filtering)
+ **Sort** (Sort multiple fields simultaneously)
### 📈Pivot table
+ **Arrange fields** (Add fileds to rows, columns, values, area, it is similar to excel)
+ **Aggregation** (Surport Sum,Count,CountA,CountUnique,Average,Max,Min,Median,Product,Stdev,Stdevp,Var,VarP etc.)
+ **Filter data** (Add fileds to filters area and analyze the desired data )
+ **Drill down** (Double click pivot table cell to drill down for detail data )
+ **Create a PivotChart** (Pivot table can create a chart )
### 📊Chart
+ **Support types** (Line, Column, Area, Bar, Pie, comming soon Scatter, Radar, Gauge, Funnel etc.)
+ **Chart Plugins** (Link to another project [ChartMix](https://github.com/mengshukeji/chartMix)(MIT): ECharts is currently supported,Highcharts, Ali G2, amCharts, googleChart, chart.js are being developed gradually)
+ **Sparklines** (Support by formula : Line, Pie, Box, Pie etc.)
### ✍️Share
+ **Comments** (Add, delete, update)
+ **Collaborate** (Simultaneous editing by multiple users)
### 📚Insert object
+ **Insert picture** (JPG,PNG,SVG and so on)
### ⚡Luckysheet
+ **Matrix operation** (Operate selection through the right-click menu: transpose, rotate, numerical calculation)
+ **Screenshot** (Take a screenshot with selection)
+ **Copy to** (In the right-click menu, copy selection to json, array etc.)
+ **EXCEL import/export** (Specially adapted to Luckysheet, export is under development)
### ⏱️Coming soon
+ **Print** (Like excel print option, save to PDF)
+ **Tree menu** (Just like the outline (group) function of excel)
+ **Table new Features** (filter, slicer)
+ **CSV,TXT import/export** (Specially adapted to Luckysheet)
+ **Insert Shapes** ([Pen tool](https://github.com/mengshukeji/Pentool) Shapes)
+ **Documentation** (Improve documentation and API)
+ **More...** (Please advise us)
## Development model
### Requirements
[Node.js](https://nodejs.org/en/) Version >= 6
### Installation
```shell
npm install
npm install gulp -g
```
### Development
```shell
npm run dev
```
### Package
```shell
npm run build
```
## Steps for usage
### First step
There are two ways to introduce dependencies
#### CDN
```html
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/plugins/css/pluginsCss.css' />
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/plugins/plugins.css' />
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/css/luckysheet.css' />
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/assets/iconfont/iconfont.css' />
<script src="https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/plugins/js/plugin.js"></script>
<script src="https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/luckysheet.umd.js"></script>
```
Note that the path of `https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/luckysheet.umd.js` means that the latest luckysheet code will be pulled, but if Luckysheet has just been released, the jsdelivr website may not have time Synchronize from npm, so using this path will still pull to the previous version. We recommend that you directly specify the latest version.
To specify the Luckysheet version, please add the version number after all CDN dependent files, such as: `https://cdn.jsdelivr.net/npm/luckysheet@2.1.12/dist/luckysheet.umd.js`.
> How do I know which version is the latest version? View the latest [release record](https://github.com/mengshukeji/Luckysheet/releases) or [package.json](https://github.com/mengshukeji/Luckysheet/blob/master/package.json)` version` field.
If it is not convenient to access jsdelivr.net, you can also import it locally
#### Import locally
After `npm run build`, all files in the `dist` folder are copied to the project directory
```html
<link rel='stylesheet' href='./plugins/css/pluginsCss.css' />
<link rel='stylesheet' href='./plugins/plugins.css' />
<link rel='stylesheet' href='./css/luckysheet.css' />
<link rel='stylesheet' href='./assets/iconfont/iconfont.css' />
<script src="./plugins/js/plugin.js"></script>
<script src="./luckysheet.umd.js"></script>
```
### Second step
Specify a table container
```html
<div id="luckysheet" style="margin:0px;padding:0px;position:absolute;width:100%;height:100%;left: 0px;top: 0px;"></div>
```
### Third step
Create a table
```javascript
<script>
$(function () {
//Configuration item
var options = {
container: 'luckysheet' //luckysheet is the container id
}
luckysheet.create(options)
})
</script>
```
## Structure
### Format
The data format of a complete Luckysheet table file is: luckysheetfile, a table file contains several sheet files, corresponding to excel sheet0, sheet1, etc.
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
![excel sheet](/LuckysheetDocs/img/excel.png)
An example of a sheet in the file is as follows:
```javascript
luckysheetfile[0] =
{
"name": "Cell", //Worksheet name
"color": "", //Worksheet color
"config": {}, //Table row height, column width, merged cells, borders, hidden rows and other settings
"index": "0", //Worksheet index
"chart": [], //Chart configuration
"status": "1", //Activation status
"order": "0", //The order of the worksheet
"hide": 0,//whether to hide
"column": 18, //Number of columns
"row": 36, //number of rows
"celldata": [], //Original cell data set
"visibledatarow": [], //The position of all rows
"visibledatacolumn": [], //The position of all columns
"ch_width": 2322, //The width of the worksheet area
"rh_height": 949, //The height of the worksheet area
"scrollLeft": 0, //Left and right scroll bar position
"scrollTop": 315, //Up and down scroll bar position
"luckysheet_select_save": [], //selected area
"luckysheet_conditionformat_save": {},//Conditional format
"calcChain": [],//Formula chain
"isPivotTable":false,//Whether to pivot table
"pivotTable":{},//Pivot table settings
"filter_select": null,//Filter range
"filter": null,//Filter configuration
"luckysheet_alternateformat_save": [], //Alternate colors
"luckysheet_alternateformat_save_modelCustom": []//Customize alternate colors
}
```
### View method
View in chrome's console
`luckysheet.getluckysheetfile()`
You can see the complete settings
`[{shee1}, {sheet2}, {sheet3}]`
## Keyboard shortcuts
| Keyboard shortcuts | Features |
| ------------ | ------------ |
| 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 | Move cell selection box |
| ENTER | Edit cell |
| TAB | Move cell selection box to the right |
| DELETE | Clear cell data |
## Guide
If you encounter problems with Luckysheet, follow the steps below to find the answer
1. Use Doge or Google to search for common technical issues
2. For Luckysheet related issues, please view [Luckysheet Official Document](https://dream-num.github.io/LuckysheetDocs/)(Note that the function of marking TODO has not yet been implemented)
3. Search [FAQ List](https://dream-num.github.io/LuckysheetDocs/guide/FAQ.html)
4. Search [Official Forum](https://groups.google.com/g/luckysheet) to see if anyone has encountered it
5. Try to check or experiment by yourself to find the answer
6. Please try to read the source code to find the answer,
If none of the above methods solve your problem, you can consider:
- Go to [Official Forum](https://groups.google.com/g/luckysheet) to ask questions
- Go to [Gitter](https://gitter.im/mengshukeji/Luckysheet) to ask questions
- If there are obvious problems or the needs cannot be met, please submit [issues](https://github.com/mengshukeji/Luckysheet/issues)
> Recommended reading [How To Ask Questions The Smart Way](http://www.catb.org/~esr/faqs/smart-questions.html)
At the same time, we strongly recommend you to help us enrich the Luckysheet community
- If you find a problem with the documentation or code, you can contribute by submitting a PR. All reasonable changes, optimizations, amendments, or document amendments or updates related to submissions will be accepted
- When you have some experience in using or secondary developing Luckysheet, we encourage you to share it through blog posts
File diff suppressed because it is too large Load Diff
+391
View File
@@ -0,0 +1,391 @@
# Format attributes
## Cell attributes table
<table>
<tr>
<td>Attribute value</td>
<td>Full name</td>
<td><div style="width:100px">Explanation</div></td>
<td>Example value</td>
<td>Aspose method or attribute</td>
</tr>
<tr>
<td>ct</td>
<td>celltype</td>
<td>Cell value format: text, time, etc.</td>
<td><a href="#cellStyle">Cell format</a></td>
<td></td>
</tr>
<tr>
<td>bg</td>
<td>background</td>
<td>background color</td>
<td>#fff000</td>
<td>setBackgroundColor</td>
</tr>
<tr>
<td>ff</td>
<td>fontfamily</td>
<td>Font</td>
<td>0 Times New Roman, 1 Arial, 2 Tahoma, 3 Verdana, 4 Microsoft Yahei, 5 Song, 6 ST Heiti, 7 ST Kaiti, 8 ST FangSong, 9 ST Song, 10 Chinese New Wei, 11 Chinese Xingkai, 12 Chinese Lishu</td>
<td>Style.Font object's Name property.</td>
</tr>
<tr>
<td>fc</td>
<td>fontcolor</td>
<td>font color</td>
<td>#fff000</td>
<td>Style.Font object's Color property</td>
</tr>
<tr>
<td>bl</td>
<td>bold</td>
<td>Bold</td>
<td>0 Regular, 1 Bold</td>
<td>Style.Font object's IsBold property to true.</td>
</tr>
<tr>
<td>it</td>
<td>italic</td>
<td>Italic</td>
<td>0 Regular, 1 Italic</td>
<td></td>
</tr>
<tr>
<td>fs</td>
<td>fontsize</td>
<td>font size</td>
<td>14</td>
<td>Style.Font object's Size property.</td>
</tr>
<tr>
<td>cl</td>
<td>cancelline</td>
<td>Cancelline</td>
<td>0 Regular, 1 Cancelline</td>
<td>Style.Font object's Underline property</td>
</tr>
<tr>
<td>vt</td>
<td>verticaltype</td>
<td>Vertical alignment</td>
<td>0 middle, 1 up, 2 down</td>
<td>setVerticalAlignment</td>
</tr>
<tr>
<td>ht</td>
<td>horizontaltype</td>
<td>Horizontal alignment</td>
<td>0 center, 1 left, 2 right</td>
<td>setHorizontalAlignment</td>
</tr>
<tr>
<td>mc</td>
<td>mergecell</td>
<td>Merge Cells</td>
<td>{rs: 10, cs:5} indicates that the cells from this cell to 10 rows and 5 columns are merged.</td>
<td>Merge</td>
</tr>
<tr>
<td>tr</td>
<td>textrotate</td>
<td>Text rotation</td>
<td>0: 0、1: 45 、2: -45、3 Vertical text、4: 90 、5: -90</td>
<td>setRotationAngle</td>
</tr>
<tr>
<td>tb</td>
<td>textbeak</td>
<td>Text wrap</td>
<td>0 truncation, 1 overflow, 2 word wrap</td>
<td>2: setTextWrapped <br> 0和1: IsTextWrapped =&nbsp;true</td>
</tr>
<tr>
<td>v</td>
<td>value</td>
<td>Original value</td>
<td></td>
<td></td>
</tr>
<tr>
<td>m</td>
<td>monitor</td>
<td>Display value</td>
<td></td>
<td></td>
</tr>
<tr>
<td>f</td>
<td>function</td>
<td>formula</td>
<td></td>
<td>setFormula <br> setArrayFormula <br> workbook.calculateFormula();</td>
</tr>
</table>
The following is the storage of 3 cells:
```json
[
{
"r": 10,
"c": 11,
"v": {
"f": "=MAX(A7:A9)",
"ct": {
"fa": "General",
"t": "n"
},
"v": 100,
"m": "100"
}
},
{
"r": 0,
"c": 1,
"v": {
"v": 12,
"f": "=SUM(A2)",
"bg": "#fff000"
}
},
{
"r": 10,
"c": 11,
"v": "值2"
}
]
```
## <div id='cellStyle'>Cell format</div>
Reference[Aspose.Cells](https://docs.aspose.com/display/cellsnet/List+of+Supported+Number+Formats#ListofSupportedNumberFormats-Aspose.Cells)
The format is set to:
```json
{
"ct": {
"fa": "General",
"t": "g"
},
"m": "2424",
"v": 2424
}
```
|Parameter|Explanation|Value|
| ------------ | ------------ | ------------ |
|fa|Format definition string| such as "General"|
|t|Type|Such as "g"|
The available settings are as follows:
| Format | ct.fa | ct.t | Example of m value | Remarks |
|----------|----------|-------------------------|------------------------- |------------------------- |
| Automatic | General | g | Luckysheet |Automatic format, which is also the default format; When the cell content is a number, the value of `m` is `'n'`|
| Plain text | @ | s | Luckysheet ||
| <br><br><br>**Number Format** | | | | |
| Integer | 0 | n | 1235 | 0 decimal places |
| One decimal place of the number | 0.0 | n | 1234.6 | The number of 0 after the dot represents the number of decimal places. If the original number is large, the number of digits will be rounded to the nearest hour |
| Two decimal places | 0.00 | n | 1234.56 ||
| Percentage integer | 0% | n | 123456% |The usage of #0% is also supported|
| Percentage | 0.00% | n | 123456.00% |The usage of #0.00% is also supported. The number of 0 after the dot represents the number of decimal places|
| Scientific Notation | 0.00E+00 | n | 1.23E+03 ||
| Scientific Notation | ##0.0E+0 | n | 1.2E+3 ||
| Fractions | # ?/? | n | 1234 5/9 ||
| Score | # ??/?? | n | 1234 14/25 ||
| Ten thousand | w | n |123 thousand and 456||
| Ten thousand two decimal places | w0.00 | n |123 thousand and 3456.00 ||
| Accounting | ¥(0.00) | n ||
| More number formats | #,##0 | n | 1,235 ||
| More number formats | #,##0.00 | n | 1,234.56 ||
| More number formats | `#,##0_);(#,##0)` | n | 1,235 ||
| More number formats | `#,##0_);[Red](#,##0)` | n | 1,235 ||
| More number formats | `#,##0.00_);(#,##0.00)` | n | 1,234.56 ||
| More number formats | `#,##0.00_);[Red](#,##0.00)` | n | 1,234.56 ||
| More number formats | $#,##0_);($#,##0) | n | $1,235 ||
| More number formats | `$#,##0_);[Red]($#,##0)` | n | $1,235 ||
| More number formats | $#,##0.00_);($#,##0.00) | n | $1,234.56 ||
| More number formats | `$#,##0.00_);[Red]($#,##0.00)` | n | $1,234.56 ||
| More number formats | _($* #,##0_);_(...($* "-"_);_(@_) | n | $ 1,235 ||
| More number formats | _(* #,##0_);_(*..._(* "-"_);_(@_) | n | 1,235 ||
| More number formats | _($* #,##0.00_);_(...($* "-"_);_(@_) | n | $ 1,234.56 ||
| More number formats | _(* #,##0.00_);...* "-"??_);_(@_) | n | 1,234.56 ||
| <br><br><br>**Time and Date Format** | | | | |
| Time | hh:mm AM/PM | d |10:23 AM||
| Time 24H | hh:mm | d |10:23||
| Date Time | yyyy-MM-dd hh:mm AM/PM | d |2020-07-29 10:23 AM||
| Date Time 24H | yyyy-MM-dd hh:mm | d |2020-07-29 10:23||
| Date | yyyy-MM-dd | d | 1930-08-05 ||
| Date | yyyy/MM/dd | d | 1930/8/5 ||
| Date | yyyy "year" M" month "d" day" | d | August 5, 1930 ||
| Date | MM-dd | d | 08-05 ||
| Date | M-d | d | 8-5 ||
| Date | M"Month"d"Day" | d | August 5th ||
| Date | h:mm:ss | d | 13:30:30 ||
| Date | h:mm | d | 13:30 ||
| Date | AM/PM hh:mm | d | 01:30 PM ||
| Date | AM/PM h:mm | d | 1:30 PM ||
| Date | AM/PM h:mm:ss | d | 1:30:30 PM ||
| Date | MM-dd AM/PM hh:mm | d | Next 08-05 01:30 PM ||
| <br><br><br>**Currency Format** | | | | |
| Currency: RMB | "¥" 0.00 | n | ¥ 123.00 | Also supports ¥ #.00 or ¥0.00|
| Currency: US Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: Euro | "€" 0.00 | n | € 123.00 ||
| Currency: British Pound | "£" 0.00 | n | £ 123.00 ||
| Currency: Hong Kong Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: Japanese Yen | "¥" 0.00 | n | ¥123.00 ||
| Currency: Albanian Lek | "Lek" 0.00 | n | Lek 123.00 ||
| Currency: Algerian Dinar | "din" 0.00 | n | din 123.00 ||
| Currency: Afghani | "Af" 0.00 | n | Af 123.00 ||
| Currency: Argentine Peso | "$" 0.00 | n | $ 123.00 ||
| Currency: United Arab Emirates Dirham | "dh" 0.00 | n | dh 123.00 ||
| Currency: Aruban Florin | "Afl" 0.00 | n | Afl 123.00 ||
| Currency: Omani Rial | "Rial" 0.00 | n | Rial 123.00 ||
| Currency: Azerbaijani Manat | "?" 0.00 | n |? 123.00 ||
| Currency: Egyptian Pound | "£" 0.00 | n | £ 123.00 ||
| Currency: Ethiopian Birr | "Birr" 0.00 | n | Birr 123.00 ||
| Currency: Angolan Kwanza | "Kz" 0.00 | n | Kz 123.00 ||
| Currency: Australian Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: Macau Patacas | "MOP" 0.00 | n | MOP 123.00 ||
| Currency: Barbadian Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: Papua New Guinea Kina | "PGK" 0.00 | n | PGK 123.00 ||
| Currency: Bahamian Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: Pakistani Rupee | "Rs" 0.00 | n | Rs 123.00 ||
| Currency: Paraguayan Guarani | "Gs" 0.00 | n | Gs 123.00 ||
| Currency: Bahraini Dinar | "din" 0.00 | n | din 123.00 ||
| Currency: Panamanian Balboa | "B/" 0.00 | n | B/ 123.00 ||
| Currency: Brazilian Riyal | "R$" 0.00 | n | R$ 123.00 ||
| Currency: Belarusian ruble | "р" 0.00 | n | р 123.00 ||
| Currency: Bermudian Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: Bulgarian Lev | "lev" 0.00 | n | lev 123.00 ||
| Currency: Iceland Krona | "kr" 0.00 | n | kr 123.00 ||
| Currency: Bosnia and Herzegovina convertible mark | "KM" 0.00 | n | KM 123.00 ||
| Currency: Polish Zloty | "z?" 0.00 | n | z? 123.00 ||
| Currency: Boliviano | "Bs" 0.00 | n | Bs 123.00 ||
| Currency: Belize Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: Botswana Pula | "P" 0.00 | n | P 123.00 ||
| Currency: Bhutan Nusam | "Nu" 0.00 | n | Nu 123.00 ||
| Currency: Burundian Franc | "FBu" 0.00 | n | FBu 123.00 ||
| Currency: North Korean Won | "?KP" 0.00 | n | ?KP 123.00 ||
| Currency: Danish Krone | "kr" 0.00 | n | kr 123.00 ||
| Currency: East Caribbean Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: Dominican Peso | "RD$" 0.00 | n | RD$ 123.00 ||
| Currency: Russian ruble | "?" 0.00 | n |? 123.00 ||
| Currency: Eritrean Nakfa | "Nfk" 0.00 | n | Nfk 123.00 ||
| Currency: CFA franc | "CFA" 0.00 | n | CFA 123.00 ||
| Currency: Philippine Peso | "?" 0.00 | n |? 123.00 ||
| Currency: Fijian Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: Cape Verde Escudo | "CVE" 0.00 | n | CVE 123.00 ||
| Currency: Falkland Islands Pound | "£" 0.00 | n | £ 123.00 ||
| Currency: Gambia Dalasi | "GMD" 0.00 | n | GMD 123.00 ||
| Currency: Congolese Franc | "FrCD" 0.00 | n | FrCD 123.00 ||
| Currency: Colombian Peso | "$" 0.00 | n | $ 123.00 ||
| Currency: Costa Rican Colon | "?" 0.00 | n |? 123.00 ||
| Currency: Cuban Peso | "$" 0.00 | n | $ 123.00 ||
| Currency: Cuban Convertible Peso | "$" 0.00 | n | $ 123.00 ||
| Currency: Guyana Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: Kazakhstan tenge | "?" 0.00 | n |? 123.00 ||
| Currency: Haitian Gourde | "HTG" 0.00 | n | HTG 123.00 ||
| Currency: Korean Won | "?" 0.00 | n |? 123.00 ||
| Currency: Netherlands Antilles Guild | "NAf." 0.00 | n | NAf. 123.00 ||
| Currency: Honduras Lalempira | "L" 0.00 | n | L 123.00 ||
| Currency: Djiboutian Franc | "Fdj" 0.00 | n | Fdj 123.00 ||
| Currency: Kyrgyzstan Som | "KGS" 0.00 | n | KGS 123.00 ||
| Currency: Guinean Franc | "FG" 0.00 | n | FG 123.00 ||
| Currency: Canadian Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: Ghanaian Cedi | "GHS" 0.00 | n | GHS 123.00 ||
| Currency: Cambodian Riel | "Riel" 0.00 | n | Riel 123.00 ||
| Currency: Czech Koruna | "K?" 0.00 | n | K? 123.00 ||
| Currency: Zimbabwe dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: Qatari Rial | "Rial" 0.00 | n | Rial 123.00 ||
| Currency: Cayman Islands Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: Comorian Franc | "CF" 0.00 | n | CF 123.00 ||
| Currency: Kuwaiti Dinar | "din" 0.00 | n | din 123.00 ||
| Currency: Croatian Kuna | "kn" 0.00 | n | kn 123.00 ||
| Currency: Kenyan Shilling | "Ksh" 0.00 | n | Ksh 123.00 ||
| Currency: Lesotho Loti | "LSL" 0.00 | n | LSL 123.00 ||
| Currency: Lao Kip | "?" 0.00 | n |? 123.00 ||
| Currency: Lebanese Pound | "L£" 0.00 | n | L£ 123.00 ||
| Currency: Lithuanian Litas | "Lt" 0.00 | n | Lt 123.00 ||
| Currency: Libyan Dinar | "din" 0.00 | n | din 123.00 ||
| Currency: Libyan Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: Rwandan franc | "RF" 0.00 | n | RF 123.00 ||
| Currency: Romanian Lei | "RON" 0.00 | n | RON 123.00 ||
| Currency: Madagascar Ariary | "Ar" 0.00 | n | Ar 123.00 ||
| Currency: Maldivian Rufiyaa | "Rf" 0.00 | n | Rf 123.00 ||
| Currency: Malawian Kwacha | "MWK" 0.00 | n | MWK 123.00 ||
| Currency: Malaysian Ringgit | "RM" 0.00 | n | RM 123.00 ||
| Currency: Macedonian Dinar | "din" 0.00 | n | din 123.00 ||
| Currency: Mauritian Rupee | "MURs" 0.00 | n | MURs 123.00 ||
| Currency: Mauritania Ouguiya | "MRO" 0.00 | n | MRO 123.00 ||
| Currency: Mongolian Tugrik | "?" 0.00 | n |? 123.00 ||
| Currency: Bangladeshi Taka | "?" 0.00 | n |? 123.00 ||
| Currency: Peruvian New Sol | "S/" 0.00 | n | S/ 123.00 ||
| Currency: Myanmar Kyat | "K" 0.00 | n | K 123.00 ||
| Currency: Moldovan Lei | "MDL" 0.00 | n | MDL 123.00 ||
| Currency: Moroccan Dirham | "dh" 0.00 | n | dh 123.00 ||
| Currency: Mozambique Metical | "MTn" 0.00 | n | MTn 123.00 ||
| Currency: Mexican Peso | "$" 0.00 | n | $ 123.00 ||
| Currency: Namibian Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: South African Rand | "R" 0.00 | n | R 123.00 ||
| Currency: South Sudanese Pound | "£" 0.00 | n | £ 123.00 ||
| Currency: Nicaragua Cordoba | "C$" 0.00 | n | C$ 123.00 ||
| Currency: Nepalese Rupee | "Rs" 0.00 | n | Rs 123.00 ||
| Currency: Nigerian Naira | "?" 0.00 | n |? 123.00 ||
| Currency: Norwegian Krone | "kr" 0.00 | n | kr 123.00 ||
| Currency: Georgia Lari | "GEL" 0.00 | n | GEL 123.00 ||
| Currency: RMB (Offshore) | "¥" 0.00 | n | ¥123.00 ||
| Currency: Swedish Krona | "kr" 0.00 | n | kr 123.00 ||
| Currency: Swiss Franc | "CHF" 0.00 | n | CHF 123.00 ||
| Currency: Serbian Dinar | "din" 0.00 | n | din 123.00 ||
| Currency: Sierra Leone Leone | "SLL" 0.00 | n | SLL 123.00 ||
| Currency: Seychelles Rupee | "SCR" 0.00 | n | SCR 123.00 ||
| Currency: Saudi Riyal | "Rial" 0.00 | n | Rial 123.00 ||
| Currency: Sao Tome Dobra | "Db" 0.00 | n | Db 123.00 ||
| Currency: St. Helena Pound | "£" 0.00 | n | £ 123.00 ||
| Currency: Sri Lankan Rupee | "Rs" 0.00 | n | Rs 123.00 ||
| Currency: Swaziland Lilangeni | "SZL" 0.00 | n | SZL 123.00 ||
| Currency: Sudanese Pound | "SDG" 0.00 | n | SDG 123.00 ||
| Currency: Surinamese Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: Solomon Islands Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: Somali Shilling | "SOS" 0.00 | n | SOS 123.00 ||
| Currency: Tajikistani Somoni | "Som" 0.00 | n | Som 123.00 ||
| Currency: Pacific Franc | "FCFP" 0.00 | n | FCFP 123.00 ||
| Currency: Thai Baht | "?" 0.00 | n |? 123.00 ||
| Currency: Tanzanian Shilling | "TSh" 0.00 | n | TSh 123.00 ||
| Currency: Tongan Paanga | "T$" 0.00 | n | T$ 123.00 ||
| Currency: Trinidad and Tobago Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: Tunisian Dinar | "din" 0.00 | n | din 123.00 ||
| Currency: Turkish Lira | "?" 0.00 | n |? 123.00 ||
| Currency: Vanuatu Vatu | "VUV" 0.00 | n | VUV 123.00 ||
| Currency: Guatemalan Quetzal | "Q" 0.00 | n | Q 123.00 ||
| Currency: Venezuelan Bolivar | "Bs" 0.00 | n | Bs 123.00 ||
| Currency: Brunei Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: Ugandan Shilling | "UGX" 0.00 | n | UGX 123.00 ||
| Currency: Ukrainian Hryvnia | "грн." 0.00 | n | грн. 123.00 ||
| Currency: Uruguayan Peso | "$" 0.00 | n | $ 123.00 ||
| Currency: Uzbekistani Sum | "so?m" 0.00 | n | so?m 123.00 ||
| Currency: Western Samoa Tala | "WST" 0.00 | n | WST 123.00 ||
| Currency: Singapore Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: New Taiwan Dollar | "NT$" 0.00 | n | NT$ 123.00 ||
| Currency: New Zealand Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: Hungarian Forint | "Ft" 0.00 | n | Ft 123.00 ||
| Currency: Syrian Pound | "£" 0.00 | n | £ 123.00 ||
| Currency: Jamaican Dollar | "$" 0.00 | n | $ 123.00 ||
| Currency: Armenian Dram | "Dram" 0.00 | n | Dram 123.00 ||
| Currency: Yemeni Rial | "Rial" 0.00 | n | Rial 123.00 ||
| Currency: Iraqi Dinar | "din" 0.00 | n | din 123.00 ||
| Currency: Iranian Rial | "Rial" 0.00 | n | Rial 123.00 ||
| Currency: Israeli New Shekel | "?" 0.00 | n |? 123.00 ||
| Currency: Indian Rupee | "?" 0.00 | n |? 123.00 ||
| Currency: Indonesian Rupiah | "Rp" 0.00 | n | Rp 123.00 ||
| Currency: Jordanian Dinar | "din" 0.00 | n | din 123.00 ||
| Currency: Vietnamese Dong | "?" 0.00 | n |? 123.00 ||
| Currency: Zambian Kwacha | "ZMW" 0.00 | n | ZMW 123.00 ||
| Currency: Gibraltar Pound | "£" 0.00 | n | £ 123.00 ||
| Currency: Chilean Peso | "$" 0.00 | n | $ 123.00 ||
| Currency: China-Africa Financial Cooperation Franc | "FCFA" 0.00 | n | FCFA 123.00 ||
Notice: Import/export only considers the data style that the user sees. For example, the way to process the date format in excel is to convert the date into a number: 42736 represents 2017-1-1.
File diff suppressed because it is too large Load Diff
+221
View File
@@ -0,0 +1,221 @@
# Contribution guide
welcome! We are very happy that you are here and look forward to your interest in participating in Luckysheet contributions. Of course, before you participate in the Luckysheet contribution, please make sure to read the following full text:
## Our code of conduct
1. We promise to respect all those who participated in the contribution, not limited to those who raised questions, contributed documents and code, resolved bugs and other contributions;
2. We are obliged to abide by local laws and regulations, and we reject all behaviors with legal risks;
3. We oppose any participant's derogatory comments, personal attacks, harassment or insult to others, and other non-professional behaviors;
4. We have the right and responsibility to delete or edit content that does not comply with this code of conduct, not limited to code, issues, wikis, documents and others. Participants who do not comply with the code of conduct may be removed from the team;
5. We accept the supervision of anyone, and anyone can report to us the facts that are found to be inconsistent with this code of conduct through problem feedback.
## How to participate in contributing?
* Contributed documents: Browsing the document can deepen your understanding of Luckysheet. Once you find that the document is not clearly written or the logic is confusing, you can correct, modify, and supplement. You can go to [Google Forum](https://groups.google.com/g/luckysheet) to give feedback
* Contributing code: Welcome everyone to contribute code to the Luckysheet community, you are welcome to claim the Open state [Issues](https://github.com/mengshukeji/Luckysheet/issues) and unfinished features, submit a PR, and become one of the contributors If you find that some functions cannot meet your needs or have problems during use, please record in Issues
* Participate in the issue discussion: you can post your suggestions under any [Issues](https://github.com/mengshukeji/Luckysheet/issues)
* Review code: You can see PR submitted by all contributors on [Github](https://github.com/mengshukeji/Luckysheet), you can review their code and post your suggestions
## How to submit issues
Before you submit features/improvements, you should pay attention to the following points:
* Please confirm whether the feature/improvement has been submitted by others
* An easy-to-understand title to explain the bug/submission feature/improvement you submitted
* If it is a bug, describe the cause of the bug in detail. If it can be reproduced, please try to provide complete reproduction steps
* If it is a feature, then the feature should have wide applicability, suitable for most users, and it is best to provide detailed design documents
* If it is an improvement, describe the benefits of this improvement as clearly as possible
Specific steps:
* Create [Issues](https://github.com/mengshukeji/Luckysheet/issues) and describe the issue clearly
* If you want to solve the issue, assign the issue to your own name. If you just submit a bug/feature/improvement and dont have time to contribute code, set assignne to empty
* If it is a relatively large feature/improvement, try to output the design document first and follow the [Luckysheet RFC](https://github.com/mengshukeji/Luckysheet-rfcs) process for others to review
## How to claim Issues
In Luckysheet's [Issues](https://github.com/mengshukeji/Luckysheet/issues) list, there are many issues created by others that have not been repaired. If you are interested, you can claim these issues. The steps to claim are as follows:
* Leave a message under the issue, express the idea of claiming the task, and specify **@I can solve it**
* If the submitter has no comments, assign the issue to your own name and update the progress in time
* If it is a relatively large feature, try to output the design document first and follow the [Luckysheet RFC](https://github.com/mengshukeji/Luckysheet-rfcs) process for others to review
* Develop the code and submit the code to github
## How to submit code
1. Fork to own warehouse
Go to the Github page of [Luckysheet](https://github.com/mengshukeji/Luckysheet), and click the Fork button in the upper right corner to proceed.
2. Git clone to local
```shell
git clone https://github.com/<your_github_name>/Luckysheet.git
```
3. Establish a connection upstream
```shell
cd Luckysheet
gitremote add upstream https://github.com/mengshukeji/Luckysheet.git
```
4. Create a development branch
```shell
git checkout -b dev
```
5. Modify the submission code
```shell
git add.
npm run commit
git push origin dev
```
6. Sync code, synchronize the latest code to the local
```shell
git fetch upstream
git rebase upstream/master
```
7. If there is a conflict (nothing can be ignored)
```shell
git status # View conflict files and modify conflicts
git add.
git rebase --continue
```
When submitting the git rebase --continue command, if vim prompts to edit the commit information, you can add your changes, then save and exit
> For vim commands, please refer to the [vim](https://www.runoob.com/linux/linux-vim.html)
8. Submit branch code
```shell
git push origin dev
```
If you are prompted to pull first, you can pull it before submitting
```shell
git pull origin dev
git push origin dev
```
If the vim prompt to edit the commit information pops up, you can exit directly through the vim command
> For vim commands, please refer to [vim](https://www.runoob.com/linux/linux-vim.html)
9. Submit pr
Go to the fork project in your github warehouse, switch to the branch you just created and modified, click new pull request, and add the corresponding description, and finally click Create pull request to submit
## Code Specification
> General code specification example
* Keep the block depth to a minimum. Avoid nested If conditions as much as possible
```js
// CORRECT
if (!comparison) return
if (variable) {
for (const item of items) {}
} else if (variable2) {
// Do something here
}
// INCORRECT
if (comparison) {
if (variable) {
for (const item in items) {}
} else if (variable2) {
// Do something here
}
} else {
return
}
```
* Do not use operands for chain comparison
```js
// CORRECT
if (cb) cb()
if (!cb || (cb === fn)) cb()
// INCORRECT
cb && cb()
(!cb || (cb === fn)) && cb()
```
* All variables should be declared at the beginning of the block in alphabetical order
```js
// CORRECT
function foo () {
const foo ='bar'
const bar ='foo'
if (conditional) {}
...
return foo
}
// INCORRECT
function foo () {
const foo ='bar'
if (conditional) {}
const bar ='foo'
...
return foo
}
```
* Return as soon as possible
```js
// CORRECT
if (condition) return'foo'
if (condition2) return'bar'
// Return must have a blank line above
return'fizz'
// INCORRECT
const variable =''
if (condition) {
variable ='foo'
} else if (condition2) {
variable ='bar'
} else {
variable ='fizz'
}
return variable
```
## How to contribute documents
## How to become Luckysheet Committer
As long as anyone contributes to the Luckysheet project, you are the officially recognized Contributor of the Luckysheet project. There is no exact standard for growing from Contributor to Committer, and there is no expected timetable, but Committer candidates are generally A long-term active contributor, becoming Committer does not require a huge architectural improvement contribution, or how many lines of code contributions, contributing code, contributing documents, participating in mailing list discussions, helping to answer questions, etc., are all ways to increase their influence .
List of potential contributions (in no particular order):
* Submit the bugs, features, and improvements you found to the issue
* Update the official documents so that the project documents are the most recent, the best practices for writing Luckysheet, and various useful documents for the users
* Perform test and report test results, performance test and other MQ performance comparison test, etc.
* Review the work of others (including code and non-code) and publish your own suggestions
* Guide new contributors and be familiar with the community process
* Post a blog about Luckysheet
* Any contribution to the development of the Luckysheet community
* ......
+809
View File
@@ -0,0 +1,809 @@
# Table Data
## Get table data
- **Configuration**
Configure the address of `updateUrl`, Luckysheet will request the table data through ajax. By default, all `data` in the sheet data with status 1 is loaded, and the rest of the sheet loads all fields except the `data` field.
- **Format**
Through the global method `luckysheet.getluckysheetfile()`, the configuration information of all worksheets can be obtained.
The luckysheetfile example is as follows:
```json
[
{
"name": "Cell", //Worksheet name
"color": "", //Worksheet color
"index": "0", //Worksheet index
"status": "1", //Activation status
"order": "0", //The order of the worksheet
"hide": 0,//whether to hide
"row": 36, //number of rows
"column": 18, //Number of columns
"config": {
"merge":{}, //merged cells
"rowlen":{}, //Table row height
"columnlen":{}, //Table column width
"rowhidden":{}, //hidden rows
"colhidden":{}, //hidden columns
"borderInfo":{}, //borders
},
"celldata": [], //initialize the cell data
"data": [], //Update and store the cell data
"scrollLeft": 0, //Left and right scroll bar position
"scrollTop": 315, //Up and down scroll bar position
"luckysheet_select_save": [], //selected area
"luckysheet_conditionformat_save": {},//Conditional format
"calcChain": [],//Formula chain
"isPivotTable":false,//Whether to pivot table
"pivotTable":{},//Pivot table configuration
"filter_select": null,//Filter range
"filter": null,//Filter configuration
"luckysheet_alternateformat_save": [], //Alternate colors
"luckysheet_alternateformat_save_modelCustom": [], //Customize alternate colors
"chart": [], //Chart configuration
"visibledatarow": [], //The position of all rows
"visibledatacolumn": [], //The position of all columns
"ch_width": 2322, //The width of the worksheet area
"rh_height": 949, //The height of the worksheet area
},
{
"name": "Sheet2",
"color": "",
"status": "0",
"order": "1",
"data": [],
"config": {},
"index": 1
},
{
"name": "Sheet3",
"color": "",
"status": "0",
"order": "2",
"data": [],
"config": {},
"index": 2
}
]
```
- **Explanation**
## name
- TypeString
- Default"Sheet1"
- UsageWorksheet name
------------
## color
- TypeString
- Default"##f20e0e"
- UsageWorksheet color, there will be a bottom border under the worksheet name
------------
## index
- TypeNumber
- Default0
- UsageWorksheet index, starting from 0
------------
## status
- TypeNumber
- Default1
- UsageActive state, there is only one active worksheet which number will be 1 and the other worksheets are 0
------------
## order
- TypeNumber
- Default0
- Usage The index of the worksheets is starting from 0. it will increase when a worksheet is added.
------------
## hide
- TypeNumber
- Default0
- Usage Whether to hide, `0` means not to hide, `1` means to hide
------------
## row
- TypeNumber
- Default36
- Usage The number of cell rows
------------
## column
- TypeNumber
- Default18
- Usage The number of cell columns
------------
## scrollLeft
- TypeNumber
- Default0
- Usage Left and right scroll bar position
------------
## scrollTop
- TypeNumber
- Default0
- Usage Up and down scroll bar position
------------
## config
- Type: Object
- Default: {}
- Usage: Table row height, column width, merged cells, borders, hidden rows and other settings
### config.merge
- TypeObject
- Default{}
- UsageMerge cell settings
- example:
```js
{
"13_5": {
"r": 13,
"c": 5,
"rs": 3,
"cs": 1
},
"13_7": {
"r": 13,
"c": 7,
"rs": 3,
"cs": 2
},
"14_2": {
"r": 14,
"c": 2,
"rs": 1,
"cs": 2
}
}
```
The `key` in the object is the spliced value of `r +'_' + c`, and the `value` is the cell information in the upper left corner: r: number of rows, c: number of columns, rs: number of merged rows, cs: merge Number of columns
### config.rowlen
- TypeObject
- Default{}
- UsageThe row height of each cell
- example:
```js
"rowlen": {
"0": 20,
"1": 20,
"2": 20
}
```
### config.columnlen
- TypeObject
- Default{}
- UsageThe column width of each cell
- example:
```js
"columnlen": {
"0": 97,
"1": 115,
"2": 128
}
```
### config.rowhidden
- TypeObject
- Default{}
- UsageHidden row information, Rows`rowhidden[Rows]: 0`,
you should specify the number of rows by `key`,`value` is always `0`
- example:
```js
"rowhidden": {
"30": 0,
"31": 0
}
```
### config.colhidden
- TypeObject
- Default{}
- UsageHidden column information, Columns`colhidden[Columns]: 0`,
`key` specify the number of columns,`value` is always `0`
- example:
```js
"colhidden": {
"30": 0,
"31": 0
}
```
### config.borderInfo
- TypeArray
- Default{}
- UsageThe border information of the cell
- example:
```js
"borderInfo": [{
"rangeType": "cell",
"value": {
"row_index": 3,
"col_index": 3,
"l": {
"style": 10,
"color": "rgb(255, 0, 0)"
},
"r": {
"style": 10,
"color": "rgb(255, 0, 0)"
},
"t": {
"style": 10,
"color": "rgb(255, 0, 0)"
},
"b": {
"style": 10,
"color": "rgb(255, 0, 0)"
}
}
},
{
"rangeType": "range",
"borderType": "border-all",
"style": "3",
"color": "#0000ff",
"range": [{
"row": [7, 8],
"column": [2, 3]
}]
}, {
"rangeType": "range",
"borderType": "border-inside",
"style": "3",
"color": "#0000ff",
"range": [{
"row": [7, 8],
"column": [8, 9]
}]
}]
```
The range type can be divided into single cell and selected area
1. selection `rangeType: "range"`
+ Border type `borderType"border-left" | "border-right" | "border-top" | "border-bottom" | "border-all" | "border-outside" | "border-inside" | "border-horizontal" | "border-vertical" | "border-none"`,
+ Border thickness `style: 1 Thin | 2 Hair | 3 Dotted | 4 Dashed | 5 DashDot | 6 DashDotDot | 7 Double | 8 Medium | 9 MediumDashed | 10 MediumDashDot | 11 MediumDashDotDot | 12 SlantedDashDot | 13 Thick`
+ Border color `color: Hexadecimal color value`
+ Selection area `range: Row and column information array`
2. Single cell `rangeType"cell"`
+ Number of rows and columns `value.row_index: number,value.col_index: number`
+ Four border objects `value.l:Left border,value.r:Right border,value.t:Top border,value.b:Bottom border`
+ Border thickness `value.l.style: 1 Thin | 2 Hair | 3 Dotted | 4 Dashed | 5 DashDot | 6 DashDotDot | 7 Double | 8 Medium | 9 MediumDashed | 10 MediumDashDot | 11 MediumDashDotDot | 12 SlantedDashDot | 13 Thick`
+ Border color `value.l.color: Hexadecimal color value`
- 示例
+ ```js
{
"rangeType": "range",
"borderType": "border-all",
"style": "3",
"color": "#0000ff",
"range": [{
"row": [7, 8],
"column": [2, 3]
}]
}
```
Represents a selection with a setting range of `{"row": [7, 8], "column": [2, 3]}`, the type is all borders, the border thickness is `Dotted`, and the color is `"#0000ff"`
+ ```js
{
"rangeType": "cell",
"value": {
"row_index": 3,
"col_index": 3,
"l": {
"style": 10,
"color": "rgb(255, 0, 0)"
},
"r": {
"style": 10,
"color": "rgb(255, 0, 0)"
},
"t": {
"style": 10,
"color": "rgb(255, 0, 0)"
},
"b": {
"style": 10,
"color": "rgb(255, 0, 0)"
}
}
}
```
Means to set the cell `"D4"`, the upper border/lower border/left border/right border are all border thicknesses `"MediumDashDot"`, color is `"rgb(255, 0, 0)"`
------------
## celldata
- TypeArray
- Default[]
- Usage The original cell data set is a set containing `{r:0,c:0,v:{m:"value",v:"value",ct: {fa: "General", t: "g"}} }`The one-dimensional array of format cell information is only used during initialization. After the table is initialized with celldata, the data is converted to the same level field data in the luckysheetfile, such as `luckysheetfile[0].data`, the subsequent operation of the table Data update will be updated to this data field, and celldata is no longer used. Example:
```js
[{
"r": 0,
"c": 0,
"v": {
ct: {fa: "General", t: "g"},
m:"value1",
v:"value1"
}
}, {
"r": 0,
"c": 1,
"v": {
ct: {fa: "General", t: "g"},
m:"value2",
v:"value2"
}
}]
```
------------
## luckysheet_select_save
- TypeArray
- Default[]
- Usage The selected area supports multiple selections and is a one-dimensional array containing multiple selection objects. Example:
```js
[
{
"left": 0,
"width": 97,
"top": 0,
"height": 20,
"left_move": 0,
"width_move": 97,
"top_move": 0,
"height_move": 41,
"row": [ 0, 1 ],
"column": [ 0, 0 ],
"row_focus": 0,
"column_focus": 0
},
{
"left": 98,
"width": 73,
"top": 63,
"height": 20,
"left_move": 98,
"width_move": 189,
"top_move": 63,
"height_move": 41,
"row": [ 3, 4 ],
"column": [ 1, 2 ],
"row_focus": 3,
"column_focus": 1
},
{
"left": 288,
"width": 128,
"top": 21,
"height": 20,
"left_move": 288,
"width_move": 128,
"top_move": 21,
"height_move": 62,
"row": [ 1, 3 ],
"column": [ 3, 3 ],
"row_focus": 1,
"column_focus": 3
}
]
```
------------
## luckysheet_conditionformat_save
- TypeArray
- Default[]
- Usage Conditional format configuration information, a one-dimensional array containing multiple conditional format configuration objects,
type: "default": Highlight cell rules and project selection rules,
"dataBar": Data bar,
"icons": Icon set,
"colorGradation": Color scale
Example:
```js
[
{
"type": "default",
"cellrange": [
{
"row": [ 2, 7 ],
"column": [ 2, 2 ]
}
],
"format": {
"textColor": "#000000",
"cellColor": "#ff0000"
},
"conditionName": "betweenness",
"conditionRange": [
{
"row": [ 4, 4 ],
"column": [ 2, 2 ]
},
{
"row": [ 6, 6 ],
"column": [ 2, 2 ]
}
],
"conditionValue": [ 2, 4
]
},
{
"type": "dataBar",
"cellrange": [
{
"row": [ 10, 15 ],
"column": [ 10, 11 ]
}
],
"format": [
"#6aa84f",
"#ffffff"
]
},
{
"type": "icons",
"cellrange": [
{
"row": [ 19, 23 ],
"column": [ 2, 2 ]
}
],
"format": {
"len": "3",
"leftMin": "0",
"top": "0"
}
},
{
"type": "colorGradation",
"cellrange": [
{
"left": 422,
"width": 100,
"top": 210,
"height": 20,
"left_move": 422,
"width_move": 100,
"top_move": 210,
"height_move": 125,
"row": [ 10, 15 ],
"column": [ 6, 6 ],
"row_focus": 10,
"column_focus": 6
}
],
"format": [
"rgb(99, 190, 123)",
"rgb(255, 235, 132)",
"rgb(248, 105, 107)"
]
}
]
```
------------
## calcChain
- TypeArray
- Default[]
- UsageFormula chain, used when the cell linked by the formula is changed, all formulas referencing this cell will be refreshed, example:
```js
[{
"r": 6,
"c": 3,
"index": 1,
"func": [true, 23.75, "=AVERAGE(D3:D6)"],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
}, {
"r": 7,
"c": 3,
"index": 1,
"func": [true, 30, "=MAX(D3:D6)"],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
}]
```
------------
## isPivotTable
- TypeBoolean
- Defaultfalse
- Usage Whether PivotTable
------------
## pivotTable
- TypeObject
- Default{}
- Usage Pivot table settings, example:
```js
{
"pivot_select_save": {
"left": 0,
"width": 73,
"top": 0,
"height": 19,
"left_move": 0,
"width_move": 369,
"top_move": 0,
"height_move": 259,
"row": [0, 12],
"column": [0, 4],
"row_focus": 0,
"column_focus": 0
},
"pivotDataSheetIndex": 6, //The sheet index where the source data is located
"column": [{
"index": 3,
"name": "subject",
"fullname": "subject"
}],
"row": [{
"index": 1,
"name": "student",
"fullname": "student"
}],
"filter": [],
"values": [{
"index": 4,
"name": "score",
"fullname": "count:score",
"sumtype": "COUNTA",
"nameindex": 0
}],
"showType": "column",
"pivotDatas": [
["count:score", "science", "mathematics", "foreign language", "English", "total"],
["Alex", 1, 1, 1, 1, 4],
["Joy", 1, 1, 1, 1, 4],
["Tim", 1, 1, 1, 1, 4],
["total", 3, 3, 3, 3, 12]
],
"drawPivotTable": false,
"pivotTableBoundary": [5, 6]
}
```
------------
## filter_select
- TypeObject
- Default{}
- UsageFilter range, a selection area, a sheet has only one filter range, similar to the `luckysheet_select_save` example:
```js
{
"left": 74,
"width": 73,
"top": 40,
"height": 19,
"left_move": 74,
"width_move": 221,
"top_move": 40,
"height_move": 99,
"row": [
2,
6
],
"column": [
1,
3
],
"row_focus": 2,
"column_focus": 1
}
```
------------
## filter
- TypeObject
- Default{}
- Usage Specific settings for filtering, examples:
```js
{
"0": {
"caljs": {},
"rowhidden": {
"3": 0,
"4": 0
},
"optionstate": true,
"str": 2,
"edr": 6,
"cindex": 1,
"stc": 1,
"edc": 3
},
"1": {
"caljs": {},
"rowhidden": {
"6": 0
},
"optionstate": true,
"str": 2,
"edr": 6,
"cindex": 2,
"stc": 1,
"edc": 3
}
}
```
------------
## luckysheet_alternateformat_save
- TypeArray
- Default[]
- Usage Alternating color configuration, example:
```js
[{
"cellrange": {
"row": [1, 6],
"column": [1, 5]
},
"format": {
"head": {
"fc": "#000",
"bc": "#5ed593"
},
"one": {
"fc": "#000",
"bc": "#ffffff"
},
"two": {
"fc": "#000",
"bc": "#e5fbee"
},
"foot": {
"fc": "#000",
"bc": "#a5efcc"
}
},
"hasRowHeader": false,
"hasRowFooter": false
}, {
"cellrange": {
"row": [1, 6],
"column": [8, 12]
},
"format": {
"head": {
"fc": "#000",
"bc": "#5599fc"
},
"one": {
"fc": "#000",
"bc": "#ffffff"
},
"two": {
"fc": "#000",
"bc": "#ecf2fe"
},
"foot": {
"fc": "#000",
"bc": "#afcbfa"
}
},
"hasRowHeader": false,
"hasRowFooter": false
}]
```
------------
## luckysheet_alternateformat_save_modelCustom
- TypeArray
- Default[]
- UsageCustom alternate colors, including multiple custom alternate colors configuration, example:
```js
[{
"head": {
"fc": "#6aa84f",
"bc": "#ffffff"
},
"one": {
"fc": "#000",
"bc": "#ffffff"
},
"two": {
"fc": "#000",
"bc": "#e5fbee"
},
"foot": {
"fc": "#000",
"bc": "#a5efcc"
}
}]
```
------------
## chart
- TypeArray
- Default[]
- Usage Chart configuration (under development)
------------
## visibledatarow
- TypeNumber
- Default[]
- Usage Position information of all rows, incremental row position data, No need to set up for initialization
------------
## visibledatacolumn
- TypeNumber
- Default[]
- Usage Position information of all columns, incremental column position data, No need to set up for initialization
------------
## ch_width
- TypeNumber
- Default2322
- UsageThe width of the entire worksheet area (the gray area including the border), No need to set up for initialization
------------
## rh_height
- TypeNumber
- Default2322
- UsageThe height of the entire worksheet area (the gray area containing the border), No need to set up for initialization
------------
## Get sheet data
- **Configuration**
Configure the address of `loadSheetUrl`, the parameters are `gridKey` (table primary key) and `index` (sheet primary key collection, format is `[1,2,3]`), the returned data is the `data` field set of sheet
- **Format**
```json
{
"1": [{r:0, c:1, v:"value 1"},{r:10, c:11, v:"value 2"}],
"2": [data],
"3": [data],
}
```
- **Explanation**
`r` stands for row, `c` stands for column, and `v` stands for the value of the cell. The value can be a character, number, or json string.
The data will only be loaded once, generally speaking, there is only one primary key, but considering that some formulas, charts and pivot tables will refer to the data of other sheets, the front desk will add a judgment, if the current sheet refers to the data of other sheets, then complete the data of the referenced sheet together.
## Update data
- **Configuration**
Configure the address of `updateUrl`, and the parameter sent to the backend is a json string.
- **Format**
```json
{
compress: false,
gridKey:10004,
data: [update data]
}
```
- **Explanation**
| Parameter | Explanation | Example |
| ------------ | ------------ | ------------ |
| compress | Luckysheet uses client pako for zlib parameter compression, which is true if the browser supports compression, otherwise false. The backend can decide whether to decompress the data content based on this parameter | The process of obtaining parameters on the server side: 1. Serialize json string 2. Decode the data field if the compress field is TRUE 3. Decode the data string URLDecoder.decode(utf-8) |
| gridKey | Luckysheet file identifier | none |
| data | An array containing updated data. For the parameter format in the array, please see the introduction below. In the example: `t` indicates the update type, `i` is the index of the sheet, `c` is the row number, `r` is the column number, and `v` is the value | `data: [{ t : 'cell', i:0, c : 0, r : 0 , v: 2 }]` |
+903
View File
@@ -0,0 +1,903 @@
# Table Operation
`luckysheet` stores all operations in the history to `undo` and `redo`. If `allowupdate` is set to true and `updateURL` is available in initial, operations will be updated on the backend in real-time via webSocket. And every one can edit same sheet on the same time.
>Source code [`src/controllers/server.js`] (https://github.com/mengshukeji/Luckysheet/blob/master/src/controllers/server.js) The module shows us the function of background saving.
In general, shared editing(or collaborative editing) is controled by the account system created by developers to control permissions.
The following are all types of operations that support transferring to the background. In this case, I use mongodb as a storage example to explain how front-end and back-end interacts with eachother.
Pay attention, `i` in the object is the `index` of the sheet rather than `order`.
## Cell refresh
### single cell refresh
- **Format**
```json
{
"t": "v",
"i": "Sheet_0554kKiKl4M7_1597974810804",
"v": {
"v": 233,
"ct": { "fa": "General", "t": "n" },
"m": "233"
},
"r": 0,
"c": 1
}
```
- **Explanation**
|Parameter|Explanation|
| ------------ | ------------ |
|t|Operation type symbol|
|i|The index value of the current sheet|
|v|Cell value, refer to [单元格属性表](/zh/guide/cell.html#基本单元格)|
|r|Row number of cell|
|c|The column number of the cell|
- **Backend update**
The cell update is mainly to update the `luckysheetfile[i].celldata` parameter, which is an array:
```json
[
{r:0, c:1, v: "value1"},
{r:10, c:11, v:"value2"},
{r:10, c:11, v:{f:"=sum", v:"100"}}
]
```
Store the values in all the cells in the sheet, Luckysheet will create a new table data according to the number of rows and columns in `luckysheetfile[i].row` and `luckysheetfile[i].column` when it is created, and then use `data[ r][c]=v` to fill the table data, empty data cells are represented by null.
When saving the data posted by the frontend, the backend needs to convert the parameters to the format of `{r:0, c:1:v:100}` first, and then update the field of `luckysheetfile[i].celldata`, if the cell exists the cell is updated, if not, it is added, and if the cell exists but `v` is null, the cell is deleted.
- **Frontend view**
You can modify the value of any cell, and then go to the chrome console to view the operation of `"t"=="v"`.
## Config operation
- **Format**
```json
{
"t": "cg",
"i": 3,
"v": {
"7": 192
},
"k": "rowlen"
}
```
- **Explanation**
|Parameter|Explanation|
| ------------ | ------------ |
|t|Operation type symbol|
|i|The index value of the current sheet|
|v|The internal key-value that needs to be updated|
|k|Operation key name|
- **Backend update**
Update `luckysheetfile[i].config.[k][v.key] = v.value`, if `k` does not exist in `config`, then create a new `k` attribute and set it to empty, If there is no `v.key` in `k`, create a new `v.key` and update `v.value`.
1. Examples of modifying row height:
- Enter: `{"t":"cg","i":3,"v":{"3":10, "5":70, "10":100},"k":" rowlen"}`
- Update: `luckysheetfile[3].config.["rowlen"]["3"] = 10`
2. Examples of modifying column width:
- Enter: `{"t":"cg","i":1,"v":{"20":74, "15":170, "6":40},"k":" columnlen"}`
- Update: `luckysheetfile[1].config.["columnlen"]["20"] = 74`
3. Examples of merged cells:
- Enter: `{"t":"cg","i":1,"v":{"5_10":{row:[1,3], column:[3,5]},"k":" merge "}`
- Update: `luckysheetfile[1].config.["merge"]["5_10"] = {row:[1,3], column:[3,5]}`
## General save
- **Format**
```json
{
"t": "all",
"i": 3,
"v": {
"v": 1,
"m":1,
},
"k": "freezen",
"s": false
}
```
- **Explanation**
|Parameter|Explanation|
| ------------ | ------------ |
|t|Operation type symbol|
|i|The index value of the current sheet|
|v|The internal key-value that needs to be updated|
|k|The `value` in the key-value that needs to be saved|
|s|If it is `true` then `v` is saved as a string, otherwise it is saved according to the object|
- **Backend update**
`luckysheetfile[3].[k]= v`
If `s` is `true`, it is `luckysheetfile[3].[k]= JSON.stringify(v)`
1. Pivot table:
- Enter: `{"t":"all","i":1,"v":{………},"k":"pivotTable", "s": false}`
- Update: `luckysheetfile[1].["pivotTable"] = {………}`
2. Freeze rows and columns:
- Enter: `{"t":"all","i":3,"v":{………},"k":"freezen", "s": false}`
- Update: `luckysheetfile[3].["freezen"] = {………}`
3. Filter range:
- Enter: `{"t":"all","i":3,"v":{………},"k":"filter_select", "s": true }`
- Update: `luckysheetfile[3].["filter_select"] = JSON.stringify ({………})`
4. Sheet name:
- Enter: `{"t":"all","i":1,"v":"doc","k":"name", "s": false}`
- Update: `luckysheetfile[1].["name"] = "doc"`
5. Sheet color:
- Enter: `{"t":"all","i":2,"v":"#FFF000","k":"color", "s": false}`
- Update: `luckysheetfile[2].["color"] = "#FFF000"`
## Function chain operation
- **Format**
```json
{
"t": "fc",
"i": 0,
"v": {
"r": 3,
"c": 7,
"index": 0,
"func": [
true,
187282,
"=SUM(E4:G4)"
]
},
"op": "add",
"pos": 0
}
```
- **Explanation**
|Parameter|Explanation|
| ------------ | ------------ |
|t|Operation type symbol|
|i|The index value of the current sheet|
|v|Object value, the internal fields of the object do not need to be updated separately, so save as text|
|op|Operation type, `add` is add, `update` is update, and `del` is delete|
|pos|Updated or deleted function location|
- **Backend update**
calcChain is an array
- If the value of `op` is `add` then add to the end `luckysheetfile[i].calcChain.push (v)`
- If the value of `op` is `update` then update `luckysheetfile[i].calcChain[pos]= v`
- If the value of `op` is `del` then delete `luckysheetfile[i].calcChain.splice(pos, 1)`。
- **Frontend view**
You can modify the value of any cell, and then go to the chrome console to view the operation of `"t"=="v"`.
## Row and column operations
### Delete rows or columns
- **Format**
```json
{
"t": "drc",
"i": 3,
"v": {
"index": 6,
"len": 2
},
"rc": "r"
}
```
- **Explanation**
<table>
<tr>
<td colspan="2">Parameter</td>
<td>Explanation</td>
</tr>
<tr>
<td colspan="2">t</td>
<td>Operation type symbol</td>
</tr>
<tr>
<td colspan="2">i</td>
<td>The index value of the current sheet</td>
</tr>
<tr>
<td colspan="2">rc</td>
<td>Row operation or column operation, the value `r` stands for row, and `c` stands for column</td>
</tr>
<tr>
<td rowspan="2">v</td>
<td>index</td>
<td>Delete from which row or column</td>
</tr>
<tr>
<td>len</td>
<td>Number of rows or columns deleted</td>
</tr>
</table>
- **Backend update**
If the value of `rc` is `'r'` then delete the row, if the value of `rc` is `'c'` then delete the column, eg `rc='r'`, `index=4`, `len= 5`, means to delete the next 5 lines (4, 5, 6, 7, 8) from the 4th line.
Mainly operate on the cells in `luckysheetfile[i].celldata`, delete the qualified cells described in the parameters and update the row and column values of other cells. Taking the above as an example, first find the `r` in the cell Delete all the cells with values from 4 to 8, and then subtract the value of 5 from the original cell number 9 and later, and finally subtract 5 from `luckysheetfile[i].row`.
If the `v` value is `"#__qkdelete#"` (without quotes), then this is the cell to be deleted.
- **Front view**
You can delete rows or columns, and then go to the chrome console to view the operation of `"t"=="drc"`.
### Add rows or columns
- **Format**
```json
{
"t": "arc",
"i": 0,
"v": {
"index": 5,
"len": 10,
"data": []
},
"rc": "c"
}
```
- **Explanation**
<table>
<tr>
<td colspan="2">Parameter</td>
<td>Explanation</td>
</tr>
<tr>
<td colspan="2">t</td>
<td>Operation type symbol</td>
</tr>
<tr>
<td colspan="2">i</td>
<td>The index value of the current sheet</td>
</tr>
<tr>
<td colspan="2">rc</td>
<td>Row operation or column operation, the value `r` stands for row, and `c` stands for column</td>
</tr>
<tr>
<td rowspan="3">v</td>
<td>index</td>
<td>Start from which row or column</td>
</tr>
<tr>
<td>len</td>
<td>How many rows or columns to add</td>
</tr>
<tr>
<td>data</td>
<td>New row or column content</td>
</tr>
</table>
- **Backend update**
If the value of `rc` is `r`, add a new row. If the value of `rc` is `c`, add a new column. For example, `rc=r, index=4, len=5` then it means increase 5 lines from line 4. If `data` is empty, add an empty line. If `data` is not empty, use the array in `data` to add a new line.
Mainly operate on the cells in `luckysheetfile[i].celldata`. Taking the above as an example, first add 5 to `luckysheetfile[i].row`, and then add `r` greater than 4 to the entire cell`r `Value +5, if `data` is empty, add an empty line to end, if `data` is not empty, convert the two-dimensional array `data` to `{r:0,c:0,v:100}` Format and added to `celldata`, the pseudo code for conversion is as follows:
```javascript
var ret = [];
for(var r=0;r<data.length;r++){
for(var c=0;c<data[0].length;c++){
if(d[r][c]==null){
continue;
}
ret.push({r:r+5, c:c, v: data[r][c]});
}
}
return ret;
```
- **Front view**
You can add rows or columns, and then go to the chrome console to view the operation of `"t"=="arc"`. If you want to view the operation with the value of `data`, you can delete some rows or columns, and then undelete (Ctrl+Z), you can see.
## Filter operating
### Select filter condition
- **Format**
```json
{
"t": "f",
"i": 0,
"v": "{\"caljs\":{},\"selected\":{\"Qingdao\":\"1\",\"Guangxi\":\"1\",\"Chongqing\":\"1\"},\"rowhidden\":{\"1\":0,\"2\":0,\"3\":0,\"4\":0,\"6\":0,\"7\":0,\"8\":0,\"9\":0,\"10\":0,\"11\":0,\"12\":0,\"13\":0,\"14\":0,\"15\":0,\"16\":0,\"17\":0,\"18\":0,\"19\":0,\"21\":0,\"22\":0,\"24\":0,\"25\":0,\"26\":0,\"27\":0,\"28\":0,\"29\":0,\"30\":0,\"31\":0,\"32\":0,\"33\":0,\"34\":0,\"35\":0}}",
"op": "upOrAdd",
"pos": 1
}
```
- **Explanation**
|Parameter|Explanation|
| ------------ | ------------ |
|t|Operation type symbol|
|i|The index value of the current sheet|
|v|Object value, the internal fields of the object do not need to be updated separately, so save as text|
|op|The operation type `upOrAdd` is update, if it does not exist, it is added, and `del` is delete|
|pos|Updated or deleted `option` location|
- **Backend update**
Update `luckysheetfile[i].filter = {pos: v }`, the value of `v` is a string in JSON format. `filter` is a key-value pair, `key` is the index value (in characters) of the option position, and `v` is a json string parameter. `filter` represents a set of filter conditions.
### Clear filter
- **Format**
```json
{
"t": "fsc",
"i": 0,
"v": null
}
```
- **Backend update**
Clear `luckysheetfile[i]. filter = null` `luckysheetfile[i]. filter_select = null`。
### Restore filter
- **Format**
```json
{
"t": "fsr",
"i": 0,
"v": {
"filter": [],
"filter_select": {}
}
}
```
- **Backend update**
Clear `luckysheetfile[i]. filter = v.filter` `luckysheetfile[i]. filter_select = v. filter_select`。
## Sheet operation
### New sheet
- **Format**
```json
{
"t": "sha",
"i": null,
"v": {
"name": "Sheet4",
"color": "",
"status": "0",
"order": 3,
"index": 3,
"data": [],
"config": {},
"pivotTable": null,
"isPivotTable": false
}
}
```
- **Explanation**
<table>
<tr>
<td colspan="2">Parameter</td>
<td>Explanation</td>
</tr>
<tr>
<td colspan="2">t</td>
<td>Operation type symbol</td>
</tr>
<tr>
<td colspan="2">i</td>
<td>The index value of the current sheet</td>
</tr>
<tr>
<td rowspan="9">v</td>
<td>name</td>
<td>The index value of the sheet jumped after hiding</td>
</tr>
<tr>
<td>color</td>
<td>Sheet color</td>
</tr>
<tr>
<td>status</td>
<td>Active state</td>
</tr>
<tr>
<td>order</td>
<td>Sheet order</td>
</tr>
<tr>
<td>index</td>
<td>Sheet Index</td>
</tr>
<tr>
<td>celldata</td>
<td>Cell dataset</td>
</tr>
<tr>
<td>config</td>
<td>Setting</td>
</tr>
<tr>
<td>pivotTable</td>
<td>Pivot table settings</td>
</tr>
<tr>
<td>isPivotTable</td>
<td>Whether the pivot table</td>
</tr>
</table>
- **Backend update**
Add a line (a document) to the database.
### Copy sheet
- **Format**
```json
{
"t": "shc",
"i": "New sheet location",
"v": {
"copyindex": "copyindex"
}
}
```
- **Backend update**
Copy the sheet index value in the table, set it to `copyindex` and add it to the database, set the `index` of the new document to the value corresponding to `i`.
### Delete sheet
- **Format**
```json
{
"t": "shd",
"i": null,
"v": {
"deleIndex": 0
}
}
```
- **Explanation**
<table>
<tr>
<td colspan="2">Parameter</td>
<td>Explanation</td>
</tr>
<tr>
<td colspan="2">t</td>
<td>Operation type symbol</td>
</tr>
<tr>
<td rowspan="2">v</td>
<td>deleIndex</td>
<td>The sheet index to be deleted</td>
</tr>
</table>
- **Backend update**
Delete the sheet whose index is the value corresponding to `deleIndex`.
### restore from a deleted sheet
- **format**
```json
{
"t": "shre",
"i": null,
"v": {
"reIndex": "0"
}
}
```
- **Explanation**
<table>
<tr>
<td colspan="2">Parameter</td>
<td>Explanation</td>
</tr>
<tr>
<td colspan="2">t</td>
<td>Operation type symbol</td>
</tr>
<tr>
<td rowspan="2">v</td>
<td>deleIndex</td>
<td>需要恢复的sheet索引</td>
</tr>
</table>
- **Backend update**
restore the sheet whose index is the number of `reIndex`.
### Position
- **Format**
```json
{
"t": "shr",
"i": null,
"v": {
"0": 1,
"1": 0,
"2": 2,
"3": 3,
"4": 4,
"5": 5,
"6": 6,
"7": 7,
"Sheet_6az6nei65t1i_1596209937084": 8
}
}
```
- **Explanation**
|Parameter|Explanation|
| ------------ | ------------ |
|t|Operation type symbol|
|v|Set the sorting of Sheet as a key-value pair, `key` represents the index of the sheet, and `value` represents the order value. The format is: `{"1": 3, "2":1, "0": 2, "3":0}`|
- **Backend update**
For the page where the `index` of the sheet is equal to the `key`, set its `order` attribute to the `value`. Examples:
`luckysheetfile[key1].order = value1`
`luckysheetfile[key2].order = value2`
`luckysheetfile[key3].order = value3`
### switch to the specified sheet
- **format**
```json
{
"t": "shs",
"i": null,
"v": 1
}
```
- **Explanation**
|Parameter|Explanation|
| ------------ | ------------ |
|t|Operation type symbol|
|v|index of the specified sheet|
- **Backend update**
setting the `status` = `1`, when the `index` of a sheet is eaqul to `v`
`luckysheetfile[v].status = 1`
## Sheet attributes (hide or show)
- **Format**
```json
{
"t": "sh",
"i": 0,
"v": 1,
"op": " hide",
"cur": 2
}
```
- **Explanation**
|Parameter|Explanation|
| ------------ | ------------ |
|t|Operation type symbol|
|i|The index value of the current sheet|
|op|Operation options include hide and show|
|v|Hide if `hide` is `1`, show if `0` or empty|
|cur|After hiding, set sheet which index corresponding to the `cur` to the active state|
- **Backend update**
The `hide` field of the root path of the sheet corresponding to `i` is updated to `v`. When hidden, the `status` value is `0`. When displayed, it is `1`. If hidden, the sheet which `cur` corresponds to `index`, its `status` is updated to `1`.
## Table information change
### Table name
- **Format**
```json
{
"t": "na",
"i": null,
"v": "Data"
}
```
- **Explanation**
|Parameter|Explanation|
| ------------ | ------------ |
|t|Operation type symbol|
|v|The name of the table|
- **Backend update**
Update the table name in the database according to gridkey.
### Thumbnail
- **Format**
```json
{
"t": "thumb",
"img": "base64",
"curindex": "curindx"
}
```
- **Explanation**
|Parameter|Explanation|
| ------------ | ------------ |
|t|Operation type symbol|
|img|Thumbnail of current table, base64 string|
|curindex|The current sheet opened by default|
- **Backend update**
According to gridkey, update the thumbnail field of the table in mysql to the img value, and update the status field of the sheet whose index is the curindex value to 1, and set the status value of other sheets to 0.
## Chart(TODO)
There are four types of chart operations: add new chart -"add", move chart position-"xy", zoom chart-"wh", and update chart configuration-"update".
### new chart
- **format**
```json
{
"t": "c",
"i": 0,
"op":"add",
"v": {
"chart_id": "chart_p145W6i73otw_1596209943446",
"width": 400,
"height": 250,
"left": 20,
"top": 120,
"sheetIndex": "Sheet_6az6nei65t1i_1596209937084",
"needRangeShow": true,
"chartOptions": {
"chart_id": "chart_p145W6i73otw_1596209943446",
"chartAllType": "echarts|line|default",
"rangeArray": [ { "row": [ 0, 4 ], "column": [ 0, 7 ] } ],
"rangeColCheck": { "exits": true, "range": [ 0, 0 ] },
"rangeRowCheck": { "exits": true, "range": [ 0, 0 ] },
"rangeConfigCheck": false,
"defaultOption": {
"title": {
"show": true,
"text": "default title"
}
}
},
"isShow": true
}
}
```
- **Explanation**
|Parameter|Explanation|
| ------------ | ------------ |
|t|Operation type symbol|
|i|The index value of the current sheet|
|op|Operation options include hide and show|
|v|configuration information of charts|
- **Backend update**
update the chart settings in the current sheet,if`luckysheetfile[i].chart` is nullthe array should be `[]` on initial.
```json
luckysheetfile[0].chart.push(v)
```
### move chart position
- **format**
```json
{
"t": "c",
"i": 0,
"op":"xy",
"v": {
"chart_id": "chart_p145W6i73otw_1596209943446",
"left": 20,
"top": 120
}
}
```
- **Explanation**
|Parameter|Explanation|
| ------------ | ------------ |
|t|Operation type symbol|
|i|The index value of the current sheet|
|op|Operation options include hide and show|
|v|configuration information of charts|
- **Backend update**
update the chart settings in the current sheet
```js
luckysheetfile[0].chart[v.chart_id].left = v.left;
luckysheetfile[0].chart[v.chart_id].top = v.top;
```
### zoom chart
- **format**
```json
{
"t": "c",
"i": 0,
"op":"wh",
"v": {
"chart_id": "chart_p145W6i73otw_1596209943446",
"width": 400,
"height": 250,
"left": 20,
"top": 120
}
}
```
- **Explanation**
|Parameter|Explanation|
| ------------ | ------------ |
|t|Operation type symbol|
|i|The index value of the current sheet|
|op|Operation options include hide and show|
|v|configuration information of charts|
- **Backend update**
update the chart settings in the current sheet
```js
luckysheetfile[0].chart[v.chart_id].left = v.left;
luckysheetfile[0].chart[v.chart_id].top = v.top;
luckysheetfile[0].chart[v.chart_id].width = v.width;
luckysheetfile[0].chart[v.chart_id].height = v.height;
```
### change the configuration of charts
- **format**
```json
{
"t": "c",
"i": 0,
"op":"update",
"v": {
"chart_id": "chart_p145W6i73otw_1596209943446",
"width": 400,
"height": 250,
"left": 20,
"top": 120,
"sheetIndex": "Sheet_6az6nei65t1i_1596209937084",
"needRangeShow": true,
"chartOptions": {
"chart_id": "chart_p145W6i73otw_1596209943446",
"chartAllType": "echarts|line|default",
"rangeArray": [ { "row": [ 0, 4 ], "column": [ 0, 7 ] } ],
"rangeColCheck": { "exits": true, "range": [ 0, 0 ] },
"rangeRowCheck": { "exits": true, "range": [ 0, 0 ] },
"rangeConfigCheck": false,
"defaultOption": {
"title": {
"show": true,
"text": "default title"
}
}
},
"isShow": true
}
}
```
- **Explanation**
|Parameter|Explanation|
| ------------ | ------------ |
|t|Operation type symbol|
|i|The index value of the current sheet|
|op|Operation options include hide and show|
|v|configuration information of charts|
- **Backend update**
update the chart settings in the current sheet
```js
luckysheetfile[0].chart[v.chart_id] = v;
```
## Backend return format
Data format returned by websocket backend
```js
{
createTime: command sending time
data:{} modified command
id: "7a" websocket id
returnMessage: "success"
status: "0" 0 tells the front end to modify according to the data command 1 meaningless
type: 0: connection is successful, 1: send to the currently connected user, 2: send information to other users, 3: send selection location information, 999: user disconnected
username: username
}
```
+33
View File
@@ -0,0 +1,33 @@
# Tutorials and resources
Open source software is inseparable from the contribution of the community. Here will be a list of tutorials, learning materials and supporting solutions provided by the community.
If you have written or found an excellent tutorial and want to recommend it to us, please directly [edit this page](https://github.com/mengshukeji/Luckysheet/edit/master/docs/guide/resource.md) submit a PR.
## Blog
- [How Luckysheet initializes the data with merged cells](https://www.cnblogs.com/DuShuSir/p/13272397.html)[Pending translation]
- [How Luckysheet saves the data in the table to the database](https://www.cnblogs.com/DuShuSir/p/13857874.html)[Pending translation]
- [Case of introducing Luckysheet into local HTML using CDN loading](https://www.cnblogs.com/DuShuSir/p/13859103.html)[Pending translation]
- [Basic usage of Luckysheet, use `loadUrl` to load server data](https://blog.csdn.net/DCDC2020/article/details/108486525)
- [Luckysheet import and export implementation-Java background processing](https://blog.csdn.net/u014632228/article/details/109738221)
## Front-end case
### Community Case
- [luckysheet-vue-importAndExport](https://github.com/oy-paddy/luckysheet-vue-importAndExport/tree/master/)
## Back-end case
### Official case
- [Java backend Luckysheet Server](https://github.com/mengshukeji/LuckysheetServer)
### Community Case
- [Luckysheet save and restore](https://gitee.com/ichiva/luckysheet-saved-in-recovery) (Java version)
- [Online form for collaborative editing based on Luckysheet](https://github.com/DilemmaVi/ecsheet) (Java version)
- [Simple Express.js server example template for individual use](https://github.com/TitanRGB/Luckysheet-ExpressReact-Example) (Node-Express version)
- [Use .net core 3.1 and Npoi to make a basic export based on LuckSheet](https://gitee.com/xiong-kangli/luck-sheet_.-net-core) (.NET version)
- [Collaborative editing in go language version](https://github.com/fandypeng/excel2config)Go version
## Learning Materials
- [How to build a web data analysis report from 0 to 1](https://github.com/mengshukeji/LuckyResources/blob/master/ppt/%E5%A6%82%E4%BD%95%E4%BB%8E0%E5%88%B01%E6%90%AD%E5%BB%BA%20Web%20%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90%E6%8A%A5%E8%A1%A8.pptx)[Pending translation]
File diff suppressed because it is too large Load Diff
+15
View File
@@ -0,0 +1,15 @@
---
home: true
heroText: Luckysheet
tagline: 配置文档 · API · 教程
actionText: 快速上手 →
actionLink: /zh/guide/
features:
- title: 功能强大
details: 包含大量常用电子表格功能,替代你的excel
- title: 配置简单
details: 最少的配置就能开始上手使用
- title: 完全开源
details: 社区驱动,共同来完善你的想法
footer: MIT Licensed | Copyright © 2020-present Mengshukeji
---
+28
View File
@@ -0,0 +1,28 @@
# 认识团队
Luckysheet是由个人主导、几个志同道合的小伙伴一同开发的项目。
## 核心团队活跃成员
- [@wbfsa](https://github.com/wbfsa)
- [@eiji-th](https://github.com/eiji-th)
- [@fly-95](https://github.com/fly-95)
- [@tonytonychopper123](https://github.com/tonytonychopper123)
- [@Dushusir](https://github.com/Dushusir)
- [@iamxuchen800117](https://github.com/iamxuchen800117)
- [@wpxp123456](https://github.com/wpxp123456)
- [@c19c19i](https://weibo.com/u/3884623955)
- [@zhangchen915](https://github.com/zhangchen915)
- [@jerry-f](https://github.com/jerry-f)
- [@flowerField](https://github.com/flowerField)
## 社区伙伴
- [@yiwasheng](https://github.com/yiwasheng)
- [@danielcai1987](https://github.com/danielcai1987)
- [@qq6690876](https://github.com/qq6690876)
- [@javahuang](https://github.com/javahuang)
- [@TimerGang](https://github.com/TimerGang)
- [@gsw945](https://github.com/gsw945)
- [@swen-xiong](https://github.com/swen-xiong)
- [@lzmch](https://github.com/lzmch)
- [@kdevilpf](https://github.com/kdevilpf)
- [@WJWM0316](https://github.com/WJWM0316)
@@ -0,0 +1,49 @@
# 社区案例
我们搜集到了很多来自社区的案例反馈,还发现了以前我们没有预想到的Luckysheet使用场景。
积极聆听社区的声音,在大家的支持和反馈中不断更新迭代,已是我们的责任。
## 公司案例
<table>
<tbody>
<tr>
<td align="center" valign="middle">
<a href="https://www.zpy360.com/" target="_blank">
<img width="222px" src="https://cdn.jsdelivr.net/npm/luckyresources/assets/img/community_case/Zhiping_Cloud.png">
</a>
<p>雄安智评云数字科技有限公司</p>
</td>
<td align="center" valign="middle">
<a href="https://code-the-future.com/" target="_blank">
<img width="222px" src="https://cdn.jsdelivr.net/npm/luckyresources/assets/img/community_case/code_the_future.png">
</a>
<p>Code the Future</p>
</td>
<td align="center" valign="middle">
<a href="http://www.jackyun.com/" target="_blank">
<img width="222px" src="https://cdn.jsdelivr.net/npm/luckyresources/assets/img/community_case/jackyun.png">
</a>
<p>吉客云</p>
</td>
<td align="center" valign="middle">
<a href="https://www.huawei.com/cn/" target="_blank">
<img width="222px" src="https://cdn.jsdelivr.net/npm/luckyresources/assets/img/community_case/huawei.png">
</a>
<p>华为</p>
</td>
</tr>
<tr>
<td align="center" valign="middle">
</td>
<td align="center" valign="middle">
</td>
<td align="center" valign="middle">
</td>
<td align="center" valign="middle">
</td>
</tr>
</tbody>
</table>
+156
View File
@@ -0,0 +1,156 @@
# 赞助
## 为什么赞助
如果您经营一家企业并在盈利产品中使用Luckysheet,那么赞助Luckysheet开发将具有商业意义:它可确保您的产品所依赖的项目保持健康并得到积极维护。 它还可以帮助您在Luckysheet社区中曝光,使得更多的人关注您的产品。
当然,如果Luckysheet在您的工作或个人项目中为您提供了帮助,也欢迎请作者喝杯果汁😋。
## 赞助方式
Luckysheet是MIT许可的开源项目,其持续稳定的开发离不开这些优秀的 [**支持者**](#赞助者列表)。 如果您想加入他们,请考虑:
- [成为Patreon的支持者或赞助商](https://www.patreon.com/mengshukeji)
- [成为Open Collective的支持者或赞助商](https://opencollective.com/luckysheet)
- 通过PayPal,微信或支付宝一次性捐赠
| PayPal | 微信 | 支付宝 |
|---|---|---|
| [Paypal Me](https://www.paypal.me/wbfsa) | <img src="https://minio.cnbabylon.com/public/luckysheet/wechat.jpg" width="140" />| <img src="https://minio.cnbabylon.com/public/luckysheet/alipay.jpg" width="130" /> |
### Patreon和OpenCollective有什么区别?
通过Patreon捐赠的资金将直接用于支持menshshukeji在Luckysheet上的工作。 通过OpenCollective捐赠的资金由透明费用管理,将用于补偿核心团队成员的工作和费用或赞助社区活动。 通过在任一平台上捐款,您的姓名/徽标将得到适当的认可和曝光。
## 赞助者列表
(按时间顺序排列)
- *涛 ¥ 200
- popo ¥ 1
- 孔垂善 ¥ 5
- Shawn文 ¥ 99
- 幸运的小路易 ¥ 1
- 冯启俊 ¥ 88
- mxb ¥ 10
- 祭阳 ¥ 20
- *勇 ¥ 30
- 虚我 ¥ 200
- 甜党 ¥ 50
- Alphabet(Google)-gcf ¥ 1
- **平 ¥ 100
- **东 ¥ 10
- debugger ¥ 20
- 烦了烦 ¥ 10
- 文顶顶 ¥ 200
- yangxshn ¥ 10
- 爱乐 ¥ 100
- 小李飞刀刀 ¥ 66
- 张铭 ¥ 200
- 曹治军 ¥ 1
- *特 ¥ 10
- **权 ¥ 9.9
- **sdmq ¥ 20
- *旭 ¥ 10
- Quentin ¥ 20
- 周宇凡 ¥ 100
- *超 ¥ 10
- 维宁 ¥ 100
- hyy ¥ 20
- 雨亭寒江月 ¥ 50
- **功 ¥ 10
- **光 ¥ 20
- terrywan ¥ 100
- 王晓洪 ¥ 10
- Sun ¥ 10
- 忧绣 ¥ 100
- Jasonx ¥ 10
- 国勇 ¥ 66.6
- 郎志 ¥ 100
- 匿名 ¥ 1
- ni ¥ 100
- 苏 ¥ 50
- Mads_chan ¥ 1
- LK ¥ 100
- 智连方舟 李汪石 ¥ 168
- **发 ¥ 260
- *超 ¥ 10
- *勇 ¥ 10
- *腾 ¥ 15
- 名字好难起 ¥ 20
- 大山 ¥ 1
- waiting ¥ 1000
- **宇 ¥ 10.00
- 刘小帅的哥哥 ¥ 20.00
- 宁静致远 ¥ 10.00
- Eleven ¥ 1.00
- **帆 ¥ 188
- henry ¥ 100
- .波罗 ¥ 50
- 花落有家 ¥ 50
- 踏遍南水北山 ¥ 1
- LC ¥ 5
- **明 ¥ 8.80
- *军 ¥ 20
- 张彪 ¥ 50
- 企业文档云@肖敏 ¥ 10
- 匿名 ¥ 50
- 逍遥行 ¥ 10
- z.wasaki ¥ 50
- Make Children ¥ 20
- Foam ¥ 20
- 奥特曼( o|o)ノ三 ¥ 50
- **凯 ¥ 10
- **兵 ¥ 20
- **川 ¥ 1
- 二万 ¥ 50
- 蔚然成林 ¥ 10
- 邹杰 ¥ 10
- 张永强 ¥ 50
- 鱼得水 ¥ 50
- Ccther ¥ 1
- Eric Cheng ¥ 10
- 佚名 ¥ 1
- 花叶 ¥ 50
- GT ¥ 20
- 菜菜心 ¥ 10
- fisher ¥ 1
- JC ¥ 5
- 佚名 ¥ 20
- 独孤一剑 ¥ 50
- mxt ¥ 20
- 一叶迷山 ¥ 100
- Jeff ¥ 100
- 八千多条狗🐶 ¥ 100
- 晓峰 ¥ 10
- 戒 ¥ 1
- 浪里个浪 ¥ 1
- 回调函数 ¥ 50
- 赖瓜子 ¥ 5
- Milo•J ¥ 20
- 可道云 ¥ 200
- *程 ¥ 10
- 来一杯卡布酸奶 ¥ 5
- 刘久胜 ¥ 100
- 快意江湖 ¥ 50
- *新 ¥ 9.9
- **龙 ¥ 100
- **江 ¥ 100
- **威 ¥ 9.8
- **涛 ¥ 500
- **嘉 ¥ 10
- *涛 ¥ 1
- *兵 ¥ 5
- *阳 ¥ 200
- *辉 ¥ 1
- *帆 ¥ 30
- **旺 ¥ 10
- **麟 ¥ 20
- *霖 ¥ 9.9
- *帅 ¥ 10
- *鑫 ¥ 6.66
- ~朴:shu ¥ 29.79
- 未来 ¥ 1
- 国勇 ¥ 0.1
- 用心灵听雨 ¥ 10
- 钊 ¥ 5
- 星稀 ¥ 5
+325
View File
@@ -0,0 +1,325 @@
# 常见问题
本章内容搜集了大家反馈的常见问题,如果官方文档和此列表都不能解答您的疑问,推荐到[官方论坛](https://github.com/mengshukeji/Luckysheet/discussions)反馈
## luckysheetfile中的data和celldata有什么区别?
**<span style="font-size:20px;">A</span>**:表格初始化时使用一维数组格式的 [celldata](/zh/guide/sheet.html#celldata),初始化完成后转化为二维数组格式的data作为存储更新使用,celldata不再使用。
如果需要将`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}格式 一维数组
luckysheet.transToCellData(data)
// celldata => data 生成表格所需二维数组
luckysheet.transToData(celldata)
```
------------
## 单元格的类型有哪些?
**<span style="font-size:20px;">A</span>**:参考[单元格格式列表](/zh/guide/cell.html),例举了可用的单元格格式
------------
## 如何在Vue/React项目中使用Luckysheet
**<span style="font-size:20px;">A</span>**:参考
- Vue案例:[luckysheet-vue](https://github.com/mengshukeji/luckysheet-vue)
- React案例:[luckysheet-react](https://github.com/mengshukeji/luckysheet-react)
------------
## 为什么初始化后表格里面的公式不会被触发?
**<span style="font-size:20px;">A</span>**:参考 [表格数据格式](/zh/guide/sheet.html#calcchain) ,设置单元格数据对应的calcChain即可。
------------
## 远端加载数据是loadUrl还是updateUrl
**<span style="font-size:20px;">A</span>**[loadUrl](/zh/guide/config.html#loadurl)。配置了loadUrlLuckysheet会通过ajax请求整个表格数据,而updateUrl会作为协同编辑实时保存的接口地址。
注意:初始化数据需要配置loadUrl参数,而协同编辑则在配置loadUrl、updateUrl和allowUpdate四个参数才能生效。
------------
## 每个sheet页的`index`和`order`有什么区别?
**<span style="font-size:20px;">A</span>**:每个sheet页都有一个唯一id,就是`index`,可以用数字递增,也可以使用随机字符串,而`order`是所有的sheet的排序情况,从0开始,只能为数字`0,1,2...`
------------
## dist文件夹下为什么不能直接运行项目?
**<span style="font-size:20px;">A</span>**:需要启动本地服务器
- [Node搭建本地服务器](https://github.com/JacksonTian/anywhere)
- [Python搭建本地服务器](https://developer.mozilla.org/zh-CN/docs/Learn/Common_questions/set_up_a_local_testing_server)
------------
## excel导入导出怎么做?
**<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;">A</span>**:参考以下案例
- [Luckysheet如何初始化含合并单元格的数据](https://www.cnblogs.com/DuShuSir/p/13272397.html)
------------
## Luckysheet如何把表格里的数据保存到数据库?有没有服务端存储和协作的解决方案?
**<span style="font-size:20px;">A</span>**:有两个方案:
- 一是表格操作完成后,使用`luckysheet.getAllSheets()`方法获取到全部的工作表数据,全部发送到后台存储。
- 二是开启协同编辑功能,实时传输数据给后端。
具体的操作步骤参考这篇文章:[Luckysheet如何把表格里的数据保存到数据库](https://www.cnblogs.com/DuShuSir/p/13857874.html)
------------
## 如何监听单元格hover或者点击事件?`cellRenderAfter`如何实时监听变化?
**<span style="font-size:20px;">A</span>**:我们搜集到需要针对单元格事件的二次开发需求,规划了单元格相关的钩子函数,参考[单元格钩子函数](/zh/guide/config.html#cellrenderafter)(显示的TODO的暂未开放)
------------
## 顶部的工具栏不支持自定义配置?
**<span style="font-size:20px;">A</span>**
顶部工具栏的自定义配置使用初始[options.showtoolbarconfig](/zh/guide/config.html#showtoolbarconfig)(如果标注TODO表示暂未开发)
------------
## 项目使用了jQuery吗?
**<span style="font-size:20px;">A</span>**:是的。Luckysheet内部启动时间比开源的时间早很多,所以用到了jQuery。打包工具会把jQuery集成到打包目录的`./plugins/js/plugin.js`文件中。
如果您的项目中(比如React/Vue)也自己全局引用了jQuery,且造成了冲突,可以尝试去掉一个jQuery。
要想在Luckysheet里去除jQuery,需要在源码根目录下的`gulpfile.js`文件中找到打包jQuery的地方:[src/plugins/js/jquery.min.js](https://github.com/mengshukeji/Luckysheet/blob/master/gulpfile.js),删除jQuery相关的信息即可。
------------
## 如何为单元格对象新增字段?
**<span style="font-size:20px;">A</span>**:首先参考[单元格对象格式](/zh/guide/cell.html),然后参照源码批注的部分[src/controllers/postil.js](https://github.com/mengshukeji/Luckysheet/blob/master/src/controllers/postil.js)。批注是一个加在单元格对象上的一个配置。
------------
## 工具栏图标加载不出来?
**<span style="font-size:20px;">A</span>**:工具栏及其他部分图标采用了iconfont图标,加载不出来是因为缺少了iconfont.css的引入,之前旧版官方文档未写清楚这一点对大家造成误导,很抱歉。
详细的Luckysheet使用教程参考已经更新的[官方文档](/zh/guide/#使用步骤)
------------
## Luckyexcel打包后不动?
**<span style="font-size:20px;">A</span>**:打包的终端命令行不显示结束,但是如果`dist`文件夹内已经有了结果文件`luckyexcel.js`,则表明是正常的。
Luckyexcel是excel导入导出库,项目采用了gulp作为打包工具,旧版打包工具有点问题在命令行显示这块有些问题,问题已经修复。请还出现此问题的小伙伴做如下更新操作:
1. pull最新代码
2. `npm i`
3. `npm run build`
更多详细信息关注:[Luckyexcel](https://github.com/mengshukeji/Luckyexcel/)
------------
## 单元格不可编辑如何控制?表格保护怎么操作?
**<span style="font-size:20px;">A</span>**:单元格不可编辑属于工作表保护的功能范畴,需要配置在每个sheet页中`config.authority`,最新的设置参数请参考[工作表保护](/zh/guide/sheet.html#config-authority)。
为了大家便于理解工作表保护的功能使用,下方的视频演示了如何让当前整个工作表不可编辑,但是允许某一列单元格可编辑的功能:
<iframe frameborder="0" src="https://v.qq.com/txp/iframe/player.html?vid=g3162sacwn6" allowFullScreen="true"></iframe>
跟着演示操作一下本地的工作表,然后打开浏览器控制台,使用`luckysheet.getLuckysheetfile()[0].config.authority`就可以获取到第一个工作表的工作表保护参数。
------------
## 数据验证怎么配置?
**<span style="font-size:20px;">A</span>**:最新文档已经提供了数据验证的配置信息,参考[数据验证配置](/zh/guide/sheet.html#dataVerification)。官方也提供了API方法 [setDataVerification](/zh/guide/api.html#setdataverification-optionitem-setting),用于动态设置数据验证功能。
------------
## Luckysheet通过引入CDN有案例吗?
**<span style="font-size:20px;">A</span>**Luckysheet支持CDN方式引入,参考:[本地HTML采用cdn加载方式引入Luckysheet的案例](https://www.cnblogs.com/DuShuSir/p/13859103.html)
------------
## 请问一下图片怎么限制在单元格里面自适应高度?
**<span style="font-size:20px;">A</span>**:首先需要对图片设置移动并调整单元格大小,然后有以下几种情况:
- 如果图片位置完全在单元格内部时,当拉长单元格的宽度或高度的时候,图片不会随着单元格的变大而伸缩变大
- 如果图片位置完全在单元格内部时,当拉短单元格的宽度或高度,贴到图片的边时,图片会随着单元格的变小而伸缩变小
- 当这个图片超过单元格的边框时,图片可以跟随单元格大小变化
根据图片的第二个特性,可以操作得到图片位置信息,原理就是将图片的位置设置成和单元格边框重叠(源码中,需要重叠超过2px),以下演示视频展示了怎么将图片限制在单元格里面自适应宽高。
<iframe frameborder="0" src="https://v.qq.com/txp/iframe/player.html?vid=y3163ya0q6c" allowFullScreen="true"></iframe>
------------
## 如何获取工作表默认的行高列宽?
**<span style="font-size:20px;">A</span>**:有两种方式可以获取
- 一是使用`luckysheet.getLuckysheetfile()`获取到所有工作表配置后,在各个工作表的配置中直接取得默认行高`defaultRowHeight`和默认列宽`defaultColWidth`
- 二是开放了API可以获取到工作表默认的行高[getDefaultRowHeight](/zh/guide/api.html#getdefaultrowheight-setting)和列宽[getDefaultColWidth](/zh/guide/api.html#getdefaultcolwidth-setting)
------------
## 如何隐藏工作表下方的添加行按钮和回到顶部按钮?
**<span style="font-size:20px;">A</span>**:已开放配置
- 允许添加行 [enableAddRow](/zh/guide/config.html#enableaddrow)
- 允许回到顶部 [enableAddBackTop](/zh/guide/config.html#enableAddBackTop)
------------
## 如何隐藏工作表的行标题和列标题?
**<span style="font-size:20px;">A</span>**:已开放配置
- 行标题区域的宽度 [rowHeaderWidth](/zh/guide/config.html#rowheaderwidth)
- 列标题区域的高度 [columnHeaderHeight](/zh/guide/config.html#columnHeaderHeight)
------------
## 调用什么方法能设置`config.merge`
**<span style="font-size:20px;">A</span>**:三个方法
- 界面操作
- 用API[setRangeMerge](/zh/guide/api.html#setrangemerge-type-setting)
- 手动组装merge参数
------------
## 为什么官方公布的新功能没有效果?
**<span style="font-size:20px;">A</span>**:第一步,检查下您是否使用了CDN的方式引入,
Luckysheet教程里采用的CDN链接是 [jsdelivr](https://www.jsdelivr.com/package/npm/luckysheet) 提供的服务,代码是从 [npmjs.com](https://www.npmjs.com/) 自动同步过去的,不是从 [Github](https://github.com/mengshukeji/Luckysheet/) 同步过去的。因为我们新提交的代码,还需要经过一段时间的测试,所以不会立即发布到npm使用,导致了npm的代码稍滞后于Github。
如果需要尝试最新代码,我们强烈建议您从 [Luckysheet Github](https://github.com/mengshukeji/Luckysheet/) 主仓库拉取代码。后续我们版本稳定了,会考虑实时发布npm包。
第二步,如果是引用github仓库打包后的代码,测试判断是否有bug,您可以查找问题并尝试修复,再[提交PR](https://github.com/mengshukeji/Luckysheet/pulls),如果修复不了,请[提交issues](https://github.com/mengshukeji/Luckysheet/issues)。
------------
## `npm run dev`报错:`Error: Cannot find module 'rollup'`
**<span style="font-size:20px;">A</span>**:可能是npm包安装问题,尝试以下步骤:
1. `npm cache clean --force`
2. `npm i rimraf -g`
3. `rimraf node_modules`
4. 删除package-lock.json文件
5. `npm i`
6. `npm run dev`
提示:大多数的其他npm安装问题,也可以尝试此步骤来解决。
------------
## 怎样在vue工程里对Luckysheet进行二次开发?
**<span style="font-size:20px;">A</span>**[luckysheet-vue](https://github.com/mengshukeji/luckysheet-vue) 案例是提供一个应用集成的方案。
如果本地直接开发的话:
1. 把Luckysheet的工程和自己的Vue工程都启动起来,比如Luckysheet的工程在 `http://localhost:3001`
2. 在Vue工程里面通过 `http://localhost:3001` 引入Luckysheet使用
这样的话,Luckysheet实时修改后,Vue工程里是可以看到更改的
------------
## 创建图表时候报错`Store.createChart`
**<span style="font-size:20px;">A</span>**:需要引入图表插件才能使用,工作簿初始化的时候应该配置图表插件使用,参考
- 插件配置 [plugins](/zh/guide/config.html#配置项)
- 或 官方demo [src/index.html](https://github.com/mengshukeji/Luckysheet/blob/master/src/index.html)
通常,参考demo配置完后就可以和demo一样正常使用了,但是还是会偶现`chartmix is not defined`,这时需要在谷歌浏览器控制台的network里检查下图表的依赖是否都加载了,有5项依赖需要关注:`vue / vuex / element-ui / echarts / chartmix.umd.js`
------------
## 单元格能增加自定义属性吗?
**<span style="font-size:20px;">A</span>**:直接赋值到单元格对象上的自定义属性会被过滤,要想使得自定义属性生效,需要二开去除过滤属性的代码。
------------
## 如何输入以`'='`开头的文本?例如`=currentDate('YYYY-MM-DD')`,它默认会去掉函数,函数怎么禁止?
**<span style="font-size:20px;">A</span>**:前面加一个单引号就行,会强制识别为字符串,和excel表现一致的。比如:`'=currentDate('YYYY-MM-DD')`
------------
## create回调为什么没有效果?
**<span style="font-size:20px;">A</span>**API 方法`luckysheet.create()`这个方法没有回调,但是Luckysheet提供了钩子函数用于在指定位置执行回调方法,比如:
- 表格创建之前触发 [workbookCreateBefore](/zh/guide/config.html#workbookcreatebefore)
- 表格创建之后触发 [workbookCreateAfter](/zh/guide/config.html#workbookcreateafter)
------------
## create的时候默认选中第一个单元格,怎么去除?
**<span style="font-size:20px;">A</span>**:选中单元格时默认是高亮,把高亮去除即可,使用API: [setRangeShow](/zh/guide/api.html#setrangeshow-range-setting)
```js
luckysheet.setRangeShow("A2",{show:false})
```
------------
## 右键事件绑定在哪?
**<span style="font-size:20px;">A</span>**:在源码的 [src/controllers/hander.js](https://github.com/mengshukeji/Luckysheet/blob/master/src/controllers/handler.js) 搜索`event.which == "3"`即可找到右键事件触发执行的代码。
------------
## 如何添加自定义工具栏?
**<span style="font-size:20px;">A</span>**:暂未提供配置,可以参照工具栏打印按钮的实现来修改源码:
1. 全局搜索 `luckysheet-icon-print`即可找到打印按钮的实现,在 [src/controllers/constant.js](https://github.com/mengshukeji/Luckysheet/blob/master/src/controllers/constant.js) 中增加一个类似的模板字符串,需要自定义一个唯一id
2. 修改 [src/controllers/resize.js](https://github.com/mengshukeji/Luckysheet/blob/master/src/controllers/resize.js) ,在toobarConfig对象中新增一条记录
3. 修改 [src/controllers/menuButton.js](https://github.com/mengshukeji/Luckysheet/blob/master/src/controllers/menuButton.js) ,新增一个事件监听
------------
## 如何添加自定义公式?
**<span style="font-size:20px;">A</span>**:需要修改两处源码:
1. 在 [src/function/functionImplementation.js](https://github.com/mengshukeji/Luckysheet/blob/master/src/function/functionImplementation.js) 文件中的`functionImplementation`对象中增加一个公式,格式参考`SUM`/`AVERAGE`等公式
2. 修改 [src/locale](https://github.com/mengshukeji/Luckysheet/blob/master/src/locale) 文件目录下所有的语言包,将自己新增的公式说明加到`functionlist`数组中。其中,`t`是函数的类别,`m`是参数的个数,最小参数个数和最大参数个数。
------------
## 有没有类似loadData接口,我想实现先加载10条记录,然后再动态加载数据,这些数据都追加到表格中?
**<span style="font-size:20px;">A</span>**:有的。我们`loadSheetUrl`提供了这个功能,初始化`options.enablePage = true`可以开启。
源码里搜索`enablePage`可以看到,有个`method.addDataAjax`方法,里面就有一个ajax请求,用来动态加载数据,这些数据会追加到表格中。
这个功能现在在文档上是隐藏的,是因为这个接口我们做的时候,接口参数是根据我们实际业务匹配的,可能不太通用,我们准备抽象后再放出来给大家用,如果您想自己用可以依据这个改下。
推荐您考虑自己写接口来加载数据,然后使用`setRangeValue`来在指定位置追加数据,这样的自定义程度更高。
------------
+281
View File
@@ -0,0 +1,281 @@
# Luckysheet 已不再维护,推荐使用 [Univer](https://github.com/dream-num/univer) 替代
# 快速上手
## 基本介绍
Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置简单、完全开源。
## Demo
[在线demo](https://dream-num.github.io/LuckysheetDemo/)
![演示](/LuckysheetDocs/img/LuckysheetDemo.gif)
## 在线案例
- [协同编辑Demo](http://luckysheet.lashuju.com/demo/)
## 特性
### 🛠️格式设置
+ **样式** (修改字体样式,字号,颜色或者其他通用的样式)
+ **条件格式** (突出显示所关注的单元格或单元格区域;强调异常值;使用数据栏、色阶和图标集(与数据中的特定变体对应)直观地显示数据)
+ **文本对齐及旋转**
+ **支持文本的截断、溢出、自动换行**
+ **数据类型**
+ **货币, 百分比, 数字, 日期**
+ **Custom** (和excel保持一致,例如: `##,###0.00` , `$1,234.56$##,###0.00_);[Red]($##,###0.00)`, `_($* ##,###0.00_);_(...($* "-"_);_(@_)`, `08-05 PM 01:30MM-dd AM/PM hh:mm` )
+ **单元格内多样式** (Alt+Enter单元格内换行、上标、下标、单元格内可定义每个文字的不同样式)
### 🧬单元格
+ **拖拽选取来修改单元格** (对选区进行操作,可以拖动四边来移动选区,也可以在右下角对选区进行下拉填充操作)
+ **选区下拉填充** (对于一个1,2,3,4,5的序列,将会按照间隔为1进行下拉填充,而对2,4,6,8将会以2作为间隔。支持等差数列,等比数列,日期,周,天,月,年,中文数字填充)
+ **自动填充选项** (下拉填充后,会出现填充选项的菜单,支持选择复制,序列,仅格式,只填充格式,天,月,年的选择)
+ **多选区操作** (可以按住Ctrl键进行单元格多选操作,支持多选区的复制粘贴)
+ **查找和替换** (对内容进行查找替换,支持正则表达式,整词,大小写敏感)
+ **定位** (可以根据单元格的数据类型进行自动定位并选中,选中后可以批量进行格式等操作)
+ **合并单元格**
+ **数据验证(表单功能)** (支持Checkbox, drop-down list, datePicker)
### 🖱️行和列操作
+ **隐藏,插入,删除行或列**
+ **冻结行或列** (支持冻结首行和首列,冻结到选区,冻结调节杆可以进行拖动操作)
+ **文本分列** (可以把文本根据不同符号进行拆分,和excel的分列功能类似)
### 🔨操作体验
+ **撤销/重做**
+ **复制/粘贴/剪切操作** (支持Luckysheet到excel和excel到Luckysheet带格式的互相拷贝)
+ **快捷键支持** (快捷键操作保持与excel一致,如果有不同或者缺失请反馈给我们)
+ **格式刷** (与google sheet类似)
+ **任意选区拖拽** (选择单元格,输入公式,插入图表,会与选区相关,可以通过任意拖动和放大缩小选区来改变与之关联的参数)
### ⚙️公式和函数
+ **内置公式**
+ 数学 (SUMIFS, AVERAGEIFS, SUMIF, SUM, etc.)
+ 文本 (CONCATENATE, REGEXMATCH, MID)
+ 日期 (DATEVALUE, DATEDIF, NOW, WEEKDAY, etc.)
+ 财务 (PV, FV, IRR, NPV, etc.)
+ 逻辑 (IF, AND, OR, IFERROR, etc.)
+ 查找和引用 (VLOOKUP, HLOOkUP, INDIRECT, OFFSET, etc.)
+ 动态数组 (Excel2019新函数,SORT,FILTER,UNIQUE,RANDARRAY,SEQUENCE)
+ **公式支持数组** (={1,2,3,4,5,6}, Crtl+Shift+Enter)
+ **远程公式** (DM_TEXT_TFIDF, DM_TEXT_TEXTRANK,DATA_CN_STOCK_CLOSE etc. Need remote interface, can realize complex calculation)
+ **自定义公式** (根据身份证识别年龄,性别,生日,省份,城市等. AGE_BY_IDCARD, SEX_BY_IDCARD, BIRTHDAY_BY_IDCARD, PROVINCE_BY_IDCARD, CITY_BY_IDCARD, etc. 可以任意加入自己的公式哦)
### 📐表格操作
+ **筛选** (支持颜色、数字、字符、日期的筛选)
+ **排序** (同时加入多个字段进行排序)
### 📈数据透视表
+ **字段拖拽** (操作方式与excel类似,拖动字段到行、列、数值、筛选等4个区域)
+ **聚合方式** (支持汇总、计数、去重计数、平均、最大、最小、中位数、协方差、标准差、方差等计算)
+ **筛选数据** (可对字段进行筛选后再进行汇总)
+ **数据透视表下钻** (双击数据透视表中的数据,可以下钻查看到明细,操作方式与excel一致)
+ **根据数据透视表新建图表** (数据透视表产生的数据也可以进行图表的制作)
### 📊图表
+ **支持的图表类型** (目前折线图、柱状图、面积图、条形图、饼图可以使用,散点图、雷达图、仪表盘、漏斗图正在接入,其他图表正在陆续开发中,请大家给予建议)
+ **关于图表插件** (图表使用了一个中间插件[ChartMix](https://github.com/mengshukeji/chartMix)(MIT协议): 目前支持ECharts,正在逐步接入Highcharts、阿里G2、amCharts、googleChart、chart.js)
+ **Sparklines小图** (以公式的形式进行设置和展示,目前支持:折线图、面积图、柱状图、累积图、条形图、离散图、三态图、饼图、箱线图等)
### ✍️分享及写作
+ **评论** (评论的删除、添加、修改、隐藏)
+ **共享编辑** (支持多用户共享编辑,内置API)
### 📚插入对象
+ **插入图片** (支持JPG,PNG,SVG的插入、修改和删除,并且随表格的变动而产生变化)
### ⚡Luckysheet专有
+ **矩阵计算** (通过右键菜单进行支持:对选区内的数据进行转置、旋转、数值计算)
+ **截图** (把选区的内容进行截图展示)
+ **复制到其他格式** (右键菜单的"复制为", 支持复制为json、array、对角线数据、去重等)
+ **EXCEL导入及导出** (专为Luckysheet打造的导入导出插件,支持密码、水印、公式等的本地导入导出,导出正在开发)
### ⏱️未来开发计划
+ **打印及设置** (像excel一样进行打印设置,并导出为图片或者PDF)
+ **树形菜单** (类似excel中的分级显示(分组))
+ **表格新功能** (类似excel中表格的筛选器和切片器)
+ **CSV,TXT导入及导出** (专为Luckysheet打造的导入导出插件,支持密码、水印、公式等的本地导入导出)
+ **插入svg形状** (支持[Pen tool](https://github.com/mengshukeji/Pentool)的插入、修改和删除,并且随表格的变动而产生变化)
+ **文档** (完善文档和API)
+ **敬请期待...** (可以提出好的建议给我们)
## 开发模式
### 环境
[Node.js](https://nodejs.org/en/) Version >= 6
### 安装
```shell
npm install
npm install gulp -g
```
### 开发
```shell
npm run dev
```
### 打包
```shell
npm run build
```
## 使用步骤
### 第一步
引入依赖,有2种方式
#### CDN
```html
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/plugins/css/pluginsCss.css' />
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/plugins/plugins.css' />
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/css/luckysheet.css' />
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/assets/iconfont/iconfont.css' />
<script src="https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/plugins/js/plugin.js"></script>
<script src="https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/luckysheet.umd.js"></script>
```
注意,`https://cdn.jsdelivr.net/npm/luckysheet@latest/dist/luckysheet.umd.js`这个路径意思是会拉取到最新的luckysheet代码,但是如果Luckysheet刚刚发布,jsdelivr网站可能还没来得及从npm上同步过去,故而使用这个路径还是会拉到上一个版本,我们推荐您直接指定最新版本。
想要指定Luckysheet版本,请在所有的CDN依赖文件后面加上版本号,如:`https://cdn.jsdelivr.net/npm/luckysheet@2.1.12/dist/luckysheet.umd.js`
> 如何知道最新版本是哪一版?查看最新 [release记录](https://github.com/mengshukeji/Luckysheet/releases) 或者 [package.json](https://github.com/mengshukeji/Luckysheet/blob/master/package.json) 的`version`字段。
如果不方便访问 jsdelivr.net,还可以采用本地方式引入
#### 本地引入
`npm run build``dist`文件夹下的所有文件复制到项目目录,然后通过相对路径引入
```html
<link rel='stylesheet' href='./plugins/css/pluginsCss.css' />
<link rel='stylesheet' href='./plugins/plugins.css' />
<link rel='stylesheet' href='./css/luckysheet.css' />
<link rel='stylesheet' href='./assets/iconfont/iconfont.css' />
<script src="./plugins/js/plugin.js"></script>
<script src="./luckysheet.umd.js"></script>
```
### 第二步
指定一个表格容器
```html
<div id="luckysheet" style="margin:0px;padding:0px;position:absolute;width:100%;height:100%;left: 0px;top: 0px;"></div>
```
### 第三步
创建一个表格
```javascript
<script>
$(function () {
//配置项
var options = {
container: 'luckysheet' //luckysheet为容器id
}
luckysheet.create(options)
})
</script>
```
## 整体结构
### 格式
一个完整的Luckysheet表格文件的数据格式为:luckysheetfile,一个表格文件包含若干个sheet文件,对应excel的sheet0、sheet1等。
一个Luckysheet文件的示例如下,该表格包含3个sheet:`
luckysheetfile = [ {sheet1设置}, {sheet2设置}, {sheet3设置} ]`
相当于excel的3个sheet
![excel sheet](/LuckysheetDocs/img/excel.png)
文件中的一个sheet的数据`luckysheetfile[0]`的结构如下:
```json
{
"name": "Cell", //工作表名称
"color": "", //工作表颜色
"index": "0", //工作表索引
"status": "1", //激活状态
"order": "0", //工作表的顺序
"hide": 0,//是否隐藏
"row": 36, //行数
"column": 18, //列数
"config": {
"merge":{}, //合并单元格
"rowlen":{}, //表格行高
"columnlen":{}, //表格列宽
"rowhidden":{}, //隐藏行
"colhidden":{}, //隐藏列
"borderInfo":{}, //边框
},
"celldata": [], //初始化使用的单元格数据
"data": [], //更新和存储使用的单元格数据
"scrollLeft": 0, //左右滚动条位置
"scrollTop": 315, //上下滚动条位置
"luckysheet_select_save": [], //选中的区域
"luckysheet_conditionformat_save": {},//条件格式
"calcChain": [],//公式链
"isPivotTable":false,//是否数据透视表
"pivotTable":{},//数据透视表设置
"filter_select": {},//筛选范围
"filter": null,//筛选配置
"luckysheet_alternateformat_save": [], //交替颜色
"luckysheet_alternateformat_save_modelCustom": [], //自定义交替颜色
"freezen": {}, //冻结行列
"chart": [], //图表配置
"visibledatarow": [], //所有行的位置
"visibledatacolumn": [], //所有列的位置
"ch_width": 2322, //工作表区域的宽度
"rh_height": 949, //工作表区域的高度
"load": "1", //已加载过此sheet的标识
}
```
### 查看方式
在chrome的console中查看
`luckysheet.getluckysheetfile()`
可以看到完整设置
`[{shee1}, {sheet2}, {sheet3}]`
## 快捷键
| 快捷键 | 功能 |
| ------------ | ------------ |
| CTRL + C | 复制单元格 |
| CTRL + V | 粘贴单元格 |
| CTRL + X | 剪切单元格 |
| CTRL + Z | 撤销 |
| CTRL + Y | 重做 |
| CTRL + A | 全选 |
| CTRL + B | 加粗 |
| CTRL + F | 查找 |
| CTRL + H | 替换 |
| CTRL + I | 斜体 |
| CTRL + UP/DOWN/LEFT/RIGHT | 快捷调整单元格选框 |
| SHIFT + UP/DOWN/LEFT/RIGHT | 调整选区 |
| CTRL + 鼠标左击 | 多选单元格 |
| SHIFT + 鼠标左击 | 调整选区 |
| UP/DOWN/LEFT/RIGHT | 移动单元格选框 |
| ENTER | 编辑单元格 |
| TAB | 向右移动单元格选框 |
| DELETE | 清除单元格数据 |
## 指引
如果您使用Luckysheet遇到了问题,按以下步骤来寻找答案
1. 使用多吉或者Google搜索常见技术问题
2. Luckysheet相关的问题优先查看[Luckysheet官方文档](https://dream-num.github.io/LuckysheetDocs/zh/)(注意标注TODO的功能暂未实现)
3. 搜索[常见问题列表](https://dream-num.github.io/LuckysheetDocs/zh/guide/FAQ.html)
4. 搜索[官方论坛](https://support.qq.com/product/288322),看看有没有人已经遇到过
5. 尝试自己检查或试验以找到答案
6. 请尝试阅读源代码以找到答案,
如果以上方法都没有解决您的问题,可以考虑:
- 去[官方论坛](https://support.qq.com/product/288322)提问
- 去Luckysheet官方微信群或者QQ群提问
- 发现有明显问题的或者需求无法满足的,直接提交[issues](https://github.com/mengshukeji/Luckysheet/issues)
> 推荐阅读 [提问的智慧](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/master/README-zh_CN.md)
同时,我们强烈推荐您帮助我们丰富Luckysheet社区
- 如果您发现文档或者代码有问题,您可以通过提交PR来贡献。所有合理的改动、优化、修正,或者文档的修正、更新相关的提交都会被接受
- 当您有了一部分使用或者二次开发Luckysheet的经验,我们鼓励您通过博文分享出来
File diff suppressed because it is too large Load Diff
+614
View File
@@ -0,0 +1,614 @@
# 单元格
## 基本单元格
单元格是Luckysheet中最基本的单位,每个单元格都会保存为一个对象,一个工作表的数据则会保存为一个由单元格对象组成的二维数组,并存入当前工作表的 `luckysheetfile[i].data`中。
单元格对象包含以下单元格属性
<table>
<tr>
<td>属性值</td>
<td>全称</td>
<td><div style="width:100px">说明</div></td>
<td>值示例</td>
<td>Aspose方法或者属性</td>
</tr>
<tr>
<td>ct</td>
<td>celltype</td>
<td>单元格值格式:文本、时间等</td>
<td><code>{
"fa": "General",
"t": "g"
}</code><a href="#cellStyle">单元格值格式</a></td>
<td></td>
</tr>
<tr>
<td>bg</td>
<td>background</td>
<td>背景颜色</td>
<td>#fff000</td>
<td>setBackgroundColor</td>
</tr>
<tr>
<td>ff</td>
<td>fontfamily</td>
<td>字体</td>
<td>0 Times New Roman、 1 Arial、2 Tahoma 、3 Verdana、4 微软雅黑、5 宋体(Song)、6 黑体(ST Heiti)、7 楷体(ST Kaiti)、 8 仿宋(ST FangSong)、9 新宋体(ST Song)、10 华文新魏、11 华文行楷、12 华文隶书</td>
<td>Style.Font object's Name property.</td>
</tr>
<tr>
<td>fc</td>
<td>fontcolor</td>
<td>字体颜色</td>
<td>#fff000</td>
<td>Style.Font object's Color property</td>
</tr>
<tr>
<td>bl</td>
<td>bold</td>
<td>粗体</td>
<td>0 常规 、 1加粗</td>
<td>Style.Font object's IsBold property to true.</td>
</tr>
<tr>
<td>it</td>
<td>italic</td>
<td>斜体</td>
<td>0 常规 、 1 斜体</td>
<td></td>
</tr>
<tr>
<td>fs</td>
<td>fontsize</td>
<td>字体大小</td>
<td>14</td>
<td>Style.Font object's Size property.</td>
</tr>
<tr>
<td>cl</td>
<td>cancelline</td>
<td>删除线</td>
<td>0 常规 、 1 删除线</td>
<td>Style.Font object's Underline property</td>
</tr>
<tr>
<td>un</td>
<td>underline</td>
<td>下划线</td>
<td>0 无 、 1 有</td>
<td></td>
</tr>
<tr>
<td>vt</td>
<td>verticaltype</td>
<td>垂直对齐</td>
<td>0 中间、1 上、2下</td>
<td>setVerticalAlignment</td>
</tr>
<tr>
<td>ht</td>
<td>horizontaltype</td>
<td>水平对齐</td>
<td>0 居中、1 左、2右</td>
<td>setHorizontalAlignment</td>
</tr>
<tr>
<td>mc</td>
<td>mergecell</td>
<td>合并单元格</td>
<td>主单元格{ r:0, c:0, rs: 2, cs:2 },辅单元格{ r:0, c:0 }<a href="#mergeCell">合并单元格案例</a></td>
<td>Merge</td>
</tr>
<tr>
<td>tr</td>
<td>textrotate</td>
<td>竖排文字</td>
<td>3</td>
<td>setRotationAngle</td>
</tr>
<tr>
<td>rt</td>
<td>rotatetext</td>
<td>文字旋转角度</td>
<td>介于0~180之间的整数,包含0和180</td>
<td>setRotationAngle</td>
</tr>
<tr>
<td>tb</td>
<td>textbeak</td>
<td>文本换行</td>
<td>0 截断、1溢出、2 自动换行</td>
<td>2setTextWrapped <br> 0和1IsTextWrapped =&nbsp;true</td>
</tr>
<tr>
<td>v</td>
<td>value</td>
<td>原始值</td>
<td></td>
<td></td>
</tr>
<tr>
<td>m</td>
<td>monitor</td>
<td>显示值</td>
<td></td>
<td></td>
</tr>
<tr>
<td>f</td>
<td>function</td>
<td>公式</td>
<td></td>
<td>setFormula <br> setArrayFormula <br> workbook.calculateFormula();</td>
</tr>
<tr>
<td>ps</td>
<td>comment</td>
<td>批注</td>
<td>
<code>
{<br>
height: 140,//批注框高度 <br>
width: 73,//批注框宽度 <br>
left: 75,//批注框距离左边工作表边缘位置 <br>
top: 22,//批注框距离上边工作表边缘位置 <br>
isshow: true,//是否显示批注<br>
value: "jhbk"//批注内容<br>
}
</code>
</td>
<td></td>
</tr>
</table>
一个规范的单元格对象如下:
```json
{
"ct": { //单元格值格式
"fa": "General", //格式名称为自动格式
"t": "n" //格式类型为数字类型
},
"v": 233, //内容的原始值为 233
"m": 233, //内容的显示值为 233
"bg": "#f6b26b", //背景为 "#f6b26b"
"ff": 1, // 字体为 "Arial"
"fc": "#990000", //字体颜色为 "#990000"
"bl": 1, //字体加粗
"it": 1, //字体斜体
"fs": 9, //字体大小为 9px
"cl": 1, //启用删除线
"ht": 0, //水平居中
"vt": 0, //垂直居中
"tr": 2, //文字旋转 -45°
"tb": 2, //文本自动换行
"ps": { //批注
"left": 92, //批注框左边距
"top": 10, //批注框上边距
"width": 91, //批注框宽度
"height": 48, //批注框高度
"value": "I am a comment", //批注内容
"isshow": true //批注框为显示状态
},
"f": "=SUM(233)" //单元格是一个求和公式
}
```
### 为什么会有原始值 `v` 和显示值 `m` 的区分?
Luckysheet在存储数字类型的内容时,支持多种格式转换,所以需要保留原始值来做更多处理,比如同样一个数字`1`,设置成百分比格式就是`"100%"`,设置成两位小数数字就是`"1.00"`
还有一个原因是日期和时间格式的内容原始值会存储为一个数字,默认情况下,Luckysheet把`1900-1-1 0:00:00`存储为`1`,把`1900-1-1 0:00:00`以后的每一个时刻存储为该时刻与`1900-1-1 0:00:00`这个时刻的差值(以天为单位)。比如`44127`就表示`2020-10-23`这一天。
以下是特殊格式的例子:
百分比 `100%`
```json
{
"ct": {
"fa": "0%",
"t": "n"
},
"v": 1,
"m": "100%"
}
```
小数 `1.00`
```json
{
"ct": {
"fa": "##0.00",
"t": "n"
},
"v": 1,
"m": "1.00"
}
```
日期 `2020-10-23`
```json
{
"ct": {
"fa": "yyyy-MM-dd",
"t": "d"
},
"v": 44127,
"m": "2020-10-23"
}
```
## 合并单元格<div id='mergeCell'></div>
设置一个合并单元格,需要处理两个地方,一是单元格对象中设置`mc`属性,二是在`config`中设置`merge`
比如,将"A1:B2"单元格合并为一个单元格
- 第一步:先设置四个单元格的参数
```json
[
[{
"m": "merge cell",
"ct": {
"fa": "General",
"t": "g"
},
"v": "merge cell",
"mc": { //合并单元格必备属性
"r": 0, //主单元格的行号
"c": 0, //主单元格的列号
"rs": 2, //合并单元格占的行数
"cs": 2 //合并单元格占的列数
}
}, {
"mc": {
"r": 0, //主单元格的行号
"c": 0, //主单元格的列号
}
}],
[{
"mc": {
"r": 0, //主单元格的行号
"c": 0, //主单元格的列号
}
}, {
"mc": {
"r": 0, //主单元格的行号
"c": 0, //主单元格的列号
}
}]
]
```
合并单元格的关键属性是`mc`,主单元格是选区范围中左上角的单元格,包含4个属性 r/c/rs/cs ,分别表示 row/column/rowspan/columnspan,在这里,就表示从主单元格A1(row 0 column 0)开始到右边2行下方2列的单元格进行合并,选区范围中的其他单元格则只需要设置主单元格位置即可。
- 第二步:再设置`config.merge`
```json
{
"0_0": {
"r": 0,
"c": 0,
"rs": 2,
"cs": 2
}
}
```
对象中的key为 `r + '_' + c` 的拼接值,value同主单元格的`mc`设置: r:行数,c:列数,rs:合并的行数,cs:合并的列数
> merge 详细参考:[表格数据config](/zh/guide/data.html#config)
## 含边框单元格
单元格的边框设置与合并单元格类似,需要在`config`中设置`borderInfo`,区别在于不需要设置单元格对象。
加入
比如,将"A1"单元格设置一个黑色细实线的全部边框
设置`config.borderInfo`为
```json
{
"rangeType": "range",
"borderType": "border-all",
"color": "#000",
"style": "1",
"range": [
{
"row": [ 0, 0 ],
"column": [0, 0]
}
]
}
```
而其单元格对象不需要增加设置,如下只是基础的内容和格式设置
```json
[
[
{
"m": "borderCell",
"ct": {
"fa": "General",
"t": "g"
},
"v": "borderCell"
}
]
]
```
> borderInfo 详细参考:[config.borderInfo](/zh/guide/sheet.html#config-borderinfo)
## 简化的单元格数据
特别强调的是,表格初始化的时候,采用的是`r/c/v`对象组成的一维数组格式,其中`v`的值一般是设置为单元格对象。为了节约后台的存储空间,`v`的值支持简写格式,直接写为一个字符串即可,渲染进Luckysheet后自动识别为自动格式即,`"ct": { "fa": "General", "t": "n" }`
以下为初始化3个单元格信息,第三个单元格即为简写格式:
```json
[
{
"r": 0,
"c": 0,
"v": {
"f": "=MAX(A7:A9)",
"ct": {
"fa": "General",
"t": "n"
},
"v": 100,
"m": "100"
}
},
{
"r": 0,
"c": 1,
"v": {
"f": "=SUM(A2)",
"bg": "#fff000",
"v": 12,
"m": "12"
}
},
{
"r": 0,
"c": 2,
"v": "value 2"
}
]
```
> 了解 [celldata的使用](/zh/guide/data.html#celldata)
## 单元格值格式<div id='cellStyle'></div>
值格式即为单元格对象中 `ct` 的设置,
如下为自动格式的单元格
```json
{
"ct": {
"fa": "General",
"t": "g"
},
"m": "2424",
"v": 2424
}
```
|参数|说明|值|
| ------------ | ------------ | ------------ |
|fa|Format格式的定义串| 如"General"|
|t|Type类型|如"g"|
### 可选择的设置如下
| 格式 | ct.fa | ct.t | m 值示例 |备注 |
|----------|----------|-------------------------|------------------------- |------------------------- |
| 自动 | General | g/n | Luckysheet |自动格式,也是默认的格式;单元格内容为数字时,`m`的值为`'n'`|
| 纯文本 | @ | s | Luckysheet ||
| <br><br><br>**数字格式** | | | | |
| 整数 | 0 | n | 1235 | 0位小数 ||
| 数字一位小数 | 0.0 | n | 1234.6 | 点后面0的个数就代表小数位数,如果原始数字位数大,设置位数小时会做四舍五入 |
| 数字两位小数 | 0.00 | n | 1234.56 ||
| 百分比整数 | 0% | n | 123456% |也支持 #0% 的用法|
| 百分比 | 0.00% | n | 123456.00% |也支持 #0.00% 的用法,点后面0的个数就代表小数位数|
| 科学计数 | 0.00E+00 | n | 1.23E+03 ||
| 科学计数 | ##0.0E+0 | n | 1.2E+3 ||
| 分数 | # ?/? | n | 1234 5/9 ||
| 分数 | # ??/?? | n | 1234 14/25 ||
| 万元 | w | n |12万3456||
| 万元2位小数 | w0.00 | n |12万3456.00||
| 会计 | ¥(0.00) | n ||
| 更多数字格式 | #,##0 | n | 1,235 ||
| 更多数字格式 | #,##0.00 | n | 1,234.56 ||
| 更多数字格式 | `#,##0_);(#,##0)` | n | 1,235 ||
| 更多数字格式 | `#,##0_);[Red](#,##0)` | n | 1,235 ||
| 更多数字格式 | `#,##0.00_);(#,##0.00)` | n | 1,234.56 ||
| 更多数字格式 | `#,##0.00_);[Red](#,##0.00)` | n | 1,234.56 ||
| 更多数字格式 | $#,##0_);($#,##0) | n | $1,235 ||
| 更多数字格式 | `$#,##0_);[Red]($#,##0)` | n | $1,235 ||
| 更多数字格式 | $#,##0.00_);($#,##0.00) | n | $1,234.56 ||
| 更多数字格式 | `$#,##0.00_);[Red]($#,##0.00)` | n | $1,234.56 ||
| 更多数字格式 | _($* #,##0_);_(...($* "-"_);_(@_) | n | $ 1,235 ||
| 更多数字格式 | _(* #,##0_);_(*..._(* "-"_);_(@_) | n | 1,235 ||
| 更多数字格式 | _($* #,##0.00_);_(...($* "-"_);_(@_) | n | $ 1,234.56 ||
| 更多数字格式 | _(* #,##0.00_);...* "-"??_);_(@_) | n | 1,234.56 ||
| <br><br><br>**时间日期格式** | | | | |
| 时间 | hh:mm AM/PM | d |10:23 AM||
| 时间24H | hh:mm | d |10:23||
| 日期时间 | yyyy-MM-dd hh:mm AM/PM | d |2020-07-29 10:23 AM||
| 日期时间24H | yyyy-MM-dd hh:mm | d |2020-07-29 10:23||
| 日期 | yyyy-MM-dd | d | 1930-08-05 ||
| 日期 | yyyy/MM/dd | d | 1930/8/5 ||
| 日期 | yyyy"年"M"月"d"日" | d | 1930年8月5日 ||
| 日期 | MM-dd | d | 08-05 ||
| 日期 | M-d | d | 8-5 ||
| 日期 | M"月"d"日" | d | 8月5日 ||
| 日期 | h:mm:ss | d | 13:30:30 ||
| 日期 | h:mm | d | 13:30 ||
| 日期 | AM/PM hh:mm | d | 下午01:30 ||
| 日期 | AM/PM h:mm | d | 下午1:30 ||
| 日期 | AM/PM h:mm:ss | d | 下午1:30:30 ||
| 日期 | MM-dd AM/PM hh:mm | d | 下08-05 下午01:30 ||
| <br><br><br>**货币格式** | | | | |
| 货币:人民币 | "¥" 0.00 | n | ¥ 123.00 |也支持 ¥ #.00 或者 ¥0.00|
| 货币:美元 | "$" 0.00 | n | $ 123.00 ||
| 货币:欧元 | "€" 0.00 | n | € 123.00 ||
| 货币:英镑 | "£" 0.00 | n | £ 123.00 ||
| 货币:港元 | "$" 0.00 | n | $ 123.00 ||
| 货币:日元 | "¥" 0.00 | n | ¥ 123.00 ||
| 货币:阿尔巴尼亚列克 | "Lek" 0.00 | n | Lek 123.00 ||
| 货币:阿尔及利亚第纳尔 | "din" 0.00 | n | din 123.00 ||
| 货币:阿富汗尼 | "Af" 0.00 | n | Af 123.00 ||
| 货币:阿根廷比索 | "$" 0.00 | n | $ 123.00 ||
| 货币:阿拉伯联合酋长国迪拉姆 | "dh" 0.00 | n | dh 123.00 ||
| 货币:阿鲁巴弗罗林 | "Afl" 0.00 | n | Afl 123.00 ||
| 货币:阿曼里亚尔 | "Rial" 0.00 | n | Rial 123.00 ||
| 货币:阿塞拜疆马纳特 | "?" 0.00 | n | ? 123.00 ||
| 货币:埃及镑 | "£" 0.00 | n | £ 123.00 ||
| 货币:埃塞俄比亚比尔 | "Birr" 0.00 | n | Birr 123.00 ||
| 货币:安哥拉宽扎 | "Kz" 0.00 | n | Kz 123.00 ||
| 货币:澳大利亚元 | "$" 0.00 | n | $ 123.00 ||
| 货币:澳门元 | "MOP" 0.00 | n | MOP 123.00 ||
| 货币:巴巴多斯元 | "$" 0.00 | n | $ 123.00 ||
| 货币:巴布亚新几内亚基那 | "PGK" 0.00 | n | PGK 123.00 ||
| 货币:巴哈马元 | "$" 0.00 | n | $ 123.00 ||
| 货币:巴基斯坦卢比 | "Rs" 0.00 | n | Rs 123.00 ||
| 货币:巴拉圭瓜拉尼 | "Gs" 0.00 | n | Gs 123.00 ||
| 货币:巴林第纳尔 | "din" 0.00 | n | din 123.00 ||
| 货币:巴拿马巴波亚 | "B/" 0.00 | n | B/ 123.00 ||
| 货币:巴西里亚伊 | "R$" 0.00 | n | R$ 123.00 ||
| 货币:白俄罗斯卢布 | "р" 0.00 | n | р 123.00 ||
| 货币:百慕大元 | "$" 0.00 | n | $ 123.00 ||
| 货币:保加利亚列弗 | "lev" 0.00 | n | lev 123.00 ||
| 货币:冰岛克朗 | "kr" 0.00 | n | kr 123.00 ||
| 货币:波黑可兑换马克 | "KM" 0.00 | n | KM 123.00 ||
| 货币:波兰兹罗提 | "z?" 0.00 | n | z? 123.00 ||
| 货币:玻利维亚诺 | "Bs" 0.00 | n | Bs 123.00 ||
| 货币:伯利兹元 | "$" 0.00 | n | $ 123.00 ||
| 货币:博茨瓦纳普拉 | "P" 0.00 | n | P 123.00 ||
| 货币:不丹努扎姆 | "Nu" 0.00 | n | Nu 123.00 ||
| 货币:布隆迪法郎 | "FBu" 0.00 | n | FBu 123.00 ||
| 货币:朝鲜圆 | "?KP" 0.00 | n | ?KP 123.00 ||
| 货币:丹麦克朗 | "kr" 0.00 | n | kr 123.00 ||
| 货币:东加勒比元 | "$" 0.00 | n | $ 123.00 ||
| 货币:多米尼加比索 | "RD$" 0.00 | n | RD$ 123.00 ||
| 货币:俄国卢布 | "?" 0.00 | n | ? 123.00 ||
| 货币:厄立特里亚纳克法 | "Nfk" 0.00 | n | Nfk 123.00 ||
| 货币:非洲金融共同体法郎 | "CFA" 0.00 | n | CFA 123.00 ||
| 货币:菲律宾比索 | "?" 0.00 | n | ? 123.00 ||
| 货币:斐济元 | "$" 0.00 | n | $ 123.00 ||
| 货币:佛得角埃斯库多 | "CVE" 0.00 | n | CVE 123.00 ||
| 货币:福克兰群岛镑 | "£" 0.00 | n | £ 123.00 ||
| 货币:冈比亚达拉西 | "GMD" 0.00 | n | GMD 123.00 ||
| 货币:刚果法郎 | "FrCD" 0.00 | n | FrCD 123.00 ||
| 货币:哥伦比亚比索 | "$" 0.00 | n | $ 123.00 ||
| 货币:哥斯达黎加科朗 | "?" 0.00 | n | ? 123.00 ||
| 货币:古巴比索 | "$" 0.00 | n | $ 123.00 ||
| 货币:古巴可兑换比索 | "$" 0.00 | n | $ 123.00 ||
| 货币:圭亚那元 | "$" 0.00 | n | $ 123.00 ||
| 货币:哈萨克斯坦坚戈 | "?" 0.00 | n | ? 123.00 ||
| 货币:海地古德 | "HTG" 0.00 | n | HTG 123.00 ||
| 货币:韩元 | "?" 0.00 | n | ? 123.00 ||
| 货币:荷属安的列斯盾 | "NAf." 0.00 | n | NAf. 123.00 ||
| 货币:洪都拉斯拉伦皮拉 | "L" 0.00 | n | L 123.00 ||
| 货币:吉布提法郎 | "Fdj" 0.00 | n | Fdj 123.00 ||
| 货币:吉尔吉斯斯坦索姆 | "KGS" 0.00 | n | KGS 123.00 ||
| 货币:几内亚法郎 | "FG" 0.00 | n | FG 123.00 ||
| 货币:加拿大元 | "$" 0.00 | n | $ 123.00 ||
| 货币:加纳塞地 | "GHS" 0.00 | n | GHS 123.00 ||
| 货币:柬埔寨瑞尔 | "Riel" 0.00 | n | Riel 123.00 ||
| 货币:捷克克朗 | "K?" 0.00 | n | K? 123.00 ||
| 货币:津巴布韦元 | "$" 0.00 | n | $ 123.00 ||
| 货币:卡塔尔里亚尔 | "Rial" 0.00 | n | Rial 123.00 ||
| 货币:开曼群岛元 | "$" 0.00 | n | $ 123.00 ||
| 货币:科摩罗法郎 | "CF" 0.00 | n | CF 123.00 ||
| 货币:科威特第纳尔 | "din" 0.00 | n | din 123.00 ||
| 货币:克罗地亚库纳 | "kn" 0.00 | n | kn 123.00 ||
| 货币:肯尼亚先令 | "Ksh" 0.00 | n | Ksh 123.00 ||
| 货币:莱索托洛蒂 | "LSL" 0.00 | n | LSL 123.00 ||
| 货币:老挝基普 | "?" 0.00 | n | ? 123.00 ||
| 货币:黎巴嫩镑 | "L£" 0.00 | n | L£ 123.00 ||
| 货币:立陶宛立特 | "Lt" 0.00 | n | Lt 123.00 ||
| 货币:利比亚第纳尔 | "din" 0.00 | n | din 123.00 ||
| 货币:利比亚元 | "$" 0.00 | n | $ 123.00 ||
| 货币:卢旺达法郎 | "RF" 0.00 | n | RF 123.00 ||
| 货币:罗马尼亚列伊 | "RON" 0.00 | n | RON 123.00 ||
| 货币:马达加斯加阿里亚里 | "Ar" 0.00 | n | Ar 123.00 ||
| 货币:马尔代夫拉菲亚 | "Rf" 0.00 | n | Rf 123.00 ||
| 货币:马拉维克瓦查 | "MWK" 0.00 | n | MWK 123.00 ||
| 货币:马来西亚林吉特 | "RM" 0.00 | n | RM 123.00 ||
| 货币:马其顿戴第纳尔 | "din" 0.00 | n | din 123.00 ||
| 货币:毛里求斯卢比 | "MURs" 0.00 | n | MURs 123.00 ||
| 货币:毛里塔尼亚乌吉亚 | "MRO" 0.00 | n | MRO 123.00 ||
| 货币:蒙古图格里克 | "?" 0.00 | n | ? 123.00 ||
| 货币:孟加拉塔卡 | "?" 0.00 | n | ? 123.00 ||
| 货币:秘鲁新索尔 | "S/" 0.00 | n | S/ 123.00 ||
| 货币:缅甸开亚特 | "K" 0.00 | n | K 123.00 ||
| 货币:摩尔多瓦列伊 | "MDL" 0.00 | n | MDL 123.00 ||
| 货币:摩洛哥迪拉姆 | "dh" 0.00 | n | dh 123.00 ||
| 货币:莫桑比克梅蒂卡尔 | "MTn" 0.00 | n | MTn 123.00 ||
| 货币:墨西哥比索 | "$" 0.00 | n | $ 123.00 ||
| 货币:纳米比亚元 | "$" 0.00 | n | $ 123.00 ||
| 货币:南非兰特 | "R" 0.00 | n | R 123.00 ||
| 货币:南苏丹镑 | "£" 0.00 | n | £ 123.00 ||
| 货币:尼加拉瓜科多巴 | "C$" 0.00 | n | C$ 123.00 ||
| 货币:尼泊尔卢比 | "Rs" 0.00 | n | Rs 123.00 ||
| 货币:尼日利亚奈拉 | "?" 0.00 | n | ? 123.00 ||
| 货币:挪威克朗 | "kr" 0.00 | n | kr 123.00 ||
| 货币:乔治亚拉瑞 | "GEL" 0.00 | n | GEL 123.00 ||
| 货币:人民币(离岸) | "¥" 0.00 | n | ¥ 123.00 ||
| 货币:瑞典克朗 | "kr" 0.00 | n | kr 123.00 ||
| 货币:瑞士法郎 | "CHF" 0.00 | n | CHF 123.00 ||
| 货币:塞尔维亚第纳尔 | "din" 0.00 | n | din 123.00 ||
| 货币:塞拉利昂利昂 | "SLL" 0.00 | n | SLL 123.00 ||
| 货币:塞舌尔卢比 | "SCR" 0.00 | n | SCR 123.00 ||
| 货币:沙特里亚尔 | "Rial" 0.00 | n | Rial 123.00 ||
| 货币:圣多美多布拉 | "Db" 0.00 | n | Db 123.00 ||
| 货币:圣赫勒拿群岛磅 | "£" 0.00 | n | £ 123.00 ||
| 货币:斯里兰卡卢比 | "Rs" 0.00 | n | Rs 123.00 ||
| 货币:斯威士兰里兰吉尼 | "SZL" 0.00 | n | SZL 123.00 ||
| 货币:苏丹镑 | "SDG" 0.00 | n | SDG 123.00 ||
| 货币:苏里南元 | "$" 0.00 | n | $ 123.00 ||
| 货币:所罗门群岛元 | "$" 0.00 | n | $ 123.00 ||
| 货币:索马里先令 | "SOS" 0.00 | n | SOS 123.00 ||
| 货币:塔吉克斯坦索莫尼 | "Som" 0.00 | n | Som 123.00 ||
| 货币:太平洋法郎 | "FCFP" 0.00 | n | FCFP 123.00 ||
| 货币:泰国铢 | "?" 0.00 | n | ? 123.00 ||
| 货币:坦桑尼亚先令 | "TSh" 0.00 | n | TSh 123.00 ||
| 货币:汤加潘加 | "T$" 0.00 | n | T$ 123.00 ||
| 货币:特立尼达和多巴哥元 | "$" 0.00 | n | $ 123.00 ||
| 货币:突尼斯第纳尔 | "din" 0.00 | n | din 123.00 ||
| 货币:土耳其里拉 | "?" 0.00 | n | ? 123.00 ||
| 货币:瓦努阿图瓦图 | "VUV" 0.00 | n | VUV 123.00 ||
| 货币:危地马拉格查尔 | "Q" 0.00 | n | Q 123.00 ||
| 货币:委内瑞拉博利瓦 | "Bs" 0.00 | n | Bs 123.00 ||
| 货币:文莱元 | "$" 0.00 | n | $ 123.00 ||
| 货币:乌干达先令 | "UGX" 0.00 | n | UGX 123.00 ||
| 货币:乌克兰格里夫尼亚 | "грн." 0.00 | n | грн. 123.00 ||
| 货币:乌拉圭比索 | "$" 0.00 | n | $ 123.00 ||
| 货币:乌兹别克斯坦苏姆 | "so?m" 0.00 | n | so?m 123.00 ||
| 货币:西萨摩亚塔拉 | "WST" 0.00 | n | WST 123.00 ||
| 货币:新加坡元 | "$" 0.00 | n | $ 123.00 ||
| 货币:新台币 | "NT$" 0.00 | n | NT$ 123.00 ||
| 货币:新西兰元 | "$" 0.00 | n | $ 123.00 ||
| 货币:匈牙利福林 | "Ft" 0.00 | n | Ft 123.00 ||
| 货币:叙利亚镑 | "£" 0.00 | n | £ 123.00 ||
| 货币:牙买加元 | "$" 0.00 | n | $ 123.00 ||
| 货币:亚美尼亚德拉姆 | "Dram" 0.00 | n | Dram 123.00 ||
| 货币:也门里亚尔 | "Rial" 0.00 | n | Rial 123.00 ||
| 货币:伊拉克第纳尔 | "din" 0.00 | n | din 123.00 ||
| 货币:伊朗里亚尔 | "Rial" 0.00 | n | Rial 123.00 ||
| 货币:以色列新谢克尔 | "?" 0.00 | n | ? 123.00 ||
| 货币:印度卢比 | "?" 0.00 | n | ? 123.00 ||
| 货币:印度尼西亚卢比 | "Rp" 0.00 | n | Rp 123.00 ||
| 货币:约旦第纳尔 | "din" 0.00 | n | din 123.00 ||
| 货币:越南盾 | "?" 0.00 | n | ? 123.00 ||
| 货币:赞比亚克瓦查 | "ZMW" 0.00 | n | ZMW 123.00 ||
| 货币:直布罗陀镑 | "£" 0.00 | n | £ 123.00 ||
| 货币:智利比索 | "$" 0.00 | n | $ 123.00 ||
| 货币:中非金融合作法郎 | "FCFA" 0.00 | n | FCFA 123.00 ||
以上配置参考了[Aspose.Cells](https://docs.aspose.com/display/cellsnet/List+of+Supported+Number+Formats#ListofSupportedNumberFormats-Aspose.Cells)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,222 @@
# 贡献指南
欢迎!我们很高兴您能来到这里,并非常期待您能有兴趣参与 Luckysheet 贡献。当然,在您参与 Luckysheet 贡献之前,请确保通读以下全文:
## 我们的行为准则
1. 我们保证尊重所有参与贡献的人,不限于提出问题、文档和代码贡献、解决bug以及其它贡献的人;
2. 我们有义务遵守当地法律法规,所有的附带法律风险的行为我们都是拒绝的;
3. 我们反对任何参与者存在贬损评论、人身攻击、骚扰或侮辱他人以及其他非专业行为;
4. 我们有权并有责任删除或编辑与此行为准则不符的内容,不限于代码、Issues、wiki、文档以及其它。不遵守行为准则的参与者可能会被移除团队;
5. 我们接受任何人的监督,任何人可通过问题反馈,向我们报告发现的与此行为准则不符的事实存在。
## 如何参与贡献?
* 贡献文档:浏览文档可以加深您对 Luckysheet 的了解,一旦发现文档写得不清晰或逻辑混乱的地方,可以订正、修改、补充,您可以通过 [中文论坛](https://support.qq.com/products/288322)或者 [谷歌论坛](https://groups.google.com/g/luckysheet)给予反馈
* 贡献代码:欢迎大家为 Luckysheet 社区贡献代码,欢迎您认领Open状态的 [Issues](https://github.com/mengshukeji/Luckysheet/issues) 和未完成的特性,提交PR,成为贡献者之一如果您在使用过程中发现有些功能无法满足您的需求或出现问题,请在Issues中记录
* 参与Issue讨论:您可以在任一 [Issues](https://github.com/mengshukeji/Luckysheet/issues) 下发表您的建议
* Review代码:您可以在 [Github](https://github.com/mengshukeji/Luckysheet)上看到所有贡献者提交的PR,您可以Review他们的代码并发表您的建议
## 如何提交 Issues
在您提交特性/改进前,应该注意以下几点:
* 请先确认该特性/改进是否被其他人已经提交
* 一个通俗易懂的标题来阐述你提交的Bug/提交特性/改进
* 如果是Bug则详细描述该bug产生的原因,如果能够复现,请尽量提供完整的重现步骤
* 如果是特性,那么该特性应该有广泛的适用性,适用于大部分用户,最好能够提供详尽的设计文档
* 如果是改进,尽可能描述清楚此改进所带来的益处
具体步骤:
* 创建 [Issues](https://github.com/mengshukeji/Luckysheet/issues) ,描述清楚问题
* 如果你要解决该issue则将issue assign到自己名下,如果你仅仅是提交Bug/特性/改进,并没有时间去贡献代码,则assignne设置为空
* 如果是比较大的特性/改进,尽量先输出设计文档,走 [Luckysheet RFC](https://github.com/mengshukeji/Luckysheet-rfcs) 流程,供其他人review
## 如何认领 Issues
在 Luckysheet 的 [Issues](https://github.com/mengshukeji/Luckysheet/issues) 列表中,有很多由其他人创建的issue并未被修复,如果你感兴趣的话,可以认领这些issue。认领步骤如下:
* 在该issue下留言,表达想认领该任务的想法,另注明 **@I can solve it** 即可
* 如果提交者没有意见,则将该issue assign到自己名下并及时更新进度
* 如果是比较大的特性,尽量先输出设计文档,走 [Luckysheet RFC](https://github.com/mengshukeji/Luckysheet-rfcs) 流程,供其他人review
* 开发代码并提交代码至github
## 如何提交代码
1. fork 到自己的仓库
进入  [Luckysheet](https://github.com/mengshukeji/Luckysheet)  的Github页面 ,点击右上角按钮 Fork 进行 Fork。
2. git clone 到本地
```shell
git clone https://github.com/<your_github_name>/Luckysheet.git
```
3. 上游建立连接
```shell
cd Luckysheet
git remote add upstream https://github.com/mengshukeji/Luckysheet.git
```
4. 创建开发分支
```shell
git checkout -b dev
```
5. 修改提交代码
```shell
git add . 
npm run commit
git push origin dev
```
6. 同步代码,将最新代码同步到本地
```shell
git fetch upstream 
git rebase upstream/master
```
7. 如果有冲突(没有可以忽略)
```shell
git status # 查看冲突文件,并修改冲突
git add .
git rebase --continue
```
提交git rebase --continue命令的时候,如果弹出vim提示编辑commit信息,则可以添加你的修改,然后保存退出
> vim命令请参考阅读[vim](https://www.runoob.com/linux/linux-vim.html)
8. 提交分支代码
```shell
git push origin dev
```
如果提示需要先pull 可以先拉取在提交
```shell
git pull origin dev
git push origin dev
```
若弹出vim提示编辑commit信息,可以直接通过vim命令退出
> vim命令请参考阅读[vim](https://www.runoob.com/linux/linux-vim.html)
9. 提交pr
去自己github仓库对应fork的项目,切换到刚刚创建修改的分支,点击new pull request,并添加上对应的描述,最后点击Create pull request进行提交
## 代码规范
> 一般性的代码规范示例
* 保持块深度最小。尽可能避免嵌套If条件
```js
// CORRECT
if (!comparison) return
if (variable) {
for (const item of items) {}
} else if (variable2) {
// Do something here
}
// INCORRECT
if (comparison) {
if (variable) {
for (const item in items) {}
} else if (variable2) {
// Do something here
}
} else {
return
}
```
* 不要使用操作数进行链比较
```js
// CORRECT
if (cb) cb()
if (!cb || (cb === fn)) cb()
// INCORRECT
cb && cb()
(!cb || (cb === fn)) && cb()
```
* 所有变量都应该按字母顺序在块的开头声明
```js
// CORRECT
function foo () {
const foo = 'bar'
const bar = 'foo'
if (conditional) {}
...
return foo
}
// INCORRECT
function foo () {
const foo = 'bar'
if (conditional) {}
const bar = 'foo'
...
return foo
}
```
* 尽快返回
```js
// CORRECT
if (condition) return 'foo'
if (condition2) return 'bar'
// Return must have a blank line above
return 'fizz'
// INCORRECT
const variable = ''
if (condition) {
variable = 'foo'
} else if (condition2) {
variable = 'bar'
} else {
variable = 'fizz'
}
return variable
```
## 如何贡献文档
## 如何成为Luckysheet Committer
任何人只要对 Luckysheet 项目做了贡献,那您就是官方承认的 Luckysheet 项目的Contributor了,从Contributor成长为Committer并没有一个确切的标准, 也没有任何预期的时间表,但是Committer的候选人一般都是长期活跃的贡献者,成为Committer并没有要求必须有巨大的架构改进贡献, 或者多少行的代码贡献,贡献代码、贡献文档、参与邮件列表的讨论、帮助回答问题等等都提升自己影响力的方式。
潜在贡献清单(无特定顺序):
* 提交自己发现的Bug、特性、改进到issue
* 更新官方文档使项目的文档是最近的、撰写 Luckysheet 的最佳实践、特性剖析的各种对用户有用的文档
* 执行测试并报告测试结果,性能测试与其他MQ的性能对比测试等
* 审查(Review)其他人的工作(包括代码和非代码)并发表你自己的建议
* 指导新加入的贡献者,熟悉社区流程
* 发表关于 Luckysheet 的博客
* 有利于 Luckysheet 社区发展的任何贡献
* ......
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,33 @@
# 教程与资源
开源软件离不开社区的贡献,这里将会列举出社区提供的教程、学习资料及配套解决方案。
如果您写了或者发现了优秀的教程想要推荐给我们,请直接[编辑此页](https://github.com/mengshukeji/Luckysheet/edit/master/docs/zh/guide/resource.md)提交PR。
## 博客
- [Luckysheet如何初始化含合并单元格的数据](https://www.cnblogs.com/DuShuSir/p/13272397.html)
- [Luckysheet如何把表格里的数据保存到数据库](https://www.cnblogs.com/DuShuSir/p/13857874.html)
- [本地HTML采用cdn加载方式引入Luckysheet的案例](https://www.cnblogs.com/DuShuSir/p/13859103.html)
- [Luckysheet基础用法,使用loadUrl加载服务端数据](https://blog.csdn.net/DCDC2020/article/details/108486525)
- [Luckysheet 导入与导出实现 - Java后台处理](https://blog.csdn.net/u014632228/article/details/109738221)
## 前端案例
### 社区案例
- [luckysheet-vue-importAndExport](https://github.com/oy-paddy/luckysheet-vue-importAndExport/tree/master/)
## 后端案例
### 官方案例
- [Java 后台 Luckysheet Server](https://github.com/mengshukeji/LuckysheetServer)
### 社区案例
- [Luckysheet保存与恢复](https://gitee.com/ichiva/luckysheet-saved-in-recovery)Java版)
- [基于Luckysheet实现的协同编辑在线表格](https://github.com/DilemmaVi/ecsheet)Java版)
- [简易的Express服务端示例 个人应用模板](https://github.com/TitanRGB/Luckysheet-ExpressReact-Example) (Node-Express版)
- [使用.net core 3.1和Npoi 制作基于LuckSheet的基础导出](https://gitee.com/xiong-kangli/luck-sheet_.-net-core).NET 版本)
- [go语言版本的协同编辑](https://github.com/fandypeng/excel2config)Go 版本)
## 学习资料
- [如何从0到1搭建 Web 数据分析报表](https://github.com/mengshukeji/LuckyResources/blob/master/ppt/%E5%A6%82%E4%BD%95%E4%BB%8E0%E5%88%B01%E6%90%AD%E5%BB%BA%20Web%20%E6%95%B0%E6%8D%AE%E5%88%86%E6%9E%90%E6%8A%A5%E8%A1%A8.pptx)
File diff suppressed because it is too large Load Diff