单选功能错行问题、拖拽列宽返回的 width 参数不对的问题

This commit is contained in:
yangchch6 2019-07-01 16:22:24 +08:00
parent 233efa609a
commit aa69d8dfed
7 changed files with 21 additions and 21 deletions

View File

@ -96,7 +96,7 @@ var TableHeader = function (_Component) {
_this.drag.oldWidth = parseInt(currentObj.style.width);
_this.drag.minWidth = currentObj.style.minWidth != "" ? parseInt(currentObj.style.minWidth) : defaultWidth;
_this.drag.tableWidth = parseInt(_this.table.table.style.width ? _this.table.table.style.width : _this.table.table.scrollWidth);
console.log(" ----- ", _this.drag);
// console.log(" ----- ",this.drag);
if (!_this.tableOldWidth) {
_this.tableOldWidth = _this.drag.tableWidth; //this.getTableWidth();
// console.log(" this.tableOldWidth--- ",this.tableOldWidth);
@ -156,8 +156,7 @@ var TableHeader = function (_Component) {
var currentCols = _this.table.cols[_this.drag.currIndex];
var diff = event.x - _this.drag.oldLeft;
var newWidth = _this.drag.oldWidth + diff;
_this.drag.newWidth = newWidth;
_this.drag.newWidth = newWidth > 0 ? newWidth : _this.minWidth;
// if(newWidth > this.drag.minWidth){
if (newWidth > _this.minWidth) {
currentCols.style.width = newWidth + 'px';
@ -210,6 +209,8 @@ var TableHeader = function (_Component) {
_this.optTableScroll(_this.table.fixedRightBodyTable, { x: 'auto' });
}
}
} else {
_this.drag.newWidth = _this.minWidth;
}
} else if (_this.props.draggable && _this.drag.option == "draggable") {
// console.log(" --onTrMouseMove--draggable- ",this.drag.option);

View File

@ -73,7 +73,7 @@ function singleSelect(Table, Radio) {
onChange: function onChange(value) {
return _this.onRadioChange(value, record, index);
},
style: { width: '16px', height: '16px', display: 'block', marginLeft: '4px' } },
style: { width: '14px', height: '14px', display: 'block', marginLeft: '4px' } },
_react2["default"].createElement(Radio, { value: index })
);
}
@ -117,8 +117,7 @@ function singleSelect(Table, Radio) {
return _react2["default"].createElement(Table, _extends({}, this.props, {
columns: this.getDefaultColumns(columns),
data: data,
height: 40 }));
data: data }));
};
return SingleSelect;

12
dist/demo.js vendored
View File

@ -37434,7 +37434,7 @@
_this.drag.oldWidth = parseInt(currentObj.style.width);
_this.drag.minWidth = currentObj.style.minWidth != "" ? parseInt(currentObj.style.minWidth) : defaultWidth;
_this.drag.tableWidth = parseInt(_this.table.table.style.width ? _this.table.table.style.width : _this.table.table.scrollWidth);
console.log(" ----- ", _this.drag);
// console.log(" ----- ",this.drag);
if (!_this.tableOldWidth) {
_this.tableOldWidth = _this.drag.tableWidth; //this.getTableWidth();
// console.log(" this.tableOldWidth--- ",this.tableOldWidth);
@ -37494,8 +37494,7 @@
var currentCols = _this.table.cols[_this.drag.currIndex];
var diff = event.x - _this.drag.oldLeft;
var newWidth = _this.drag.oldWidth + diff;
_this.drag.newWidth = newWidth;
_this.drag.newWidth = newWidth > 0 ? newWidth : _this.minWidth;
// if(newWidth > this.drag.minWidth){
if (newWidth > _this.minWidth) {
currentCols.style.width = newWidth + 'px';
@ -37548,6 +37547,8 @@
_this.optTableScroll(_this.table.fixedRightBodyTable, { x: 'auto' });
}
}
} else {
_this.drag.newWidth = _this.minWidth;
}
} else if (_this.props.draggable && _this.drag.option == "draggable") {
// console.log(" --onTrMouseMove--draggable- ",this.drag.option);
@ -268120,7 +268121,7 @@
onChange: function onChange(value) {
return _this.onRadioChange(value, record, index);
},
style: { width: '16px', height: '16px', display: 'block', marginLeft: '4px' } },
style: { width: '14px', height: '14px', display: 'block', marginLeft: '4px' } },
_react2["default"].createElement(Radio, { value: index })
);
}
@ -268164,8 +268165,7 @@
return _react2["default"].createElement(Table, _extends({}, this.props, {
columns: this.getDefaultColumns(columns),
data: data,
height: 40 }));
data: data }));
};
return SingleSelect;

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "bee-table",
"version": "2.1.4-alpha.2",
"version": "2.1.4-alpha.4",
"description": "Table ui component for react",
"keywords": [
"react",

View File

@ -204,7 +204,7 @@ class TableHeader extends Component {
this.drag.oldWidth = parseInt((currentObj).style.width);
this.drag.minWidth = currentObj.style.minWidth != ""?parseInt(currentObj.style.minWidth):defaultWidth;
this.drag.tableWidth = parseInt(this.table.table.style.width ?this.table.table.style.width:this.table.table.scrollWidth);
console.log(" ----- ",this.drag);
// console.log(" ----- ",this.drag);
if(!this.tableOldWidth){
this.tableOldWidth = this.drag.tableWidth;//this.getTableWidth();
// console.log(" this.tableOldWidth--- ",this.tableOldWidth);
@ -262,8 +262,7 @@ class TableHeader extends Component {
let currentCols = this.table.cols[this.drag.currIndex];
let diff = (event.x - this.drag.oldLeft);
let newWidth = this.drag.oldWidth + diff;
this.drag.newWidth = newWidth;
this.drag.newWidth = newWidth > 0 ? newWidth : this.minWidth;
// if(newWidth > this.drag.minWidth){
if(newWidth > this.minWidth){
currentCols.style.width = newWidth +'px';
@ -315,7 +314,9 @@ class TableHeader extends Component {
this.optTableScroll( this.table.fixedRightBodyTable,{x:'auto'});
}
}
}
}else {
this.drag.newWidth = this.minWidth;
}
}else if(this.props.draggable && this.drag.option == "draggable"){
// console.log(" --onTrMouseMove--draggable- ",this.drag.option);
}else{

View File

@ -70,7 +70,7 @@ export default function singleSelect(Table, Radio) {
name="table-radio"
selectedValue={selectedRowIndex}
onChange={value => this.onRadioChange(value, record, index)}
style={{width:'16px', height:'16px', display:'block', marginLeft:'4px'}}>
style={{width:'14px', height:'14px', display:'block', marginLeft:'4px'}}>
<Radio value={index}/>
</Radio.RadioGroup>
}
@ -84,8 +84,7 @@ export default function singleSelect(Table, Radio) {
return <Table
{...this.props}
columns={this.getDefaultColumns(columns)}
data={data}
height={40}/>
data={data} />
}
};
}