0.6.1-beta1 • Published 2 years ago

bs-component-web v0.6.1-beta1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

bs-component-web

npm npm vue2

Bsoft Web Component

快速使用

安装

npm install --save bs-component-web
yarn bs-component-web
pnpm i bs-component-web

引入

引入所有组件功能:

import Vue from 'vue'
import BsComponentWeb from 'bs-component-web'

Vue.use(BsComponentWeb)

按需引入:

import Vue from 'vue'
import { BsRichTextEditor } from 'bs-component-web'

Vue.component('BsRichTextEditor', BsRichTextEditor)

使用

BsRichTextEditor

 <BsRichTextEditor
    v-model="richText:string"
    :height="height:number"
    :disabled="disabled:boolean"
    @filePicker="file_picker_callback"
    @imagesUpload="images_upload_handler"
  ></BsRichTextEditor>

BsWechatMenuMng

 <BsWechatMenuMng
    :buttons="menuArr:[]"
    @submit="submit_callback:menuArr=>{}"
  ></BsWechatMenuMng>

BsFilterTree

树形菜单组件

  • 用法
<BsFilterTree
    :data="treeDate"
    :props="defaultProps"
    :placeholder="placeholder"
    :filter-node-method="filterNode"
    :default-expand-all="true"
    :show-slot="false"
></BsFilterTree>
  • 参数说明
参数说明类型可选值默认值
data展示数据array--
props配置选项,具体看下表object-{children:"children",label: "label"}
placeholder筛选输入框的提示文本String-请输入筛选条件
filter-node-method对树节点进行筛选时执行的方法,返回 true 表示这个节点可以显示,返回 false 则表示这个节点会被隐藏Function(value, data, node)--
default-expand-all是否默认展开所有节点booleantrue,falsefalse
show-slot是否开启插槽模式,插槽模式下可使用插槽自定义树节点内容booleantrue,falsefalse
node-key每个树节点用来作为唯一标识的属性,整棵树应该是唯一的String--
  • props配置
参数说明类型可选值默认值
label指定节点标签为节点对象的某个属性值string, function(data, node)--
children指定子树为节点对象的某个属性值string--
  • 事件
事件名称说明回调参数
node-click节点被点击时的回调共三个参数,依次为:传递给 data 属性的数组中该节点所对应的对象、节点对应的 Node、节点组件本身。
node-contextmenu当某一节点被鼠标右键点击时会触发该事件共四个参数,依次为:event、传递给 data 属性的数组中该节点所对应的对象、节点对应的 Node、节点组件本身。
current-change当前选中节点变化时触发的事件共两个参数,依次为:当前节点的数据,当前节点的 Node 对象
  • 默认选中的使用方式

若想树菜单默认选择某条信息需要先设置唯一标识node-key,然后使用setCurrentKey方法改变当前选中的数据 示例:

    this.$refs.tree.setCurrentKey(key)  

BsPagination

分页菜单组件

  • 用法
<BsPagination
    @size-change="handleSizeChange"
    @current-change="handleCurrentChange"
    :current-page="currentPage"
    :page-sizes="[10, 20, 30, 40, 50]"
    :page-size="20"
    :total="1400"
    :pagerCount="9"
/>
  • 参数说明
参数说明类型可选值默认值
current-page当前页数number-1
page-sizes每页显示个数选择器的选项设置number[]-10, 20, 30, 40, 50, 100
pager-count页码按钮的数量,当总页数超过该值时会折叠number大于等于 5 且小于等于 21 的奇数7
page-size每页显示条目个数number-10
total总条目数number--
disabled是否禁用boolean-false
  • 事件
事件名称说明回调参数
size-changepageSize 改变时会触发每页条数
current-changecurrentPage 改变时会触发当前页

BsTreeSelect

分页菜单组件

  • 用法
    <BsTreeSelect
      :treeData="departmentList"
      :treeProps="props"
      @treeSelect="deptSelect"
    >
    </BsTreeSelect>
  • 参数说明
参数说明类型可选值默认值
treeData树结构dataArray-[]
treeProps树结构配置项Object-{ children: "children", label: "label", value: "value", }
  • 事件
事件名称说明回调参数
treeSelect选中节点事件节点id

BsSoltBox

布局盒子

  • 用法
 <BsSlotBox :title="'标题'">
    <template #handle>
      <div style="display: flex; align-items: center">
         <i  style="font-size: 14px; margin-right: 4px" class="el-icon-circle-plus-outline"></i>
            新增
          </div>
        </template>
        <div slot="content"></div>
</BsSlotBox>
  • 参数说明
参数说明类型可选值默认值
title标题String--
  • 插槽slot
name说明
handle标题栏右侧操作区域
content主要内容

BsDialog

