From 37c307087cb50efa9eb3e1f3a22a356024aa43b5 Mon Sep 17 00:00:00 2001 From: liurunze <1414556676@qq.com> Date: Sat, 25 Jul 2020 01:36:01 +0800 Subject: [PATCH] refactor(all project): modular,Document promotion,Some bugs 1. Modularization, use es6, split files 2. Add English documents,enriched parameter description 3. add allowEdit 4. Delete row, insert row,hidden row 5. some bugs BREAKING CHANGE: File name change fix #11, fix #2 --- LICENSE | 21 + README-zh.md | 111 + README.md | 115 +- commitlint.config.js | 3 + deploy_demo.bat | 6 - docs/.vuepress/config.js | 110 +- docs/README.md | 16 +- docs/guide/README.md | 164 +- docs/guide/config.md | 230 +- docs/guide/data.md | 722 +- docs/guide/feature.md | 117 +- docs/guide/format.md | 200 +- docs/guide/operate.md | 412 +- docs/zh/README.md | 15 + docs/zh/guide/README.md | 145 + docs/zh/guide/config.md | 214 + docs/zh/guide/data.md | 745 + docs/zh/guide/feature.md | 124 + docs/zh/guide/format.md | 214 + docs/zh/guide/operate.md | 621 + gulpfile.js | 272 +- index.html | 70 + package.json | 29 +- src/chartMix.css | 22 - src/config.js | 55 + src/controllers/alternateformat.js | 1214 + src/controllers/conditionformat.js | 3658 + src/controllers/constant.js | 1287 + src/controllers/controlHistory.js | 550 + src/controllers/dropCell.js | 2683 + src/controllers/expendPlugins.js | 19 + src/controllers/filter.js | 271 + src/controllers/freezen.js | 1476 + src/controllers/handler.js | 10045 ++ src/controllers/ifFormulaGenerator.js | 545 + src/controllers/insertFormula.js | 467 + src/controllers/locationCell.js | 489 + src/controllers/luckysheetConfigsetting.js | 34 + src/controllers/menuButton.js | 4467 + src/controllers/mobile.js | 178 + src/controllers/moreFormat.js | 1217 + src/controllers/pivotTable.js | 3094 + src/controllers/postil.js | 833 + src/controllers/resize.js | 170 + src/controllers/searchReplace.js | 741 + src/controllers/select.js | 399 + src/controllers/selection.js | 1739 + src/controllers/server.js | 1072 + src/controllers/sheetMove.js | 1991 + src/controllers/sheetSearch.js | 80 + src/controllers/sheetmanage.js | 1507 + src/controllers/sparkline.js | 2254 + src/controllers/splitColumn.js | 315 + src/controllers/updateCell.js | 115 + src/core.js | 141 + src/css/luckysheet-core.css | 241 +- src/data/chartJson.js | 605 + src/demoData/sheetCell.js | 5599 + src/demoData/sheetComment.js | 80 + src/demoData/sheetConditionFormat.js | 6553 + src/demoData/sheetFormula.js | 6613 + src/demoData/sheetPivotTable.js | 202 + src/demoData/sheetPivotTableData.js | 754 + src/demoData/sheetSparkline.js | 7079 + src/demoData/sheetTable.js | 1081 + src/expendPlugins/chart/chartmix.common.0.js | 1034 + .../chart/chartmix.common.0.js.map | 1 + src/expendPlugins/chart/chartmix.common.1.js | 161 + .../chart/chartmix.common.1.js.map | 1 + src/expendPlugins/chart/chartmix.common.10.js | 91 + .../chart/chartmix.common.10.js.map | 1 + src/expendPlugins/chart/chartmix.common.11.js | 82 + .../chart/chartmix.common.11.js.map | 1 + src/expendPlugins/chart/chartmix.common.12.js | 82 + .../chart/chartmix.common.12.js.map | 1 + src/expendPlugins/chart/chartmix.common.2.js | 212 + .../chart/chartmix.common.2.js.map | 1 + src/expendPlugins/chart/chartmix.common.3.js | 476 + .../chart/chartmix.common.3.js.map | 1 + src/expendPlugins/chart/chartmix.common.4.js | 299 + .../chart/chartmix.common.4.js.map | 1 + src/expendPlugins/chart/chartmix.common.5.js | 243 + .../chart/chartmix.common.5.js.map | 1 + src/expendPlugins/chart/chartmix.common.6.js | 208 + .../chart/chartmix.common.6.js.map | 1 + src/expendPlugins/chart/chartmix.common.7.js | 218 + .../chart/chartmix.common.7.js.map | 1 + src/expendPlugins/chart/chartmix.common.8.js | 83 + .../chart/chartmix.common.8.js.map | 1 + src/expendPlugins/chart/chartmix.common.9.js | 92 + .../chart/chartmix.common.9.js.map | 1 + src/expendPlugins/chart/chartmix.common.js | 134858 ++++++++++++++ .../chart/chartmix.common.js.map | 1 + src/expendPlugins/chart/chartmix.css | 1 + src/expendPlugins/chart/chartmix.umd.0.js | 1034 + src/expendPlugins/chart/chartmix.umd.0.js.map | 1 + src/expendPlugins/chart/chartmix.umd.1.js | 161 + src/expendPlugins/chart/chartmix.umd.1.js.map | 1 + src/expendPlugins/chart/chartmix.umd.10.js | 91 + .../chart/chartmix.umd.10.js.map | 1 + src/expendPlugins/chart/chartmix.umd.11.js | 82 + .../chart/chartmix.umd.11.js.map | 1 + src/expendPlugins/chart/chartmix.umd.12.js | 82 + .../chart/chartmix.umd.12.js.map | 1 + src/expendPlugins/chart/chartmix.umd.2.js | 212 + src/expendPlugins/chart/chartmix.umd.2.js.map | 1 + src/expendPlugins/chart/chartmix.umd.3.js | 476 + src/expendPlugins/chart/chartmix.umd.3.js.map | 1 + src/expendPlugins/chart/chartmix.umd.4.js | 299 + src/expendPlugins/chart/chartmix.umd.4.js.map | 1 + src/expendPlugins/chart/chartmix.umd.5.js | 243 + src/expendPlugins/chart/chartmix.umd.5.js.map | 1 + src/expendPlugins/chart/chartmix.umd.6.js | 208 + src/expendPlugins/chart/chartmix.umd.6.js.map | 1 + src/expendPlugins/chart/chartmix.umd.7.js | 218 + src/expendPlugins/chart/chartmix.umd.7.js.map | 1 + src/expendPlugins/chart/chartmix.umd.8.js | 83 + src/expendPlugins/chart/chartmix.umd.8.js.map | 1 + src/expendPlugins/chart/chartmix.umd.9.js | 92 + src/expendPlugins/chart/chartmix.umd.9.js.map | 1 + src/expendPlugins/chart/chartmix.umd.js | 134868 +++++++++++++++ src/expendPlugins/chart/chartmix.umd.js.map | 1 + src/expendPlugins/chart/chartmix.umd.min.0.js | 8 + .../chart/chartmix.umd.min.0.js.map | 1 + src/expendPlugins/chart/chartmix.umd.min.1.js | 2 + .../chart/chartmix.umd.min.1.js.map | 1 + .../chart/chartmix.umd.min.10.js | 2 + .../chart/chartmix.umd.min.10.js.map | 1 + .../chart/chartmix.umd.min.11.js | 2 + .../chart/chartmix.umd.min.11.js.map | 1 + .../chart/chartmix.umd.min.12.js | 2 + .../chart/chartmix.umd.min.12.js.map | 1 + src/expendPlugins/chart/chartmix.umd.min.2.js | 2 + .../chart/chartmix.umd.min.2.js.map | 1 + src/expendPlugins/chart/chartmix.umd.min.3.js | 2 + .../chart/chartmix.umd.min.3.js.map | 1 + src/expendPlugins/chart/chartmix.umd.min.4.js | 2 + .../chart/chartmix.umd.min.4.js.map | 1 + src/expendPlugins/chart/chartmix.umd.min.5.js | 2 + .../chart/chartmix.umd.min.5.js.map | 1 + src/expendPlugins/chart/chartmix.umd.min.6.js | 2 + .../chart/chartmix.umd.min.6.js.map | 1 + src/expendPlugins/chart/chartmix.umd.min.7.js | 2 + .../chart/chartmix.umd.min.7.js.map | 1 + src/expendPlugins/chart/chartmix.umd.min.8.js | 2 + .../chart/chartmix.umd.min.8.js.map | 1 + src/expendPlugins/chart/chartmix.umd.min.9.js | 2 + .../chart/chartmix.umd.min.9.js.map | 1 + src/expendPlugins/chart/chartmix.umd.min.js | 16 + .../chart/chartmix.umd.min.js.map | 1 + src/expendPlugins/chart/css/1.68a757d2.css | 1 + src/expendPlugins/chart/css/2.68a757d2.css | 1 + src/expendPlugins/chart/demo.html | 10 + src/expendPlugins/chart/plugin.js | 48 + src/function/func.js | 1779 + src/function/functionImplementation.js | 27370 +++ src/function/functionlist.js | 9049 + src/function/luckysheet_function.js | 12 + src/function/matrix_methods.js | 340 + src/global/analysis.js | 38 + src/global/array.js | 67 + src/global/border.js | 1034 + src/global/browser.js | 131 + src/global/cleargridelement.js | 34 + src/global/count.js | 72 + src/global/createdom.js | 108 + src/global/createsheet.js | 56 + src/global/cursorPos.js | 51 + src/global/datecontroll.js | 87 + src/global/draw.js | 2451 + src/global/dynamicArray.js | 138 + src/global/editor.js | 162 + src/global/extend.js | 1488 + src/global/format.js | 1935 + src/global/formula.js | 4549 + src/global/func_methods.js | 675 + src/global/getRowlen.js | 171 + src/global/getdata.js | 221 + src/global/json.js | 33 + src/global/loading.js | 7 + src/global/location.js | 73 + src/global/method.js | 185 + src/global/refresh.js | 953 + src/global/rhchInit.js | 75 + src/global/scroll.js | 86 + src/global/setdata.js | 216 + src/global/sort.js | 371 + src/global/tooltip.js | 304 + src/global/validate.js | 198 + src/index.html | 68 +- src/index.js | 11 + src/locale/en.js | 660 + src/locale/locale.js | 14 + src/locale/zh.js | 667 + src/luckysheet-chart.js | 1102 - src/luckysheet-core.js | 54560 ------ src/luckysheet-function.js | 43053 ----- src/methods/get.js | 77 + src/methods/set.js | 47 + src/plugins/images/mario.jpg | Bin 66065 -> 0 bytes src/plugins/images/timg.jpg | Bin 33749 -> 0 bytes .../images/world.topo.bathy.200401.jpg | Bin 599466 -> 0 bytes src/plugins/js/jquery-ui.min.js | 2 +- src/store/index.js | 90 + src/utils/chartUtil.js | 92 + src/utils/math.js | 158 + src/utils/polyfill.js | 46 + src/utils/util.js | 642 + 208 files changed, 409271 insertions(+), 99587 deletions(-) create mode 100644 LICENSE create mode 100644 README-zh.md create mode 100644 commitlint.config.js delete mode 100644 deploy_demo.bat create mode 100644 docs/zh/README.md create mode 100644 docs/zh/guide/README.md create mode 100644 docs/zh/guide/config.md create mode 100644 docs/zh/guide/data.md create mode 100644 docs/zh/guide/feature.md create mode 100644 docs/zh/guide/format.md create mode 100644 docs/zh/guide/operate.md create mode 100644 index.html delete mode 100644 src/chartMix.css create mode 100644 src/config.js create mode 100644 src/controllers/alternateformat.js create mode 100644 src/controllers/conditionformat.js create mode 100644 src/controllers/constant.js create mode 100644 src/controllers/controlHistory.js create mode 100644 src/controllers/dropCell.js create mode 100644 src/controllers/expendPlugins.js create mode 100644 src/controllers/filter.js create mode 100644 src/controllers/freezen.js create mode 100644 src/controllers/handler.js create mode 100644 src/controllers/ifFormulaGenerator.js create mode 100644 src/controllers/insertFormula.js create mode 100644 src/controllers/locationCell.js create mode 100644 src/controllers/luckysheetConfigsetting.js create mode 100644 src/controllers/menuButton.js create mode 100644 src/controllers/mobile.js create mode 100644 src/controllers/moreFormat.js create mode 100644 src/controllers/pivotTable.js create mode 100644 src/controllers/postil.js create mode 100644 src/controllers/resize.js create mode 100644 src/controllers/searchReplace.js create mode 100644 src/controllers/select.js create mode 100644 src/controllers/selection.js create mode 100644 src/controllers/server.js create mode 100644 src/controllers/sheetMove.js create mode 100644 src/controllers/sheetSearch.js create mode 100644 src/controllers/sheetmanage.js create mode 100644 src/controllers/sparkline.js create mode 100644 src/controllers/splitColumn.js create mode 100644 src/controllers/updateCell.js create mode 100644 src/core.js create mode 100644 src/data/chartJson.js create mode 100644 src/demoData/sheetCell.js create mode 100644 src/demoData/sheetComment.js create mode 100644 src/demoData/sheetConditionFormat.js create mode 100644 src/demoData/sheetFormula.js create mode 100644 src/demoData/sheetPivotTable.js create mode 100644 src/demoData/sheetPivotTableData.js create mode 100644 src/demoData/sheetSparkline.js create mode 100644 src/demoData/sheetTable.js create mode 100644 src/expendPlugins/chart/chartmix.common.0.js create mode 100644 src/expendPlugins/chart/chartmix.common.0.js.map create mode 100644 src/expendPlugins/chart/chartmix.common.1.js create mode 100644 src/expendPlugins/chart/chartmix.common.1.js.map create mode 100644 src/expendPlugins/chart/chartmix.common.10.js create mode 100644 src/expendPlugins/chart/chartmix.common.10.js.map create mode 100644 src/expendPlugins/chart/chartmix.common.11.js create mode 100644 src/expendPlugins/chart/chartmix.common.11.js.map create mode 100644 src/expendPlugins/chart/chartmix.common.12.js create mode 100644 src/expendPlugins/chart/chartmix.common.12.js.map create mode 100644 src/expendPlugins/chart/chartmix.common.2.js create mode 100644 src/expendPlugins/chart/chartmix.common.2.js.map create mode 100644 src/expendPlugins/chart/chartmix.common.3.js create mode 100644 src/expendPlugins/chart/chartmix.common.3.js.map create mode 100644 src/expendPlugins/chart/chartmix.common.4.js create mode 100644 src/expendPlugins/chart/chartmix.common.4.js.map create mode 100644 src/expendPlugins/chart/chartmix.common.5.js create mode 100644 src/expendPlugins/chart/chartmix.common.5.js.map create mode 100644 src/expendPlugins/chart/chartmix.common.6.js create mode 100644 src/expendPlugins/chart/chartmix.common.6.js.map create mode 100644 src/expendPlugins/chart/chartmix.common.7.js create mode 100644 src/expendPlugins/chart/chartmix.common.7.js.map create mode 100644 src/expendPlugins/chart/chartmix.common.8.js create mode 100644 src/expendPlugins/chart/chartmix.common.8.js.map create mode 100644 src/expendPlugins/chart/chartmix.common.9.js create mode 100644 src/expendPlugins/chart/chartmix.common.9.js.map create mode 100644 src/expendPlugins/chart/chartmix.common.js create mode 100644 src/expendPlugins/chart/chartmix.common.js.map create mode 100644 src/expendPlugins/chart/chartmix.css create mode 100644 src/expendPlugins/chart/chartmix.umd.0.js create mode 100644 src/expendPlugins/chart/chartmix.umd.0.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.1.js create mode 100644 src/expendPlugins/chart/chartmix.umd.1.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.10.js create mode 100644 src/expendPlugins/chart/chartmix.umd.10.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.11.js create mode 100644 src/expendPlugins/chart/chartmix.umd.11.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.12.js create mode 100644 src/expendPlugins/chart/chartmix.umd.12.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.2.js create mode 100644 src/expendPlugins/chart/chartmix.umd.2.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.3.js create mode 100644 src/expendPlugins/chart/chartmix.umd.3.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.4.js create mode 100644 src/expendPlugins/chart/chartmix.umd.4.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.5.js create mode 100644 src/expendPlugins/chart/chartmix.umd.5.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.6.js create mode 100644 src/expendPlugins/chart/chartmix.umd.6.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.7.js create mode 100644 src/expendPlugins/chart/chartmix.umd.7.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.8.js create mode 100644 src/expendPlugins/chart/chartmix.umd.8.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.9.js create mode 100644 src/expendPlugins/chart/chartmix.umd.9.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.js create mode 100644 src/expendPlugins/chart/chartmix.umd.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.min.0.js create mode 100644 src/expendPlugins/chart/chartmix.umd.min.0.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.min.1.js create mode 100644 src/expendPlugins/chart/chartmix.umd.min.1.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.min.10.js create mode 100644 src/expendPlugins/chart/chartmix.umd.min.10.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.min.11.js create mode 100644 src/expendPlugins/chart/chartmix.umd.min.11.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.min.12.js create mode 100644 src/expendPlugins/chart/chartmix.umd.min.12.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.min.2.js create mode 100644 src/expendPlugins/chart/chartmix.umd.min.2.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.min.3.js create mode 100644 src/expendPlugins/chart/chartmix.umd.min.3.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.min.4.js create mode 100644 src/expendPlugins/chart/chartmix.umd.min.4.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.min.5.js create mode 100644 src/expendPlugins/chart/chartmix.umd.min.5.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.min.6.js create mode 100644 src/expendPlugins/chart/chartmix.umd.min.6.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.min.7.js create mode 100644 src/expendPlugins/chart/chartmix.umd.min.7.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.min.8.js create mode 100644 src/expendPlugins/chart/chartmix.umd.min.8.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.min.9.js create mode 100644 src/expendPlugins/chart/chartmix.umd.min.9.js.map create mode 100644 src/expendPlugins/chart/chartmix.umd.min.js create mode 100644 src/expendPlugins/chart/chartmix.umd.min.js.map create mode 100644 src/expendPlugins/chart/css/1.68a757d2.css create mode 100644 src/expendPlugins/chart/css/2.68a757d2.css create mode 100644 src/expendPlugins/chart/demo.html create mode 100644 src/expendPlugins/chart/plugin.js create mode 100644 src/function/func.js create mode 100644 src/function/functionImplementation.js create mode 100644 src/function/functionlist.js create mode 100644 src/function/luckysheet_function.js create mode 100644 src/function/matrix_methods.js create mode 100644 src/global/analysis.js create mode 100644 src/global/array.js create mode 100644 src/global/border.js create mode 100644 src/global/browser.js create mode 100644 src/global/cleargridelement.js create mode 100644 src/global/count.js create mode 100644 src/global/createdom.js create mode 100644 src/global/createsheet.js create mode 100644 src/global/cursorPos.js create mode 100644 src/global/datecontroll.js create mode 100644 src/global/draw.js create mode 100644 src/global/dynamicArray.js create mode 100644 src/global/editor.js create mode 100644 src/global/extend.js create mode 100644 src/global/format.js create mode 100644 src/global/formula.js create mode 100644 src/global/func_methods.js create mode 100644 src/global/getRowlen.js create mode 100644 src/global/getdata.js create mode 100644 src/global/json.js create mode 100644 src/global/loading.js create mode 100644 src/global/location.js create mode 100644 src/global/method.js create mode 100644 src/global/refresh.js create mode 100644 src/global/rhchInit.js create mode 100644 src/global/scroll.js create mode 100644 src/global/setdata.js create mode 100644 src/global/sort.js create mode 100644 src/global/tooltip.js create mode 100644 src/global/validate.js create mode 100644 src/index.js create mode 100644 src/locale/en.js create mode 100644 src/locale/locale.js create mode 100644 src/locale/zh.js delete mode 100644 src/luckysheet-chart.js delete mode 100644 src/luckysheet-core.js delete mode 100644 src/luckysheet-function.js create mode 100644 src/methods/get.js create mode 100644 src/methods/set.js delete mode 100644 src/plugins/images/mario.jpg delete mode 100644 src/plugins/images/timg.jpg delete mode 100644 src/plugins/images/world.topo.bathy.200401.jpg create mode 100644 src/store/index.js create mode 100644 src/utils/chartUtil.js create mode 100644 src/utils/math.js create mode 100644 src/utils/polyfill.js create mode 100644 src/utils/util.js diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..d17c8fab0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +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 diff --git a/README-zh.md b/README-zh.md new file mode 100644 index 000000000..7b07c1638 --- /dev/null +++ b/README-zh.md @@ -0,0 +1,111 @@ +# Luckysheet +简体中文 | [English](./README.md) + +## 介绍 +Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置简单、完全开源。 + +## 特性 +1. Luckysheet支持表格设置包括冻结行列、合并单元格、筛选、排序、查询、条件格式、批注 +2. 支持数据分析功能包括透视表、图表、分列、矩阵操作、内置385个计算函数 +3. 支持一键截图、复制为json数据、共享编辑、excel与Luckysheet之间数据的复制粘贴 +4. 支持移动端查看 +5. 支持sparkLine +6. 下拉复制 +7. 快捷键 + +![演示](https://minio.cnbabylon.com/public/luckysheet/LuckysheetDemo.gif) + +## 计划 +- 完善图表插件 +- 插入图片 +- 数据验证(复选框、下拉列表) +- 打印 +- 单元格分段样式 +- 树形菜单 +- 表格功能:筛选,切片 +- excel导入/导出 +- 更多... + +## 文档 +[在线demo](https://mengshukeji.github.io/LuckysheetDemo/) + +[在线文档](https://mengshukeji.github.io/LuckysheetDocs/) + +## 环境 +[Node.js](https://nodejs.org/en/) Version >= 6 + +## 安装 +``` +npm install +npm install gulp -g +``` + +## 开发 +开发 +``` +npm run dev +``` +打包 +``` +npm run build +``` +阅读 + +Luckysheet的核心代码为luckysheet-core.js和luckysheet-function.js,开发者看源码只需要看这两个文件即可,接下来会讨论进行模块化方案,完善这个插件. + +## 用法 + +#### 第一步 +`npm run build`后`dist`文件夹下的所有文件复制到项目目录 + +#### 第二步 +引入依赖 +``` + + + + + +``` +#### 第三步 +指定一个表格容器 +``` +
+``` +#### 第四步 +创建一个表格 +``` + +``` + +## 联系 +mengshu@office2.cn + +## 交流 + +- 添加小编微信,拉你进Luckysheet开发者交流微信群,备注:加群 + + + +或者 + +- 加入Luckysheet开发者交流QQ群 + + + +## 贡献者和感谢 +- [@wpxp123456](https://github.com/wpxp123456) +- [@Dushusir](https://github.com/Dushusir) + +## 版权信息 +[MIT](http://opensource.org/licenses/MIT) + +Copyright (c) 2020-present, mengshukeji diff --git a/README.md b/README.md index 7d1d58458..7db022077 100644 --- a/README.md +++ b/README.md @@ -1,103 +1,106 @@ # Luckysheet +[![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) -## Introduction - 介绍 -Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置简单、完全开源。 +English| [简体中文](./README-zh.md) -## Features - 特性 -1. Luckysheet支持表格设置包括冻结行列、合并单元格、筛选、排序、查询、条件格式、批注 -2. 支持数据分析功能包括透视表、图表、分列、矩阵操作、内置385个计算函数 -3. 支持一键截图、复制为json数据、共享编辑、excel与Luckysheet之间数据的复制粘贴 -4. 支持移动端查看 -5. 支持sparkLine -![演示](https://minio.cnbabylon.com/public/luckysheet/LuckysheetDemo.gif) +## Introduction +Luckysheet is an online spreadsheet like excel that is powerful, simple to configure, and completely open source. -## Plan - 计划 -- 模块化(进行中) -- excel导入/导出 -- 表单 -- 插入图片 -- 更多... -## Documentation - 文档 -[在线demo](https://mengshukeji.github.io/LuckysheetDemo/) +## Features +1. Support table settings including freezing columns, merging cells, filtering, sorting, querying, conditional formatting, and annotations +2. Support data analysis functions including pivottables, charts, columns, matrix operations, built-in 385 calculation functions +3. Support one-click screenshots, data copying as json,shared editing, and free data copying and pasting between excel and luckysheet +4. Support mobile viewing +5. Support sparkLine +6. Drop down copy +7. Keyboard shortcuts -[在线文档](https://mengshukeji.github.io/LuckysheetDocs/) +![Demo](https://minio.cnbabylon.com/public/luckysheet/LuckysheetDemo.gif) -## Requirements - 环境 +## Plan +- Improve chart plugin +- Insert picture +- Data validation (checkbox, drop-down list) +- Print +- Cell segmentation style +- Tree menu +- Table function: filter, slice +- Excel import/export +- More... + +## Documentation +[Online demo](https://mengshukeji.github.io/LuckysheetDemo/) + +[Online documentation](https://mengshukeji.github.io/LuckysheetDocs/en/) + +## Requirements [Node.js](https://nodejs.org/en/) Version >= 6 -## Installation - 安装 +## Installation ``` npm install npm install gulp -g ``` -## Development - 开发 -开发 +## Development +Development ``` npm run dev ``` -打包 +Package ``` npm run build ``` -阅读 +Read -Luckysheet的核心代码为luckysheet-core.js和luckysheet-function.js,开发者看源码只需要看这两个文件即可,接下来会讨论进行模块化方案,完善这个插件. +The core code of Luckysheet is luckysheet-core.js and luckysheet-function.js, developers only need to look at these two files to see the source code, and then we will discuss the modularization scheme and improve this library. -## Usage - 用法 +## Usage -#### 第一步 -npm run build后dist文件夹下的所有文件复制到项目目录 +#### First step +`npm run build`后`dist`文件夹下的所有文件复制到项目目录 -#### 第二步 -引入依赖 +#### Second step +Introduce dependencies ``` - - - - - + + + + + ``` -#### 第三步 -指定一个表格容器 +#### Third step +Specify a table container ``` ``` -#### 第四步 -创建一个表格 +#### Fourth step +Create a table ``` ``` -## Contact - 联系 +## Contact mengshu@office2.cn -## communication - 交流 - -- 添加小编微信,拉你进Luckysheet开发者交流微信群,备注:加群 - - - -或者 +## communication -- 加入Luckysheet开发者交流QQ群 - - +- [Gitter](https://gitter.im/mengshukeji/Luckysheet) -## Authors and acknowledgment - 贡献者和感谢 -- Bug Pan ([@wpxp123456](https://github.com/wpxp123456)) -- Dushusir ([@Dushusir](https://github.com/Dushusir)) +## Authors and acknowledgment +- [@wpxp123456](https://github.com/wpxp123456) +- [@Dushusir](https://github.com/Dushusir) -## License - 版权信息 +## License [MIT](http://opensource.org/licenses/MIT) Copyright (c) 2020-present, mengshukeji diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 000000000..f3f3988d8 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ['@commitlint/config-conventional'] +} diff --git a/deploy_demo.bat b/deploy_demo.bat deleted file mode 100644 index 32b43207a..000000000 --- a/deploy_demo.bat +++ /dev/null @@ -1,6 +0,0 @@ -npm run build -cd dist -git init -git add -A -git commit -m 'deploy Luckysheet demo' -git push -f https://github.com/mengshukeji/LuckysheetDemo.git master:gh-pages \ No newline at end of file diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 0b00af84d..75e9f095b 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,34 +1,96 @@ module.exports = { - title: 'Luckysheet文档', - description: 'Luckysheet 配置文档/API/教程', base: '/LuckysheetDocs/', + locales: { + // 键名是该语言所属的子路径 + // 作为特例,默认语言可以使用 '/' 作为其路径。 + '/': { + lang: 'en-US', // 将会被设置为 的 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: { logo: '/img/logo.png', - // 页面滚动 - smoothScroll: true, - // 导航栏 - nav: [ - { text: '首页', link: '/' }, - { text: '指南', link: '/guide/' }, - { text: '演示', link: 'https://mengshukeji.github.io/LuckysheetDemo/' }, - { text: 'Github', link: 'https://github.com/mengshukeji/Luckysheet' }, - ], - // 侧边栏 - sidebar: { - '/guide/': [ - '', - 'config', - 'feature', - 'data', - 'operate', - 'format' - ], - }, + // 仓库地址 repo: 'mengshukeji/Luckysheet', - // 仓库链接文字 - repoLabel: '在 GitHub 上编辑此页', + // 允许编辑链接文字 + 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: '/en/' }, + { text: 'Guide', link: '/en/guide/' }, + { text: 'Demo', link: 'https://mengshukeji.github.io/LuckysheetDemo/' } + ], + // 侧边栏 + sidebar: { + '/guide/': [ + '', + 'config', + 'feature', + 'data', + 'operate', + 'format' + ], + }, + }, + '/zh/': { + // 多语言下拉菜单的标题 + selectText: '选择语言', + // 该语言在下拉菜单中的标签 + label: '简体中文', + ariaLabel: '选择语言', + // 编辑链接文字 + editLinkText: '在 GitHub 上编辑此页', + lastUpdated: '上次更新', + // Service Worker 的配置 + serviceWorker: { + updatePopup: { + message: "发现新内容可用.", + buttonText: "刷新" + } + }, + // 导航栏 + nav: [ + { text: '首页', link: '/' }, + { text: '指南', link: '/guide/' }, + { text: '演示', link: 'https://mengshukeji.github.io/LuckysheetDemo/' } + ], + // 侧边栏 + sidebar: { + '/zh/guide/': [ + '', + 'config', + 'feature', + 'data', + 'operate', + 'format' + ], + }, + }, + + }, }, } \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 28ebb33ad..198825b98 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,15 +1,15 @@ --- home: true heroText: Luckysheet -tagline: Luckysheet 配置文档/API/教程 -actionText: 快速上手 → +tagline: Configuration Document · API · Tutorial +actionText: Get Started → actionLink: /guide/ features: -- title: 功能强大 - details: 包含大量常用电子表格功能,替代你的excel -- title: 配置简单 - details: 最少的配置就能开始上手使用 -- title: 完全开源 - details: 社区驱动,共同来完善你的想法 +- 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 diff --git a/docs/guide/README.md b/docs/guide/README.md index a20628f9a..0c8f7537b 100644 --- a/docs/guide/README.md +++ b/docs/guide/README.md @@ -1,123 +1,145 @@ -# 快速上手 +# Get started -## 基本介绍 -Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置简单、完全开源。 +## Introduction +Luckysheet is an online spreadsheet like excel that is powerful, simple to configure, and completely open source. -### 特性 -1. Luckysheet支持表格设置包括冻结行列、合并单元格、筛选、排序、查询、条件格式、批注 -2. 支持数据分析功能包括透视表、分列、矩阵操作、内置385个计算函数 -3. 支持一键截图、复制为json数据、共享编辑、excel与Luckysheet之间数据的复制粘贴 -4. 支持移动端查看 +### Features +1. Support table settings including freezing columns, merging cells, filtering, sorting, querying, conditional formatting, and annotations +2. Support data analysis functions including pivottables, charts, columns, matrix operations, built-in 385 calculation functions +3. Support one-click screenshots, data copying as json,shared editing, and free data copying and pasting between excel and luckysheet +4. Support mobile viewing +5. Support sparkLine +6. Drop down copy +7. keyboard shortcuts -![演示](https://minio.cnbabylon.com/public/luckysheet/LuckysheetDemo.gif) +![Demo](https://minio.cnbabylon.com/public/luckysheet/LuckysheetDemo.gif) ### Demo -[在线demo](https://mengshukeji.github.io/LuckysheetDemo/) +[Online demo](https://mengshukeji.github.io/LuckysheetDemo/) -## 开发模式 +## Development model -### 环境 +### Requirements [Node.js](https://nodejs.org/en/) Version >= 6 -### 安装 +### Installation ```shell npm install npm install gulp -g ``` -### 开发 +### Development ```shell npm run dev ``` -### 打包 +### Package ```shell npm run build ``` -## 使用步骤 +## Steps for usage -### 第一步 -npm run build后dist文件夹下的所有文件复制到项目目录 +### First step +After `npm run build`, all files in the `dist` folder are copied to the project directory -### 第二步 -引入依赖 +### Second step +Introduce dependencies ```html - - - - - + + + + + ``` -### 第三步 -指定一个表格容器 +### Third step +Specify a table container ```html ``` -### 第四步 -创建一个表格 +### Fourth step +Create a table ```javascript ``` -## 整体结构 +## Structure -### 格式 +### Format -一个完整的Luckysheet表格文件的数据格式为:luckysheetfile,一个表格表格文件包含若干个sheet文件,对应excel的sheet0、sheet1等。 +The data format of a complete Luckysheet table file is: luckysheetfile, a table file contains several sheet files, corresponding to excel sheet0, sheet1, etc. -一个Luckysheet文件的示例如下,该表格包含3个sheet:` -luckysheetfile = [ {sheet1设置}, {sheet2设置}, {sheet3设置} ]` -相当于excel的3个sheet +An example of a Luckysheet file is as follows, the table contains 3 sheets:` +luckysheetfile = [{sheet1 settings}, {sheet2 settings}, {sheet3 settings}]` +Equivalent to 3 sheets of excel ![excel sheet](https://minio.cnbabylon.com/public/luckysheet/excel.png) -文件中的一个sheet的示例如下: +An example of a sheet in the file is as follows: ```javascript luckysheetfile[0] = { - "name": "超市销售额", - "color": "", - "chart": [], - "status": 0, - "order": 0, - "celldata": [], - "row":90, - "column":100, - "index": 0, - "visibledatarow": [], - "visibledatacolumn": [], - "rowsplit": [], - "ch_width": 4629, - "rh_height": 1681, - "luckysheet_select_save": {}, - "luckysheet_selection_range": {}, - "scrollLeft": 0, - "scrollTop": 0, - "load": "1", - "config": { - "columlen": {}, - "rowhidden": {} - } - , - "pivotTable": {}, - "isPivotTable": true, - "calcChain": [], - "filter":{key1:value1, key2:value2}, - "filter_select": {} + "name": "Cell", //Worksheet name + "color": "", //Worksheet color + "config": {}, //Table row height, column width, merged cells, borders, hidden rows and other settings + "index": "0", //Worksheet index + "chart": [], //Chart configuration + "status": "1", //Activation status + "order": "0", //The order of the worksheet + "hide": 0,//whether to hide + "column": 18, //Number of columns + "row": 36, //number of rows + "celldata": [], //Original cell data set + "visibledatarow": [], //The position of all rows + "visibledatacolumn": [], //The position of all columns + "ch_width": 2322, //The width of the worksheet area + "rh_height": 949, //The height of the worksheet area + "scrollLeft": 0, //Left and right scroll bar position + "scrollTop": 315, //Up and down scroll bar position + "luckysheet_select_save": [], //selected area + "luckysheet_conditionformat_save": {},//Conditional format + "calcChain": [],//Formula chain + "isPivotTable":false,//Whether to pivot table + "pivotTable":{},//Pivot table settings + "filter_select": null,//Filter range + "filter": null,//Filter configuration + "luckysheet_alternateformat_save": [], //Alternate colors + "luckysheet_alternateformat_save_modelCustom": []//Customize alternate colors } ``` -### 查看方式 -在chrome的console中查看 +### View method +View in chrome's console `luckysheet.getluckysheetfile()` -可以看到完整设置 -[{shee1}, {sheet2}, {sheet3}] \ No newline at end of file +You can see the complete settings +`[{shee1}, {sheet2}, {sheet3}]` + +## Keyboard shortcuts + +| Keyboard shortcuts | Features | +| ------------ | ------------ | +| CTRL + C | Copy cell | +| CTRL + V | Paste cell | +| CTRL + X | Cut cell | +| CTRL + Z | Undo | +| CTRL + Y | Redo | +| CTRL + A | Select all | +| CTRL + B | Bold | +| CTRL + F | Find | +| CTRL + H | Replace | +| CTRL + I | Italic | +| CTRL + UP/DOWN/LEFT/RIGHT | Quickly adjust cell marquee | +| SHIFT + UP/DOWN/LEFT/RIGHT | Adjust selection area | +| CTRL + Left mouse click | Multiple selection cell | +| SHIFT + Left mouse click | Adjust selection area | +| UP/DOWN/LEFT/RIGHT | Single move adjustment cell selection box | +| ENTER | Edit cell | +| DELETE | Clear cell data | \ No newline at end of file diff --git a/docs/guide/config.md b/docs/guide/config.md index e1cb2f8cf..6b8c8663b 100644 --- a/docs/guide/config.md +++ b/docs/guide/config.md @@ -1,232 +1,214 @@ -# 基本配置 +# Basic Configuration ## container -- 类型:String -- 默认值:"luckysheet" -- 作用:容器的ID +- Type: String +- Default: "luckysheet" +- Usage: Container ID ------------ ## title -- 类型:String -- 默认值:"Luckysheet Demo" -- 作用:表格的名称 +- Type: String +- Default: "Luckysheet Demo" +- Usage: Table's name ------------ ## column -- 类型:Number -- 默认值:60 -- 作用:空表格默认的列数量 +- Type: Number +- Default: 60 +- Usage: The default number of columns in an empty table ------------ ## row -- 类型:Number -- 默认值:84 -- 作用:空表格默认的行数据量 +- Type: Number +- Default: 84 +- Usage: The default number of rows in an empty table ------------ ## data -- 类型:Array -- 默认值:[{ "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数据[shee1, sheet2, sheet3] +- Type: Array +- Default: [{ "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 }] +- Usage: Client sheet data `[shee1, sheet2, sheet3]` ------------ ## fullscreenmode -- 类型:Boolean -- 默认值:true -- 作用:是否全屏模式,非全屏模式下,标记框不会强制选中。 +- Type: Boolean +- Default: true +- Usage: Whether full-screen mode. In non-full-screen mode, the marker box is not forced to be selected ------------ ## autoFormatw -- 类型:Boolean -- 默认值:false -- 作用:自动格式化超过4位数的数字为 亿万格式 例:true or "true" or "TRUE" +- Type: Boolean +- Default: false +- Usage: Automatically format numbers with more than 4 digits as 'billion format', for example: true or "true" or "TRUE" ------------ ## accuracy -- 类型:Number -- 默认值:undefined -- 作用:设置传输来的数值的精确位数,小数点后n位 传参数为数字或数字字符串,例: "0" 或 0 +- Type: Number +- Default: undefined +- Usage: Set the accuracy,the number of digits after the decimal point. Pass the parameter as a number or numeric string, for example: "0" or 0 ------------ ## allowCopy -- 类型:Boolean -- 默认值:true -- 作用:是否允许拷贝 +- Type: Boolean +- Default: true +- Usage: Whether to allow copying ------------ ## showtoolbar -- 类型:Boolean -- 默认值:true -- 作用:是否第二列显示工具栏 +- Type: Boolean +- Default: true +- Usage: Whether to display the toolbar in the second row ------------ ## showinfobar -- 类型:Boolean -- 默认值:true -- 作用:是否显示顶部名称栏 +- Type: Boolean +- Default: true +- Usage: Whether to display the top name bar ------------ ## showsheetbar -- 类型:Boolean -- 默认值:true -- 作用:是否显示底部表格名称区域 +- Type: Boolean +- Default: true +- Usage: Whether to display the bottom table name area ------------ ## showstatisticBar -- 类型:Boolean -- 默认值:true -- 作用:是否显示底部计数栏 - ------------- -## editMode -- 类型:Boolean -- 默认值:false -- 作用:是否为编辑模式 +- Type: Boolean +- Default: true +- Usage: Whether to display the bottom count bar ------------ ## allowEdit -- 类型:Boolean -- 默认值:true -- 作用:是否允许前台编辑 +- Type: Boolean +- Default: true +- Usage: Whether to allow frontend editing ------------ ## enableAddRow -- 类型:Boolean -- 默认值:true -- 作用:允许增加行 +- Type: Boolean +- Default: true +- Usage: Allow add line ------------ ## enableAddCol -- 类型:Boolean -- 默认值:true -- 作用:允许增加列 +- Type: Boolean +- Default: true +- Usage: Allow add column ------------ ## pointEdit -- 类型:Boolean -- 默认值:false -- 作用:是否是编辑器插入表格模式 +- Type: Boolean +- Default: false +- Usage: Whether the editor inserts table mode ------------ ## pointEditUpdate -- 类型:Function -- 默认值:null -- 作用:编辑器表格更新函数 +- Type: Function +- Default: null +- Usage: Editor table update function ------------ ## pointEditZoom -- 类型:Number -- 默认值:1 -- 作用:编辑器表格编辑时缩放比例 - ------------- -## pointEditZoom -- 类型:Number -- 默认值:1 -- 作用:编辑器表格编辑时缩放比例 +- Type: Number +- Default: 1 +- Usage: Editor table scaling when editing ------------ ## userInfo -- 类型:String -- 默认值:`' rabbit'` -- 作用:右上角的用户信息展示样式 +- Type: String +- Default: `' rabbit'` +- Usage: User information display style in the upper right corner ------------ ## userMenuItem -- 类型:Array -- 默认值:`[{url:"www.baidu.com", "icon":'', "name":"我的表格"}, {url:"www.baidu.com", "icon":'', "name":"退出登陆"}]` -- 作用:点击右上角的用户信息弹出的菜单 +- Type: Array +- Default: `[{url:"www.baidu.com", "icon":'', "name":"My Table"}, {url:"www.baidu.com", "icon":'', "name":"Sign Out"}]` +- Usage: The menu, which popped up by clicking the user information in the upper right corner ------------ ## myFolderUrl -- 类型:String -- 默认值:"www.baidu.com" -- 作用:左上角<返回按钮的链接 - ------------- -## config -- 类型:Object -- 默认值:{} -- 作用:表格行高、列宽、合并单元格、公式等设置 +- Type: String +- Default: "www.baidu.com" +- Usage: Back button link in the upper left corner ------------ ## devicePixelRatio -- 类型:Number -- 默认值:window.devicePixelRatio -- 作用:设备比例,比例越大表格分标率越高 +- Type: Number +- Default: window.devicePixelRatio +- Usage: Device Pixel Ratio, the larger the ratio, the higher the table resolution ------------ ## gridKey -- 类型:String -- 默认值:"" -- 作用:表格唯一标识符 +- Type: String +- Default: "" +- Usage: Form unique identifier ------------ ## loadUrl -- 类型:String -- 默认值:"" -- 作用:配置loadUrl的地址,luckysheet会通过ajax请求表格数据,默认载入status为1的sheet数据中的所有data,其余的sheet载入除data字段外的所有字段 +- Type: String +- Default: "" +- Usage: Configure the address of `loadUrl`, Luckysheet will request the table data through ajax. By default, all `data` in the sheet data with status 1 is loaded, and the rest of the sheet loads all fields except the `data` field. ------------ ## loadSheetUrl -- 类型:String -- 默认值:"" -- 作用:配置loadSheetUrl的地址,参数为gridKey(表格主键) 和 index(sheet主键合集,格式为[1,2,3]),返回的数据为sheet的data字段数据集合 +- Type: String +- Default: "" +- Usage: Configure the address of `loadSheetUrl`, the parameters are `gridKey` (table primary key) and `index` (sheet primary key collection, format is `[1,2,3]`), the returned data is the `data` field set of sheet ------------ ## updateUrl -- 类型:String -- 默认值:"" -- 作用:表格数据的更新地址 +- Type: String +- Default: "" +- Usage: Update URL of table data ------------ ## updateImageUrl -- 类型:String -- 默认值:"" -- 作用:缩略图的更新地址 +- Type: String +- Default: "" +- Usage: Update URL of thumbnail ------------ ## allowUpdate -- 类型:Boolean -- 默认值:false -- 作用:是否允许编辑后的后台更新 +- Type: Boolean +- Default: false +- Usage: Whether to allow background updates after editing ------------ ## functionButton -- 类型:String -- 默认值:"" -- 作用:右上角功能按钮,例如`' '` +- Type: String +- Default: "" +- Usage: Function buttons in the upper right corner, for example`' '` ------------ ## showConfigWindowResize -- 类型:Boolean -- 默认值:true -- 作用:图表和数据透视表的配置会在右侧弹出,设置弹出后表格是否会自动缩进 +- Type: Boolean +- Default: true +- Usage: The configuration of the chart or pivot table will pop up on the right. Set whether the table will be automatically indented after popping up ------------ ## enablePage -- 类型:Boolean -- 默认值:false -- 作用:允许加载下一页 +- Type: Boolean +- Default: false +- Usage: Allow next page to load ------------ ## chartConfigChange -- 类型:Function -- 默认值:null -- 作用:图表插件中图表更新触发的自定义方法 +- Type: Function +- Default: null +- Usage: Custom method for triggering chart update in chart plugin ------------ ## beforeCreateDom -- 类型:Function -- 默认值:null -- 作用:表格创建之前自定义方法 +- Type: Function +- Default: null +- Usage: Custom method before table creation ------------ ## fireMousedown -- 类型:Function -- 默认值:null -- 作用:单元格数据下钻自定义方法 +- Type: Function +- Default: null +- Usage: Custom method for drilling down cell data ------------ \ No newline at end of file diff --git a/docs/guide/data.md b/docs/guide/data.md index 72c236378..b936cfb00 100644 --- a/docs/guide/data.md +++ b/docs/guide/data.md @@ -1,24 +1,44 @@ -# 表格数据 +# Table Data -## 获取表格数据 +## Get table data -- **配置**: +- **Configuration**: - 配置 `updateUrl` 的地址,Luckysheet会通过ajax请求表格数据,默认载入status为1的sheet数据中的所有data,其余的sheet载入除data字段外的所有字段。 + Configure the address of `updateUrl`, Luckysheet will request the table data through ajax. By default, all `data` in the sheet data with status 1 is loaded, and the rest of the sheet loads all fields except the `data` field. -- **格式**: +- **Format**: + Through the global method `luckysheet.getluckysheetfile()`, the configuration information of all worksheets can be obtained. - luckysheetfile示例如下: + The luckysheetfile example is as follows: ```json [ { - "name": "Sheet1", - "color": "", - "status": "1", - "order": "0", - "celldata": [], - "config": {}, - "index": 0 + "name": "Cell", //Worksheet name + "color": "", //Worksheet color + "config": {}, //Table row height, column width, merged cells, borders, hidden rows and other settings + "index": "0", //Worksheet index + "chart": [], //Chart configuration + "status": "1", //Activation status + "order": "0", //The order of the worksheet + "hide": 0,//whether to hide + "column": 18, //Number of columns + "row": 36, //number of rows + "celldata": [], //Original cell data set + "visibledatarow": [], //The position of all rows + "visibledatacolumn": [], //The position of all columns + "ch_width": 2322, //The width of the worksheet area + "rh_height": 949, //The height of the worksheet area + "scrollLeft": 0, //Left and right scroll bar position + "scrollTop": 315, //Up and down scroll bar position + "luckysheet_select_save": [], //selected area + "luckysheet_conditionformat_save": {},//Conditional format + "calcChain": [],//Formula chain + "isPivotTable":false,//Whether to pivot table + "pivotTable":{},//Pivot table settings + "filter_select": null,//Filter range + "filter": null,//Filter configuration + "luckysheet_alternateformat_save": [], //Alternate colors + "luckysheet_alternateformat_save_modelCustom": []//Customize alternate colors }, { "name": "Sheet2", @@ -40,53 +60,687 @@ } ] ``` +- **Explanation**: + + ------------ + ## name + - Type:String + - Default:"Sheet1" + - Usage:Worksheet name + + ------------ + ## color + - Type:String + - Default:"##f20e0e" + - Usage:Worksheet color, there will be a bottom border under the worksheet name + + ------------ + ## index + - Type:Number + - Default:0 + - Usage:Worksheet index, starting from 0 + + ------------ + ## status + - Type:Number + - Default:1 + - Usage: Active state, there is only one active worksheet, other worksheets are 0 + + ------------ + ## order + - Type:Number + - Default:0 + - Usage: The order of the worksheets, it will increase when a worksheet is added, starting from 0 + + ------------ + ## hide + - Type:Number + - Default:0 + - Usage: Whether to hide, `0` means not to hide, `1` means to hide + + ------------ + ## column + - Type:Number + - Default:18 + - Usage: Number of cell columns + + ------------ + ## row + - Type:Number + - Default:36 + - Usage: Number of cell rows + + ------------ + ## visibledatarow + - Type:Number + - Default:[] + - Usage: Position information of all rows, incremental row position data + + ------------ + ## visibledatacolumn + - Type:Number + - Default:[] + - Usage: Position information of all columns, incremental column position data + + ------------ + ## ch_width + - Type:Number + - Default:2322 + - Usage:The width of the entire worksheet area (the gray area including the border) + + ------------ + ## rh_height + - Type:Number + - Default:2322 + - Usage:The height of the entire worksheet area (the gray area containing the border) + + ------------ + ## scrollLeft + - Type:Number + - Default:0 + - Usage: Left and right scroll bar position + + ------------ + ## scrollTop + - Type:Number + - Default:0 + - Usage: Up and down scroll bar position + + ------------ + ## config + - Type: Object + - Default: {} + - Usage: Table row height, column width, merged cells, borders, hidden rows and other settings + + ### config.merge + - Type:Object + - Default:{} + - Usage:Merge cell settings, example: + ```js + { + "13_5": { + "r": 13, + "c": 5, + "rs": 3, + "cs": 1 + }, + "13_7": { + "r": 13, + "c": 7, + "rs": 3, + "cs": 2 + }, + "14_2": { + "r": 14, + "c": 2, + "rs": 1, + "cs": 2 + } + } + ``` + The `key` in the object is the spliced value of `r +'_' + c`, and the `value` is the cell information in the upper left corner: r: number of rows, c: number of columns, rs: number of merged rows, cs: merge Number of columns + + ### config.rowlen + - Type:Object + - Default:{} + - Usage:The row height of each cell, example: + ```js + "rowlen": { + "0": 20, + "1": 20, + "2": 20 + } + ``` + + ### config.columlen + - Type:Object + - Default:{} + - Usage:The column width of each cell, example: + ```js + "columlen": { + "0": 97, + "1": 115, + "2": 128 + } + ``` + + ### config.borderInfo + - Type:Object + - Default:{} + - Usage:The border information of the cell, example: + ```js + "borderInfo": [{ + "rangeType": "cell", + "value": { + "row_index": 3, + "col_index": 3, + "l": { + "style": 10, + "color": "rgb(255, 0, 0)" + }, + "r": { + "style": 10, + "color": "rgb(255, 0, 0)" + }, + "t": { + "style": 10, + "color": "rgb(255, 0, 0)" + }, + "b": { + "style": 10, + "color": "rgb(255, 0, 0)" + } + } + }, + { + "rangeType": "range", + "borderType": "border-all", + "style": "3", + "color": "#0000ff", + "range": [{ + "row": [7, 8], + "column": [2, 3] + }] + }, { + "rangeType": "range", + "borderType": "border-inside", + "style": "3", + "color": "#0000ff", + "range": [{ + "row": [7, 8], + "column": [8, 9] + }] + }] + ``` + There are two types of range: single cell and selection + 1. selection `rangeType: "range"` + + - Border type `borderType:"border-left" | "border-right" | "border-top" | "border-bottom" | "border-all" | "border-outside" | "border-inside" | "border-horizontal" | "border-vertical" | "border-none"`, + - Border thickness `style: 1 Thin | 2 Hair | 3 Dotted | 4 Dashed | 5 DashDot | 6 DashDotDot | 7 Double | 8 Medium | 9 MediumDashed | 10 MediumDashDot | 11 MediumDashDotDot | 12 SlantedDashDot | 13 Thick` + - Border color `color: Hexadecimal color value` + - Selection area `range: Row and column information array` + + 2. Single cell `rangeType:"cell"` + - Number of rows and columns `value.row_index: number,value.col_index: number` + - Four border objects `value.l:Left border,value.r:Right border,value.t:Top border,value.b:Bottom border` + - Border thickness `value.l.style: 1 Thin | 2 Hair | 3 Dotted | 4 Dashed | 5 DashDot | 6 DashDotDot | 7 Double | 8 Medium | 9 MediumDashed | 10 MediumDashDot | 11 MediumDashDotDot | 12 SlantedDashDot | 13 Thick` + - Border color `value.l.color: Hexadecimal color value` + + ### config.rowhidden + - Type:Object + - Default:{} + - Usage:Hidden row information, example: + ```js + "rowhidden": { + "30": 0, + "31": 0 + } + ``` + - Rows:`rowhidden[Rows]: 0`,`key`Specify the number of rows,`value` is always `0` + + ------------ + ## celldata + - Type:Array + - Default:[] + - Usage: The original cell data set is a set containing `{r:0,c:0,v:{m:"value",v:"value",ct: {fa: "General", t: "g"}} }`The one-dimensional array of format cell information is only used during initialization. After the table is initialized with celldata, the data is converted to the same level field data in the luckysheetfile, such as `luckysheetfile[0].data`, the subsequent operation of the table Data update will be updated to this data field, and celldata is no longer used. If you need to take out data as initial data, you need to execute `luckysheet.getGridData(data)` to convert it to celldata data. One-dimensional array of `rcv` is converted to two-dimensional array using `luckysheet.buildGridData(luckysheetfile)`, and the input parameter is the table data object `luckysheetfile`, example: + ```js + [{ + "r": 0, + "c": 0, + "v": { + ct: {fa: "General", t: "g"}, + m:"value1", + v:"value1" + } + }, { + "r": 0, + "c": 1, + "v": { + ct: {fa: "General", t: "g"}, + m:"value2", + v:"value2" + } + }] + ``` + + ------------ + ## luckysheet_select_save + - Type:Array + - Default:[] + - Usage: The selected area supports multiple selections and is a one-dimensional array containing multiple selection objects. Example: + ```js + [ + { + "left": 0, + "width": 97, + "top": 0, + "height": 20, + "left_move": 0, + "width_move": 97, + "top_move": 0, + "height_move": 41, + "row": [ 0, 1 ], + "column": [ 0, 0 ], + "row_focus": 0, + "column_focus": 0 + }, + { + "left": 98, + "width": 73, + "top": 63, + "height": 20, + "left_move": 98, + "width_move": 189, + "top_move": 63, + "height_move": 41, + "row": [ 3, 4 ], + "column": [ 1, 2 ], + "row_focus": 3, + "column_focus": 1 + }, + { + "left": 288, + "width": 128, + "top": 21, + "height": 20, + "left_move": 288, + "width_move": 128, + "top_move": 21, + "height_move": 62, + "row": [ 1, 3 ], + "column": [ 3, 3 ], + "row_focus": 1, + "column_focus": 3 + } + ] + ``` + + ------------ + ## luckysheet_conditionformat_save + - Type:Array + - Default:[] + - Usage: Conditional format configuration information, a one-dimensional array containing multiple conditional format configuration objects, + + type: "default": Highlight cell rules and project selection rules, + + "dataBar": Data bar, + + "icons": Icon set, + + "colorGradation": Color scale + + Example: + ```js + [ + { + "type": "default", + "cellrange": [ + { + "row": [ 2, 7 ], + "column": [ 2, 2 ] + } + ], + "format": { + "textColor": "#000000", + "cellColor": "#ff0000" + }, + "conditionName": "betweenness", + "conditionRange": [ + { + "row": [ 4, 4 ], + "column": [ 2, 2 ] + }, + { + "row": [ 6, 6 ], + "column": [ 2, 2 ] + } + ], + "conditionValue": [ 2, 4 + ] + }, + { + "type": "dataBar", + "cellrange": [ + { + "row": [ 10, 15 ], + "column": [ 10, 11 ] + } + ], + "format": [ + "#6aa84f", + "#ffffff" + ] + }, + { + "type": "icons", + "cellrange": [ + { + "row": [ 19, 23 ], + "column": [ 2, 2 ] + } + ], + "format": { + "len": "3", + "leftMin": "0", + "top": "0" + } + }, + { + "type": "colorGradation", + "cellrange": [ + { + "left": 422, + "width": 100, + "top": 210, + "height": 20, + "left_move": 422, + "width_move": 100, + "top_move": 210, + "height_move": 125, + "row": [ 10, 15 ], + "column": [ 6, 6 ], + "row_focus": 10, + "column_focus": 6 + } + ], + "format": [ + "rgb(99, 190, 123)", + "rgb(255, 235, 132)", + "rgb(248, 105, 107)" + ] + } + ] + ``` + + ------------ + ## calcChain + - Type:Array + - Default:[] + - Usage:Formula chain, used when the cell linked by the formula is changed, all formulas referencing this cell will be refreshed, example: + ```js + [{ + "r": 6, + "c": 3, + "index": 1, + "func": [true, 23.75, "=AVERAGE(D3:D6)"], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }, { + "r": 7, + "c": 3, + "index": 1, + "func": [true, 30, "=MAX(D3:D6)"], + "color": "w", + "parent": null, + "chidren": {}, + "times": 0 + }] + ``` + + ------------ + ## isPivotTable + - Type:Boolean + - Default:false + - Usage: Whether PivotTable + + ------------ + ## pivotTable + - Type:Object + - Default:{} + - Usage: Pivot table settings, example: + ```js + { + "pivot_select_save": { + "left": 0, + "width": 73, + "top": 0, + "height": 19, + "left_move": 0, + "width_move": 369, + "top_move": 0, + "height_move": 259, + "row": [0, 12], + "column": [0, 4], + "row_focus": 0, + "column_focus": 0 + }, + "pivotDataSheetIndex": 6, //The sheet index where the source data is located + "column": [{ + "index": 3, + "name": "subject", + "fullname": "subject" + }], + "row": [{ + "index": 1, + "name": "student", + "fullname": "student" + }], + "filter": [], + "values": [{ + "index": 4, + "name": "score", + "fullname": "count:score", + "sumtype": "COUNTA", + "nameindex": 0 + }], + "showType": "column", + "pivotDatas": [ + ["count:score", "science", "mathematics", "foreign language", "English", "total"], + ["Alex", 1, 1, 1, 1, 4], + ["Joy", 1, 1, 1, 1, 4], + ["Tim", 1, 1, 1, 1, 4], + ["total", 3, 3, 3, 3, 12] + ], + "drawPivotTable": false, + "pivotTableBoundary": [5, 6] + } + ``` + + ------------ + ## filter_select + - Type:Object + - Default:{} + - Usage:Filter range, a selection area, a sheet has only one filter range, similar to the `luckysheet_select_save` example: + ```js + { + "left": 74, + "width": 73, + "top": 40, + "height": 19, + "left_move": 74, + "width_move": 221, + "top_move": 40, + "height_move": 99, + "row": [ + 2, + 6 + ], + "column": [ + 1, + 3 + ], + "row_focus": 2, + "column_focus": 1 + } + ``` + + ------------ + ## filter + - Type:Object + - Default:{} + - Usage: Specific settings for filtering, examples: + ```js + { + "0": { + "caljs": {}, + "rowhidden": { + "3": 0, + "4": 0 + }, + "optionstate": true, + "str": 2, + "edr": 6, + "cindex": 1, + "stc": 1, + "edc": 3 + }, + "1": { + "caljs": {}, + "rowhidden": { + "6": 0 + }, + "optionstate": true, + "str": 2, + "edr": 6, + "cindex": 2, + "stc": 1, + "edc": 3 + } + } + ``` + + ------------ + ## luckysheet_alternateformat_save + - Type:Array + - Default:[] + - Usage: Alternating color configuration, example: + ```js + [{ + "cellrange": { + "row": [1, 6], + "column": [1, 5] + }, + "format": { + "head": { + "fc": "#000", + "bc": "#5ed593" + }, + "one": { + "fc": "#000", + "bc": "#ffffff" + }, + "two": { + "fc": "#000", + "bc": "#e5fbee" + }, + "foot": { + "fc": "#000", + "bc": "#a5efcc" + } + }, + "hasRowHeader": false, + "hasRowFooter": false + }, { + "cellrange": { + "row": [1, 6], + "column": [8, 12] + }, + "format": { + "head": { + "fc": "#000", + "bc": "#5599fc" + }, + "one": { + "fc": "#000", + "bc": "#ffffff" + }, + "two": { + "fc": "#000", + "bc": "#ecf2fe" + }, + "foot": { + "fc": "#000", + "bc": "#afcbfa" + } + }, + "hasRowHeader": false, + "hasRowFooter": false + }] + ``` + + ------------ + ## luckysheet_alternateformat_save_modelCustom + - Type:Array + - Default:[] + - Usage:Custom alternate colors, including multiple custom alternate colors configuration, example: + ```js + [{ + "head": { + "fc": "#6aa84f", + "bc": "#ffffff" + }, + "one": { + "fc": "#000", + "bc": "#ffffff" + }, + "two": { + "fc": "#000", + "bc": "#e5fbee" + }, + "foot": { + "fc": "#000", + "bc": "#a5efcc" + } + }] + ``` + + ------------ + ## chart + - Type:Array + - Default:[] + - Usage: Chart configuration (under development) + + ------------ -## 获取sheet数据 +## Get sheet data -- **配置**: +- **Configuration**: - 配置 `loadSheetUrl` 的地址,参数为gridKey(表格主键) 和 index(sheet主键合集,格式为[1,2,3]),返回的数据为sheet的data字段数据集合 + Configure the address of `loadSheetUrl`, the parameters are `gridKey` (table primary key) and `index` (sheet primary key collection, format is `[1,2,3]`), the returned data is the `data` field set of sheet -- **格式**: +- **Format**: ```json { - "1": [{r:0, c:1, v:"值1"},{r:10, c:11, v:"值2"}], + "1": [{r:0, c:1, v:"value 1"},{r:10, c:11, v:"value 2"}], "2": [data], "3": [data], } ``` -- **说明**: +- **Explanation**: - r代表行,c代表列,v代表该单元格的值,值可以是字符、数字或者json串。 - 数据只会载入一次,一般来说都只有一个主键,但是考虑到一些公式、图表及数据透视表会引用其他sheet的数据,所以前台会加一个判断,如果该当前sheet引用了其他sheet的数据则把引用到的sheet的数据一并补全。 + `r` stands for row, `c` stands for column, and `v` stands for the value of the cell. The value can be a character, number, or json string. + + The data will only be loaded once, generally speaking, there is only one primary key, but considering that some formulas, charts and pivot tables will refer to the data of other sheets, the front desk will add a judgment, if the current sheet refers to the data of other sheets, then complete the data of the referenced sheet together. -## 获取range范围数据 +## Get range data -- **配置**: +- **Configuration**: - 配置 `loadCellUrl` 的地址,参数为gridKey(表格主键) 、 index(sheet主键)、开始行、结束行、开始列、结束列。后台根据范围获取指定的celldata数据并返回。 + Configure the address of `loadCellUrl`, the parameters are `gridKey` (table primary key), `index` (sheet primary key), start row, end row, start column, end column. The backend gets the specified celldata data according to the range and returns it. -## 更新数据 +## Update data -- **配置**: +- **Configuration**: - 配置 `updateUrl` 的地址,发送到后台的参数为json的字符串。 + Configure the address of `updateUrl`, and the parameter sent to the backend is a json string. -- **格式**: +- **Format**: ```json { compress: false, gridKey:10004, - data: [更新数据] + data: [update data] } ``` -- **说明**: +- **Explanation**: - | 参数 | 说明 | 举例 | + | Parameter | Explanation | Example | | ------------ | ------------ | ------------ | - | compress | Luckysheet采用客户端pako进行zlib参数压缩,如果浏览器支持压缩则为true,否则为false。后台可以根据此参数决定是否解压data中的内容 | 服务端获取参数过程:1. 序列化json字符串 2判断compress字段如果为TRUE则解压data字段 3. 解码data字符串URLDecoder.decode(utf-8) | - | gridKey | Luckysheet文件的标识符 | 无 | - | data | 一个包含更新数据的数组,数组中的参数格式请看下面的介绍。实例中:t表示更新类型、i为sheet的索引、c为行号、r为列号,v为值 | data: [{ t : 'cell', i:0, c : 0, r : 0 , v: 2 }] | + | compress | Luckysheet uses client pako for zlib parameter compression, which is true if the browser supports compression, otherwise false. The backend can decide whether to decompress the data content based on this parameter | The process of obtaining parameters on the server side: 1. Serialize json string 2. Decode the data field if the compress field is TRUE 3. Decode the data string URLDecoder.decode(utf-8) | + | gridKey | Luckysheet file identifier | none | + | data | An array containing updated data. For the parameter format in the array, please see the introduction below. In the example: `t` indicates the update type, `i` is the index of the sheet, `c` is the row number, `r` is the column number, and `v` is the value | `data: [{ t : 'cell', i:0, c : 0, r : 0 , v: 2 }]` | diff --git a/docs/guide/feature.md b/docs/guide/feature.md index c454ca2fa..d3e90473b 100644 --- a/docs/guide/feature.md +++ b/docs/guide/feature.md @@ -1,89 +1,90 @@ -# 高级功能 +# Advanced Features ## luckysheet.getcellvalue(r, c, data, type) -- **参数**: - - r:单元格所在行数;可选值;从0开始的整数,0表示第一行。 - - c:单元格所在列数;可选值;从0开始的整数,0表示第一列。 - - data:表数据;二维数组;默认值为当前表格数据。 - - type:单元格属性值;可选值;默认值为'v',表示获取单元格的值。 -- **用法**: +- **Parameter**: + - r: the number of rows in which the cell is located; optional values; integers starting at 0, 0 representing the first row. + - c: the number of columns in which the cell is located; optional values; integers starting at 0, 0 indicating the first column. + - data: table data; two-dimensional array; the default value is the current table data. + - type: cell attribute value; optional value; the default value is'v', which means to get the cell value. +- **Usage**: - 此方法为获取单元格的值。r, c都没有值时,返回data;r, c只有一个有值时,返回整行或整列数据; + This method is to get the cell value. When `r` and `c` have no value, return `data`; when `r`, `c` has only one value, return the entire row or column of data; ------------ ## luckysheet.getluckysheetfile() -- **用法**: +- **Usage**: - 返回所有表格数据结构。 + Return all table data structures. ------------ ## luckysheet.sheetmanage.getSheetByIndex(index) -- **参数**: - - index:表格下标;从0开始的整数,0表示第一个表格;默认为当前表格下标。 -- **用法**: +- **Parameter**: + - index: table subscript; integer starting from 0, 0 means the first table; default is the current table subscript. +- **Usage**: - 返回某个表格数据结构。 + Returns a table data structure. ------------ ## luckysheet.getconfig() -- **用法**: +- **Usage**: - 返回当前表格config配置。 + Returns the current table configuration. ------------ ## luckysheet.getSheetConfig(sheetIndex) -- **参数**: - - sheetIndex:表格下标;从0开始的整数,0表示第一个表格;默认为当前表格下标。 -- **用法**: +- **Parameter**: + - sheetIndex: table index; an integer starting from 0, 0 means the first table; the default is the current table index. +- **Usage**: - 返回某个表格config配置。 + Return to a table configuration. ------------ ## luckysheet.getvisibledatarow() -- **用法**: +- **Usage**: - 返回当前表格行高。 + Returns the current table row height. ------------ ## luckysheet.getvisibledatacolumn() -- **用法**: +- **Usage**: - 返回当前表格列宽。 + Returns the current table column width. ------------ ## luckysheet.getluckysheet_select_save() -- **用法**: +- **Usage**: - 返回当前选区。 + Returns the current selection. ------------ ## luckysheet.getdatabyselection(range, sheetIndex) -- **参数**: - - range:选区对象;object: { row: [r1, r2], column: [c1, c2] };默认为当前选区。 - - sheetIndex:表格下标;从0开始的整数,0表示第一个表格;默认为当前表格下标。 -- **用法**: +- **Parameter**: + - range: selection object; `object: {row: [r1, r2], column: [c1, c2] }`; the default is the current selection. + - sheetIndex: table index; an integer starting from 0, 0 means the first table; the default is the current table index. +- **Usage**: - 返回某个表格某个区域单元格数据。 + Returns the cell data of a range in a table. ------------ ## luckysheet.luckysheetrefreshgrid(scrollWidth, scrollHeight) -- **参数**: - - scrollWidth:横向滚动值。默认为当前横向滚动位置。 - - scrollHeight:纵向滚动值。默认为当前纵向滚动位置。 -- **用法**: +- **Parameter**: + - scrollWidth: horizontal scroll value. The default is the current horizontal scroll position. + - scrollHeight: vertical scroll value. The default is the current vertical scroll position. +- **Usage**: - 按照scrollWidth, scrollHeight刷新canvas展示数据。 + Refresh canvas display data according to scrollWidth, scrollHeight. ------------ ## luckysheet.setcellvalue(r, c, d, v) -- **参数**: - - r:单元格所在行数;从0开始的整数,0表示第一行。 - - c:单元格所在列数;从0开始的整数,0表示第一列。 - - d:表数据;二维数组。 - - v:要设置的值;可为对象,对象是是要符合单元格对象格式。 -- **用法**: - - 设置某个单元格的值。可配合luckysheet.luckysheetrefreshgrid()刷新查看单元格值改变。 +- **Parameter**: + + - r: the number of rows in which the cell is located; an integer starting from 0, 0 means the first row. + - c: the number of columns in which the cell is located; an integer starting from 0, 0 means the first column. + - d: table data; two-dimensional array. + - v: The value to be set; it can be an object, and the object should conform to the cell object format. +- **Usage**: + + Set the value of a cell. Cooperate with `luckysheet.luckysheetrefreshgrid()` to refresh to see the cell value changes. ```js luckysheet.setcellvalue(0, 0, luckysheet.flowdata, 'abc'); luckysheet.luckysheetrefreshgrid(); @@ -91,11 +92,11 @@ ------------ ## luckysheet.setluckysheet_select_save(v) -- **参数**: - - v:要设置的选区值(数组)。符合选区格式规则,如[{ row: [r1, r2], column: [c1, c2] }]。 -- **用法**: +- **Parameter**: + - v: The selection value (array) to be set. It conforms to the selection format rules, such as `[{ row: [r1, r2], column: [c1, c2] }]`. +- **Usage**: - 设置当前表格选区的值。配合luckysheet.selectHightlightShow()可在界面查看选区改变。 + Set the value of the current table selection. With `luckysheet.selectHightlightShow()`, you can view the selection changes on the interface. ```js luckysheet.setluckysheet_select_save([{ row: [0, 1], column: [0, 1] }]); luckysheet.selectHightlightShow(); @@ -103,22 +104,22 @@ ------------ ## luckysheet.sheetmanage.setSheetHide(index) -- **参数**: - - index:表格下标;从0开始的整数,0表示第一个表格;默认为当前表格下标。 -- **用法**: +- **Parameter**: + - index: table subscript; integer starting from 0, 0 means the first table; default is the current table subscript. +- **Usage**: - 隐藏某个表格。 + Hide a table. ------------ ## luckysheet.sheetmanage.setSheetShow(index) -- **参数**: - - index:表格下标;从0开始的整数,0表示第一个表格;默认为当前表格下标。 -- **用法**: +- **Parameter**: + - index: table subscript; integer starting from 0, 0 means the first table; default is the current table subscript. +- **Usage**: - 显示某个表格。 + Display a table. ------------ ## luckysheet.method.destroy() -- **用法**: +- **Usage**: - 释放表格 + Release table diff --git a/docs/guide/format.md b/docs/guide/format.md index 56335f492..3c794dbd8 100644 --- a/docs/guide/format.md +++ b/docs/guide/format.md @@ -1,259 +1,157 @@ -# 格式属性 +# Format attributes -## 单元格属性表 +## Cell attributes table属性值 | -全称 | -说明 |
- 值示例 | -Aspose方法或者属性 | +Attribute value | +Full name | +Explanation |
+ Example value | +Aspose method or attribute |
ct | celltype | -单元格值格式:文本、时间等 | -单元格格式 | +Cell value format: text, time, etc. | +Cell format | ||||
bg | background | -背景颜色 | +background color | #fff000 | setBackgroundColor | ||||
ff | fontfamily | -字体 | -0 微软雅黑、1 宋体(Song)、2 黑体(ST Heiti)、3 楷体(ST Kaiti)、 4仿宋(ST FangSong)、 5 新宋体(ST Song)、 6 华文新魏、 7华文行楷、 8 华文隶书、 9 Arial、 10 Times New Roman 、11 Tahoma 、12 Verdana | +Font | +0 Microsoft Yahei, 1 Song, 2 ST Heiti, 3 ST Kaiti, 4 ST FangSong, 5 ST Song, 6 Chinese New Wei, 7 Chinese Xingkai, 8 Chinese Lishu, 9 Arial, 10 Times New Roman, 11 Tahoma, 12 Verdana | Style.Font object's Name property. | |||
fc | fontcolor | -字体颜色 | +font color | #fff000 | Style.Font object's Color property | ||||
bl | bold | -粗体 | -0 常规 、 1加粗 | +Bold | +0 Regular, 1 Bold | Style.Font object's IsBold property to true. | |||
it | italic | -斜体 | -0 常规 、 1 斜体 | +Italic | +0 Regular, 1 Italic | ||||
fs | fontsize | -字体大小 | +font size | 14 | Style.Font object's Size property. | ||||
cl | cancelline | -删除线 | -0 常规 、 1 删除线 | +Cancelline | +0 Regular, 1 Cancelline | Style.Font object's Underline property | |||
ul | underline | -下划线 | -0 常规 、 1 下划线 | -||||||
bs | -borderstyle | -边框样式 | -0 none | -LineStyle | -|||||
1 Thin | -|||||||||
2 Hair | -|||||||||
3 Dotted | -|||||||||
4 Dashed | -|||||||||
5 DashDot | -|||||||||
6 DashDotDot | -|||||||||
7 Double | -|||||||||
8 Medium | -|||||||||
9 MediumDashed | -|||||||||
10 MediumDashDot | -|||||||||
11 MediumDashDotDot | -|||||||||
12 SlantedDashDot | -|||||||||
13 Thick | -|||||||||
bc | -bordercolor | -边框颜色 | -#fff000 | -setBorderColor | -|||||
bs_t | -borderstyleTop | -上边框样式 | -同上 | -- | |||||
bc_t | -bordercolorTop | -上边框颜色 | -- | ||||||
bs_b | -borderstyleBottom | -下边框样式 | -- | ||||||
bc_b | -bordercolorBottom | -下边框颜色 | -- | ||||||
bs_l | -borderstyleLeft | -左边框样式 | -- | ||||||
bc_l | -bordercolorLeft | -左边框颜色 | -- | ||||||
bs_r | -borderstyleRight | -右边框样式 | -- | ||||||
bc_r | -bordercolorRight | -右边框颜色 | -+ | Underline | +0 Regular, 1 Underline | ||||
vt | verticaltype | -垂直对齐 | -0 中间、1 上、2下 | +Vertical alignment | +0 middle, 1 up, 2 down | setVerticalAlignment | |||
ht | horizontaltype | -水平对齐 | -0 居中、1 左、2右 | +Horizontal alignment | +0 center, 1 left, 2 right | setHorizontalAlignment | |||
mc | mergecell | -合并单元格 | -{ rs: 10, cs:5 } 表示从此cell开始到10行5列的cell进行合并。 | +Merge Cells | +{rs: 10, cs:5} indicates that the cells from this cell to 10 rows and 5 columns are merged. | Merge | |||
tr | textrotate | -文字旋转 | -0: 0、1: 45 、2:-45、3 竖排文字、4: 90 、5:-90 | +Text rotation | +0: 0、1: 45 、2: -45、3 Vertical text、4: 90 、5: -90 | setRotationAngle | |||
fl | floatlenght | -小数位数 | +Decimal places | 3 | |||||
tb | textbeak | -文本换行 | -0 截断、1溢出、2 自动换行 | -2:setTextWrapped 0和1:IsTextWrapped = true |
+ Text wrap | +0 truncation, 1 overflow, 2 word wrap | +2: setTextWrapped 0和1: IsTextWrapped = true |
||
ov | originvalue | -原始值 | +Original value | ||||||
v | value | -显示值 | +Display value | ||||||
f | function | -公式 | +formula | setFormula setArrayFormula workbook.calculateFormula(); |
参数 | -说明 | +Parameter | +Explanation | ||
t | -操作类型表示符号 | +Operation type symbol | |||
i | -当前sheet的index值 | +The index value of the current sheet | |||
rc | -行操作还是列操作,值r代表行,c代表列 | +Row operation or column operation, the value `r` stands for row, and `c` stands for column | |||
v | index | -从第几行或者列开始删除 | +Delete from which row or column | ||
len | -删除多少行或者列 | +Number of rows or columns deleted |
参数 | -说明 | +Parameter | +Explanation | ||
t | -操作类型表示符号 | +Operation type symbol | |||
i | -当前sheet的index值 | +The index value of the current sheet | |||
rc | -行操作还是列操作,值r代表行,c代表列 | +Row operation or column operation, the value `r` stands for row, and `c` stands for column | |||
v | index | -从第几行或者列开始新增 | +Start from which row or column | ||
len | -增加多少行或者列 | +How many rows or columns to add | |||
data | -新增行或者列的内容 | +New row or column content |
参数 | -说明 | +Parameter | +Explanation | ||
t | -操作类型表示符号 | +Operation type symbol | |||
v | deleIndex | -需要删除的sheet索引 | +The sheet index to be deleted |
属性值 | +全称 | +说明 |
+ 值示例 | +Aspose方法或者属性 | +
ct | +celltype | +单元格值格式:文本、时间等 | +单元格格式 | ++ |
bg | +background | +背景颜色 | +#fff000 | +setBackgroundColor | +
ff | +fontfamily | +字体 | +0 微软雅黑、1 宋体(Song)、2 黑体(ST Heiti)、3 楷体(ST Kaiti)、 4仿宋(ST FangSong)、 5 新宋体(ST Song)、 6 华文新魏、 7华文行楷、 8 华文隶书、 9 Arial、 10 Times New Roman 、11 Tahoma 、12 Verdana | +Style.Font object's Name property. | +
fc | +fontcolor | +字体颜色 | +#fff000 | +Style.Font object's Color property | +
bl | +bold | +粗体 | +0 常规 、 1加粗 | +Style.Font object's IsBold property to true. | +
it | +italic | +斜体 | +0 常规 、 1 斜体 | ++ |
fs | +fontsize | +字体大小 | +14 | +Style.Font object's Size property. | +
cl | +cancelline | +删除线 | +0 常规 、 1 删除线 | +Style.Font object's Underline property | +
ul | +underline | +下划线 | +0 常规 、 1 下划线 | +|
vt | +verticaltype | +垂直对齐 | +0 中间、1 上、2下 | +setVerticalAlignment | +
ht | +horizontaltype | +水平对齐 | +0 居中、1 左、2右 | +setHorizontalAlignment | +
mc | +mergecell | +合并单元格 | +{ rs: 10, cs:5 } 表示从此cell开始到10行5列的cell进行合并。 | +Merge | +
tr | +textrotate | +文字旋转 | +0: 0、1: 45 、2:-45、3 竖排文字、4: 90 、5:-90 | +setRotationAngle | +
fl | +floatlenght | +小数位数 | +3 | ++ |
tb | +textbeak | +文本换行 | +0 截断、1溢出、2 自动换行 | +2:setTextWrapped 0和1:IsTextWrapped = true |
+
ov | +originvalue | +原始值 | ++ | + |
v | +value | +显示值 | ++ | + |
f | +function | +公式 | ++ | setFormula setArrayFormula workbook.calculateFormula(); |
+
参数 | +说明 | +|
t | +操作类型表示符号 | +|
i | +当前sheet的index值 | +|
rc | +行操作还是列操作,值`r`代表行,`c`代表列 | +|
v | +index | +从第几行或者列开始删除 | +
len | +删除多少行或者列 | +
参数 | +说明 | +|
t | +操作类型表示符号 | +|
i | +当前sheet的index值 | +|
rc | +行操作还是列操作,值`r`代表行,`c`代表列 | +|
v | +index | +从第几行或者列开始新增 | +
len | +增加多少行或者列 | +|
data | +新增行或者列的内容 | +
参数 | +说明 | +|
t | +操作类型表示符号 | +|
v | +deleIndex | +需要删除的sheet索引 | +