|
|
@@ -246,6 +246,13 @@ $(document).ready(() => {
|
|
|
self.addCol('num', select);
|
|
|
},
|
|
|
},
|
|
|
+ 'remove': {
|
|
|
+ name: '删除',
|
|
|
+ icon: 'fa-remove',
|
|
|
+ callback: function (key, opt) {
|
|
|
+ self.remove();
|
|
|
+ },
|
|
|
+ },
|
|
|
addSpr: '----',
|
|
|
upMove: {
|
|
|
name: '上移',
|
|
|
@@ -312,6 +319,12 @@ $(document).ready(() => {
|
|
|
}
|
|
|
SpreadJsObj.loadSheetData(this.sheet, SpreadJsObj.DataType.Data, this.colSetData);
|
|
|
}
|
|
|
+ remove() {
|
|
|
+ const sel = this.sheet.getSelections()[0];
|
|
|
+ if (!sel) return;
|
|
|
+ this.colSetData.splice(sel.row, sel.rowCount);
|
|
|
+ SpreadJsObj.loadSheetData(this.sheet, SpreadJsObj.DataType.Data, this.colSetData);
|
|
|
+ }
|
|
|
move(type, select) {
|
|
|
const index = this.colSetData.findIndex(x => { return x.field === select.field; });
|
|
|
if (type === 'upMove' && index === 0) {
|