Skip to content

Commit 490cbb1

Browse files
author
yangjian
committed
新增文集批量导出Markdown压缩包,新增在线表格支持
1 parent bbdf272 commit 490cbb1

19 files changed

Lines changed: 1015 additions & 45 deletions

CHANGES.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
## 版本更新记录
22

3+
### v0.6.6 2021-04
4+
5+
- [新增]站点语言配置项,英文和繁体中文语言包;
6+
- [新增]文集批量导出Markdown压缩包;
7+
- [新增]首页文集列表访问码文集标识;
8+
- [新增]在线表格类型文档支持;
9+
- [修复]无法复制/移动文档到协作文集的问题;
10+
- [修复]版本检测的问题;
11+
- [优化]文集下载选项状态控制;
12+
13+
314
### v0.6.5 2021-03
415

516
- [新增]图片批量管理功能;

app_doc/report_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def operat_md_media(self,md_content):
174174

175175

176176
# 批量导出文集Markdown压缩包
177-
class ReportMdBetch():
177+
class ReportMdBatch():
178178
def __init__(self,username,project_id_list):
179179
self.project_list = project_id_list
180180
self.username = username

app_doc/views.py

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2000,22 +2000,39 @@ def handle_404(request):
20002000
@require_http_methods(["POST"])
20012001
def report_md(request):
20022002
pro_id = request.POST.get('project_id','')
2003+
types = request.POST.get('type','single')
20032004
user = request.user
2004-
try:
2005-
project = Project.objects.get(id=int(pro_id))
2006-
if project.create_user == user:
2005+
if types == 'single':
2006+
try:
2007+
Project.objects.get(id=int(pro_id),create_user=user)
20072008
project_md = ReportMD(
20082009
project_id=int(pro_id)
20092010
)
20102011
md_file_path = project_md.work() # 生成并获取MD文件压缩包绝对路径
20112012
md_file_filename = os.path.split(md_file_path)[-1] # 提取文件名
20122013
md_file = "/media/reportmd_temp/"+ md_file_filename # 拼接相对链接
20132014
return JsonResponse({'status':True,'data':md_file})
2014-
else:
2015-
return JsonResponse({'status':False,'data':_('无权限')})
2016-
except Exception as e:
2017-
logger.exception(_("导出文集MD文件出错"))
2018-
return JsonResponse({'status':False,'data':_('文集不存在')})
2015+
except Exception as e:
2016+
logger.exception(_("导出文集MD文件出错"))
2017+
return JsonResponse({'status':False,'data':_('文集不存在')})
2018+
elif types == 'multi':
2019+
project_list = pro_id.split(',')
2020+
for project in project_list:
2021+
try:
2022+
Project.objects.get(id=project,create_user=request.user)
2023+
except ObjectDoesNotExist:
2024+
return JsonResponse({'status':False,'data':_('无权限')})
2025+
project_md = ReportMdBatch(
2026+
project_id_list = project_list,
2027+
username = request.user.username
2028+
)
2029+
md_file_path = project_md.work() # 生成并获取MD文件压缩包绝对路径
2030+
md_file_filename = os.path.split(md_file_path)[-1] # 提取文件名
2031+
md_file = "/media/reportmd_temp/" + md_file_filename # 拼接相对链接
2032+
return JsonResponse({'status': True, 'data': md_file})
2033+
2034+
else:
2035+
return JsonResponse({'status':False,'data':_('无效参数')})
20192036

20202037

20212038
# 生成文集文件 - 个人中心 - 文集管理

config/config.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ engine = sqlite
1717
# port = db_port
1818

1919
[locale]
20-
20+
# 默认站点语言为 中文简体,如需使用其他语言,请配置 language 参数;
21+
# 默认站点时区为 Asia/Shanghai,如需使用其他时区,请配置 timezone 参数
2122

2223
[selenium]
2324
# 在Windows环境下测试或使用,请配置driver = Chrome
Lines changed: 1 addition & 0 deletions
Loading

static/luckysheet/CHANGELOG.md

Lines changed: 474 additions & 0 deletions
Large diffs are not rendered by default.

static/luckysheet/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2020-present, Mengshukeji
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

static/luckysheet/README.md

