publish 1.3.2
This commit is contained in:
parent
fd24f05025
commit
62df601fbd
|
@ -55,8 +55,8 @@ function newMultiSelect(Table, Checkbox) {
|
||||||
var selectList = [];
|
var selectList = [];
|
||||||
var check = checkedAll ? false : true;
|
var check = checkedAll ? false : true;
|
||||||
data.forEach(function (item) {
|
data.forEach(function (item) {
|
||||||
item.checked = check;
|
item._checked = check;
|
||||||
if (item.checked) {
|
if (item._checked) {
|
||||||
selectList.push(item);
|
selectList.push(item);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -73,11 +73,11 @@ function newMultiSelect(Table, Checkbox) {
|
||||||
var data = _this.state.data;
|
var data = _this.state.data;
|
||||||
|
|
||||||
var selectList = [];
|
var selectList = [];
|
||||||
record.checked = record.checked ? false : true;
|
record._checked = record._checked ? false : true;
|
||||||
var checkedAll = true;
|
var checkedAll = true;
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
var item = data[i];
|
var item = data[i];
|
||||||
if (!item.checked || item.checked == false) {
|
if (!item._checked || item._checked == false) {
|
||||||
checkedAll = false;
|
checkedAll = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ function newMultiSelect(Table, Checkbox) {
|
||||||
checkedAll: checkedAll
|
checkedAll: checkedAll
|
||||||
}));
|
}));
|
||||||
data.forEach(function (da) {
|
data.forEach(function (da) {
|
||||||
if (da.checked) {
|
if (da._checked) {
|
||||||
selectList.push(da);
|
selectList.push(da);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -110,13 +110,17 @@ function newMultiSelect(Table, Checkbox) {
|
||||||
fixed: "left",
|
fixed: "left",
|
||||||
width: 50,
|
width: 50,
|
||||||
render: function render(text, record, index) {
|
render: function render(text, record, index) {
|
||||||
return _react2["default"].createElement(Checkbox, {
|
var attr = {};
|
||||||
|
console.log("record._disabled---", record._disabled);
|
||||||
|
record._disabled ? attr.disabled = record._disabled : "";
|
||||||
|
return _react2["default"].createElement(Checkbox, _extends({
|
||||||
key: index,
|
key: index,
|
||||||
className: 'table-checkbox',
|
className: 'table-checkbox'
|
||||||
checked: record.checked,
|
}, attr, {
|
||||||
|
checked: record._checked,
|
||||||
onClick: _this.handleClick,
|
onClick: _this.handleClick,
|
||||||
onChange: _this.onCheckboxChange(text, record, index)
|
onChange: _this.onCheckboxChange(text, record, index)
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
}];
|
}];
|
||||||
return _defaultColumns.concat(columns);
|
return _defaultColumns.concat(columns);
|
||||||
|
|
|
@ -28,4 +28,7 @@
|
||||||
.u-table-filter-column-filter-icon{
|
.u-table-filter-column-filter-icon{
|
||||||
right: 15px;
|
right: 15px;
|
||||||
}
|
}
|
||||||
|
.u-table-scroll .u-table-header{
|
||||||
|
margin-right: 15px;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -124,6 +124,7 @@ const dataList = [
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
index: 2,
|
index: 2,
|
||||||
|
_checked:true,
|
||||||
orderCode:"222",
|
orderCode:"222",
|
||||||
supplierName: "22xxx",
|
supplierName: "22xxx",
|
||||||
type_name: "1223",
|
type_name: "1223",
|
||||||
|
@ -140,6 +141,7 @@ const dataList = [
|
||||||
index: 3,
|
index: 3,
|
||||||
orderCode:"222",
|
orderCode:"222",
|
||||||
supplierName: "22xxx",
|
supplierName: "22xxx",
|
||||||
|
_disabled:true,
|
||||||
type_name: "1223",
|
type_name: "1223",
|
||||||
purchasing:'内行2',
|
purchasing:'内行2',
|
||||||
purchasingGroup:"3223",
|
purchasingGroup:"3223",
|
||||||
|
@ -190,6 +192,10 @@ class Demo25 extends Component {
|
||||||
return (sum);
|
return (sum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
selectedRow=(record, index)=>{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let columns = getCloumns();
|
let columns = getCloumns();
|
||||||
|
|
||||||
|
@ -202,6 +208,7 @@ class Demo25 extends Component {
|
||||||
draggable={true}
|
draggable={true}
|
||||||
multiSelect={{type: "checkbox"}}
|
multiSelect={{type: "checkbox"}}
|
||||||
scroll={{x:"130%", y: 100}}
|
scroll={{x:"130%", y: 100}}
|
||||||
|
selectedRow={this.selectedRow}
|
||||||
// scroll={{x:this.getCloumnsScroll(columns), y: 150}}
|
// scroll={{x:this.getCloumnsScroll(columns), y: 150}}
|
||||||
/></div>
|
/></div>
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -9698,5 +9698,7 @@ li.rc-time-picker-panel-select-option-disabled:hover {
|
||||||
height: 100%; }
|
height: 100%; }
|
||||||
.demo25 .u-table-filter-column-filter-icon {
|
.demo25 .u-table-filter-column-filter-icon {
|
||||||
right: 15px; }
|
right: 15px; }
|
||||||
|
.demo25 .u-table-scroll .u-table-header {
|
||||||
|
margin-right: 15px; }
|
||||||
|
|
||||||
/*# sourceMappingURL=demo.css.map */
|
/*# sourceMappingURL=demo.css.map */
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "bee-table",
|
"name": "bee-table",
|
||||||
"version": "1.3.1",
|
"version": "1.3.2",
|
||||||
"description": "Table ui component for react",
|
"description": "Table ui component for react",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"react",
|
"react",
|
||||||
|
|
|
@ -43,8 +43,8 @@ export default function newMultiSelect(Table, Checkbox) {
|
||||||
let selectList = [];
|
let selectList = [];
|
||||||
let check = checkedAll?false:true;
|
let check = checkedAll?false:true;
|
||||||
data.forEach(item => {
|
data.forEach(item => {
|
||||||
item.checked = check;
|
item._checked = check;
|
||||||
if(item.checked){
|
if(item._checked){
|
||||||
selectList.push(item);
|
selectList.push(item);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -61,11 +61,11 @@ export default function newMultiSelect(Table, Checkbox) {
|
||||||
onCheckboxChange = (text, record, index) => () => {
|
onCheckboxChange = (text, record, index) => () => {
|
||||||
let {data} = this.state;
|
let {data} = this.state;
|
||||||
let selectList = [];
|
let selectList = [];
|
||||||
record.checked = record.checked?false:true;
|
record._checked = record._checked?false:true;
|
||||||
let checkedAll = true;
|
let checkedAll = true;
|
||||||
for(let i=0;i<data.length;i++){
|
for(let i=0;i<data.length;i++){
|
||||||
let item = data[i];
|
let item = data[i];
|
||||||
if(!item.checked || item.checked == false){
|
if(!item._checked || item._checked == false){
|
||||||
checkedAll = false;
|
checkedAll = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ export default function newMultiSelect(Table, Checkbox) {
|
||||||
checkedAll
|
checkedAll
|
||||||
})
|
})
|
||||||
data.forEach((da)=>{
|
data.forEach((da)=>{
|
||||||
if(da.checked){
|
if(da._checked){
|
||||||
selectList.push(da);
|
selectList.push(da);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -101,10 +101,14 @@ export default function newMultiSelect(Table, Checkbox) {
|
||||||
fixed:"left",
|
fixed:"left",
|
||||||
width: 50,
|
width: 50,
|
||||||
render: (text, record, index) => {
|
render: (text, record, index) => {
|
||||||
|
let attr = {};
|
||||||
|
console.log("record._disabled---",record._disabled)
|
||||||
|
record._disabled?attr.disabled = record._disabled:"";
|
||||||
return <Checkbox
|
return <Checkbox
|
||||||
key={index}
|
key={index}
|
||||||
className="table-checkbox"
|
className="table-checkbox"
|
||||||
checked={record.checked}
|
{...attr}
|
||||||
|
checked={record._checked}
|
||||||
onClick={this.handleClick}
|
onClick={this.handleClick}
|
||||||
onChange={this.onCheckboxChange(text, record, index)}
|
onChange={this.onCheckboxChange(text, record, index)}
|
||||||
></Checkbox>
|
></Checkbox>
|
||||||
|
|
Loading…
Reference in New Issue