column新增required属性控制标题红色星号的展示

This commit is contained in:
huayj 2019-08-24 16:21:57 +08:00
parent b7b4e2f8a3
commit a84313109a
3 changed files with 6 additions and 0 deletions

View File

@ -482,6 +482,7 @@ class Table extends Component {
dataindex:column.dataIndex, dataindex:column.dataIndex,
textAlign:column.textAlign, textAlign:column.textAlign,
titleAlign: column.titleAlign, // 标题水平对齐方式 titleAlign: column.titleAlign, // 标题水平对齐方式
required: column.required, // 标题是否展示必填标志
}; };
if (column.onHeadCellClick) { if (column.onHeadCellClick) {
cell.onClick = column.onHeadCellClick; cell.onClick = column.onHeadCellClick;

View File

@ -466,6 +466,9 @@ $icon-color:#505F79;
// overflow: hidden; // overflow: hidden;
// white-space: nowrap; // white-space: nowrap;
// text-overflow: ellipsis; // text-overflow: ellipsis;
.required {
color: #F22C1D;
}
.bee-table-column-sorter { .bee-table-column-sorter {
position: relative; position: relative;
margin-left: 4px; margin-left: 4px;
@ -488,6 +491,7 @@ $icon-color:#505F79;
cursor: pointer; cursor: pointer;
} }
} }
.bee-table-column-sorter-down.on .uf-triangle-down, .bee-table-column-sorter-down.on .uf-triangle-down,

View File

@ -784,6 +784,7 @@ class TableHeader extends Component {
if(!da.fixed ){ if(!da.fixed ){
return (<th {...da} {...keyTemp} className={thClassName} data-th-fixed={da.fixed} data-line-key={da.key} return (<th {...da} {...keyTemp} className={thClassName} data-th-fixed={da.fixed} data-line-key={da.key}
data-line-index={columIndex} data-th-width={da.width} data-type="draggable"> data-line-index={columIndex} data-th-width={da.width} data-type="draggable">
{da.required ? <span className='required'>*</span>:''}
{da.children} {da.children}
{ {
dragborder && columIndex != _rowLeng? <div ref={el => (this.gap = el)} data-line-key={da.key} dragborder && columIndex != _rowLeng? <div ref={el => (this.gap = el)} data-line-key={da.key}