|
@@ -2251,17 +2251,19 @@ const SpreadJsObj = {
|
|
|
|
|
|
RowHeader: {
|
|
|
getTagRowHeader: function (setting) {
|
|
|
- const indent = 16, maxHintWidth = 200, borderIndent = 10;
|
|
|
+ const indent = setting.indent || 18, maxHintWidth = 200, borderIndent = 10;
|
|
|
+ const height = setting.tagSize ? 11 * setting.tagSize : 11, width = setting.tagSize ? 10 * setting.tagSize : 10;
|
|
|
+ const tagFont = setting.tagFont || '9px 微软雅黑';
|
|
|
const drawTag = function (canvas, x, y, fillColor) {
|
|
|
canvas.save();
|
|
|
// 设置偏移量
|
|
|
canvas.translate(0.5, 0.5);
|
|
|
canvas.beginPath();
|
|
|
canvas.moveTo(x, y);
|
|
|
- canvas.lineTo(x, y+5);
|
|
|
- canvas.lineTo(x+6, y+11);
|
|
|
- canvas.lineTo(x+11, y+6);
|
|
|
- canvas.lineTo(x+5, y);
|
|
|
+ canvas.lineTo(x, y+height/11*5);
|
|
|
+ canvas.lineTo(x+width/10*5.5, y+height);
|
|
|
+ canvas.lineTo(x+width, y+height-width/10*4.5);
|
|
|
+ canvas.lineTo(x+width/11*5, y);
|
|
|
canvas.lineTo(x, y);
|
|
|
canvas.stroke();
|
|
|
canvas.fillStyle = fillColor instanceof Array ? fillColor[0] : fillColor;
|
|
@@ -2275,8 +2277,8 @@ const SpreadJsObj = {
|
|
|
|
|
|
if (fillColor instanceof Array && fillColor.length > 1) {
|
|
|
canvas.fillStyle = '#444444';
|
|
|
- canvas.font="9px 微软雅黑";
|
|
|
- canvas.fillText(fillColor.length, x+13, y+14);
|
|
|
+ canvas.font = tagFont;
|
|
|
+ canvas.fillText(fillColor.length, x+width/11*13, y+height/11*14);
|
|
|
}
|
|
|
|
|
|
canvas.restore();
|
|
@@ -2293,9 +2295,8 @@ const SpreadJsObj = {
|
|
|
spreadNS.CellTypes.Text.prototype.paint.apply(this, [canvas, value, x, y, w - indent, h, style, options]);
|
|
|
const node = SpreadJsObj.getRowObject(options.sheet, options.row);
|
|
|
const color = this.getTagColor(options.row, node);
|
|
|
- const centerX = x + w - indent + 4, centerY = y + h/2;
|
|
|
- color && drawTag(canvas, centerX - 6, centerY - 6, color);
|
|
|
-
|
|
|
+ const centerX = x + w - indent + height/2, centerY = y + h/2;
|
|
|
+ color && drawTag(canvas, centerX - height/2, centerY - width/2, color);
|
|
|
};
|
|
|
/**
|
|
|
* 获取点击信息
|