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

hsry-oms-ui

v1.0.28

Published

基于oms样式规范

Readme

此组件是基于 OMS 样式规范而进行封装

1.安装依赖

npm i hsry-oms-ui

2.引入组件,在 main.ts 中引入

// main.ts
import hsryOmsUi from 'hsry-oms-ui';
import 'hsry-oms-ui/style.css';

// 全局注册
app.use(hsryOmsUi);

3.使用组件

3.1、PageTemplage 组件

<!-- template -->
<PageTemplate ref="pagetemplate">
  <template #search>
    <!-- 搜索区域 -->
  </template>
  <template #buttonLeft>
    <!-- 左侧按钮区域 -->
  </template>
  <template #buttonRight>
    <!-- 右侧按钮区域 -->
  </template>
  <template #table>
    <!-- 表格区域 -->
  </template>
</PageTemplate>
// script
// 展开和收起按钮方法
const queryShow = ref(false);
const pagetemplate = ref();
const handleMore = () => {
  queryShow.value = !queryShow.value;
  pagetemplate.value.getChineDom(queryShow.value);
};

3.2、VDialog 组件(弹窗)

<!-- 使用示例 -->
<VDialog v-model="dialogVisible" title="弹窗标题" @confirm="confirm">
  <div>弹窗内容</div>
</VDialog>

| 参数 | 说明 | 类型 | 默认值 | | :---------- | :---------------------------------- | :------- | :----: | | modelValue | 弹窗显示隐藏 | Boolean | false | | width | 弹窗宽度 | String | 500px | | title | 弹窗标题 | String | - | | draggable | 弹窗是否可拖拽 | Boolean | false | | titleShow | 是否显示弹窗标题,取值:inline/none | String | inline | | cancelText | 取消按钮文字 | String | 取消 | | cancelShow | 取消按钮显示 | Boolean | true | | confirmText | 确认按钮文字 | String | 确定 | | confirmShow | 确认按钮显示 | Boolean | true | | bottomShow | 底部按钮显示 | Boolean | true | | btnLoadig | 确认按钮 loading | Boolean | false | | confirm | 确认按钮点击事件 | Function | - | | cancel | 取消按钮点击事件 | Function | - | | close | 关闭弹窗事件 | Function | - |

3.3、VMessageBox 组件(对话框)

<!-- 组件式 -->
<VMessageBox v-model="dialogVisible" title="对话框标题" @confirm="confirm">
  <div>弹窗内容</div>
</VMessageBox>
// 函数式(推荐)
// 引用全局
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
proxy?.$modal.dialog({ title: '提示', message: '对话框内容', type: 'warning' }).then(res=>{
  console.log(res)
}).catch(err=>{
  console.log(err)
})
// 手动引入
import { createDialog } from 'hsry-oms-ui';
createDialog({ title: '提示', message: '对话框内容', type: 'warning' })
  .then((res) => {
    console.log(res);
  })
  .catch((err) => {
    console.log(err);
  });

| 参数 | 说明 | 类型 | 默认值 | | :---------- | :------------------------------------------ | :------- | :-----: | | modelValue | 对话框显示隐藏 | Boolean | false | | type | 对话框类型,取值:success/error/warning/tip | String | success | | message | 对话框内容 | String | - | | width | 对话框宽度 | String | 500px | | title | 对话框标题 | String | - | | titleShow | 是否显示弹窗标题,取值:inline/none | String | inline | | cancelText | 取消按钮文字 | String | 取消 | | cancelShow | 取消按钮显示 | Boolean | true | | confirmText | 确认按钮文字 | String | 确定 | | confirmShow | 确认按钮显示 | Boolean | true | | bottomShow | 底部按钮显示 | Boolean | true | | btnLoadig | 确认按钮 loading | Boolean | false | | confirm | 确认按钮点击事件 | Function | - | | cancel | 取消按钮点击事件 | Function | - | | close | 关闭对话框事件 | Function | - |

4.字体图标使用和按钮规范

