Commit be4f22ef authored by zhangwenshuai's avatar zhangwenshuai

修改展开逻辑

parent cf013df5
...@@ -27,6 +27,7 @@ const Cell = (props: CellProps) => { ...@@ -27,6 +27,7 @@ const Cell = (props: CellProps) => {
rowIndex, rowIndex,
paginationConfig, paginationConfig,
showIndex, showIndex,
showExpand,
emptyPlaceholder, emptyPlaceholder,
cellEditable, cellEditable,
rowSelection, rowSelection,
...@@ -45,7 +46,6 @@ const Cell = (props: CellProps) => { ...@@ -45,7 +46,6 @@ const Cell = (props: CellProps) => {
renderEditCell, renderEditCell,
cellRenderProps, cellRenderProps,
readOnlyFlag, readOnlyFlag,
showExpand,
} = columnConfig; } = columnConfig;
const [status, setStatus] = useState('detail'); const [status, setStatus] = useState('detail');
...@@ -174,9 +174,9 @@ const Cell = (props: CellProps) => { ...@@ -174,9 +174,9 @@ const Cell = (props: CellProps) => {
} }
onClick={() => { onClick={() => {
// 不可编辑状态 // 不可编辑状态
// if (!cellEditable || readOnlyFlag || (dynamicCellConfigDTO && dynamicCellConfigDTO.readonlyFlag)) { if (!cellEditable || readOnlyFlag || (dynamicCellConfigDTO && dynamicCellConfigDTO.readonlyFlag)) {
// return false; return false;
// } }
if (selectedCell === `${position}_${cellKey}`) { if (selectedCell === `${position}_${cellKey}`) {
setStatus('edit'); setStatus('edit');
} else { } else {
......
...@@ -340,6 +340,7 @@ export default class AirTable extends Component<TableProps, TableState> { ...@@ -340,6 +340,7 @@ export default class AirTable extends Component<TableProps, TableState> {
emitChangeCell, emitChangeCell,
paginationConfig, paginationConfig,
showIndex, showIndex,
showExpand,
emptyPlaceholder, emptyPlaceholder,
cellEditable, cellEditable,
rowSelection, rowSelection,
...@@ -402,6 +403,7 @@ export default class AirTable extends Component<TableProps, TableState> { ...@@ -402,6 +403,7 @@ export default class AirTable extends Component<TableProps, TableState> {
columns={columns} columns={columns}
paginationConfig={paginationConfig} paginationConfig={paginationConfig}
showIndex={position === 'right' ? false : showIndex} showIndex={position === 'right' ? false : showIndex}
showExpand={showExpand}
emptyPlaceholder={emptyPlaceholder} emptyPlaceholder={emptyPlaceholder}
cellEditable={cellEditable} cellEditable={cellEditable}
rowSelection={position === 'right' ? false : rowSelection} rowSelection={position === 'right' ? false : rowSelection}
......
...@@ -67,6 +67,7 @@ class AirTable extends React.Component<CommonProps, CommonState> { ...@@ -67,6 +67,7 @@ class AirTable extends React.Component<CommonProps, CommonState> {
operateConfig, operateConfig,
paginationConfig, paginationConfig,
showIndex, showIndex,
showExpand,
emptyPlaceholder, emptyPlaceholder,
cellEditable, cellEditable,
rowHeight, rowHeight,
...@@ -108,6 +109,7 @@ class AirTable extends React.Component<CommonProps, CommonState> { ...@@ -108,6 +109,7 @@ class AirTable extends React.Component<CommonProps, CommonState> {
sortConfig={sortConfig} sortConfig={sortConfig}
paginationConfig={paginationConfig} paginationConfig={paginationConfig}
showIndex={showIndex} showIndex={showIndex}
showExpand={showExpand}
emptyPlaceholder={emptyPlaceholder} emptyPlaceholder={emptyPlaceholder}
cellEditable={cellEditable} cellEditable={cellEditable}
rowHeight={rowHeight} rowHeight={rowHeight}
......
...@@ -62,6 +62,7 @@ export interface TableProps extends LoadConfigProps { ...@@ -62,6 +62,7 @@ export interface TableProps extends LoadConfigProps {
sortConfig?: any; sortConfig?: any;
paginationConfig?: any; paginationConfig?: any;
showIndex?: boolean; showIndex?: boolean;
showExpand?: Function;
emptyPlaceholder?: string; emptyPlaceholder?: string;
cellEditable?: boolean; cellEditable?: boolean;
rowHeight?: number; rowHeight?: number;
...@@ -116,6 +117,7 @@ export interface CellProps { ...@@ -116,6 +117,7 @@ export interface CellProps {
hasFixed?: boolean; hasFixed?: boolean;
paginationConfig?: any; paginationConfig?: any;
showIndex?: boolean; showIndex?: boolean;
showExpand?: Function;
emptyPlaceholder?: string; emptyPlaceholder?: string;
cellEditable?: boolean; cellEditable?: boolean;
rowSelection?: any; rowSelection?: any;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment