固定列在过滤栏位上显示单不可以点击
This commit is contained in:
parent
3c91162336
commit
c3c3331b51
|
@ -90,7 +90,7 @@ function filterColumn(Table, Popover) {
|
|||
showModal = _state.showModal;
|
||||
|
||||
|
||||
var locale = (0, _tool.getComponentLocale)(this.props, this.context, 'Table', function () {
|
||||
var locale = (0, _tool.getComponentLocale)(this.props, this.context, "Table", function () {
|
||||
return _i18n2["default"];
|
||||
});
|
||||
|
||||
|
@ -115,7 +115,7 @@ function filterColumn(Table, Popover) {
|
|||
_react2["default"].createElement(
|
||||
"span",
|
||||
{ className: prefixCls + "-clear-setting", onClick: this.clear },
|
||||
locale['resetSettings']
|
||||
locale["resetSettings"]
|
||||
),
|
||||
_react2["default"].createElement(
|
||||
"div",
|
||||
|
@ -127,11 +127,13 @@ function filterColumn(Table, Popover) {
|
|||
return _react2["default"].createElement(
|
||||
"div",
|
||||
{ className: prefixCls + "-cont" },
|
||||
_react2["default"].createElement(Table, _extends({}, this.props, { columns: _columns, data: data
|
||||
_react2["default"].createElement(Table, _extends({}, this.props, {
|
||||
columns: _columns,
|
||||
data: data
|
||||
// scroll={scroll}
|
||||
// scroll={{x:this.getCloumnsScroll(columns)}}
|
||||
})),
|
||||
_react2["default"].createElement(
|
||||
this.props.columnFilterAble == false ? "" : _react2["default"].createElement(
|
||||
"div",
|
||||
{ className: prefixCls + "-filter-icon" },
|
||||
_react2["default"].createElement(
|
||||
|
@ -140,7 +142,8 @@ function filterColumn(Table, Popover) {
|
|||
id: "filter_column_popover",
|
||||
placement: "left",
|
||||
content: content,
|
||||
show: showModal },
|
||||
show: showModal
|
||||
},
|
||||
_react2["default"].createElement(
|
||||
"div",
|
||||
{ className: prefixCls + "-pop-column-filter-cont" },
|
||||
|
@ -155,6 +158,7 @@ function filterColumn(Table, Popover) {
|
|||
}(_react.Component), _class.defaultProps = {
|
||||
prefixCls: "u-table-filter-column",
|
||||
afterFilter: noop,
|
||||
columnFilterAble: true,
|
||||
scroll: {}
|
||||
}, _initialiseProps = function _initialiseProps() {
|
||||
var _this2 = this;
|
||||
|
@ -162,7 +166,7 @@ function filterColumn(Table, Popover) {
|
|||
this.setColumOrderByIndex = function (_column) {
|
||||
_column.forEach(function (da) {
|
||||
//默认所有的列都显示,如果传递ifshow属性,根据ifshow属性值来判断是否显示某列
|
||||
if (da.hasOwnProperty('ifshow')) {
|
||||
if (da.hasOwnProperty("ifshow")) {
|
||||
da.checked = da.ifshow ? true : false;
|
||||
da.ifshow = da.checked;
|
||||
} else {
|
||||
|
@ -208,20 +212,27 @@ function filterColumn(Table, Popover) {
|
|||
var columns = _this2.state.columns;
|
||||
|
||||
return columns.map(function (da, i) {
|
||||
if (!da.fixed) {
|
||||
return _react2["default"].createElement(
|
||||
"div",
|
||||
{ key: da.key + "_" + i, className: prefixCls + "-pop-cont-item" },
|
||||
_react2["default"].createElement(_beeCheckbox2["default"], { id: da.key, checked: da.checked, onClick: function onClick() {
|
||||
_this2.checkedColumItemClick(da);
|
||||
} }),
|
||||
_react2["default"].createElement(
|
||||
"span",
|
||||
null,
|
||||
da.title
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return _react2["default"].createElement(
|
||||
"div",
|
||||
{
|
||||
key: da.key + "_" + i,
|
||||
className: prefixCls + "-pop-cont-item"
|
||||
},
|
||||
_react2["default"].createElement(_beeCheckbox2["default"], {
|
||||
id: da.key,
|
||||
disabled: da.fixed,
|
||||
checked: da.checked,
|
||||
onClick: function onClick() {
|
||||
_this2.checkedColumItemClick(da);
|
||||
}
|
||||
}),
|
||||
_react2["default"].createElement(
|
||||
"span",
|
||||
null,
|
||||
da.title
|
||||
)
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -89,23 +89,29 @@ export default function filterColumn(Table, Popover) {
|
|||
const { prefixCls } = this.props;
|
||||
const { columns } = this.state;
|
||||
return columns.map((da, i) => {
|
||||
if (!da.fixed) {
|
||||
let paramObj = {
|
||||
id:da.key,
|
||||
checked:da.checked
|
||||
}
|
||||
if(da.fixed){
|
||||
paramObj.disabled = true
|
||||
}else{
|
||||
paramObj.onClick = () => {
|
||||
this.checkedColumItemClick(da);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
key={da.key + "_" + i}
|
||||
className={`${prefixCls}-pop-cont-item`}
|
||||
>
|
||||
<Checkbox
|
||||
id={da.key}
|
||||
checked={da.checked}
|
||||
onClick={() => {
|
||||
this.checkedColumItemClick(da);
|
||||
}}
|
||||
/>
|
||||
<Checkbox {...paramObj}/>
|
||||
|
||||
<span>{da.title}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue