# api_parse_column_excel **Repository Path**: hjhcos/api_parse_column_excel ## Basic Information - **Project Name**: api_parse_column_excel - **Description**: 本项目旨在开发一个Web端接口解析工具,用于将API接口返回的数据结构解析并导出到Excel文件中。该工具主要面向开发人员和测试人员,帮助他们快速理解和记录API接口的数据结构。 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-03-24 - **Last Updated**: 2025-03-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README 帮我写一个工具,用来解析接口的,然后将接口返回的KEY解析到Excel里面。 用户只需要在界面里面输入接口的URL,和数据格式,指定提取的对象,然后后台自动将提取的对象的KEY自动写入到EXCEL文件里面。 技术栈: - vue3 - element-plus 技术要求: - web端 - 接口文档类似与 swagger ui - MVP(最小可行性产品) - 界面简洁,操作简单 - 界面美观,操作流畅 - 界面可以自适应 - 界面可以展示预览的数据, - 界面可以展示提取的key - 界面可以导出excel - 代码扩展性高,耦合性低 - 代码可读性高,可维护性高 - 代码性能高,不会出现性能问题 - 代码可测试性高,可维护性高 界面操作步骤: 1. 用户选择请求方式, 2. 在请求方式旁边用户输入URL:http://172.16.100.106:8088/prod-api/admin/family/list?pageNum=1&pageSize=50, 3. 用户可以在界面的Headers里面可以自定义新增Header 4. 界面有个预览按钮,用户点击预览,将根据请求方式+URL+Headers来开始预览接口的数据,例如预览的接口数据为 ``` { "total": 76, "rows": [ { "id": 157, "lineCode": null, "partCategory": null, "subCategory": null, "afName": "T30_RB40", "afDesc": null, "afExclude": null, "afRelid": "156", "afRelName": "T30(T30)", "afStat": "A", "afJobtype": null, "afSequence": null, "afMesresult": null, "basedOnModules": null, "counterId": null, "shippingCounterId": null, "afPadding": null, "lineId": null, "fgiWorkstationId": null, "fgiSequence": null, "backflushPerWorkOrder": null, "lpsUrl": null, "lpsSpecUrl": null, "requireAllChildFamilies": null, "erpChildFamily": null, "usePlausibility": null, "remark": null }, { "id": 156, "lineCode": null, "partCategory": null, "subCategory": null, "afName": "T30", "afDesc": "T30", "afExclude": null, "afRelid": null, "afRelName": null, "afStat": "A", "afJobtype": null, "afSequence": null, "afMesresult": null, "basedOnModules": null, "counterId": null, "shippingCounterId": null, "afPadding": null, "lineId": null, "fgiWorkstationId": null, "fgiSequence": null, "backflushPerWorkOrder": null, "lpsUrl": null, "lpsSpecUrl": null, "requireAllChildFamilies": null, "erpChildFamily": null, "usePlausibility": null, "remark": null } ], "code": 200, "msg": "查询成功" } ``` 5. 界面可以展示预览的数据, 6. 界面预览有数据以后,用户可以点击解析,解析成可以直观识别的数据,例如上面的数据解析为: ``` { "total": int, "rows": list "id": int, "lineCode": str, "partCategory": str, "subCategory": str, "afName": str, "afDesc": str, "afExclude": str, "afRelid": str, "afRelName": str, "afStat": str, "afJobtype": str, "afSequence": str, "afMesresult": str, "basedOnModules": str, "counterId": str, "shippingCounterId": str, "afPadding": str, "lineId": str, "fgiWorkstationId": str, "fgiSequence": str, "backflushPerWorkOrder": str, "lpsUrl": str, "lpsSpecUrl": str, "requireAllChildFamilies": str, "erpChildFamily": str, "usePlausibility": str, "remark": str "code": int, "msg": str } ``` 7. 界面有个输入提取规则,提取规则如下: - 当值为空的时候,默认提取第一层key即 `total` `rows` `code` `msg` - 当值不为空时,根据提取规则提取,即 提取规则输入:`rows[0]`,那么默认提取指定的key即 `id` `lineCode` `partCategory` `subCategory` ... `remark` 等 8. 界面有个按钮提取,那么就是按照第七条说明的提取规则去提取key 9. 界面可以展示提取的key 10. 导出,将提取的key可以导出为excel,每一个key独占一行数据 ## 效果图 ![image-20250324135247257](image/README/image-20250324135247257.png) ![image-20250324135308508](image/README/image-20250324135308508.png) ![image-20250324135321387](image/README/image-20250324135321387.png) ![image-20250324135348798](image/README/image-20250324135348798.png)