|
|
@ -228,6 +228,10 @@ const sheetmanage = { |
|
|
|
// alert("非编辑模式下不允许该操作!");
|
|
|
|
return; |
|
|
|
} |
|
|
|
// 钩子 sheetCreateBefore
|
|
|
|
if(!method.createHookFunction('sheetCreateBefore')){ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
let _this = this; |
|
|
|
|
|
|
@ -271,10 +275,16 @@ const sheetmanage = { |
|
|
|
} |
|
|
|
|
|
|
|
_this.changeSheetExec(index, isPivotTable, true); |
|
|
|
|
|
|
|
// 钩子 sheetCreateAfter 不应该在这里 应在绘制完成后 因此在 changeSheet 实现
|
|
|
|
}, |
|
|
|
setSheetHide: function(index) { |
|
|
|
setSheetHide: function(index, isDelete) { |
|
|
|
let _this = this; |
|
|
|
let currentIdx = _this.getSheetIndex(index); |
|
|
|
// 钩子 sheetHideBefore
|
|
|
|
if(!isDelete && !method.createHookFunction('sheetHideBefore', {sheet: Store.luckysheetfile[currentIdx]})){ |
|
|
|
return; |
|
|
|
} |
|
|
|
Store.luckysheetfile[currentIdx].hide = 1; |
|
|
|
|
|
|
|
let luckysheetcurrentSheetitem = $("#luckysheet-sheets-item" + index); |
|
|
@ -311,14 +321,24 @@ const sheetmanage = { |
|
|
|
_this.changeSheetExec(indicator); |
|
|
|
|
|
|
|
server.saveParam("sh", luckysheetcurrentSheetitem.data("index"), 1, { "op": "hide", "cur": indicator }); |
|
|
|
// 钩子 sheetHideAfter
|
|
|
|
if (!isDelete) { |
|
|
|
method.createHookFunction('sheetHideAfter', {sheet: Store.luckysheetfile[currentIdx]}); |
|
|
|
} |
|
|
|
}, |
|
|
|
setSheetShow: function(index) { |
|
|
|
let _this = this; |
|
|
|
|
|
|
|
Store.luckysheetfile[_this.getSheetIndex(index)].hide = 0; |
|
|
|
const file = Store.luckysheetfile[_this.getSheetIndex(index)] |
|
|
|
// 钩子 sheetShowBefore
|
|
|
|
if(!method.createHookFunction('sheetShowBefore', {sheet: file})){ |
|
|
|
return; |
|
|
|
} |
|
|
|
file.hide = 0; |
|
|
|
_this.changeSheetExec(index); |
|
|
|
|
|
|
|
server.saveParam("sh", index, 0, {"op": "show", "cur": null}); |
|
|
|
// 钩子 sheetShowAfter
|
|
|
|
method.createHookFunction('sheetShowAfter', {sheet: file}); |
|
|
|
}, |
|
|
|
sheetMaxIndex: 0, |
|
|
|
ordersheet: function(property) { |
|
|
@ -460,6 +480,14 @@ const sheetmanage = { |
|
|
|
copyjson.order = order; |
|
|
|
copyjson.index = index; |
|
|
|
copyjson.name = _this.generateCopySheetName(Store.luckysheetfile, copyjson.name); |
|
|
|
|
|
|
|
// 钩子 sheetCreateBefore
|
|
|
|
if(!method.createHookFunction('sheetCopyBefore', { |
|
|
|
targetSheet: Store.luckysheetfile[copyarrindex], |
|
|
|
copySheet: copyjson |
|
|
|
})){ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
let colorset = ''; |
|
|
|
if(copyjson.color != null){ |
|
|
@ -478,7 +506,7 @@ const sheetmanage = { |
|
|
|
|
|
|
|
server.saveParam("shc", index, { "copyindex": copyindex, "name": copyjson.name }); |
|
|
|
|
|
|
|
_this.changeSheetExec(index); |
|
|
|
_this.changeSheetExec(index, undefined, undefined, true); |
|
|
|
_this.reOrderAllSheet(); |
|
|
|
|
|
|
|
if (Store.clearjfundo) { |
|
|
@ -560,7 +588,15 @@ const sheetmanage = { |
|
|
|
} |
|
|
|
|
|
|
|
let arrIndex = _this.getSheetIndex(index); |
|
|
|
_this.setSheetHide(index); |
|
|
|
|
|
|
|
const file = Store.luckysheetfile[arrIndex]; |
|
|
|
|
|
|
|
// 钩子 sheetDeleteBefore
|
|
|
|
if(!method.createHookFunction('sheetDeleteBefore', { sheet: file })){ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
_this.setSheetHide(index, true); |
|
|
|
|
|
|
|
$("#luckysheet-sheets-item" + index).remove(); |
|
|
|
$("#luckysheet-datavisual-selection-set-" + index).remove(); |
|
|
@ -574,6 +610,8 @@ const sheetmanage = { |
|
|
|
removedsheet[0].type = "deleteSheet"; |
|
|
|
Store.jfredo.push(removedsheet[0]); |
|
|
|
} |
|
|
|
// 钩子 sheetDeleteAfter
|
|
|
|
method.createHookFunction('sheetDeleteAfter', { sheet: file }); |
|
|
|
}, |
|
|
|
nulldata: null, |
|
|
|
getGridData: function(d) { |
|
|
@ -1131,7 +1169,7 @@ const sheetmanage = { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
changeSheet: function(index, isPivotInitial, isNewSheet) { |
|
|
|
changeSheet: function(index, isPivotInitial, isNewSheet, isCopySheet) { |
|
|
|
if(isEditMode()){ |
|
|
|
// alert("非编辑模式下不允许该操作!");
|
|
|
|
return; |
|
|
@ -1147,6 +1185,15 @@ const sheetmanage = { |
|
|
|
$("#luckysheet-cell-main #luckysheet-multipleRange-show").empty(); |
|
|
|
server.multipleIndex = 0; |
|
|
|
} |
|
|
|
let file = Store.luckysheetfile[_this.getSheetIndex(index)] |
|
|
|
// 钩子 sheetCreateAfter
|
|
|
|
if (isNewSheet) { |
|
|
|
method.createHookFunction('sheetCreateAfter', { sheet: file }); |
|
|
|
} |
|
|
|
// 钩子 sheetCopyAfter
|
|
|
|
if (isCopySheet) { |
|
|
|
method.createHookFunction('sheetCopyAfter', { sheet: file }); |
|
|
|
} |
|
|
|
|
|
|
|
// 钩子函数
|
|
|
|
method.createHookFunction('sheetActivate', index, isPivotInitial, isNewSheet); |
|
|
@ -1157,7 +1204,6 @@ const sheetmanage = { |
|
|
|
_this.storeSheetParamALL(); |
|
|
|
_this.setCurSheet(index); |
|
|
|
|
|
|
|
let file = Store.luckysheetfile[_this.getSheetIndex(index)] |
|
|
|
|
|
|
|
if (!!file.isPivotTable) { |
|
|
|
Store.luckysheetcurrentisPivotTable = true; |
|
|
@ -1467,7 +1513,7 @@ const sheetmanage = { |
|
|
|
|
|
|
|
return null; |
|
|
|
}, |
|
|
|
changeSheetExec: function(index, isPivotInitial, isNewSheet) { |
|
|
|
changeSheetExec: function(index, isPivotInitial, isNewSheet, isCopySheet) { |
|
|
|
|
|
|
|
let $sheet = $("#luckysheet-sheets-item" + index); |
|
|
|
|
|
|
@ -1476,7 +1522,7 @@ const sheetmanage = { |
|
|
|
$sheet.addClass("luckysheet-sheets-item-active").show(); |
|
|
|
|
|
|
|
cleargridelement(); |
|
|
|
this.changeSheet(index, isPivotInitial, isNewSheet); |
|
|
|
this.changeSheet(index, isPivotInitial, isNewSheet, isCopySheet); |
|
|
|
|
|
|
|
$("#luckysheet-sheet-list, #luckysheet-rightclick-sheet-menu").hide(); |
|
|
|
|
|
|
|