dpzvc3-ui 3.0.0
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/LICENSE +20 -0
- package/README.md +175 -0
- package/build-style.js +58 -0
- package/dist/dpzvc3.esm.js +17676 -0
- package/dist/dpzvc3.esm.js.map +1 -0
- package/dist/dpzvc3.esm.min.js +2 -0
- package/dist/dpzvc3.esm.min.js.map +1 -0
- package/dist/dpzvc3.js +15200 -0
- package/dist/dpzvc3.js.map +1 -0
- package/dist/dpzvc3.min.js +2 -0
- package/dist/dpzvc3.min.js.map +1 -0
- package/dist/styles/base/font.css +1 -0
- package/dist/styles/base/reset.css +1 -0
- package/dist/styles/base/variable.css +0 -0
- package/dist/styles/components/actionSheet.css +1 -0
- package/dist/styles/components/badge.css +1 -0
- package/dist/styles/components/button.css +1 -0
- package/dist/styles/components/card.css +1 -0
- package/dist/styles/components/cell-swipe.css +1 -0
- package/dist/styles/components/cell.css +1 -0
- package/dist/styles/components/checkBox.css +1 -0
- package/dist/styles/components/editor.css +1 -0
- package/dist/styles/components/header.css +1 -0
- package/dist/styles/components/indicator.css +1 -0
- package/dist/styles/components/loadmore.css +1 -0
- package/dist/styles/components/message.css +1 -0
- package/dist/styles/components/modal.css +1 -0
- package/dist/styles/components/number.css +1 -0
- package/dist/styles/components/picker.css +1 -0
- package/dist/styles/components/popup.css +1 -0
- package/dist/styles/components/progress.css +1 -0
- package/dist/styles/components/prompt.css +1 -0
- package/dist/styles/components/radioBox.css +1 -0
- package/dist/styles/components/slide-Bar.css +1 -0
- package/dist/styles/components/spinner.css +1 -0
- package/dist/styles/components/swipe.css +1 -0
- package/dist/styles/components/switchBar.css +1 -0
- package/dist/styles/components/tab.css +1 -0
- package/dist/styles/components/text.css +1 -0
- package/dist/styles/components/toTop.css +1 -0
- package/dist/styles/components/upload.css +1 -0
- package/dist/styles/dpzvc3.css +1 -0
- package/dist/styles/utils/1px.css +1 -0
- package/dist/styles/utils/animation.css +1 -0
- package/dist/styles/utils/nowrap.css +1 -0
- package/dist-prod/91.9d79b442ec3131707419.js +3 -0
- package/dist-prod/91.9d79b442ec3131707419.js.LICENSE.txt +25 -0
- package/dist-prod/91.9d79b442ec3131707419.js.map +1 -0
- package/dist-prod/actionsheet.e2f7c32d0120f5147a4f.chunk.js +2 -0
- package/dist-prod/actionsheet.e2f7c32d0120f5147a4f.chunk.js.map +1 -0
- package/dist-prod/badge.6038c4ccc54ffb56a645.chunk.js +2 -0
- package/dist-prod/badge.6038c4ccc54ffb56a645.chunk.js.map +1 -0
- package/dist-prod/button.28b491339fbba29c3f16.chunk.js +2 -0
- package/dist-prod/button.28b491339fbba29c3f16.chunk.js.map +1 -0
- package/dist-prod/card.3ad847f07bebc1391125.chunk.js +2 -0
- package/dist-prod/card.3ad847f07bebc1391125.chunk.js.map +1 -0
- package/dist-prod/cell.8920796a9ebd2d84bbd3.chunk.js +2 -0
- package/dist-prod/cell.8920796a9ebd2d84bbd3.chunk.js.map +1 -0
- package/dist-prod/cellswipe.53b0178e4638c201dcf1.chunk.js +2 -0
- package/dist-prod/cellswipe.53b0178e4638c201dcf1.chunk.js.map +1 -0
- package/dist-prod/checkbox.87403976981ee0f64f4a.chunk.js +2 -0
- package/dist-prod/checkbox.87403976981ee0f64f4a.chunk.js.map +1 -0
- package/dist-prod/guide.5195c74796a7a0e37f7b.chunk.js +2 -0
- package/dist-prod/guide.5195c74796a7a0e37f7b.chunk.js.map +1 -0
- package/dist-prod/header.e3cecc6d60f801c1c105.chunk.js +2 -0
- package/dist-prod/header.e3cecc6d60f801c1c105.chunk.js.map +1 -0
- package/dist-prod/index.html +19 -0
- package/dist-prod/indicator.6b0c7a91ca254c3586e8.chunk.js +2 -0
- package/dist-prod/indicator.6b0c7a91ca254c3586e8.chunk.js.map +1 -0
- package/dist-prod/loadmore.ba86c35311fc68ee215b.chunk.js +2 -0
- package/dist-prod/loadmore.ba86c35311fc68ee215b.chunk.js.map +1 -0
- package/dist-prod/main.2e9aaa9095e329ea2d7b.js +2 -0
- package/dist-prod/main.2e9aaa9095e329ea2d7b.js.map +1 -0
- package/dist-prod/message.e57fa263a214006f7191.chunk.js +2 -0
- package/dist-prod/message.e57fa263a214006f7191.chunk.js.map +1 -0
- package/dist-prod/modal.1172c8ba7d90503fc8e8.chunk.js +2 -0
- package/dist-prod/modal.1172c8ba7d90503fc8e8.chunk.js.map +1 -0
- package/dist-prod/picker.4ff114161c5c3f8df57a.chunk.js +2 -0
- package/dist-prod/picker.4ff114161c5c3f8df57a.chunk.js.map +1 -0
- package/dist-prod/popup.8f92c027932e4d47fa59.chunk.js +2 -0
- package/dist-prod/popup.8f92c027932e4d47fa59.chunk.js.map +1 -0
- package/dist-prod/progress.1e0d785044aecadc5615.chunk.js +2 -0
- package/dist-prod/progress.1e0d785044aecadc5615.chunk.js.map +1 -0
- package/dist-prod/prompt.c2b442c3dd0e6d8319bc.chunk.js +2 -0
- package/dist-prod/prompt.c2b442c3dd0e6d8319bc.chunk.js.map +1 -0
- package/dist-prod/radiobox.479703c69b75d473e85d.chunk.js +2 -0
- package/dist-prod/radiobox.479703c69b75d473e85d.chunk.js.map +1 -0
- package/dist-prod/rater.939e0e7e770728f684c3.chunk.js +2 -0
- package/dist-prod/rater.939e0e7e770728f684c3.chunk.js.map +1 -0
- package/dist-prod/slidebar.3d3f48a631f03a2210c9.chunk.js +2 -0
- package/dist-prod/slidebar.3d3f48a631f03a2210c9.chunk.js.map +1 -0
- package/dist-prod/spinner.f20e3bd8cec27d26afe0.chunk.js +2 -0
- package/dist-prod/spinner.f20e3bd8cec27d26afe0.chunk.js.map +1 -0
- package/dist-prod/swipe.2e5b0acc3bbb2bf49dd5.chunk.js +2 -0
- package/dist-prod/swipe.2e5b0acc3bbb2bf49dd5.chunk.js.map +1 -0
- package/dist-prod/switchbar.56d03d96c275ff4c65a1.chunk.js +2 -0
- package/dist-prod/switchbar.56d03d96c275ff4c65a1.chunk.js.map +1 -0
- package/dist-prod/tab.4c391211c41b7d12b585.chunk.js +2 -0
- package/dist-prod/tab.4c391211c41b7d12b585.chunk.js.map +1 -0
- package/dist-prod/text.ee2804ba87e6a460aa7d.chunk.js +2 -0
- package/dist-prod/text.ee2804ba87e6a460aa7d.chunk.js.map +1 -0
- package/dist-prod/totop.c6f9dce152bb6abe5cb2.chunk.js +2 -0
- package/dist-prod/totop.c6f9dce152bb6abe5cb2.chunk.js.map +1 -0
- package/dist-prod/upload.ec7a954970889869d93e.chunk.js +2 -0
- package/dist-prod/upload.ec7a954970889869d93e.chunk.js.map +1 -0
- package/images/IMG_2614 2 2.JPG +0 -0
- package/images/IMG_2614.JPG +0 -0
- package/images/IMG_2615 2.JPG +0 -0
- package/images/IMG_2615.JPG +0 -0
- package/package.json +113 -0
- package/postcss.config.js +5 -0
- package/src/components/Indicator/Indicator.vue +82 -0
- package/src/components/Indicator/index.js +86 -0
- package/src/components/Text/Number.vue +167 -0
- package/src/components/Text/index.js +7 -0
- package/src/components/Text/textBar.vue +122 -0
- package/src/components/action-sheet/actionSheet.vue +93 -0
- package/src/components/action-sheet/index.js +5 -0
- package/src/components/app.vue +61 -0
- package/src/components/badge/badge.vue +80 -0
- package/src/components/badge/index.js +5 -0
- package/src/components/button/button.vue +111 -0
- package/src/components/button/index.js +5 -0
- package/src/components/card/card.vue +49 -0
- package/src/components/card/index.js +5 -0
- package/src/components/cell/cell.vue +93 -0
- package/src/components/cell/index.js +5 -0
- package/src/components/cell-swipe/cell-swipe.vue +169 -0
- package/src/components/cell-swipe/index.js +5 -0
- package/src/components/checkBox/checkbox-group.vue +74 -0
- package/src/components/checkBox/checkbox.vue +117 -0
- package/src/components/checkBox/index.js +8 -0
- package/src/components/header/header.vue +130 -0
- package/src/components/header/index.js +5 -0
- package/src/components/loadMore/index.js +5 -0
- package/src/components/loadMore/loadmore.vue +258 -0
- package/src/components/message/confirm.js +60 -0
- package/src/components/message/index.js +111 -0
- package/src/components/message/message.vue +137 -0
- package/src/components/message/messageGroup.vue +82 -0
- package/src/components/modal/confirm.js +122 -0
- package/src/components/modal/index.js +52 -0
- package/src/components/modal/modal.vue +138 -0
- package/src/components/picker/area-picker/area-picker.vue +230 -0
- package/src/components/picker/area-picker/props.js +17 -0
- package/src/components/picker/date-picker/date-picker.vue +191 -0
- package/src/components/picker/date-picker/props.js +24 -0
- package/src/components/picker/index.js +5 -0
- package/src/components/picker/normal-picker/normal-picker.vue +120 -0
- package/src/components/picker/normal-picker/props.js +20 -0
- package/src/components/picker/picker-slot.vue +217 -0
- package/src/components/picker/picker.vue +111 -0
- package/src/components/popup/index.js +5 -0
- package/src/components/popup/popup.vue +91 -0
- package/src/components/progress/index.js +5 -0
- package/src/components/progress/progress.vue +86 -0
- package/src/components/prompt/confirm.js +91 -0
- package/src/components/prompt/index.js +53 -0
- package/src/components/prompt/prompt.vue +125 -0
- package/src/components/radioBox/index.js +8 -0
- package/src/components/radioBox/radiobox-group.vue +66 -0
- package/src/components/radioBox/radiobox.vue +88 -0
- package/src/components/rater/index.js +5 -0
- package/src/components/rater/rater.vue +118 -0
- package/src/components/slideBar/index.js +6 -0
- package/src/components/slideBar/slideBar.vue +207 -0
- package/src/components/spinner/behavior/blade.vue +42 -0
- package/src/components/spinner/behavior/double-bounce.vue +38 -0
- package/src/components/spinner/behavior/fading-circle.vue +55 -0
- package/src/components/spinner/behavior/snake.vue +41 -0
- package/src/components/spinner/behavior/triple-bounce.vue +52 -0
- package/src/components/spinner/index.js +5 -0
- package/src/components/spinner/props.js +28 -0
- package/src/components/spinner/spinner.vue +78 -0
- package/src/components/swipe/index.js +5 -0
- package/src/components/swipe/swipe.vue +281 -0
- package/src/components/switchbar/index.js +5 -0
- package/src/components/switchbar/switchbar.vue +79 -0
- package/src/components/tab/index.js +6 -0
- package/src/components/tab/tab.vue +89 -0
- package/src/components/toTop/index.js +5 -0
- package/src/components/toTop/topTop.vue +78 -0
- package/src/components/upload/index.js +5 -0
- package/src/components/upload/upload.vue +166 -0
- package/src/config/config.js +16 -0
- package/src/directives/clickoutside.js +42 -0
- package/src/directives/tranferDom.js +66 -0
- package/src/index.js +149 -0
- package/src/lib/MegaPixImage.js +163 -0
- package/src/lib/MegaPixImageOld.js +153 -0
- package/src/lib/exif-js.js +235 -0
- package/src/lib/exif.js +789 -0
- package/src/main.js +31 -0
- package/src/mixin/emitter.js +72 -0
- package/src/mixin/input.js +41 -0
- package/src/router.js +36 -0
- package/src/styles/base/font.less +99 -0
- package/src/styles/base/reset.less +135 -0
- package/src/styles/base/variable.less +108 -0
- package/src/styles/components/actionSheet.less +43 -0
- package/src/styles/components/badge.less +81 -0
- package/src/styles/components/button.less +124 -0
- package/src/styles/components/card.less +31 -0
- package/src/styles/components/cell-swipe.less +20 -0
- package/src/styles/components/cell.less +75 -0
- package/src/styles/components/checkBox.less +113 -0
- package/src/styles/components/editor.less +3 -0
- package/src/styles/components/header.less +72 -0
- package/src/styles/components/indicator.less +39 -0
- package/src/styles/components/loadmore.less +48 -0
- package/src/styles/components/message.less +57 -0
- package/src/styles/components/modal.less +84 -0
- package/src/styles/components/number.less +60 -0
- package/src/styles/components/picker.less +152 -0
- package/src/styles/components/popup.less +46 -0
- package/src/styles/components/progress.less +52 -0
- package/src/styles/components/prompt.less +37 -0
- package/src/styles/components/radioBox.less +138 -0
- package/src/styles/components/slide-Bar.less +149 -0
- package/src/styles/components/spinner.less +329 -0
- package/src/styles/components/swipe.less +125 -0
- package/src/styles/components/switchBar.less +88 -0
- package/src/styles/components/tab.less +71 -0
- package/src/styles/components/text.less +82 -0
- package/src/styles/components/toTop.less +28 -0
- package/src/styles/components/upload.less +23 -0
- package/src/styles/index.less +38 -0
- package/src/styles/utils/1px.less +206 -0
- package/src/styles/utils/animation.less +165 -0
- package/src/styles/utils/nowrap.less +19 -0
- package/src/template/index.ejs +40 -0
- package/src/utils/util.js +202 -0
- package/src/vconsole-resources.min.js +6 -0
- package/src/vconsole-sources.min.js +6 -0
- package/src/vconsole.min.js +7 -0
- package/src/views/ActionSheet.vue +46 -0
- package/src/views/Badge.vue +51 -0
- package/src/views/Button.vue +69 -0
- package/src/views/Card.vue +88 -0
- package/src/views/Cell.vue +30 -0
- package/src/views/CellSwipe.vue +68 -0
- package/src/views/CheckBox.vue +77 -0
- package/src/views/Header.vue +70 -0
- package/src/views/Indicator.vue +82 -0
- package/src/views/LoadMore.vue +73 -0
- package/src/views/Message.vue +61 -0
- package/src/views/Modal.vue +69 -0
- package/src/views/Picker.vue +140 -0
- package/src/views/Popup.vue +97 -0
- package/src/views/Progress.vue +47 -0
- package/src/views/Prompt.vue +43 -0
- package/src/views/RadioBox.vue +68 -0
- package/src/views/Rater.vue +49 -0
- package/src/views/SlideBar.vue +55 -0
- package/src/views/Spinner.vue +15 -0
- package/src/views/Swipe.vue +59 -0
- package/src/views/SwitchBar.vue +47 -0
- package/src/views/Tab.vue +53 -0
- package/src/views/Text.vue +93 -0
- package/src/views/ToTop.vue +17 -0
- package/src/views/Upload.vue +61 -0
- package/src/views/guide.vue +164 -0
- package/src/views/index.vue +554 -0
- package/webpack.base.config.js +65 -0
- package/webpack.dev.config.js +42 -0
- package/webpack.dist.dev.config.js +75 -0
- package/webpack.dist.prod.config.js +89 -0
- package/webpack.prod.config.js +51 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="app">
|
|
3
|
+
<transition :name="direction">
|
|
4
|
+
<router-view class="page" />
|
|
5
|
+
</transition>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
<script>
|
|
9
|
+
export default {
|
|
10
|
+
data () {
|
|
11
|
+
return {
|
|
12
|
+
direction: 'dpzvc3-ani-fade'
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
watch: {
|
|
16
|
+
$route (to, from) {
|
|
17
|
+
const toDepth = to.path.split('/').length
|
|
18
|
+
const fromDepth = from.path.split('/').length
|
|
19
|
+
|
|
20
|
+
if (toDepth === fromDepth) {
|
|
21
|
+
this.direction = 'dpzvc3-ani-fade'
|
|
22
|
+
} else if (toDepth > fromDepth) {
|
|
23
|
+
this.direction = 'dpzvc3-ani-left'
|
|
24
|
+
} else {
|
|
25
|
+
this.direction = 'dpzvc3-ani-right'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
mounted () {
|
|
30
|
+
|
|
31
|
+
},
|
|
32
|
+
beforeUnmount () {
|
|
33
|
+
|
|
34
|
+
},
|
|
35
|
+
methods: {
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
40
|
+
<style lang="less">
|
|
41
|
+
// @import '../styles/common.css';
|
|
42
|
+
|
|
43
|
+
// @import '../../src/styles/index';
|
|
44
|
+
@import '../styles/index.less';
|
|
45
|
+
|
|
46
|
+
.page{
|
|
47
|
+
position: relative;
|
|
48
|
+
top: 0;
|
|
49
|
+
left: 0;
|
|
50
|
+
right: 0;
|
|
51
|
+
bottom: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
html,body {
|
|
55
|
+
height: 100%;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
#app {
|
|
59
|
+
height: 100%;
|
|
60
|
+
}
|
|
61
|
+
</style>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span :class="classes">
|
|
3
|
+
<slot />
|
|
4
|
+
<sup
|
|
5
|
+
v-show="visible"
|
|
6
|
+
:class="supClasses"
|
|
7
|
+
>{{ displayCount }}</sup>
|
|
8
|
+
</span>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
import { computed, ref, watch } from 'vue'
|
|
13
|
+
|
|
14
|
+
const prefixCls = 'dpzvc3-badge'
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
name: 'Dpzvc3Badge',
|
|
18
|
+
props: {
|
|
19
|
+
type: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: 'danger',
|
|
22
|
+
validator: (val) => ['normal', 'danger', 'warning', 'success'].includes(val)
|
|
23
|
+
},
|
|
24
|
+
size: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: 'normal',
|
|
27
|
+
validator: (val) => ['small', 'normal', 'large'].includes(val)
|
|
28
|
+
},
|
|
29
|
+
dot: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false
|
|
32
|
+
},
|
|
33
|
+
max: {
|
|
34
|
+
type: [Number, String],
|
|
35
|
+
default: 99
|
|
36
|
+
},
|
|
37
|
+
number: [Number, String]
|
|
38
|
+
},
|
|
39
|
+
setup (props) {
|
|
40
|
+
const visible = ref(true)
|
|
41
|
+
|
|
42
|
+
// 监听 number 来控制 visible
|
|
43
|
+
watch(
|
|
44
|
+
() => props.number,
|
|
45
|
+
(val) => {
|
|
46
|
+
if (props.dot) {
|
|
47
|
+
visible.value = true
|
|
48
|
+
} else if (val == null || isNaN(Number(val))) {
|
|
49
|
+
visible.value = false
|
|
50
|
+
} else {
|
|
51
|
+
visible.value = true
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
{ immediate: true }
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
const classes = computed(() => [prefixCls])
|
|
58
|
+
const supClasses = computed(() => [
|
|
59
|
+
`${prefixCls}-${props.type}`,
|
|
60
|
+
{
|
|
61
|
+
[`${prefixCls}-size-${props.size}`]: !props.dot,
|
|
62
|
+
[`${prefixCls}-dot`]: props.dot
|
|
63
|
+
}
|
|
64
|
+
])
|
|
65
|
+
|
|
66
|
+
const displayCount = computed(() => {
|
|
67
|
+
if (props.dot) return ''
|
|
68
|
+
const num = Number(props.number)
|
|
69
|
+
return num <= Number(props.max) ? String(num) : String(props.max) + '+'
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
return {
|
|
73
|
+
classes,
|
|
74
|
+
supClasses,
|
|
75
|
+
visible,
|
|
76
|
+
displayCount
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
</script>
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="classes"
|
|
4
|
+
:style="wrapperStyles"
|
|
5
|
+
>
|
|
6
|
+
<button
|
|
7
|
+
:style="styles"
|
|
8
|
+
:class="buttonClass"
|
|
9
|
+
:disabled="disabled"
|
|
10
|
+
@click.stop="handleClick"
|
|
11
|
+
>
|
|
12
|
+
<slot name="left">
|
|
13
|
+
<span
|
|
14
|
+
v-show="loadingValue"
|
|
15
|
+
class="loading"
|
|
16
|
+
>
|
|
17
|
+
<Spinner
|
|
18
|
+
type="blade"
|
|
19
|
+
size="15"
|
|
20
|
+
color="#ffffff"
|
|
21
|
+
/>
|
|
22
|
+
</span>
|
|
23
|
+
</slot>
|
|
24
|
+
<slot><span>确定</span></slot>
|
|
25
|
+
<slot name="right" />
|
|
26
|
+
</button>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
|
29
|
+
|
|
30
|
+
<script>
|
|
31
|
+
import { defineComponent, computed } from 'vue'
|
|
32
|
+
import Spinner from '../spinner'
|
|
33
|
+
|
|
34
|
+
const prefixCls = 'dpzvc3-button'
|
|
35
|
+
|
|
36
|
+
export default defineComponent({
|
|
37
|
+
name: 'VButton',
|
|
38
|
+
components: { Spinner },
|
|
39
|
+
props: {
|
|
40
|
+
type: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: 'normal',
|
|
43
|
+
validator: (val) =>
|
|
44
|
+
['success', 'loading', 'normal', 'primary', 'warning', 'danger', 'text'].includes(val)
|
|
45
|
+
},
|
|
46
|
+
styles: {
|
|
47
|
+
type: Object,
|
|
48
|
+
default: () => ({})
|
|
49
|
+
},
|
|
50
|
+
circle: { type: Boolean, default: false },
|
|
51
|
+
disabled: { type: Boolean, default: false },
|
|
52
|
+
inline: { type: Boolean, default: false },
|
|
53
|
+
width: { type: String, default: '100%' },
|
|
54
|
+
height: { type: String, default: '40px' },
|
|
55
|
+
loading: { type: Boolean, default: false },
|
|
56
|
+
radius: { type: Boolean, default: true },
|
|
57
|
+
border: { type: String, default: 'all' }
|
|
58
|
+
},
|
|
59
|
+
setup (props, { emit }) {
|
|
60
|
+
// 外层容器类
|
|
61
|
+
const classes = computed(() => [
|
|
62
|
+
prefixCls,
|
|
63
|
+
{
|
|
64
|
+
[`${prefixCls}-circle`]: props.circle,
|
|
65
|
+
[`${prefixCls}-inline`]: props.inline
|
|
66
|
+
}
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
// 外层容器样式
|
|
70
|
+
const wrapperStyles = computed(() => ({
|
|
71
|
+
display: props.inline ? 'inline-block' : 'block',
|
|
72
|
+
width: props.width,
|
|
73
|
+
height: props.height
|
|
74
|
+
}))
|
|
75
|
+
|
|
76
|
+
// button 类
|
|
77
|
+
const buttonClass = computed(() => [
|
|
78
|
+
`${prefixCls}-btn`,
|
|
79
|
+
[`dpzvc3-1px-${props.border}`],
|
|
80
|
+
{
|
|
81
|
+
[`${prefixCls}-success`]: props.type === 'success',
|
|
82
|
+
[`${prefixCls}-loading`]: props.type === 'loading',
|
|
83
|
+
[`${prefixCls}-normal`]: props.type === 'normal',
|
|
84
|
+
[`${prefixCls}-warning`]: props.type === 'warning',
|
|
85
|
+
[`${prefixCls}-danger`]: props.type === 'danger',
|
|
86
|
+
[`${prefixCls}-text`]: props.type === 'text',
|
|
87
|
+
[`${prefixCls}-primary`]: props.type === 'primary',
|
|
88
|
+
[`${prefixCls}-disabled`]: props.disabled,
|
|
89
|
+
[`${prefixCls}-radius`]: props.radius
|
|
90
|
+
}
|
|
91
|
+
])
|
|
92
|
+
|
|
93
|
+
// 点击事件
|
|
94
|
+
const handleClick = (e) => {
|
|
95
|
+
if (props.disabled || props.loading) return
|
|
96
|
+
emit('click', e)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// 状态
|
|
100
|
+
const loadingValue = computed(() => props.loading)
|
|
101
|
+
|
|
102
|
+
return {
|
|
103
|
+
classes,
|
|
104
|
+
wrapperStyles,
|
|
105
|
+
buttonClass,
|
|
106
|
+
handleClick,
|
|
107
|
+
loadingValue
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
})
|
|
111
|
+
</script>
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="classes"
|
|
4
|
+
:style="{ width: cardWidth }"
|
|
5
|
+
>
|
|
6
|
+
<div :class="headerClass">
|
|
7
|
+
<slot name="header" />
|
|
8
|
+
</div>
|
|
9
|
+
<div :class="contentClass">
|
|
10
|
+
<slot>
|
|
11
|
+
<div class="main" />
|
|
12
|
+
</slot>
|
|
13
|
+
</div>
|
|
14
|
+
<div :class="footerClass">
|
|
15
|
+
<slot name="footer" />
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script>
|
|
21
|
+
import { defineComponent, computed } from 'vue'
|
|
22
|
+
|
|
23
|
+
const prefixCls = 'dpzvc3-card'
|
|
24
|
+
|
|
25
|
+
export default defineComponent({
|
|
26
|
+
name: 'Dpzvc3Card',
|
|
27
|
+
props: {
|
|
28
|
+
width: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: '100%'
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
setup (props) {
|
|
34
|
+
const classes = computed(() => [prefixCls])
|
|
35
|
+
const headerClass = computed(() => [`${prefixCls}-header`, 'dpzvc3-1px-bottom'])
|
|
36
|
+
const contentClass = computed(() => [`${prefixCls}-content`])
|
|
37
|
+
const footerClass = computed(() => [`${prefixCls}-footer`, 'dpzvc3-1px-top'])
|
|
38
|
+
const cardWidth = computed(() => props.width)
|
|
39
|
+
return {
|
|
40
|
+
classes,
|
|
41
|
+
headerClass,
|
|
42
|
+
contentClass,
|
|
43
|
+
footerClass,
|
|
44
|
+
cardWidth
|
|
45
|
+
// 不返回 width,模板直接用 props.width
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
</script>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:href="toLink"
|
|
4
|
+
:class="classes"
|
|
5
|
+
@click.prevent="handleClick"
|
|
6
|
+
>
|
|
7
|
+
<span
|
|
8
|
+
v-if="hasMask"
|
|
9
|
+
:class="maskClass"
|
|
10
|
+
/>
|
|
11
|
+
<div :class="leftClasses">
|
|
12
|
+
<slot name="left" />
|
|
13
|
+
</div>
|
|
14
|
+
<div :class="wrapperClasses">
|
|
15
|
+
<div :class="titleClass">
|
|
16
|
+
<slot name="icon" />
|
|
17
|
+
<slot name="title">
|
|
18
|
+
<span v-text="title" />
|
|
19
|
+
<span
|
|
20
|
+
:class="labelClass"
|
|
21
|
+
v-text="label"
|
|
22
|
+
/>
|
|
23
|
+
</slot>
|
|
24
|
+
</div>
|
|
25
|
+
<div :class="valueClass">
|
|
26
|
+
<slot name="value">
|
|
27
|
+
<span v-text="value" />
|
|
28
|
+
</slot>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<div :class="rightClasses">
|
|
32
|
+
<slot name="right" />
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
import { computed } from 'vue'
|
|
39
|
+
import { useRouter } from 'vue-router'
|
|
40
|
+
|
|
41
|
+
const prefixCls = 'dpzvc3-cell'
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
name: 'Dpzvc3Cell',
|
|
45
|
+
props: {
|
|
46
|
+
title: String,
|
|
47
|
+
value: {},
|
|
48
|
+
label: String,
|
|
49
|
+
link: String,
|
|
50
|
+
hasMask: Boolean
|
|
51
|
+
},
|
|
52
|
+
setup (props, { emit }) {
|
|
53
|
+
const router = useRouter()
|
|
54
|
+
|
|
55
|
+
// 计算链接
|
|
56
|
+
const toLink = computed(() => {
|
|
57
|
+
if (!props.link) return ''
|
|
58
|
+
// Vue 3 router.resolve 替代 Vue 2 match
|
|
59
|
+
const resolved = router.resolve(props.link)
|
|
60
|
+
return resolved.matched.length ? resolved.href : props.link
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
// 样式类
|
|
64
|
+
const classes = computed(() => [`${prefixCls}`])
|
|
65
|
+
const maskClass = computed(() => [`${prefixCls}-mask`])
|
|
66
|
+
const leftClasses = computed(() => [`${prefixCls}-left`])
|
|
67
|
+
const rightClasses = computed(() => [`${prefixCls}-right`])
|
|
68
|
+
const wrapperClasses = computed(() => [`${prefixCls}-main`, 'dpzvc3-1px-top'])
|
|
69
|
+
const titleClass = computed(() => [`${prefixCls}-main-title`])
|
|
70
|
+
const valueClass = computed(() => [`${prefixCls}-main-value`])
|
|
71
|
+
const labelClass = computed(() => [`${prefixCls}-main-label`])
|
|
72
|
+
|
|
73
|
+
// 点击跳转
|
|
74
|
+
const handleClick = (e) => {
|
|
75
|
+
if (props.link) router.push(props.link)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
toLink,
|
|
80
|
+
classes,
|
|
81
|
+
maskClass,
|
|
82
|
+
leftClasses,
|
|
83
|
+
rightClasses,
|
|
84
|
+
wrapperClasses,
|
|
85
|
+
titleClass,
|
|
86
|
+
valueClass,
|
|
87
|
+
labelClass,
|
|
88
|
+
handleClick,
|
|
89
|
+
emit
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
</script>
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Cell
|
|
3
|
+
ref="cell"
|
|
4
|
+
v-clickoutside:touchstart="swipe"
|
|
5
|
+
:title="title"
|
|
6
|
+
:value="value"
|
|
7
|
+
:label="label"
|
|
8
|
+
:link="link"
|
|
9
|
+
:has-mask="hasMask"
|
|
10
|
+
@click="swipe()"
|
|
11
|
+
@touchstart="onTouchStart"
|
|
12
|
+
@touchmove="onTouchMove"
|
|
13
|
+
@touchend="onTouchEnd"
|
|
14
|
+
>
|
|
15
|
+
<template #left>
|
|
16
|
+
<div
|
|
17
|
+
ref="leftRef"
|
|
18
|
+
class="dpzvc3-cell-swipe-group"
|
|
19
|
+
>
|
|
20
|
+
<span
|
|
21
|
+
v-for="(item, key) in left"
|
|
22
|
+
:key="key"
|
|
23
|
+
class="dpzvc3-cell-swipe-btn"
|
|
24
|
+
:style="item.style"
|
|
25
|
+
@click.stop="() => { item.handleClick && item.handleClick(); swipe() }"
|
|
26
|
+
v-html="item.content"
|
|
27
|
+
/>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<template #right>
|
|
32
|
+
<div
|
|
33
|
+
ref="rightRef"
|
|
34
|
+
class="dpzvc3-cell-swipe-group"
|
|
35
|
+
>
|
|
36
|
+
<span
|
|
37
|
+
v-for="(item, key) in right"
|
|
38
|
+
:key="key"
|
|
39
|
+
class="dpzvc3-cell-swipe-btn"
|
|
40
|
+
:style="item.style"
|
|
41
|
+
@click.stop="() => { item.handleClick && item.handleClick(); swipe() }"
|
|
42
|
+
v-html="item.content"
|
|
43
|
+
/>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
</Cell>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<script>
|
|
50
|
+
import { ref, reactive, onMounted, watch, nextTick } from 'vue'
|
|
51
|
+
import Cell from '../cell'
|
|
52
|
+
import Clickoutside from '../../directives/clickoutside'
|
|
53
|
+
|
|
54
|
+
export default {
|
|
55
|
+
name: 'CellSwipe',
|
|
56
|
+
components: { Cell },
|
|
57
|
+
directives: { Clickoutside },
|
|
58
|
+
props: {
|
|
59
|
+
title: String,
|
|
60
|
+
value: {},
|
|
61
|
+
label: String,
|
|
62
|
+
link: String,
|
|
63
|
+
left: Array,
|
|
64
|
+
right: Array,
|
|
65
|
+
hasMask: Boolean
|
|
66
|
+
},
|
|
67
|
+
setup (props) {
|
|
68
|
+
const cell = ref(null)
|
|
69
|
+
const leftRef = ref(null)
|
|
70
|
+
const rightRef = ref(null)
|
|
71
|
+
|
|
72
|
+
const state = reactive({
|
|
73
|
+
isDrag: false,
|
|
74
|
+
translate: 0,
|
|
75
|
+
$wrapper: null,
|
|
76
|
+
$left: null,
|
|
77
|
+
$right: null,
|
|
78
|
+
leftWidth: 0,
|
|
79
|
+
rightWidth: 0,
|
|
80
|
+
startX: 0,
|
|
81
|
+
currentX: 0,
|
|
82
|
+
direction: '',
|
|
83
|
+
distance: 0
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
const translate3d = (translate) => `translate3d(${translate}px,0,0)`
|
|
87
|
+
|
|
88
|
+
const swipe = (translate = 0) => {
|
|
89
|
+
state.translate = translate
|
|
90
|
+
if (state.$wrapper) state.$wrapper.style.transform = translate3d(translate)
|
|
91
|
+
if (state.$left) state.$left.style.transform = translate3d(-state.leftWidth + translate)
|
|
92
|
+
if (state.$right) state.$right.style.transform = translate3d(state.rightWidth + translate)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const onTouchStart = (e) => {
|
|
96
|
+
console.log('滑动开始')
|
|
97
|
+
state.startX = e.touches[0].clientX
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const onTouchMove = (e) => {
|
|
101
|
+
console.log('滑动移动')
|
|
102
|
+
e.preventDefault()
|
|
103
|
+
state.currentX = e.touches[0].clientX
|
|
104
|
+
const diff = state.currentX - state.startX
|
|
105
|
+
state.direction = diff < 0 ? 'left' : 'right'
|
|
106
|
+
|
|
107
|
+
if (state.direction === 'left') {
|
|
108
|
+
state.translate = Math.max(-state.rightWidth, diff)
|
|
109
|
+
} else {
|
|
110
|
+
state.translate = Math.min(state.leftWidth, diff)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
nextTick(() => swipe(state.translate))
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const onTouchEnd = () => {
|
|
117
|
+
console.log('滑动结束')
|
|
118
|
+
if (Math.abs(state.translate) > state.leftWidth / 2 && state.direction === 'right') {
|
|
119
|
+
swipe(state.leftWidth)
|
|
120
|
+
} else if (Math.abs(state.translate) > state.rightWidth / 2 && state.direction === 'left') {
|
|
121
|
+
swipe(-state.rightWidth)
|
|
122
|
+
} else {
|
|
123
|
+
swipe(0)
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
watch(() => props.left, () => {
|
|
128
|
+
nextTick(() => {
|
|
129
|
+
state.leftWidth = leftRef.value?.offsetWidth || 0
|
|
130
|
+
swipe()
|
|
131
|
+
})
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
watch(() => props.right, () => {
|
|
135
|
+
nextTick(() => {
|
|
136
|
+
state.rightWidth = rightRef.value?.offsetWidth || 0
|
|
137
|
+
swipe()
|
|
138
|
+
})
|
|
139
|
+
})
|
|
140
|
+
|
|
141
|
+
onMounted(() => {
|
|
142
|
+
nextTick(() => {
|
|
143
|
+
// if (!leftRef.value || !rightRef.value || !cell.value) return
|
|
144
|
+
state.$wrapper = cell.value.$el.querySelector('.dpzvc3-cell-main')
|
|
145
|
+
state.$left = leftRef.value.parentNode
|
|
146
|
+
state.$right = rightRef.value.parentNode
|
|
147
|
+
|
|
148
|
+
state.leftWidth = state.$left.offsetWidth
|
|
149
|
+
state.rightWidth = state.$right.offsetWidth
|
|
150
|
+
|
|
151
|
+
state.$left.style.transform = translate3d(-state.leftWidth)
|
|
152
|
+
state.$right.style.transform = translate3d(state.rightWidth + 1)
|
|
153
|
+
state.$wrapper.style.transform = translate3d(0)
|
|
154
|
+
})
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
return {
|
|
158
|
+
cell,
|
|
159
|
+
leftRef,
|
|
160
|
+
rightRef,
|
|
161
|
+
state,
|
|
162
|
+
swipe,
|
|
163
|
+
onTouchStart,
|
|
164
|
+
onTouchMove,
|
|
165
|
+
onTouchEnd
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
</script>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
:class="[
|
|
4
|
+
'dpzvc3-checkBoxGroup',
|
|
5
|
+
vertical ? 'dpzvc3-checkBoxGroup-vertical' : ''
|
|
6
|
+
]"
|
|
7
|
+
>
|
|
8
|
+
<slot />
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script>
|
|
13
|
+
import { defineComponent, ref, watch, provide } from 'vue'
|
|
14
|
+
// import Emitter from '../../mixin/emitter'
|
|
15
|
+
|
|
16
|
+
export default defineComponent({
|
|
17
|
+
name: 'CheckBoxGroup',
|
|
18
|
+
// mixins: [Emitter],
|
|
19
|
+
|
|
20
|
+
props: {
|
|
21
|
+
modelValue: {
|
|
22
|
+
type: Array,
|
|
23
|
+
default: () => []
|
|
24
|
+
},
|
|
25
|
+
single: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: false
|
|
28
|
+
},
|
|
29
|
+
vertical: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
emits: ['update:modelValue', 'on-change'],
|
|
36
|
+
|
|
37
|
+
setup (props, { emit }) {
|
|
38
|
+
// alert(props)
|
|
39
|
+
const currentValue = ref([...props.modelValue])
|
|
40
|
+
|
|
41
|
+
/** 对外暴露给 checkbox 的方法 */
|
|
42
|
+
const toggleOption = (label) => {
|
|
43
|
+
let newValue = []
|
|
44
|
+
newValue = [...label]
|
|
45
|
+
// currentValue.value = newValue
|
|
46
|
+
emit('update:modelValue', newValue)
|
|
47
|
+
emit('on-change', newValue)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** 提供给子 checkbox */
|
|
51
|
+
provide('CheckBoxGroup', {
|
|
52
|
+
currentValue,
|
|
53
|
+
toggleOption
|
|
54
|
+
// single: props.single
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
watch(
|
|
58
|
+
() => props.modelValue,
|
|
59
|
+
(val) => {
|
|
60
|
+
currentValue.value = [...val]
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
return {}
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<style scoped>
|
|
70
|
+
.dpzvc3-checkBoxGroup-vertical {
|
|
71
|
+
display: flex;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
}
|
|
74
|
+
</style>
|