跳到主要内容

公共组件

公共组件

电脑端公共组件统一写在/jsbos-web/src/components目录下
手机端公共组件统一写在/jsbos-app/src/components目录下

此处举例几个常用组件剩余组件样式可在代码生成页面选择查看效果(手机端组件同理)
img_1.png

图片上传

  • UploadImg

  • 使用示例

<template>
<UploadImg
modular="ai_user"
type="document"
v-model="dataForm.files"
:disabled="true"
:detailed="true"
:fileSize="5"
sizeUnit="MB"
:limit="3">
</UploadImg>
</template>

<script>
export default {
data() {
return {
dataForm: {
files: ""
}
}
}
}
</script>
  • 配置项
参数说明类型默认值可选值
type文件类型\文件保存路径Stringannexpiclicense\useravatar\mail\im\weixin\workflow\annex\annexpic\dataBackup\document\temporary\allowuploadfiletype\preview\templatefile\servicedirectory\webdirectory\codetemp\bivisualpath\export
disabled是否禁用Booleanfalsefalse/true
detailed是否detailedBooleanfalsefalse/true
showTip是否显示 提示说明文字Booleanfalsefalse/true
limit最大允许上传个数Number0-
accept接受上传的文件类型Stringimage/*-
sizeUnit单位StringMB-
fileSize文件大小-5-

树选择器

  • TreeSelect

  • 使用示例

<template>
<TreeSelect
:disabled="false"
v-model="dataForm.transportTypeId"
placeholder="请选择"
clearable
:options="treeData"
:props="parentIdProps"
@change="setTitle"
>
</TreeSelect>
</template>

<script>
export default {
data() {
return {
dataForm: {
transportTypeId: ""
},
treeData: [],
parentIdProps: {
children: "children",
label: "name",
value: "id"
},
}
},
methods: {
setTitle() {

},
},
}
</script>
  • 配置项
参数说明类型默认值可选值
props配置项Objectyaml { value: "id", // ID字段名 label: "fullName", // 显示名称 children: "children", // 子级字段名 }
disabled是否禁用Booleanfalsefalse/true
options选项列表数据(树形结构的对象数组)Array[]-
placeholder提示说明文字String请选择-
value初始值[String, Array]--
clearable可清空选项Booleanfalse-
filterable能否搜索Booleanfalse-
lastLevel只能选择最后一层的数值Booleanfalse-
lastLevelKey只能选择最后一层的数值时,需要根据 lastLevelKey来判断是否最后一层StringhasChildren-
firstLevelValue--false-
accordion自动收起Booleanfalse-
defaultExpandAll-Booleantrue-
multiple是否多选,默认单选Booleanfalse-
collapseTags是否折叠隐藏选中数据Booleanfalse-

人员选择器

  • userSelect

  • 使用示例

<template>
<UserSelect
v-model="dataForm.value"
:disabled="false"
@change="onConditionObjChange() "
placeholder="请选择"
clearable
:multiple="false"
/>
</template>

<script>
export default {
data() {
return {
dataForm: {
value: ""
}
}
},
methods: {
onConditionObjChange() {

},
},
}
</script>
  • 配置项
参数说明类型默认值可选值
value选中的数据String(单选), Array(多选)""
props配置项Object
ifActiveName默认显示的分类Stringallall,department,subordinates
placeholder提示说明文字String请选择-
disabled是否禁用Booleanfalsefalse/true
multiple是否多选Booleanfalse-
clearable可清空选项Booleanfalse-
collapseTags默认展开和折叠Booleanfalse-

组织选择组件

自定义公共组件

  • ComSelect

  • 使用示例

<template>
<ComSelect
:value="dataForm.data"
placeholder="请选择"
clearable
:multiple="true">
</ComSelect>
</template>

<script>
export default {
data() {
return {
dataForm: {
data: ""
}
}
}
}
</script>
  • 配置项
参数说明类型默认值可选值
value数据绑定Array[]--
placeholder提示说明文字String请选择--
disabled是否禁用Booleanfalse--
multiple是否支持多选Booleanfalse--
collapseTags多选时是否将选中值按文字的形式展示Booleanfalse--
clearable是否可以清空选项Booleanfalse--

部门选择组件

自定义公共组件

  • DepSelect

  • 使用示例

<template>
<DepSelect
v-model="dataForm.organizeId"
ref="depselect"
placeholder="请选择"
clearable
@change="depChange()"
:style="{ width: '100%' }"
/>
</template>

<script>
export default {
data() {
return {
dataForm: {
organizeId: ""
}
}
},
methods: {
depChange() {

},
},
}
</script>
  • 配置项
参数说明类型默认值可选值
value数据绑定Array[]--
lastLevel是否只能选择末尾节点Booleantrue--
clearable是否可以清空选项Booleantrue--

分组选择组件

自定义公共组件

  • GroSelect

  • 使用示例

<template>
<GroSelect
v-model="dataForm.groId"
ref="groselect"
placeholder="请选择"
clearable
@change="onConditionObjChange()"
:style="{ width: '100%' }"
/>
</template>

<script>
export default {
data() {
return {
dataForm: {
groId: ""
}
}
},
methods: {
onConditionObjChange() {

},
},
}
</script>
  • 配置项
参数说明类型默认值可选值
value数据绑定Array[]--
disabled是否禁用Booleanfalse--
placeholder提示说明文字String请选择--
multiple是否支持多选Booleanfalse--
clearable是否可清空选项Booleanfalse--

岗位选择组件

  • 自定义公共组件

  • PosSelect

  • 使用示例

<template>
<PosSelect
v-model="dataForm.posId"
ref="posselect"
placeholder="请选择"
clearable
@change="onConditionObjChange()"
:style="{ width: '100%' }"
/>
</template>

<script>
export default {
data() {
return {
dataForm: {
posId: ""
}
}
},
methods: {
onConditionObjChange() {

},
},
}
</script>
  • 配置项
参数说明类型默认值可选值
value数据绑定Array[]--
disabled是否禁用Booleanfalse--
placeholder提示说明文字String请选择--
multiple是否支持多选Booleanfalse--
clearable是否可清空选项Booleanfalse--

数据字典选择组件

  • 自定义公共组件

  • DicSelect

  • 使用示例

<template>
<DicSelect
v-model="dataForm.treeDictionary"
placeholder="请选择数据字典"
/>
</template>

<script>
export default {
data() {
return {
dataForm: {
treeDictionary: ""
}
}
},
}
</script>
  • 配置项
参数说明类型默认值可选值
value数据绑定Array[]--
disabled是否禁用Booleanfalse--
placeholder提示说明文字String请选择--

列表组件

  • 自定义公共组件
  • daily-list-items
参数说明类型默认值可选值
title标题String默认标题--
id点击后返回id,可通过filter方法筛选原数组获取当前数据[String, Number, Object]''--
titleRightColor右侧类型文字颜色String'#af9d92'--
titleRightText右侧类型文字'未执行'--
ConcealColor右上角角标文字颜色String'#af9d92'--
ConcealText右上角角标文字String'未定义'--
tags标签Array[]--
operateButton按钮类型及方法类型Array[]--
datetime完成时间String'2023-01-02 15:03'--
datetimeShow完成时间是否显示Booleantrue--
isConceal是否显示右侧状态Booleanfalse--
ItemHeight高度String'130'--

上传图片裁剪功能

自定义公共组件

  • UploadCropImg

  • 使用示例

<template>
<UploadCropImg
:autoCropWidth="200"
:autoCropHeight="200"
v-model="dataForm.loginIcon"
tip="登录图标"
/>
</template>

<script>
export default {
data() {
return {
dataForm: {
loginIcon: ""
}
}
},
}
</script>
  • 配置项
参数说明类型默认值可选值
value裁剪图片String''--
disabled上传禁用Booleanfalsefalse/true
limit最大上传数量Number1--
autoCropWidth设置裁剪图片宽度Number300--
autoCropHeight设置裁剪图片高度Number200--
fixedBox设置裁剪截图框是否可以改变大小Booleanfalsefalse/true
tip裁剪弹窗标题String图片上传--
isHead是否是上传头像Booleanfalsefalse/true

用户过滤组件

自定义公共组件

  • FilterSelect

  • 使用示例

<template>
<filterSelect
width="500px"
v-model="list"
@change="getChangeData"
></filterSelect>
</template>

<script>
export default {
data() {
return {
list: [],
}
},
methods: {
getChangeData() {

},
},
}
</script>
  • 配置项
参数说明类型默认值可选值
value数据绑定Array[]--
width设置过滤组件的宽度String500px--

范围内的用户选择

自定义公共组件

  • RangeUser

  • 使用示例

<template>
<RangeUser
@change="getUserIds"
:value="value"
:rangeList="list"
:multiple="false"
/>
</template>

<script>
export default {
data() {
return {
value: '',
list: [],
}
},
methods: {
getUserIds() {

},
},
}
</script>
  • 配置项
参数说明类型默认值可选值
value数据绑定String""--
rangeList筛选范围列表Array[]--
multiple是否开启多选Booleanfalse--

表格操作按钮组件

自定义公共组件

  • tableOperation
参数说明类型默认值可选值
delText删除按钮文本设置String"删除"--
editText编辑按钮文本设置String"编辑"--
hasEdit是否展示编辑按钮Booleantrue--
hasDel是否展示删除按钮Booleantrue--
editDisabled编辑按钮是否禁用Booleanfalse--
delDisabled删除按钮是否禁用Booleanfalse--
isJudgePer是否开启权限判断Booleanfalse--
editPerCode编辑权限标识String"btn_edit"--
delPerCode删除权限标识String"btn_remove"--
方法说明参数
edit编辑按钮调用方法--
del删除按钮调用方法--
插槽说明
left左侧插入
right右侧插入
center中间插入

表格分页组件

自定义公共组件

  • Pagination

  • 使用示例

<template>
<pagination
:total="total"
:page.sync="listQuery.currentPage"
:limit.sync="listQuery.pageSize"
@pagination="initData"
/>
</template>

<script>
export default {
data() {
return {
total: 24,
listQuery: {
currentPage: 1,
pageSize: 20
},
}
},
methods: {
initData() {

},
},
}
</script>
  • 配置项
参数说明类型默认值可选值
total数据总数量Number0--
limit每页条数Number20--
pageSizes设置每页多少条Array[20, 50, 100, 500]--
layout分页工具操作项String"total, sizes, prev, pager, next, jumper"--
autoScroll页码改变后页面滚动展示的位置Booleantrue--
hidden是否隐藏滚动条Booleanfalse--

用户选择组件

自定义公共组件

  • UserSelect

  • 使用示例

<template>
<userSelect
v-model="listQuery.pickupUser"
placeholder="请选择"
/>
</template>

<script>
export default {
data() {
return {
listQuery: {
pickupUser: null,
},
}
},
}
</script>
  • 配置项
参数说明类型默认值可选值
value数据绑定String""--
ifActiveName打开弹窗默认展示项设置String"department"--
placeholder输入框提示文字String"请选择"--
disabled是否禁用Booleanfalse--
multiple是否开启多选Booleanfalse--
clearable是否显示清楚所以图标Booleantrue--
方法说明参数
change数据改变获取选中数据参数1:id集合,参数2:数据集合

树形下拉框组件

自定义公共组件

  • TreeSelect

  • 使用示例

<template>
<TreeSelect
v-model="dataForm.workOrderTypeId"
:options="treeData"
placeholder="选择工单类型"
:props="defaultProps"
@change="setTitle"
:firstLevel="true"
firstLevelKey="id"
firstLevelValue="0"
/>
</template>

<script>
export default {
data() {
return {
treeData: [],
dataForm: {
id: '1',
},
defaultProps: {
children: "children",
label: "name",
value: "id",
},
}
},
methods: {
setTitle() {

},
},
}
</script>
  • 配置项
参数说明类型默认值可选值
props下拉框配置项Objectjson { value: "id", // ID字段名 label: "fullName", // 显示名称 children: "children", // 子级字段名 } --
disabled是否禁用Booleanfalse--
options选项列表数据(树形结构的对象数组)Array[]--
placeholder占位提示String"请选择"--
value初始值(绑定值)String""--
clearable是否显示清楚所以图标Booleanfalse--
filterable是否可搜索Booleantrue--
lastLevel是否只能选择最后一层数据,需要根据 lastLevelKey来判断是否最后一层Booleanfalse--
lastLevelKey判断是否是最后一层的字段设置String"hasChildren"--
multiple是否支持多选Booleanfalse--
方法说明参数
change数据改变获取选中数据

表格组件

自定义公共组件

  • JsbosTable

  • 使用示例

<template>
<jsbos-table
v-loading="listLoading"
:data="list"
:border="false"
highlight-current-row
@row-click="rowClick"
:hasNO="false"
>
<el-table-column
type="index"
width="50"
label="序号"
align="center"
/>
</jsbos-table>
</template>

<script>
export default {
data() {
return {
listLoading: false,
list: [],
}
},
methods: {
rowClick() {

},
},
}
</script>
  • 配置项
参数说明类型默认值可选值
data表格数据Array[]--
hasNO是否显示序号Booleantrue--
hasC是否开启多选Booleanfalse--
border是否带有纵向边框Booleanfalse--
customColumn自定义列Booleantrue--

动态进度组件

自定义公共组件

  • TaskDynamics

  • 使用示例

<template>
<TaskDynamics
:list="dynList"
:showAvator="true"
:showContent="showContent"
></TaskDynamics>
</template>

<script>
export default {
data() {
return {
dynList: [],
showContent: [
{
name: "任务状态",
key: "taskState",
},
{
name: "任务描述",
key: "taskDescription",
},
],
}
},
}
</script>
  • 配置项
参数说明类型默认值可选值
list动态进度数据Array[]--
showAvator是否展示头像Booleantrue--
showContent需要展示的内容Boolean[{ name: "任务状态", key: "taskState", }, { name: "任务描述", key: "taskDescription", }]--

插槽: <slot name="other" :item="item"></slot>

九宫格列表组件

自定义公共组件

  • gridList

  • 使用示例

<template>
<GridList
class="tableContainer"
:data="authorizeTreeData"
:span="6"
style="margin-left: 10px; overflow: scroll"
:prop="prop"
:selection="true"
:moduleIdsTemp="dataForm.module"
v-show="showGrid && active == '0'"
v-if="showGrid && active == '0'"
@change="gridChange"
>
<template #image="{ item }">
<el-avatar size="medium" :src="item"></el-avatar>
</template>
<template #item="{ item }">
<div style="">
图标:
<i :class="item.icon"></i>
<br />
类型:
{{ item.category }}
</div>
</template>
</GridList>
</template>

<script>
export default {
data() {
return {
authorizeTreeData: [],
prop: {
title: "fullName",
url: "url",
},
dataForm: {
module: ''
},
}
},
methods: {
gridChange() {

},
},
}
</script>
  • 配置项
参数说明类型默认值可选值
data列表数据Array[]--
selection是否可以选择Booleanfalsetrue/false
prop字段映射Object{title: "title",url: "url",}----
showImage是否显示图片Booleanfalsetrue/false

图标选择组件

自定义公共组件

  • icon-box

  • 使用示例

<template>
<icon-box
:visible.sync="iconBoxVisible"
ref="iconBox"
:current="dataForm.icon"
@choiceIcon="choiceIcon"
/>
</template>

<script>
export default {
data() {
return {
iconBoxVisible: false,
dataForm: {
icon: ""
},
}
},
methods: {
choiceIcon() {

},
},
}
</script>
  • 配置项
参数说明类型默认值可选值
current图标库类型String''----

富文本组件

自定义公共组件

  • Quill

  • 使用示例

<template>
<quill
v-model="dataForm.description"
placeholder="请输入内容..."
>
</quill>
</template>

<script>
export default {
data() {
return {
iconBoxVisible: false,
dataForm: {
description: ""
},
}
},
}
</script>
  • 配置项
参数说明类型默认值可选值
disabled是否禁用Booleanfalsetrue/false
prefixCls自定义类名Stringjsbos-editor-quill----
value富文本值String----
placeholder占位符字符串String请输入内容...----

表格宽松度组件

自定义公共组件

  • TableSizeSetting

  • 无配置项

  • 使用方法

<TableSizeSetting @input="getSize" />

树形穿梭框组件

自定义公共组件

  • tree-transfer

  • 使用示例

<template>
<tree-transfer
:from_data="dataSourceTables"
:to_data="dataSelectTables"
:filter="true"
:openAll="true"
@addBtn="handleSourceChange"
@removeBtn="handleSourceChange"
:highLight="true"
v-loading="sourceTablesLoading"
:defaultProps="defaultTreeProperties"
:title="['已存在的表','要同步的表']">
</tree-transfer>
</template>

<script>
export default {
data() {
return {
dataSourceTables: [],
dataSelectTables: [],
sourceTablesLoading: false,
defaultTreeProperties: {
label: 'name',
children: 'dataTableModels'
},
}
},
methods: {
handleSourceChange() {

},
},
}
</script>
  • 配置项
参数说明类型默认值可选值
width宽度String100%----
height高度String320px----
title标题Array["源列表", "目标列表"]----
button_text穿梭按钮名字Array[]----
from_data源数据Array[]----
to_data选中数据Array[]----
defaultPropstree 配置项Object{ label: "fullName", children: "children" }----
node_keytree node-key 必须唯一Stringid----
pidpid参数名StringparentId----
filter是否启用筛选Booleanfalse----
openAll是否展开所有节点Booleanfalse----
renderContentLeft左侧自定义树节点Function--------
renderContentRight右侧自定义树节点Function--------
transferOpenNode是否展开节点Booleantrue----
defaultCheckedKeys源数据 默认选中节点Array[]----
defaultExpandedKeys源数据 默认展开节点Array[]----
placeholder筛选placeholderString输入关键词----
filterNode自定义筛选函数Function--------
defaultTransfer默认穿梭一次默认选中数据Booleanfalse----
arrayToTree是否开启arrayToTreeBooleanfalse----
lazy是否启用懒加载Booleanfalse----
lazyRight右侧是否启用懒加载Booleanfalse----
lazyFn懒加载的回调函数Function----
highLight是否高亮当前选中节点Booleanfalse----

省市区组件

自定义公共组件

  • Address

  • 使用示例

<template>
<Address
v-model="dataForm.filedValue"
placeholder="请选择"
:level="item.level"
clearable
@change="onConditionListChange(arguments, item)"
/>
</template>

<script>
export default {
data() {
return {
dataForm: {
filedValue: "",
level: ""
},
}
},
methods: {
onConditionListChange() {

},
},
}
</script>
  • 配置项
参数说明类型默认值可选值
value数据绑定Array[]----
level选择层级Number2----
placeholder占位符提示文案String请选择----
disabled是否禁用Booleanfalse----
multiple是否支持多选Booleanfalse----
clearable是否可以清空选项Booleanfalse----
collapseTags是否折叠隐藏选中数据Booleanfalse-