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

@chidiui/base-platform

v2.2.3

Published

基础平台-后台管理包

Downloads

76

Readme

基础平台

  • 成勘院数字分公司研发中心专用包

说明

  1. 为避免与其他组件冲突,基础平台所有组件都添加有bp(base-platform)前缀
  2. 此包强制依赖一下第三方库:
    • axios
    • vue
    • element-ui
    • moment
    • js-md5
    • vue-json-viewer
  3. 在引入包之前请确保element-ui已初始化
  4. 此组件强依赖于vuex,并需要业务系统在主业务store中的getters中配置current对象,current对象为/api/current接口返回的data数据
// 示例
export const getters = {
  current : state => state.user.loginInfo
}
  1. 引入Permission组件,根据当前用户所拥有的权限以及所用有的角色,决定此组件下的内容是否渲染,此组件强依赖于store.getters.current
<template>
  <!--
    1、此组件如果不传入code属性,则permission下的内容默认渲染
    2、code = String | Array, excludeRole = String | Array
    3、不传入code,子组件默认渲染
    4、current.permissons中如果包含code传入的内容,渲染
    5、如果current.permissions中不能匹配,而excludeRole能与current.roles相匹配,也能渲染
  -->
  <permission code="run" exclude-role="super">
    <el-button>测试</el-button>
  </permission>
</template>

组件地图

用法

// 在业务系统入口文件中添加以下逻辑
// 基础平台包必须在系统登录成功后进行初始化
import Vue from 'vue'; 
import basePlatform from '@chidiui/base-platform';

Vue.use(basePlatform);
/* NOTE: 基础平台初始化 结束*/

// TODO: 其他业务逻辑

系统参数的获取

  • 基础平台在载入后会自动获取以下后端系统配置参数
    1. 密码是否需要md5加密
    2. 系统登录是否需要验证码
    3. jwt参数名
    4. 业务通知id
    5. 系统默认密码
  • 在业务系统的开发中,这些参数不必在额外发送请求获取,通过基础平台提供的api直接获取即可
  • 示例
/**
 * 获取系统配置信息
 * getSystemConfig (configName) : any;
**/
import { getSystemConfig } from '@chidiui/base-platform';

// 获取系统密码是否需要md5加密配置
const needMd5 = getSystemConfig('needMd5');
// 获取系统是否需要严重吗功能
const needkaptcha = getSystemConfig('needkaptcha');
// 获取系统传递token时的参数名,作为请求header参数或者params参数使用
const jwtParamName = getSystemConfig('jwtParamName');
// 获取系统websocket业务消息id
const noticeBusinessId = getSystemConfig('noticeBusinessId');
// 获取系统默认密码
const defaultPwd = getSystemConfig('defaultPwd');
// 获取当前登录用户
const current = getSystemConfig('current');

单组件用法

import {BpApi} from '@chidiui/base-platform';

export defualt {
  components : {
    BpApi
  }
};