<!-- 使用字体图标 -->
<span class="iconfont icon-OMS_daochu"></span>
<!-- 或 -->
<i class="iconfont icon-OMS_daochu"></i>

<!-- 按钮使用规范 -->
<!-- 导出 -->
<el-button type="primary">
  <i class="iconfont icon-OMS_daochu pr-1"></i>
  导出
</el-button>
<!-- 新增 -->
<el-button type="primary" plain icon="Plus">新增</el-button>
<!-- 导入 -->
<el-button type="primary" icon="Download">导入</el-button>
<!-- 修改 -->
<el-button type="warning">
  <i class="iconfont icon-OMS_xiugai pr-1"></i>
  修改
</el-button>
<!-- 确认 -->
<el-button type="success" icon="Edit"> 客户签收、司机签收、批量确认</el-button>
<!-- 删除 -->
<el-button type="danger" plain icon="Delete">删除</el-button>
<!-- 推送 -->
<el-button>
  <i class="iconfont icon-OMS_tuisong pr-1"></i>
  推送
</el-button>
<!-- 打印 -->
<el-button icon="Printer">打印</el-button>

动态表格

配置

1.角色管理,复制代码
2.复制selectLayout页面布局组件
3.api->role.ts 文件中添加updateLayout 接口(此接口需要后端配合)
4.store->modules 文件夹中添加 pagePermission.ts 文件,user.ts 添加路由与鉴权配置
5.src->permission.ts 添加动态表格鉴权
6.src->directive->permission->index.ts 添加鉴权方法和指令
7.src->directive->index.ts 注册鉴权指令
8.utils->common.ts 添加判断屏幕大小方法 getSearchNum (此方法在hsry-oms-ui包中已封装,也可直接引入使用)
9.添加FieldCheck 组件

使用

1. 引入权限方法

import { VhasColumn, VhasExport } from '@/directive/permission/index';

2. 搜索权限

<!-- v-hasQuery="['xxx']" -->
<el-form-item label="销售单号" prop="osoCode" v-hasQuery="['osoCode']">
  <el-input v-model="queryParams.osoCode" placeholder="请输入销售单号" clearable @keyup.enter="handleQuery" />
</el-form-item>

<!-- v-hasExpand -->
<el-button type="primary" plain @click="handleMore" v-hasExpand>
  {{ queryShow ? '收起' : '展开' }}更多
  <el-icon v-if="queryShow"><CaretTop /></el-icon>
  <el-icon v-else><CaretBottom /></el-icon>
</el-button>

3. 表格列权限

<field-check></field-check>

<!-- VhasColumn('xxx') -->
<el-table-column label="销售单号" align="center" prop="osoCode" width="185" v-if="VhasColumn('osoCode')" />

4.导出

let exportData = queryParams.value;
exportData.tableHead = VhasExport();
proxy?.download(
  'xxx(导出接口)',
  {
    ...exportData
  },
  `xxx信息导出_${new Date().getTime()}.xlsx`
);

5. 对应 api 文件夹内 layout.ts 文件配置

export const info {
  /*
  * 注:旧版首字母大写,新版首字母小写
  * 新旧版请以接口返回的nam为准,name后带一串数字(id)为新版
  */
  name: 'SalesOrder',
  label: '销售订单',
  queryList: [
    {
      name: 'osoShopDateTime',
      label: '下单日期',
      locks: true
    },
    {
      name: 'osoGmtDeliveryTime',
      label: '到货日期',
      locks: false
    },
  ],
   table:[
    {
      name: 'main',
      label: '页面主表格',
      columnList: [
        {
          name: 'osoCode',
          label: '订单编号',
          locks: false
        },
        {
          name: 'osoShopDate',
          label: '下单日期',
          locks: false
        }
      ]
    }
   ]
}

注:

1.script 标签中的 name 必须和 layout.ts 中的 name 一致
2.菜单路由配置,路由地址也需和以上两个一致,但首字母小写即可(oms旧写法)
3.ruoyi 新版路由name加上了id,新版layout.ts中name请使用首字母小写