vsyswin-ui 0.2.60 → 0.2.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/vsyswin-ui.common.js +331 -54
- package/lib/vsyswin-ui.common.js.map +1 -1
- package/lib/vsyswin-ui.umd.js +331 -54
- package/lib/vsyswin-ui.umd.js.map +1 -1
- package/lib/vsyswin-ui.umd.min.js +39 -39
- package/lib/vsyswin-ui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/packages/button-ellipsis/index.js +14 -0
- package/packages/button-ellipsis/src/button-container.vue +72 -0
- package/packages/button-ellipsis/src/button-item.vue +15 -0
- package/packages/button-ellipsis/src/button-list.vue +36 -0
- package/packages/index.js +6 -1
- package/packages/search-bar/src/search-bar.vue +12 -0
package/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
import buttonList from './src/button-list.vue'
|
|
3
|
+
import buttonItem from './src/button-item.vue'
|
|
4
|
+
|
|
5
|
+
// 为组件提供 install 安装方法,供按需引入
|
|
6
|
+
buttonList.install = function (Vue) {
|
|
7
|
+
Vue.component(buttonList.name, buttonList)
|
|
8
|
+
}
|
|
9
|
+
buttonItem.install = function (Vue) {
|
|
10
|
+
Vue.component(buttonItem.name, buttonItem)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// 默认导出组件
|
|
14
|
+
export default { buttonList, buttonItem }
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export default {
|
|
3
|
+
name: 'SyButtonContainer',
|
|
4
|
+
props: {
|
|
5
|
+
buttons: {
|
|
6
|
+
type: Array,
|
|
7
|
+
default: () => []
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
computed: {
|
|
11
|
+
trigger() {
|
|
12
|
+
return this.$parent.trigger
|
|
13
|
+
},
|
|
14
|
+
num() {
|
|
15
|
+
return this.$parent.num
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
render(h) {
|
|
19
|
+
let contents = []
|
|
20
|
+
if (this.buttons.length <= this.num) {
|
|
21
|
+
contents = this.buttons.map((btn) => {
|
|
22
|
+
return btn.$slots.default
|
|
23
|
+
})
|
|
24
|
+
} else {
|
|
25
|
+
const idx = this.num - 1
|
|
26
|
+
const preBtns = this.buttons.slice(0, idx).map((btn) => btn.$slots.default)
|
|
27
|
+
const moreBtns = this.buttons.slice(idx).map((btn) => {
|
|
28
|
+
const slotDefault = btn.$slots.default
|
|
29
|
+
const elBtn = slotDefault[0].componentOptions.children[0]
|
|
30
|
+
const listenersFn = slotDefault[0].componentOptions.listeners.click
|
|
31
|
+
const icon = slotDefault[0].componentOptions.propsData.icon || ''
|
|
32
|
+
const text = elBtn.text
|
|
33
|
+
return h(
|
|
34
|
+
'el-dropdown-item',
|
|
35
|
+
{
|
|
36
|
+
props: { icon },
|
|
37
|
+
nativeOn: {
|
|
38
|
+
click: listenersFn
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
[text]
|
|
42
|
+
)
|
|
43
|
+
})
|
|
44
|
+
const moreDiv = h('div', { class: 'sy-button-dots' }, [h('i', { class: 'el-icon-more' })])
|
|
45
|
+
const dropDown = h(
|
|
46
|
+
'el-dropdown',
|
|
47
|
+
{
|
|
48
|
+
props: { trigger: this.trigger, size: 'medium', placement: 'bottom-end' }
|
|
49
|
+
},
|
|
50
|
+
[moreDiv, h('el-dropdown-menu', { slot: 'dropdown' }, moreBtns)]
|
|
51
|
+
)
|
|
52
|
+
contents = [...preBtns, dropDown]
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return h(
|
|
56
|
+
'div',
|
|
57
|
+
{
|
|
58
|
+
class: 'sy-buttons'
|
|
59
|
+
},
|
|
60
|
+
contents
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</script>
|
|
65
|
+
|
|
66
|
+
<style lang="scss" scoped>
|
|
67
|
+
.sy-button-dots {
|
|
68
|
+
width: 18px;
|
|
69
|
+
height: 18px;
|
|
70
|
+
cursor: pointer;
|
|
71
|
+
}
|
|
72
|
+
</style>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sy-btn-ellipsis">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
<button-container :buttons="buttons"></button-container>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
import buttonContainer from './button-container.vue'
|
|
10
|
+
export default {
|
|
11
|
+
name: 'SyButtonList',
|
|
12
|
+
components: { buttonContainer },
|
|
13
|
+
props: {
|
|
14
|
+
// 触发下拉框的方式
|
|
15
|
+
trigger: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: 'hover',
|
|
18
|
+
validator: (value) => ['hover', 'click'].includes(value)
|
|
19
|
+
},
|
|
20
|
+
// 最多显示多少数量的按钮,超过此数量是显示下拉菜单
|
|
21
|
+
num: {
|
|
22
|
+
type: Number,
|
|
23
|
+
default: 3
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
data() {
|
|
27
|
+
return {
|
|
28
|
+
buttons: []
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<style lang="scss" scoped>
|
|
35
|
+
|
|
36
|
+
</style>
|
package/packages/index.js
CHANGED
|
@@ -13,9 +13,12 @@ import paging from './paging'
|
|
|
13
13
|
import newSearchBar from './newSearchBar' // 高级筛选
|
|
14
14
|
import table from './table' // 表格组件
|
|
15
15
|
import dragSet from './drag-set'
|
|
16
|
+
import buttonEllipsis from './button-ellipsis'
|
|
17
|
+
|
|
18
|
+
const { buttonList, buttonItem } = buttonEllipsis
|
|
16
19
|
|
|
17
20
|
// 存储组件列表
|
|
18
|
-
const components = [layout, searchTree, selectProject, selectTree, SearchBar, simpleSearchBar, inputMore, paging, newSearchBar, table, dragSet]
|
|
21
|
+
const components = [layout, searchTree, selectProject, selectTree, buttonItem, buttonList, SearchBar, simpleSearchBar, inputMore, paging, newSearchBar, table, dragSet]
|
|
19
22
|
|
|
20
23
|
// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
|
|
21
24
|
const install = function (Vue) {
|
|
@@ -38,6 +41,8 @@ export default {
|
|
|
38
41
|
searchTree,
|
|
39
42
|
selectProject,
|
|
40
43
|
selectTree,
|
|
44
|
+
buttonItem,
|
|
45
|
+
buttonList,
|
|
41
46
|
SearchBar,
|
|
42
47
|
simpleSearchBar,
|
|
43
48
|
inputMore,
|
|
@@ -493,6 +493,18 @@ export default {
|
|
|
493
493
|
})
|
|
494
494
|
return list
|
|
495
495
|
},
|
|
496
|
+
// 设置底部标签,比如日期重新设置了值,但是底部没有标签,使用该方法来生成
|
|
497
|
+
/*
|
|
498
|
+
this.$set(this.searchList[10].itemList[0], 'value', [1649865600000, 1657727999000])
|
|
499
|
+
this.$set(this.searchList[10].itemList[0], 'isActive', true)
|
|
500
|
+
this.$nextTick(() => {
|
|
501
|
+
this.$refs.searchbarRef.setTagList()
|
|
502
|
+
})
|
|
503
|
+
*/
|
|
504
|
+
setTagList() {
|
|
505
|
+
const filterList = this.createTagList()
|
|
506
|
+
this.tagList = filterList
|
|
507
|
+
},
|
|
496
508
|
// 搜索按钮
|
|
497
509
|
handleSearch(skipShrink) {
|
|
498
510
|
if (this.$slots.default) {
|