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

@gyyxds/gyy-web-plugin

v0.2.6

Published

基于 Vue 3 + Vite + Element Plus 构建的可复用业务组件库,面向大数据平台的运营配置、权限管理与主题定制等场景,提供开箱即用的页面级组件与工具函数。

Readme

大数据平台-通用插件库

基于 Vue 3 + Vite + Element Plus 构建的可复用业务组件库,面向大数据平台的运营配置、权限管理与主题定制等场景,提供开箱即用的页面级组件与工具函数。

包名: @gyyxds/gyy-web-plugin
技术栈: Vue 3、TypeScript、Element Plus、Axios、Day.js


功能概览

| 组件 / 模块 | 导出名称 | 说明 | | --- | --- | --- | | 接口管理 | InterFaceList | 平台接口列表查询与展示,支持关键字搜索、分页及修改时间展示 | | 资源配置 | ResourceAllocation | 菜单与页面资源管理,支持树形结构拖拽排序、菜单/页面增删改、功能点维护及接口绑定,可配置快捷绑定 API 映射 | | 功能权限 | FunctionalAuthority | 按平台端与角色配置菜单/页面下各功能点的开通与关闭 | | 角色管理 | RoleManagement | 角色的新增、编辑、删除及列表检索 | | 用户管理 | UserManager | 用户的新增、编辑、删除,支持按姓名、账号、手机号、角色筛选,可配置密码严格校验 | | 自定义主题 | CustomTheme | 主题版本列表管理,支持新建、编辑、复制、启用/停用,可视化配置 CSS 变量并预览效果 | | 主题编辑面板 | EditConfigPane | 自定义主题的配置编辑面板,可作为抽屉或独立页面嵌入使用 | | 调试 Demo | Test | 本地开发调试用的示例组件 |

工具函数

| 函数 | 说明 | | --- | --- | | getHtmlFontSize | 获取当前页面 html 根元素的 font-size(px) | | pxToRem | 将 CSS 字符串中的 px 单位批量转换为 rem | | setCssVariableInBody | 将自定义 CSS 变量写入 body 标签的 style 属性 | | isSetCssVariableInBody | 判断 body 上是否已设置自定义主题 CSS 变量 |

通用能力

  • 国际化(i18n): 各组件均支持传入外部 i18n 对象,与宿主应用语言包合并
  • 权限控制: 运营类组件支持通过 permissionCodeList 控制按钮与操作的显隐
  • 统一请求配置: 通过 httpBaseUrlheaders 传入 API 地址及鉴权信息

开发

安装依赖

yarn

本地启动

yarn dev

打包组件库

yarn build:lib

打包产物输出至 dist/lib/ 目录。

发布到 npm

npm publish

安装与引入

安装

yarn add @gyyxds/gyy-web-plugin

Peer 依赖(使用前需自行安装):

yarn add element-plus axios dayjs

全局引入

// main.ts — 引入样式
import '@gyyxds/gyy-web-plugin/dist/lib/index.ts.css'

// 按需引入组件
import {
  InterFaceList,
  ResourceAllocation,
  FunctionalAuthority,
  RoleManagement,
  UserManager,
  CustomTheme,
} from '@gyyxds/gyy-web-plugin'

国际化

需要与宿主应用共用语言包时,直接传入 i18n 对象即可:

<script setup lang="ts">
import { InterFaceList } from '@gyyxds/gyy-web-plugin'
import i18n from '@/i18n'
</script>

<template>
  <InterFaceList :httpBaseUrl="httpBaseUrl" :headers="headers" :i18n="i18n" />
</template>

组件使用说明

公共 Props

多数运营配置类组件共享以下 Props:

| Prop | 类型 | 必填 | 说明 | | --- | --- | --- | --- | | httpBaseUrl | String | 是 | API 请求基础地址,如 http://app-api.dev.zyun.link | | headers | Object | 是 | 请求头,通常包含 Authorizationx-zg-system | | i18n | Object | 否 | 外部国际化实例 | | tenantId | String | 否 | 租户 ID |

headers 示例:

