From 5a5e07a0ce81d064038ece372e7e8844157a7d1b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 05 六月 2022 22:59:20 +0800 Subject: [PATCH] 2022-06-05 --- src/tabviews/custom/index.jsx | 61 ++++++++++++++++++++++++++++++ 1 files changed, 61 insertions(+), 0 deletions(-) diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index d8f28c0..e794b18 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -569,6 +569,18 @@ col.elements = col.elements.map(cell => { if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height) { cell.innerHeight = 'auto' + } else if (cell.eleType === 'icon') { + let fontSize = 14 + let lineHeight = 1.5 + + if (cell.style.fontSize) { + fontSize = parseInt(cell.style.fontSize) + } + if (cell.style.lineHeight) { + lineHeight = parseFloat(cell.style.lineHeight) + } + + cell.innerHeight = fontSize * lineHeight } return cell }) @@ -658,6 +670,18 @@ } } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { cell.innerHeight = 'auto' + } else if (cell.eleType === 'icon') { + let fontSize = 14 + let lineHeight = 1.5 + + if (cell.style.fontSize) { + fontSize = parseInt(cell.style.fontSize) + } + if (cell.style.lineHeight) { + lineHeight = parseFloat(cell.style.lineHeight) + } + + cell.innerHeight = fontSize * lineHeight } return cell.eleType !== 'button' || skip || permAction[cell.uuid] @@ -688,7 +712,20 @@ } } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { cell.innerHeight = 'auto' + } else if (cell.eleType === 'icon') { + let fontSize = 14 + let lineHeight = 1.5 + + if (cell.style.fontSize) { + fontSize = parseInt(cell.style.fontSize) + } + if (cell.style.lineHeight) { + lineHeight = parseFloat(cell.style.lineHeight) + } + + cell.innerHeight = fontSize * lineHeight } + return cell.eleType !== 'button' || skip || permAction[cell.uuid] }) }) @@ -718,6 +755,18 @@ } } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height) { cell.innerHeight = 'auto' + } else if (cell.eleType === 'icon') { + let fontSize = 14 + let lineHeight = 1.5 + + if (cell.style.fontSize) { + fontSize = parseInt(cell.style.fontSize) + } + if (cell.style.lineHeight) { + lineHeight = parseFloat(cell.style.lineHeight) + } + + cell.innerHeight = fontSize * lineHeight } return cell.eleType !== 'button' || skip || permAction[cell.uuid] @@ -751,6 +800,18 @@ } } else if (['text', 'number', 'link'].includes(cell.eleType) && !cell.height && _hasheight) { cell.innerHeight = 'auto' + } else if (cell.eleType === 'icon') { + let fontSize = 14 + let lineHeight = 1.5 + + if (cell.style.fontSize) { + fontSize = parseInt(cell.style.fontSize) + } + if (cell.style.lineHeight) { + lineHeight = parseFloat(cell.style.lineHeight) + } + + cell.innerHeight = fontSize * lineHeight } return cell.eleType !== 'button' || skip || permAction[cell.uuid] }) -- Gitblit v1.8.0