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 🙏

© 2026 – Pkg Stats / Ryan Hefner

hb_rh-utils

v0.0.63

Published

tools

Downloads

3

Readme

ruijings-utils-library

组件

读卡(read-card-comp)

示例

// 安装:npm i ruijings-tools-library
// 引用:
import { ReadCardComp } from 'ruijings-tools-library'
Vue.component('read-card-comp', ReadCardComp)
// 调用:
<read-card-comp v-model="form.cardNo" />
// 需要在main.js 中设置
window.baseURL = IpConfig.baseUrl

方法

校验 | utils.verify(verifyType, verifyStr)

Arguments

|参数名|参数类型|描述| | :- | :- | :- | |verifyType|String|校验规则。可选值:tel(手机号和固定电话)mobile(手机号)fixed(固定电话)email(邮箱)idnumber(身份证号,一代15位和二代18位)其中,tel和mobile中的手机号码默认校验以1[3-9]开头的11位纯数字;同时允许通过拼接 _strict 或 _loose 实现对手机号码进行更为宽松或严格的校验模式。_strict:根据2019年工信部公布的最新号段校验_loose:以1开头即可通过| |verifyStr|String|待校验的字符串。|

Returns

(Boolean): 返回校验结果

Example

verify('mobile', '10000000000')
verify('mobile_loose', '10000000000')
verify('mobile_strict', '10000000000')

开发环境端口号转换 | utils.changePort(url)

Arguments

url (String): 接口返回的待转换port的URL

Returns

(String): 返回转换后的URL

Example

utils.changePort('http://10.0.0.116:8034/#/rjhis/1/Resident/PatientList');
// 'http://localhost:9099/#/rjhis/1/Resident/PatientList'

清除Cookie | utils.clearCookies()

Example

utils.clearCookies()

根据接口返回的Ret响应不同类型的提示信息 | createMessageBox

获取Cookie中的信息 | getCookieInfo

获取本机药品部门 | getDeptId

获取本机药品包装单位 | getlocalPackUnit

获取本地时间 | getLocalDateTime

获取打印配置 | getPrintConfig

保存系统配置 | setSystemConfig(SystemNo)

Arguments

SystemNo (String): 系统编号

Returns

Example

utils.setSystemConfig('108');
// 此操作将查询108对应系统的所有系统设置

获取系统配置 | getSystemConfig(ConfigKeyCode, Type)

Arguments

Returns

(Object): 返回保存的系统配置信息

Example

utils.getSystemConfig();
// { Psychiatry: 1, ... }

获取指定系统配置的值 | getSystemConfigByCode(KeyCode, Type)

Arguments

KeyCode (String): 系统设置对应的keyCode Type (Number): 当传入1时,会将获取到的配置信息转为Number类型返回

Returns

(String|Number): 返回从 SystemConfig 查询到的系统设置KeyValue

Example

utils.getSystemConfigByCode('Psychiatry');
// 1

获取服务器时间 | getSystemDateTime

Arguments

formatter (String): 日期时间格式

Returns

(String): 格式化后的服务器时间

Example

utils.getSystemDateTime('YYYY-MM-DD HH:mm:ss');
// 2022-01-01 00:00:00

获取本地时间 | getLocalDateTime

Arguments

formatter (String): 日期时间格式

Returns

(String): 格式化后的本地时间

Example

utils.getLocalDateTime('YYYY-MM-DD');
// 2022-01-01

获取编码体系 | getValueDic

Arguments

Types (String|Array): 编码体系Code

Returns

(Array): 编码体系值域,每个Code为一条记录

Example

utils.getValueDic(["DRJCM119","DRJCM123"]);
// [
//   {
//       "codeId": "873809181222367200",
//       "code": "DRJCM119",
//       "codeName": "审批结果编码体系",
//       "fiveCode": "PRXJXDWT",
//       "pinCode": "SPJGBMTX",
//       "definition": "审批结果编码体系",
//       "describe": "审批结果编码体系",
//       "values": [
//           {
//               "codeId": "873809181222367200",
//               "valueId": "874507487766376400",
//               "valueCode": "1",
//               "value": "驳回",
//               "showValue": "驳回",
//               "fiveCode": "CL",
//               "pinCode": "BH",
//               "parentValueId": null
//           }
//       ]
//   },
//   {
//       "codeId": "874179567013326800",
//       "code": "DRJCM123",
//       "codeName": "审批状态编码体系2",
//       "fiveCode": "PRUDXDWT2",
//       "pinCode": "SPZTBMTX2",
//       "definition": "审批状态编码体系2",
//       "describe": "审批状态编码体系2",
//       "values": [
//           {
//               "codeId": "874179567013326800",
//               "valueId": "874179721917362200",
//               "valueCode": "1",
//               "value": "待审批",
//               "showValue": "待审批",
//               "fiveCode": "TPR",
//               "pinCode": "DSP",
//               "parentValueId": null
//           }
//       ]
//   }
// ]