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 {
1717 ConstructorToView ,
1818 deferAction ,
1919 fromRecord ,
20- isDynamicSegment ,
2120 multiChangeAction ,
2221 withFunction ,
2322 wrapChildAction ,
@@ -199,21 +198,23 @@ const ColumnPropertyView = React.memo(({
199198 selectedColumn . getComp ( ) . children . compType . getView ( ) ,
200199 [ selectedColumn ]
201200 ) ;
202-
201+
202+ const initialColumns = useMemo ( ( ) =>
203+ selectedColumn . getParams ( ) ?. initialColumns as OptionType [ ] || [ ] ,
204+ [ selectedColumn ]
205+ ) ;
206+
203207 const columnValue = useMemo ( ( ) => {
204208 const column = selectedColumn . getComp ( ) . toJsonValue ( ) ;
205209 if ( column . comp ?. hasOwnProperty ( 'src' ) ) {
206210 return ( column . comp as any ) . src ;
207211 } 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 ;
209215 }
210216 return '{{currentCell}}' ;
211- } , [ selectedColumn ] ) ;
212-
213- const initialColumns = useMemo ( ( ) =>
214- selectedColumn . getParams ( ) ?. initialColumns as OptionType [ ] || [ ] ,
215- [ selectedColumn ]
216- ) ;
217+ } , [ selectedColumn , initialColumns ] ) ;
217218
218219 const summaryColumns = comp . children . summaryColumns . getView ( ) ;
219220
You can’t perform that action at this time.
0 commit comments