确认弹框

  • 用法
   this.$dialog(title,message,type,confirmButtonText,cancelButtonText)
   .then(()=>{
     console.log('点击确认')
   }).catch(()=>{
     console.log('点击取消')
   })
  • 参数说明
参数说明类型可选值默认值
title标题string,HTML片段--
message内容信息string,HTML片段--
type弹框图标类型stringsuccess / info / warning / errorwarning
confirmButtonText确认按钮文本string-确认
cancelButtonText取消按钮文本string-取消

BsDeptTree

带过滤的机构科室选择器

  • 用法
 <BsDeptTree
    ref="tree"
    v-model="selectedOrganizationId"
    @change="getTree"
    :organizationList="orgList"
    :changeOrg="true"
    :checkList="[
        { label: '门诊', value: 'outpatientUse' },
        { label: '住院', value: 'inpatientUse' },
        { label: '病区', value: 'inpatientPlaceUse' },
        { label: '医技', value: 'technologyUse' },
    ]"
    :props="defaultProps"
    @node-click="onClickNode"
    :deptList="treeData"
>
</BsDeptTree>
参数说明类型可选值默认值
v-model选中的机构idstring--
organizationList待选机构listarray--
orgProps机构配置,配置选项的label和valueobject-{value: "organizationId",label: "organizationName",}
changeOrg机构是否可选boolean-true
showFilter是否显示过滤boolean-true
checkList过滤开关列表(Array<{label:展示文本,value:过滤字段}>))array-[]
deptList科室数据树array-[]
props科室树配置object-{ children: "departmentList", label: "departmentName", defaultKey:"departmentId" } defaultKey用于设置默认选中的值

License

MIT

更新日志

  • 2022/6.21 v0.5.32 1.打包移除element与vue依赖,改为peerDependencies缩小了打包后的文件体积 2.filterTree树状菜单滚动逻辑修改,改为搜索框不移动下方滚动

  • 2022/6.21 v0.5.36 1.树形控件参数传递方式修改,修复了控件参数传递与文档不一致问题

  • 2022/8.03 v0.5.47 1.将组件库内popperManager初始zIndex值设定为2000(打包结果)

  • 2022/8.08 v0.5.48 1.增加BsDeptTree 机构部门过滤选择树组件

0.6.1-beta1

2 years ago

0.5.50

3 years ago

0.6.0-beta3

3 years ago

0.6.0-beta5

3 years ago

0.6.0-beta6

3 years ago

0.6.0-beta2

3 years ago

0.5.43

3 years ago

0.5.44

3 years ago

0.5.41

3 years ago

0.5.42

3 years ago

0.5.40

3 years ago

0.5.49

3 years ago

0.5.47

3 years ago

0.5.48

3 years ago

0.5.46

3 years ago

0.5.32

3 years ago

0.5.33

3 years ago

0.5.30

3 years ago

0.5.31

3 years ago

0.5.38

3 years ago

0.5.39

3 years ago

0.5.36

3 years ago

0.5.37

3 years ago

0.5.34

3 years ago

0.5.35

3 years ago

0.6.0-beta

3 years ago

0.5.29

3 years ago

0.5.27

3 years ago

0.5.28

3 years ago

0.5.25

3 years ago

0.5.26

3 years ago

0.5.23

3 years ago

0.5.24

3 years ago

0.5.10

3 years ago

0.5.11

3 years ago

0.5.18

3 years ago

0.5.19

3 years ago

0.5.16

3 years ago

0.5.17

3 years ago

0.5.14

3 years ago

0.5.15

3 years ago

0.5.12

3 years ago

0.5.13

3 years ago

0.3.20

3 years ago

0.3.23

3 years ago

0.3.22

3 years ago

0.3.21

3 years ago

0.3.19

3 years ago

0.3.18

3 years ago

0.5.4

3 years ago

0.5.3

3 years ago

0.5.6

3 years ago

0.5.5

3 years ago

0.5.0

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.5.8

3 years ago

0.5.7

3 years ago

0.5.9

3 years ago

0.3.17

3 years ago

0.3.16

3 years ago

0.3.15

3 years ago

0.3.14

3 years ago

0.3.13

3 years ago

0.3.12

3 years ago

0.5.21

3 years ago

0.5.22

3 years ago

0.5.20

3 years ago

0.4.5

3 years ago

0.4.4

3 years ago

0.4.7

3 years ago

0.4.6

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.4.3

3 years ago

0.4.2

3 years ago

0.3.11

3 years ago

0.3.10

3 years ago

0.3.9

3 years ago

0.3.8

3 years ago

0.3.7

3 years ago

0.3.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.3.6

3 years ago

0.3.5

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

0.1.1

3 years ago

0.0.1

3 years ago