@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,30 @@
|
|
|
1
|
+
body {
|
|
2
|
+
.el-tag {
|
|
3
|
+
white-space: break-spaces;
|
|
4
|
+
min-height: 20px;
|
|
5
|
+
line-height: 22px;
|
|
6
|
+
padding-left: 8px;
|
|
7
|
+
padding-right: 8px;
|
|
8
|
+
height: auto;
|
|
9
|
+
}
|
|
10
|
+
.el-tag.el-tag--primary{
|
|
11
|
+
color: #409EFF;
|
|
12
|
+
background-color: #ecf5ff;
|
|
13
|
+
}
|
|
14
|
+
.el-tag.el-tag--success{
|
|
15
|
+
color: #67C23A;
|
|
16
|
+
background-color: #f0f9eb;
|
|
17
|
+
}
|
|
18
|
+
.el-tag.el-tag--warning{
|
|
19
|
+
color: #E6A23C;
|
|
20
|
+
background-color: #fdf6ec;
|
|
21
|
+
}
|
|
22
|
+
.el-tag.el-tag--danger{
|
|
23
|
+
color: #F56C6C;
|
|
24
|
+
background-color: #fef0f0;
|
|
25
|
+
}
|
|
26
|
+
.el-tag.el-tag--info{
|
|
27
|
+
color: #172b4d;
|
|
28
|
+
background-color: #e6e6ea;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export default {
|
|
3
|
+
name: 'UiText',
|
|
4
|
+
functional: true,
|
|
5
|
+
props: {
|
|
6
|
+
icon: {
|
|
7
|
+
type: String
|
|
8
|
+
},
|
|
9
|
+
lineClamp: {
|
|
10
|
+
type: Number
|
|
11
|
+
},
|
|
12
|
+
type: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: 'default',
|
|
15
|
+
validator (value) {
|
|
16
|
+
return ['default', 'info', 'primary', 'success', 'danger', 'warning'].includes(value)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
render (h, c) {
|
|
21
|
+
const style = {}
|
|
22
|
+
if (c.props.lineClamp) {
|
|
23
|
+
style.display = '-webkit-box'
|
|
24
|
+
style.overflow = 'hidden'
|
|
25
|
+
style['text-overflow'] = 'ellipsis'
|
|
26
|
+
style['-webkit-line-clamp'] = c.props.lineClamp
|
|
27
|
+
style['-webkit-box-orient'] = 'vertical'
|
|
28
|
+
}
|
|
29
|
+
return h('span', {
|
|
30
|
+
class: ['ui-text', 'ui-text--' + c.props.type, c.data.class],
|
|
31
|
+
style
|
|
32
|
+
}, [
|
|
33
|
+
c.props.icon ? h('ui-icon', {
|
|
34
|
+
props: {
|
|
35
|
+
class: 'ui-text__icon',
|
|
36
|
+
name: c.props.icon
|
|
37
|
+
}
|
|
38
|
+
}) : null,
|
|
39
|
+
c.scopedSlots.default ? c.scopedSlots.default() : null
|
|
40
|
+
])
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
</script>
|
|
44
|
+
<style lang="less">
|
|
45
|
+
.ui-text {
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: row;
|
|
48
|
+
align-items: center;
|
|
49
|
+
white-space: pre-wrap;
|
|
50
|
+
}
|
|
51
|
+
.ui-text__icon{
|
|
52
|
+
margin-right: 4px;
|
|
53
|
+
}
|
|
54
|
+
.ui-text--info {
|
|
55
|
+
color: #909399;
|
|
56
|
+
}
|
|
57
|
+
.ui-text--primary {
|
|
58
|
+
color: #409eff;
|
|
59
|
+
}
|
|
60
|
+
.ui-text--success {
|
|
61
|
+
color: #67c23a;
|
|
62
|
+
}
|
|
63
|
+
.ui-text--danger {
|
|
64
|
+
color: #f56c6c;
|
|
65
|
+
}
|
|
66
|
+
.ui-text--warning {
|
|
67
|
+
color: #e6a23c;
|
|
68
|
+
}
|
|
69
|
+
</style>
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ui-textarea" :class="{'is-worklimit': innerShowWordLimit, 'is-focus': focused, 'is-radius': radius, 'is-resizeable': resizeable, 'is-auto-height': autoHeight}" :style="{height: height}">
|
|
3
|
+
<div
|
|
4
|
+
v-if="!editable"
|
|
5
|
+
class="ui-textarea__view"
|
|
6
|
+
>{{innerValue}}</div>
|
|
7
|
+
<el-input
|
|
8
|
+
v-else
|
|
9
|
+
class="ui-textarea__input"
|
|
10
|
+
type="textarea"
|
|
11
|
+
ref="input"
|
|
12
|
+
:autosize="autoHeight"
|
|
13
|
+
v-model="innerValue"
|
|
14
|
+
:disabled="disabled"
|
|
15
|
+
:placeholder="placeholder"
|
|
16
|
+
:show-word-limit="innerShowWordLimit"
|
|
17
|
+
:maxlength="maxlength"
|
|
18
|
+
:rows="rows"
|
|
19
|
+
@change="handleChange"
|
|
20
|
+
@blur="handleBlur"
|
|
21
|
+
@focus="handleFocus"
|
|
22
|
+
>
|
|
23
|
+
</el-input>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
<script>
|
|
27
|
+
import { Input } from 'element-ui'
|
|
28
|
+
import 'element-ui/lib/theme-chalk/input.css'
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
name: 'UiTextarea',
|
|
32
|
+
components: {
|
|
33
|
+
ElInput: Input
|
|
34
|
+
},
|
|
35
|
+
props: {
|
|
36
|
+
rows: {
|
|
37
|
+
type: Number,
|
|
38
|
+
default: 3
|
|
39
|
+
},
|
|
40
|
+
maxlength: {
|
|
41
|
+
type: [Number, String],
|
|
42
|
+
default: 300
|
|
43
|
+
},
|
|
44
|
+
autoHeight: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false
|
|
47
|
+
},
|
|
48
|
+
resizeable: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: true
|
|
51
|
+
},
|
|
52
|
+
placeholder: {
|
|
53
|
+
type: String
|
|
54
|
+
},
|
|
55
|
+
height: {
|
|
56
|
+
type: String
|
|
57
|
+
},
|
|
58
|
+
value: {
|
|
59
|
+
type: String
|
|
60
|
+
},
|
|
61
|
+
editable: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: true
|
|
64
|
+
},
|
|
65
|
+
disabled: {
|
|
66
|
+
type: Boolean
|
|
67
|
+
},
|
|
68
|
+
radius: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: true
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
data () {
|
|
74
|
+
return {
|
|
75
|
+
focused: false
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
computed: {
|
|
79
|
+
innerValue: {
|
|
80
|
+
get () {
|
|
81
|
+
return this.value
|
|
82
|
+
},
|
|
83
|
+
set (val) {
|
|
84
|
+
this.$emit('input', val)
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
innerShowWordLimit () {
|
|
88
|
+
if (this.maxlength) {
|
|
89
|
+
return true
|
|
90
|
+
}
|
|
91
|
+
return false
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
methods: {
|
|
95
|
+
handleChange (e) {
|
|
96
|
+
this.$emit('change', {
|
|
97
|
+
value: e
|
|
98
|
+
})
|
|
99
|
+
},
|
|
100
|
+
handleBlur () {
|
|
101
|
+
this.focused = false
|
|
102
|
+
this.$emit('blur')
|
|
103
|
+
},
|
|
104
|
+
handleFocus () {
|
|
105
|
+
this.focused = true
|
|
106
|
+
},
|
|
107
|
+
getSelectionRange () {
|
|
108
|
+
const value = this.value || ''
|
|
109
|
+
let selectionStart = value.length
|
|
110
|
+
let selectionEnd = selectionStart
|
|
111
|
+
if (this.$refs.input && this.$refs.input.$refs.textarea) {
|
|
112
|
+
selectionStart = this.$refs.input.$refs.textarea.selectionStart
|
|
113
|
+
selectionEnd = this.$refs.input.$refs.textarea.selectionEnd
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
start: selectionStart,
|
|
117
|
+
end: selectionEnd
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
setSelectionStart (startIndex) {
|
|
121
|
+
if (typeof startIndex !== 'number') {
|
|
122
|
+
return
|
|
123
|
+
}
|
|
124
|
+
if (this.$refs.input && this.$refs.input.$refs.textarea) {
|
|
125
|
+
this.$refs.input.$refs.textarea.setSelectionRange(startIndex, startIndex)
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
focus () {
|
|
129
|
+
this.$nextTick(() => {
|
|
130
|
+
this.$refs.input && this.$refs.input.focus && this.$refs.input.focus()
|
|
131
|
+
})
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
</script>
|
|
136
|
+
<style lang="less">
|
|
137
|
+
.ui-textarea{
|
|
138
|
+
&.is-worklimit{
|
|
139
|
+
.el-textarea{
|
|
140
|
+
// .el-textarea__inner{
|
|
141
|
+
// padding-bottom: 20px;
|
|
142
|
+
// }
|
|
143
|
+
}
|
|
144
|
+
.el-input__count{
|
|
145
|
+
position: static;
|
|
146
|
+
height: 20px;
|
|
147
|
+
line-height: 20px;
|
|
148
|
+
display: block;
|
|
149
|
+
text-align: right;
|
|
150
|
+
padding: 0 12px;
|
|
151
|
+
background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 17%, rgba(255,255,255,1) 100%);
|
|
152
|
+
background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 17%,rgba(255,255,255,1) 100%);
|
|
153
|
+
background: linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(255,255,255,1) 17%,rgba(255,255,255,1) 100%);
|
|
154
|
+
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#ffffff',GradientType=0 );
|
|
155
|
+
border-bottom-left-radius: 3px;
|
|
156
|
+
border-bottom-right-radius: 3px;
|
|
157
|
+
pointer-events: none;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
.ui-textarea__input {
|
|
161
|
+
border: 1px solid #DCDFE6;
|
|
162
|
+
box-sizing: border-box;
|
|
163
|
+
transition: all .25s;
|
|
164
|
+
}
|
|
165
|
+
&.is-radius .ui-textarea__input{
|
|
166
|
+
border-radius: 3px;
|
|
167
|
+
.el-textarea__inner{
|
|
168
|
+
border-radius: 3px;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
&.is-resizeable{
|
|
172
|
+
.el-textarea__inner{
|
|
173
|
+
resize: vertical;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
&.is-focus {
|
|
177
|
+
.ui-textarea__input {
|
|
178
|
+
border-color: #1aa2e8;
|
|
179
|
+
box-shadow: 0 0 0 0.2rem rgba(26, 162, 232,.25);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
.ui-textarea {
|
|
184
|
+
&:not(.is-auto-height) {
|
|
185
|
+
.ui-textarea__input.el-textarea{
|
|
186
|
+
height: 100%;
|
|
187
|
+
display: flex;
|
|
188
|
+
flex-direction: column;
|
|
189
|
+
.el-textarea__inner{
|
|
190
|
+
flex: 1;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
&.is-worklimit.is-auto-height {
|
|
195
|
+
.el-textarea .el-textarea__inner{
|
|
196
|
+
overflow: hidden;
|
|
197
|
+
padding-right: 50px;
|
|
198
|
+
}
|
|
199
|
+
.el-input__count{
|
|
200
|
+
background: none;
|
|
201
|
+
position: absolute;
|
|
202
|
+
right: -3px;
|
|
203
|
+
bottom: 0;
|
|
204
|
+
height: 28px;
|
|
205
|
+
line-height: 28px;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
.ui-textarea__input.el-textarea .el-textarea__inner{
|
|
210
|
+
font-size: 14px;
|
|
211
|
+
transition: all .15s ease-in-out;
|
|
212
|
+
line-height: 24px;
|
|
213
|
+
padding: 3px 11px;
|
|
214
|
+
font-family: PingFangSC-Regular,PingFang SC;
|
|
215
|
+
border-radius: 0;
|
|
216
|
+
resize: none;
|
|
217
|
+
border: 0;
|
|
218
|
+
box-sizing: border-box;
|
|
219
|
+
}
|
|
220
|
+
.ui-textarea__view{
|
|
221
|
+
min-height: 24px;
|
|
222
|
+
padding: 3px 12px;
|
|
223
|
+
line-height: 24px;
|
|
224
|
+
white-space: pre-wrap;
|
|
225
|
+
}
|
|
226
|
+
.ui-textarea__prefixicon{
|
|
227
|
+
font-size: 18px;
|
|
228
|
+
}
|
|
229
|
+
</style>
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ui-textbox" :class="{'has-icon': hasIcon, 'is-viewable': !editable}">
|
|
3
|
+
<div
|
|
4
|
+
class="ui-textbox__view"
|
|
5
|
+
v-if="!editable"
|
|
6
|
+
>
|
|
7
|
+
{{innerValue}}
|
|
8
|
+
</div>
|
|
9
|
+
<template v-else>
|
|
10
|
+
<span class="ui-textbox__icon" v-if="hasIcon" @click="handleIconClick">
|
|
11
|
+
<slot name="icon"></slot>
|
|
12
|
+
</span>
|
|
13
|
+
<el-input
|
|
14
|
+
ref="input"
|
|
15
|
+
class="ui-textbox__input"
|
|
16
|
+
:value="inputValue"
|
|
17
|
+
:type="type"
|
|
18
|
+
:disabled="disabled"
|
|
19
|
+
:readonly="readonly"
|
|
20
|
+
:size="size"
|
|
21
|
+
:placeholder="placeholder"
|
|
22
|
+
:clearable="clearable"
|
|
23
|
+
:maxlength="maxlength"
|
|
24
|
+
:show-word-limit="innerShowWordLimit"
|
|
25
|
+
:validate-event="validateEvent"
|
|
26
|
+
@keyup.native.13="handleEnter"
|
|
27
|
+
@focus="handleFocus"
|
|
28
|
+
@blur="handleBlur"
|
|
29
|
+
@clear="handleClear"
|
|
30
|
+
@change="handleChange"
|
|
31
|
+
@compositionstart.native="handleCompositionStart"
|
|
32
|
+
@compositionend.native="handleCompositionEnd"
|
|
33
|
+
@input="handleInput"
|
|
34
|
+
>
|
|
35
|
+
<template slot="prepend">
|
|
36
|
+
<slot name="prepend"></slot>
|
|
37
|
+
</template>
|
|
38
|
+
<template slot="suffix">
|
|
39
|
+
<slot name="suffix"></slot>
|
|
40
|
+
</template>
|
|
41
|
+
<template slot="append">
|
|
42
|
+
<slot name="append"></slot>
|
|
43
|
+
</template>
|
|
44
|
+
</el-input>
|
|
45
|
+
</template>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
48
|
+
<script>
|
|
49
|
+
import { Input } from 'element-ui'
|
|
50
|
+
import 'element-ui/lib/theme-chalk/input.css'
|
|
51
|
+
|
|
52
|
+
export default {
|
|
53
|
+
name: 'UiTextbox',
|
|
54
|
+
components: {
|
|
55
|
+
ElInput: Input
|
|
56
|
+
},
|
|
57
|
+
props: {
|
|
58
|
+
showWordLimit: {
|
|
59
|
+
type: null
|
|
60
|
+
},
|
|
61
|
+
maxlength: {
|
|
62
|
+
type: [Number, String],
|
|
63
|
+
default: 120
|
|
64
|
+
},
|
|
65
|
+
size: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: 'small'
|
|
68
|
+
},
|
|
69
|
+
clearable: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: false
|
|
72
|
+
},
|
|
73
|
+
type: {
|
|
74
|
+
type: String,
|
|
75
|
+
default: 'text',
|
|
76
|
+
validator: (val) => {
|
|
77
|
+
return ['password', 'text', 'number'].indexOf(val) >= 0
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
value: {
|
|
81
|
+
type: String
|
|
82
|
+
},
|
|
83
|
+
placeholder: {
|
|
84
|
+
type: String
|
|
85
|
+
},
|
|
86
|
+
editable: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: true
|
|
89
|
+
},
|
|
90
|
+
disabled: {
|
|
91
|
+
type: Boolean
|
|
92
|
+
},
|
|
93
|
+
readonly: {
|
|
94
|
+
type: Boolean
|
|
95
|
+
},
|
|
96
|
+
validateEvent: {
|
|
97
|
+
type: Boolean,
|
|
98
|
+
default: true
|
|
99
|
+
},
|
|
100
|
+
keepInput: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
default: true
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
data () {
|
|
106
|
+
return {
|
|
107
|
+
inputValue: ''
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
computed: {
|
|
111
|
+
innerValue: {
|
|
112
|
+
get () {
|
|
113
|
+
return this.value
|
|
114
|
+
},
|
|
115
|
+
set (val) {
|
|
116
|
+
this.$emit('input', val)
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
hasIcon () {
|
|
120
|
+
return this.$slots.icon
|
|
121
|
+
},
|
|
122
|
+
innerShowWordLimit () {
|
|
123
|
+
if (typeof this.showWordLimit === 'boolean') {
|
|
124
|
+
return this.showWordLimit
|
|
125
|
+
}
|
|
126
|
+
return !!this.maxlength
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
watch: {
|
|
130
|
+
innerValue () {
|
|
131
|
+
this.inputValue = this.innerValue
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
created () {
|
|
135
|
+
this.inputValue = this.innerValue
|
|
136
|
+
},
|
|
137
|
+
mounted () {
|
|
138
|
+
if (this.type === 'password') {
|
|
139
|
+
this.$refs.input.$refs.input.setAttribute('autocomplete', 'new-password')
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
methods: {
|
|
143
|
+
handleInput (value) {
|
|
144
|
+
if (this.keepInput) {
|
|
145
|
+
this.innerValue = value
|
|
146
|
+
} else {
|
|
147
|
+
this.inputValue = value
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
handleChange (e) {
|
|
151
|
+
this.$emit('change', {
|
|
152
|
+
value: e
|
|
153
|
+
})
|
|
154
|
+
},
|
|
155
|
+
handleEnter (e) {
|
|
156
|
+
this.innerValue = e.target.value.trim()
|
|
157
|
+
this.$emit('enter')
|
|
158
|
+
},
|
|
159
|
+
handleFocus (e) {
|
|
160
|
+
this.$emit('focus')
|
|
161
|
+
},
|
|
162
|
+
handleBlur (e) {
|
|
163
|
+
if (!this.keepInput) {
|
|
164
|
+
this.innerValue = (this.inputValue || '').trim()
|
|
165
|
+
}
|
|
166
|
+
this.$emit('blur')
|
|
167
|
+
},
|
|
168
|
+
handleClear () {
|
|
169
|
+
this.$emit('clear')
|
|
170
|
+
},
|
|
171
|
+
handleCompositionStart () {
|
|
172
|
+
this.$emit('composition-start')
|
|
173
|
+
},
|
|
174
|
+
handleCompositionEnd () {
|
|
175
|
+
this.$emit('composition-end')
|
|
176
|
+
},
|
|
177
|
+
handleIconClick () {
|
|
178
|
+
this.focus()
|
|
179
|
+
},
|
|
180
|
+
focus () {
|
|
181
|
+
this.$nextTick(() => {
|
|
182
|
+
this.$refs.input && this.$refs.input.focus && this.$refs.input.focus()
|
|
183
|
+
})
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
</script>
|
|
188
|
+
<style lang="less">
|
|
189
|
+
.ui-textbox{
|
|
190
|
+
outline: 0;
|
|
191
|
+
&.has-icon{
|
|
192
|
+
position: relative;
|
|
193
|
+
.ui-textbox__input{
|
|
194
|
+
.el-input__inner{
|
|
195
|
+
padding-left: 36px;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
.el-input-group__prepend{
|
|
200
|
+
.ui-button {
|
|
201
|
+
margin: -1px -10px!important;
|
|
202
|
+
border-color: transparent!important;
|
|
203
|
+
box-shadow: none!important;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
&.is-viewable{
|
|
207
|
+
.ui-textbox__view{
|
|
208
|
+
padding-left: 0;
|
|
209
|
+
padding-right: 0;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
.ui-textbox__input.el-input{
|
|
213
|
+
.el-input__inner{
|
|
214
|
+
box-sizing: border-box;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
.ui-textbox__icon{
|
|
219
|
+
position: absolute;
|
|
220
|
+
left: 10px;
|
|
221
|
+
top: 50%;
|
|
222
|
+
transform: translateY(-50%);
|
|
223
|
+
z-index: 300;
|
|
224
|
+
width: 20px;
|
|
225
|
+
text-align: center;
|
|
226
|
+
height: 20px;
|
|
227
|
+
line-height: 20px;
|
|
228
|
+
}
|
|
229
|
+
.ui-textbox__view{
|
|
230
|
+
position: relative;
|
|
231
|
+
line-height: 24px;
|
|
232
|
+
min-height: 24px;
|
|
233
|
+
padding: 4px 12px;
|
|
234
|
+
}
|
|
235
|
+
.ui-textbox__view-empty{
|
|
236
|
+
position: absolute;
|
|
237
|
+
bottom: -3px;
|
|
238
|
+
left: 12px;
|
|
239
|
+
color: transparent;
|
|
240
|
+
}
|
|
241
|
+
.ui-textbox__input.el-input{
|
|
242
|
+
&.el-input--suffix{
|
|
243
|
+
.el-input__inner{
|
|
244
|
+
padding-right: 38px;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
.el-input__suffix{
|
|
248
|
+
z-index: 3;
|
|
249
|
+
}
|
|
250
|
+
.el-input__inner{
|
|
251
|
+
font-size: 14px;
|
|
252
|
+
transition: all .15s ease-in-out;
|
|
253
|
+
font-family: PingFangSC-Regular,PingFang SC;
|
|
254
|
+
padding-left: 11px;
|
|
255
|
+
padding-right: 11px;
|
|
256
|
+
position: relative;
|
|
257
|
+
z-index: 3;
|
|
258
|
+
&:focus{
|
|
259
|
+
border-color: #1aa2e8;
|
|
260
|
+
box-shadow: 0 0 0 0.2rem rgba(26, 162, 232,.25);
|
|
261
|
+
}
|
|
262
|
+
&::placeholder{
|
|
263
|
+
color: #bababa;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
.el-input-group__prepend,
|
|
267
|
+
.el-input-group__append{
|
|
268
|
+
padding-left: 9px;
|
|
269
|
+
padding-right: 9px;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
.ui-textbox.el-input--large{
|
|
273
|
+
line-height: 40px;
|
|
274
|
+
}
|
|
275
|
+
</style>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-time-picker
|
|
3
|
+
class="ui-time-picker"
|
|
4
|
+
v-model="innerValue"
|
|
5
|
+
size="small"
|
|
6
|
+
range-separator="至"
|
|
7
|
+
:disabled="disabled"
|
|
8
|
+
:is-range="isRange"
|
|
9
|
+
:clearable="clearable"
|
|
10
|
+
:value-format="valueFormat"
|
|
11
|
+
:format="format"
|
|
12
|
+
:placeholder="placeholder"
|
|
13
|
+
:start-placeholder="startPlaceholder"
|
|
14
|
+
:end-placeholder="endPlaceholder"
|
|
15
|
+
></el-time-picker>
|
|
16
|
+
</template>
|
|
17
|
+
<script>
|
|
18
|
+
import ElTimePicker from 'element-ui/lib/time-picker'
|
|
19
|
+
import 'element-ui/lib/theme-chalk/time-picker.css'
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
name: 'UiTimePicker',
|
|
23
|
+
components: {
|
|
24
|
+
ElTimePicker
|
|
25
|
+
},
|
|
26
|
+
props: {
|
|
27
|
+
value: {
|
|
28
|
+
type: [Array, Date, String]
|
|
29
|
+
},
|
|
30
|
+
format: {
|
|
31
|
+
type: String
|
|
32
|
+
},
|
|
33
|
+
valueFormat: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: 'yyyy-MM-dd HH:mm:ss'
|
|
36
|
+
},
|
|
37
|
+
clearable: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: true
|
|
40
|
+
},
|
|
41
|
+
disabled: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: false
|
|
44
|
+
},
|
|
45
|
+
startPlaceholder: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: '开始时间'
|
|
48
|
+
},
|
|
49
|
+
endPlaceholder: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: '结束时间'
|
|
52
|
+
},
|
|
53
|
+
isRange: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false
|
|
56
|
+
},
|
|
57
|
+
placeholder: {
|
|
58
|
+
type: String
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
computed: {
|
|
62
|
+
innerValue: {
|
|
63
|
+
get () {
|
|
64
|
+
return this.value
|
|
65
|
+
},
|
|
66
|
+
set (val) {
|
|
67
|
+
this.$emit('input', val)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
</script>
|
|
73
|
+
<style lang="less">
|
|
74
|
+
.ui-time-picker.el-date-editor{
|
|
75
|
+
width: 100%;
|
|
76
|
+
}
|
|
77
|
+
</style>
|