{"id":21432230,"url":"https://github.com/notbucai/tree-excel","last_synced_at":"2025-07-25T02:39:11.612Z","repository":{"id":118216864,"uuid":"364762871","full_name":"notbucai/tree-excel","owner":"notbucai","description":"解析树结构并导出 excel","archived":false,"fork":false,"pushed_at":"2023-08-02T12:44:56.000Z","size":52,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-16T22:37:46.030Z","etag":null,"topics":["data","excel","merge","tree","xlsx"],"latest_commit_sha":null,"homepage":"https://codesandbox.io/s/weathered-haze-e9o8m?file=/index.html","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/notbucai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-06T02:33:59.000Z","updated_at":"2023-08-02T12:45:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"6a2bf0aa-80f9-4983-bdef-6d805edce9d0","html_url":"https://github.com/notbucai/tree-excel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/notbucai/tree-excel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notbucai%2Ftree-excel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notbucai%2Ftree-excel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notbucai%2Ftree-excel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notbucai%2Ftree-excel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/notbucai","download_url":"https://codeload.github.com/notbucai/tree-excel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notbucai%2Ftree-excel/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266945076,"owners_count":24010492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data","excel","merge","tree","xlsx"],"created_at":"2024-11-22T23:17:24.131Z","updated_at":"2025-07-25T02:39:11.596Z","avatar_url":"https://github.com/notbucai.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 树结构 EXCEL 导出\n\n解析`树结构`并导出 excel    \n\n1. 自动计算并合并单元格\n2. 树结构保留\n3. API简洁\n4. 高度内聚\n\n### 依赖\n\n1. FileSaver.js\n2. exceljs\n\n### 数据格式要求\n\n```json\n[\n  {\n    \"value\": \"value 1\",\n    \"list\": [\n      {\n        \"value\": \"value 2\"\n      }\n    ]\n  }\n]\n```\n### 示例\n```javascript\n// 数据\nconst header = ['日期','人员','订单号','菜品','价格'];\nconst data = [\n  {\n    value: \"2021-05-06\",\n    list: [\n      {\n        value: \"不才\",\n        list: [\n          {\n            value: \"O891JHU876HGT\",\n            list: [\n              {\n                value: \"皮蛋\",\n                list:[\n                  {\n                    value: \"¥10\"\n                  }\n                ]\n              },\n              {\n                value: \"红烧肉\",\n                list:[\n                  {\n                    value: \"¥60\"\n                  }\n                ]\n              },\n              {\n                value: \"满汉全席\",\n                list:[\n                  {\n                    value: \"¥6000\"\n                  }\n                ]\n              }\n            ]\n          },\n          {\n            value: \"O89JH5K8234JHT\",\n            list: [\n              {\n                value: \"过桥米线\",\n                list:[\n                  {\n                    value: \"¥20\"\n                  }\n                ]\n              },\n              {\n                value: \"蛋炒饭\",\n                list:[\n                  {\n                    value: \"¥6\"\n                  }\n                ]\n              },\n              {\n                value: \"手抓饭\",\n                list:[\n                  {\n                    value: \"¥9\"\n                  }\n                ]\n              }\n            ]\n          }\n        ]\n      },\n    ]\n  }\n];\n\nExportXlsxByTreeData.exportExcel(header, data);\n\n```\n渲染效果\n\n![./show/show001.png](./show/show001.png)\n\n\n### 如何使用？\n\n详情可参考demo.html\n\n1. down [ExportXlsxByTreeData.js](ExportXlsxByTreeData.js)\n2. 引入依赖\n3. 调用 ExportXlsxByTreeData.exportExcel(header, data);\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotbucai%2Ftree-excel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotbucai%2Ftree-excel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotbucai%2Ftree-excel/lists"}