Bläddra i källkod

feat: sjs 列文字超出编辑框后,文本悬停显示

caipin 2 dagar sedan
förälder
incheckning
402ddfe3c6
2 ändrade filer med 10 tillägg och 2 borttagningar
  1. 1 1
      app/public/js/filesjs.js
  2. 9 1
      app/public/js/spreadjs_rela/spreadjs_zh.js

+ 1 - 1
app/public/js/filesjs.js

@@ -1226,7 +1226,7 @@ $(document).ready(function() {
             this.spreadSetting = {
             this.spreadSetting = {
                 cols: [{
                 cols: [{
                     title: '标段列表', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 280,
                     title: '标段列表', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 280,
-                    formatter: '@', cellType: 'tree',
+                    formatter: '@', cellType: 'tree', showTips: true,
                     getValue: function(data) {
                     getValue: function(data) {
                         return data.name;
                         return data.name;
                     },
                     },

+ 9 - 1
app/public/js/spreadjs_rela/spreadjs_zh.js

@@ -2101,7 +2101,15 @@ const SpreadJsObj = {
                 if (!node) return false;
                 if (!node) return false;
 
 
                 const move = (node[tree.setting.level]) * indent + (node[tree.setting.level]) * levelIndent + xOffset;
                 const move = (node[tree.setting.level]) * indent + (node[tree.setting.level]) * levelIndent + xOffset;
-                const validWidth = hitinfo.cellRect.width - move;
+                let iconWidth = 0;
+                if (col.getIcon) {
+                    const iconType = col.getIcon(node);
+                    if (iconType) {
+                        const customSize = typeof iconType === 'object' ? Number(iconType.size) : 0;
+                        iconWidth = (customSize > 0 ? customSize : 14) + 4;
+                    }
+                }
+                const validWidth = hitinfo.cellRect.width - move - iconWidth;
                 return this.getTextDisplayWidth(hitinfo, text) > validWidth;
                 return this.getTextDisplayWidth(hitinfo, text) > validWidth;
             };
             };
             /**
             /**