You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.6 KiB
56 lines
1.6 KiB
import { datagridgrowth } from './getdata';
|
|
import editor from './editor';
|
|
import rhchInit from './rhchInit';
|
|
import formula from './formula';
|
|
import { luckysheetrefreshgrid } from './refresh';
|
|
import sheetmanage from '../controllers/sheetmanage';
|
|
import Store from '../store';
|
|
|
|
export default function luckysheetcreatesheet(colwidth, rowheight, data, cfg, active) {
|
|
if(active == null){
|
|
active = true;
|
|
}
|
|
|
|
Store.visibledatarow = [];
|
|
Store.visibledatacolumn = [];
|
|
Store.ch_width = 0;
|
|
Store.rh_height = 0;
|
|
|
|
if(cfg != null){
|
|
Store.config = cfg;
|
|
}
|
|
else{
|
|
Store.config = {};
|
|
}
|
|
|
|
if (data.length == 0) {
|
|
Store.flowdata = datagridgrowth(data, rowheight, colwidth);
|
|
}
|
|
else if (data.length < rowheight && data[0].length < colwidth) {
|
|
Store.flowdata = datagridgrowth(data, rowheight - data.length, colwidth - data[0].length);
|
|
}
|
|
else if (data.length < rowheight) {
|
|
Store.flowdata = datagridgrowth(data, rowheight - data.length, 0);
|
|
}
|
|
else if (data[0].length < colwidth) {
|
|
Store.flowdata = datagridgrowth(data, 0, colwidth - data[0].length);
|
|
}
|
|
else {
|
|
Store.flowdata = data;
|
|
}
|
|
|
|
editor.webWorkerFlowDataCache(Store.flowdata);//worker存数据
|
|
|
|
rhchInit(rowheight, colwidth);
|
|
|
|
if(active){
|
|
sheetmanage.showSheet();
|
|
|
|
setTimeout(function () {
|
|
sheetmanage.restoreCache();
|
|
formula.execFunctionGroup();
|
|
sheetmanage.restoreSheetAll(Store.currentSheetIndex);
|
|
luckysheetrefreshgrid();
|
|
}, 1);
|
|
}
|
|
}
|
|
|