@gyyxds/gyy-web-plugin
v0.2.5
Published
基础库
Readme
gyy-web-plugin
基础库
开发组件
下载依赖
npm i启动
npm run dev打包pack
npm run build:lib推送到内部npm仓库
npm publish组件使用
外部安装
cnpm install gyy-web-plugin -S --registry=http://maven.zyun.link/nexus/repository/npm-public/
安装完成后, 修改package.json里 gyy-web-plugin下载依赖路径 http://maven.zyun.link/nexus/repository/fe-npm/gyy-web-plugin/-/gyy-web-plugin-0.0.1.tgz
开始使用
然后在你的代码中写入下面的代码
/**
使用前,需安装,并使用一下依赖 npm i element-plus axios dayjs --save
element-plus
axios
dayjs
*/
// main.ts 引入css
import 'gyy-web-plugin/dist/lib/index.ts.css'
// 引入组件
import {InterFaceList, ResourceAllocation} from "gyy-web-plugin"就可以使用相关的组件了。
国际化
/**
需要国际化时时, 直接传入i18n对象
*/
import {InterFaceList } from "gyy-web-plugin"
/** 引入i18n 举例*/
import i18n from 'xxx'
<InterFaceList :httpBaseUrl="httpBaseUrl" :headers="headers" :i18n="i18n" />组件使用说明
运营配置
接口配置组件
使用示例及参数
import {InterFaceList } from "gyy-web-plugin"
<InterFaceList :httpBaseUrl="httpBaseUrl" :headers="headers" />
props:
httpBaseUrl [String] http请求url Ip
httpBaseUrl = "http://app-api.dev.zyun.link"
headers [Object] http请求headers信息
headers = {
'Authorization': 'Bearer 77f8f656-5a49-44a3-80b1-aa246xxxxxxx32', // 登录token
'x-zg-system': 'kbvip' // 平台关键字
}
资源配置组件
使用示例及参数
import {ResourceAllocation } from "gyy-web-plugin"
<ResourceAllocation :httpBaseUrl="httpBaseUrl" :headers="headers" :permissionCodeList="permissionCodeList" />
/**
props:
httpBaseUrl [String] http请求url Ip [必传]
httpBaseUrl = "http://app-api.dev.zyun.link"
headers [Object] http请求headers信息 [必传]
headers = {
'Authorization': 'Bearer 77f8f656-5a49-44a3-80b1-aa246xxxxxxx32', // 登录token
'x-zg-system': 'kbvip' // 平台关键字
}
permissionCodeList [Array] 权限编码表 [非必传]
默认 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' ]
resources_menu_add => 新增菜单/页面功能
resources_menu_edit => 编辑菜单/页面功能
resources_menu_draggable => 菜单/页面拖拽功能
esources_menu_dele => 删除菜单/页面
resources_function_add => 新增功能
resources_function_edit => 编辑功能
resources_function_dele => 删除功能
resources_function_bind => 绑定接口
*/功能权限组件
使用示例及参数
import { FunctionalAuthority } from "gyy-web-plugin"
<FunctionalAuthority :httpBaseUrl="httpBaseUrl" :headers="headers" :permissionCodeList="permissionCodeList" />
/**
props:
httpBaseUrl [String] http请求url Ip [必传]
httpBaseUrl = "http://app-api.dev.zyun.link"
headers [Object] http请求headers信息 [必传]
headers = {
'Authorization': 'Bearer 77f8f656-5a49-44a3-80b1-aa246xxxxxxx32', // 登录token
'x-zg-system': 'kbvip' // 平台关键字
}
permissionCodeList [Array] 权限编码表 [非必传]
默认 permissionCodeList = ['authorityManager_open_close']
authorityManager_open_close => 权限开通/关闭权限
*/角色管理组件
使用示例及参数
import { RoleManagement } from "gyy-web-plugin"
<RoleManagement :httpBaseUrl="httpBaseUrl" :headers="headers" :permissionCodeList="permissionCodeList" />
/**
props:
httpBaseUrl [String] http请求url Ip [必传]
httpBaseUrl = "http://app-api.dev.zyun.link"
headers [Object] http请求headers信息 [必传]
headers = {
'Authorization': 'Bearer 77f8f656-5a49-44a3-80b1-aa246xxxxxxx32', // 登录token
'x-zg-system': 'kbvip' // 平台关键字
}
permissionCodeList [Array] 权限编码表 [非必传]
默认 permissionCodeList = ['roleManager_add', 'roleManager_edit', 'roleManager_dele']
roleManager_add => 新增角色
roleManager_edit => 编辑角色
roleManager_dele => 删除角色
*/用户管理组件
使用示例及参数
import { UserManager } from "gyy-web-plugin"
<UserManager :httpBaseUrl="httpBaseUrl" :headers="headers" :permissionCodeList="permissionCodeList" />
/**
props:
httpBaseUrl [String] http请求url Ip [必传]
httpBaseUrl = "http://app-api.dev.zyun.link"
headers [Object] http请求headers信息 [必传]
headers = {
'Authorization': 'Bearer 77f8f656-5a49-44a3-80b1-aa246xxxxxxx32', // 登录token
'x-zg-system': 'kbvip' // 平台关键字
}
permissionCodeList [Array] 权限编码表 [非必传]
默认 permissionCodeList = ['userManager_add', 'userManager_dele', 'userManager_edit']
userManager_add => 新增用户
userManager_add => 编辑用户
userManager_add => 删除用户
strictValida [Boolean] 编辑用户密码时是否启用严格校验 [非必传]
默认 false
*/