修改导出语法规范
This commit is contained in:
parent
d4c15e2d2f
commit
26085cc3f8
|
@ -8,7 +8,7 @@ import Checkbox from "bee-checkbox";
|
||||||
* getSelectedDataFunc--function,能获取到选中的数据
|
* getSelectedDataFunc--function,能获取到选中的数据
|
||||||
* 使用全选时得注意,data中的key值一定要是唯一值
|
* 使用全选时得注意,data中的key值一定要是唯一值
|
||||||
*/
|
*/
|
||||||
module.exports = function multiSelect(Table) {
|
export default function multiSelect(Table) {
|
||||||
Array.prototype.indexOf = function(val) {
|
Array.prototype.indexOf = function(val) {
|
||||||
for (var i = 0; i < this.length; i++) {
|
for (var i = 0; i < this.length; i++) {
|
||||||
if (this[i] == val) return i;
|
if (this[i] == val) return i;
|
||||||
|
@ -90,7 +90,7 @@ module.exports = function multiSelect(Table) {
|
||||||
checkedObj: checkedObj,
|
checkedObj: checkedObj,
|
||||||
selIds: selIds
|
selIds: selIds
|
||||||
});
|
});
|
||||||
if(typeof getSelectedDataFunc === 'function'){
|
if (typeof getSelectedDataFunc === "function") {
|
||||||
getSelectedDataFunc(selIds);
|
getSelectedDataFunc(selIds);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -150,4 +150,4 @@ module.exports = function multiSelect(Table) {
|
||||||
return <Table {...this.props} columns={columns} />;
|
return <Table {...this.props} columns={columns} />;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
|
@ -62,18 +62,18 @@ export default function sort(Table) {
|
||||||
sortButton = (
|
sortButton = (
|
||||||
<div className={`${prefixCls}-column-sorter`}>
|
<div className={`${prefixCls}-column-sorter`}>
|
||||||
<span
|
<span
|
||||||
className={`${prefixCls}-column-sorter-up ${isAscend
|
className={`${prefixCls}-column-sorter-up ${
|
||||||
? "on"
|
isAscend ? "on" : "off"
|
||||||
: "off"}`}
|
}`}
|
||||||
title="↑"
|
title="↑"
|
||||||
onClick={() => this.toggleSortOrder("ascend", column)}
|
onClick={() => this.toggleSortOrder("ascend", column)}
|
||||||
>
|
>
|
||||||
<Icon type="uf-triangle-up" />
|
<Icon type="uf-triangle-up" />
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
className={`${prefixCls}-column-sorter-down ${isDescend
|
className={`${prefixCls}-column-sorter-down ${
|
||||||
? "on"
|
isDescend ? "on" : "off"
|
||||||
: "off"}`}
|
}`}
|
||||||
title="↓"
|
title="↓"
|
||||||
onClick={() => this.toggleSortOrder("descend", column)}
|
onClick={() => this.toggleSortOrder("descend", column)}
|
||||||
>
|
>
|
||||||
|
|
|
@ -8,7 +8,7 @@ let columns2 = {
|
||||||
dataIndex: "showSum"
|
dataIndex: "showSum"
|
||||||
};
|
};
|
||||||
|
|
||||||
let sum = Table => {
|
export default function sum(Table){
|
||||||
return class SumTable extends React.Component {
|
return class SumTable extends React.Component {
|
||||||
//无状态
|
//无状态
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
@ -17,7 +17,7 @@ let sum = Table => {
|
||||||
//合计数字列,并将计算所得数据存储到一个obj对象中
|
//合计数字列,并将计算所得数据存储到一个obj对象中
|
||||||
currentFooter = () => {
|
currentFooter = () => {
|
||||||
let data_2 = this.props.data;
|
let data_2 = this.props.data;
|
||||||
let columns_sum = (this.props.columns).concat();
|
let columns_sum = this.props.columns.concat();
|
||||||
let sumCol_index;
|
let sumCol_index;
|
||||||
//用一个对象存储合计数据,这里合计对象的属性对应每列字段
|
//用一个对象存储合计数据,这里合计对象的属性对应每列字段
|
||||||
for (let i = 0; i < columns_sum.length; i++) {
|
for (let i = 0; i < columns_sum.length; i++) {
|
||||||
|
@ -66,5 +66,3 @@ let sum = Table => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export default sum;
|
|
||||||
|
|
Loading…
Reference in New Issue