use-block-interfaces

更新时间:
复制 MD 格式

This topic describes how to configure the data, event, and action interfaces in a block by using the Blueprint Editor in the block editor to Data Transmission Service the inside and outside of the block.

Background information

Configure the block interface in the block editor and use the sample interface based on the block requirements defined in Block Sample Description.

Configuring the Use Block Interface in the Block Editor

  1. Create a block. For more information, see Create a blank block.

  2. Click the newly created blank block to enter the block editor.

  3. In the block editor, add the carousel list, ECharts polar area chart, and vertical capsule histogram components.

  4. Right-click the widgets and select Export to Blueprint Editor.

  5. Click the 数据接口设置图标icon in the upper-right corner of the block editor. On the Data Interface Settings tab, configure the data interface style as shown in the following figure. For more information about how to configure data interfaces in a block, see Configure data interfaces.

  6. Click the 事件接口图标icon in the upper-right corner of the block editor. On the Event Settings tab, configure the event style as shown in the following figure. For more information about how to configure an event interface in a block, see Configure an event interface.

  7. Click the 动作图标icon in the upper-right corner of the block editor. On the Action Settings tab, configure the action style as shown in the following figure. For more information about how to configure actions in a block, see Actions.

  8. After you configure the interfaces of the block, click the 蓝图编辑器入口icon in the upper-left corner of the block editor to go to the Blueprint Editor page.

  9. Drag the three block interfaces from Blueprint Editor to the canvas of Blueprint Editor. You can see that each block interface corresponds to the content defined in the preceding steps.

  10. You can use the method of connecting nodes in Blueprint Editor to connect block interface nodes with corresponding component nodes to configure the required business logic. The following figure shows the business logic of the current block sample requirement. For more information about how to configure a blueprint connection, see Features.

    完成蓝图连线

Configure the use block interface in Canvas Editor

  1. In the block editor, you can preview and test the content of each interface in the block after you configure the interaction between the interface content and the blueprint logic in the block. After the interface content is tested, you can publish the sample block. For more information, see Preview a block and Publish a block.

  2. Switch to the console page. You can click a dashboard and click Edit to open the canvas editor.

  3. Click the Component Library tab and select Block. You can view all published blocks in the block list.

  4. Click the required sample block to add the block to Canvas Editor.

  5. Click a block in the canvas. In the right-side configuration panel, click the Data Source tab. On the Data Source tab, you can view all configurations of the data interfaces in the block.

  6. Click the Advanced tab. On the Advanced tab, you can view all the configurations of the API operations in the block.

  7. On the canvas, right-click the target block and select Export to Blueprint.

  8. Click the image icon in the upper-left corner of Canvas Editor to go to Blueprint Editor.

  9. Drag the sample block node to the canvas of Blueprint Editor to view information about all events and action interfaces in the block. The event actions in the blueprint of a block can be called by other widgets in the blueprint editor by connecting lines and configuring logical nodes. For more information, see Features.