npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@riil-frontend/component-common-res-list

v1.0.38

Published

intro component

Downloads

46

Readme

通用资源列表

@riil-frontend/component-common-res-list

CHANGE LOG

  • 2022-7-1 权限参数 urlAuth,增加控制资源树权限
  • 2022-11-28 新增customFilterNode属性,用来扩展自定义筛选器
  • 2023-3-20 扩展reqFormat属性,用于动态修改查询资源数据请求体
  • 2023-3-24 扩展ref.getCiTypeProps方法,用于获取资产类型过滤器配置
  • 2023-3-30
    1. 扩展ref.getSelectedRows方法,用于获取选中的表格数据
    2. 扩展ref.service方法,公开内部的service,用于外部单独调用service
  • 2023-6-1 增加showAllType参数

API

| 参数名 | 说明 | 类型 | 默认值 | | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------------------------------------------------ | | request | 数据请求方法,必填 | - | - | | defaultCondition | 默认查询条件 | String | - | | paginationProps | fusion pagination props 透传,如表格使用在抽屉中时需要修改翻页器类型,可使用该值 | Object | - | | tableProps | fusion next table props 透传 | Object | - | | filters | 内置的过滤控件:ciType 表示类型级联选择,keyword 表示搜索 | Array | ['ciType', 'keyword'] | | noConditionIsEmpty | 不传 condition 条件时的行为:true 表示不进行查询结果为空;false 表示查询全部资源 | Boolean | false | | limitTypes | 限制查询的资源类型:内置查询时自带类型范围限制,且级联选择中只展示这些类型 | Array | - | | filterCiRes | 过滤资源类型级联选择 dataSource | Function | - | | checkable | 是否允许勾选 | Boolean | true | | onCheckedChange | 勾选内容变化时回调函数 | Function | (checkedIds) => {} | | checkIsNeedReset | 表格数据刷新时,是否重置勾选项;默认不会重置,可设置为()=>true,则表格刷新后重置勾选项 | Function | () => false | | columnsFormat | 表格列配置转换,以该函数返回值作为表格列配置 | Function | (columns) => columns | | noDataPageProps | 无数据组件参数透传 | Object | { imgSrc: '/noDataImg/tableNotData.svg' } | | innerTreeFilters | 类型选择树默认过滤项,默认过滤项集合:可监控、可发现、有实例化资源,;如果只过滤可监控,传['monitorable']即可,其他情况同理 | Array | ['monitorable', 'discoverable', 'instances'] | | searchFields | 搜索哪些列,默认为显示名称和 IP 地址,传到接口参数的 condition 中,逗号分隔 | String | 'display_name,ipv4_address' | | urlAuth | 使用带权限的 url 查询,为 true 时使用 /mdc/v1/api/cmdb/authority/commonQueryCiData ,/mdc/v1/api/model-asset/authority/tree | Boolean | false | | defaultSelectedRowKeys | 默认选中项 | Array | - | | defaultCiType | 级联选择默认选中项 | - | - | | customFilterNode | 放置在组件过滤器前面的自定义选择器 | ReactNode | - | | reqFormat | 资源查询数据请求转换,以该函数返回值作为请求体配 | Function | (reqConfig) => reqConfig | - | | showAllType | 类型过滤级联选择是否展示“全部类型”,不展示时默认选中第一个可选项 | Boolean | true | - |

ref 公开方法:可以获取到组件内部数据和方法,通过 ref.current 进行调用

| 参数 | 说明 | 类型 | | ------------------ | -------------------------------------------------------------------------------------- | ------------------------------------------- | | formProps | formily props | Object | | tableProps | fusion next table props | Object | | paginationProps | fusion pagination props | Object | | query | 处理过的请求方法,可以在外界刷新 table,默认会带上上一次请求的参数,传入对象会自动合并 | (params?: Object) => Promise<IResponse> | | getParams | 获取请求参数,只会在请求成功才更新 | () => Object | | getSelectedRowKeys | 获取选中行指定的 primaryKey 值 | () => any[] | | getSelectedRows | 获取选中行记录 | () => any[] | | resetAndQuery | 重置请求条件并重新请求 | () => Promise<any> | | getCiTypeProps | 获取资产类型过滤器配置 | () => Object | | service | 内部service方法 | ({ keyword, ciType, current, pageSize, sortBy, sortOrder, condition }) => ({ data: { dataSource: [], total: 0 } }) |