Commit 61ac71e7 authored by XieZhiXiong's avatar XieZhiXiong

fix: 修复默认不展开的问题

parent 232a718a
......@@ -128,6 +128,8 @@ const OrderMaterialsDrawer: React.ForwardRefRenderFunction<OrderMaterialsDrawerR
const [checkedKeysState, setCheckedKeysState] = useState([]);
const [halfCheckedState, setHalfCheckedState] = useState([]);
const [expandedRowKeys, setExpandedRowKeys] = useState([]);
const polymericRef = useRef<NormalTableRefHandleType | null>(null);
const keyEntities = useRef<any>({});
......@@ -192,6 +194,7 @@ const OrderMaterialsDrawer: React.ForwardRefRenderFunction<OrderMaterialsDrawerR
...keyEntities.current,
...convertDataToEntities(dataSource).keyEntities,
};
setExpandedRowKeys(dataSource.map((item) => item.key));
return {
data: dataSource,
totalCount: res.data.totalCount,
......@@ -453,7 +456,7 @@ const OrderMaterialsDrawer: React.ForwardRefRenderFunction<OrderMaterialsDrawerR
)
),
childrenColumnName: 'xx', // 默认是 children,与 dataSource数据中 冲突,随便改了名称,否则不能正常展开
defaultExpandAllRows: true, // 无效,我giao
expandedRowKeys,
} : undefined}
searchFormProps={{
schema: querySchema,
......@@ -475,7 +478,6 @@ const OrderMaterialsDrawer: React.ForwardRefRenderFunction<OrderMaterialsDrawerR
),
}}
beforePaginationChange={handleBeforePaginationChange}
defaultExpandAllRows
full
/>
</Drawer>
......
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