const headers = {
  Authorization: 'Bearer <token>',
  'x-zg-system': 'kbvip', // 平台标识
}

接口管理 — InterFaceList

平台接口信息的列表展示与搜索。

<InterFaceList :httpBaseUrl="httpBaseUrl" :headers="headers" />

资源配置 — ResourceAllocation

菜单、页面及功能点的树形配置,支持拖拽排序与接口绑定。

<ResourceAllocation
  :httpBaseUrl="httpBaseUrl"
  :headers="headers"
  :permissionCodeList="permissionCodeList"
  :quickBindApiMap="quickBindApiMap"
/>

permissionCodeList 默认值及含义:

| 编码 | 说明 | | --- | --- | | resources_menu_add | 新增菜单/页面 | | resources_menu_edit | 编辑菜单/页面 | | resources_menu_draggable | 菜单/页面拖拽排序 | | resources_menu_dele | 删除菜单/页面 | | resources_function_add | 新增功能 | | resources_function_edit | 编辑功能 | | resources_function_dele | 删除功能 | | resources_function_bind | 绑定接口 |


功能权限 — FunctionalAuthority

按角色为各菜单/页面下的功能点开通或关闭权限。

<FunctionalAuthority
  :httpBaseUrl="httpBaseUrl"
  :headers="headers"
  :permissionCodeList="permissionCodeList"
  :showQXZD="true"
/>

| Prop | 类型 | 默认值 | 说明 | | --- | --- | --- | --- | | showQXZD | Boolean | true | 是否显示「请选择端」选项,由外部传入控制 |

permissionCodeList 默认值:

| 编码 | 说明 | | --- | --- | | authorityManager_open_close | 功能权限开通/关闭 |


角色管理 — RoleManagement

角色的增删改查。

<RoleManagement
  :httpBaseUrl="httpBaseUrl"
  :headers="headers"
  :permissionCodeList="permissionCodeList"
/>

permissionCodeList 默认值:

| 编码 | 说明 | | --- | --- | | roleManager_add | 新增角色 | | roleManager_edit | 编辑角色 | | roleManager_dele | 删除角色 |


用户管理 — UserManager

用户信息维护,支持多条件检索。

<UserManager
  :httpBaseUrl="httpBaseUrl"
  :headers="headers"
  :permissionCodeList="permissionCodeList"
  :strictValida="false"
/>

| Prop | 类型 | 说明 | | --- | --- | --- | | permissionCodeList | Array | 权限编码,默认 userManager_add / userManager_edit / userManager_dele | | strictValida | Boolean | 编辑用户密码时是否启用严格校验,默认 false |


自定义主题 — CustomTheme

主题版本的全生命周期管理,包括 CSS 变量可视化编辑、预览、启用与停用。

<CustomTheme
  :httpBaseUrl="httpBaseUrl"
  :headers="headers"
  :system="system"
  :configItems="configItems"
  :needWriteStyle="true"
  :permissionCodeList="permissionCodeList"
  @cancel="onCancel"
/>

| Prop | 类型 | 说明 | | --- | --- | --- | | system | String | 平台标识,对应 x-zg-system | | configItems | Array | 可配置的主题变量项列表 | | needWriteStyle | Boolean | 是否将主题变量写入页面样式 | | permissionCodeList | Array | 权限编码,如 customTheme_add / customTheme_edit / customTheme_use / customTheme_copy 等 |

主题编辑面板 — EditConfigPane 可单独引入,以抽屉或内嵌形式使用:

<EditConfigPane
  :httpBaseUrl="httpBaseUrl"
  :headers="headers"
  :configItems="configItems"
  :isDrawer="true"
/>

主题工具函数

配合 CustomTheme 在宿主应用中动态应用主题变量:

import {
  getHtmlFontSize,
  pxToRem,
  setCssVariableInBody,
  isSetCssVariableInBody,
} from '@gyyxds/gyy-web-plugin'

// 将主题变量写入 body
setCssVariableInBody({ '--zg-tc-g': '#1890ff' })

// 检查是否已应用主题变量
const applied = isSetCssVariableInBody()