File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
client/packages/lowcoder/src/comps/comps/tableComp/column Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ import {
17
17
ConstructorToView ,
18
18
deferAction ,
19
19
fromRecord ,
20
- isDynamicSegment ,
21
20
multiChangeAction ,
22
21
withFunction ,
23
22
wrapChildAction ,
@@ -199,21 +198,23 @@ const ColumnPropertyView = React.memo(({
199
198
selectedColumn . getComp ( ) . children . compType . getView ( ) ,
200
199
[ selectedColumn ]
201
200
) ;
202
-
201
+
202
+ const initialColumns = useMemo ( ( ) =>
203
+ selectedColumn . getParams ( ) ?. initialColumns as OptionType [ ] || [ ] ,
204
+ [ selectedColumn ]
205
+ ) ;
206
+
203
207
const columnValue = useMemo ( ( ) => {
204
208
const column = selectedColumn . getComp ( ) . toJsonValue ( ) ;
205
209
if ( column . comp ?. hasOwnProperty ( 'src' ) ) {
206
210
return ( column . comp as any ) . src ;
207
211
} else if ( column . comp ?. hasOwnProperty ( 'text' ) ) {
208
- return isDynamicSegment ( ( column . comp as any ) . text ) ? '{{currentCell}}' : ( column . comp as any ) . text ;
212
+ const value = ( column . comp as any ) . text ;
213
+ const isDynamicValue = initialColumns . find ( ( column ) => column . value === value ) ;
214
+ return ! isDynamicValue ? '{{currentCell}}' : value ;
209
215
}
210
216
return '{{currentCell}}' ;
211
- } , [ selectedColumn ] ) ;
212
-
213
- const initialColumns = useMemo ( ( ) =>
214
- selectedColumn . getParams ( ) ?. initialColumns as OptionType [ ] || [ ] ,
215
- [ selectedColumn ]
216
- ) ;
217
+ } , [ selectedColumn , initialColumns ] ) ;
217
218
218
219
const summaryColumns = comp . children . summaryColumns . getView ( ) ;
219
220
You can’t perform that action at this time.
0 commit comments