{"id":42897973,"url":"https://github.com/guozhaolong/antd-etable","last_synced_at":"2026-01-30T15:16:14.202Z","repository":{"id":45830419,"uuid":"206307241","full_name":"guozhaolong/antd-etable","owner":"guozhaolong","description":"Editable Table base on Ant Design","archived":false,"fork":false,"pushed_at":"2022-08-21T07:32:39.000Z","size":2672,"stargazers_count":48,"open_issues_count":1,"forks_count":22,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T01:32:28.387Z","etag":null,"topics":["ant-design","antd","editable","table"],"latest_commit_sha":null,"homepage":"https://guozhaolong.github.io/antd-etable/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guozhaolong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-04T11:51:02.000Z","updated_at":"2025-01-26T07:11:18.000Z","dependencies_parsed_at":"2022-09-05T22:41:25.952Z","dependency_job_id":null,"html_url":"https://github.com/guozhaolong/antd-etable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/guozhaolong/antd-etable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guozhaolong%2Fantd-etable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guozhaolong%2Fantd-etable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guozhaolong%2Fantd-etable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guozhaolong%2Fantd-etable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guozhaolong","download_url":"https://codeload.github.com/guozhaolong/antd-etable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guozhaolong%2Fantd-etable/sbom","scorecard":{"id":449712,"data":{"date":"2025-08-11","repo":{"name":"github.com/guozhaolong/antd-etable","commit":"0deaa25b5b2caf5ae3e1de0481bd0f7227f8589e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}}]},"last_synced_at":"2025-08-19T07:53:05.505Z","repository_id":45830419,"created_at":"2025-08-19T07:53:05.505Z","updated_at":"2025-08-19T07:53:05.505Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28914901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T12:13:43.263Z","status":"ssl_error","status_checked_at":"2026-01-30T12:13:22.389Z","response_time":66,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["ant-design","antd","editable","table"],"created_at":"2026-01-30T15:16:13.104Z","updated_at":"2026-01-30T15:16:14.196Z","avatar_url":"https://github.com/guozhaolong.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Ant Design Editable Table\n\n[![NPM Version](http://img.shields.io/npm/v/antd-etable.svg?style=flat)](https://www.npmjs.org/package/antd-etable)\n[![NPM Downloads](https://img.shields.io/npm/dm/antd-etable.svg?style=flat)](https://www.npmjs.org/package/antd-etable)\n![](https://img.shields.io/badge/license-MIT-000000.svg)\n\n![image](https://github.com/guozhaolong/antd-etable/raw/master/example/snapshots/1.jpg)\n\n## Online Demo\nhttps://guozhaolong.github.io/antd-etable/\n\n## Usage\n```\nimport React, {useContext, useState} from \"react\";\nimport EditableTable from 'antd-etable';\nimport {Button} from 'antd';\nimport styles from './index.css';\n\nconst data = [\n  {id:1,name:'测试1',title:'哈哈',status:0,desc:'描述1描述1描述1描述1',type:0,created_time:'2019-5-2'},\n  {id:2,name:'测试2',title:'呵呵',status:1,desc:'描述2描述2描述2描述2',type:1,created_time:'2019-5-3'},\n  {id:3,name:'测试3',title:'嘻嘻',status:2,desc:'描述3描述3描述3描述3',type:0,created_time:'2019-5-4'}\n];\nconst type = ['类型一','类型二'];\nconst status = ['正常','异常','停止'];\nconst cols = [\n  {\n    title: '名称',\n    dataIndex: 'name',\n    editable:true,\n    editor: {\n      required: true,\n    },\n  },\n  {\n    title: '类型',\n    dataIndex: 'type',\n    editable:true,\n    editor: {\n      type: 'select',\n      options: [\n        {key: 1, value: '类型一'},\n        {key: 2, value: '类型二'},\n      ]\n    },\n    render: (text, record) =\u003e (\n      type[text]\n    ),\n  },\n  {\n    title: '日期',\n    dataIndex: 'created_time',\n    editable:true,\n    editor: {\n      type: 'datetime'\n    }\n  },\n];\nconst allCols = [\n  ...cols.slice(0,2),\n  {\n    title: '标题',\n    dataIndex: 'title',\n    editable:true,\n    width: 120,\n  },\n  ...cols.slice(2),\n  {\n    title: '状态',\n    dataIndex: 'status',\n    editable:true,\n    width: 120,\n    editor: {\n      type: 'select',\n      options: status.map((value,key) =\u003e ({key,value}))\n    },\n    render: (text, record) =\u003e (\n      status[text]\n    ),\n  }\n];\nexport default function() {\n  const [changedData,setChangedData] = useState([]);\n  const fetch = (pager,filter,sorter) =\u003e {\n    // Do Remote Fetch\n  };\n  return (\n    \u003cdiv className={styles.root}\u003e\n      \u003cdiv style={{textAlign:'right',marginBottom:16}}\u003e\u003cButton type=\"primary\"\u003e保存\u003c/Button\u003e\u003c/div\u003e\n      \u003cEditableTable\n        title=\"\"\n        loading={false}\n        data={data}\n        changedData={changedData}\n        pageSize={10}\n        total={100}\n        cols={cols}\n        allCols={allCols}\n        onFetch={()=\u003efetch()}\n        onChangedDataUpdate={(d)=\u003e{setChangedData(d)}}\n      /\u003e\n    \u003c/div\u003e\n  );\n}\n\n```\n## API\n##### EditableTable\n###### 属性\n| 名称 | 描述 | 类型 | 默认值 |\n|:---|:---|:---:|:---:|\n| data | 初始化数据 | Array | [ ] |\n| [changedData](#changeddata) | 用于保存增删改的更新数据 | Array | [ ] |\n| [cols](#cols) | 表格列 | Array | [ ] |\n| allCols | 可显示表格列（格式同cols属性） | Array | [ ] |\n| [rowKey](#rowkey) | 唯一标识 | String | 'id' |\n| newRowKeyPrefix | 新增数据唯一标识的前缀 | String | 'new_' |\n| title | 标题 | String或Component | '' |\n| loading | 读取状态 | Boolean | false |\n| pageSize | 每页记录数 | Number | 10 |\n| total | 记录总数 | Number | 0 |\n| multiSelect | 可多选 | Boolean | false |\n| showHeader | 是否显示顶栏 | Boolean | true |\n| showFooter | 是否显示底栏 | Boolean | true |\n| showToolbar | 是否显示顶部工具栏 | Boolean | true |\n| showSelector | 是否显示选择按钮 | Boolean | false |\n| showAddBtn | 是否显示添加按钮 | Boolean | true |\n| showOpBtn | 是否显示编辑和删除按钮 | Boolean | true |\n| showTopPager | 是否显示顶部分页器 | Boolean | true |\n| showBottomPager | 是否显示底部分页器 | Boolean | false |\n| buttons | 自定义操作按钮组 | Component | 无 |\n| style | 样式 | Object | null |\n| expandedRowRender | 展开行时的渲染内容 | ReactNode | null |\n| expandedFirstRow | 默认展开第一行 | Boolean | false |\n| editOnSelected | 点击一行时编辑 | Boolean | false |\n| parentForm | 传入form | FormInstance | null |\n\n###### 事件\n| 名称 | 描述 | 参数 | 返回值 |\n|:---|:---|:---:|:---:|\n| canEdit | 每行是否可编辑 | record | Boolean |\n| canRemove | 每行是否可删除 | record | Boolean |\n| beforeEdit | 编辑数据前触发 | 无 | 无 |\n| afterEdit | 编辑数据后触发 | 无 | 无 |\n| [onAdd](#onadd) | 新增数据的默认对象 | 无 | Object |\n| onFetch | 请求数据事件 | pager,filter,sorter | 无 |\n| [onChangedDataUpdate](#onchangeddataupdate) | 更新数据变化时触发 | arr | 无 |\n| [onSelectRow](#onselectrow) | 每页记录数 | rows | 无 |\n| [onDownload](#ondownload) | 每页记录数 | filter,sorter | 无 |\n| onExpandedRow | 展开一行时触发 | record | 无 |\n\n###### 方法\n| 名称 | 描述 | 参数 | 返回值 |\n|:---|:---|:---:|:---:|\n| resetTable | 重置表格页码 | 无 | 无 |\n\n## Config\n##### changedData\n###### 数组，用于保存变更后的数据，每条数据中会使用isNew、isUpdate、isDelete来标识该数据是新增、更新还是删除\n\n##### cols\n###### 参数例子\n```\n[{\n   title: 'ID',\n   dataIndex: 'id',\n   editable:false,\n},{\n   title: '名称',\n   dataIndex: 'name',\n   sorter: true,\n   editable:true,\n   editor: {\n     required: true,\n     type: 'select',\n     options: [\n       {key: 1, value: '类型一'},\n       {key: 2, value: '类型二'},\n     ],\n     validator: (rule,value,callback) =\u003e {\n       if(data.find(d =\u003e d.name === value))\n         callback('名称已存在!');\n       else\n         callback();\n     },\n   },\n}]\n```\n###### editable：设置可编辑状态\n###### editor：对象默认类型为text，支持的类型包括select、number、datetime、checkbox，如果为select需传入options参数\n\n##### rowKey\n###### 数据的唯一标识，必须唯一，用于判断编辑状态和匹配数据\n\n##### onAdd\n###### 当点击新增时，可配置初始化数据的方法用于返回一个新数据对象，可用来设置一些默认值\n\n##### onChangedDataUpdate\n###### 每次新增、更新、删除都会触发该方法，并传入更新后的数组\n\n##### onSelectRow\n###### 该方法会传入一个已选对象的数组，如果为单选模式，该数组只包含当前点击行的对象\n\n##### onDownload\n###### 点击工具栏下载时触发，如果配置了方法，则该方法会接到filter和sorter两个参数，如果没有配置方法则默认生成当页的excel下载\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguozhaolong%2Fantd-etable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguozhaolong%2Fantd-etable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguozhaolong%2Fantd-etable/lists"}