{"id":16962016,"url":"https://github.com/wangdahoo/antd-easy-listview","last_synced_at":"2025-07-02T09:04:07.467Z","repository":{"id":42855491,"uuid":"260745468","full_name":"wangdahoo/antd-easy-listview","owner":"wangdahoo","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-06T04:50:01.000Z","size":7084,"stargazers_count":0,"open_issues_count":10,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-12T18:49:33.217Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/wangdahoo.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}},"created_at":"2020-05-02T18:04:34.000Z","updated_at":"2020-11-20T14:26:22.000Z","dependencies_parsed_at":"2023-02-05T08:45:33.143Z","dependency_job_id":null,"html_url":"https://github.com/wangdahoo/antd-easy-listview","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wangdahoo/antd-easy-listview","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangdahoo%2Fantd-easy-listview","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangdahoo%2Fantd-easy-listview/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangdahoo%2Fantd-easy-listview/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangdahoo%2Fantd-easy-listview/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wangdahoo","download_url":"https://codeload.github.com/wangdahoo/antd-easy-listview/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangdahoo%2Fantd-easy-listview/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263108767,"owners_count":23415002,"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","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":[],"created_at":"2024-10-13T23:04:58.444Z","updated_at":"2025-07-02T09:04:07.443Z","avatar_url":"https://github.com/wangdahoo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# antd-easy-listview\n\n\u003e Easy ListView based on Ant Design\n\n## Usage\n\n```tsx\nimport '@wangdahoo/antd-easy-form/dist/index.css'\nimport { FormItemType } from '@wangdahoo/antd-easy-form'\nimport '@wangdahoo/antd-easy-listview/dist/index.css'\nimport { createListView, ListViewOptions, SelectFilter } from '@wangdahoo/antd-easy-listview'\nimport { getAllUsers, createUser, updateUser, deleteUsers, batchDeleteUsers, User } from './api'\nimport { Button, message } from 'antd'\n\nconst createFormItems = (props: any) =\u003e [\n    {\n        name: 'name',\n        labelText: '姓名',\n        itemType: FormItemType.INPUT,\n        required: true,\n        defaultValue: ''\n    },\n    {\n        name: 'gender',\n        labelText: '性别',\n        itemType: FormItemType.RADIO,\n        options: [\n            {\n                value: 1,\n                text: '男'\n            },\n            {\n                value: 0,\n                text: '女'\n            }\n        ],\n        defaultValue: 1,\n        buttonStyle: 'solid'\n    },\n    {\n        name: 'age',\n        labelText: '年龄',\n        itemType: FormItemType.NUMBER,\n        min: 1,\n        max: 200,\n        step: 0.1,\n        unit: '岁',\n        defaultValue: 18\n    },\n    {\n        name: 'city',\n        labelText: '城市',\n        itemType: FormItemType.SELECT,\n        options: [\n            {\n                value: '上海',\n                text: '上海'\n            },\n            {\n                value: '北京',\n                text: '北京'\n            },\n        ],\n        defaultValue: '上海'\n    }\n]\n\nconst tableColumns = [\n    {\n        title: '#',\n        key: '#',\n        dataIndex: 'index',\n        width: 50,\n        align: 'center'\n    },\n    {\n        title: '姓名',\n        dataIndex: 'name',\n        key: 'name',\n        width: 100\n    },\n    {\n        title: '性别',\n        dataIndex: 'gender',\n        key: 'gender',\n        render: (value: number) =\u003e {\n            return value === 1 ? '男' : '女'\n        },\n        width: 100,\n        align: 'center'\n    },\n    {\n        title: '年龄',\n        dataIndex: 'age',\n        key: 'age',\n        render: (age: number) =\u003e `${age}岁`,\n        width: 100,\n        align: 'center'\n    },\n    {\n        title: '城市',\n        dataIndex: 'city',\n        key: 'city',\n        width: 100,\n        align: 'center'\n    },\n    {\n        key: 'dummy'\n    }\n]\n\nconst options = {\n    itemName: '人员',\n    createFormItems,\n    updateFormItems: (record: User, props: any) =\u003e {\n        return [\n            {\n                name: 'id',\n                labelText: '人员 id',\n                itemType: FormItemType.INPUT,\n                required: true,\n                defaultValue: record.id,\n                hidden: true\n            },\n\n            ...createFormItems(props).map(item =\u003e ({\n                ...item,\n                ...(record[item.name] ? {\n                    defaultValue: record[item.name]\n                } : {})\n            }))\n        ]\n    },\n    tableWrapper: 'none' as 'card'|'none',\n    tableColumns,\n    filters: [\n        'name',\n        {\n            name: 'gender',\n            options: [\n                {\n                    value: 1,\n                    text: '男'\n                },\n                {\n                    value: 0,\n                    text: '女'\n                }\n            ],\n            labelText: '性别：',\n            selectStyle: {\n                width: 60\n            }\n        },\n        {\n            name: 'city',\n            options: [\n                {\n                    value: '',\n                    text: '请选择'\n                },\n            ],\n            getOptions: function () {\n                return new Promise((resolve, reject) =\u003e {\n                    setTimeout(() =\u003e resolve([\n                        {\n                            value: '',\n                            text: '请选择'\n                        },\n                        {\n                            value: '上海',\n                            text: '上海'\n                        },\n                        {\n                            value: '北京',\n                            text: '北京'\n                        }\n                    ]), 500)\n                })\n            },\n            labelText: '城市：',\n            selectStyle: {\n                width: 100\n            }\n        },\n    ] as (string | SelectFilter)[],\n    fetchItems: getAllUsers,\n    createItem: createUser,\n    updateItem: updateUser,\n    deleteItem: deleteUsers,\n    batchDeleteEnabled: true,\n    batchDeleteItems: batchDeleteUsers,\n    exportEnabled: true,\n    exportItems: console.log\n} as Partial\u003cListViewOptions\u003cUser\u003e\u003e\n\nexport default createListView(options)\n```\n\n## ListViewOptions Reference\n\n[here](https://github.com/wangdahoo/antd-easy-listview/blob/master/src/types.ts)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangdahoo%2Fantd-easy-listview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwangdahoo%2Fantd-easy-listview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangdahoo%2Fantd-easy-listview/lists"}