@aochuang/common 1.0.0 → 1.0.1
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/common/loading/index.js +7 -0
- package/common/loading/loading.vue +71 -0
- package/common/tips/index.js +7 -0
- package/common/tips/tips.vue +82 -0
- package/common/tooltip/index.js +7 -0
- package/common/tooltip/popper.js +18 -0
- package/common/tooltip/tooltip.vue +55 -0
- package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-boolean.vue +33 -0
- package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-date-range.vue +30 -0
- package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-date.vue +41 -0
- package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-datetime-range.vue +34 -0
- package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-datetime.vue +41 -0
- package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-number-range.vue +67 -0
- package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-number.vue +35 -0
- package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-string.vue +41 -0
- package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item-value.vue +73 -0
- package/components/advanced-filter/advanced-filter-condition-item/advanced-filter-condition-item.vue +226 -0
- package/components/advanced-filter/advanced-filter-condition-toggle.vue +112 -0
- package/components/advanced-filter/advanced-filter-condition.vue +352 -0
- package/components/advanced-filter/advanced-filter-permanent-item.vue +10 -0
- package/components/advanced-filter/advanced-filter-permanent.vue +10 -0
- package/components/advanced-filter/advanced-filter-scene-form.vue +95 -0
- package/components/advanced-filter/advanced-filter-scene-item.vue +64 -0
- package/components/advanced-filter/advanced-filter-scene-manage.vue +264 -0
- package/components/advanced-filter/advanced-filter-scene-transfer.vue +283 -0
- package/components/advanced-filter/advanced-filter-scene.vue +199 -0
- package/components/advanced-filter/advanced-filter.vue +114 -0
- package/components/advanced-filter/index.js +36 -0
- package/components/advanced-filter/utils.js +132 -0
- package/components/autocomplete/autocomplete.vue +121 -0
- package/components/autocomplete/index.js +7 -0
- package/components/avatar/avatar.png +0 -0
- package/components/avatar/avatar.vue +212 -0
- package/components/avatar/index.js +7 -0
- package/components/brick-wall/brick-wall-skeleton.vue +125 -0
- package/components/brick-wall/brick-wall.vue +293 -0
- package/components/brick-wall/index.js +7 -0
- package/components/button/button.vue +537 -0
- package/components/button/index.js +7 -0
- package/components/button/utils.js +20 -0
- package/components/cascader/cascader.vue +184 -0
- package/components/cascader/index.js +7 -0
- package/components/cascader/util.js +50 -0
- package/components/checkbox/checkbox.vue +114 -0
- package/components/checkbox/index.js +7 -0
- package/components/checkbox-button/index.js +8 -0
- package/components/checkbox-group/checkbox-group.vue +11 -0
- package/components/checkbox-group/index.js +7 -0
- package/components/date-picker/date-picker.vue +300 -0
- package/components/date-picker/index.js +7 -0
- package/components/dialog/dialog.vue +182 -0
- package/components/dialog/index.js +14 -0
- package/components/dialog/utils.js +20 -0
- package/components/drawer/drawer.vue +186 -0
- package/components/drawer/index.js +14 -0
- package/components/drawer/utils.js +36 -0
- package/components/dropdown/dropdown-item.vue +63 -0
- package/components/dropdown/dropdown.vue +286 -0
- package/components/dropdown/index.js +16 -0
- package/components/empty/empty.vue +62 -0
- package/components/empty/index.js +7 -0
- package/components/filter/filter-group.vue +44 -0
- package/components/filter/filter-item.vue +122 -0
- package/components/filter/filter-more.vue +114 -0
- package/components/filter/filter.vue +407 -0
- package/components/filter/index.js +20 -0
- package/components/filter/refresh-line.svg +1 -0
- package/components/filter/util.js +5 -0
- package/components/form/form-cell.vue +231 -0
- package/components/form/form-group.vue +147 -0
- package/components/form/form-row.vue +51 -0
- package/components/form/form.vue +256 -0
- package/components/form/index.js +13 -0
- package/components/grid/grid-card-view/grid-card-view.vue +157 -0
- package/components/grid/grid-column.vue +136 -0
- package/components/grid/grid-filter/grid-filter-group.vue +41 -0
- package/components/grid/grid-filter/grid-filter-item.vue +68 -0
- package/components/grid/grid-filter/grid-filter.vue +115 -0
- package/components/grid/grid-filter/util.js +7 -0
- package/components/grid/grid-filter-operate/grid-filter-operate-item.vue +55 -0
- package/components/grid/grid-filter-operate/grid-filter-operate.vue +46 -0
- package/components/grid/grid-sort/grid-sort-proxy.js +27 -0
- package/components/grid/grid-sort/grid-sort.vue +205 -0
- package/components/grid/grid-sort/icons/asc.png +0 -0
- package/components/grid/grid-sort/icons/desc.png +0 -0
- package/components/grid/grid-sort/index.js +7 -0
- package/components/grid/grid-table-view/grid-table-view.vue +178 -0
- package/components/grid/grid-table.vue +547 -0
- package/components/grid/grid-toolbar/grid-batch-toolbar-proxy.js +21 -0
- package/components/grid/grid-toolbar/grid-batch-toolbar.vue +129 -0
- package/components/grid/grid-toolbar/grid-global-toolbar-proxy.js +21 -0
- package/components/grid/grid-toolbar/grid-global-toolbar.vue +37 -0
- package/components/grid/grid-toolbar/grid-more-toolbar-proxy.js +21 -0
- package/components/grid/grid-toolbar/grid-more-toolbar.vue +138 -0
- package/components/grid/grid-toolbar/grid-row-toolbar.vue +279 -0
- package/components/grid/grid-view-select.vue +78 -0
- package/components/grid/grid.vue +1102 -0
- package/components/grid/icons/more-line.svg +1 -0
- package/components/grid/icons/refresh.svg +14 -0
- package/components/grid/index.js +61 -0
- package/components/grid/util.js +31 -0
- package/components/icon/demo.css +539 -0
- package/components/icon/demo_index.html +7433 -0
- package/components/icon/icon.vue +96 -0
- package/components/icon/iconfont.css +1275 -0
- package/components/icon/iconfont.eot +0 -0
- package/components/icon/iconfont.js +1 -0
- package/components/icon/iconfont.json +2214 -0
- package/components/icon/iconfont.svg +455 -0
- package/components/icon/iconfont.ttf +0 -0
- package/components/icon/iconfont.woff +0 -0
- package/components/icon/iconfont.woff2 +0 -0
- package/components/icon/index.js +7 -0
- package/components/image/image.vue +299 -0
- package/components/image/index.js +12 -0
- package/components/image/util.js +26 -0
- package/components/index.js +153 -0
- package/components/loading/index.js +7 -0
- package/components/loading/loading.vue +130 -0
- package/components/menu/index.js +14 -0
- package/components/menu/menu-group.vue +240 -0
- package/components/menu/menu-item.vue +215 -0
- package/components/menu/menu.vue +64 -0
- package/components/message/index.js +19 -0
- package/components/message/message.js +28 -0
- package/components/message/message.less +6 -0
- package/components/message-box/index.js +10 -0
- package/components/message-box/message-box.js +140 -0
- package/components/message-box/message-box.less +5 -0
- package/components/pagination/index.js +7 -0
- package/components/pagination/pagination.vue +193 -0
- package/components/panel/index.js +7 -0
- package/components/panel/panel.vue +44 -0
- package/components/popover/index.js +7 -0
- package/components/popover/popover.vue +140 -0
- package/components/popup-select/index.js +7 -0
- package/components/popup-select/popup-select.vue +114 -0
- package/components/radio/index.js +7 -0
- package/components/radio/radio.vue +92 -0
- package/components/radio-button/index.js +7 -0
- package/components/radio-button/radio-button.vue +20 -0
- package/components/radio-group/index.js +7 -0
- package/components/radio-group/radio-group.vue +22 -0
- package/components/searchbox/index.js +7 -0
- package/components/searchbox/searchbox.vue +260 -0
- package/components/select/index.js +9 -0
- package/components/select/select-load-more.vue +53 -0
- package/components/select/select.vue +572 -0
- package/components/skeleton/index.js +14 -0
- package/components/skeleton/skeleton-rows.vue +52 -0
- package/components/skeleton/skeleton.vue +72 -0
- package/components/sortable/index.js +9 -0
- package/components/sortable/sortable-item.vue +77 -0
- package/components/sortable/sortable.vue +62 -0
- package/components/spinner/index.js +7 -0
- package/components/spinner/spinner.vue +121 -0
- package/components/spinner-range/index.js +7 -0
- package/components/spinner-range/spinner-range.vue +97 -0
- package/components/spinner-textarea/index.js +7 -0
- package/components/spinner-textarea/spinner-textarea.vue +65 -0
- package/components/switch/index.js +7 -0
- package/components/switch/switch.vue +105 -0
- package/components/tabs/index.js +10 -0
- package/components/tabs/tabs.vue +115 -0
- package/components/tag/index.js +9 -0
- package/components/tag/tag.less +30 -0
- package/components/text/index.js +7 -0
- package/components/text/text.vue +69 -0
- package/components/textarea/index.js +7 -0
- package/components/textarea/textarea.vue +229 -0
- package/components/textbox/index.js +7 -0
- package/components/textbox/textbox.vue +275 -0
- package/components/time-picker/index.js +7 -0
- package/components/time-picker/time-picker.vue +77 -0
- package/components/toolbar/index.js +14 -0
- package/components/toolbar/toolbar-item.vue +43 -0
- package/components/toolbar/toolbar.vue +81 -0
- package/components/tooltip/index.js +9 -0
- package/components/tooltip/tooltip.vue +86 -0
- package/components/transfer/index.js +7 -0
- package/components/transfer/transfer-load-more.vue +53 -0
- package/components/transfer/transfer.vue +245 -0
- package/components/tree/index.js +7 -0
- package/components/tree/tree.vue +326 -0
- package/components/tree/utils.js +122 -0
- package/components/video/index.js +7 -0
- package/components/video/video.vue +53 -0
- package/package.json +4 -1
- package/utils/date.js +55 -0
- package/utils/emitter.js +3 -0
- package/utils/json.js +19 -0
- package/utils/resize-event.js +35 -0
- package/utils/util.js +12 -0
- package/utils/utils.js +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-radio
|
|
3
|
+
class="ui-radio"
|
|
4
|
+
:class="{'is-viewable': !editable}"
|
|
5
|
+
v-bind="$props"
|
|
6
|
+
v-model="innerValue"
|
|
7
|
+
><slot></slot></el-radio>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import ElRadio from 'element-ui/lib/radio'
|
|
12
|
+
import 'element-ui/lib/theme-chalk/radio.css'
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
name: 'UiRadio',
|
|
16
|
+
components: {
|
|
17
|
+
ElRadio
|
|
18
|
+
},
|
|
19
|
+
props: Object.assign({}, ElRadio.props),
|
|
20
|
+
inject: {
|
|
21
|
+
UiRadioGroup: {
|
|
22
|
+
default: null
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
computed: {
|
|
26
|
+
innerValue: {
|
|
27
|
+
get () {
|
|
28
|
+
return this.value
|
|
29
|
+
},
|
|
30
|
+
set (val) {
|
|
31
|
+
this.$emit('input', val)
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
editable () {
|
|
35
|
+
if (!this.UiRadioGroup) {
|
|
36
|
+
return true
|
|
37
|
+
}
|
|
38
|
+
return this.UiRadioGroup.editable
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
<style lang="less">
|
|
44
|
+
body {
|
|
45
|
+
.el-radio{
|
|
46
|
+
margin-right: 20px;
|
|
47
|
+
}
|
|
48
|
+
.el-radio__label{
|
|
49
|
+
font-size: 14px;
|
|
50
|
+
}
|
|
51
|
+
.el-radio__inner{
|
|
52
|
+
width: 16px;
|
|
53
|
+
height: 16px;
|
|
54
|
+
border-width: 2px;
|
|
55
|
+
box-sizing: border-box;
|
|
56
|
+
&:after{
|
|
57
|
+
width: 8px;
|
|
58
|
+
height: 8px;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
.el-radio{
|
|
62
|
+
line-height: 32px;
|
|
63
|
+
}
|
|
64
|
+
.el-radio__input{
|
|
65
|
+
vertical-align: top;
|
|
66
|
+
margin-top: 8px;
|
|
67
|
+
line-height: 1em;
|
|
68
|
+
}
|
|
69
|
+
.el-radio__input.is-checked+.el-radio__label{
|
|
70
|
+
color: #404040;
|
|
71
|
+
}
|
|
72
|
+
.el-radio-button.el-radio-button--small{
|
|
73
|
+
.el-radio-button__inner{
|
|
74
|
+
padding-top: 6px;
|
|
75
|
+
padding-bottom: 6px;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
.ui-radio{
|
|
80
|
+
&.is-viewable{
|
|
81
|
+
&:not(.is-checked) {
|
|
82
|
+
display: none;
|
|
83
|
+
}
|
|
84
|
+
.el-radio__input{
|
|
85
|
+
display: none;
|
|
86
|
+
}
|
|
87
|
+
.el-radio__label{
|
|
88
|
+
padding-left: 0;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import ElRadioButton from 'element-ui/lib/radio-button'
|
|
3
|
+
import 'element-ui/lib/theme-chalk/radio-button.css'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
...ElRadioButton,
|
|
7
|
+
name: 'UiRadioButton',
|
|
8
|
+
props: {
|
|
9
|
+
...ElRadioButton.props
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
<style lang="less">
|
|
14
|
+
body {
|
|
15
|
+
.el-radio-button--small .el-radio-button__inner{
|
|
16
|
+
padding-left: 12px;
|
|
17
|
+
padding-right: 12px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import ElRadioGroup from 'element-ui/lib/radio-group'
|
|
3
|
+
import 'element-ui/lib/theme-chalk/radio-group.css'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
...ElRadioGroup,
|
|
7
|
+
name: 'UiRadioGroup',
|
|
8
|
+
mixins: [].concat(ElRadioGroup.mixins || [], [{
|
|
9
|
+
props: {
|
|
10
|
+
editable: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: true
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
provide () {
|
|
16
|
+
return {
|
|
17
|
+
UiRadioGroup: this
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}])
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ui-searchbox" :class="['ui-searchbox--' + type]" :style="style">
|
|
3
|
+
<ui-textbox
|
|
4
|
+
class="ui-searchbox__input"
|
|
5
|
+
ref="textbox"
|
|
6
|
+
v-model.trim="keyword"
|
|
7
|
+
:readonly="innerLoading"
|
|
8
|
+
:placeholder="placeholder"
|
|
9
|
+
:validate-event="false"
|
|
10
|
+
:maxlength="null"
|
|
11
|
+
@keyup.native.enter="handleNativeEnter"
|
|
12
|
+
@input="handleInput"
|
|
13
|
+
@blur="handleBlur"
|
|
14
|
+
>
|
|
15
|
+
<span key="loading" v-if="innerLoading" slot="suffix" class="ui-searchbox__btn is-loading">
|
|
16
|
+
<ui-icon name="loading"></ui-icon>
|
|
17
|
+
</span>
|
|
18
|
+
<span key="clear" v-else-if="showClear" slot="suffix" class="ui-searchbox__btn is-clear" @click="handleClear" title="清除搜索">
|
|
19
|
+
<ui-icon name="error"></ui-icon>
|
|
20
|
+
</span>
|
|
21
|
+
<span key="search" v-else slot="suffix" class="ui-searchbox__btn is-search" title="点击搜索">
|
|
22
|
+
<ui-icon name="sousuo"></ui-icon>
|
|
23
|
+
</span>
|
|
24
|
+
</ui-textbox>
|
|
25
|
+
</div>
|
|
26
|
+
</template>
|
|
27
|
+
<script>
|
|
28
|
+
import UiIcon from '../icon/icon'
|
|
29
|
+
import UiTextbox from '../textbox'
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
name: 'UiSearchbox',
|
|
33
|
+
components: {
|
|
34
|
+
UiIcon,
|
|
35
|
+
UiTextbox
|
|
36
|
+
},
|
|
37
|
+
props: {
|
|
38
|
+
mode: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: 'alone',
|
|
41
|
+
validator: (val) => {
|
|
42
|
+
return ['merge', 'alone'].indexOf(val) >= 0
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
width: {
|
|
46
|
+
type: String
|
|
47
|
+
},
|
|
48
|
+
loading: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false
|
|
51
|
+
},
|
|
52
|
+
value: {
|
|
53
|
+
type: String
|
|
54
|
+
},
|
|
55
|
+
data: {
|
|
56
|
+
type: Array,
|
|
57
|
+
default: () => []
|
|
58
|
+
},
|
|
59
|
+
placeholder: {
|
|
60
|
+
type: String
|
|
61
|
+
},
|
|
62
|
+
props: {
|
|
63
|
+
type: Array,
|
|
64
|
+
default: () => []
|
|
65
|
+
},
|
|
66
|
+
immediate: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false
|
|
69
|
+
},
|
|
70
|
+
type: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: 'border',
|
|
73
|
+
validator (value) {
|
|
74
|
+
return ['border', 'background'].indexOf(value) >= 0
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
submitMethod: {
|
|
78
|
+
type: Function
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
data () {
|
|
82
|
+
return {
|
|
83
|
+
keyword: '',
|
|
84
|
+
innerLoading: this.loading
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
computed: {
|
|
88
|
+
innerValue: {
|
|
89
|
+
get () {
|
|
90
|
+
return this.value
|
|
91
|
+
},
|
|
92
|
+
set (val) {
|
|
93
|
+
this.$emit('input', val)
|
|
94
|
+
this.handleSearch(val)
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
style () {
|
|
98
|
+
const sy = {}
|
|
99
|
+
if (this.width) {
|
|
100
|
+
sy.width = this.width
|
|
101
|
+
}
|
|
102
|
+
return sy
|
|
103
|
+
},
|
|
104
|
+
showClear () {
|
|
105
|
+
return this.value === this.keyword && (this.value !== '' && this.keyword !== '')
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
watch: {
|
|
109
|
+
value: {
|
|
110
|
+
immediate: true,
|
|
111
|
+
handler (val) {
|
|
112
|
+
this.keyword = val ? String(val).trim() : ''
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
loading () {
|
|
116
|
+
this.innerLoading = this.loading
|
|
117
|
+
},
|
|
118
|
+
data () {
|
|
119
|
+
this.search()
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
methods: {
|
|
123
|
+
handleSearch () {
|
|
124
|
+
this.doSearch()
|
|
125
|
+
},
|
|
126
|
+
handleClear () {
|
|
127
|
+
this.doSearch(() => {
|
|
128
|
+
this.keyword = ''
|
|
129
|
+
})
|
|
130
|
+
},
|
|
131
|
+
handleInput () {
|
|
132
|
+
if (this.immediate) {
|
|
133
|
+
this.doSearch()
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
handleBlur () {
|
|
137
|
+
// 避免失去焦点就触发搜索,但是还是需要保留重复点击搜索框能够触发搜索的逻辑
|
|
138
|
+
if (this.value === this.keyword) {
|
|
139
|
+
return
|
|
140
|
+
}
|
|
141
|
+
// blur时增加延时,优先清空和搜索图标点击的逻辑
|
|
142
|
+
this._blurSearch = setTimeout(() => {
|
|
143
|
+
this.doSearch()
|
|
144
|
+
})
|
|
145
|
+
},
|
|
146
|
+
handleNativeEnter () {
|
|
147
|
+
this.doSearch()
|
|
148
|
+
},
|
|
149
|
+
doSearch (callback) {
|
|
150
|
+
if (this._disableSearch) {
|
|
151
|
+
return
|
|
152
|
+
}
|
|
153
|
+
callback && callback()
|
|
154
|
+
this.search()
|
|
155
|
+
this._disableSearch = true
|
|
156
|
+
this._searchTimer = setTimeout(() => {
|
|
157
|
+
this._disableSearch = false
|
|
158
|
+
}, 20)
|
|
159
|
+
},
|
|
160
|
+
search () {
|
|
161
|
+
let result
|
|
162
|
+
if (!this.keyword || !this.props || !this.props.length) {
|
|
163
|
+
result = this.data
|
|
164
|
+
} else if (Array.isArray(this.data)) {
|
|
165
|
+
result = this.data.filter(v => {
|
|
166
|
+
return this.props.some(p => String(v[p]).indexOf(this.keyword) >= 0)
|
|
167
|
+
})
|
|
168
|
+
}
|
|
169
|
+
result = result || []
|
|
170
|
+
this.$emit('input', this.keyword)
|
|
171
|
+
this.$emit('search', {
|
|
172
|
+
keyword: this.keyword,
|
|
173
|
+
result
|
|
174
|
+
})
|
|
175
|
+
if (this.submitMethod) {
|
|
176
|
+
this.innerLoading = true
|
|
177
|
+
this.submitMethod().finally(() => {
|
|
178
|
+
this.innerLoading = false
|
|
179
|
+
})
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
focus () {
|
|
183
|
+
this.$refs.textbox && this.$refs.textbox.focus()
|
|
184
|
+
}
|
|
185
|
+
},
|
|
186
|
+
beforeDestroy () {
|
|
187
|
+
clearTimeout(this._timer)
|
|
188
|
+
clearTimeout(this._blurSearch)
|
|
189
|
+
clearTimeout(this._searchTimer)
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
</script>
|
|
193
|
+
<style lang="less">
|
|
194
|
+
.ui-searchbox{
|
|
195
|
+
width: 100%;
|
|
196
|
+
}
|
|
197
|
+
.ui-searchbox__props{
|
|
198
|
+
margin-right: 9px;
|
|
199
|
+
.ui-button.el-button--text{
|
|
200
|
+
color: #333;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
.ui-searchbox__input.el-input{
|
|
204
|
+
.el-input__suffix{
|
|
205
|
+
right: 0;
|
|
206
|
+
}
|
|
207
|
+
.el-input-group__prepend{
|
|
208
|
+
background-color: transparent;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
.ui-searchbox__btn{
|
|
212
|
+
display: inline-block;
|
|
213
|
+
text-align: center;
|
|
214
|
+
vertical-align: top;
|
|
215
|
+
cursor: pointer;
|
|
216
|
+
&.is-loading{
|
|
217
|
+
height: 30px;
|
|
218
|
+
width: 30px;
|
|
219
|
+
line-height: 30px;
|
|
220
|
+
}
|
|
221
|
+
&.is-search{
|
|
222
|
+
height: 30px;
|
|
223
|
+
width: 30px;
|
|
224
|
+
line-height: 30px;
|
|
225
|
+
transition: color .3s cubic-bezier(.645,.045,.355,1);
|
|
226
|
+
&:hover{
|
|
227
|
+
color: #666;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
&.is-clear{
|
|
231
|
+
width: 14px;
|
|
232
|
+
height: 14px;
|
|
233
|
+
border-radius: 50%;
|
|
234
|
+
text-align: center;
|
|
235
|
+
line-height: 14px;
|
|
236
|
+
background-color: #ccc;
|
|
237
|
+
color: #fff;
|
|
238
|
+
margin-top: 8px;
|
|
239
|
+
margin-right: 8px;
|
|
240
|
+
.ui-icon{
|
|
241
|
+
font-size: 12px;
|
|
242
|
+
display: inline-block;
|
|
243
|
+
vertical-align: top;
|
|
244
|
+
margin-top: 1px;
|
|
245
|
+
}
|
|
246
|
+
&:hover{
|
|
247
|
+
color: #fff;
|
|
248
|
+
background-color: #999;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
.ui-searchbox--background{
|
|
253
|
+
.ui-searchbox__input{
|
|
254
|
+
.el-input__inner{
|
|
255
|
+
border-color: transparent;
|
|
256
|
+
background-color: #F9FAFB;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
</style>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ui-select-load-more">
|
|
3
|
+
<div class="ui-select-load-more__loading" v-if="status === 'loading'">
|
|
4
|
+
<ui-icon name="loading"></ui-icon> 正在加载
|
|
5
|
+
</div>
|
|
6
|
+
<div class="ui-select-load-more__loadmore" v-if="status === 'loadmore'" @click="handleLoadMoreClick">点击加载更多</div>
|
|
7
|
+
<div class="ui-select-load-more__nomore" v-if="status === 'nomore'">没有更多了</div>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
name: 'UiSelectLoadMore',
|
|
14
|
+
props: {
|
|
15
|
+
status: {
|
|
16
|
+
type: String,
|
|
17
|
+
value: 'loadmore',
|
|
18
|
+
validator (value) {
|
|
19
|
+
return ['loadmore', 'loading', 'nomore']
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
methods: {
|
|
24
|
+
handleLoadMoreClick () {
|
|
25
|
+
this.$emit('loadmore')
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<style lang="less">
|
|
32
|
+
.ui-select-load-more{
|
|
33
|
+
height: 24px;
|
|
34
|
+
line-height: 24px;
|
|
35
|
+
padding: 4px 12px;
|
|
36
|
+
text-align: center;
|
|
37
|
+
color: #999;
|
|
38
|
+
font-size: 12px;
|
|
39
|
+
box-sizing: content-box!important;
|
|
40
|
+
}
|
|
41
|
+
.ui-select-load-more__loading,
|
|
42
|
+
.ui-select-load-more__loadmore,
|
|
43
|
+
.ui-select-load-more__nomore{
|
|
44
|
+
display: inline-block;
|
|
45
|
+
position: relative;
|
|
46
|
+
}
|
|
47
|
+
.ui-select-load-more__loadmore{
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
&:hover {
|
|
50
|
+
color: #4389fa;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
</style>
|