Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
fix(formular): docs
Browse files Browse the repository at this point in the history
1.Add deploy github actions 2.Add resources docs 3.Fix formula bug
  • Loading branch information
mengshukeji committed Nov 26, 2020
1 parent 4b36102 commit ddac582
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 33 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 2 additions & 0 deletions docs/guide/resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
2 changes: 2 additions & 0 deletions docs/zh/guide/resource.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

## 后台

Expand All @@ -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 版本)

## 学习资料

Expand Down
8 changes: 4 additions & 4 deletions src/function/func.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
96 changes: 67 additions & 29 deletions src/global/refresh.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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" });
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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" });
Expand Down

0 comments on commit ddac582

Please sign in to comment.