Commit 891e5d3e authored by zhangwenshuai's avatar zhangwenshuai

修改分组时编辑样式

parent 52eb141b
...@@ -125,11 +125,11 @@ ...@@ -125,11 +125,11 @@
} }
.editCell { .editCell {
position: absolute; position: absolute;
z-index: 1;
width: 100%; width: 100%;
height: 100%; height: 40px;
top: 0; z-index: 10;
left: 0; //top: 0;
//left: 0;
} }
.menuPop { .menuPop {
width: 110px; width: 110px;
......
...@@ -236,8 +236,6 @@ const Cell = (props: CellProps) => { ...@@ -236,8 +236,6 @@ const Cell = (props: CellProps) => {
}; };
const transferColumn = transferAttr(columnType, newProps); const transferColumn = transferAttr(columnType, newProps);
const style: any = {};
const { dynamicCellConfigDTO } = columnData || {}; const { dynamicCellConfigDTO } = columnData || {};
// 不可编辑状态(无编辑权限、列只读、行锁定、单元格只读) // 不可编辑状态(无编辑权限、列只读、行锁定、单元格只读)
const disabled = const disabled =
...@@ -284,7 +282,6 @@ const Cell = (props: CellProps) => { ...@@ -284,7 +282,6 @@ const Cell = (props: CellProps) => {
} }
} }
}} }}
style={style}
> >
<div className={s.content}> <div className={s.content}>
{empty ? ( {empty ? (
...@@ -313,13 +310,13 @@ const Cell = (props: CellProps) => { ...@@ -313,13 +310,13 @@ const Cell = (props: CellProps) => {
trigger="contextMenu" trigger="contextMenu"
placement="rightTop" placement="rightTop"
content={ content={
<div role="presentation" className={style.menuContainer}> <div role="presentation" className={s.menuContainer}>
{contentMenu.map((item: any, i: number) => { {contentMenu.map((item: any, i: number) => {
return ( return (
<div <div
key={i} key={i}
role="presentation" role="presentation"
className={style.menu} className={s.menu}
onClick={item.onClick.bind(null, record)} onClick={item.onClick.bind(null, record)}
> >
{item.label} {item.label}
...@@ -352,8 +349,12 @@ const Cell = (props: CellProps) => { ...@@ -352,8 +349,12 @@ const Cell = (props: CellProps) => {
const newProps = { const newProps = {
...(transferColumn || {}), ...(transferColumn || {}),
}; };
const width =
columnIndex === 0 && position !== 'right' && record.groupLevel
? `${cellStyle.width - record.groupLevel * 16 - 50}px`
: cellStyle.width;
return ( return (
<div className={s.editCell}> <div className={s.editCell} style={{ width }}>
<EditComp <EditComp
value={getFormat(editConfig, columnConfig, cellData)} value={getFormat(editConfig, columnConfig, cellData)}
{...newProps} {...newProps}
...@@ -385,7 +386,7 @@ const Cell = (props: CellProps) => { ...@@ -385,7 +386,7 @@ const Cell = (props: CellProps) => {
rowId={record.id} rowId={record.id}
cellRenderProps={cellRenderProps} cellRenderProps={cellRenderProps}
style={{ style={{
minHeight: cellStyle.height, minHeight: 40, //cellStyle.height,
borderRadius: 0, borderRadius: 0,
}} }}
maxPopHeight={maxPopHeight} maxPopHeight={maxPopHeight}
...@@ -396,6 +397,8 @@ const Cell = (props: CellProps) => { ...@@ -396,6 +397,8 @@ const Cell = (props: CellProps) => {
); );
}; };
const groupLevel = getGroupLevel(record.classList); const groupLevel = getGroupLevel(record.classList);
const paddingLeft =
columnIndex === 0 && position !== 'right' && record.groupLevel ? `${record.groupLevel * 16}px` : 0;
return ( return (
<div <div
className={classNames( className={classNames(
...@@ -408,8 +411,7 @@ const Cell = (props: CellProps) => { ...@@ -408,8 +411,7 @@ const Cell = (props: CellProps) => {
)} )}
style={{ style={{
...cellStyle, ...cellStyle,
paddingLeft: paddingLeft,
columnIndex === 0 && position !== 'right' && record.groupLevel ? `${record.groupLevel * 16}px` : 0,
paddingTop: `${groupLevel * 40}px`, paddingTop: `${groupLevel * 40}px`,
}} }}
onMouseEnter={onMouseEnter} onMouseEnter={onMouseEnter}
......
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