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

Commit0af140d

Browse files
fix status column edited value doesn't persist
1 parent7396f8e commit0af140d

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
@@ -326,15 +326,6 @@ const TableWrapper = styled.div<{
326326
border-top-right-radius: 0px;
327327
}
328328
}
329-
330-
// hide the bottom border of the last row
331-
${(props)=>
332-
props.$toolbarPosition!=="below"&&
333-
`
334-
tbody > tr:last-child > td {
335-
border-bottom: unset;
336-
}
337-
`}
338329
}
339330
340331
.ant-table-expanded-row-fixed:after {
@@ -951,6 +942,7 @@ export function TableCompView(props: {
951942
return(
952943
<TableSummary
953944
tableSize={size}
945+
istoolbarPositionBelow={toolbar.position==="below"}
954946
expandableRows={Boolean(expansion.expandModalView)}
955947
summaryRows={parseInt(summaryRows)}
956948
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