feat:优化执行步骤
This commit is contained in:
@@ -7,8 +7,8 @@ description: 把已有组件换成另一种组件类型,例如"把折线图换
|
||||
|
||||
## 步骤
|
||||
|
||||
1. 用 get_nodes 读取原组件的完整配置
|
||||
2. 用 list_components 选出用户要的新类型,用 get_component_materials 查看它的默认配置
|
||||
1. 同一轮一起调用 get_nodes(读取原组件的完整配置)和 get_component_materials(查看新类型的默认配置),两者互不依赖
|
||||
2. 用户没说清新类型、不确定选哪种时,才用 list_components 查看可用组件
|
||||
3. 在同一批动作里先 delete 原组件,再 add 新组件:
|
||||
- node.id 沿用原组件 ID,layout 沿用原组件的位置和尺寸(用户另有要求除外)
|
||||
- node.type 填新类型
|
||||
|
||||
Reference in New Issue
Block a user