Browse Source

fix(formular): docs

1.Add deploy github actions 2.Add resources docs 3.Fix formula bug
master
mengshukeji 5 years ago
parent
commit
ddac582f69
  1. 43
      .github/workflows/github-pages.yml
  2. 2
      docs/guide/resource.md
  3. 2
      docs/zh/guide/resource.md
  4. 8
      src/function/func.js
  5. 96
      src/global/refresh.js

43
.github/workflows/github-pages.yml

@ -0,0 +1,43 @@
name: Github pages deploy
on: push
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout # 检查项目
uses: actions/checkout@v2
- name: Set up Node.js # Nodejs版本
uses: actions/setup-node@master
with:
node-version: 12.13.0
- name: Install dependencies & Generate static files # 安装依赖打包demo和文档
run: |
node -v
npm install
npm install gulp -g
npm run build
npm run docs:build
- name: Deploy LuckysheetDemo to GitHub Pages # 发布demo 到github pages
if: success()
uses: crazy-max/ghaction-github-pages@v2
with:
repo: mengshukeji/LuckysheetDemo
target_branch: gh-pages
build_dir: dist
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
- name: Deploy LuckysheetDocs to GitHub Pages # 发布docs 到github pages
if: success()
uses: crazy-max/ghaction-github-pages@v2
with:
repo: mengshukeji/LuckysheetDocs
target_branch: gh-pages
build_dir: docs/.vuepress/dist
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}

2
docs/guide/resource.md

