Commit 0413ff18 authored by zhangwenshuai's avatar zhangwenshuai

自定义组件默认取config的setFormat

parent dd72d6b0
......@@ -191,6 +191,15 @@ const Cell = (props: CellProps) => {
let detailConfig;
if (typeof renderDetailCell === 'function') {
detailConfig = renderDetailCell({ cellData, rowData: record, columnConfig });
const defaultConfig = config[String(columnType)];
if (defaultConfig) {
if (defaultConfig.getFormatter && !detailConfig.getFormatter) {
detailConfig.getFormatter = defaultConfig.getFormatter;
}
if (defaultConfig.setFormatter && !detailConfig.setFormatter) {
detailConfig.setFormatter = defaultConfig.setFormatter;
}
}
empty = false;
} else {
detailConfig = config[String(columnType)] || config['1'];
......
......@@ -6,6 +6,7 @@
width: 100%;
height: 100%;
align-items: center;
overflow: hidden;
.itemBgTxt {
position: absolute;
z-index: -1;
......
......@@ -29,7 +29,7 @@ export const Tags = (props: any) => {
if (mode !== 'multiple') {
// 单选
return (
<div className={s.container}>
<div className={s.container} style={{ overflow: 'hidden' }}>
<span className={s.item} style={{ ...itemStyle, background: `#${getColor(value[0])}` }}>
<div className={s.itemBgTxt}>{value[0].text}</div>
</span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment