|
@@ -400,10 +400,19 @@ var sheetCommonObj = {
|
|
|
sheet.getCell(row, col).hAlign(GC.Spread.Sheets.HorizontalAlign.center);
|
|
sheet.getCell(row, col).hAlign(GC.Spread.Sheets.HorizontalAlign.center);
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
- getCheckBox(threeState = false) {
|
|
|
|
|
- var c = new GC.Spread.Sheets.CellTypes.CheckBox();
|
|
|
|
|
- c.isThreeState(threeState);
|
|
|
|
|
- return c
|
|
|
|
|
|
|
+ getCheckBox(threeState = false){
|
|
|
|
|
+ var c = new GC.Spread.Sheets.CellTypes.CheckBox();
|
|
|
|
|
+ c.isThreeState(threeState);
|
|
|
|
|
+ return c
|
|
|
|
|
+ },
|
|
|
|
|
+ // 无法勾选的复选框
|
|
|
|
|
+ getReadOnlyCheckBox () {
|
|
|
|
|
+ function ReadOnlyCheckBox() {}
|
|
|
|
|
+ ReadOnlyCheckBox.prototype = new GC.Spread.Sheets.CellTypes.CheckBox();
|
|
|
|
|
+ ReadOnlyCheckBox.prototype.processMouseUp = function () {
|
|
|
|
|
+ return;
|
|
|
|
|
+ };
|
|
|
|
|
+ return new ReadOnlyCheckBox();
|
|
|
},
|
|
},
|
|
|
setComboBox(row, col, sheet, options, editorValueType, editable, maxDropDownItems) {
|
|
setComboBox(row, col, sheet, options, editorValueType, editable, maxDropDownItems) {
|
|
|
//let combo = new GC.Spread.Sheets.CellTypes.ComboBox();
|
|
//let combo = new GC.Spread.Sheets.CellTypes.ComboBox();
|
|
@@ -763,7 +772,59 @@ var sheetCommonObj = {
|
|
|
};
|
|
};
|
|
|
return new ComboCellForActiveCell();
|
|
return new ComboCellForActiveCell();
|
|
|
},
|
|
},
|
|
|
- getTipsCombo: function (forLocked, tips, setting, node) {
|
|
|
|
|
|
|
+ getTipsCell: function (baseCell, cellPrototype, tips, setting, node) {
|
|
|
|
|
+ let getTipsCell = function () {
|
|
|
|
|
+ this.clickCom=false;
|
|
|
|
|
+ };
|
|
|
|
|
+ getTipsCell.prototype = baseCell;
|
|
|
|
|
+ if(tips && tips !=""){
|
|
|
|
|
+ getTipsCell.prototype.processMouseEnter = function(hitinfo){
|
|
|
|
|
+ if(this.clickCom == true){ //点击了下拉框的三角形,则不用再显示悬浮框了
|
|
|
|
|
+ this.clickCom = false;
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ let text = typeof tips == 'function'?tips(node):tips;
|
|
|
|
|
+ TREE_SHEET_HELPER.delayShowTips(hitinfo,setting,text);
|
|
|
|
|
+ };
|
|
|
|
|
+ getTipsCell.prototype.processMouseLeave = function (hitinfo) {
|
|
|
|
|
+ TREE_SHEET_HELPER.hideTipsDiv();
|
|
|
|
|
+ };
|
|
|
|
|
+ getTipsCell.prototype.processMouseDown = function (hitinfo){
|
|
|
|
|
+ if(hitinfo.isReservedLocation == true){//这里是点击了下拉框的三角形才会有这个属性
|
|
|
|
|
+ TREE_SHEET_HELPER.hideTipsDiv();
|
|
|
|
|
+ this.clickCom = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ cellPrototype.processMouseDown.apply(this, arguments);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ getTipsCell.prototype.updateEditor = function (editorContext, cellStyle, cellRect, context){
|
|
|
|
|
+ TREE_SHEET_HELPER.hideTipsDiv();
|
|
|
|
|
+ cellPrototype.updateEditor.apply(this, arguments);
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+ return new getTipsCell();
|
|
|
|
|
+ },
|
|
|
|
|
+ getTipsText: function (tips, setting, node) {
|
|
|
|
|
+ function baseTextCell() {}
|
|
|
|
|
+ baseTextCell.prototype = new GC.Spread.Sheets.CellTypes.Text();
|
|
|
|
|
+ baseTextCell.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
|
|
|
|
|
+ return {
|
|
|
|
|
+ x: x,
|
|
|
|
|
+ y: y,
|
|
|
|
|
+ row: context.row,
|
|
|
|
|
+ col: context.col,
|
|
|
|
|
+ cellStyle: cellStyle,
|
|
|
|
|
+ cellRect: cellRect,
|
|
|
|
|
+ sheetArea: context.sheetArea
|
|
|
|
|
+ };
|
|
|
|
|
+ };
|
|
|
|
|
+ return this.getTipsCell(new baseTextCell(), GC.Spread.Sheets.CellTypes.Text.prototype, tips, setting, node);
|
|
|
|
|
+ },
|
|
|
|
|
+ getTipsCombo:function (forLocked,tips,setting,node) {
|
|
|
|
|
+ const baseCell = sheetCommonObj.getDynamicCombo(forLocked);
|
|
|
|
|
+ return this.getTipsCell(baseCell, GC.Spread.Sheets.CellTypes.ComboBox.prototype, tips, setting, node);
|
|
|
|
|
+ },
|
|
|
|
|
+ /* getTipsCombo: function (forLocked, tips, setting, node) {
|
|
|
let getTipsCombo = function () {
|
|
let getTipsCombo = function () {
|
|
|
this.clickCom = false;
|
|
this.clickCom = false;
|
|
|
};
|
|
};
|
|
@@ -794,7 +855,7 @@ var sheetCommonObj = {
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
return new getTipsCombo();
|
|
return new getTipsCombo();
|
|
|
- },
|
|
|
|
|
|
|
+ }, */
|
|
|
getTreeNodeCellType: function (datas, row, parentMap,treeCol, paintFunc) {// 2018-09-26 不用spreadjs默认的树结构,自定义控件
|
|
getTreeNodeCellType: function (datas, row, parentMap,treeCol, paintFunc) {// 2018-09-26 不用spreadjs默认的树结构,自定义控件
|
|
|
var ns = GC.Spread.Sheets;
|
|
var ns = GC.Spread.Sheets;
|
|
|
let rectW = 10;
|
|
let rectW = 10;
|