From 7f270b5ab1b0cc104b4678354fbee40443a4d9f1 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 14 十一月 2023 22:13:51 +0800 Subject: [PATCH] 2023-11-14 --- src/menu/components/card/cardcellcomponent/index.jsx | 41 ++++++++++++++++++++++++++++------------- 1 files changed, 28 insertions(+), 13 deletions(-) diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx index 21d06f8..aeb7c5c 100644 --- a/src/menu/components/card/cardcellcomponent/index.jsx +++ b/src/menu/components/card/cardcellcomponent/index.jsx @@ -449,21 +449,36 @@ res.style = {} } } else if (res.class !== cell.class || res.show !== cell.show || !res.style) { - let cl = res.class.replace('border-', '') - let style = {} - if (res.class === 'default') { - style.color = 'rgba(0, 0, 0, 0.65)' - style.backgroundColor = '#fff' - style.borderColor = '#d9d9d9' - } else if (res.class.indexOf('border') > -1) { - style.color = color[cl] - style.backgroundColor = '#fff' - style.borderColor = color[cl] + if (res.class) { + let cl = res.class.replace('border-', '') + let style = {} + if (res.class === 'default') { + style.color = 'rgba(0, 0, 0, 0.65)' + style.backgroundColor = '#fff' + style.borderColor = '#d9d9d9' + } else if (res.class.indexOf('border') > -1) { + style.color = color[cl] + style.backgroundColor = '#fff' + style.borderColor = color[cl] + } else { + style.color = '#ffffff' + style.backgroundColor = color[cl] + } + res.style = {...res.style, ...style} } else { - style.color = '#ffffff' - style.backgroundColor = color[cl] + res.style = res.style || {} } - res.style = {...res.style, ...style} + } + + if (res.width === 0 && cell.width !== 0) { + res.style = res.style || {} + + res.style.paddingLeft = '15px' + res.style.paddingRight = '15px' + res.style.marginRight = '15px' + res.style.width = 'auto' + + delete res.style.marginLeft } res.updateTime = moment().format('YYYY-MM-DD HH:mm') -- Gitblit v1.8.0