---
title: 组件
order: 4
---

### Topology


| 参数 | 说明 | 类型   | 默认值 |
| ---- | ---- | ------ | ------ |
| topo |  拓扑模型实例    | `Topo` |        |
| titleBar     |  工具栏    |  `ReactNode\|false`      |        |
| editorProps     |  编辑器参数    |  `EditorProps`      |        |
| onRefresh     |   刷新回调   |  `function`      |        |
| onSave     |  保存回调    |  `function`      |        |
| onRemoveElements     |  删除元素回调    |  `function`      |        |
| onConnect     |  called when user connects two nodes    |  `function({ source, target })`      |        |
| onConnectStart     |   called when user starts to drag connection line   |  `function(event, { nodeId, handleType })`      |        |
| onConnectStop     |   called when user stops to drag connection line   |  `function(event)`      |        |
| onConnectEnd     |    called after user stops or connects nodes  |  `function(event)`      |        |
| onLoad     |      |  `function(topoInstance)`      |        |
| onSelectionChange     |    called when user selects one or multiple elements  |  `function(elements)`      |        |

##### EditorProps

```
  const editorProps = {
    layerSelectResource: {
      ciTypes: [], // 类型过滤
      getTableData: async (params) => {
        const {
          current = 1,
          pageSize = 20,
          sortBy = 'displayName',
          sortOrder = 'asc',
          like,
          typeCode,
        } = params;
        // 从拓扑图查询已有资源列表
        // TODO 查询数据
        return {
            success: true,
            data: {
              dataSource: [],
              total: 100,
              current: 1,
              pageSize,
            }
        }
      },
      onOk: async (selected) => {
        // 查询、合并数据、全量更新拓扑图数据

      }
    }
  };
```

### SearchWidget


| 参数 | 说明 | 类型   | 默认值 |
| ---- | ---- | ------ | ------ |
| type |      | string |        |
|      |      |        |        |
|      |      |        |        |
