|
@@ -384,7 +384,7 @@ $(document).ready(() => {
|
|
|
const sel = info.sheet.getSelections()[0];
|
|
|
const col = info.sheet.zh_setting.cols[sel.col];
|
|
|
const data = SpreadJsObj.getSelectObject(info.sheet);
|
|
|
- if (col && col.field === 'del_list' && !_.find(changeUsedData, { cbid: data.id })) {
|
|
|
+ if (col && col.field === 'del_list' && data && !_.find(changeUsedData, { cbid: data.id })) {
|
|
|
changeSpreadObj.del();
|
|
|
}
|
|
|
changeSpreadObj.resetXmjSpread(data);
|
|
@@ -723,7 +723,29 @@ $(document).ready(() => {
|
|
|
changeSpread.bind(spreadNS.Events.ValueChanged, changeSpreadObj.valueChanged);
|
|
|
SpreadJsObj.addDeleteBind(changeSpread, changeSpreadObj.deletePress);
|
|
|
changeSpreadSheet.getCell(-1, 10).foreColor('#dc3545');
|
|
|
+ const delCommand = {
|
|
|
+ canUndo: false,
|
|
|
+ execute: function (context, options, isUndo) {
|
|
|
+ var Commands = GC.Spread.Sheets.Commands;
|
|
|
+ const sel = changeSpreadSheet.getSelections()[0];
|
|
|
+ const col = changeSpreadSheet.zh_setting.cols[sel.col];
|
|
|
+ if (col && col.field !== 'ca_tp') {
|
|
|
+ isUndo = true;
|
|
|
+ }
|
|
|
+ if (isUndo) {
|
|
|
+ Commands.undoTransaction(context, options);
|
|
|
+ return true;
|
|
|
+ } else {
|
|
|
+ Commands.startTransaction(context, options);
|
|
|
|
|
|
+ Commands.endTransaction(context, options);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ const commandManager = changeSpread.commandManager();
|
|
|
+ commandManager.register('banDel', delCommand);
|
|
|
+ commandManager.setShortcutKey('banDel', 39, false, false, false, false);// 改写键盘右键,防止删除清单
|
|
|
let batchInsertObj;
|
|
|
$.contextMenu.types.batchInsert = function (item, opt, root) {
|
|
|
const self = this;
|