|
@@ -69,19 +69,19 @@ $(document).ready(function () {
|
|
|
for (let i = 0, len = sels.length; i < len; i++) {
|
|
|
let sel = sels[i];
|
|
|
//delete
|
|
|
- if (sel.colCount === me.setting.header.length) {
|
|
|
+ // if (sel.colCount === me.setting.header.length) {
|
|
|
for (let j = 0, jLen = sel.rowCount; j < jLen; j++) {
|
|
|
let row = sel.row + j;
|
|
|
let section = me.cache[row];
|
|
|
//有数据,删除数据
|
|
|
if (me.isDef(section)) {
|
|
|
- sePostData.push({ updateType: me.updateType.update, updateData: { ID: section.ID, deleted: true } });
|
|
|
+ sePostData.push({ updateType: me.updateType.del, updateData: { ID: section.ID, deleted: true } });
|
|
|
fiPostData.push({ updateType: me.updateType.update, updateData: { ID: fi.currentFeeItem.ID, $pull: { section: { ID: section.ID } } } });
|
|
|
}
|
|
|
}
|
|
|
//front delete
|
|
|
me.cache.splice(sel.row, sel.rowCount);
|
|
|
- }
|
|
|
+ // }
|
|
|
}
|
|
|
//update currentSection
|
|
|
me.currentSection = fi.getCurrentData(me.sheet, me.cache);
|
|
@@ -394,7 +394,7 @@ let sectionObj = {
|
|
|
sheet: null,
|
|
|
cache: [],
|
|
|
currentSection: null,
|
|
|
- updateType: { update: "update", new: "new" },
|
|
|
+ updateType: { update: "update", new: "new", del: 'delete' },
|
|
|
deleteType: "section",
|
|
|
setting: {
|
|
|
header: [
|
|
@@ -496,6 +496,19 @@ let sectionObj = {
|
|
|
$("#sectionTreeModal").modal("show");
|
|
|
},
|
|
|
},
|
|
|
+ del: {
|
|
|
+ name: "删除章节",
|
|
|
+ disabled: function () {
|
|
|
+ const inValidCell = !commonUtil.isDef(target.row) || !commonUtil.isDef(target.col);
|
|
|
+ const inValidData = target.row >= me.cache.length;
|
|
|
+ return locked || inValidCell || inValidData;
|
|
|
+ },
|
|
|
+ icon: "fa-times",
|
|
|
+ callback: function (key, opt) {
|
|
|
+ curDeleteType = me.deleteType;
|
|
|
+ $("#delAlert").modal("show");
|
|
|
+ },
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
} else {
|
|
@@ -647,7 +660,7 @@ let sectionObj = {
|
|
|
me.workBook.commandManager().setShortcutKey("sectionDel", GC.Spread.Commands.Key.del, false, false, false, false);
|
|
|
},
|
|
|
updateSection: function (updateData, callback) {
|
|
|
- CommonAjax.post("/rationRepository/api/updateSection", { updateData: updateData }, function (rstData) {
|
|
|
+ CommonAjax.post("/rationRepository/api/updateSection", { updateData: updateData, libID: feeItemObj.rationRepId }, function (rstData) {
|
|
|
if (callback) {
|
|
|
callback();
|
|
|
}
|