|
@@ -1218,11 +1218,10 @@ $(document).ready(function() {
|
|
|
// const $obj = $('<div>' + item.name +)
|
|
|
// };
|
|
|
// 右键菜单
|
|
|
- let addTagShare = true;
|
|
|
+ const addTag = newTag({ledgerSheet: ledgerSpread.getActiveSheet(), billsTag});
|
|
|
const billsContextMenuOptions = {
|
|
|
selector: '#ledger-spread',
|
|
|
build: function ($trigger, e) {
|
|
|
- addTagShare = true;
|
|
|
const target = SpreadJsObj.safeRightClickSelection($trigger, e, ledgerSpread);
|
|
|
return target.hitTestType === spreadNS.SheetArea.viewport || target.hitTestType === spreadNS.SheetArea.rowHeader;
|
|
|
},
|
|
@@ -1295,7 +1294,7 @@ $(document).ready(function() {
|
|
|
return !readOnly;
|
|
|
}
|
|
|
};
|
|
|
- billsContextMenuOptions.items.sprBase = '-----------';
|
|
|
+ billsContextMenuOptions.items.sprBase = '----';
|
|
|
}
|
|
|
billsContextMenuOptions.items.copyBlock = {
|
|
|
name: '复制整块',
|
|
@@ -1411,7 +1410,7 @@ $(document).ready(function() {
|
|
|
return !readOnly;
|
|
|
}
|
|
|
};
|
|
|
- billsContextMenuOptions.items.sprBlock = '-----------';
|
|
|
+ billsContextMenuOptions.items.sprBlock = '----';
|
|
|
}
|
|
|
if (!readOnly) {
|
|
|
billsContextMenuOptions.items.sortChildren = {
|
|
@@ -1441,7 +1440,7 @@ $(document).ready(function() {
|
|
|
}
|
|
|
};
|
|
|
}
|
|
|
- billsContextMenuOptions.items.sprSort = '-----------';
|
|
|
+ billsContextMenuOptions.items.sprSort = '----';
|
|
|
}
|
|
|
if (!readOnly) {
|
|
|
billsContextMenuOptions.items.batchInsert = {
|
|
@@ -1520,7 +1519,7 @@ $(document).ready(function() {
|
|
|
return !readOnly;
|
|
|
}
|
|
|
};
|
|
|
- billsContextMenuOptions.items.sprBatch = '-----------';
|
|
|
+ billsContextMenuOptions.items.sprBatch = '----';
|
|
|
}
|
|
|
if (!readOnly) {
|
|
|
billsContextMenuOptions.items.importExcel = {
|
|
@@ -1605,83 +1604,18 @@ $(document).ready(function() {
|
|
|
return !readOnly;
|
|
|
}
|
|
|
};
|
|
|
- billsContextMenuOptions.items.sprImport = '-----------';
|
|
|
+ billsContextMenuOptions.items.sprImport = '----';
|
|
|
}
|
|
|
billsContextMenuOptions.items.tag = {
|
|
|
name: '书签',
|
|
|
- items: {
|
|
|
- tagShare: {
|
|
|
- name: '参与人可见',
|
|
|
- type: 'checkbox',
|
|
|
- selected: true,
|
|
|
- events: {
|
|
|
- change: function () {
|
|
|
- addTagShare = this.checked;
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- tagSpr: '--------------',
|
|
|
- tagPrimary: {
|
|
|
- icon: 'fa-tag text-primary mt-2 mb-2',
|
|
|
- name: '靛青',
|
|
|
- callback: function (key, opt, menu, e) {
|
|
|
- const node = SpreadJsObj.getSelectObject(ledgerSpread.getActiveSheet());
|
|
|
- postData(window.location.pathname + '/tag', {add: { color: '#007bff', lid: node.id, share: addTagShare }}, function (data) {
|
|
|
- if (data.add) data.add.node = node;
|
|
|
- billsTag.updateDatasAndShow(data);
|
|
|
- SpreadJsObj.repaintNodesRowHeader(ledgerSpread.getActiveSheet(), node);
|
|
|
- });
|
|
|
- },
|
|
|
- },
|
|
|
- tagSuccess: {
|
|
|
- icon: 'fa-tag text-success mt-2 mb-2',
|
|
|
- name: '果绿',
|
|
|
- callback: function (key, opt) {
|
|
|
- const node = SpreadJsObj.getSelectObject(ledgerSpread.getActiveSheet());
|
|
|
- postData(window.location.pathname + '/tag', {add: { color: '#28a745', lid: node.id, share: addTagShare }}, function (data) {
|
|
|
- if (data.add) data.add.node = node;
|
|
|
- billsTag.updateDatasAndShow(data);
|
|
|
- SpreadJsObj.repaintNodesRowHeader(ledgerSpread.getActiveSheet(), node);
|
|
|
- });
|
|
|
- },
|
|
|
- },
|
|
|
- tagDanger: {
|
|
|
- icon: 'fa-tag text-danger mt-2 mb-2',
|
|
|
- name: '朱砂',
|
|
|
- callback: function (key, opt) {
|
|
|
- const node = SpreadJsObj.getSelectObject(ledgerSpread.getActiveSheet());
|
|
|
- postData(window.location.pathname + '/tag', {add: { color: '#dc3545', lid: node.id, share: addTagShare }}, function (data) {
|
|
|
- if (data.add) data.add.node = node;
|
|
|
- billsTag.updateDatasAndShow(data);
|
|
|
- SpreadJsObj.repaintNodesRowHeader(ledgerSpread.getActiveSheet(), node);
|
|
|
- });
|
|
|
- },
|
|
|
- },
|
|
|
- tagWarning: {
|
|
|
- icon: 'fa-tag text-warning mt-2 mb-2',
|
|
|
- name: '姜黄',
|
|
|
- callback: function (key, opt) {
|
|
|
- const node = SpreadJsObj.getSelectObject(ledgerSpread.getActiveSheet());
|
|
|
- postData(window.location.pathname + '/tag', {add: { color: '#da9500', lid: node.id, share: addTagShare }}, function (data) {
|
|
|
- if (data.add) data.add.node = node;
|
|
|
- billsTag.updateDatasAndShow(data);
|
|
|
- SpreadJsObj.repaintNodesRowHeader(ledgerSpread.getActiveSheet(), node);
|
|
|
- });
|
|
|
- },
|
|
|
- },
|
|
|
- tagInfo: {
|
|
|
- icon: 'fa-tag text-info mt-2 mb-2',
|
|
|
- name: '天蓝',
|
|
|
- callback: function (key, opt) {
|
|
|
- const node = SpreadJsObj.getSelectObject(ledgerSpread.getActiveSheet());
|
|
|
- postData(window.location.pathname + '/tag', {add: { color: '#17a2b8', lid: node.id, share: addTagShare }}, function (data) {
|
|
|
- if (data.add) data.add.node = node;
|
|
|
- billsTag.updateDatasAndShow(data);
|
|
|
- SpreadJsObj.repaintNodesRowHeader(ledgerSpread.getActiveSheet(), node);
|
|
|
- });
|
|
|
- },
|
|
|
- }
|
|
|
+ callback: function (key, opt, menu, e) {
|
|
|
+ const node = SpreadJsObj.getSelectObject(ledgerSpread.getActiveSheet());
|
|
|
+ addTag.do(node);
|
|
|
},
|
|
|
+ disabled: function (key, opt) {
|
|
|
+ const node = SpreadJsObj.getSelectObject(ledgerSpread.getActiveSheet());
|
|
|
+ return !node;
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
$.contextMenu(billsContextMenuOptions);
|
|
@@ -2767,7 +2701,7 @@ $(document).ready(function() {
|
|
|
self.OprObj.delete(self.sheet);
|
|
|
},
|
|
|
},
|
|
|
- sprEdit: '---------',
|
|
|
+ sprEdit: '----',
|
|
|
apply: {
|
|
|
name: '应用全部清单单价至台账',
|
|
|
icon: 'fa-magic',
|