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-condition-res-list

v2.0.21

Published

intro component

Downloads

137

Readme

条件资源列表(包含动态匹配、手动添加)

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

CHANGE LOG

  • 2023-7-27
  1. 修复 table 容器外使用 flex 布局高度被撑起的问题
  • 2023-7-18
  1. 添加 hideDelete 属性,支持可以在手动添加模式时隐藏批量删除按钮、操作列、checkbox
  • 2023-7-11
  1. 移除内置传给 ResAdvancedSearch 组件的属性:domainIsOptional={true}
  • 2023-6-13
  1. 扩展 rowDeleteBallonProps,允许重写删除组件的属性
  • 2023-6-1
  1. 扩展 fixAddProps.commonResListProps,详见@riil-frontend/component-common-res-list
  • 2023-5-9
  1. 扩展 fixAddProps.conditionFormat,详见 api 与 demo
  • 2023-3-30
  1. 扩展 ruleAddProps 与 fixAddProps,详见 api
  • 2023-3-24
  1. 原 filters 属性,扩展 ciType 支持资产类型组件过滤
  • 2023-3-23
  1. 版本改造:【卡慢问题专项】修改动态固定资源查询逻辑,废弃前端分页,表格拆分
  • 2022-3-7
  1. 支持是否需要权限参数 urlAuth
  • 2022-3-4
  1. 内置及联选择浮层单列宽度为 153
  • 2022-1-20
  1. 添加属性 defaultSort
  2. 清空条件按钮调整,挪到 footer 中,单击后直接关闭抽屉
  • 2021-12-10
  1. 标题默认为“资源列表” -> 空
  2. 添加属性 buttonProps,可修改按钮显隐,文本等
  3. 添加属性 drawerProps
  4. 添加属性 filterCiRes,可定制资源类型范围
  5. 支持(资源名称、IP 地址、资源类型)排序
  6. 打开动态匹配抽屉时,默认不显示匹配结果列表,点击查看匹配结果按钮后才显示
  7. 动态匹配抽屉滚动方式修改为整体滚动
  8. 表格数据刷新后不清空勾选项
  9. defaultRuleCondition 可不传递,不传时组件内部根据 defaultRuleValues 自动转化
  • 2022-7-1
  1. 权限参数 urlAuth,增加控制资源树权限
  2. 升级 @riil-frontend/component-common-res-list 组件为 V1.0.23

API

| 参数名 | 说明 | 类型 | 默认值 | | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | ------------------------------------------------------- | | request | 数据请求方法,必填 | - | - | | title | 表格左上方标题 | String/ReactNode | - | | defaultRuleCondition | 默认动态查询条件 | String | - | | defaultRuleValues | 默认动态查询条件对应的规则树的值 | Array | - | | defaultFixResIds | 默认手动资源 id 集合 | Array | - | | onChange | 动态条件或手动添加的资源变更时的回调 | ({ ruleCondition, ruleValues, fixResIds })=>{} | - | | defaultSort | 表格列默认排序方式,如果期望默认按名称排,传{ ['attributes.display_name']: 'asc'} | Object | [name]: 'desc' / 'asc' | | columnsFormat | 表格列配置转换,以该函数返回值作为表格列配置 | Function | (columns) => columns | | filterCiRes | 过滤资源类型函数,可同时限定动态条件和手动添加可选的资源类型 | Function | - | | fixAddExcludeIds | 添加固定资源时,额外排除的资源 id 集合 | Array | - | | noDataPageProps | 无数据组件参数透传 | Object | { imgSrc: '/noDataImg/tableNotData.svg' } | | resAdvancedSearchProps | 资源树高级搜索组件参数透传 | Object | { domainIsOptional:true, disabledFirstSelect:false } | | commonResListProps | 手动添加按钮打开的通用列表组件属性透传 | Object | - | | filters | 内置的过滤控件:keyword 表示搜索;ciType 表示资产类型过滤 | Array | ['keyword'] | | buttonProps | [动态匹配按钮属性透传,手动添加按钮属性透传],每个对象可额外设置 visible 表示隐藏按钮;label 表示按钮文本,如[{visible:false},{label:'手动触发',text:true}] | Array<Object> | true | | drawerProps | [动态匹配抽屉属性透传,手动添加抽屉透传],分别透传抽屉对象,如[{width:500},{width:500}] | Array<Object> | - | | paginationProps | 主列表翻页器属性透传,fusion pagination props | Object | - | | ruleAddProps | 动态添加 { footerNode: ReactNode, onOkValidate: () => true/false, onCancleCb: () => void } props | Object | - | | fixAddProps | 手动添加 { onOkValidate: () => true/false, conditionFormat: (values) => values.result 详见 demo, commonResListProps,详见下层组件} props | Object | - | | extraLimitCondition | 额外的限制条件,以&&的方式拼接到【动态抽屉】【手动抽屉】condition 中进行查询,动态抽屉【确定】按钮回调的 condition 中会拼接这个条件 | String | - | | urlAuth | 使用带权限的 url 查询,为 true 时使用/mdc/v1/api/cmdb/authority/commonQueryCiData ,/mdc/v1/api/model-asset/authority/tree , | Boolean | false | | roleId | 角色 ID | String | - | | isRoleIdCondition | 是否打开角色条件 | Boolean | false | | authOperation | 排除某类权限的资产,readroles(读权限),writeroles(写权限),deleteroles(删除权限) | array | ["readroles"] | | rowDeleteBallonProps | 重写删除按钮使用的 RowDeleteBallon 组件属性,详见物料库的 RowDeleteBallon 组件 | func | - | | hideDelete | 手动添加模式时隐藏批量删除按钮、操作列、checkbox | bool | false |

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[] | | resetAndQuery | 重置请求条件并重新请求 | () => Promise<any> | | getAllDataSource | 获取全量的表格数据 | () => any[] | | service | 内部 service 方法,mode 必填,fix 代表查固定资源;rule 代表查动态资源 | ({ mode, keyword, ciType, pageIndex, pageSize, condition }) => ({ data: { dataSource: [], total: 0 } }) |