@aochuang/common 1.0.1 → 1.0.126
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/index.js +13 -0
- package/common/resizable/index.js +3 -0
- package/common/resizable/resizable.vue +260 -0
- package/common/scroll-load-more/index.js +3 -0
- package/common/scroll-load-more/scroll-load-more.vue +397 -0
- package/common/static-map/index.js +3 -0
- package/common/static-map/static-map.vue +87 -0
- package/common/tooltip/tooltip.vue +27 -7
- package/common/viewer/index.js +4 -0
- package/common/viewer/util.js +40 -0
- package/common/viewer/viewer.vue +607 -0
- package/common/viewer-pedestal/index.js +3 -0
- package/common/viewer-pedestal/viewer-pedestal.vue +70 -0
- package/common/voice/index.js +21 -0
- package/common/voice/util.js +18 -0
- package/common/voice/voice-player-aac.js +584 -0
- package/common/voice/voice-player-audio.js +159 -0
- package/common/voice/voice-player.js +309 -0
- package/common/voice/voice.vue +274 -0
- package/common/voice-player/index.js +3 -0
- package/common/voice-player/voice-player.vue +785 -0
- package/common/waterfall/index.js +3 -0
- package/common/waterfall/waterfall.vue +169 -0
- package/common/wechat-emoji/emoji/666.png +0 -0
- package/common/wechat-emoji/emoji/Emm.png +0 -0
- package/common/wechat-emoji/emoji/OK.png +0 -0
- package/common/wechat-emoji/emoji//344/272/262/344/272/262.png +0 -0
- package/common/wechat-emoji/emoji//344/276/277/344/276/277.png +0 -0
- package/common/wechat-emoji/emoji//345/201/267/347/254/221.png +0 -0
- package/common/wechat-emoji/emoji//345/202/262/346/205/242.png +0 -0
- package/common/wechat-emoji/emoji//345/206/215/350/247/201.png +0 -0
- package/common/wechat-emoji/emoji//345/207/213/350/260/242.png +0 -0
- package/common/wechat-emoji/emoji//345/210/240/351/231/244.png +0 -0
- package/common/wechat-emoji/emoji//345/212/240/346/262/271.png +0 -0
- package/common/wechat-emoji/emoji//345/213/276/345/274/225.png +0 -0
- package/common/wechat-emoji/emoji//345/217/221/345/221/206.png +0 -0
- package/common/wechat-emoji/emoji//345/217/221/346/200/222.png +0 -0
- package/common/wechat-emoji/emoji//345/217/221/346/212/226.png +0 -0
- package/common/wechat-emoji/emoji//345/217/257/346/200/234.png +0 -0
- package/common/wechat-emoji/emoji//345/217/263/345/223/274/345/223/274.png +0 -0
- package/common/wechat-emoji/emoji//345/217/271/346/260/224.png +0 -0
- package/common/wechat-emoji/emoji//345/220/203/347/223/234.png +0 -0
- package/common/wechat-emoji/emoji//345/220/210/345/215/201.png +0 -0
- package/common/wechat-emoji/emoji//345/220/220.png +0 -0
- package/common/wechat-emoji/emoji//345/220/220/350/210/214/345/244/264.png +0 -0
- package/common/wechat-emoji/emoji//345/221/262/347/211/231.png +0 -0
- package/common/wechat-emoji/emoji//345/222/222/351/252/202.png +0 -0
- package/common/wechat-emoji/emoji//345/222/226/345/225/241.png +0 -0
- package/common/wechat-emoji/emoji//345/223/207.png +0 -0
- package/common/wechat-emoji/emoji//345/223/210/346/254/240.png +0 -0
- package/common/wechat-emoji/emoji//345/225/244/351/205/222.png +0 -0
- package/common/wechat-emoji/emoji//345/230/230.png +0 -0
- package/common/wechat-emoji/emoji//345/230/264/345/224/207.png +0 -0
- package/common/wechat-emoji/emoji//345/230/277/345/223/210.png +0 -0
- package/common/wechat-emoji/emoji//345/233/247.png +0 -0
- package/common/wechat-emoji/emoji//345/233/260.png +0 -0
- package/common/wechat-emoji/emoji//345/235/217/347/254/221.png +0 -0
- package/common/wechat-emoji/emoji//345/244/247/345/223/255.png +0 -0
- package/common/wechat-emoji/emoji//345/244/251/345/225/212.png +0 -0
- package/common/wechat-emoji/emoji//345/244/252/351/230/263.png +0 -0
- package/common/wechat-emoji/emoji//345/244/261/346/234/233.png +0 -0
- package/common/wechat-emoji/emoji//345/245/213/346/226/227.png +0 -0
- package/common/wechat-emoji/emoji//345/245/270/347/254/221.png +0 -0
- package/common/wechat-emoji/emoji//345/245/275/347/232/204.png +0 -0
- package/common/wechat-emoji/emoji//345/247/224/345/261/210.png +0 -0
- package/common/wechat-emoji/emoji//345/256/263/347/276/236.png +0 -0
- package/common/wechat-emoji/emoji//345/260/264/345/260/254.png +0 -0
- package/common/wechat-emoji/emoji//345/267/246/345/223/274/345/223/274.png +0 -0
- package/common/wechat-emoji/emoji//345/272/206/347/245/235.png +0 -0
- package/common/wechat-emoji/emoji//345/274/261.png +0 -0
- package/common/wechat-emoji/emoji//345/274/272.png +0 -0
- package/common/wechat-emoji/emoji//345/276/227/346/204/217.png +0 -0
- package/common/wechat-emoji/emoji//345/276/256/347/254/221.png +0 -0
- package/common/wechat-emoji/emoji//345/277/203/347/242/216.png +0 -0
- package/common/wechat-emoji/emoji//345/277/253/345/223/255/344/272/206.png +0 -0
- package/common/wechat-emoji/emoji//346/200/204/347/201/253.png +0 -0
- package/common/wechat-emoji/emoji//346/201/220/346/203/247.png +0 -0
- package/common/wechat-emoji/emoji//346/202/240/351/227/262.png +0 -0
- package/common/wechat-emoji/emoji//346/203/212/346/201/220.png +0 -0
- package/common/wechat-emoji/emoji//346/203/212/350/256/266.png +0 -0
- package/common/wechat-emoji/emoji//346/204/211/345/277/253.png +0 -0
- package/common/wechat-emoji/emoji//346/206/250/347/254/221.png +0 -0
- package/common/wechat-emoji/emoji//346/211/223/350/204/270.png +0 -0
- package/common/wechat-emoji/emoji//346/212/223/347/213/202.png +0 -0
- package/common/wechat-emoji/emoji//346/212/240/351/274/273.png +0 -0
- package/common/wechat-emoji/emoji//346/212/261/346/213/263.png +0 -0
- package/common/wechat-emoji/emoji//346/213/245/346/212/261.png +0 -0
- package/common/wechat-emoji/emoji//346/213/263/345/244/264.png +0 -0
- package/common/wechat-emoji/emoji//346/215/202/350/204/270.png +0 -0
- package/common/wechat-emoji/emoji//346/217/241/346/211/213.png +0 -0
- package/common/wechat-emoji/emoji//346/222/207/345/230/264.png +0 -0
- package/common/wechat-emoji/emoji//346/223/246/346/261/227.png +0 -0
- package/common/wechat-emoji/emoji//346/225/262/346/211/223.png +0 -0
- package/common/wechat-emoji/emoji//346/227/240/350/257/255.png +0 -0
- package/common/wechat-emoji/emoji//346/227/272/346/237/264.png +0 -0
- package/common/wechat-emoji/emoji//346/231/225.png +0 -0
- package/common/wechat-emoji/emoji//346/234/210/344/272/256.png +0 -0
- package/common/wechat-emoji/emoji//346/234/272/346/231/272.png +0 -0
- package/common/wechat-emoji/emoji//346/261/227.png +0 -0
- package/common/wechat-emoji/emoji//346/265/201/346/261/227.png +0 -0
- package/common/wechat-emoji/emoji//346/265/201/346/263/252.png +0 -0
- package/common/wechat-emoji/emoji//347/202/270/345/274/271.png +0 -0
- package/common/wechat-emoji/emoji//347/203/237/350/212/261.png +0 -0
- package/common/wechat-emoji/emoji//347/210/206/347/253/271.png +0 -0
- package/common/wechat-emoji/emoji//347/210/261/345/277/203.png +0 -0
- package/common/wechat-emoji/emoji//347/214/252/345/244/264.png +0 -0
- package/common/wechat-emoji/emoji//347/216/253/347/221/260.png +0 -0
- package/common/wechat-emoji/emoji//347/224/237/347/227/205.png +0 -0
- package/common/wechat-emoji/emoji//347/226/221/351/227/256.png +0 -0
- package/common/wechat-emoji/emoji//347/231/274.png +0 -0
- package/common/wechat-emoji/emoji//347/231/275/347/234/274.png +0 -0
- package/common/wechat-emoji/emoji//347/232/261/347/234/211.png +0 -0
- package/common/wechat-emoji/emoji//347/235/241.png +0 -0
- package/common/wechat-emoji/emoji//347/240/264/346/266/225/344/270/272/347/254/221.png +0 -0
- package/common/wechat-emoji/emoji//347/244/274/347/211/251.png +0 -0
- package/common/wechat-emoji/emoji//347/244/276/344/274/232/347/244/276/344/274/232.png +0 -0
- package/common/wechat-emoji/emoji//347/246/217.png +0 -0
- package/common/wechat-emoji/emoji//347/254/221/350/204/270.png +0 -0
- package/common/wechat-emoji/emoji//347/272/242/345/214/205.png +0 -0
- package/common/wechat-emoji/emoji//347/277/273/347/231/275/347/234/274.png +0 -0
- package/common/wechat-emoji/emoji//350/200/266.png +0 -0
- package/common/wechat-emoji/emoji//350/203/234/345/210/251.png +0 -0
- package/common/wechat-emoji/emoji//350/204/270/347/272/242.png +0 -0
- package/common/wechat-emoji/emoji//350/211/262.png +0 -0
- package/common/wechat-emoji/emoji//350/213/246/346/266/251.png +0 -0
- package/common/wechat-emoji/emoji//350/217/234/345/210/200.png +0 -0
- package/common/wechat-emoji/emoji//350/233/213/347/263/225.png +0 -0
- package/common/wechat-emoji/emoji//350/241/260.png +0 -0
- package/common/wechat-emoji/emoji//350/243/202/345/274/200.png +0 -0
- package/common/wechat-emoji/emoji//350/245/277/347/223/234.png +0 -0
- package/common/wechat-emoji/emoji//350/256/251/346/210/221/347/234/213/347/234/213.png +0 -0
- package/common/wechat-emoji/emoji//350/260/203/347/232/256.png +0 -0
- package/common/wechat-emoji/emoji//350/267/263/350/267/263.png +0 -0
- package/common/wechat-emoji/emoji//350/275/254/345/234/210.png +0 -0
- package/common/wechat-emoji/emoji//351/204/231/350/247/206.png +0 -0
- package/common/wechat-emoji/emoji//351/227/255/345/230/264.png +0 -0
- package/common/wechat-emoji/emoji//351/230/264/351/231/251.png +0 -0
- package/common/wechat-emoji/emoji//351/232/276/350/277/207.png +0 -0
- package/common/wechat-emoji/emoji//351/252/267/351/253/205.png +0 -0
- package/common/wechat-emoji/emoji//351/254/274/350/204/270.png +0 -0
- package/common/wechat-emoji/emoji//351/270/241.png +0 -0
- package/common/wechat-emoji/emoji//351/274/223/346/216/214.png +0 -0
- package/common/wechat-emoji/index.js +14 -0
- package/common/wechat-emoji/order.json +111 -0
- package/common/wechat-emoji/utils.js +52 -0
- package/common/wechat-emoji/wechat-emoji.vue +74 -0
- package/common/wechat-emoji-select/index.js +3 -0
- package/common/wechat-emoji-select/wechat-emoji-select.vue +67 -0
- package/components/advanced-filter/advanced-filter-condition.vue +1 -1
- package/components/advanced-filter/advanced-filter.vue +6 -1
- package/components/advanced-filter/index.js +11 -12
- package/components/avatar/avatar.vue +9 -5
- package/components/button/button.vue +15 -2
- package/components/date-picker/date-picker.vue +9 -2
- package/components/dialog/dialog.vue +6 -1
- package/components/dropdown/dropdown-item.vue +10 -2
- package/components/dropdown/dropdown.vue +45 -5
- package/components/dropdown/index.js +8 -8
- package/components/empty/empty.vue +29 -2
- package/components/filter/filter.vue +1 -1
- package/components/filter/index.js +10 -10
- package/components/form/form.vue +33 -2
- package/components/form/index.js +11 -0
- package/components/grid/grid-column.vue +1 -0
- package/components/grid/grid-table.vue +6 -4
- package/components/grid/grid.vue +15 -3
- package/components/grid/index.js +31 -32
- package/components/icon/demo_index.html +2752 -1073
- package/components/icon/iconfont.css +299 -7
- package/components/icon/iconfont.js +1 -1
- package/components/icon/iconfont.json +518 -7
- package/components/icon/iconfont.ttf +0 -0
- package/components/icon/iconfont.woff +0 -0
- package/components/icon/iconfont.woff2 +0 -0
- package/components/image/image.vue +91 -13
- package/components/image/index.js +3 -1
- package/components/image/util.js +82 -1
- package/components/index.js +6 -2
- package/components/menu/index.js +13 -7
- package/components/menu/menu-group.vue +6 -1
- package/components/menu/menu-item.vue +57 -3
- package/components/menu/menu.vue +1 -1
- package/components/message/message.js +12 -9
- package/components/message-box/index.js +4 -0
- package/components/pagination/pagination.vue +11 -7
- package/components/popover/popover.vue +24 -1
- package/components/searchbox/searchbox.vue +15 -3
- package/components/select/index.js +2 -0
- package/components/select/select.vue +7 -1
- package/components/skeleton/index.js +2 -0
- package/components/sortable/index.js +7 -5
- package/components/sortable/sortable.vue +5 -0
- package/components/tabbar/index.js +9 -0
- package/components/tabbar/tabbar-item.vue +162 -0
- package/components/tabbar/tabbar.vue +49 -0
- package/components/tabs/index.js +2 -0
- package/components/tabs/tabs.vue +5 -0
- package/components/tag/index.js +4 -4
- package/components/tag/tag.less +12 -3
- package/components/textarea/textarea.vue +19 -3
- package/components/time-picker/time-picker.vue +7 -0
- package/components/toolbar/index.js +2 -0
- package/components/transfer/index.js +4 -4
- package/components/transfer/transfer-element.vue +109 -0
- package/components/transfer/transfer.vue +22 -7
- package/components/tree/tree.vue +175 -16
- package/components/video/video.vue +50 -2
- package/package.json +12 -1
- package/uni-common/more-button/more-button.vue +23 -0
- package/uni-common/popup-select/popup-select.vue +217 -0
- package/uni-common/portray/portray.vue +54 -0
- package/uni-common/refresh-view/refresh-view.vue +94 -0
- package/uni-common/scroll-load-more/scroll-load-more.vue +201 -0
- package/uni-common/tree-popup-select/index.js +3 -0
- package/uni-common/tree-popup-select/tree-popup-select-panel.vue +92 -0
- package/uni-common/tree-popup-select/tree-popup-select.vue +124 -0
- package/uni-common/tree-popup-select/util.js +19 -0
- package/uni-common/wechat-emoji/index.js +13 -0
- package/uni-common/wechat-emoji/order.json +438 -0
- package/uni-common/wechat-emoji/utils.js +52 -0
- package/uni-common/wechat-emoji/wechat-emoji.vue +74 -0
- package/uni-components/avatar/avatar.vue +81 -0
- package/uni-components/badge/badge.vue +57 -0
- package/uni-components/empty/empty.vue +27 -0
- package/uni-components/exception/exception.vue +47 -0
- package/uni-components/icon/demo.css +539 -0
- package/uni-components/icon/demo_index.html +1591 -0
- package/uni-components/icon/icon.vue +48 -0
- package/uni-components/icon/iconfont.css +259 -0
- package/uni-components/icon/iconfont.js +1 -0
- package/uni-components/icon/iconfont.json +436 -0
- package/uni-components/icon/iconfont.ttf +0 -0
- package/uni-components/icon/iconfont.woff +0 -0
- package/uni-components/icon/iconfont.woff2 +0 -0
- package/uni-components/icon/index.js +3 -0
- package/uni-components/image/image.vue +38 -0
- package/uni-components/image/index.js +3 -0
- package/uni-components/loading/index.js +3 -0
- package/uni-components/loading/loading.vue +30 -0
- package/uni-components/message/message-item.vue +29 -0
- package/uni-components/message/message.js +80 -0
- package/uni-components/message/message.vue +30 -0
- package/uni-components/message-box/message-box-item.vue +54 -0
- package/uni-components/message-box/message-box.js +91 -0
- package/uni-components/message-box/message-box.vue +52 -0
- package/uni-components/picker/picker.vue +270 -0
- package/uni-components/popup/index.js +3 -0
- package/uni-components/popup/popup.vue +143 -0
- package/uni-components/search/index.js +3 -0
- package/uni-components/search/search.vue +86 -0
- package/uni-components/skeleton/skeleton-chat.vue +85 -0
- package/uni-components/skeleton/skeleton-contact.vue +84 -0
- package/uni-components/skeleton/skeleton-detail.vue +84 -0
- package/uni-components/skeleton/skeleton.vue +32 -0
- package/uni-components/tabbar/tabbar-item.vue +33 -0
- package/uni-components/tabbar/tabbar.vue +87 -0
- package/uni-components/tree/index.js +3 -0
- package/uni-components/tree/tree-select-loading.vue +48 -0
- package/uni-components/tree/tree-select-node.vue +202 -0
- package/uni-components/tree/tree-select-store.js +520 -0
- package/uni-components/tree/tree-select.vue +210 -0
- package/uni-components/tree/utils.js +33 -0
- package/uni-components/video/index.js +3 -0
- package/uni-components/video/video.vue +29 -0
- package/uni-components/voice/index.js +3 -0
- package/uni-components/voice/voice.vue +24 -0
- package/uni-components/waterfall/index.js +3 -0
- package/uni-components/waterfall/util.js +72 -0
- package/uni-components/waterfall/waterfall.vue +147 -0
- package/utils/data.js +128 -0
- package/utils/date.js +484 -44
- package/utils/dom.js +37 -0
- package/utils/event.js +92 -0
- package/utils/file.js +76 -0
- package/utils/json.js +22 -1
- package/utils/network-detector.js +258 -0
- package/utils/oss.js +11 -0
- package/utils/share-message.js +81 -0
- package/utils/share-websocket.js +127 -0
- package/utils/string.js +59 -0
- package/utils/time-task.js +60 -0
- package/utils/url.js +46 -0
- package/utils/util.js +416 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="ui-searchbox" :class="['ui-searchbox--' + type]" :style="style">
|
|
2
|
+
<div class="ui-searchbox" :class="['ui-searchbox--' + type, 'ui-searchbox--' + size]" :style="style">
|
|
3
3
|
<ui-textbox
|
|
4
4
|
class="ui-searchbox__input"
|
|
5
5
|
ref="textbox"
|
|
6
6
|
v-model.trim="keyword"
|
|
7
|
+
:size="size"
|
|
7
8
|
:readonly="innerLoading"
|
|
8
9
|
:placeholder="placeholder"
|
|
9
10
|
:validate-event="false"
|
|
@@ -18,8 +19,8 @@
|
|
|
18
19
|
<span key="clear" v-else-if="showClear" slot="suffix" class="ui-searchbox__btn is-clear" @click="handleClear" title="清除搜索">
|
|
19
20
|
<ui-icon name="error"></ui-icon>
|
|
20
21
|
</span>
|
|
21
|
-
<span key="search" v-else slot="suffix" class="ui-searchbox__btn is-search" title="点击搜索">
|
|
22
|
-
<ui-icon name="sousuo"></ui-icon>
|
|
22
|
+
<span key="search" v-else slot="suffix" class="ui-searchbox__btn is-search" title="点击搜索" @click="handleSearchClick">
|
|
23
|
+
<!-- <ui-icon name="sousuo"></ui-icon> -->
|
|
23
24
|
</span>
|
|
24
25
|
</ui-textbox>
|
|
25
26
|
</div>
|
|
@@ -42,6 +43,13 @@ export default {
|
|
|
42
43
|
return ['merge', 'alone'].indexOf(val) >= 0
|
|
43
44
|
}
|
|
44
45
|
},
|
|
46
|
+
size: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: 'small',
|
|
49
|
+
validator (value) {
|
|
50
|
+
return ['small', 'mini'].includes(value)
|
|
51
|
+
}
|
|
52
|
+
},
|
|
45
53
|
width: {
|
|
46
54
|
type: String
|
|
47
55
|
},
|
|
@@ -120,6 +128,9 @@ export default {
|
|
|
120
128
|
}
|
|
121
129
|
},
|
|
122
130
|
methods: {
|
|
131
|
+
handleSearchClick () {
|
|
132
|
+
this.focus()
|
|
133
|
+
},
|
|
123
134
|
handleSearch () {
|
|
124
135
|
this.doSearch()
|
|
125
136
|
},
|
|
@@ -193,6 +204,7 @@ export default {
|
|
|
193
204
|
<style lang="less">
|
|
194
205
|
.ui-searchbox{
|
|
195
206
|
width: 100%;
|
|
207
|
+
background-color: #fff;
|
|
196
208
|
}
|
|
197
209
|
.ui-searchbox__props{
|
|
198
210
|
margin-right: 9px;
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
:label="item[textField]"
|
|
39
39
|
>
|
|
40
40
|
<slot name="item" :item="item">
|
|
41
|
-
{{item[textField]}}
|
|
41
|
+
{{item[textField]}} <el-tag v-if="item.isNew" style="margin-left: 10px;">点击新增</el-tag>
|
|
42
42
|
</slot>
|
|
43
43
|
</el-option>
|
|
44
44
|
</template>
|
|
@@ -378,6 +378,12 @@ export default {
|
|
|
378
378
|
}
|
|
379
379
|
rs.then((rs) => {
|
|
380
380
|
this.options = rs || []
|
|
381
|
+
// 可以创建并选中选项中不存在的条目,增加一个标识
|
|
382
|
+
if (this.allowCreate) {
|
|
383
|
+
if (this.options.findIndex(opt => opt.value === this.keyword) === -1) {
|
|
384
|
+
this.options.push({ text: this.keyword, value: this.keyword, isNew: true }) // 标记为新创建的选项
|
|
385
|
+
}
|
|
386
|
+
}
|
|
381
387
|
this.showOptions = this.options
|
|
382
388
|
this.$emit('load', {
|
|
383
389
|
data: this.options
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import Sortable from './sortable'
|
|
2
2
|
import SortableItem from './sortable-item'
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Vue.component(SortableItem.name, SortableItem)
|
|
8
|
-
}
|
|
4
|
+
Sortable.install = (Vue) => {
|
|
5
|
+
Vue.component(Sortable.name, Sortable)
|
|
6
|
+
Vue.component(SortableItem.name, SortableItem)
|
|
9
7
|
}
|
|
8
|
+
|
|
9
|
+
Sortable.SortableItem = SortableItem
|
|
10
|
+
|
|
11
|
+
export default Sortable
|
|
@@ -12,6 +12,10 @@ let uniqueNumber = Date.now()
|
|
|
12
12
|
export default {
|
|
13
13
|
name: 'UiSortable',
|
|
14
14
|
props: {
|
|
15
|
+
disabled: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false
|
|
18
|
+
},
|
|
15
19
|
enableHandle: {
|
|
16
20
|
type: Boolean,
|
|
17
21
|
default: true
|
|
@@ -40,6 +44,7 @@ export default {
|
|
|
40
44
|
mounted () {
|
|
41
45
|
this.sortable = new Sortable(this.$el, {
|
|
42
46
|
sort: true,
|
|
47
|
+
disabled: this.disabled,
|
|
43
48
|
draggable: '.' + this.id + '-item',
|
|
44
49
|
handle: this.enableHandle ? '.' + this.handleClass : '.ui-sortable-item',
|
|
45
50
|
animation: 150,
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ui-tabbar-item" :class="{'is-active': tabbarValue === value, 'is-link': link}" @click="handleClick">
|
|
3
|
+
<template v-if="$slots.icon">
|
|
4
|
+
<span class="ui-tabbar-item__icon">
|
|
5
|
+
<slot name="icon"></slot>
|
|
6
|
+
</span>
|
|
7
|
+
</template>
|
|
8
|
+
<span class="ui-tabbar-item__text">
|
|
9
|
+
<slot></slot>
|
|
10
|
+
</span>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
<script>
|
|
14
|
+
export default {
|
|
15
|
+
name: 'UiTabbarItem',
|
|
16
|
+
inject: ['UiTabbar'],
|
|
17
|
+
props: {
|
|
18
|
+
value: {
|
|
19
|
+
type: String
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
computed: {
|
|
23
|
+
link () {
|
|
24
|
+
return this.UiTabbar.link
|
|
25
|
+
},
|
|
26
|
+
tabbarValue () {
|
|
27
|
+
return this.UiTabbar.value
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
watch: {
|
|
31
|
+
tabbarValue (value) {
|
|
32
|
+
if (value !== this.value) {
|
|
33
|
+
return
|
|
34
|
+
}
|
|
35
|
+
this.$nextTick(() => {
|
|
36
|
+
this.scrollIntoHorizontalParent()
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
mounted () {
|
|
41
|
+
if (this.tabbarValue !== this.value) {
|
|
42
|
+
return
|
|
43
|
+
}
|
|
44
|
+
this.$nextTick(() => {
|
|
45
|
+
this.scrollIntoHorizontalParent()
|
|
46
|
+
})
|
|
47
|
+
},
|
|
48
|
+
methods: {
|
|
49
|
+
handleClick () {
|
|
50
|
+
this.UiTabbar.setValue(this.value)
|
|
51
|
+
},
|
|
52
|
+
getHorizontalScrollPadding (scrollParent) {
|
|
53
|
+
const siblings = this.$el && this.$el.parentElement ? Array.from(this.$el.parentElement.children) : []
|
|
54
|
+
if (siblings.length === 0) {
|
|
55
|
+
return {
|
|
56
|
+
left: 0,
|
|
57
|
+
right: 0
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const firstItem = siblings[0]
|
|
61
|
+
const lastItem = siblings[siblings.length - 1]
|
|
62
|
+
const left = Math.max(firstItem.offsetLeft, 0)
|
|
63
|
+
const right = Math.max(scrollParent.scrollWidth - lastItem.offsetLeft - lastItem.offsetWidth, 0)
|
|
64
|
+
return {
|
|
65
|
+
left,
|
|
66
|
+
right
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
getHorizontalScrollParent () {
|
|
70
|
+
let parent = this.$el && this.$el.parentElement
|
|
71
|
+
while (parent) {
|
|
72
|
+
const style = window.getComputedStyle(parent)
|
|
73
|
+
const overflowX = style.overflowX
|
|
74
|
+
const canScrollHorizontally = parent.scrollWidth > parent.clientWidth
|
|
75
|
+
if (canScrollHorizontally && ['auto', 'scroll', 'overlay'].includes(overflowX)) {
|
|
76
|
+
return parent
|
|
77
|
+
}
|
|
78
|
+
parent = parent.parentElement
|
|
79
|
+
}
|
|
80
|
+
return null
|
|
81
|
+
},
|
|
82
|
+
scrollIntoHorizontalParent () {
|
|
83
|
+
const scrollParent = this.getHorizontalScrollParent()
|
|
84
|
+
if (!scrollParent) {
|
|
85
|
+
return
|
|
86
|
+
}
|
|
87
|
+
const scrollPadding = this.getHorizontalScrollPadding(scrollParent)
|
|
88
|
+
const itemLeft = this.$el.offsetLeft
|
|
89
|
+
const itemRight = itemLeft + this.$el.offsetWidth
|
|
90
|
+
const containerLeft = scrollParent.scrollLeft
|
|
91
|
+
const containerRight = containerLeft + scrollParent.clientWidth
|
|
92
|
+
const maxScrollLeft = Math.max(scrollParent.scrollWidth - scrollParent.clientWidth, 0)
|
|
93
|
+
if (itemLeft < containerLeft) {
|
|
94
|
+
this.setHorizontalScrollLeft(scrollParent, Math.max(itemLeft - scrollPadding.left, 0))
|
|
95
|
+
} else if (itemRight > containerRight) {
|
|
96
|
+
this.setHorizontalScrollLeft(scrollParent, Math.min(itemRight + scrollPadding.right - scrollParent.clientWidth, maxScrollLeft))
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
setHorizontalScrollLeft (scrollParent, left) {
|
|
100
|
+
if (typeof scrollParent.scrollTo === 'function') {
|
|
101
|
+
scrollParent.scrollTo({
|
|
102
|
+
left,
|
|
103
|
+
behavior: 'smooth'
|
|
104
|
+
})
|
|
105
|
+
return
|
|
106
|
+
}
|
|
107
|
+
scrollParent.scrollLeft = left
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
</script>
|
|
112
|
+
<style lang="less">
|
|
113
|
+
.ui-tabbar-item{
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-direction: row;
|
|
116
|
+
align-items: center;
|
|
117
|
+
line-height: 24px;
|
|
118
|
+
box-sizing: content-box;
|
|
119
|
+
padding-top: 3px;
|
|
120
|
+
padding-bottom: 3px;
|
|
121
|
+
background-color: transparent;
|
|
122
|
+
border: 1px solid transparent;
|
|
123
|
+
border-radius: 4px;
|
|
124
|
+
cursor: pointer;
|
|
125
|
+
color: #666;
|
|
126
|
+
transition: all .25s;
|
|
127
|
+
white-space: nowrap;
|
|
128
|
+
&:not(.is-link) {
|
|
129
|
+
padding-right: 8px;
|
|
130
|
+
padding-left: 8px;
|
|
131
|
+
}
|
|
132
|
+
&:hover {
|
|
133
|
+
color: #333;
|
|
134
|
+
&:not(.is-link) {
|
|
135
|
+
background-color: #f8f8f8;
|
|
136
|
+
border: 1px solid #f8f8f8;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
&.is-active {
|
|
140
|
+
color: #409EFF;
|
|
141
|
+
&:not(.is-link) {
|
|
142
|
+
border-color: #e6f2ff;
|
|
143
|
+
background-color: #e6f2ff;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
.ui-tabbar-item__icon{
|
|
148
|
+
display: inline-block;
|
|
149
|
+
width: 16px;
|
|
150
|
+
height: 16px;
|
|
151
|
+
min-width: 16px;
|
|
152
|
+
vertical-align: top;
|
|
153
|
+
line-height: 16px;
|
|
154
|
+
svg {
|
|
155
|
+
width: 100%;
|
|
156
|
+
height: 100%;
|
|
157
|
+
}
|
|
158
|
+
+ .ui-tabbar-item__text {
|
|
159
|
+
margin-left: 4px;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
</style>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="ui-tabbar" :class="{'is-link': link}">
|
|
3
|
+
<slot></slot>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
<script>
|
|
7
|
+
export default {
|
|
8
|
+
name: 'UiTabbar',
|
|
9
|
+
props: {
|
|
10
|
+
value: {
|
|
11
|
+
type: String
|
|
12
|
+
},
|
|
13
|
+
link: {
|
|
14
|
+
type: Boolean
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
provide () {
|
|
18
|
+
return {
|
|
19
|
+
UiTabbar: this
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
methods: {
|
|
23
|
+
setValue (value) {
|
|
24
|
+
this.$emit('input', value)
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
<style lang="less">
|
|
30
|
+
.ui-tabbar{
|
|
31
|
+
display: flex;
|
|
32
|
+
flex-direction: row;
|
|
33
|
+
align-items: center;
|
|
34
|
+
&:not(.is-link) {
|
|
35
|
+
> .ui-tabbar-item {
|
|
36
|
+
&:not(:last-child) {
|
|
37
|
+
margin-right: 12px;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
&.is-link {
|
|
42
|
+
> .ui-tabbar-item {
|
|
43
|
+
&:not(:last-child) {
|
|
44
|
+
margin-right: 20px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
</style>
|
package/components/tabs/index.js
CHANGED
package/components/tabs/tabs.vue
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
ref="tabs"
|
|
4
4
|
class="ui-tabs"
|
|
5
5
|
v-model="innerValue"
|
|
6
|
+
:stretch="stretch"
|
|
6
7
|
:tab-position="tabPosition"
|
|
7
8
|
:type="type"
|
|
8
9
|
:style="style"
|
|
@@ -34,6 +35,10 @@ export default {
|
|
|
34
35
|
return ['left', 'center', 'right'].indexOf(value) >= 0
|
|
35
36
|
}
|
|
36
37
|
},
|
|
38
|
+
stretch: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
37
42
|
height: {
|
|
38
43
|
type: String
|
|
39
44
|
},
|
package/components/tag/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import ElTag from 'element-ui/lib/tag'
|
|
|
2
2
|
import 'element-ui/lib/theme-chalk/tag.css'
|
|
3
3
|
import './tag.less'
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Vue.component('UiTag', ElTag)
|
|
8
|
-
}
|
|
5
|
+
ElTag.install = (Vue) => {
|
|
6
|
+
Vue.component('UiTag', ElTag)
|
|
9
7
|
}
|
|
8
|
+
|
|
9
|
+
export default ElTag
|
package/components/tag/tag.less
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
body {
|
|
2
|
-
.el-tag {
|
|
2
|
+
.el-tag:not(.el-tag--mini) {
|
|
3
3
|
white-space: break-spaces;
|
|
4
4
|
min-height: 20px;
|
|
5
5
|
line-height: 22px;
|
|
@@ -7,9 +7,18 @@ body {
|
|
|
7
7
|
padding-right: 8px;
|
|
8
8
|
height: auto;
|
|
9
9
|
}
|
|
10
|
+
.el-tag.el-tag--mini {
|
|
11
|
+
white-space: nowrap;
|
|
12
|
+
line-height: 17px;
|
|
13
|
+
padding-left: 4px;
|
|
14
|
+
padding-right: 4px;
|
|
15
|
+
font-size: 10px;
|
|
16
|
+
height: auto;
|
|
17
|
+
box-sizing: content-box;
|
|
18
|
+
}
|
|
10
19
|
.el-tag.el-tag--primary{
|
|
11
|
-
color: #
|
|
12
|
-
background-color: #
|
|
20
|
+
color: #0052CC;
|
|
21
|
+
background-color: #edf3fb;
|
|
13
22
|
}
|
|
14
23
|
.el-tag.el-tag--success{
|
|
15
24
|
color: #67C23A;
|
|
@@ -17,8 +17,11 @@
|
|
|
17
17
|
:maxlength="maxlength"
|
|
18
18
|
:rows="rows"
|
|
19
19
|
@change="handleChange"
|
|
20
|
-
@blur="handleBlur"
|
|
21
|
-
@focus="handleFocus"
|
|
20
|
+
@blur="handleBlur"
|
|
21
|
+
@focus="handleFocus"
|
|
22
|
+
@keyup.native="handleKeyup"
|
|
23
|
+
@keydown.native="handleKeydown"
|
|
24
|
+
@paste.native="handlePaste"
|
|
22
25
|
>
|
|
23
26
|
</el-input>
|
|
24
27
|
</div>
|
|
@@ -35,7 +38,7 @@ export default {
|
|
|
35
38
|
props: {
|
|
36
39
|
rows: {
|
|
37
40
|
type: Number,
|
|
38
|
-
default:
|
|
41
|
+
default: 10
|
|
39
42
|
},
|
|
40
43
|
maxlength: {
|
|
41
44
|
type: [Number, String],
|
|
@@ -96,6 +99,9 @@ export default {
|
|
|
96
99
|
this.$emit('change', {
|
|
97
100
|
value: e
|
|
98
101
|
})
|
|
102
|
+
const textarea = this.$refs.input.$el.querySelector('.el-textarea__inner');
|
|
103
|
+
textarea.style.height = 'auto'; // 重置高度为自动
|
|
104
|
+
textarea.style.height = textarea.scrollHeight + 'px'; // 根据内容调整高度
|
|
99
105
|
},
|
|
100
106
|
handleBlur () {
|
|
101
107
|
this.focused = false
|
|
@@ -103,6 +109,7 @@ export default {
|
|
|
103
109
|
},
|
|
104
110
|
handleFocus () {
|
|
105
111
|
this.focused = true
|
|
112
|
+
this.$emit('focus')
|
|
106
113
|
},
|
|
107
114
|
getSelectionRange () {
|
|
108
115
|
const value = this.value || ''
|
|
@@ -125,6 +132,15 @@ export default {
|
|
|
125
132
|
this.$refs.input.$refs.textarea.setSelectionRange(startIndex, startIndex)
|
|
126
133
|
}
|
|
127
134
|
},
|
|
135
|
+
handlePaste (evt) {
|
|
136
|
+
this.$emit('paste', evt)
|
|
137
|
+
},
|
|
138
|
+
handleKeyup (evt) {
|
|
139
|
+
this.$emit('keyup', evt)
|
|
140
|
+
},
|
|
141
|
+
handleKeydown (evt) {
|
|
142
|
+
this.$emit('keydown', evt)
|
|
143
|
+
},
|
|
128
144
|
focus () {
|
|
129
145
|
this.$nextTick(() => {
|
|
130
146
|
this.$refs.input && this.$refs.input.focus && this.$refs.input.focus()
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
:placeholder="placeholder"
|
|
13
13
|
:start-placeholder="startPlaceholder"
|
|
14
14
|
:end-placeholder="endPlaceholder"
|
|
15
|
+
@change="change"
|
|
15
16
|
></el-time-picker>
|
|
16
17
|
</template>
|
|
17
18
|
<script>
|
|
@@ -67,6 +68,12 @@ export default {
|
|
|
67
68
|
this.$emit('input', val)
|
|
68
69
|
}
|
|
69
70
|
}
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
methods: {
|
|
74
|
+
change() {
|
|
75
|
+
this.$emit('change', this.innerValue)
|
|
76
|
+
}
|
|
70
77
|
}
|
|
71
78
|
}
|
|
72
79
|
</script>
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import ElTransfer from 'element-ui/lib/transfer'
|
|
3
|
+
import 'element-ui/lib/theme-chalk/transfer.css'
|
|
4
|
+
|
|
5
|
+
Object.assign(ElTransfer.components.TransferPanel, {
|
|
6
|
+
name: 'UiTransferElementPanel',
|
|
7
|
+
inject: ['ElTransfer'],
|
|
8
|
+
mixins: [].concat(ElTransfer.components.TransferPanel.mixins || [], [{
|
|
9
|
+
watch: {
|
|
10
|
+
query () {
|
|
11
|
+
if (!this.isRemote()) {
|
|
12
|
+
return
|
|
13
|
+
}
|
|
14
|
+
if (this.queryMethod) {
|
|
15
|
+
this.queryMethod({
|
|
16
|
+
keyword: this.query
|
|
17
|
+
})
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
methods: {
|
|
22
|
+
isRemote () {
|
|
23
|
+
if (!this.ElTransfer.remote) {
|
|
24
|
+
return false
|
|
25
|
+
}
|
|
26
|
+
return this !== this.ElTransfer.$refs.rightPanel
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}]),
|
|
30
|
+
computed: Object.assign({}, ElTransfer.components.TransferPanel.computed, {
|
|
31
|
+
queryMethod () {
|
|
32
|
+
return this.ElTransfer.queryMethod
|
|
33
|
+
},
|
|
34
|
+
filteredData () {
|
|
35
|
+
if (this.isRemote()) {
|
|
36
|
+
return this.data
|
|
37
|
+
}
|
|
38
|
+
return this.data.filter((item) => {
|
|
39
|
+
if (typeof this.filterMethod === 'function') {
|
|
40
|
+
return this.filterMethod(this.query, item);
|
|
41
|
+
} else {
|
|
42
|
+
var label = item[this.labelProp] || item[this.keyProp].toString();
|
|
43
|
+
return label.toLowerCase().indexOf(this.query.toLowerCase()) > -1;
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
export default Object.assign(ElTransfer, {
|
|
51
|
+
mixins: [].concat(ElTransfer.mixins || [], [{
|
|
52
|
+
props: {
|
|
53
|
+
remote: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false
|
|
56
|
+
},
|
|
57
|
+
queryMethod: {
|
|
58
|
+
type: Function
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
watch: {
|
|
62
|
+
data () {
|
|
63
|
+
if (!this.cacheDataMap) {
|
|
64
|
+
this.cacheDataMap = {}
|
|
65
|
+
}
|
|
66
|
+
if (this.data && this.data.length) {
|
|
67
|
+
this.data.forEach(v => {
|
|
68
|
+
this.cacheDataMap[v[this.props.key]] = v
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}]),
|
|
74
|
+
provide () {
|
|
75
|
+
return {
|
|
76
|
+
ElTransfer: this
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
computed: Object.assign({}, ElTransfer.computed, {
|
|
80
|
+
targetData() {
|
|
81
|
+
if (this.remote) {
|
|
82
|
+
if (this.targetOrder === 'original') {
|
|
83
|
+
return this.value.map(v => this.cacheDataMap[v])
|
|
84
|
+
} else {
|
|
85
|
+
return this.value.reduce((arr, cur) => {
|
|
86
|
+
const val = this.dataObj[cur];
|
|
87
|
+
if (val) {
|
|
88
|
+
arr.push(val);
|
|
89
|
+
}
|
|
90
|
+
return arr;
|
|
91
|
+
}, []);
|
|
92
|
+
}
|
|
93
|
+
} else {
|
|
94
|
+
if (this.targetOrder === 'original') {
|
|
95
|
+
return this.data.filter(item => this.value.indexOf(item[this.props.key]) > -1);
|
|
96
|
+
} else {
|
|
97
|
+
return this.value.reduce((arr, cur) => {
|
|
98
|
+
const val = this.dataObj[cur];
|
|
99
|
+
if (val) {
|
|
100
|
+
arr.push(val);
|
|
101
|
+
}
|
|
102
|
+
return arr;
|
|
103
|
+
}, []);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
})
|
|
108
|
+
})
|
|
109
|
+
</script>
|