@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
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<uv-modal
|
|
3
|
+
ref="modal"
|
|
4
|
+
:title="title"
|
|
5
|
+
:content="content"
|
|
6
|
+
:show-cancel-button="showCancelButton"
|
|
7
|
+
:show-confirm-button="showConfirmButton"
|
|
8
|
+
:async-close="asyncClose"
|
|
9
|
+
@confirm="handleModalConfirm"
|
|
10
|
+
@cancel="handleModalCancel"
|
|
11
|
+
></uv-modal>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
export default {
|
|
16
|
+
name: 'BiMessageBoxItem',
|
|
17
|
+
props: {
|
|
18
|
+
title: {
|
|
19
|
+
type: String
|
|
20
|
+
},
|
|
21
|
+
asyncClose: {
|
|
22
|
+
type: Boolean
|
|
23
|
+
},
|
|
24
|
+
showCancelButton: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: true
|
|
27
|
+
},
|
|
28
|
+
showConfirmButton: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: true
|
|
31
|
+
},
|
|
32
|
+
content: {
|
|
33
|
+
type: String
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
mounted () {
|
|
37
|
+
this.$refs.modal && this.$refs.modal.open()
|
|
38
|
+
},
|
|
39
|
+
methods: {
|
|
40
|
+
handleModalConfirm (evt) {
|
|
41
|
+
this.$emit('confirm', evt)
|
|
42
|
+
},
|
|
43
|
+
handleModalCancel (evt) {
|
|
44
|
+
this.$emit('cancel', evt)
|
|
45
|
+
},
|
|
46
|
+
close () {
|
|
47
|
+
this.$refs.modal && this.$refs.modal.close()
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
</script>
|
|
52
|
+
|
|
53
|
+
<style>
|
|
54
|
+
</style>
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import { unique } from '../../utils/string.js'
|
|
3
|
+
|
|
4
|
+
const proxyData = Vue.observable({
|
|
5
|
+
data: []
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
function addMessageBox (id, options) {
|
|
9
|
+
if (proxyData.data.some(v => v.id === id)) {
|
|
10
|
+
throw new Error('[UiMessgeBoxProxy]已存在消息框实例')
|
|
11
|
+
}
|
|
12
|
+
if (!options.callback) {
|
|
13
|
+
throw new Error('[UiMessgeBoxProxy] 缺少callback定义')
|
|
14
|
+
}
|
|
15
|
+
proxyData.data.push({
|
|
16
|
+
id,
|
|
17
|
+
options
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function removeMessageBox (id) {
|
|
22
|
+
let index = -1
|
|
23
|
+
proxyData.data.some((v, i) => {
|
|
24
|
+
if (v.id === id) {
|
|
25
|
+
index = i
|
|
26
|
+
return true
|
|
27
|
+
}
|
|
28
|
+
})
|
|
29
|
+
if (index < 0) {
|
|
30
|
+
return
|
|
31
|
+
}
|
|
32
|
+
proxyData.data.splice(index, 1)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function getMessageBoxQueue () {
|
|
36
|
+
return proxyData
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function confirm (content, title, confirmCallback, cancelCallback) {
|
|
40
|
+
return new Promise((resolve, reject) => {
|
|
41
|
+
if (typeof title === 'function') {
|
|
42
|
+
cancelCallback = confirmCallback
|
|
43
|
+
confirmCallback = title
|
|
44
|
+
title = null
|
|
45
|
+
}
|
|
46
|
+
const id = unique()
|
|
47
|
+
const options = {
|
|
48
|
+
title: title || '确定',
|
|
49
|
+
content,
|
|
50
|
+
showCancelButton: true,
|
|
51
|
+
showConfirmButton: true,
|
|
52
|
+
asyncClose: true,
|
|
53
|
+
callback: (action) => {
|
|
54
|
+
return new Promise((resolve, reject) => {
|
|
55
|
+
let rs = null
|
|
56
|
+
if (action === 'confirm') {
|
|
57
|
+
if (confirmCallback) {
|
|
58
|
+
rs = confirmCallback()
|
|
59
|
+
if (rs && rs.then) {
|
|
60
|
+
rs.then(resolve, reject)
|
|
61
|
+
} else {
|
|
62
|
+
resolve()
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
resolve()
|
|
66
|
+
}
|
|
67
|
+
} else {
|
|
68
|
+
if (cancelCallback) {
|
|
69
|
+
rs = cancelCallback()
|
|
70
|
+
if (rs && rs.then) {
|
|
71
|
+
rs.then(resolve, reject)
|
|
72
|
+
} else {
|
|
73
|
+
resolve()
|
|
74
|
+
}
|
|
75
|
+
} else {
|
|
76
|
+
resolve()
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
if (rs && rs.then) {
|
|
80
|
+
rs.then(() => {
|
|
81
|
+
removeMessageBox(id)
|
|
82
|
+
})
|
|
83
|
+
} else {
|
|
84
|
+
removeMessageBox(id)
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
addMessageBox(id, options)
|
|
90
|
+
})
|
|
91
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<view class="uv-message-box">
|
|
3
|
+
<message-box-item
|
|
4
|
+
v-for="item in messageBoxQueue.data"
|
|
5
|
+
:ref="item.id"
|
|
6
|
+
:key="item.id"
|
|
7
|
+
:title="item.options.title"
|
|
8
|
+
:content="item.options.content"
|
|
9
|
+
:show-cancel-button="item.options.showCancelButton"
|
|
10
|
+
:show-confirm-button="item.options.showConfirmButton"
|
|
11
|
+
:async-close="item.options.asyncClose"
|
|
12
|
+
@confirm="handleModalConfirm(item)"
|
|
13
|
+
@cancel="handleModalCancel(item)"
|
|
14
|
+
></message-box-item>
|
|
15
|
+
</view>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
import { getMessageBoxQueue } from './message-box.js'
|
|
20
|
+
import MessageBoxItem from './message-box-item.vue'
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
name: 'UiMessageBox',
|
|
24
|
+
components: {
|
|
25
|
+
MessageBoxItem
|
|
26
|
+
},
|
|
27
|
+
computed: {
|
|
28
|
+
messageBoxQueue () {
|
|
29
|
+
return getMessageBoxQueue()
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
methods: {
|
|
33
|
+
handleModalConfirm (item) {
|
|
34
|
+
if (item && item.options && item.options.callback) {
|
|
35
|
+
item.options.callback('confirm').then(rs => {
|
|
36
|
+
this.$refs[item.id][0] && this.$refs[item.id][0].close()
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
handleModalCancel (item) {
|
|
41
|
+
if (item && item.options && item.options.callback) {
|
|
42
|
+
item.options.callback('cancel').then(rs => {
|
|
43
|
+
this.$refs[item.id][0] && this.$refs[item.id][0].close()
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<style>
|
|
52
|
+
</style>
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
|
|
2
|
+
<template>
|
|
3
|
+
<view class="bi-picker" :class="{'is-border': border}">
|
|
4
|
+
<view class="bi-picker__handle" :style="{'width': width}" @click="handleHandleClick">
|
|
5
|
+
<template v-if="$slots.prefix">
|
|
6
|
+
<view class="bi-picker__handle-prefix">
|
|
7
|
+
<slot name="prefix"></slot>
|
|
8
|
+
</view>
|
|
9
|
+
</template>
|
|
10
|
+
<template v-if="isEmpty">
|
|
11
|
+
<view class="bi-picker__handle-placeholder">
|
|
12
|
+
{{ placeholder }}
|
|
13
|
+
</view>
|
|
14
|
+
<view class="bi-picker__handle-arrow"></view>
|
|
15
|
+
</template>
|
|
16
|
+
<template v-else>
|
|
17
|
+
<view class="bi-picker__handle-value">
|
|
18
|
+
{{ valueItem ? valueItem[textField] : value }}
|
|
19
|
+
</view>
|
|
20
|
+
<template v-if="clearable">
|
|
21
|
+
<view class="bi-picker__handle-clear" @click.stop="handleClearClick"></view>
|
|
22
|
+
</template>
|
|
23
|
+
<template v-else>
|
|
24
|
+
<view class="bi-picker__handle-arrow"></view>
|
|
25
|
+
</template>
|
|
26
|
+
</template>
|
|
27
|
+
</view>
|
|
28
|
+
<uv-picker
|
|
29
|
+
ref="picker"
|
|
30
|
+
:columns="columns"
|
|
31
|
+
@confirm="handlePickerConfirm"
|
|
32
|
+
@change="handlePickerChange"
|
|
33
|
+
></uv-picker>
|
|
34
|
+
</view>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
export default {
|
|
39
|
+
name: 'BiPicker',
|
|
40
|
+
props: {
|
|
41
|
+
value: {
|
|
42
|
+
type: [String, Number]
|
|
43
|
+
},
|
|
44
|
+
width: {
|
|
45
|
+
type: String
|
|
46
|
+
},
|
|
47
|
+
placeholder: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: '请选择'
|
|
50
|
+
},
|
|
51
|
+
items: {
|
|
52
|
+
type: Array
|
|
53
|
+
},
|
|
54
|
+
border: {
|
|
55
|
+
type: Boolean
|
|
56
|
+
},
|
|
57
|
+
enableEmptyItem: {
|
|
58
|
+
type: Boolean
|
|
59
|
+
},
|
|
60
|
+
clearable: {
|
|
61
|
+
type: Boolean
|
|
62
|
+
},
|
|
63
|
+
textField: {
|
|
64
|
+
tyep: String,
|
|
65
|
+
default: 'text'
|
|
66
|
+
},
|
|
67
|
+
valueField: {
|
|
68
|
+
tyep: String,
|
|
69
|
+
default: 'value'
|
|
70
|
+
},
|
|
71
|
+
childrenField: {
|
|
72
|
+
type: String
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
computed: {
|
|
76
|
+
isEmpty () {
|
|
77
|
+
if (this.valueItem) {
|
|
78
|
+
return false
|
|
79
|
+
}
|
|
80
|
+
return this.value === null || this.value === undefined || this.value === ''
|
|
81
|
+
},
|
|
82
|
+
valueItem () {
|
|
83
|
+
const loop = (items, context) => {
|
|
84
|
+
if (!items || !items.length) {
|
|
85
|
+
return context
|
|
86
|
+
}
|
|
87
|
+
items.some(v => {
|
|
88
|
+
if (v[this.valueField] === this.value) {
|
|
89
|
+
context.result = v
|
|
90
|
+
return true
|
|
91
|
+
} else {
|
|
92
|
+
if (loop(v[this.childrenField], context).result) {
|
|
93
|
+
return true
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
return context
|
|
98
|
+
}
|
|
99
|
+
return loop(this.items, { result: null }).result
|
|
100
|
+
},
|
|
101
|
+
columns () {
|
|
102
|
+
if (!this.items || !this.items.length) {
|
|
103
|
+
return
|
|
104
|
+
}
|
|
105
|
+
if (this.hasChildren) {
|
|
106
|
+
const columns = this.items.map(v => v[this.textField])
|
|
107
|
+
return [
|
|
108
|
+
this.enableEmptyItem ? ['--请选择--'].concat(columns) : columns,
|
|
109
|
+
this.enableEmptyItem ? ['--请选择--'] : []
|
|
110
|
+
]
|
|
111
|
+
} else {
|
|
112
|
+
return [
|
|
113
|
+
[].concat(this.enableEmptyItem ? ['--请选择--'] : []).concat(this.items.map(v => v[this.textField]))
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
hasChildren () {
|
|
118
|
+
return !!this.childrenField
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
methods: {
|
|
122
|
+
handleClearClick () {
|
|
123
|
+
this.$emit('input', null)
|
|
124
|
+
},
|
|
125
|
+
handlePickerChange (evt) {
|
|
126
|
+
if (!this.hasChildren) {
|
|
127
|
+
return
|
|
128
|
+
}
|
|
129
|
+
const { columnIndex, index } = evt
|
|
130
|
+
const realIndex = this.enableEmptyItem ? Math.max(index - 1, 0) : index
|
|
131
|
+
if (columnIndex === 0) {
|
|
132
|
+
if (this.items[realIndex][this.childrenField] && this.items[realIndex][this.childrenField].length) {
|
|
133
|
+
const columns = this.items[realIndex][this.childrenField].map(v => v[this.textField])
|
|
134
|
+
this.$refs.picker.setColumnValues(1, this.enableEmptyItem ? ['--请选择--'].concat(columns) : columns)
|
|
135
|
+
} else {
|
|
136
|
+
this.$refs.picker.setColumnValues(1, this.enableEmptyItem ? ['--请选择--'] : [])
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
handlePickerConfirm ({ indexs }) {
|
|
141
|
+
if (!indexs || !indexs.length) {
|
|
142
|
+
this.$emit('input', null)
|
|
143
|
+
} else {
|
|
144
|
+
const nextIndexs = this.enableEmptyItem ? indexs.map(index => index - 1) : indexs
|
|
145
|
+
if (nextIndexs[0] < 0) {
|
|
146
|
+
this.$emit('input', null)
|
|
147
|
+
} else {
|
|
148
|
+
if (nextIndexs.length === 2) {
|
|
149
|
+
if (nextIndexs[1] < 0) {
|
|
150
|
+
const item = this.items[nextIndexs[0]]
|
|
151
|
+
if (item) {
|
|
152
|
+
this.$emit('input', item[this.valueField])
|
|
153
|
+
} else {
|
|
154
|
+
this.$emit('input', null)
|
|
155
|
+
}
|
|
156
|
+
} else {
|
|
157
|
+
const item = this.items[nextIndexs[0]]
|
|
158
|
+
if (item) {
|
|
159
|
+
const childItems = item[this.childrenField]
|
|
160
|
+
if (childItems[nextIndexs[1]]) {
|
|
161
|
+
this.$emit('input', childItems[nextIndexs[1]][this.valueField])
|
|
162
|
+
} else {
|
|
163
|
+
this.$emit('input', null)
|
|
164
|
+
}
|
|
165
|
+
} else {
|
|
166
|
+
this.$emit('input', null)
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
} else {
|
|
170
|
+
|
|
171
|
+
const item = this.items[nextIndexs[0]]
|
|
172
|
+
if (item) {
|
|
173
|
+
this.$emit('input', item[this.valueField])
|
|
174
|
+
} else {
|
|
175
|
+
this.$emit('input', null)
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
handleHandleClick () {
|
|
182
|
+
this.$refs.picker.open()
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
</script>
|
|
187
|
+
|
|
188
|
+
<style lang="less">
|
|
189
|
+
.bi-picker{
|
|
190
|
+
display: inline-block;
|
|
191
|
+
&.is-border {
|
|
192
|
+
.bi-picker__handle{
|
|
193
|
+
border: 1px solid #eee;
|
|
194
|
+
border-radius: 3px;
|
|
195
|
+
padding: 0 24px 0 12px;
|
|
196
|
+
}
|
|
197
|
+
.bi-picker__handle-clear{
|
|
198
|
+
margin-top: -3px;
|
|
199
|
+
right: 12px;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
.bi-picker__handle{
|
|
204
|
+
display: flex;
|
|
205
|
+
flex-direction: row;
|
|
206
|
+
align-items: center;
|
|
207
|
+
height: 30px;
|
|
208
|
+
line-height: 30px;
|
|
209
|
+
padding: 1px 24px 1px 1px;
|
|
210
|
+
position: relative;
|
|
211
|
+
box-sizing: border-box;
|
|
212
|
+
}
|
|
213
|
+
.bi-picker__handle-prefix{
|
|
214
|
+
margin-right: 4px;
|
|
215
|
+
}
|
|
216
|
+
.bi-picker__handle-arrow{
|
|
217
|
+
width: 18px;
|
|
218
|
+
height: 18px;
|
|
219
|
+
position: relative;
|
|
220
|
+
margin-left: 4px;
|
|
221
|
+
position: absolute;
|
|
222
|
+
right: 4px;
|
|
223
|
+
top: 50%;
|
|
224
|
+
transform: translateY(-50%);
|
|
225
|
+
&:after {
|
|
226
|
+
position: absolute;
|
|
227
|
+
top: 4px;
|
|
228
|
+
left: 6px;
|
|
229
|
+
content: '';
|
|
230
|
+
width: 5px;
|
|
231
|
+
height: 5px;
|
|
232
|
+
border: 1px solid #555;
|
|
233
|
+
display: inline-block;
|
|
234
|
+
transform: rotate(45deg);
|
|
235
|
+
border-left: 0;
|
|
236
|
+
border-top: 0;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
.bi-picker__handle-clear{
|
|
240
|
+
width: 18px;
|
|
241
|
+
height: 18px;
|
|
242
|
+
background-color: #eee;
|
|
243
|
+
position: relative;
|
|
244
|
+
border-radius: 50%;
|
|
245
|
+
position: absolute;
|
|
246
|
+
right: 6px;
|
|
247
|
+
top: 50%;
|
|
248
|
+
margin-top: -2px;
|
|
249
|
+
transform: rotate(45deg) translateY(-50%);
|
|
250
|
+
&:after, &:before {
|
|
251
|
+
content: '';
|
|
252
|
+
position: absolute;
|
|
253
|
+
left: 50%;
|
|
254
|
+
top: 50%;
|
|
255
|
+
transform: translate(-50%, -50%);
|
|
256
|
+
background-color: #444;
|
|
257
|
+
}
|
|
258
|
+
&:after {
|
|
259
|
+
width: 10px;
|
|
260
|
+
height: 1px;
|
|
261
|
+
}
|
|
262
|
+
&:before {
|
|
263
|
+
width: 1px;
|
|
264
|
+
height: 10px;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
.bi-picker__handle-placeholder{
|
|
268
|
+
color: #999;
|
|
269
|
+
}
|
|
270
|
+
</style>
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<uv-popup
|
|
3
|
+
ref="popup"
|
|
4
|
+
class="ui-popup"
|
|
5
|
+
:class="{'is-opened': opened}"
|
|
6
|
+
:closeOnClickOverlay="maskable"
|
|
7
|
+
:bg-color="bgColor"
|
|
8
|
+
:mode="mode"
|
|
9
|
+
:safe-area-inset-bottom="safeAreaBottom"
|
|
10
|
+
@change="handleVisibleChange"
|
|
11
|
+
@maskClick="handleMaskClick"
|
|
12
|
+
>
|
|
13
|
+
<template v-if="title">
|
|
14
|
+
<view class="ui-popup__head">
|
|
15
|
+
<view class="ui-popup__title">{{ title }}</view>
|
|
16
|
+
<view class="ui-popup__close" @click="handleCloseClick"></view>
|
|
17
|
+
</view>
|
|
18
|
+
</template>
|
|
19
|
+
<view class="ui-popup__body">
|
|
20
|
+
<slot></slot>
|
|
21
|
+
</view>
|
|
22
|
+
</uv-popup>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
export default {
|
|
27
|
+
name: "UiPopup",
|
|
28
|
+
props: {
|
|
29
|
+
value: {
|
|
30
|
+
type: Boolean
|
|
31
|
+
},
|
|
32
|
+
title: {
|
|
33
|
+
type: String
|
|
34
|
+
},
|
|
35
|
+
mode: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'bottom'
|
|
38
|
+
},
|
|
39
|
+
maskable: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: true
|
|
42
|
+
},
|
|
43
|
+
safeAreaBottom: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: true
|
|
46
|
+
},
|
|
47
|
+
bgColor: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: "#ffffff"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
data () {
|
|
53
|
+
return {
|
|
54
|
+
opened: false
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
watch: {
|
|
58
|
+
value () {
|
|
59
|
+
this.syncVisible()
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
created () {
|
|
63
|
+
this.syncVisible()
|
|
64
|
+
},
|
|
65
|
+
methods: {
|
|
66
|
+
syncVisible () {
|
|
67
|
+
this.$nextTick(() => {
|
|
68
|
+
if (this.value) {
|
|
69
|
+
this.$refs.popup.open()
|
|
70
|
+
} else {
|
|
71
|
+
this.$refs.popup.close()
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
},
|
|
75
|
+
handleMaskClick () {
|
|
76
|
+
this.$emit('mask-click')
|
|
77
|
+
},
|
|
78
|
+
handleCloseClick () {
|
|
79
|
+
this.$emit('input', false)
|
|
80
|
+
},
|
|
81
|
+
handleVisibleChange ({ show }) {
|
|
82
|
+
this.$emit('input', show)
|
|
83
|
+
if (show) {
|
|
84
|
+
this.$emit('open')
|
|
85
|
+
this._openTimer = setTimeout(() => {
|
|
86
|
+
this.opened = true
|
|
87
|
+
}, 400)
|
|
88
|
+
} else {
|
|
89
|
+
this.opened = false
|
|
90
|
+
clearTimeout(this._openTimer)
|
|
91
|
+
this.$emit('close')
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
beforeDestroy () {
|
|
96
|
+
clearTimeout(this._openTimer)
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
</script>
|
|
100
|
+
|
|
101
|
+
<style lang="less">
|
|
102
|
+
.ui-popup {
|
|
103
|
+
&.is-opened {
|
|
104
|
+
::v-deep > uni-view > .uv-overlay + [name=content] {
|
|
105
|
+
transform: none!important;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
.ui-popup__head{
|
|
110
|
+
height: 32px;
|
|
111
|
+
line-height: 32px;
|
|
112
|
+
padding: 4px 12px;
|
|
113
|
+
border-bottom: 1px solid #f3f3f3;
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-direction: row;
|
|
116
|
+
justify-content: space-between;
|
|
117
|
+
align-items: center;
|
|
118
|
+
}
|
|
119
|
+
.ui-popup__title{
|
|
120
|
+
}
|
|
121
|
+
.ui-popup__close{
|
|
122
|
+
width: 18px;
|
|
123
|
+
height: 18px;
|
|
124
|
+
position: relative;
|
|
125
|
+
transform: rotate(45deg);
|
|
126
|
+
&:after,&:before {
|
|
127
|
+
content: '';
|
|
128
|
+
position: absolute;
|
|
129
|
+
background-color: #999;
|
|
130
|
+
left: 50%;
|
|
131
|
+
top: 50%;
|
|
132
|
+
transform: translate(-50%, -50%);
|
|
133
|
+
}
|
|
134
|
+
&:after {
|
|
135
|
+
width: 14px;
|
|
136
|
+
height: 1px;
|
|
137
|
+
}
|
|
138
|
+
&:before {
|
|
139
|
+
width: 1px;
|
|
140
|
+
height: 14px;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
</style>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<uv-search
|
|
3
|
+
:shape="round ? 'round' : 'square'"
|
|
4
|
+
:placeholder="placeholder"
|
|
5
|
+
:show-action="showAction"
|
|
6
|
+
:focus="innerFocus"
|
|
7
|
+
:disabled="disabled"
|
|
8
|
+
:clearabled="clearable"
|
|
9
|
+
:action-text="actionText"
|
|
10
|
+
:value="value"
|
|
11
|
+
@search="handleSearch"
|
|
12
|
+
@clear="handleClear"
|
|
13
|
+
@click="handleClick"
|
|
14
|
+
@custom="handleCustomClick"
|
|
15
|
+
></uv-search>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
export default {
|
|
20
|
+
name: 'BiSearch',
|
|
21
|
+
props: {
|
|
22
|
+
value: {
|
|
23
|
+
type: String
|
|
24
|
+
},
|
|
25
|
+
focus: {
|
|
26
|
+
type: Boolean
|
|
27
|
+
},
|
|
28
|
+
round: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: true
|
|
31
|
+
},
|
|
32
|
+
clearable: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: true
|
|
35
|
+
},
|
|
36
|
+
disabled: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false
|
|
39
|
+
},
|
|
40
|
+
showAction: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: false
|
|
43
|
+
},
|
|
44
|
+
actionText: {
|
|
45
|
+
type: String
|
|
46
|
+
},
|
|
47
|
+
placeholder: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: '输入搜索关键词'
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
data () {
|
|
53
|
+
return {
|
|
54
|
+
innerFocus: false
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
mounted () {
|
|
58
|
+
// 加点延时解决真实浏览器里面没有获取焦点问题
|
|
59
|
+
this._timer = setTimeout(() => {
|
|
60
|
+
if (this.focus) {
|
|
61
|
+
this.innerFocus = true
|
|
62
|
+
}
|
|
63
|
+
}, 200)
|
|
64
|
+
},
|
|
65
|
+
methods: {
|
|
66
|
+
handleSearch (keyword) {
|
|
67
|
+
this.$emit('input', keyword)
|
|
68
|
+
},
|
|
69
|
+
handleClear () {
|
|
70
|
+
this.$emit('input', '')
|
|
71
|
+
},
|
|
72
|
+
handleClick () {
|
|
73
|
+
this.$emit('click')
|
|
74
|
+
},
|
|
75
|
+
handleCustomClick () {
|
|
76
|
+
this.$emit('action-click')
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
beforeDestroy () {
|
|
80
|
+
clearTimeout(this._timer)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<style>
|
|
86
|
+
</style>
|