|
@@ -1,45 +1,42 @@
|
|
|
-
|
|
|
-import defaultSetting from './config.js';
|
|
|
-import { common_extend } from './utils/util';
|
|
|
-import Store from './store';
|
|
|
-import server from './controllers/server';
|
|
|
-import luckysheetConfigsetting from './controllers/luckysheetConfigsetting';
|
|
|
-import sheetmanage from './controllers/sheetmanage';
|
|
|
-import luckysheetsizeauto from './controllers/resize';
|
|
|
-import luckysheetHandler from './controllers/handler';
|
|
|
-import {initialFilterHandler} from './controllers/filter';
|
|
|
-import {initialMatrixOperation} from './controllers/matrixOperation';
|
|
|
-import {initialSheetBar} from './controllers/sheetBar';
|
|
|
-import {formulaBarInitial} from './controllers/formulaBar';
|
|
|
-import {rowColumnOperationInitial} from './controllers/rowColumnOperation';
|
|
|
-import {keyboardInitial} from './controllers/keyboard';
|
|
|
-import {orderByInitial} from './controllers/orderBy';
|
|
|
-import {initPlugins} from './controllers/expendPlugins';
|
|
|
-import {
|
|
|
- getluckysheetfile,
|
|
|
- getluckysheet_select_save,
|
|
|
- getconfig,
|
|
|
-} from './methods/get';
|
|
|
+import defaultSetting from "./config.js";
|
|
|
+import { common_extend } from "./utils/util";
|
|
|
+import Store from "./store";
|
|
|
+import server from "./controllers/server";
|
|
|
+import luckysheetConfigsetting from "./controllers/luckysheetConfigsetting";
|
|
|
+import sheetmanage from "./controllers/sheetmanage";
|
|
|
+import luckysheetsizeauto from "./controllers/resize";
|
|
|
+import luckysheetHandler from "./controllers/handler";
|
|
|
+import { initialFilterHandler } from "./controllers/filter";
|
|
|
+import { initialMatrixOperation } from "./controllers/matrixOperation";
|
|
|
+import { initialSheetBar } from "./controllers/sheetBar";
|
|
|
+import { formulaBarInitial } from "./controllers/formulaBar";
|
|
|
+import { rowColumnOperationInitial } from "./controllers/rowColumnOperation";
|
|
|
+import { keyboardInitial } from "./controllers/keyboard";
|
|
|
+import { orderByInitial } from "./controllers/orderBy";
|
|
|
+import { initPlugins } from "./controllers/expendPlugins";
|
|
|
import {
|
|
|
- setluckysheet_select_save
|
|
|
-} from './methods/set';
|
|
|
-import { luckysheetrefreshgrid, jfrefreshgrid } from './global/refresh';
|
|
|
-import functionlist from './function/functionlist';
|
|
|
-import { luckysheetlodingHTML } from './controllers/constant';
|
|
|
-import { getcellvalue, getdatabyselection } from './global/getdata';
|
|
|
-import { setcellvalue } from './global/setdata';
|
|
|
-import { selectHightlightShow } from './controllers/select';
|
|
|
-import {zoomInitial} from './controllers/zoom';
|
|
|
-import {printInitial} from './controllers/print';
|
|
|
-import method from './global/method';
|
|
|
-
|
|
|
-import * as api from './global/api';
|
|
|
-
|
|
|
-import flatpickr from 'flatpickr'
|
|
|
-import Mandarin from 'flatpickr/dist/l10n/zh.js'
|
|
|
-import { initListener } from './controllers/listener';
|
|
|
-import { hideloading, showloading } from './global/loading.js';
|
|
|
-import { luckysheetextendData } from './global/extend.js';
|
|
|
+ getluckysheetfile,
|
|
|
+ getluckysheet_select_save,
|
|
|
+ getconfig,
|
|
|
+} from "./methods/get";
|
|
|
+import { setluckysheet_select_save } from "./methods/set";
|
|
|
+import { luckysheetrefreshgrid, jfrefreshgrid } from "./global/refresh";
|
|
|
+import functionlist from "./function/functionlist";
|
|
|
+import { luckysheetlodingHTML } from "./controllers/constant";
|
|
|
+import { getcellvalue, getdatabyselection } from "./global/getdata";
|
|
|
+import { setcellvalue } from "./global/setdata";
|
|
|
+import { selectHightlightShow } from "./controllers/select";
|
|
|
+import { zoomInitial } from "./controllers/zoom";
|
|
|
+import { printInitial } from "./controllers/print";
|
|
|
+import method from "./global/method";
|
|
|
+
|
|
|
+import * as api from "./global/api";
|
|
|
+
|
|
|
+import flatpickr from "flatpickr";
|
|
|
+import Mandarin from "flatpickr/dist/l10n/zh.js";
|
|
|
+import { initListener } from "./controllers/listener";
|
|
|
+import { hideloading, showloading } from "./global/loading.js";
|
|
|
+import { luckysheetextendData } from "./global/extend.js";
|
|
|
|
|
|
let luckysheet = {};
|
|
|
|
|
@@ -47,162 +44,223 @@ let luckysheet = {};
|
|
|
// luckysheet.api = api;
|
|
|
// Object.assign(luckysheet, api);
|
|
|
|
|
|
-luckysheet = common_extend(api,luckysheet);
|
|
|
-
|
|
|
-
|
|
|
+luckysheet = common_extend(api, luckysheet);
|
|
|
|
|
|
//创建luckysheet表格
|
|
|
-luckysheet.create = function (setting) {
|
|
|
- method.destroy()
|
|
|
- server.websocket && server.websocket.close(1000, "Work complete");
|
|
|
- // Store original parameters for api: toJson
|
|
|
- Store.toJsonOptions = {}
|
|
|
- for(let c in setting){
|
|
|
- if(c !== 'data'){
|
|
|
- Store.toJsonOptions[c] = setting[c];
|
|
|
- }
|
|
|
+luckysheet.create = function(setting) {
|
|
|
+ method.destroy();
|
|
|
+ server.websocket && server.websocket.close(1000, "Work complete");
|
|
|
+ // Store original parameters for api: toJson
|
|
|
+ Store.toJsonOptions = {};
|
|
|
+ for (let c in setting) {
|
|
|
+ if (c !== "data") {
|
|
|
+ Store.toJsonOptions[c] = setting[c];
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ let extendsetting = common_extend(defaultSetting, setting);
|
|
|
+
|
|
|
+ let loadurl = extendsetting.loadUrl,
|
|
|
+ authorityUrl = extendsetting.authorityUrl,
|
|
|
+ templateId = extendsetting.templateId,
|
|
|
+ menu = extendsetting.menu,
|
|
|
+ authority = extendsetting.authority,
|
|
|
+ title = extendsetting.title;
|
|
|
+
|
|
|
+ let container = extendsetting.container;
|
|
|
+ Store.container = container;
|
|
|
+ Store.luckysheetfile = extendsetting.data;
|
|
|
+ Store.defaultcolumnNum = extendsetting.column;
|
|
|
+ Store.defaultrowNum = extendsetting.row;
|
|
|
+ Store.defaultFontSize = extendsetting.defaultFontSize;
|
|
|
+ Store.fullscreenmode = extendsetting.fullscreenmode;
|
|
|
+ Store.lang = extendsetting.lang; //language
|
|
|
+ Store.allowEdit = extendsetting.allowEdit;
|
|
|
+ Store.limitSheetNameLength = extendsetting.limitSheetNameLength;
|
|
|
+ Store.defaultSheetNameMaxLength = extendsetting.defaultSheetNameMaxLength;
|
|
|
+ Store.fontList = extendsetting.fontList;
|
|
|
+ server.gridKey = extendsetting.gridKey;
|
|
|
+ server.loadUrl = extendsetting.loadUrl;
|
|
|
+ server.updateUrl = extendsetting.updateUrl;
|
|
|
+ server.updateImageUrl = extendsetting.updateImageUrl;
|
|
|
+ server.title = extendsetting.title;
|
|
|
+ server.loadSheetUrl = extendsetting.loadSheetUrl;
|
|
|
+ server.allowUpdate = extendsetting.allowUpdate;
|
|
|
+
|
|
|
+ luckysheetConfigsetting.autoFormatw = extendsetting.autoFormatw;
|
|
|
+ luckysheetConfigsetting.accuracy = extendsetting.accuracy;
|
|
|
+ luckysheetConfigsetting.total = extendsetting.data[0].total;
|
|
|
+
|
|
|
+ luckysheetConfigsetting.loading = extendsetting.loading;
|
|
|
+ luckysheetConfigsetting.allowCopy = extendsetting.allowCopy;
|
|
|
+ luckysheetConfigsetting.showtoolbar = extendsetting.showtoolbar;
|
|
|
+ luckysheetConfigsetting.showtoolbarConfig = extendsetting.showtoolbarConfig;
|
|
|
+ luckysheetConfigsetting.showinfobar = extendsetting.showinfobar;
|
|
|
+ luckysheetConfigsetting.showsheetbar = extendsetting.showsheetbar;
|
|
|
+ luckysheetConfigsetting.showsheetbarConfig = extendsetting.showsheetbarConfig;
|
|
|
+ luckysheetConfigsetting.showstatisticBar = extendsetting.showstatisticBar;
|
|
|
+ luckysheetConfigsetting.showstatisticBarConfig =
|
|
|
+ extendsetting.showstatisticBarConfig;
|
|
|
+ luckysheetConfigsetting.sheetFormulaBar = extendsetting.sheetFormulaBar;
|
|
|
+ luckysheetConfigsetting.cellRightClickConfig =
|
|
|
+ extendsetting.cellRightClickConfig;
|
|
|
+ luckysheetConfigsetting.sheetRightClickConfig =
|
|
|
+ extendsetting.sheetRightClickConfig;
|
|
|
+ luckysheetConfigsetting.pointEdit = extendsetting.pointEdit;
|
|
|
+ luckysheetConfigsetting.pointEditUpdate = extendsetting.pointEditUpdate;
|
|
|
+ luckysheetConfigsetting.pointEditZoom = extendsetting.pointEditZoom;
|
|
|
+
|
|
|
+ luckysheetConfigsetting.userInfo = extendsetting.userInfo;
|
|
|
+ luckysheetConfigsetting.userMenuItem = extendsetting.userMenuItem;
|
|
|
+ luckysheetConfigsetting.myFolderUrl = extendsetting.myFolderUrl;
|
|
|
+ luckysheetConfigsetting.functionButton = extendsetting.functionButton;
|
|
|
+
|
|
|
+ luckysheetConfigsetting.showConfigWindowResize =
|
|
|
+ extendsetting.showConfigWindowResize;
|
|
|
+ luckysheetConfigsetting.enableAddRow = extendsetting.enableAddRow;
|
|
|
+ luckysheetConfigsetting.enableAddBackTop = extendsetting.enableAddBackTop;
|
|
|
+ luckysheetConfigsetting.addRowCount = extendsetting.addRowCount;
|
|
|
+ luckysheetConfigsetting.enablePage = extendsetting.enablePage;
|
|
|
+ luckysheetConfigsetting.pageInfo = extendsetting.pageInfo;
|
|
|
+
|
|
|
+ luckysheetConfigsetting.editMode = extendsetting.editMode;
|
|
|
+ luckysheetConfigsetting.beforeCreateDom = extendsetting.beforeCreateDom;
|
|
|
+ luckysheetConfigsetting.workbookCreateBefore =
|
|
|
+ extendsetting.workbookCreateBefore;
|
|
|
+ luckysheetConfigsetting.workbookCreateAfter =
|
|
|
+ extendsetting.workbookCreateAfter;
|
|
|
+ luckysheetConfigsetting.remoteFunction = extendsetting.remoteFunction;
|
|
|
+
|
|
|
+ luckysheetConfigsetting.fireMousedown = extendsetting.fireMousedown;
|
|
|
+ luckysheetConfigsetting.forceCalculation = extendsetting.forceCalculation;
|
|
|
+ luckysheetConfigsetting.plugins = extendsetting.plugins;
|
|
|
+
|
|
|
+ luckysheetConfigsetting.rowHeaderWidth = extendsetting.rowHeaderWidth;
|
|
|
+ luckysheetConfigsetting.columnHeaderHeight = extendsetting.columnHeaderHeight;
|
|
|
+
|
|
|
+ luckysheetConfigsetting.defaultColWidth = extendsetting.defaultColWidth;
|
|
|
+ luckysheetConfigsetting.defaultRowHeight = extendsetting.defaultRowHeight;
|
|
|
+
|
|
|
+ luckysheetConfigsetting.title = extendsetting.title;
|
|
|
+ luckysheetConfigsetting.container = extendsetting.container;
|
|
|
+ luckysheetConfigsetting.hook = extendsetting.hook;
|
|
|
+
|
|
|
+ luckysheetConfigsetting.pager = extendsetting.pager;
|
|
|
+
|
|
|
+ luckysheetConfigsetting.initShowsheetbarConfig = false;
|
|
|
+
|
|
|
+ luckysheetConfigsetting.imageUpdateMethodConfig =
|
|
|
+ extendsetting.imageUpdateMethodConfig;
|
|
|
+
|
|
|
+ if (Store.lang === "zh") flatpickr.localize(Mandarin.zh);
|
|
|
+
|
|
|
+ // Store the currently used plugins for monitoring asynchronous loading
|
|
|
+ Store.asyncLoad.push(...luckysheetConfigsetting.plugins);
|
|
|
+
|
|
|
+ // Register plugins
|
|
|
+ initPlugins(extendsetting.plugins, extendsetting.data);
|
|
|
+
|
|
|
+ // Store formula information, including internationalization
|
|
|
+ functionlist();
|
|
|
+
|
|
|
+ let devicePixelRatio = extendsetting.devicePixelRatio;
|
|
|
+ if (devicePixelRatio == null) {
|
|
|
+ devicePixelRatio = 1;
|
|
|
+ }
|
|
|
+ Store.devicePixelRatio = Math.ceil(devicePixelRatio);
|
|
|
+
|
|
|
+ //loading
|
|
|
+ const loadingObj = luckysheetlodingHTML("#" + container);
|
|
|
+ Store.loadingObj = loadingObj;
|
|
|
+
|
|
|
+ if (loadurl == "") {
|
|
|
+ sheetmanage.initialjfFile(menu, title);
|
|
|
+ // luckysheetsizeauto();
|
|
|
+ initialWorkBook();
|
|
|
+ } else {
|
|
|
+ $.get(authorityUrl, function(res) {
|
|
|
+ let arr = res.data.filter(
|
|
|
+ (item) => item.template?.template_id == templateId
|
|
|
+ );
|
|
|
+ console.log(arr);
|
|
|
+ let allowRangeList = [],
|
|
|
+ colhidden = {};
|
|
|
+
|
|
|
+ $.post(loadurl, { gridKey: server.gridKey }, function(d) {
|
|
|
+ let data = new Function("return " + d)();
|
|
|
+ let sheet = data[0];
|
|
|
+ let cache = {};
|
|
|
+ sheet.celldata.forEach((item) => {
|
|
|
+ if (!cache[item.c]) cache[item.c] = [];
|
|
|
+ cache[item.c].push(item);
|
|
|
+ });
|
|
|
+ arr.forEach((item) => {
|
|
|
+ // 将A B C D....转换为0 1 2 3...
|
|
|
+ let col_idx = item.template.col_idx;
|
|
|
+ let col = col_idx.charCodeAt(0) - 65;
|
|
|
+ if (!item.can_read) {
|
|
|
+ colhidden[col] = 0;
|
|
|
+ }
|
|
|
+ if (item.can_write) {
|
|
|
+ // 区域保护
|
|
|
+ allowRangeList.push({
|
|
|
+ hintText: "",
|
|
|
+ sqref: `$${col_idx}$0:$${col_idx}$99999`,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // let celldata = []
|
|
|
+ // Object.values(cache).forEach(colItem => {
|
|
|
+ // celldata = [...celldata,...colItem]
|
|
|
+ // })
|
|
|
+ // sheet.celldata = celldata
|
|
|
+ sheet.config = sheet.config || {};
|
|
|
+ // 处于审批时 所有人都无法修改
|
|
|
+ if (authority) {
|
|
|
+ sheet.config.authority = authority;
|
|
|
+ } else if (arr.length > 0) {
|
|
|
+ let newAuthority = {
|
|
|
+ sheet: true,
|
|
|
+ hintText: "没有编辑权限!",
|
|
|
+ };
|
|
|
+ if (allowRangeList.length > 0) {
|
|
|
+ // 可编辑内容
|
|
|
+ newAuthority.allowRangeList = allowRangeList
|
|
|
+ }
|
|
|
+
|
|
|
+ sheet.config.authority = newAuthority
|
|
|
+ }
|
|
|
|
|
|
- let extendsetting = common_extend(defaultSetting, setting);
|
|
|
-
|
|
|
- let loadurl = extendsetting.loadUrl,
|
|
|
- menu = extendsetting.menu,
|
|
|
- title = extendsetting.title;
|
|
|
-
|
|
|
- let container = extendsetting.container;
|
|
|
- Store.container = container;
|
|
|
- Store.luckysheetfile = extendsetting.data;
|
|
|
- Store.defaultcolumnNum = extendsetting.column;
|
|
|
- Store.defaultrowNum = extendsetting.row;
|
|
|
- Store.defaultFontSize = extendsetting.defaultFontSize;
|
|
|
- Store.fullscreenmode = extendsetting.fullscreenmode;
|
|
|
- Store.lang = extendsetting.lang; //language
|
|
|
- Store.allowEdit = extendsetting.allowEdit;
|
|
|
- Store.limitSheetNameLength = extendsetting.limitSheetNameLength;
|
|
|
- Store.defaultSheetNameMaxLength = extendsetting.defaultSheetNameMaxLength;
|
|
|
- Store.fontList = extendsetting.fontList;
|
|
|
- server.gridKey = extendsetting.gridKey;
|
|
|
- server.loadUrl = extendsetting.loadUrl;
|
|
|
- server.updateUrl = extendsetting.updateUrl;
|
|
|
- server.updateImageUrl = extendsetting.updateImageUrl;
|
|
|
- server.title = extendsetting.title;
|
|
|
- server.loadSheetUrl = extendsetting.loadSheetUrl;
|
|
|
- server.allowUpdate = extendsetting.allowUpdate;
|
|
|
-
|
|
|
- luckysheetConfigsetting.autoFormatw = extendsetting.autoFormatw;
|
|
|
- luckysheetConfigsetting.accuracy = extendsetting.accuracy;
|
|
|
- luckysheetConfigsetting.total = extendsetting.data[0].total;
|
|
|
-
|
|
|
- luckysheetConfigsetting.loading = extendsetting.loading;
|
|
|
- luckysheetConfigsetting.allowCopy = extendsetting.allowCopy;
|
|
|
- luckysheetConfigsetting.showtoolbar = extendsetting.showtoolbar;
|
|
|
- luckysheetConfigsetting.showtoolbarConfig = extendsetting.showtoolbarConfig;
|
|
|
- luckysheetConfigsetting.showinfobar = extendsetting.showinfobar;
|
|
|
- luckysheetConfigsetting.showsheetbar = extendsetting.showsheetbar;
|
|
|
- luckysheetConfigsetting.showsheetbarConfig = extendsetting.showsheetbarConfig;
|
|
|
- luckysheetConfigsetting.showstatisticBar = extendsetting.showstatisticBar;
|
|
|
- luckysheetConfigsetting.showstatisticBarConfig = extendsetting.showstatisticBarConfig;
|
|
|
- luckysheetConfigsetting.sheetFormulaBar = extendsetting.sheetFormulaBar;
|
|
|
- luckysheetConfigsetting.cellRightClickConfig = extendsetting.cellRightClickConfig;
|
|
|
- luckysheetConfigsetting.sheetRightClickConfig = extendsetting.sheetRightClickConfig;
|
|
|
- luckysheetConfigsetting.pointEdit = extendsetting.pointEdit;
|
|
|
- luckysheetConfigsetting.pointEditUpdate = extendsetting.pointEditUpdate;
|
|
|
- luckysheetConfigsetting.pointEditZoom = extendsetting.pointEditZoom;
|
|
|
-
|
|
|
- luckysheetConfigsetting.userInfo = extendsetting.userInfo;
|
|
|
- luckysheetConfigsetting.userMenuItem = extendsetting.userMenuItem;
|
|
|
- luckysheetConfigsetting.myFolderUrl = extendsetting.myFolderUrl;
|
|
|
- luckysheetConfigsetting.functionButton = extendsetting.functionButton;
|
|
|
-
|
|
|
- luckysheetConfigsetting.showConfigWindowResize = extendsetting.showConfigWindowResize;
|
|
|
- luckysheetConfigsetting.enableAddRow = extendsetting.enableAddRow;
|
|
|
- luckysheetConfigsetting.enableAddBackTop = extendsetting.enableAddBackTop;
|
|
|
- luckysheetConfigsetting.addRowCount = extendsetting.addRowCount;
|
|
|
- luckysheetConfigsetting.enablePage = extendsetting.enablePage;
|
|
|
- luckysheetConfigsetting.pageInfo = extendsetting.pageInfo;
|
|
|
-
|
|
|
- luckysheetConfigsetting.editMode = extendsetting.editMode;
|
|
|
- luckysheetConfigsetting.beforeCreateDom = extendsetting.beforeCreateDom;
|
|
|
- luckysheetConfigsetting.workbookCreateBefore = extendsetting.workbookCreateBefore;
|
|
|
- luckysheetConfigsetting.workbookCreateAfter = extendsetting.workbookCreateAfter;
|
|
|
- luckysheetConfigsetting.remoteFunction = extendsetting.remoteFunction;
|
|
|
-
|
|
|
- luckysheetConfigsetting.fireMousedown = extendsetting.fireMousedown;
|
|
|
- luckysheetConfigsetting.forceCalculation = extendsetting.forceCalculation;
|
|
|
- luckysheetConfigsetting.plugins = extendsetting.plugins;
|
|
|
-
|
|
|
- luckysheetConfigsetting.rowHeaderWidth = extendsetting.rowHeaderWidth;
|
|
|
- luckysheetConfigsetting.columnHeaderHeight = extendsetting.columnHeaderHeight;
|
|
|
-
|
|
|
- luckysheetConfigsetting.defaultColWidth = extendsetting.defaultColWidth;
|
|
|
- luckysheetConfigsetting.defaultRowHeight = extendsetting.defaultRowHeight;
|
|
|
-
|
|
|
- luckysheetConfigsetting.title = extendsetting.title;
|
|
|
- luckysheetConfigsetting.container = extendsetting.container;
|
|
|
- luckysheetConfigsetting.hook = extendsetting.hook;
|
|
|
-
|
|
|
- luckysheetConfigsetting.pager = extendsetting.pager;
|
|
|
-
|
|
|
- luckysheetConfigsetting.initShowsheetbarConfig = false;
|
|
|
-
|
|
|
- luckysheetConfigsetting.imageUpdateMethodConfig = extendsetting.imageUpdateMethodConfig;
|
|
|
-
|
|
|
- if (Store.lang === 'zh') flatpickr.localize(Mandarin.zh);
|
|
|
-
|
|
|
- // Store the currently used plugins for monitoring asynchronous loading
|
|
|
- Store.asyncLoad.push(...luckysheetConfigsetting.plugins);
|
|
|
-
|
|
|
- // Register plugins
|
|
|
- initPlugins(extendsetting.plugins , extendsetting.data);
|
|
|
-
|
|
|
- // Store formula information, including internationalization
|
|
|
- functionlist();
|
|
|
-
|
|
|
- let devicePixelRatio = extendsetting.devicePixelRatio;
|
|
|
- if(devicePixelRatio == null){
|
|
|
- devicePixelRatio = 1;
|
|
|
- }
|
|
|
- Store.devicePixelRatio = Math.ceil(devicePixelRatio);
|
|
|
-
|
|
|
- //loading
|
|
|
- const loadingObj=luckysheetlodingHTML("#" + container)
|
|
|
- Store.loadingObj=loadingObj
|
|
|
+ sheet.config.colhidden = colhidden;
|
|
|
+ console.log(data);
|
|
|
+ Store.luckysheetfile = data;
|
|
|
|
|
|
- if (loadurl == "") {
|
|
|
sheetmanage.initialjfFile(menu, title);
|
|
|
// luckysheetsizeauto();
|
|
|
initialWorkBook();
|
|
|
- }
|
|
|
- else {
|
|
|
- $.post(loadurl, {"gridKey" : server.gridKey}, function (d) {
|
|
|
- let data = new Function("return " + d)();
|
|
|
- Store.luckysheetfile = data;
|
|
|
-
|
|
|
- sheetmanage.initialjfFile(menu, title);
|
|
|
- // luckysheetsizeauto();
|
|
|
- initialWorkBook();
|
|
|
-
|
|
|
- //需要更新数据给后台时,建立WebSocket连接
|
|
|
- if(server.allowUpdate){
|
|
|
- server.getUser = setting.getUser
|
|
|
- server.openWebSocket();
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-}
|
|
|
|
|
|
-function initialWorkBook(){
|
|
|
- luckysheetHandler();//Overall dom initialization
|
|
|
- initialFilterHandler();//Filter initialization
|
|
|
- initialMatrixOperation();//Right click matrix initialization
|
|
|
- initialSheetBar();//bottom sheet bar initialization
|
|
|
- formulaBarInitial();//top formula bar initialization
|
|
|
- rowColumnOperationInitial();//row and coloumn operate initialization
|
|
|
- keyboardInitial();//Keyboard operate initialization
|
|
|
- orderByInitial();//menu bar orderby function initialization
|
|
|
- zoomInitial();//zoom method initialization
|
|
|
- printInitial();//print initialization
|
|
|
- initListener();
|
|
|
+ //需要更新数据给后台时,建立WebSocket连接
|
|
|
+ if (server.allowUpdate) {
|
|
|
+ server.getUser = setting.getUser;
|
|
|
+ server.openWebSocket();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+function initialWorkBook() {
|
|
|
+ luckysheetHandler(); //Overall dom initialization
|
|
|
+ initialFilterHandler(); //Filter initialization
|
|
|
+ initialMatrixOperation(); //Right click matrix initialization
|
|
|
+ initialSheetBar(); //bottom sheet bar initialization
|
|
|
+ formulaBarInitial(); //top formula bar initialization
|
|
|
+ rowColumnOperationInitial(); //row and coloumn operate initialization
|
|
|
+ keyboardInitial(); //Keyboard operate initialization
|
|
|
+ orderByInitial(); //menu bar orderby function initialization
|
|
|
+ zoomInitial(); //zoom method initialization
|
|
|
+ printInitial(); //print initialization
|
|
|
+ initListener();
|
|
|
}
|
|
|
|
|
|
//获取所有表格数据
|
|
@@ -241,9 +299,9 @@ luckysheet.getdatabyselection = getdatabyselection;
|
|
|
luckysheet.sheetmanage = sheetmanage;
|
|
|
|
|
|
// Data of the current table
|
|
|
-luckysheet.flowdata = function () {
|
|
|
- return Store.flowdata;
|
|
|
-}
|
|
|
+luckysheet.flowdata = function() {
|
|
|
+ return Store.flowdata;
|
|
|
+};
|
|
|
|
|
|
// Set selection highlight
|
|
|
luckysheet.selectHightlightShow = selectHightlightShow;
|
|
@@ -255,6 +313,4 @@ luckysheet.showLoadingProgress = showloading;
|
|
|
luckysheet.hideLoadingProgress = hideloading;
|
|
|
luckysheet.luckysheetextendData = luckysheetextendData;
|
|
|
|
|
|
-export {
|
|
|
- luckysheet
|
|
|
-}
|
|
|
+export { luckysheet };
|