3.0.0 • Published 4 months ago

inspur-portal-manage-helper v3.0.0

Weekly downloads
-
License
-
Repository
-
Last release
4 months ago

portal-manage-helper

简介

统一门户管理通用帮助(包含用户、角色、组织三个组件)

安装

npm i inspur-portal-manage-helper

使用

  • main.js
import portalManageHelper from 'inspur-portal-manage-helper'
import 'inspur-portal-manage-helper/portalManageHelper.css'

Vue.use(portalManageHelper)
  • 组件中使用 xxx.vue
// 用户树 UserHelper;角色树 RoleHelper;组织树 OrganHelper
<OrganHelper
  ref="helper"
  :base-url="baseURL"
  :is-show-footer="true"
  leaf-only
  include-half-checked
  :token-name="tokenTableName"
  @cancle="cancle"
  @confirm="getCheckNode"
  />

属性

  • baseUrl:项目代理网关,通用帮助组件获取的用户、角色、组织,与引用项目登录用户权限一致;若是 wuu 框架,可通过import { baseURL } from '@/config'赋值
  • token:项目 oAuth 认证。可为空,若不为空,优先取此值。
  • tokenName:浏览器存储的 token 名,若是 wuu 框架,可通过import { tokenTableName } from '@/config'赋值。可为空。
  • leafOnlyconfirm事件返回数组中是否只是叶子节点,默认值为false
  • includeHalfCheckedconfirm事件返回数组中是否包含半选节点,默认值为false
  • isShowSearch:是否展示搜索框,默认值为true
  • isShowFooter:是否展示页脚按钮,默认值为true
  • radio:是否单选,默认值为false
  • check-strictly:在显示复选框的情况下,是否严格的遵循父子不互相关联的做法,默认值为false

事件

  • confirm:点击确认按钮返回事件,回调参数为当前选中的节点所组成的数组
  • cancle:点击取消按钮返回的事件
  • check:当复选框被点击的时候触发。共两个参数,依次为:传递给 data 属性的数组中该节点所对应的对象、树目前的选中状态对象,包含 checkedNodes、checkedKeys、halfCheckedNodes、halfCheckedKeys 四个属性

方法

  • getCheckedNodes:返回目前被选中的节点所组成的数组。(leafOnly, includeHalfChecked) 接收两个 boolean 类型的参数,1. 是否只是叶子节点,默认值为 false 2. 是否包含半选节点,默认值为 false

注意

  1. 用户树中,有特殊字段 keyId 与 labelName。当节点为组织时,分别对应节点字段的 organId 与 organName;当节点为用户时,分别对应节点字段的 userId 与 userName。
  2. 回显可使用以下方法:
this.$refs.helper.$refs.tree.setCheckedKeys(["xx_userId"]);
3.0.0

4 months ago

2.1.2

6 months ago

2.1.1

6 months ago

2.1.3

6 months ago

2.1.0

7 months ago

1.6.1

7 months ago

1.6.0

7 months ago

2.0.0

7 months ago

1.5.3

8 months ago

1.5.2

8 months ago

1.5.1

8 months ago

1.5.0

8 months ago

1.4.0

8 months ago

1.3.0

8 months ago

1.2.0

8 months ago

1.1.0

8 months ago

1.0.0

8 months ago