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

@yizhou-library/organization-cascader

v0.0.4

Published

护理管理组织架构筛选(分全院和按权限)

Downloads

1

Readme

(本组件开发,基于 frontend-ui-startkit 脚手架)

dependencies 为发布依赖包集合

:::dependencies { "dependencies": { "antd": "~3.26.13", "classnames": "^2.2.6" }, "devDependencies": {} } :::dependencies

@ewell/OrganizationCascader

@ewell/OrganizationCascader 护理管理组织架构筛选,有多选、单选、排班定制(单选)三个模式

代码演示

:::护理管理组织架构筛选演示代码块。

import { Multiple, Single } from "@ewell/OrganizationCascader";

const loadData = () => {
  return new Promise(async (resolve) => {
    const { status, object: data } = await request({
      url:
        "http://server-sit.317hu.com/api/nurse-staff-web/nurseUnit/read/queryUnitTreeNode/privilege",
      options: {
        method: "GET",
      },
    });
    if (status === 1) {
      resolve({
        data: data.children || [],
      });
    } else {
      resolve({ data: [] });
    }
  });
};

return (
  <>
    <Multiple
      style={{ width: 200 }}
      type="filter"
      filterContent="大科"
      load={loadData}
    />
    <Single
      style={{ width: 200 }}
      load={this.loadData}
      // defaultActiveFirstOption={true}
      defaultValue={"915bca0503e34d6f8e7311e123bfdf1a"}
    />
    <Single
      style={{ width: 200 }}
      load={loadData}
      type="scheduleCustom"
      value={this.state.scheduleCustom}
      onChange={({ id }) => {
        const list = [...this.state.scheduleCustom];
        list.push(id);
        this.setState({
          scheduleCustom: list,
        });
      }}
    />
  </>
);

:::

API

共同的 API

以下 API 为 Single,Multiple 共享的 API

| 参数 | 说明 | 类型 | 默认值 | 版本 | | --------------------- | ----------------------------------------------- | --------------------- | ------ | ---- | | dataSource | 数据源 | Data[] | 无 | | | disabled | 禁用 | boolean | false | | | allowClear | 是否支持清除 | boolean | false | | | column | 展示几列 | number | 3 | | | disabledEmptyChildren | 没有子级的是否需要 disabled,跟 column 搭配使用 | boolean | true | | | expandTrigger | 次级菜单的展开方式,可选 'click' 和 'hover' | string | hover | | | hideOnSingleBranch | 组织架构只有一个院区时是否隐藏院区显示 | boolean | false | | | load | 获取数据源的方法,返回 promise | () => any | 无 | | | onChange | 选择完成后的回调 | (value) => void | 无 | |

Single

| 参数 | 说明 | 类型 | 默认值 | 版本 | | ------------------------ | ------------------------------------------------ | ----------------- | ------ | ----- | | defaultValue | 默认选中的项 | string | 无 | | | value | 指定选中项,type 为 scheduleCustom 传入数组 | string / string[] | 无 | | | type | 定制化展示,可选 'scheduleCustom' | string | 无 | | | defaultActiveFirstOption | 是否默认选中第一个选项 | boolean | false | | | changeOnSelect | 当此项为 true 时,点选每级菜单选项值都会发生变化 | boolean | false | | | showLastOption | 是否只显示选中的最后一项 | boolean | true | | | showCheckAll | 是否在起始增加一项全院 | boolean | false | 0.0.2 | | checkAllContent | 增加的全院的文字 | string | 全院 | 0.0.2 |

Multiple

| 参数 | 说明 | 类型 | 默认值 | 版本 | | ------------- | ---------------------------------------- | -------------------------- | ------ | ---- | | defaultValue | 默认选中的项 | Values[] | 无 | | | value | 指定选中项 | Values[] | 无 | | | fixedHeight | 是否固定高度,一行显示,并且没有搜索功能 | boolean | false | | | type | 定制化展示,可选 'filter' | string | 无 | | | filterContent | type 为'filter'展示的文字 | string | 病区 | |

dataSource

interface DataSourceProps {
  bizId: string;
  bizName: string;
  children?: Data[];
}

Multiple Value

interface ValueProps {
  id: string;
  name: string;
}