fixed: protable

This commit is contained in:
RB 2022-03-23 15:49:09 +08:00
parent 32ef537758
commit 4b9a9ae8de
2 changed files with 10 additions and 3 deletions

View file

@ -1186,7 +1186,8 @@ select.form-control:not([disabled]) {
padding-top: 12px;
}
.col-form-label.required::after {
.col-form-label.required::after,
.protable thead > tr > th.required::after {
content: '';
position: absolute;
display: inline-block;
@ -1196,6 +1197,10 @@ select.form-control:not([disabled]) {
margin-left: 6px;
}
.protable thead > tr > th.required::after {
margin-top: 2px;
}
.form-text {
color: #878787;
line-height: 1.41;

View file

@ -35,8 +35,9 @@ class ProTable extends React.Component {
<tr>
<th className="col-index" />
{formFields.map((item) => {
if (item.field === TYPE_DIVIDER) return null
return (
<th key={item.field} data-field={item.field} style={colStyles}>
<th key={item.field} data-field={item.field} style={colStyles} className={item.nullable ? '' : 'required'}>
{item.label}
<i className="dividing hide" />
</th>
@ -177,7 +178,8 @@ class InlineForm extends RbForm {
return (
<React.Fragment>
{this.props.children.map((fieldComp) => {
const refid = fieldComp.props.field === TYPE_DIVIDER ? null : `fieldcomp-${fieldComp.props.field}`
if (fieldComp.props.field === TYPE_DIVIDER) return null
const refid = `fieldcomp-${fieldComp.props.field}`
return (
<td key={`td-${refid}`} ref={(c) => (this._$ref = c)}>
{React.cloneElement(fieldComp, { $$$parent: this, ref: refid })}