Skip to content

Commit 327ec56

Browse files
authored
Merge pull request #60 from kne-union/linzp
添加context
2 parents d3914a1 + 88efca2 commit 327ec56

5 files changed

Lines changed: 18 additions & 11 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kne/info-page",
3-
"version": "0.1.27",
3+
"version": "0.1.28",
44
"description": "一般用在复杂的详情展示页面,InfoPage提供了一个标准的展示信息的格式",
55
"syntax": {
66
"esmodules": true

src/CentralContent/index.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import boxComputed from './boxComputed';
66
import style from './style.module.scss';
77
import computeColumnsValue from '../computeColumnsValue';
88

9-
const TableView = props => {
10-
const { dataSource, columns, col, valueIsEmpty, emptyIsPlaceholder, placeholder, className } = Object.assign(
9+
const CentralContent = props => {
10+
const { dataSource, columns, col, valueIsEmpty, emptyIsPlaceholder, placeholder, className, context } = Object.assign(
1111
{
1212
dataSource: {}, //数据
1313
columns: [], //列定义
@@ -25,7 +25,8 @@ const TableView = props => {
2525
dataSource,
2626
columns,
2727
valueIsEmpty,
28-
emptyIsPlaceholder
28+
emptyIsPlaceholder,
29+
context
2930
}),
3031
col
3132
);
@@ -54,7 +55,8 @@ const TableView = props => {
5455
<Col className={classnames(style['table-view-content'], 'table-view-content')}>
5556
{computeColumnsValue.computeDisplay({
5657
column: item,
57-
placeholder
58+
placeholder,
59+
context
5860
})}
5961
</Col>
6062
</Row>
@@ -65,4 +67,4 @@ const TableView = props => {
6567
);
6668
};
6769

68-
export default TableView;
70+
export default CentralContent;

src/Flow/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import get from 'lodash/get';
77
import formatView from '../formatView';
88
import { isEmpty } from '@kne/is-empty';
99

10+
//todo: 渲染方法迁移到computeColumnsValue
11+
1012
export const ActionList = ({ name, action, options, content }) => {
1113
return (
1214
<div className={classnames('step-content-wrap', style['step-content-wrap'])}>

src/SplitLine/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@ import computeColumnsValue from '../computeColumnsValue';
55
import classnames from 'classnames';
66
import style from './style.module.scss';
77

8-
const SplitLine = ({ className, dataSource, columns, valueIsEmpty = isEmpty, placeholder = '-', emptyIsPlaceholder = false, size = 0, labelGap = 4, labelMode = 'horizontal', split = <Divider type="vertical" />, ...props }) => {
8+
const SplitLine = ({ className, dataSource, columns, valueIsEmpty = isEmpty, placeholder = '-', emptyIsPlaceholder = false, size = 0, labelGap = 4, labelMode = 'horizontal', split = <Divider type="vertical" />, context, ...props }) => {
99
return (
1010
<Space {...props} split={split} size={size} className={classnames(style['split-line'], 'split-line', className)}>
1111
{computeColumnsValue({
1212
columns,
1313
emptyIsPlaceholder,
1414
valueIsEmpty,
1515
dataSource,
16-
placeholder
16+
placeholder,
17+
context
1718
}).map((item, index) => {
1819
return (
1920
<Flex key={item.key || index} flex={item.flex || 1} className="split-line-item" gap={labelGap} justify="space-between" align="center" vertical={labelMode === 'vertical'}>

src/TableView/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Checkbox, Col, Empty, Row } from 'antd';
44
import { CheckOutlined } from '@ant-design/icons';
55
import classnames from 'classnames';
66
import get from 'lodash/get';
7-
import computeColumnsValue, { computeDisplay, computeColumnsDisplay } from '../computeColumnsValue';
7+
import computeColumnsValue, { computeDisplay } from '../computeColumnsValue';
88
import { isEmpty } from '@kne/is-empty';
99
import style from './style.module.scss';
1010

@@ -69,13 +69,15 @@ const TableView = p => {
6969
isChecked ? selectedRowKeys.splice(rowSelection.selectedRowKeys.indexOf(id), 1) : selectedRowKeys.push(id);
7070
rowSelection.onChange(
7171
selectedRowKeys,
72-
selectedRowKeys.map(id => dataSourceMapRef.current.get(id))
72+
selectedRowKeys.map(id => dataSourceMapRef.current.get(id)),
73+
{ context }
7374
);
7475
} else {
7576
const selectedRowKeys = rowSelection.selectedRowKeys.length && rowSelection.selectedRowKeys[0] === id ? [] : [id];
7677
rowSelection.onChange(
7778
selectedRowKeys,
78-
selectedRowKeys.map(id => dataSourceMapRef.current.get(id))
79+
selectedRowKeys.map(id => dataSourceMapRef.current.get(id)),
80+
{ context }
7981
);
8082
}
8183
}}

0 commit comments

Comments
 (0)