Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb31cae1

Browse files
fix status column edited value doesn't persist
1 parentf82d015 commitb31cae1

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

‎client/packages/lowcoder/src/components/table/EditableCell.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function EditableCell<T extends JSONValue>(props: EditableCellProps<T>) {
104104

105105
useEffect(()=>{
106106
setTmpValue(value);
107-
},[value]);
107+
},[JSON.stringify(value)]);
108108

109109
constonChange=useCallback(
110110
(value:T)=>{
@@ -125,11 +125,11 @@ export function EditableCell<T extends JSONValue>(props: EditableCellProps<T>) {
125125
if(!_.isEqual(tmpValue,value)){
126126
onTableEvent?.('columnEdited');
127127
}
128-
},[dispatch,baseValue,tmpValue]);
128+
},[dispatch,JSON.stringify(baseValue),JSON.stringify(tmpValue)]);
129129

130130
consteditView=useMemo(
131131
()=>editViewFn?.({ value, onChange, onChangeEnd})??<></>,
132-
[editViewFn,value,onChange,onChangeEnd]
132+
[editViewFn,JSON.stringify(value),onChange,onChangeEnd]
133133
);
134134

135135
constenterEditFn=useCallback(()=>{

‎client/packages/lowcoder/src/comps/comps/tableComp/tableCompView.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -325,15 +325,6 @@ const TableWrapper = styled.div<{
325325
border-top-right-radius: 0px;
326326
}
327327
}
328-
329-
// hide the bottom border of the last row
330-
${(props)=>
331-
props.$toolbarPosition!=="below"&&
332-
`
333-
tbody > tr:last-child > td {
334-
border-bottom: unset;
335-
}
336-
`}
337328
}
338329
339330
.ant-table-expanded-row-fixed:after {
@@ -948,6 +939,7 @@ export function TableCompView(props: {
948939
return(
949940
<TableSummary
950941
tableSize={size}
942+
istoolbarPositionBelow={toolbar.position==="below"}
951943
expandableRows={Boolean(expansion.expandModalView)}
952944
summaryRows={parseInt(summaryRows)}
953945
columns={columns}

‎client/packages/lowcoder/src/comps/comps/tableComp/tableSummaryComp.tsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,19 @@ import Table from "antd/es/table";
77
import{ReactNode}from"react";
88
importTooltipfrom"antd/es/tooltip";
99

10-
constTableSummaryRow=styled(Table.Summary.Row)`
10+
constTableSummaryRow=styled(Table.Summary.Row)<{
11+
$istoolbarPositionBelow:boolean;
12+
}>`
1113
td:last-child {
1214
border-right: unset !important;
1315
}
16+
17+
${props=>!props.$istoolbarPositionBelow&&`
18+
&:last-child td {
19+
border-bottom: none !important;
20+
}
21+
`}
22+
1423
`;
1524

1625
constTableSummarCell=styled(Table.Summary.Cell)<{
@@ -168,13 +177,15 @@ export function TableSummary(props: {
168177
summaryRows:number;
169178
columns:ColumnComp[];
170179
summaryRowStyle:TableSummaryRowStyleType;
180+
istoolbarPositionBelow:boolean;
171181
}){
172182
const{
173183
columns,
174184
summaryRows,
175185
summaryRowStyle,
176186
tableSize,
177187
expandableRows,
188+
istoolbarPositionBelow,
178189
}=props;
179190
letvisibleColumns=columns.filter(col=>!col.getView().hide);
180191
if(expandableRows){
@@ -186,7 +197,7 @@ export function TableSummary(props: {
186197
return(
187198
<Table.Summary>
188199
{Array.from(Array(summaryRows)).map((_,rowIndex)=>(
189-
<TableSummaryRowkey={rowIndex}>
200+
<TableSummaryRowkey={rowIndex}$istoolbarPositionBelow={istoolbarPositionBelow}>
190201
{visibleColumns.map((column,index)=>{
191202
constsummaryColumn=column.children.summaryColumns.getView()[rowIndex].getView();
192203
return(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp