> 需要屏蔽的按钮(走基础列表钩子扩展)： 导出、个性化设置、快速排序、批量保存（新建）、批量保存（编辑）

## 概述

**之间转换说明（重要）：**

**思想：所有的数据源按钮都走自定义pluginName和pluginFunc，然后执行的时候通过getConfig拿到的buttonConfi. btns中获取events执行**

```javascript
 // 数据源(系统 和 非系统按钮)按钮插件定义，目前所有动作统一的name和fn：
"pluginName": "EbListEventAction",
 "pluginFunc": "onExcuEventAction",

"events" 下的type类型定义：

 // 系统按钮转化后端统一写死自定义事件名称
 "type": "DatasetEventAction",

  // 注意:   事件层面
 "type": "EbListViewLogs",//查看日志
 "type": "EbListReplyComment",//评论和日志
  //编辑字段值
  type:  'EbListEditFieldValue'
  //触发动作流
  type: 'EbListEsb'
  //打开页面 --  后端直接转化   --详细看目录8
  type:"EbListNewPage",
  //确认对话框-- 后端直接转化，后面的事件放child中的events  --详细看目录7
  type:"EbListIF"   
  //扫描上传
  type:'EbScanUpload', 
  //打开企业微信会话
  type:'EbOpenWeComSession',
  //分享消息到当前企业微信会话
  type:'EbShareToWeComSession',
  //javascript代码块  -- 代码块新的直接用页面列表的事件，这块没法转化，只能统一
  type:''
```

## 1、组件的自定义按钮结构

```typescript
      {
        "buttonType": "COMCUSTOM",
        "system": 0,
        "id": "8500843480597610",
        "showPosition": [
            "lineEnd"
        ],
        "actions": [
            [
                {
                    "type": "CLICK",
                    "name": "单击",
                    "id": "b5150f2d362448ad9fc016006ccf39c9",
                    "disableDelete": true,
                    "events": [
                        {
                            "id": "a87f43fa6ac9415abe9ebcc6542cc45c",
                            "type": "NewPage",
                            "linkInfo": {
                                "page": {
                                    "pageId": "0/920867862097199106",
                                    "pageName": "显示布局(ljc1018子表)",
                                    "pageType": "LAYOUT",
                                    "parentId": "Form_920867862097199106",
                                    "openMode": "0",
                                    "appid": "787963620946870272",
                                    "pageViewType": "0"
                                },
                                "openMode": "0",
                                "params": [  ],
                                "name": "显示布局(ljc1018子表)"
                            }
                        }
                    ],
                    "actionDesc": "布局: 显示布局(ljc1018子表)"
                },
                 {
                    "id": "f72303c7ab804b7093735967fd37d980",
                    "type": "RefreshComp",
                    "refreshInfo": {
                        "selectedCom": [
                            "c8bb88ae5a0940769298903a5438cd56"
                        ],
                        "filterIsNull": true,
                        "isOverrideFilter": false,
                        "dataset": {
                            "id": "920867862097199106",
                            "text": "ljc1018子表",
                            "type": "LOGIC",
                            "groupId": "weaver-ebuilder-form-service",
                            "isPhysical": true,
                            "usage": "all",
                            "appId": "787963620946870272",
                            "hasChangeGroupFilter": false,
                            "hasChangePermissions": false
                        }
                    }
                }
            ]
        ],
        "permissions": [],
        "groupBtns": [],
        "name": {
            "nameAlias": "行上-组件"
        },
        "onlyIcon": 0,
        "enable": 1,
        "operateType": "1",
        "conditionEnable": 0,
        "showOrder": 1703480647183,
        "isSingle": true
    }
```

## 2、【导入】按钮转化后数据结构

配置数据

```
 {
    "id": "920867866266337344",
    "name": "导入",
    "objId": "920867862097199106",
    "buttonKey": "tableImp",
    "system": 1,
    "buttonType": "DATASET",
    "showPosition": [
        "rightTop"
    ],
    "btnPositionData": [
        "rightTop",
        "rightTopDropDown",
        "rightTopBatch"
    ],
    "enable": 1,
    "showOrder": 1025,
    "scope": "PC",
    "permissionType": "DATASET_PERMISSION",
    "customParams": {
        "buttonKey": "tableImp",
        "buttonType": "TABLE",
        "objId": "920867862097199106",
        "system": 1
    },
    "isSingle": true
}
```

运行数据

> 运行时转化事件events,配置无

```
 {
    "id": "920867866266337344",
    "name": "导入",
    "objId": "920867862097199106",
    "buttonKey": "tableImp",
    "system": 1,
    "buttonType": "DATASET",
    "showPosition": [
        "rightTop"
    ],
    "btnPositionData": [
        "rightTop",
        "rightTopDropDown",
        "rightTopBatch"
    ],
    "enable": 1,
    "showOrder": 1025,
    "scope": "PC",
    "permissionType": "DATASET_PERMISSION",
    "customParams": {
        "buttonKey": "tableImp",
        "buttonType": "TABLE",
        "objId": "920867862097199106",
        "system": 1
    },
    "isSingle": true,
     "actions": [
            [
                {
                    "type": "CLICK",  //固定
                    "name": "单击",  //随便，可不给
                    "id": "b5150f2d362448ad9fc016006ccf39c9",// uuid:32位
                    "disableDelete": true,  //不可删除
                    "events": [
                        {
                            "id": "a87f43fa6ac9415abe9ebcc6542cc45c",// uuid:32位
                            // 系统按钮转化后端统一写死
                            "type": "DatasetEventAction",
                            // 系统按钮的自定义信息加这里一下
                            "customParams": {
                                "buttonKey": "tableImp",
                                "buttonType": "TABLE",
                                "objId": "920867862097199106",
                                "system": 1
                            },
                           // "linkInfo": {
                           //     "page": {},
                           //     "openMode": "0",
                           //     "params": [],
                           //     "name": ""
                           // }
                        }
                    ],
                    "actionDesc": "布局: 显示布局(ljc1018子表)" //动作标题
                },
                {
                    .....其他动作
                }
            ]
        ],
```

## 3、新建

```typescript
 {
    "id": "920867866266337314",
    "name": "新建",
    "objId": "920867862097199106",
    "buttonKey": "tableAdd",
    "system": 1,
    "buttonType": "DATASET",
    "showPosition": [
        "rightTop"
    ],
    "btnPositionData": [
        "rightTop",
        "rightTopDropDown",
        "rightTopBatch"
    ],
    "enable": 0,
    "showOrder": 1010,
    "scope": "PC",
    "permissionType": "DATASET_PERMISSION",
    "customParams": {
        "buttonKey": "tableAdd",
        "buttonType": "TABLE",
        "objId": "920867862097199106",
        "system": 1
    },
    "pluginName": "EbListEventAction",
    "pluginFunc": "onExcuEventAction",
    "isSingle": true,
    "actions": [
            [
                {
                    "type": "CLICK",  //固定
                    "name": "单击",  //随便，可不给
                    "id": "b5150f2d362448ad9fc016006ccf39c9",// uuid:32位
                    "disableDelete": true,  //不可删除
                    "events": [
                        {
                            "id": "a87f43fa6ac9415abe9ebcc6542cc45c",// uuid:32位
                            // 系统按钮转化后端统一写死
                            "type": "DatasetEventAction",
                            // 系统按钮的自定义信息加这里一下
                            "customParams": {
                                "buttonKey": "tableImp",
                                "buttonType": "TABLE",
                                "objId": "920867862097199106",
                                "system": 1
                            },
                            "linkInfo": {
                                isNew：true,//兼容历史数据，给true
                                isRelationCustomPage:false,//不知道干啥的，给false
                                "openMode": "0",
                                "params": [],
                                "name": ""
                                "page": {
                                    appid:"",
                                    openMode:"0",
                                    pageId:"1/982555645665",
                                    pageName:"",
                                    pageType:"LAYOUT",
                                    pageViewType:"",//不知道干啥的，待沟通，给空吧
                                  parentId:""//parentId是选链接的时候，如果是个子集，需要把id给拼一下，我们给空
                                    
                                },
                               
                            }
                        }
                    ],
                    "actionDesc": "布局: 显示布局(ljc1018子表)" //动作标题
                }
            ]
        ],
}
```

## 4、编辑、复制、删除

```
[{
	"actions": [{
		"actionType": "system",
		"buttonId": 920867866266337304,
		"confirmContent": "",
		"confirmFalse": "",
		"confirmTitle": "",
		"confirmTrue": "",
		"datarule": "",
		"deleteType": 0,
		"desc": "",
		"enable": 1,
		"executeSelectedDatas": 0,
		"id": 920867866266337305,
		"idStr": "920867866266337305",
		"name": "编辑",
		"openType": "1",
		"showOrder": 0,
		"url": "",
		"windowSize": 60.0
	}],
}, {
	"actions": [{
		"actionType": "system",
		"buttonId": 920867866266337306,
		"confirmContent": "",
		"confirmFalse": "",
		"confirmTitle": "",
		"confirmTrue": "",
		"datarule": "",
		"deleteType": 0,
		"desc": "",
		"enable": 1,
		"executeSelectedDatas": 0,
		"id": 920867866266337307,
		"idStr": "920867866266337307",
		"name": "复制",
		"openType": "0",
		"showOrder": 0,
		"url": "",
		"windowSize": 60.0
	}],
}, {
	"actions": [{
		"actionType": "system",
		"buttonId": 920867866266337310,
		"confirmContent": "",
		"confirmFalse": "",
		"confirmTitle": "",
		"confirmTrue": "",
		"dataSource": "1",
		"datarule": "",
		"deleteType": 0,
		"desc": "",
		"enable": 1,
		"executeSelectedDatas": 0,
		"id": 920867866266337311,
		"idStr": "920867866266337311",
		"name": "删除",
		"openType": "0",
		"showOrder": 0,
		"url": "",
		"windowSize": 60.0
	}],
}]
```

转化：

```
编辑：  "actions": [
                                        [
                                            {
                                                "name": "单击",
                                                "id": "a2c9047f64484bd58c634f9d326273ee",
                                                "type": "CLICK",
                                                "disableDelete": true,
                                                "events": [
                                                    {
                                                        "id": "b3ac33cc82254ffa8f364d1a530a78fe",
                                                         // 系统按钮转化后端统一写死
                            "type": "DatasetEventAction",
                            // 系统按钮的自定义信息加这里一下
                            "customParams": {
                                "buttonKey": "tableImp",
                                "buttonType": "TABLE",
                                "objId": "920867862097199106",
                                "system": 1
                            },
                                                        "linkInfo": {
                                                            "openMode": "1",
                                                            "name": "显示布局(ljc0308物理)",
                                                            "page": {
                                                                "pageViewType": "0",
                                                                "pageType": "LAYOUT",
                                                                "openMode": "0",
                                                                "appid": "787963620946870272",
                                                                "pageId": "0/973531638504792065",
                                                                "pageName": "显示布局(ljc0308物理)",
                                                                "parentId": "Form_973531638504792065"
                                                            },
                                                            "isNew": true,
                                                            "params": [
                                                                {
                                                                    "name": "id",
                                                                    "type": "FORMFIELDS",
                                                                    "value": {
                                                                        "id": "5",
                                                                        "type": "id",
                                                                        "content": "数据ID"
                                                                    }
                                                                }
                                                            ],
                                                            "isRelationCustomPage": false,
                                                            "isBlankClose": false
                                                        },
                                                    }
                                                ],
                                                "actionDesc": "布局: 显示布局(ljc0308物理)"
                                            }
                                        ]
                                    ]
复制：  历史写死了侧滑打开，前端暂时写死

删除：   标准数据源按钮，暂时没有争议
```

## 4、自定义按钮

```
 "actions": [
                                    [
                                        {
                                            "type": "CLICK",
                                            "name": "单击",
                                            "id": "ca81791383c84f44895b53552bed105b",
                                            "disableDelete": true,
                                            "events": [
                                                {
                                                    "id": "ea0d6dbacb3b4a2f83a815b911e335d1",
                                                    "type": "NewPage",
                                                    "linkInfo": {
                                                        "name": "",
                                                        "page": {
                                                            "pageType": "LINK",
                                                            "pageId": "http://www.baidu.com",
                                                            "pageName": "http://www.baidu.com"
                                                        },
                                                        "openMode": "0",
                                                        "isRelationCustomPage": false,
                                                        "params": [],
                                                        "isNew": true
                                                    }
                                                }
                                            ],
                                            "actionDesc": "自定义: http://www.baidu.com"
                                        }
                                    ]
                                ],
```

## 5、批量新增、编辑

```typescript

```

## 6、评论和日志

```javascript
查看日志：
 "actions": [
            [
                {
                    "type": "CLICK",  //固定
                    "name": "单击",  //随便，可不给
                    "id": "b5150f2d362448ad9fc016006ccf39c9",// uuid:32位
                    "disableDelete": true,  //不可删除
                    "events": [
                        {
                            "id": "a87f43fa6ac9415abe9ebcc6542cc45c",// uuid:32位
                            // 重点
                            "type": "ViewLogs",
                            // 系统按钮的自定义信息加这里一下
                            "customParams": {
                               
                            },
                        }
                    ],
                    "actionDesc": "" //动作标题
                }
            ]
        ]

评论和日志：
 "actions": [
            [
                {
                    "type": "CLICK",  //固定
                    "name": "单击",  //随便，可不给
                    "id": "b5150f2d362448ad9fc016006ccf39c9",// uuid:32位
                    "disableDelete": true,  //不可删除
                    "events": [
                        {
                            "id": "a87f43fa6ac9415abe9ebcc6542cc45c",// uuid:32位
                            // 重点
                            "type": "ReplyComment",
                            // 系统按钮的自定义信息加这里一下
                            "customParams": {
                               
                            },
                        }
                    ],
                    "actionDesc": "" //动作标题
                }
            ]
        ]
```

## 7、确认对话框

> eb表单的确认对话框只有if，  页面if， else ，故eb的转化后续事件都放在if中即可，  demo如下：

```javascript
[
                            [
                                {
                                    "name": "单击每一条数据",
                                    "id": "a2e0e1dc9cc74f4cbadd3dbbaaac0f5b",
                                    "type": "CLICKDATA",
                                    "disableDelete": false,
                                    "events": [
                                        {
                                            "conditionData": {
                                                "conditionsText": "",
                                                "cancelBtnText": "否",
                                                "conditionType": "Dialog",
                                                "conditionTitle": "确认",
                                                "confirmBtnText": "是",
                                                "conditionContent": ""
                                            },
                                            "id": "ab60196c3df349cfbb9c025d671c02ee",
                                            "type": "IF",
                                            "events": [
                                                {
                                                    "linkInfo": {
                                                        "openMode": "0",
                                                        "name": "页面ljc",
                                                        "page": {
                                                            "pageType": "PAGE",
                                                            "openMode": "4",
                                                            "appid": "787963620946870272",
                                                            "terminalScopes": "PC,MOBILE",
                                                            "pageId": "792909292982403072",
                                                            "pageName": "页面ljc",
                                                            "parentId": "pages"
                                                        },
                                                        "isNew": true,
                                                        "params": [],
                                                        "isRelationCustomPage": false
                                                    },
                                                    "id": "ccd7f0c596404d2785737f01a65cefc5",
                                                    "type": "NewPage"
                                                }
                                            ]
                                        },
                                        {
                                            "id": "c61848e2208344a29c15bfc4fa5a7d91",
                                            "type": "ELSE",
                                            "events": [
                                                {
                                                    "linkInfo": {
                                                        "openMode": "5",
                                                        "name": "网格",
                                                        "page": {
                                                            "pageType": "PAGE",
                                                            "openMode": "4",
                                                            "appid": "787963620946870272",
                                                            "terminalScopes": "PC,MOBILE",
                                                            "pageId": "798736103179550721",
                                                            "pageName": "网格",
                                                            "parentId": "pages"
                                                        },
                                                        "isNew": true,
                                                        "params": [],
                                                        "isRelationCustomPage": false
                                                    },
                                                    "id": "a6067499470a4ac3b69f95018de871fe",
                                                    "type": "NewPage"
                                                }
                                            ]
                                        }
                                    ],
                                    "actionDesc": "页面: 页面ljc"
                                }
                            ]
                        ]
```

## 8、打开页面

```javascript
"actions": [
                                        [
                                            {
                                                "name": "单击",
                                                "id": "b0606cb02ef04a068599e78f33739a97",
                                                "type": "CLICK",
                                                "disableDelete": true,
                                                "events": [
                                                    {
                                                        "linkInfo": {
                                                            "modalWidth": "900px",
                                                            "modalHeight": "200px",
                                                            "openMode": "5",
                                                            "name": "显示布局(ljc0308物理)",
                                                            "page": {
                                                                "pageViewType": "0",
                                                                "pageType": "LAYOUT",
                                                                "openMode": "0",
                                                                "appid": "787963620946870272",
                                                                "pageId": "0/973531638504792065",
                                                                "pageName": "显示布局(ljc0308物理)",
                                                                "parentId": "Form_973531638504792065"
                                                            },
                                                            "isNew": true,
                                                            "params": [
                                                                {
                                                                    "name": "id",
                                                                    "type": "FORMFIELDS",
                                                                    "value": {
                                                                        "id": "5",
                                                                        "type": "id",
                                                                        "content": "数据ID"
                                                                    }
                                                                }
                                                            ],
                                                            "isRelationCustomPage": false,
                                                            "isBlankClose": false
                                                        },
                                                        "id": "d05441c670b1401aa9892f8577122ea0",
                                                        "type": "NewPage"
                                                    }
                                                ],
                                                "actionDesc": "布局: 显示布局(ljc0308物理)"
                                            }
                                        ]
                                    ]
```