@ -9,6 +9,7 @@ If you have written or found an excellent tutorial and want to recommend it to u
- [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)
## Back-end
@ -19,6 +20,7 @@ If you have written or found an excellent tutorial and want to recommend it to u
- [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

2
docs/zh/guide/resource.md

@ -9,6 +9,7 @@
- [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)
## 后台
@ -19,6 +20,7 @@
- [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 版本)
## 学习资料

8
src/function/func.js

@ -1632,10 +1632,10 @@ function luckysheet_getcelldata(txt) {
sheetdata = luckysheetfile[index].data;
rangetxt = val[0];
// 开放execFunctionGroupData,luckysheetfile[index].data是旧值,故取得新值用来计算
if (formula.execFunctionGroupData != null) {
sheetdata = formula.execFunctionGroupData;
}
// 取消execFunctionGroupData,改用execFunctionGlobalData
// if (formula.execFunctionGroupData != null) {
// sheetdata = formula.execFunctionGroupData;
// }
}
if (rangetxt.indexOf(":") == -1) {

96
src/global/refresh.js

@ -404,23 +404,24 @@ function jfrefreshgrid_adRC(data, cfg, ctrlType, ctrlValue, calc, filterObj, cf,
//公式链中公式范围改变对应单元格值的改变
let funcData = [];
if(calc.length > 0){
// 开放execFunctionGroupData,execfunction中执行到取得单元格内容的时候会取得旧值,故在此将新的值存入formula.execFunctionGroupData
formula.execFunctionGroupData = data;
// if(calc.length > 0){
// // 取消execFunctionGroupData,改用execFunctionGlobalData
// // formula.execFunctionGroupData = data;
for(let i = 0; i < calc.length; i++){
let clc = calc[i];
let clc_r = clc.r, clc_c = clc.c, clc_i = clc.index, clc_funcStr = getcellFormula(clc_r, clc_c, clc_i, data);
// for(let i = 0; i < calc.length; i++){
// let clc = calc[i];
// let clc_r = clc.r, clc_c = clc.c, clc_i = clc.index, clc_funcStr = getcellFormula(clc_r, clc_c, clc_i, data);
let clc_result = formula.execfunction(clc_funcStr, clc_r, clc_c, clc_i,null, true);
clc.func = clc_result;
// let clc_result = formula.execfunction(clc_funcStr, clc_r, clc_c, clc_i,null, true);
// clc.func = clc_result;
if(data[clc_r][clc_c].f == clc_funcStr){
setcellvalue(clc_r, clc_c, data, clc_result[1]);
funcData.push({ "r": clc_r, "c": clc_c });
}
}
}
// if(data[clc_r][clc_c].f == clc_funcStr){
// setcellvalue(clc_r, clc_c, data, clc_result[1]);
// // funcData存储当前结果没有用处,每次还是需要从calc公式链实时从当前数据中计算比较靠谱
// // funcData.push({ "r": clc_r, "c": clc_c });
// }
// }
// }
if(Store.clearjfundo){
Store.jfundo.length = 0;
@ -526,6 +527,26 @@ function jfrefreshgrid_adRC(data, cfg, ctrlType, ctrlValue, calc, filterObj, cf,
server.saveParam("v", Store.currentSheetIndex, Store.flowdata[mcData_r][mcData_c], { "r": mcData_r, "c": mcData_c });
}
//公式链中公式范围改变对应单元格值的改变
if(calc.length > 0){
// 取消execFunctionGroupData,改用execFunctionGlobalData
// formula.execFunctionGroupData = data;
for(let i = 0; i < calc.length; i++){
let clc = calc[i];
let clc_r = clc.r, clc_c = clc.c, clc_i = clc.index, clc_funcStr = getcellFormula(clc_r, clc_c, clc_i, data);
let clc_result = formula.execfunction(clc_funcStr, clc_r, clc_c, clc_i,null, true);
clc.func = clc_result;
if(data[clc_r][clc_c].f == clc_funcStr){
setcellvalue(clc_r, clc_c, data, clc_result[1]);
// funcData存储当前结果没有用处,每次还是需要从calc公式链实时从当前数据中计算比较靠谱
// funcData.push({ "r": clc_r, "c": clc_c });
}
}
}
//calc函数链
file.calcChain = calc;
server.saveParam("all", Store.currentSheetIndex, calc, { "k": "calcChain" });
@ -624,21 +645,21 @@ function jfrefreshgrid_deleteCell(data, cfg, ctrl, calc, filterObj, cf, dataVeri
//公式链中公式范围改变对应单元格值的改变
let funcData = [];
if(calc.length > 0){
// formula.execFunctionGroupData = data;
for(let i = 0; i < calc.length; i++){
let clc = calc[i];
let clc_r = clc.r, clc_c = clc.c, clc_i = clc.index, clc_funcStr = getcellFormula(clc_r, clc_c, clc_i, data);
let clc_result = formula.execfunction(clc_funcStr, clc_r, clc_c, clc_i,null, true);
clc.func = clc_result;
if(data[clc_r][clc_c].f == clc_funcStr){
setcellvalue(clc_r, clc_c, data, clc_result[1]);
funcData.push({ "r": clc_r, "c": clc_c });
}
}
}
// if(calc.length > 0){
// // formula.execFunctionGroupData = data;
// for(let i = 0; i < calc.length; i++){
// let clc = calc[i];
// let clc_r = clc.r, clc_c = clc.c, clc_i = clc.index, clc_funcStr = getcellFormula(clc_r, clc_c, clc_i, data);
// let clc_result = formula.execfunction(clc_funcStr, clc_r, clc_c, clc_i,null, true);
// clc.func = clc_result;
// if(data[clc_r][clc_c].f == clc_funcStr){
// setcellvalue(clc_r, clc_c, data, clc_result[1]);
// funcData.push({ "r": clc_r, "c": clc_c });
// }
// }
// }
if(Store.clearjfundo){
Store.jfundo.length = 0;
@ -709,6 +730,23 @@ function jfrefreshgrid_deleteCell(data, cfg, ctrl, calc, filterObj, cf, dataVeri
server.saveParam("v", Store.currentSheetIndex, Store.flowdata[mcData_r][mcData_c], { "r": mcData_r, "c": mcData_c });
}
//公式链中公式范围改变对应单元格值的改变
if(calc.length > 0){
// formula.execFunctionGroupData = data;
for(let i = 0; i < calc.length; i++){
let clc = calc[i];
let clc_r = clc.r, clc_c = clc.c, clc_i = clc.index, clc_funcStr = getcellFormula(clc_r, clc_c, clc_i, data);
let clc_result = formula.execfunction(clc_funcStr, clc_r, clc_c, clc_i,null, true);
clc.func = clc_result;
if(data[clc_r][clc_c].f == clc_funcStr){
setcellvalue(clc_r, clc_c, data, clc_result[1]);
// funcData.push({ "r": clc_r, "c": clc_c });
}
}
}
//calc函数链
file.calcChain = calc;
server.saveParam("all", Store.currentSheetIndex, calc, { "k": "calcChain" });

Loading…
Cancel
Save