Lines changed: 205 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,205 @@
1+
<div align="center">
2+
3+
![logo](/docs/.vuepress/public/img/logo_text.png)
4+
5+
[![Join the chat at https://gitter.im/mengshukeji/Luckysheet](https://badges.gitter.im/mengshukeji/Luckysheet.svg)](https://gitter.im/mengshukeji/Luckysheet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
6+
<a href="https://twitter.com/intent/follow?screen_name=luckysheet">
7+
<img src="https://img.shields.io/twitter/follow/luckysheet?style=social&logo=twitter"
8+
alt="follow on Twitter"></a>
9+
10+
</div>
11+
12+
13+
English| [简体中文](./README-zh.md)
14+
15+
## Introduction
16+
🚀Luckysheet is an online spreadsheet like excel that is powerful, simple to configure, and completely open source.
17+
18+
## Links
19+
| Source Code | Documentation | Demo | Plugins Demo | Forum |
20+
| ------ | -------- | ------ | ------ | ------ |
21+
| [Github](https://github.com/mengshukeji/Luckysheet)| [Online Documentation](https://mengshukeji.github.io/LuckysheetDocs/) | [Online Demo](https://mengshukeji.github.io/LuckysheetDemo) / [Cooperative editing demo](http://luckysheet.lashuju.com/demo/) | [Import Excel Demo](https://mengshukeji.github.io/LuckyexcelDemo/) | [Chinese Forum](https://support.qq.com/product/288322) |
22+
| [Gitee Mirror](https://gitee.com/mengshukeji/Luckysheet)| [Gitee Online Documentation](https://mengshukeji.gitee.io/LuckysheetDocs/) | [Gitee Online Demo](https://mengshukeji.gitee.io/luckysheetdemo/) | [Gitee Import Excel Demo](https://mengshukeji.gitee.io/luckyexceldemo/) | [Google Group](https://groups.google.com/g/luckysheet) |
23+
24+
![Demo](/docs/.vuepress/public/img/LuckysheetDemo.gif)
25+
26+
## Plugins
27+
- [Luckyexcel](https://github.com/mengshukeji/Luckyexcel): Excel import and export library
28+
- [chartMix](https://github.com/mengshukeji/chartMix): Chart plugin
29+
30+
## Ecosystem
31+
32+
| Project | Description |
33+
|---------|-------------|
34+
| [Luckysheet Vue] | Luckysheet and Luckyexcel in a vue cli3 project |
35+
| [Luckysheet React] | Luckysheet in a React project |
36+
| [Luckyexcel Node] | Use Luckyexcel in koa2 |
37+
| [Luckysheet Server] | Java backend Luckysheet Server |
38+
| [Luckysheet Server Starter] | LuckysheetServer docker deployment startup template |
39+
40+
[Luckysheet Vue]: https://github.com/mengshukeji/luckysheet-vue
41+
[Luckysheet React]: https://github.com/mengshukeji/luckysheet-react
42+
[Luckyexcel Node]: https://github.com/mengshukeji/Luckyexcel-node
43+
[Luckysheet Server]: https://github.com/mengshukeji/LuckysheetServer
44+
[Luckysheet Server Starter]: https://github.com/mengshukeji/LuckysheetServerStarter
45+
46+
47+
## Features
48+
49+
- **Formatting**: style, conditional formatting, text alignment and rotation, text truncation, overflow, automatic line wrapping, multiple data types, cell segmentation style
50+
- **Cells**: drag and drop, fill handle, multiple selection, find and replace, location, merge cells, data verification
51+
- **Row & column**: hide, insert, delete rows or columns, freeze, and split text
52+
- **Operation**: undo, redo, copy, paste, cut, hot key, format painter, drag and drop selection
53+
- **Formulas & Functions**: Built-in, remote and custom formulas
54+
- **Tables**: filter, sort
55+
- **Enhanced functions**: Pivot tables, charts, comments, cooperative editing, insert picture, matrix calculations, screenshots, copying to other formats, EXCEL import and export, etc.
56+
57+
For a more detailed feature list, please refer to: [Features](https://mengshukeji.github.io/LuckysheetDocs/guide/#features)
58+
59+
## 📖 Resources
60+
- Priority reading for new users: [User Guide](https://github.com/mengshukeji/Luckysheet/wiki/User-Guide)
61+
- For the tutorials, learning materials and supporting solutions provided by the community, please refer to: [Tutorials and Resources](https://mengshukeji.github.io/LuckysheetDocs/guide/resource.html)
62+
63+
## 📜 Changelog
64+
65+
Detailed changes for each release are documented in the [CHANGELOG.md](CHANGELOG.md).
66+
67+
## ❗️ Issues
68+
69+
Please make sure to read the [Issue Reporting Checklist](https://mengshukeji.github.io/LuckysheetDocs/guide/contribute.html#how-to-submit-issues) before opening an issue. Issues not conforming to the guidelines may be closed immediately.
70+
71+
## ✅ TODO
72+
73+
Managed with [GitHub Projects](https://github.com/mengshukeji/Luckysheet/projects/1)
74+
75+
## 💪Contribution
76+
77+
Please make sure to read the[ Contributing Guide](https://mengshukeji.github.io/LuckysheetDocs/guide/contribute.html) before making a pull request.
78+
79+
## Usage
80+
81+
### First step
82+
Introduce dependencies through CDN
83+
```
84+
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet/dist/plugins/css/pluginsCss.css' />
85+
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet/dist/plugins/plugins.css' />
86+
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet/dist/css/luckysheet.css' />
87+
<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/luckysheet/dist/assets/iconfont/iconfont.css' />
88+
<script src="https://cdn.jsdelivr.net/npm/luckysheet/dist/plugins/js/plugin.js"></script>
89+
<script src="https://cdn.jsdelivr.net/npm/luckysheet/dist/luckysheet.umd.js"></script>
90+
```
91+
### Second step
92+
Specify a table container
93+
```
94+
<div id="luckysheet" style="margin:0px;padding:0px;position:absolute;width:100%;height:100%;left: 0px;top: 0px;"></div>
95+
```
96+
### Third step
97+
Create a table
98+
```
99+
<script>
100+
$(function () {
101+
//Configuration item
102+
var options = {
103+
container: 'luckysheet' //luckysheet is the container id
104+
}
105+
luckysheet.create(options)
106+
})
107+
</script>
108+
```
109+
110+
## Development
111+
112+
### Requirements
113+
[Node.js](https://nodejs.org/en/) Version >= 6
114+
115+
### Installation
116+
```
117+
npm install
118+
npm install gulp -g
119+
```
120+
### Development
121+
```
122+
npm run dev
123+
```
124+
### Package
125+
```
126+
npm run build
127+
```
128+
129+
## Partner project
130+
131+
- [luban-h5](https://github.com/ly525/luban-h5)
132+
- [excelize](https://github.com/360EntSecGroup-Skylar/excelize)
133+
- [h5-Dooring](https://github.com/MrXujiang/h5-Dooring)
134+
135+
## Communication
136+
- [Github Discussions](https://github.com/mengshukeji/Luckysheet/discussions)
137+
- [Gitter](https://gitter.im/mengshukeji/Luckysheet)
138+
139+
[Chinese community](./README-zh.md)
140+
141+
## Sponsor
142+
143+
Luckysheet is an MIT-licensed open source project with its ongoing development made possible entirely by the support of these awesome [backers](https://mengshukeji.github.io/LuckysheetDocs/about/sponsor.html#sponsors-list). If you'd like to join them, please consider:
144+
145+
- [Become a backer or sponsor on Patreon](https://www.patreon.com/mengshukeji).
146+
- [Become a backer or sponsor on Open Collective](https://opencollective.com/luckysheet).
147+
- One-time donation via PayPal, WeChat or Alipay
148+
149+
| PayPal | WeChat | Alipay |
150+
|---|---|---|
151+
| [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" /> |
152+
153+
### What's the difference between Patreon and OpenCollective?
154+
155+
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.
156+
157+
## Sponsors List
158+
159+
(Sort by time)
160+
- *勇 ¥ 30
161+
- 虚我 ¥ 200
162+
- 甜党 ¥ 50
163+
- Alphabet(Google)-gcf ¥ 1
164+
- **平 ¥ 100
165+
- **东 ¥ 10
166+
- debugger ¥ 20
167+
- 烦了烦 ¥ 10
168+
- 文顶顶 ¥ 200
169+
- yangxshn ¥ 10
170+
- 爱乐 ¥ 100
171+
- 小李飞刀刀 ¥ 66
172+
- 张铭 ¥ 200
173+
- 曹治军 ¥ 1
174+
- *特 ¥ 10
175+
- **权 ¥ 9.9
176+
- **sdmq ¥ 20
177+
178+
## Authors and acknowledgment
179+
180+
### Active Core Team Members
181+
- [@wbfsa](https://github.com/wbfsa)
182+
- [@iamxuchen800117](https://github.com/iamxuchen800117)
183+
- [@wpxp123456](https://github.com/wpxp123456)
184+
- [@tonytonychopper123](https://github.com/tonytonychopper123)
185+
- [@Dushusir](https://github.com/Dushusir)
186+
- [@c19c19i](https://weibo.com/u/3884623955)
187+
- [@zhangchen915](https://github.com/zhangchen915)
188+
- [@jerry-f](https://github.com/jerry-f)
189+
- [@flowerField](https://github.com/flowerField)
190+
191+
### Community Partners
192+
- [@danielcai1987](https://github.com/danielcai1987)
193+
- [@qq6690876](https://github.com/qq6690876)
194+
- [@javahuang](https://github.com/javahuang)
195+
- [@TimerGang](https://github.com/TimerGang)
196+
- [@gsw945](https://github.com/gsw945)
197+
- [@swen-xiong](https://github.com/swen-xiong)
198+
- [@lzmch](https://github.com/lzmch)
199+
- [@kdevilpf](https://github.com/kdevilpf)
200+
- [@WJWM0316](https://github.com/WJWM0316)
201+
202+
## License
203+
[MIT](http://opensource.org/licenses/MIT)
204+
205+
Copyright (c) 2020-present, mengshukeji

static/luckysheet/package.json

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"name": "luckysheet",
3+
"version": "2.1.13",
4+
"main": "dist/luckysheet.cjs.js",
5+
"module": "dist/luckysheet.esm.js",
6+
"browser": "dist/luckysheet.umd.js",
7+
"devDependencies": {
8+
"@babel/core": "^7.12.3",
9+
"@babel/preset-env": "^7.12.1",
10+
"@babel/runtime-corejs3": "^7.12.1",
11+
"@commitlint/cli": "^9.1.1",
12+
"@commitlint/config-conventional": "^9.1.1",
13+
"@rollup/plugin-babel": "^5.2.1",
14+
"@rollup/plugin-commonjs": "^13.0.0",
15+
"@rollup/plugin-node-resolve": "^8.0.1",
16+
"browser-sync": "^2.26.7",
17+
"commitizen": "^4.1.2",
18+
"cross-env": "^7.0.2",
19+
"delete": "^1.1.0",
20+
"gulp": "^4.0.2",
21+
"gulp-babel": "^8.0.0",
22+
"gulp-clean-css": "^4.3.0",
23+
"gulp-concat": "^2.6.1",
24+
"gulp-if": "^3.0.0",
25+
"gulp-uglify": "^3.0.2",
26+
"gulp-useref": "^4.0.1",
27+
"http-proxy-middleware": "^1.0.6",
28+
"rollup": "^2.32.1",
29+
"rollup-plugin-terser": "^6.1.0",
30+
"standard-version": "^8.0.2",
31+
"vuepress": "^1.5.0",
32+
"vuepress-plugin-baidu-autopush": "^1.0.1",
33+
"vuepress-plugin-code-copy": "^1.0.6",
34+
"vuepress-plugin-seo": "^0.1.4",
35+
"vuepress-plugin-sitemap": "^2.3.1"
36+
},
37+
"dependencies": {
38+
"@babel/runtime": "^7.12.1",
39+
"dayjs": "^1.9.6",
40+
"flatpickr": "^4.6.6",
41+
"jquery": "^2.2.4",
42+
"numeral": "^2.0.6",
43+
"pako": "^1.0.11"
44+
},
45+
"scripts": {
46+
"build": "cross-env NODE_ENV=production gulp build",
47+
"dev": "cross-env NODE_ENV=development gulp dev",
48+
"docs:dev": "vuepress dev docs",
49+
"docs:build": "vuepress build docs",
50+
"commit": "git-cz",
51+
"release": "standard-version"
52+
},
53+
"files": [
54+
"dist"
55+
],
56+
"config": {
57+
"commitizen": {
58+
"path": "./node_modules/cz-conventional-changelog"
59+
}
60+
}
61+
}

0 commit comments

Comments
 (0)