|
@@ -157,6 +157,24 @@ let TEMPLATE_BILLS_SETTING = {
|
|
},
|
|
},
|
|
},
|
|
},
|
|
{
|
|
{
|
|
|
|
+ width: 40,
|
|
|
|
+ readOnly: locked,
|
|
|
|
+ head: {
|
|
|
|
+ titleNames: ["不可\n删除"],
|
|
|
|
+ spanCols: [1],
|
|
|
|
+ spanRows: [1],
|
|
|
|
+ vAlign: [1],
|
|
|
|
+ hAlign: [1],
|
|
|
|
+ font: ["Arial"],
|
|
|
|
+ },
|
|
|
|
+ data: {
|
|
|
|
+ field: "cantDelete",
|
|
|
|
+ vAlign: 0,
|
|
|
|
+ hAlign: 1,
|
|
|
|
+ font: "Arail",
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ {
|
|
width: 250,
|
|
width: 250,
|
|
readOnly: locked,
|
|
readOnly: locked,
|
|
head: {
|
|
head: {
|
|
@@ -373,6 +391,8 @@ $(document).ready(function () {
|
|
col.data.cellType = getTypeFlagCellType();
|
|
col.data.cellType = getTypeFlagCellType();
|
|
} else if (col.data.field === "flagsIndex.fixed.flag" && TEMPLATE_BILLS_SETTING.cols.indexOf(col) !== TEMPLATE_BILLS_SETTING.treeCol) {
|
|
} else if (col.data.field === "flagsIndex.fixed.flag" && TEMPLATE_BILLS_SETTING.cols.indexOf(col) !== TEMPLATE_BILLS_SETTING.treeCol) {
|
|
col.data.cellType = getFixedFlagCellType();
|
|
col.data.cellType = getFixedFlagCellType();
|
|
|
|
+ } else if (col.data.field === 'cantDelete' && TEMPLATE_BILLS_SETTING.cols.indexOf(col) !== TEMPLATE_BILLS_SETTING.treeCol) {
|
|
|
|
+ col.data.cellType = new GC.Spread.Sheets.CellTypes.CheckBox();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -386,6 +406,33 @@ $(document).ready(function () {
|
|
//billsSpread.getSheet(0).setFormatter(-1, 1, '@');
|
|
//billsSpread.getSheet(0).setFormatter(-1, 1, '@');
|
|
controller.bind("refreshBaseActn", RefreshBaseActn);
|
|
controller.bind("refreshBaseActn", RefreshBaseActn);
|
|
|
|
|
|
|
|
+
|
|
|
|
+ function onButtonClicked(sender, info) {
|
|
|
|
+ if (info.sheet.isEditing()) {
|
|
|
|
+ info.sheet.endEdit(true);
|
|
|
|
+ }
|
|
|
|
+ const fieldName = controller.setting.cols[info.col].data.field;
|
|
|
|
+ var node = controller.tree.items[info.row];
|
|
|
|
+ if (node && fieldName === 'cantDelete') {
|
|
|
|
+ const isChecked = Boolean(info.sheet.getValue(info.row, info.col));
|
|
|
|
+ const data = { type: "update", data: { ID: node.getID() } };
|
|
|
|
+ setFee(data.data, fieldName, isChecked);
|
|
|
|
+ console.log(isChecked);
|
|
|
|
+ const updateData = [data];
|
|
|
|
+ CommonAjax.post(
|
|
|
|
+ updateUrl,
|
|
|
|
+ updateData,
|
|
|
|
+ function (data) {
|
|
|
|
+ setFee(node.data, fieldName, isChecked);
|
|
|
|
+ controller.refreshTreeNode([node], false);
|
|
|
|
+ },
|
|
|
|
+ function () {
|
|
|
|
+ controller.refreshTreeNode([node], false);
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
function billsOnEditEnded(sender, info) {
|
|
function billsOnEditEnded(sender, info) {
|
|
var node = controller.tree.items[info.row];
|
|
var node = controller.tree.items[info.row];
|
|
var fieldName = controller.setting.cols[info.col].data.field;
|
|
var fieldName = controller.setting.cols[info.col].data.field;
|
|
@@ -418,6 +465,7 @@ $(document).ready(function () {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
billsSpread.bind(GC.Spread.Sheets.Events.EditEnded, billsOnEditEnded);
|
|
billsSpread.bind(GC.Spread.Sheets.Events.EditEnded, billsOnEditEnded);
|
|
|
|
+ billsSpread.bind(GC.Spread.Sheets.Events.ButtonClicked, onButtonClicked);
|
|
billsSpread.bind(GC.Spread.Sheets.Events.ClipboardPasted, function (e, info) {
|
|
billsSpread.bind(GC.Spread.Sheets.Events.ClipboardPasted, function (e, info) {
|
|
console.log("ClipboardPasted");
|
|
console.log("ClipboardPasted");
|
|
var node,
|
|
var node,
|