|
@@ -47,7 +47,7 @@ let luckysheet = {};
|
|
|
luckysheet = common_extend(api, luckysheet);
|
|
|
|
|
|
//创建luckysheet表格
|
|
|
-luckysheet.create = function(setting) {
|
|
|
+luckysheet.create = function (setting) {
|
|
|
method.destroy();
|
|
|
server.websocket && server.websocket.close(1000, "Work complete");
|
|
|
// Store original parameters for api: toJson
|
|
@@ -178,7 +178,7 @@ luckysheet.create = function(setting) {
|
|
|
// luckysheetsizeauto();
|
|
|
initialWorkBook();
|
|
|
} else {
|
|
|
- $.get(authorityUrl, function(res) {
|
|
|
+ $.get(authorityUrl, function (res) {
|
|
|
let arr = res.data.filter(
|
|
|
(item) => item.template?.template_id == templateId
|
|
|
);
|
|
@@ -186,11 +186,11 @@ luckysheet.create = function(setting) {
|
|
|
let allowRangeList = [],
|
|
|
colhidden = {};
|
|
|
|
|
|
- $.post(loadurl, { gridKey: server.gridKey }, function(d) {
|
|
|
+ $.post(loadurl, { gridKey: server.gridKey }, function (d) {
|
|
|
let data = new Function("return " + d)();
|
|
|
let sheet = data[0];
|
|
|
let cache = {};
|
|
|
- if(sheet.config) {
|
|
|
+ if (sheet.config) {
|
|
|
delete sheet.config.authority
|
|
|
}
|
|
|
sheet.celldata.forEach((item) => {
|
|
@@ -235,6 +235,21 @@ luckysheet.create = function(setting) {
|
|
|
}
|
|
|
|
|
|
sheet.config.colhidden = colhidden;
|
|
|
+
|
|
|
+ // 公式计算
|
|
|
+ let calcChain = [];
|
|
|
+ let index = sheet.index;
|
|
|
+ sheet.celldata.forEach(item => {
|
|
|
+ if (typeof (item.v.f) !== 'undefined') {
|
|
|
+ calcChain.push({
|
|
|
+ r: item.r,
|
|
|
+ c: item.c,
|
|
|
+ index,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ sheet.calcChain = calcChain;
|
|
|
+
|
|
|
console.log(data);
|
|
|
Store.luckysheetfile = data;
|
|
|
|
|
@@ -302,7 +317,7 @@ luckysheet.getdatabyselection = getdatabyselection;
|
|
|
luckysheet.sheetmanage = sheetmanage;
|
|
|
|
|
|
// Data of the current table
|
|
|
-luckysheet.flowdata = function() {
|
|
|
+luckysheet.flowdata = function () {
|
|
|
return Store.flowdata;
|
|
|
};
|
|
|
|