Commit 610db13b authored by 宁天庆's avatar 宁天庆

撒发生

parents
node_modules
released
dist
amosqms_dist
amosqms_mfcard
lib
zip
*.zip
*.rar
umd_lib
mf_lib
saas_build
qms-saas
qms-saas-*
qmssaas_dist
/codereview
/external
.github
.vs
aaa
dist33
_env
_mock
.vscode
doc
src
node_modules
dist
.editorconfig
.eslintignore
.eslintrc.js
.gitignore
.npmignore
.npmrc
.prettierignore
.prettierrc
.project
/.umdrc.js
*.bat
*.dat
*.html
gulpfile.js
package-lock=false
save=false
# registry=https://registry.npmjs.org/
registry=http://47.92.103.240:17358/
This diff is collapsed.
File added
{
"liveServer.settings.port": 5501
}
\ No newline at end of file
This diff is collapsed.
The MIT License (MIT)
Copyright (c) 2020-present, Mengshukeji
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
module.exports = {
extends: ['@commitlint/config-conventional']
}
# deploy Demo
npm run build
cd dist
git init
git remote add origin https://github.com/mengshukeji/LuckysheetDemo.git
git config --local user.email "1414556676@qq.com"
git config --local user.name "Dushusir"
git add .
git commit -m 'deploy Luckysheet demo'
git push -f origin master:gh-pages
# ===============================================
# deploy Docs
npm run docs:build
cd docs/.vuepress/dist
git init
git remote add origin https://github.com/mengshukeji/LuckysheetDocs.git
git add .
git commit -m 'deploy Luckysheet docs'
git push -f origin master:gh-pages
# ===============================================
# add a tags
git tag -a doc -m "doc"
# replease
npm run build
npm run release -- --release-as patch
git push --follow-tags origin master
npm publish
# only publish
npm run build
git add .
npm run commit
npm version patch
git push -u origin master
npm publish
# ==============================================
# test feature branch
git checkout -b fea origin/feature
git pull
## After some test, create PR merge feature to master branch
git checkout master
git branch -d fea
# ===============================================
# test pull request: https://docs.github.com/cn/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/checking-out-pull-requests-locally
# 139 is ID, dev is branch name
git fetch origin pull/139/head:test-139
git checkout test-139
# test code
git push origin test-139
# create new PR ,merge test-139 to master
# list all remote and local branchs
git branch -a
# delete remote branch
git push origin --delete dev
git checkout master
# delete local branch
git branch -d dev
# pr
## 1. fork 到自己的仓库
## 2. git clone 到本地
## 3. 上游建立连接
git remote add upstream https://github.com/mengshukeji/Luckysheet.git
## 4. 创建开发分支
git checkout -b dev
## 5. 修改提交代码
git add .
git commit -m "add"
git push origin dev
## 6. 同步代码,将最新代码同步到本地
git fetch upstream
git rebase upstream/master
## 7. 如果有冲突(没有可以略过)
git status # 查看冲突文件,并修改冲突
git add .
git rebase --continue
## 8.提交分支代码
git push origin dev
## 7. 提交pr
去自己github仓库对应fork的项目下new pull request
\ No newline at end of file
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),
}
}
}
\ No newline at end of file
---
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
---
\ No newline at end of file
# 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)
\ No newline at end of file
# 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>
\ No newline at end of file
# 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)
- *勇 ¥ 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
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# 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 don’t 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
* ......
This diff is collapsed.
This diff is collapsed.
# 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)
- [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]
\ No newline at end of file
This diff is collapsed.
---
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
---
\ No newline at end of file
# 认识团队
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)
\ No newline at end of file
# 社区案例
我们搜集到了很多来自社区的案例反馈,还发现了以前我们没有预想到的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>
\ No newline at end of file
# 赞助
## 为什么赞助
如果您经营一家企业并在盈利产品中使用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捐赠的资金由透明费用管理,将用于补偿核心团队成员的工作和费用或赞助社区活动。 通过在任一平台上捐款,您的姓名/徽标将得到适当的认可和曝光。
## 赞助者列表
(按时间顺序排列)
- *勇 ¥ 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
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# 贡献指南
欢迎!我们很高兴您能来到这里,并非常期待您能有兴趣参与 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 社区发展的任何贡献
* ......
This diff is collapsed.
# 教程与资源
开源软件离不开社区的贡献,这里将会列举出社区提供的教程、学习资料及配套解决方案。
如果您写了或者发现了优秀的教程想要推荐给我们,请直接[编辑此页](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版)
- [使用.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)
\ No newline at end of file
This diff is collapsed.
const gulp = require('gulp');
// gulp core function
const { src, dest, series, parallel, watch } = require('gulp');
// gulp compress js
const uglify = require('gulp-uglify');
// gulp judgment
const gulpif = require('gulp-if');
// gulp compress css
const cleanCSS = require('gulp-clean-css');
// Delete Files
const del = require('delete');
// Refresh the browser in real time
const browserSync = require('browser-sync').create();
const reload = browserSync.reload;
// proxy
const { createProxyMiddleware } = require('http-proxy-middleware');
// According to html reference, files are merged
// const useref = require('gulp-useref');
// File merge
const concat = require('gulp-concat');
// rollup packaging, processing es6 modules
const { rollup } = require('rollup');
// rollup looks for node_modules module
const { nodeResolve } = require('@rollup/plugin-node-resolve');
// rollup converts commonjs module to es6 module
const commonjs = require('@rollup/plugin-commonjs');
// rollup code compression
const terser = require('rollup-plugin-terser').terser;
// rollup babel plugin, support the latest ES grammar
const babel = require('@rollup/plugin-babel').default;
// const gulpBabel = require('gulp-babel');
// Distinguish development and production environments
const production = process.env.NODE_ENV === 'production' ? true : false;
const pkg = require('./package.json');
const banner = `/*! @preserve
* ${pkg.name}
* version: ${pkg.version}
* https://github.com/mengshukeji/Luckysheet
*/`;
// uglify js Compression configuration https://github.com/mishoo/UglifyJS#minify-options
const uglifyOptions = {
compress: {
drop_console: true
}
}
// babel config
const babelConfig = {
compact: false,
babelHelpers: 'bundled',
exclude: 'node_modules/**', // Only compile our source code
plugins: [
],
presets: [
['@babel/preset-env', {
useBuiltIns: 'usage',
corejs: 3,
targets: {
chrome: 58,
ie: 11
}
}]
]
};
// file handler paths
const paths = {
// static resources,contains index.html, fonts and images,and extension plugins dependency
staticHtml: ['src/*.html'],
staticFonts: ['src/fonts/**'],
staticAssets: ['src/assets/**'],
staticImages: ['src/plugins/images/*.png'],
staticExpendPlugins: ['src/expendPlugins/**', '!src/expendPlugins/**/plugin.js'],
staticDemoData: ['src/demoData/*.js'],
staticCssImages: ['src/css/**', '!src/css/*.css'],
// static resources dest
destStaticHtml: ['dist'],
destStaticFonts: ['dist/fonts'],
destStaticAssets: ['dist/assets'],
destStaticImages: ['dist/plugins/images'],
destStaticExpendPlugins: ['dist/expendPlugins'],
destStaticDemoData: ['dist/demoData'],
destStaticCssImages: ['dist/css'],
//core es module
core: ['src/**/*.js', '!src/demoData/*.js', 'src/expendPlugins/**/plugin.js', '!src/plugins/js/*.js'],
//plugins src
pluginsCss: ['src/plugins/css/*.css'],
plugins: ['src/plugins/*.css'],
css: ['src/css/*.css', 'node_modules/flatpickr/dist/themes/light.css'],
pluginsJs: [
'node_modules/jquery/dist/jquery.min.js',
'node_modules/uuid/dist/umd/uuid.min.js',
'node_modules/exceljs/dist/exceljs.min.js',
'src/plugins/js/clipboard.min.js',
'src/plugins/js/spectrum.min.js',
'src/plugins/js/jquery-ui.min.js',
'src/plugins/js/jquery.mousewheel.min.js',
// 'src/plugins/js/numeral.min.js',
'src/plugins/js/html2canvas.min.js',
'src/plugins/js/localforage.min.js',
'src/plugins/js/lodash.min.js',
'src/plugins/js/jstat.min.js',
'src/plugins/js/crypto-api.min.js',
'src/plugins/js/jquery.sPage.min.js'
],
//plugins concat
concatPluginsCss: 'pluginsCss.css',
concatPlugins: 'plugins.css',
concatCss: 'luckysheet.css',
concatPluginsJs: 'plugin.js',
//plugins dest
destPluginsCss: ['dist/plugins/css'],
destPlugins: ['dist/plugins'],
destCss: ['dist/css'],
destPluginsJs: ['dist/plugins/js'],
// Package directory
dist: 'dist',
};
// Clear the dist directory
function clean() {
return del([paths.dist]);
}
// proxy middleware
const apiProxy = createProxyMiddleware('/luckysheet/', {
target: 'http://luckysheet.lashuju.com/', // set your server address
changeOrigin: true, // for vhosted sites
ws: true, // proxy websockets
});
// Static server
function serve(done) {
browserSync.init({
server: {
baseDir: paths.dist,
middleware: [apiProxy],//proxy
},
ghostMode: false, //默认true,滚动和表单在任何设备上输入将被镜像到所有设备里,会影响本地的协同编辑消息,故关闭
}, done)
}
// Monitoring file changes
function watcher(done) {
watch(paths.core, { delay: 500 }, series(core, reloadBrowser));
// watch plugins and css
watch(paths.pluginsCss, { delay: 500 }, series(pluginsCss, reloadBrowser));
watch(paths.plugins, { delay: 500 }, series(plugins, reloadBrowser));
watch(paths.css, { delay: 500 }, series(css, reloadBrowser));
watch(paths.pluginsJs, { delay: 500 }, series(pluginsJs, reloadBrowser));
// watch static
watch(paths.staticHtml, { delay: 500 }, series(copyStaticHtml, reloadBrowser));
watch(paths.staticFonts, { delay: 500 }, series(copyStaticFonts, reloadBrowser));
watch(paths.staticAssets, { delay: 500 }, series(copyStaticAssets, reloadBrowser));
watch(paths.staticImages, { delay: 500 }, series(copyStaticImages, reloadBrowser));
watch(paths.staticExpendPlugins, { delay: 500 }, series(copyStaticExpendPlugins, reloadBrowser));
watch(paths.staticDemoData, { delay: 500 }, series(copyStaticDemoData, reloadBrowser));
watch(paths.staticCssImages, { delay: 500 }, series(copyStaticCssImages, reloadBrowser));
done();
}
// Refresh browser
function reloadBrowser(done) {
reload();
done();
}
//Package the core code
async function core_rollup() {
const bundle = await rollup({
input: 'src/index.js',
plugins: [
nodeResolve(), // tells Rollup how to find date-fns in node_modules
commonjs(), // converts date-fns to ES modules
// postcss({
// plugins: [],
// extract: true,
// // minimize: isProductionEnv,
// }),
production && terser(), // minify, but only in production
babel(babelConfig)
],
});
bundle.write({
file: 'dist/luckysheet.umd.js',
format: 'umd',
name: 'luckysheet',
sourcemap: true,
inlineDynamicImports: true,
banner: banner
});
if (production) {
bundle.write({
file: 'dist/luckysheet.esm.js',
format: 'esm',
name: 'luckysheet',
sourcemap: true,
inlineDynamicImports: true,
banner: banner
});
}
}
async function core() {
await require('esbuild').buildSync({
format: 'iife',
globalName: 'luckysheet',
entryPoints: ['src/index.js'],
bundle: true,
minify: production,
banner: { js: banner },
target: ['es2020'],
sourcemap: true,
outfile: 'dist/luckysheet.umd.js',
})
}
// According to the build tag in html, package js and css
function pluginsCss() {
return src(paths.pluginsCss)
.pipe(concat(paths.concatPluginsCss))
.pipe(gulpif(production, cleanCSS()))
.pipe(dest(paths.destPluginsCss))
}
function plugins() {
return src(paths.plugins)
.pipe(concat(paths.concatPlugins))
.pipe(gulpif(production, cleanCSS()))
.pipe(dest(paths.destPlugins));
}
function css() {
return src(paths.css)
.pipe(concat(paths.concatCss))
.pipe(gulpif(production, cleanCSS()))
.pipe(dest(paths.destCss));
}
function pluginsJs() {
return src(paths.pluginsJs)
.pipe(concat(paths.concatPluginsJs))
.pipe(gulpif(production, uglify(uglifyOptions)))
.pipe(dest(paths.destPluginsJs));
}
// Copy static resources
function copyStaticHtml() {
return src(paths.staticHtml)
.pipe(dest(paths.destStaticHtml));
}
function copyStaticFonts() {
return src(paths.staticFonts)
.pipe(dest(paths.destStaticFonts));
}
function copyStaticAssets() {
return src(paths.staticAssets)
.pipe(dest(paths.destStaticAssets));
}
function copyStaticImages() {
return src(paths.staticImages)
.pipe(dest(paths.destStaticImages));
}
function copyStaticExpendPlugins() {
return src(paths.staticExpendPlugins)
.pipe(dest(paths.destStaticExpendPlugins));
}
function copyStaticDemoData() {
return src(paths.staticDemoData)
.pipe(dest(paths.destStaticDemoData));
// .pipe(gulpBabel({
// presets: ['@babel/env']
// }))
// .pipe(gulp.dest('dist'));
}
function copyStaticCssImages() {
return src(paths.staticCssImages)
.pipe(dest(paths.destStaticCssImages));
}
const dev = series(clean, parallel(pluginsCss, plugins, css, pluginsJs, copyStaticHtml, copyStaticFonts, copyStaticAssets, copyStaticImages, copyStaticExpendPlugins, copyStaticDemoData, copyStaticCssImages, core), watcher, serve);
const build = series(clean, parallel(pluginsCss, plugins, css, pluginsJs, copyStaticHtml, copyStaticFonts, copyStaticAssets, copyStaticImages, copyStaticExpendPlugins, copyStaticDemoData, copyStaticCssImages, core));
exports.dev = dev;
exports.build = build;
exports.default = dev;
{
"name": "@cloudqms/luckysheet",
"version": "2.1.20",
"main": "lib/index.js",
"devDependencies": {
"@babel/runtime": "^7.12.1",
"@babel/core": "^7.12.3",
"@babel/preset-env": "^7.12.1",
"@babel/runtime-corejs3": "^7.12.1",
"@commitlint/cli": "^9.1.1",
"@commitlint/config-conventional": "^9.1.1",
"@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-commonjs": "^13.0.0",
"@rollup/plugin-node-resolve": "^8.0.1",
"browser-sync": "^2.26.7",
"commitizen": "^4.1.2",
"cross-env": "^7.0.2",
"delete": "^1.1.0",
"gulp": "^4.0.2",
"gulp-babel": "^8.0.0",
"gulp-clean-css": "^4.3.0",
"gulp-concat": "^2.6.1",
"gulp-if": "^3.0.0",
"gulp-uglify": "^3.0.2",
"gulp-useref": "^4.0.1",
"http-proxy-middleware": "^1.0.6",
"rollup": "^2.32.1",
"rollup-plugin-terser": "^6.1.0",
"standard-version": "^8.0.2",
"uuid": "^8.3.2",
"vuepress": "^1.5.0",
"esbuild": "^0.11.6",
"vuepress-plugin-baidu-autopush": "^1.0.1",
"vuepress-plugin-code-copy": "^1.0.6",
"vuepress-plugin-seo": "^0.1.4",
"vuepress-plugin-sitemap": "^2.3.1"
},
"dependencies": {
"dayjs": "^1.9.6",
"escape-html": "^1.0.3",
"exceljs": "^4.4.0",
"file-saver": "^2.0.5",
"flatpickr": "^4.0.9",
"jquery": "^2.2.4",
"jspdf": "^1.3.3",
"numeral": "^2.0.6",
"pako": "^1.0.11"
},
"scripts": {
"build": "ray-build react && ray-build stylescss",
"dev": "cross-env NODE_ENV=development gulp dev",
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs",
"release": "standard-version"
},
"publishConfig": {
"registry": "http://47.92.103.240:17358",
"access": "public"
}
}
\ No newline at end of file
/* Logo 字体 */
@font-face {
font-family: "iconfont logo";
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834');
src: url('https://at.alicdn.com/t/font_985780_km7mi63cihi.eot?t=1545807318834#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.woff?t=1545807318834') format('woff'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.ttf?t=1545807318834') format('truetype'),
url('https://at.alicdn.com/t/font_985780_km7mi63cihi.svg?t=1545807318834#iconfont') format('svg');
}
.logo {
font-family: "iconfont logo";
font-size: 160px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* tabs */
.nav-tabs {
position: relative;
}
.nav-tabs .nav-more {
position: absolute;
right: 0;
bottom: 0;
height: 42px;
line-height: 42px;
color: #666;
}
#tabs {
border-bottom: 1px solid #eee;
}
#tabs li {
cursor: pointer;
width: 100px;
height: 40px;
line-height: 40px;
text-align: center;
font-size: 16px;
border-bottom: 2px solid transparent;
position: relative;
z-index: 1;
margin-bottom: -1px;
color: #666;
}
#tabs .active {
border-bottom-color: #f00;
color: #222;
}
.tab-container .content {
display: none;
}
/* 页面布局 */
.main {
padding: 30px 100px;
width: 960px;
margin: 0 auto;
}
.main .logo {
color: #333;
text-align: left;
margin-bottom: 30px;
line-height: 1;
height: 110px;
margin-top: -50px;
overflow: hidden;
*zoom: 1;
}
.main .logo a {
font-size: 160px;
color: #333;
}
.helps {
margin-top: 40px;
}
.helps pre {
padding: 20px;
margin: 10px 0;
border: solid 1px #e7e1cd;
background-color: #fffdef;
overflow: auto;
}
.icon_lists {
width: 100% !important;
overflow: hidden;
*zoom: 1;
}
.icon_lists li {
width: 100px;
margin-bottom: 10px;
margin-right: 20px;
text-align: center;
list-style: none !important;
cursor: default;
}
.icon_lists li .code-name {
line-height: 1.2;
}
.icon_lists .icon {
display: block;
height: 100px;
line-height: 100px;
font-size: 42px;
margin: 10px auto;
color: #333;
-webkit-transition: font-size 0.25s linear, width 0.25s linear;
-moz-transition: font-size 0.25s linear, width 0.25s linear;
transition: font-size 0.25s linear, width 0.25s linear;
}
.icon_lists .icon:hover {
font-size: 100px;
}
.icon_lists .svg-icon {
/* 通过设置 font-size 来改变图标大小 */
width: 1em;
/* 图标和文字相邻时,垂直对齐 */
vertical-align: -0.15em;
/* 通过设置 color 来改变 SVG 的颜色/fill */
fill: currentColor;
/* path 和 stroke 溢出 viewBox 部分在 IE 下会显示
normalize.css 中也包含这行 */
overflow: hidden;
}
.icon_lists li .name,
.icon_lists li .code-name {
color: #666;
}
/* markdown 样式 */
.markdown {
color: #666;
font-size: 14px;
line-height: 1.8;
}
.highlight {
line-height: 1.5;
}
.markdown img {
vertical-align: middle;
max-width: 100%;
}
.markdown h1 {
color: #404040;
font-weight: 500;
line-height: 40px;
margin-bottom: 24px;
}
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
color: #404040;
margin: 1.6em 0 0.6em 0;
font-weight: 500;
clear: both;
}
.markdown h1 {
font-size: 28px;
}
.markdown h2 {
font-size: 22px;
}
.markdown h3 {
font-size: 16px;
}
.markdown h4 {
font-size: 14px;
}
.markdown h5 {
font-size: 12px;
}
.markdown h6 {
font-size: 12px;
}
.markdown hr {
height: 1px;
border: 0;
background: #e9e9e9;
margin: 16px 0;
clear: both;
}
.markdown p {
margin: 1em 0;
}
.markdown>p,
.markdown>blockquote,
.markdown>.highlight,
.markdown>ol,
.markdown>ul {
width: 80%;
}
.markdown ul>li {
list-style: circle;
}
.markdown>ul li,
.markdown blockquote ul>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown>ul li p,
.markdown>ol li p {
margin: 0.6em 0;
}
.markdown ol>li {
list-style: decimal;
}
.markdown>ol li,
.markdown blockquote ol>li {
margin-left: 20px;
padding-left: 4px;
}
.markdown code {
margin: 0 3px;
padding: 0 5px;
background: #eee;
border-radius: 3px;
}
.markdown strong,
.markdown b {
font-weight: 600;
}
.markdown>table {
border-collapse: collapse;
border-spacing: 0px;
empty-cells: show;
border: 1px solid #e9e9e9;
width: 95%;
margin-bottom: 24px;
}
.markdown>table th {
white-space: nowrap;
color: #333;
font-weight: 600;
}
.markdown>table th,
.markdown>table td {
border: 1px solid #e9e9e9;
padding: 8px 16px;
text-align: left;
}
.markdown>table th {
background: #F7F7F7;
}
.markdown blockquote {
font-size: 90%;
color: #999;
border-left: 4px solid #e9e9e9;
padding-left: 0.8em;
margin: 1em 0;
}
.markdown blockquote p {
margin: 0;
}
.markdown .anchor {
opacity: 0;
transition: opacity 0.3s ease;
margin-left: 8px;
}
.markdown .waiting {
color: #ccc;
}
.markdown h1:hover .anchor,
.markdown h2:hover .anchor,
.markdown h3:hover .anchor,
.markdown h4:hover .anchor,
.markdown h5:hover .anchor,
.markdown h6:hover .anchor {
opacity: 1;
display: inline-block;
}
.markdown>br,
.markdown>p>br {
clear: both;
}
.hljs {
display: block;
background: white;
padding: 0.5em;
color: #333333;
overflow-x: auto;
}
.hljs-comment,
.hljs-meta {
color: #969896;
}
.hljs-string,
.hljs-variable,
.hljs-template-variable,
.hljs-strong,
.hljs-emphasis,
.hljs-quote {
color: #df5000;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-type {
color: #a71d5d;
}
.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-attribute {
color: #0086b3;
}
.hljs-section,
.hljs-name {
color: #63a35c;
}
.hljs-tag {
color: #333333;
}
.hljs-title,
.hljs-attr,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #795da3;
}
.hljs-addition {
color: #55a532;
background-color: #eaffea;
}
.hljs-deletion {
color: #bd2c00;
background-color: #ffecec;
}
.hljs-link {
text-decoration: underline;
}
/* 代码高亮 */
/* PrismJS 1.15.0
https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript */
/**
* prism.js default theme for JavaScript, CSS and HTML
* Based on dabblet (http://dabblet.com)
* @author Lea Verou
*/
code[class*="language-"],
pre[class*="language-"] {
color: black;
background: none;
text-shadow: 0 1px white;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
text-align: left;
white-space: pre;
word-spacing: normal;
word-break: normal;
word-wrap: normal;
line-height: 1.5;
-moz-tab-size: 4;
-o-tab-size: 4;
tab-size: 4;
-webkit-hyphens: none;
-moz-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
pre[class*="language-"]::-moz-selection,
pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection,
code[class*="language-"] ::-moz-selection {
text-shadow: none;
background: #b3d4fc;
}
pre[class*="language-"]::selection,
pre[class*="language-"] ::selection,
code[class*="language-"]::selection,
code[class*="language-"] ::selection {
text-shadow: none;
background: #b3d4fc;
}
@media print {
code[class*="language-"],
pre[class*="language-"] {
text-shadow: none;
}
}
/* Code blocks */
pre[class*="language-"] {
padding: 1em;
margin: .5em 0;
overflow: auto;
}
:not(pre)>code[class*="language-"],
pre[class*="language-"] {
background: #f5f2f0;
}
/* Inline code */
:not(pre)>code[class*="language-"] {
padding: .1em;
border-radius: .3em;
white-space: normal;
}
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
color: slategray;
}
.token.punctuation {
color: #999;
}
.namespace {
opacity: .7;
}
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
color: #905;
}
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
color: #690;
}
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
color: #9a6e3a;
background: hsla(0, 0%, 100%, .5);
}
.token.atrule,
.token.attr-value,
.token.keyword {
color: #07a;
}
.token.function,
.token.class-name {
color: #DD4A68;
}
.token.regex,
.token.important,
.token.variable {
color: #e90;
}
.token.important,
.token.bold {
font-weight: bold;
}
.token.italic {
font-style: italic;
}
.token.entity {
cursor: help;
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/**
* The default luckysheet config object.
*/
export default {
container: "luckysheet", //容器的ID
loading:{}, //自定义loading
column: 60, //空表格默认的列数量
row: 84, //空表格默认的行数据量
allowCopy: true, //是否允许拷贝
showtoolbar: true, //是否第二列显示工具栏
showinfobar: true, //是否显示顶部名称栏
showsheetbar: true, //是否显示底部表格名称区域
showstatisticBar: true, //是否显示底部计数栏
pointEdit: false, //是否是编辑器插入表格模式
pointEditUpdate: null, //编辑器表格更新函数
pointEditZoom: 1, //编辑器表格编辑时缩放比例
// menu: "undo|redo|freezenrow|freezencolumn|download|share|chart|pivot",
data: [{ "name": "Sheet1", color: "", "status": "1", "order": "0", "data": [], "config": {}, "index":0 }, { "name": "Sheet2", color: "", "status": "0", "order": "1", "data": [], "config": {}, "index":1 }, { "name": "Sheet3", color: "", "status": "0", "order": "2", "data": [], "config": {}, "index":2 }], //客户端sheet数据[sheet1, sheet2, sheet3]
title: "Luckysheet Demo", //表格的名称
userInfo:false,// 右上角的用户信息展示样式,支持 1. boolean类型:false:不展示,ture:展示默认 '<i style="font-size:16px;color:#ff6a00;" class="fa fa-taxi" aria-hidden="true"></i> rabbit' ,2. HTML模板字符串或者普通字符串,如:'<i style="font-size:16px;color:#ff6a00;" class="fa fa-taxi" aria-hidden="true"></i> Lucky'或者'用户名', 3. 对象格式,设置 userImage:用户头像地址 和 userName:用户名 4. 不设置或者设置undefined同设置false
userMenuItem: [{url:"www.baidu.com", "icon":'<i class="fa fa-folder" aria-hidden="true"></i>', "name":"我的表格"}, {url:"www.baidu.com", "icon":'<i class="fa fa-sign-out" aria-hidden="true"></i>', "name":"退出登陆"}], //点击右上角的用户信息弹出的菜单
myFolderUrl: "www.baidu.com", //左上角<返回按钮的链接
config: {}, //表格行高、列宽、合并单元格、公式等设置
fullscreenmode: true, //是否全屏模式,非全屏模式下,标记框不会强制选中。
devicePixelRatio: window.devicePixelRatio, //设备比例,比例越大表格分标率越高
allowEdit: true, //是否允许前台编辑
loadUrl: "", // 配置loadUrl的地址,luckysheet会通过ajax请求表格数据,默认载入status为1的sheet数据中的所有data,其余的sheet载入除data字段外的所有字段
loadSheetUrl: "", //配置loadSheetUrl的地址,参数为gridKey(表格主键) 和 index(sheet主键合集,格式为[1,2,3]),返回的数据为sheet的data字段数据集合
gridKey: "", // 表格唯一标识符
updateUrl: "", //表格数据的更新地址
updateImageUrl: "", //缩略图的更新地址
allowUpdate: false, //是否允许编辑后的后台更新
functionButton: "", //右上角功能按钮,例如'<button id="" class="btn btn-primary" style="padding:3px 6px;font-size: 12px;margin-right: 10px;">下载</button> <button id="" class="btn btn-primary btn-danger" style=" padding:3px 6px; font-size: 12px; margin-right: 10px;">分享</button> <button id="luckysheet-share-btn-title" class="btn btn-primary btn-danger" style=" padding:3px 6px; font-size: 12px; margin-right: 10px;">秀数据</button>'
showConfigWindowResize: true, //图表和数据透视表的配置会在右侧弹出,设置弹出后表格是否会自动缩进
enableAddRow: true,//允许添加行
enableAddBackTop: true,//允许回到顶部
// enablePage: false,//允许加载下一页
autoFormatw: false, //自动格式化超过4位数的数字为 亿万格式 例:true or "true" or "TRUE"
accuracy: undefined, //设置传输来的数值的精确位数,小数点后n位 传参数为数字或数字字符串,例: "0" 或 0
pageInfo:{
'queryExps':'',
'reportId':'',
'fields':'',
'mobile':'',
'frezon':'',
'currentPage':'',
"totalPage":10,
"pageUrl":"",
},
editMode: false, //是否为编辑模式
beforeCreateDom: null,//表格创建之前的方法
fireMousedown: null, //单元格数据下钻
lang: 'en', //language
plugins: [], //plugins, e.g. ['chart']
forceCalculation:false,//强制刷新公式,公式较多会有性能问题,慎用
rowHeaderWidth: 46,
columnHeaderHeight: 20,
defaultColWidth:73,
defaultRowHeight:19,
defaultFontSize:10,
limitSheetNameLength:true, //是否限制工作表名的长度
defaultSheetNameMaxLength:31, //默认工作表名称的最大长度
sheetFormulaBar:true, //是否显示公式栏
showtoolbarConfig:{}, //自定义工具栏
showsheetbarConfig:{}, //自定义底部sheet页
showstatisticBarConfig:{}, //自定义计数栏
cellRightClickConfig:{}, //自定义单元格右键菜单
sheetRightClickConfig:{}, //自定义底部sheet页右击菜单
imageUpdateMethodConfig:{}, //自定义图片同步方式
}
This diff is collapsed.
import menuButton from './menuButton';
import formula from '../global/formula';
import Store from '../store';
import flatpickr from 'flatpickr'
import dayjs from "dayjs";
import { update, datenum_local } from '../global/format';
import { setCellValue, setCellFormat } from '../global/api';
const fitFormat = (formatStr) => {
let dateFormat = formatStr.replace(/y/g, 'Y');
dateFormat = dateFormat.replace(/d/g, 'D');
dateFormat = dateFormat.replace(/h/g, 'H');
dateFormat = dateFormat.replace(/上午\/下午/g, 'A');
dateFormat = dateFormat.replace(/上午/g, 'A');
dateFormat = dateFormat.replace(/下午/g, 'A');
dateFormat = dateFormat.replace(/AM\/PM/g, 'A');
dateFormat = dateFormat.replace(/AM/g, 'A');
dateFormat = dateFormat.replace(/PM/g, 'A');
dateFormat = dateFormat.replace(/\"/g, '');
if (dateFormat.includes('A')) {
dateFormat = dateFormat.replace(/H/g, 'h');
}
return dateFormat
}
const cellDatePickerCtrl = {
cellFocus: function (r, c, cell) {
let row = Store.visibledatarow[r],
row_pre = r == 0 ? 0 : Store.visibledatarow[r - 1];
let col = Store.visibledatacolumn[c],
col_pre = c == 0 ? 0 : Store.visibledatacolumn[c - 1];
let margeset = menuButton.mergeborer(Store.flowdata, r, c);
let type = cell.ct.fa || 'YYYY-MM-DD';
let defaultDate = update('yyyy-MM-dd hh:mm:ss', cell.v);
let dateFormat = fitFormat(type);
let enableTime = false;
let noCalendar = false;
let enableSeconds = false;
let time_24hr = true;
let hasChineseTime = false;
if (!!margeset) {
row = margeset.row[1];
row_pre = margeset.row[0];
col = margeset.column[1];
col_pre = margeset.column[0];
}
$(".cell-date-picker").show().css({
width: col - col_pre + 1,
height: row - row_pre + 1,
left: col_pre,
top: row_pre
})
if (/[上午下午]/.test(type)) {
hasChineseTime = true
}
if (/[Hhms]/.test(dateFormat)) {
enableTime = true;
}
if (!/[YMD]/.test(dateFormat)) {
noCalendar = true;
}
if (/s/.test(dateFormat)) {
enableSeconds = true;
}
if (/A/.test(dateFormat)) {
time_24hr = false;
}
const fp = flatpickr('#luckysheet-input-box', {
allowInput: false,
noCalendar,
enableSeconds,
enableTime,
dateFormat,
time_24hr,
defaultDate,
onClose() {
setTimeout(() => {
fp.destroy()
}, 0);
},
parseDate: (datestr, format) => {
return dayjs(datestr).toDate();
},
formatDate: (date, format, locale) => {
if (hasChineseTime) {
return dayjs(date).format(format).replace('AM', '上午').replace('PM', '下午')
}
return dayjs(date).format(format);
},
onChange: function (selectedDates, dateStr) {
let currentVal = datenum_local(new Date(selectedDates))
$("#luckysheet-rich-text-editor").html(dateStr);
setCellValue(r, c, currentVal, { isRefresh: false })
setCellFormat(r, c, 'ct', cell.ct)
if (!enableTime) {
formula.updatecell(Store.luckysheetCellUpdate[0], Store.luckysheetCellUpdate[1]);
}
}
});
$("#luckysheet-input-box").click();
},
}
export default cellDatePickerCtrl;
import Store from '../store';
import { replaceHtml,transformRangeToAbsolute,openSelfModel } from '../utils/util';
import { modelHTML } from './constant';
import sheetmanage from './sheetmanage';
import menuButton from './menuButton';
import {checkProtectionNotEnable} from './protection';
import { jfrefreshgrid } from '../global/refresh';
import locale from '../locale/locale';
import { setcellvalue } from '../global/setdata';
let isInitialCellFormatModel = false;
function initialCellFormatModelEvent(){
const _locale = locale();
const local_cellFormat = _locale.cellFormat;
$("#luckysheet-cellFormat-confirm").click(function(){
let locked = $("#luckysheet-protection-check-locked").is(':checked');
let hidden = $("#luckysheet-protection-check-hidden").is(':checked');
locked = locked==true?1:0;
hidden = hidden==true?1:0;
let d = recycleSeletion(
function(cell, r, c, data){
if(cell==null){
setcellvalue(r, c, data, {
lo:locked,
hi:hidden
});
}
else{
cell.lo = locked;
cell.hi = hidden;
}
},
function(){
alert(local_cellFormat.sheetDataIsNullAlert);
}
);
jfrefreshgrid(d, undefined, undefined, false);
$("#luckysheet-cellFormat-config").hide();
$("#luckysheet-modal-dialog-mask").hide();
});
}
function recycleSeletion(cycleFunction, dataIsNullFunction){
if(Store.luckysheet_select_save != null && Store.luckysheet_select_save.length > 0){
let sheetFile = sheetmanage.getSheetByIndex(), data=sheetFile.data;
if(data!=null){
for(let i=0;i<Store.luckysheet_select_save.length;i++){
let selection = Store.luckysheet_select_save[i];
let row = selection.row, column = selection.column;
for(let r=row[0];r<=row[1];r++){
for(let c=column[0];c<=column[1];c++){
let cell;
let margeset = menuButton.mergeborer(data, r, c);
if (!!margeset) {
// row = margeset.row[1];
// row_pre = margeset.row[0];
let row_index = margeset.row[2];
// row_index_ed = margeset.row[3];
// col = margeset.column[1];
// col_pre = margeset.column[0];
let col_index = margeset.column[2];
// col_index_ed = margeset.column[3];
cell = data[row_index][col_index];
}
else{
cell = data[r][c];
}
// if(cell.lo==null || cell.lo==1){
// locked = true;
// lockedCount++;
// }
// if(cell.hi==1){
// hidden = true;
// hiddenCount++;
// }
// count++;
cycleFunction(cell, r, c, data);
}
}
}
}
else{
// locked = true;
dataIsNullFunction();
}
return data;
}
}
function initialCellFormatModel(){
if(isInitialCellFormatModel){
return;
}
isInitialCellFormatModel = true;
const _locale = locale();
const local_cellFormat = _locale.cellFormat;
const locale_button = _locale.button;
//Password input initial
$("body").append(replaceHtml(modelHTML, {
"id": "luckysheet-cellFormat-config",
"addclass": "luckysheet-cellFormat-config",
"title": local_cellFormat.cellFormatTitle,
"content": `
<div class="luckysheet-cellFormat-menu-c">
<div class="luckysheet-cellFormat-menu luckysheet-cellFormat-menu-active" id="luckysheet-cellFormat-protection">
${local_cellFormat.protection}
</div>
</div>
<div id="luckysheet-cellFormat-protection-content" class="luckysheet-cellFormat-content">
<div class="luckysheet-cellFormat-protection">
<p>
${local_cellFormat.protectionTips}
</p>
<label for="luckysheet-protection-check-locked"><input id="luckysheet-protection-check-locked" name="luckysheet-protection-check-locked" type="checkbox">${local_cellFormat.locked}</label><span>部分选中</span>
<br/>
<label for="luckysheet-protection-check-hidden"><input id="luckysheet-protection-check-hidden" name="luckysheet-protection-check-hidden" type="checkbox">${local_cellFormat.hidden}</label><span>全部选中</span>
</div>
</div>
`,
"botton": `<button id="luckysheet-cellFormat-confirm" class="btn btn-primary">${locale_button.confirm}</button>
<button class="btn btn-default luckysheet-model-close-btn">${locale_button.cancel}</button>`,
"style": "z-index:100003"
}));
initialCellFormatModelEvent();
}
export function openCellFormatModel(){
initialCellFormatModel();
const _locale = locale();
const local_cellFormat = _locale.cellFormat;
const locale_button = _locale.button;
$("#luckysheet-rightclick-menu").hide();
if(!checkProtectionNotEnable(Store.currentSheetIndex)){
return;
}
let locked =false, hidden=false;
let lockedCount=0, hiddenCount=0, count=0;
if(Store.luckysheet_select_save != null && Store.luckysheet_select_save.length > 0){
recycleSeletion(
function(cell){
// let cell = data[r][c];
if(cell==null || cell.lo==null || cell.lo==1){
locked = true;
lockedCount++;
}
if(cell!=null && cell.hi==1){
hidden = true;
hiddenCount++;
}
count++;
},
function(){
locked = true;
}
);
}
else{
alert(local_cellFormat.selectionIsNullAlert);
return;
}
let tipsLock="", tipshidden="";
if(locked){
tipsLock = lockedCount==count?local_cellFormat.tipsAll:local_cellFormat.tipsPart;
}
if(hidden){
tipshidden = hiddenCount==count?local_cellFormat.tipsAll:local_cellFormat.tipsPart;
}
$("#luckysheet-protection-check-locked").prop('checked',locked).parent().next().html(tipsLock);
$("#luckysheet-protection-check-hidden").prop('checked',hidden).parent().next().html(tipshidden);
openSelfModel("luckysheet-cellFormat-config");
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
import { chart } from '../expendPlugins/chart/plugin'
import { print } from '../expendPlugins/print/plugin'
const pluginsObj = {
'chart':chart,
'print':print
}
const isDemo = true
/**
* Register plugins
*/
function initPlugins(plugins , data){
if(plugins.length){
plugins.forEach(plugin => {
pluginsObj[plugin](data , isDemo)
});
}
}
export {
initPlugins
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// 自定义图片的更新方法例如: customImageUpdate("POST", "http://127.0.0.1:8000/luckysheetimageprocess/", d)
function customImageUpdate(method, url, obj) {
return new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest() || new ActiveXObject("Microsoft.XMLHTTP");
xhr.open(method, url);
xhr.send(JSON.stringify(obj)); // 发送 POST/GET 数据
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
resolve(xhr.responseText);
} else {
reject("error");
}
}
};
});
}
export {
customImageUpdate
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/**
* Monitor special variables
*/
import {createProxy} from '../utils/util';
import Store from '../store/index';
import method from '../global/method';
import { getluckysheetfile } from '../methods/get'
import { toJson } from '../global/api';
let undoTimer,redoTimer;
function undoAccessible(len) {
clearTimeout(undoTimer);
undoTimer = setTimeout(() => {
$('#luckysheet-icon-undo')[len ? 'removeClass' : 'addClass']('disabled');
}, 10);
}
function redoAccessible(len) {
clearTimeout(redoTimer);
redoTimer = setTimeout(() => {
$('#luckysheet-icon-redo')[len ? 'removeClass' : 'addClass']('disabled');
}, 10);
}
const initListener = function(){
// createProxy(Store,['jfredo']);
createProxy(Store, 'jfredo',(target, property, val, receiver)=>{
if (property !== 'length') {
// 钩子函数
method.createHookFunction('updated',val)
}
undoAccessible(Store.jfredo.length);
} );
createProxy(Store, 'jfundo',(target, property, val, receiver)=>{
redoAccessible(Store.jfundo.length);
} );
createProxy(Store, 'asyncLoad', (target, property, val, receiver)=>{
if(property === 'length' && val === 0){
method.createHookFunction('workbookCreateAfter', toJson())
}
})
}
export {
initListener
}
\ No newline at end of file
This diff is collapsed.
const luckysheetConfigsetting = {
autoFormatw: false,
accuracy: undefined,
total: 0,
allowCopy: true,
showtoolbar: true,
showinfobar: true,
showsheetbar: true,
showstatisticBar: true,
pointEdit: false,
pointEditUpdate: null,
pointEditZoom: 1,
userInfo: false,
userMenuItem: [],
myFolderUrl: null,
functionButton: null,
showConfigWindowResize: true,
enableAddRow: true,
addRowCount: 100,
enableAddBackTop: true,
enablePage: true,
pageInfo: null,
editMode: false,
beforeCreateDom: null,
workbookCreateBefore: null,
workbookCreateAfter: null,
remoteFunction: null,
fireMousedown: null,
plugins:[],
forceCalculation:false,//强制刷新公式,公式较多会有性能问题,慎用
defaultColWidth:73,
defaultRowHeight:19,
defaultTextColor: '#000',
defaultCellColor: '#fff',
}
export default luckysheetConfigsetting;
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
import { rowLocation, colLocation, mouseposition } from '../global/location';
import { selectHightlightShow } from './select';
import menuButton from './menuButton';
import luckysheetFreezen from './freezen';
import Store from '../store';
//设备是移动端
export default function mobileinit(){
//去除滚动条
Store.cellMainSrollBarSize = 0;
//滑动滚动表格
let luckysheet_touchmove_status = false,
luckysheet_touchmove_startPos = {},
luckysheet_touchhandle_status = false,
_scrollTimer = null;
$(document).on("touchstart", "#luckysheet-grid-window-1", function(event){
clearInterval(_scrollTimer);//clear timer
luckysheet_touchmove_status = true;
let touch = event.originalEvent.targetTouches[0];
luckysheet_touchmove_startPos = {
x: touch.pageX,
y: touch.pageY,
vy:0, //vy可以理解为滑动的力度
moveType:"y",
}
})
$(document).on("touchmove", "#luckysheet-grid-window-1", function(event){
if(event.originalEvent.targetTouches.length > 1 || (event.scale && event.scale !== 1)){
return;
}
let touch = event.originalEvent.targetTouches[0];
if(luckysheet_touchmove_status){//滚动
let slideX = touch.pageX - luckysheet_touchmove_startPos.x;
let slideY = touch.pageY - luckysheet_touchmove_startPos.y;
luckysheet_touchmove_startPos.x = touch.pageX;
luckysheet_touchmove_startPos.y = touch.pageY;
let scrollLeft = $("#luckysheet-scrollbar-x").scrollLeft();
let scrollTop = $("#luckysheet-scrollbar-y").scrollTop();
// console.log("start",scrollTop, slideY,touch.pageY);
scrollLeft -= slideX;
scrollTop -= slideY;
// console.log(touch,touch.pageY, luckysheet_touchmove_startPos.y, slideY);
if(scrollLeft < 0){
scrollLeft = 0;
}
if(scrollTop < 0){
scrollTop = 0;
}
$("#luckysheet-scrollbar-y").scrollTop(scrollTop);
luckysheet_touchmove_startPos.vy_y = slideY;
luckysheet_touchmove_startPos.scrollTop = scrollTop;
$("#luckysheet-scrollbar-x").scrollLeft(scrollLeft);
luckysheet_touchmove_startPos.vy_x = slideX;
luckysheet_touchmove_startPos.scrollLeft = scrollLeft;
}
else if(luckysheet_touchhandle_status){//选区
let mouse = mouseposition(touch.pageX, touch.pageY);
let x = mouse[0] + $("#luckysheet-cell-main").scrollLeft();
let y = mouse[1] + $("#luckysheet-cell-main").scrollTop();
let row_location = rowLocation(y),
row = row_location[1],
row_pre = row_location[0],
row_index = row_location[2];
let col_location = colLocation(x),
col = col_location[1],
col_pre = col_location[0],
col_index = col_location[2];
let last = $.extend(true, {}, Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1]);
let top = 0, height = 0, rowseleted = [];
if (last.top > row_pre) {
top = row_pre;
height = last.top + last.height - row_pre;
if(last.row[1] > last.row_focus){
last.row[1] = last.row_focus;
}
rowseleted = [row_index, last.row[1]];
}
else if (last.top == row_pre) {
top = row_pre;
height = last.top + last.height - row_pre;
rowseleted = [row_index, last.row[0]];
}
else {
top = last.top;
height = row - last.top - 1;
if(last.row[0] < last.row_focus){
last.row[0] = last.row_focus;
}
rowseleted = [last.row[0], row_index];
}
let left = 0, width = 0, columnseleted = [];
if (last.left > col_pre) {
left = col_pre;
width = last.left + last.width - col_pre;
if(last.column[1] > last.column_focus){
last.column[1] = last.column_focus;
}
columnseleted = [col_index, last.column[1]];
}
else if (last.left == col_pre) {
left = col_pre;
width = last.left + last.width - col_pre;
columnseleted = [col_index, last.column[0]];
}
else {
left = last.left;
width = col - last.left - 1;
if(last.column[0] < last.column_focus){
last.column[0] = last.column_focus;
}
columnseleted = [last.column[0], col_index];
}
let changeparam = menuButton.mergeMoveMain(columnseleted, rowseleted, last, top, height, left, width);
if(changeparam != null){
columnseleted = changeparam[0];
rowseleted= changeparam[1];
top = changeparam[2];
height = changeparam[3];
left = changeparam[4];
width = changeparam[5];
}
last["row"] = rowseleted;
last["column"] = columnseleted;
last["left_move"] = left;
last["width_move"] = width;
last["top_move"] = top;
last["height_move"] = height;
Store.luckysheet_select_save[Store.luckysheet_select_save.length - 1] = last;
selectHightlightShow();
luckysheetFreezen.scrollFreezen();
}
event.stopPropagation();
})
$(document).on("touchend", function(event){
if(luckysheet_touchmove_status){
let vy_x = Math.abs(luckysheet_touchmove_startPos.vy_x), friction_x = ((vy_x >> 31) * 2 + 1) * 0.25;
let vy_y = Math.abs(luckysheet_touchmove_startPos.vy_y), friction_y = ((vy_y >> 31) * 2 + 1) * 0.25;
if(vy_x>0 || vy_y>0){
_scrollTimer = setInterval(function () {//
vy_x -= friction_x;//力度按 惯性的大小递减
vy_y -= friction_y;//力度按 惯性的大小递减
if(vy_x<=0){
vy_x = 0;
}
if(vy_y<=0){
vy_y = 0;
}
if(luckysheet_touchmove_startPos.vy_y>0){
luckysheet_touchmove_startPos.scrollTop -= vy_y;
}
else{
luckysheet_touchmove_startPos.scrollTop += vy_y;
}
$("#luckysheet-scrollbar-y").scrollTop(luckysheet_touchmove_startPos.scrollTop);
if(luckysheet_touchmove_startPos.vy_x>0){
luckysheet_touchmove_startPos.scrollLeft -= vy_x;
}
else{
luckysheet_touchmove_startPos.scrollLeft += vy_x;
}
$("#luckysheet-scrollbar-x").scrollLeft(luckysheet_touchmove_startPos.scrollLeft);
if(vy_x<=0 && vy_y<=0){
clearInterval(_scrollTimer);
}
}, 20);
}
}
luckysheet_touchmove_status = false;
// luckysheet_touchmove_startPos = {};
luckysheet_touchhandle_status = false;
})
//滑动选择选区
$(document).on("touchstart", ".luckysheet-cs-touchhandle", function(event){
luckysheet_touchhandle_status = true;
luckysheet_touchmove_status = false;
// console.log(1111111111);
event.stopPropagation();
})
//禁止微信下拉拖出微信背景
document.addEventListener("touchmove", function(event){
event.preventDefault();
}, {
passive: false
})
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
import luckysheetConfigsetting from './luckysheetConfigsetting';
import {zoomChange} from './zoom';
import sheetmanage from './sheetmanage';
import server from './server';
import {rowLocationByIndex, colLocationByIndex,mouseposition,rowLocation,colLocation} from '../global/location';
import Store from '../store';
let ExcelPlaceholder = {
"[tabName]":"&A",
"[CurrentDate]":"&D",
"[fileName]":"&F",
"[background]":"&G",
"[Shadow]":"&H",
"[TotalPages]":"&N",
"[pageNumber]":"&P",
"[CurrentTime]":"&T",
"[filePath]":"&Z",
}
// Get the pixel value per millimeter
function getOneMmsPx (){
let div = document.createElement("div");
div.style.width = "1mm";
document.querySelector("body").appendChild(div);
let mm1 = div.getBoundingClientRect();
let w = mm1.width;
$(div).remove();
return mm1.width;
}
export function viewChange(curType, preType){
let currentSheet = sheetmanage.getSheetByIndex();
if(currentSheet.config==null){
currentSheet.config = {};
}
if(currentSheet.config.sheetViewZoom==null){
currentSheet.config.sheetViewZoom = {};
}
let defaultZoom = 1, type="zoomScaleNormal";
printLineAndNumberDelete(currentSheet);
if(curType=="viewNormal"){
type = "viewNormalZoomScale";
}
else if(curType=="viewLayout"){
type = "viewLayoutZoomScale";
}
else if(curType=="viewPage"){
type = "viewPageZoomScale";
defaultZoom = 0.6;
printLineAndNumberCreate(currentSheet);
}
let curZoom = currentSheet.config.sheetViewZoom[type];
if(curZoom==null){
curZoom = defaultZoom;
}
currentSheet.config.curentsheetView = curType;
if (Store.clearjfundo) {
Store.jfredo.push({
"type": "viewChange",
"curType": curType,
"preType": preType,
"sheetIndex": Store.currentSheetIndex,
});
}
// Store.zoomRatio = curZoom;
// server.saveParam("all", Store.currentSheetIndex, curZoom, { "k": "zoomRatio" });
server.saveParam("cg", Store.currentSheetIndex, curType, { "k": "curentsheetView" });
Store.currentSheetView = curType;
zoomChange(curZoom);
}
function printLineAndNumberDelete(sheet){
}
function printLineAndNumberCreate(sheet){
}
function switchViewBtn($t){
let $viewList = $t.parent(), preType=$viewList.find("luckysheet-print-viewBtn-active").attr("type");
if($t.attr("type") == preType){
return;
}
let curType = $t.attr("type");
if(curType!=null){
viewChange(curType, preType);
}
else{
return;
}
$t.parent().find(".luckysheet-print-viewBtn").removeClass("luckysheet-print-viewBtn-active");
$t.addClass("luckysheet-print-viewBtn-active");
}
export function printInitial(){
let container = luckysheetConfigsetting.container;
let _this = this;
$("#"+container).find(".luckysheet-print-viewBtn").click(function(){
switchViewBtn($(this));
});
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment