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.
Files changed (268) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +175 -0
  3. package/build-style.js +58 -0
  4. package/dist/dpzvc3.esm.js +17676 -0
  5. package/dist/dpzvc3.esm.js.map +1 -0
  6. package/dist/dpzvc3.esm.min.js +2 -0
  7. package/dist/dpzvc3.esm.min.js.map +1 -0
  8. package/dist/dpzvc3.js +15200 -0
  9. package/dist/dpzvc3.js.map +1 -0
  10. package/dist/dpzvc3.min.js +2 -0
  11. package/dist/dpzvc3.min.js.map +1 -0
  12. package/dist/styles/base/font.css +1 -0
  13. package/dist/styles/base/reset.css +1 -0
  14. package/dist/styles/base/variable.css +0 -0
  15. package/dist/styles/components/actionSheet.css +1 -0
  16. package/dist/styles/components/badge.css +1 -0
  17. package/dist/styles/components/button.css +1 -0
  18. package/dist/styles/components/card.css +1 -0
  19. package/dist/styles/components/cell-swipe.css +1 -0
  20. package/dist/styles/components/cell.css +1 -0
  21. package/dist/styles/components/checkBox.css +1 -0
  22. package/dist/styles/components/editor.css +1 -0
  23. package/dist/styles/components/header.css +1 -0
  24. package/dist/styles/components/indicator.css +1 -0
  25. package/dist/styles/components/loadmore.css +1 -0
  26. package/dist/styles/components/message.css +1 -0
  27. package/dist/styles/components/modal.css +1 -0
  28. package/dist/styles/components/number.css +1 -0
  29. package/dist/styles/components/picker.css +1 -0
  30. package/dist/styles/components/popup.css +1 -0
  31. package/dist/styles/components/progress.css +1 -0
  32. package/dist/styles/components/prompt.css +1 -0
  33. package/dist/styles/components/radioBox.css +1 -0
  34. package/dist/styles/components/slide-Bar.css +1 -0
  35. package/dist/styles/components/spinner.css +1 -0
  36. package/dist/styles/components/swipe.css +1 -0
  37. package/dist/styles/components/switchBar.css +1 -0
  38. package/dist/styles/components/tab.css +1 -0
  39. package/dist/styles/components/text.css +1 -0
  40. package/dist/styles/components/toTop.css +1 -0
  41. package/dist/styles/components/upload.css +1 -0
  42. package/dist/styles/dpzvc3.css +1 -0
  43. package/dist/styles/utils/1px.css +1 -0
  44. package/dist/styles/utils/animation.css +1 -0
  45. package/dist/styles/utils/nowrap.css +1 -0
  46. package/dist-prod/91.9d79b442ec3131707419.js +3 -0
  47. package/dist-prod/91.9d79b442ec3131707419.js.LICENSE.txt +25 -0
  48. package/dist-prod/91.9d79b442ec3131707419.js.map +1 -0
  49. package/dist-prod/actionsheet.e2f7c32d0120f5147a4f.chunk.js +2 -0
  50. package/dist-prod/actionsheet.e2f7c32d0120f5147a4f.chunk.js.map +1 -0
  51. package/dist-prod/badge.6038c4ccc54ffb56a645.chunk.js +2 -0
  52. package/dist-prod/badge.6038c4ccc54ffb56a645.chunk.js.map +1 -0
  53. package/dist-prod/button.28b491339fbba29c3f16.chunk.js +2 -0
  54. package/dist-prod/button.28b491339fbba29c3f16.chunk.js.map +1 -0
  55. package/dist-prod/card.3ad847f07bebc1391125.chunk.js +2 -0
  56. package/dist-prod/card.3ad847f07bebc1391125.chunk.js.map +1 -0
  57. package/dist-prod/cell.8920796a9ebd2d84bbd3.chunk.js +2 -0
  58. package/dist-prod/cell.8920796a9ebd2d84bbd3.chunk.js.map +1 -0
  59. package/dist-prod/cellswipe.53b0178e4638c201dcf1.chunk.js +2 -0
  60. package/dist-prod/cellswipe.53b0178e4638c201dcf1.chunk.js.map +1 -0
  61. package/dist-prod/checkbox.87403976981ee0f64f4a.chunk.js +2 -0
  62. package/dist-prod/checkbox.87403976981ee0f64f4a.chunk.js.map +1 -0
  63. package/dist-prod/guide.5195c74796a7a0e37f7b.chunk.js +2 -0
  64. package/dist-prod/guide.5195c74796a7a0e37f7b.chunk.js.map +1 -0
  65. package/dist-prod/header.e3cecc6d60f801c1c105.chunk.js +2 -0
  66. package/dist-prod/header.e3cecc6d60f801c1c105.chunk.js.map +1 -0
  67. package/dist-prod/index.html +19 -0
  68. package/dist-prod/indicator.6b0c7a91ca254c3586e8.chunk.js +2 -0
  69. package/dist-prod/indicator.6b0c7a91ca254c3586e8.chunk.js.map +1 -0
  70. package/dist-prod/loadmore.ba86c35311fc68ee215b.chunk.js +2 -0
  71. package/dist-prod/loadmore.ba86c35311fc68ee215b.chunk.js.map +1 -0
  72. package/dist-prod/main.2e9aaa9095e329ea2d7b.js +2 -0
  73. package/dist-prod/main.2e9aaa9095e329ea2d7b.js.map +1 -0
  74. package/dist-prod/message.e57fa263a214006f7191.chunk.js +2 -0
  75. package/dist-prod/message.e57fa263a214006f7191.chunk.js.map +1 -0
  76. package/dist-prod/modal.1172c8ba7d90503fc8e8.chunk.js +2 -0
  77. package/dist-prod/modal.1172c8ba7d90503fc8e8.chunk.js.map +1 -0
  78. package/dist-prod/picker.4ff114161c5c3f8df57a.chunk.js +2 -0
  79. package/dist-prod/picker.4ff114161c5c3f8df57a.chunk.js.map +1 -0
  80. package/dist-prod/popup.8f92c027932e4d47fa59.chunk.js +2 -0
  81. package/dist-prod/popup.8f92c027932e4d47fa59.chunk.js.map +1 -0
  82. package/dist-prod/progress.1e0d785044aecadc5615.chunk.js +2 -0
  83. package/dist-prod/progress.1e0d785044aecadc5615.chunk.js.map +1 -0
  84. package/dist-prod/prompt.c2b442c3dd0e6d8319bc.chunk.js +2 -0
  85. package/dist-prod/prompt.c2b442c3dd0e6d8319bc.chunk.js.map +1 -0
  86. package/dist-prod/radiobox.479703c69b75d473e85d.chunk.js +2 -0
  87. package/dist-prod/radiobox.479703c69b75d473e85d.chunk.js.map +1 -0
  88. package/dist-prod/rater.939e0e7e770728f684c3.chunk.js +2 -0
  89. package/dist-prod/rater.939e0e7e770728f684c3.chunk.js.map +1 -0
  90. package/dist-prod/slidebar.3d3f48a631f03a2210c9.chunk.js +2 -0
  91. package/dist-prod/slidebar.3d3f48a631f03a2210c9.chunk.js.map +1 -0
  92. package/dist-prod/spinner.f20e3bd8cec27d26afe0.chunk.js +2 -0
  93. package/dist-prod/spinner.f20e3bd8cec27d26afe0.chunk.js.map +1 -0
  94. package/dist-prod/swipe.2e5b0acc3bbb2bf49dd5.chunk.js +2 -0
  95. package/dist-prod/swipe.2e5b0acc3bbb2bf49dd5.chunk.js.map +1 -0
  96. package/dist-prod/switchbar.56d03d96c275ff4c65a1.chunk.js +2 -0
  97. package/dist-prod/switchbar.56d03d96c275ff4c65a1.chunk.js.map +1 -0
  98. package/dist-prod/tab.4c391211c41b7d12b585.chunk.js +2 -0
  99. package/dist-prod/tab.4c391211c41b7d12b585.chunk.js.map +1 -0
  100. package/dist-prod/text.ee2804ba87e6a460aa7d.chunk.js +2 -0
  101. package/dist-prod/text.ee2804ba87e6a460aa7d.chunk.js.map +1 -0
  102. package/dist-prod/totop.c6f9dce152bb6abe5cb2.chunk.js +2 -0
  103. package/dist-prod/totop.c6f9dce152bb6abe5cb2.chunk.js.map +1 -0
  104. package/dist-prod/upload.ec7a954970889869d93e.chunk.js +2 -0
  105. package/dist-prod/upload.ec7a954970889869d93e.chunk.js.map +1 -0
  106. package/images/IMG_2614 2 2.JPG +0 -0
  107. package/images/IMG_2614.JPG +0 -0
  108. package/images/IMG_2615 2.JPG +0 -0
  109. package/images/IMG_2615.JPG +0 -0
  110. package/package.json +113 -0
  111. package/postcss.config.js +5 -0
  112. package/src/components/Indicator/Indicator.vue +82 -0
  113. package/src/components/Indicator/index.js +86 -0
  114. package/src/components/Text/Number.vue +167 -0
  115. package/src/components/Text/index.js +7 -0
  116. package/src/components/Text/textBar.vue +122 -0
  117. package/src/components/action-sheet/actionSheet.vue +93 -0
  118. package/src/components/action-sheet/index.js +5 -0
  119. package/src/components/app.vue +61 -0
  120. package/src/components/badge/badge.vue +80 -0
  121. package/src/components/badge/index.js +5 -0
  122. package/src/components/button/button.vue +111 -0
  123. package/src/components/button/index.js +5 -0
  124. package/src/components/card/card.vue +49 -0
  125. package/src/components/card/index.js +5 -0
  126. package/src/components/cell/cell.vue +93 -0
  127. package/src/components/cell/index.js +5 -0
  128. package/src/components/cell-swipe/cell-swipe.vue +169 -0
  129. package/src/components/cell-swipe/index.js +5 -0
  130. package/src/components/checkBox/checkbox-group.vue +74 -0
  131. package/src/components/checkBox/checkbox.vue +117 -0
  132. package/src/components/checkBox/index.js +8 -0
  133. package/src/components/header/header.vue +130 -0
  134. package/src/components/header/index.js +5 -0
  135. package/src/components/loadMore/index.js +5 -0
  136. package/src/components/loadMore/loadmore.vue +258 -0
  137. package/src/components/message/confirm.js +60 -0
  138. package/src/components/message/index.js +111 -0
  139. package/src/components/message/message.vue +137 -0
  140. package/src/components/message/messageGroup.vue +82 -0
  141. package/src/components/modal/confirm.js +122 -0
  142. package/src/components/modal/index.js +52 -0
  143. package/src/components/modal/modal.vue +138 -0
  144. package/src/components/picker/area-picker/area-picker.vue +230 -0
  145. package/src/components/picker/area-picker/props.js +17 -0
  146. package/src/components/picker/date-picker/date-picker.vue +191 -0
  147. package/src/components/picker/date-picker/props.js +24 -0
  148. package/src/components/picker/index.js +5 -0
  149. package/src/components/picker/normal-picker/normal-picker.vue +120 -0
  150. package/src/components/picker/normal-picker/props.js +20 -0
  151. package/src/components/picker/picker-slot.vue +217 -0
  152. package/src/components/picker/picker.vue +111 -0
  153. package/src/components/popup/index.js +5 -0
  154. package/src/components/popup/popup.vue +91 -0
  155. package/src/components/progress/index.js +5 -0
  156. package/src/components/progress/progress.vue +86 -0
  157. package/src/components/prompt/confirm.js +91 -0
  158. package/src/components/prompt/index.js +53 -0
  159. package/src/components/prompt/prompt.vue +125 -0
  160. package/src/components/radioBox/index.js +8 -0
  161. package/src/components/radioBox/radiobox-group.vue +66 -0
  162. package/src/components/radioBox/radiobox.vue +88 -0
  163. package/src/components/rater/index.js +5 -0
  164. package/src/components/rater/rater.vue +118 -0
  165. package/src/components/slideBar/index.js +6 -0
  166. package/src/components/slideBar/slideBar.vue +207 -0
  167. package/src/components/spinner/behavior/blade.vue +42 -0
  168. package/src/components/spinner/behavior/double-bounce.vue +38 -0
  169. package/src/components/spinner/behavior/fading-circle.vue +55 -0
  170. package/src/components/spinner/behavior/snake.vue +41 -0
  171. package/src/components/spinner/behavior/triple-bounce.vue +52 -0
  172. package/src/components/spinner/index.js +5 -0
  173. package/src/components/spinner/props.js +28 -0
  174. package/src/components/spinner/spinner.vue +78 -0
  175. package/src/components/swipe/index.js +5 -0
  176. package/src/components/swipe/swipe.vue +281 -0
  177. package/src/components/switchbar/index.js +5 -0
  178. package/src/components/switchbar/switchbar.vue +79 -0
  179. package/src/components/tab/index.js +6 -0
  180. package/src/components/tab/tab.vue +89 -0
  181. package/src/components/toTop/index.js +5 -0
  182. package/src/components/toTop/topTop.vue +78 -0
  183. package/src/components/upload/index.js +5 -0
  184. package/src/components/upload/upload.vue +166 -0
  185. package/src/config/config.js +16 -0
  186. package/src/directives/clickoutside.js +42 -0
  187. package/src/directives/tranferDom.js +66 -0
  188. package/src/index.js +149 -0
  189. package/src/lib/MegaPixImage.js +163 -0
  190. package/src/lib/MegaPixImageOld.js +153 -0
  191. package/src/lib/exif-js.js +235 -0
  192. package/src/lib/exif.js +789 -0
  193. package/src/main.js +31 -0
  194. package/src/mixin/emitter.js +72 -0
  195. package/src/mixin/input.js +41 -0
  196. package/src/router.js +36 -0
  197. package/src/styles/base/font.less +99 -0
  198. package/src/styles/base/reset.less +135 -0
  199. package/src/styles/base/variable.less +108 -0
  200. package/src/styles/components/actionSheet.less +43 -0
  201. package/src/styles/components/badge.less +81 -0
  202. package/src/styles/components/button.less +124 -0
  203. package/src/styles/components/card.less +31 -0
  204. package/src/styles/components/cell-swipe.less +20 -0
  205. package/src/styles/components/cell.less +75 -0
  206. package/src/styles/components/checkBox.less +113 -0
  207. package/src/styles/components/editor.less +3 -0
  208. package/src/styles/components/header.less +72 -0
  209. package/src/styles/components/indicator.less +39 -0
  210. package/src/styles/components/loadmore.less +48 -0
  211. package/src/styles/components/message.less +57 -0
  212. package/src/styles/components/modal.less +84 -0
  213. package/src/styles/components/number.less +60 -0
  214. package/src/styles/components/picker.less +152 -0
  215. package/src/styles/components/popup.less +46 -0
  216. package/src/styles/components/progress.less +52 -0
  217. package/src/styles/components/prompt.less +37 -0
  218. package/src/styles/components/radioBox.less +138 -0
  219. package/src/styles/components/slide-Bar.less +149 -0
  220. package/src/styles/components/spinner.less +329 -0
  221. package/src/styles/components/swipe.less +125 -0
  222. package/src/styles/components/switchBar.less +88 -0
  223. package/src/styles/components/tab.less +71 -0
  224. package/src/styles/components/text.less +82 -0
  225. package/src/styles/components/toTop.less +28 -0
  226. package/src/styles/components/upload.less +23 -0
  227. package/src/styles/index.less +38 -0
  228. package/src/styles/utils/1px.less +206 -0
  229. package/src/styles/utils/animation.less +165 -0
  230. package/src/styles/utils/nowrap.less +19 -0
  231. package/src/template/index.ejs +40 -0
  232. package/src/utils/util.js +202 -0
  233. package/src/vconsole-resources.min.js +6 -0
  234. package/src/vconsole-sources.min.js +6 -0
  235. package/src/vconsole.min.js +7 -0
  236. package/src/views/ActionSheet.vue +46 -0
  237. package/src/views/Badge.vue +51 -0
  238. package/src/views/Button.vue +69 -0
  239. package/src/views/Card.vue +88 -0
  240. package/src/views/Cell.vue +30 -0
  241. package/src/views/CellSwipe.vue +68 -0
  242. package/src/views/CheckBox.vue +77 -0
  243. package/src/views/Header.vue +70 -0
  244. package/src/views/Indicator.vue +82 -0
  245. package/src/views/LoadMore.vue +73 -0
  246. package/src/views/Message.vue +61 -0
  247. package/src/views/Modal.vue +69 -0
  248. package/src/views/Picker.vue +140 -0
  249. package/src/views/Popup.vue +97 -0
  250. package/src/views/Progress.vue +47 -0
  251. package/src/views/Prompt.vue +43 -0
  252. package/src/views/RadioBox.vue +68 -0
  253. package/src/views/Rater.vue +49 -0
  254. package/src/views/SlideBar.vue +55 -0
  255. package/src/views/Spinner.vue +15 -0
  256. package/src/views/Swipe.vue +59 -0
  257. package/src/views/SwitchBar.vue +47 -0
  258. package/src/views/Tab.vue +53 -0
  259. package/src/views/Text.vue +93 -0
  260. package/src/views/ToTop.vue +17 -0
  261. package/src/views/Upload.vue +61 -0
  262. package/src/views/guide.vue +164 -0
  263. package/src/views/index.vue +554 -0
  264. package/webpack.base.config.js +65 -0
  265. package/webpack.dev.config.js +42 -0
  266. package/webpack.dist.dev.config.js +75 -0
  267. package/webpack.dist.prod.config.js +89 -0
  268. package/webpack.prod.config.js +51 -0
@@ -0,0 +1,217 @@
1
+ <template>
2
+ <div
3
+ :class="classes"
4
+ :style="getStyles"
5
+ >
6
+ <ul
7
+ :class="draggingClass"
8
+ :style="{ transform: `translate3d(0,${translateY}px,0)` }"
9
+ @touchstart="_onTouchStart"
10
+ @touchmove="_onTouchMove"
11
+ @touchend="_onTouchEnd"
12
+ >
13
+ <!-- 上方占位 -->
14
+ <li :style="{ height: height + 'px' }" />
15
+ <li :style="{ height: height + 'px' }" />
16
+
17
+ <!-- 数据列表 -->
18
+ <li
19
+ v-for="(item, index) in list"
20
+ :key="index"
21
+ :class="{
22
+ current: index === current.index,
23
+ level_1_1: index - current.index === 1,
24
+ level_2_1: index - current.index === 2,
25
+ level_3_1: index - current.index >= 3,
26
+ level_1: index - current.index === -1,
27
+ level_2: index - current.index === -2,
28
+ level_3: index - current.index <= -3
29
+ }"
30
+ :style="{ textAlign: align, height: height + 'px' }"
31
+ >
32
+ {{ item.value }}
33
+ </li>
34
+
35
+ <!-- 下方占位 -->
36
+ <li :style="{ height: height + 'px' }" />
37
+ <li :style="{ height: height + 'px' }" />
38
+ </ul>
39
+ </div>
40
+ </template>
41
+
42
+ <script>
43
+ import { defineComponent, ref, computed, watch, onMounted } from 'vue'
44
+
45
+ export default defineComponent({
46
+ name: 'PickerSlot',
47
+ props: {
48
+ styles: Object,
49
+ list: {
50
+ type: Array,
51
+ default: () => []
52
+ },
53
+ align: {
54
+ type: String,
55
+ default: 'center'
56
+ },
57
+ target: {
58
+ type: String,
59
+ required: true
60
+ },
61
+ initItem: {
62
+ type: [String, Number],
63
+ default: ''
64
+ }
65
+ },
66
+ setup (props, { emit }) {
67
+ const count = 7
68
+ const height = ref(35)
69
+ const current = ref({})
70
+ const translateY = ref(0)
71
+ const currentTranslateY = ref(0)
72
+ const dragging = ref(false)
73
+ const startX = ref(0)
74
+ const startY = ref(0)
75
+ const delta = ref({ x: 0, y: 0 })
76
+
77
+ const classes = computed(() => ['dpzvc3-picker-slot'])
78
+ const draggingClass = computed(() => ({
79
+ 'dpzvc3-picker-slot-dragging': dragging.value
80
+ }))
81
+
82
+ const wrapperHeight = computed(() => count * height.value)
83
+
84
+ const getStyles = ref({})
85
+ const updateStyles = () => {
86
+ const styles = { ...props.styles }
87
+ if (styles.height) {
88
+ height.value = styles.height / count
89
+ }
90
+ getStyles.value = { ...styles, height: wrapperHeight.value + 'px' }
91
+ }
92
+ const getSelectedIndex = () => {
93
+ const maxIndex = props.list.length - 1
94
+ let index = -Math.round(currentTranslateY.value / height.value)
95
+ index = Math.max(index, 0)
96
+ index = Math.min(index, maxIndex)
97
+ return index
98
+ }
99
+ // 初始化样式
100
+ updateStyles()
101
+
102
+ watch(
103
+ () => props.styles,
104
+ () => {
105
+ updateStyles()
106
+ },
107
+ { deep: true }
108
+ )
109
+
110
+ // list 数据变化
111
+ watch(
112
+ () => props.list,
113
+ (list) => {
114
+ if (list.length) {
115
+ let index = getSelectedIndex()
116
+ if (index > list.length - 1) index = 0
117
+ current.value = { ...current.value, ...list[index] }
118
+ emit('change', props.target, current.value)
119
+ } else {
120
+ translateY.value = 0
121
+ }
122
+ },
123
+ { immediate: true }
124
+ )
125
+
126
+ const setSelectedItem = (index) => {
127
+ translateY.value = currentTranslateY.value = -index * height.value
128
+ try {
129
+ if (
130
+ current.value.code === props.list[index].code &&
131
+ current.value.value === props.list[index].value
132
+ ) {
133
+ return
134
+ }
135
+ current.value = {
136
+ code: props.list[index].code,
137
+ value: props.list[index].value,
138
+ target: props.target,
139
+ index
140
+ }
141
+ } catch (e) {
142
+ current.value = { code: '', value: '', target: props.target, index: '' }
143
+ }
144
+ emit('change', props.target, current.value)
145
+ }
146
+
147
+ const scrollToItem = (code) => {
148
+ props.list.forEach((item, i) => {
149
+ if (item.code === code) {
150
+ currentTranslateY.value = translateY.value
151
+ setSelectedItem(i)
152
+ }
153
+ })
154
+ }
155
+
156
+ const _onTouchStart = (e) => {
157
+ e.preventDefault()
158
+ e.stopPropagation()
159
+ currentTranslateY.value = translateY.value
160
+ startX.value = e.touches[0].pageX
161
+ startY.value = e.touches[0].pageY
162
+ dragging.value = true
163
+ }
164
+
165
+ const _onTouchMove = (e) => {
166
+ e.preventDefault()
167
+ e.stopPropagation()
168
+ delta.value.x = e.touches[0].pageX - startX.value
169
+ delta.value.y = e.touches[0].pageY - startY.value
170
+ translateY.value = delta.value.y + currentTranslateY.value
171
+ }
172
+
173
+ const _onTouchEnd = (e) => {
174
+ e.preventDefault()
175
+ e.stopPropagation()
176
+ dragging.value = false
177
+ currentTranslateY.value = translateY.value
178
+ const index = getSelectedIndex()
179
+ setSelectedItem(index)
180
+ }
181
+ // initItem 变化
182
+ watch(
183
+ () => props.initItem,
184
+ (value) => {
185
+ if (value === '' || value === null) {
186
+ current.value = { code: '', target: props.target, index: '', value: '' }
187
+ emit('change', props.target, current.value)
188
+ } else {
189
+ scrollToItem(value)
190
+ }
191
+ },
192
+ { immediate: true }
193
+ )
194
+
195
+ onMounted(() => {
196
+ if (!props.initItem && props.initItem !== 0) {
197
+ current.value = { code: '', target: props.target, index: '', value: '' }
198
+ emit('change', props.target, current.value)
199
+ } else {
200
+ scrollToItem(props.initItem)
201
+ }
202
+ })
203
+ return {
204
+ classes,
205
+ draggingClass,
206
+ translateY,
207
+ height,
208
+ current,
209
+ _onTouchStart,
210
+ _onTouchMove,
211
+ _onTouchEnd,
212
+ getStyles,
213
+ getSelectedIndex
214
+ }
215
+ }
216
+ })
217
+ </script>
@@ -0,0 +1,111 @@
1
+ <template>
2
+ <Popup
3
+ v-model="visible"
4
+ height="284px"
5
+ position="bottom"
6
+ >
7
+ <div :class="wrapperClass">
8
+ <div :class="contentClass">
9
+ <AreaPicker
10
+ v-if="type === 'AreaPicker'"
11
+ :styles="styles"
12
+ :value-separator="valueSeparator"
13
+ :address-value="addressValue"
14
+ @ok="onOk"
15
+ @fail="onFail"
16
+ />
17
+
18
+ <DatePicker
19
+ v-if="type === 'DatePicker'"
20
+ :year="year"
21
+ :month="month"
22
+ :day="day"
23
+ :value-separator="valueSeparator"
24
+ :date-value="dateValue"
25
+ @ok="onOk"
26
+ @fail="onFail"
27
+ />
28
+
29
+ <NormalPicker
30
+ v-if="type === 'NormalPicker'"
31
+ :list="list"
32
+ :init-arr="initArr"
33
+ @ok="onOk"
34
+ @fail="onFail"
35
+ @scroll="onNormalChange"
36
+ />
37
+ </div>
38
+ </div>
39
+ </Popup>
40
+ </template>
41
+
42
+ <script>
43
+ import { defineComponent, ref, watch, computed, provide } from 'vue'
44
+ import Popup from '../popup'
45
+ import AreaPicker from './area-picker/area-picker.vue'
46
+ import DatePicker from './date-picker/date-picker.vue'
47
+ import NormalPicker from './normal-picker/normal-picker.vue'
48
+ import areaProps from './area-picker/props'
49
+ import dateProps from './date-picker/props'
50
+ import normalProps from './normal-picker/props'
51
+
52
+ const LIST = ['DatePicker', 'AreaPicker', 'NormalPicker']
53
+ const prefixCls = 'dpzvc3-picker'
54
+
55
+ export default defineComponent({
56
+ name: 'Dpzvc3Picker',
57
+ components: { Popup, AreaPicker, DatePicker, NormalPicker },
58
+ mixins: [areaProps, dateProps, normalProps],
59
+ props: {
60
+ type: {
61
+ type: String,
62
+ default: 'DatePicker',
63
+ validator: (val) => LIST.includes(val)
64
+ },
65
+ modelValue: {
66
+ type: Boolean,
67
+ default: false
68
+ }
69
+ },
70
+ emits: ['update:modelValue', 'sure', 'cancle', 'normal-change'],
71
+ setup (props, { emit }) {
72
+ const visible = ref(props.value)
73
+ watch(() => props.modelValue, (val) => {
74
+ visible.value = val
75
+ })
76
+
77
+ watch(visible, (val) => {
78
+ emit('update:value', val)
79
+ })
80
+ const wrapperClass = computed(() => [`${prefixCls}-wrapper`])
81
+ const contentClass = computed(() => [`${prefixCls}-content`])
82
+
83
+ const onOk = (val) => {
84
+ emit('update:modelValue', false)
85
+ emit('sure', val)
86
+ }
87
+
88
+ const onFail = () => {
89
+ emit('update:modelValue', false)
90
+ emit('cancle')
91
+ }
92
+
93
+ const onNormalChange = (val) => {
94
+ emit('normal-change', val)
95
+ }
96
+ provide('DpzVc3Picker', {
97
+ pickerOnOk: onOk,
98
+ pickeronFail: onFail,
99
+ pickerOnNormalChange: onNormalChange
100
+ })
101
+ return {
102
+ visible,
103
+ wrapperClass,
104
+ contentClass,
105
+ onOk,
106
+ onFail,
107
+ onNormalChange
108
+ }
109
+ }
110
+ })
111
+ </script>
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Created by admin on 2025/11/19.
3
+ */
4
+ import Popup from './popup'
5
+ export default Popup
@@ -0,0 +1,91 @@
1
+ <template>
2
+ <div :class="classes">
3
+ <transition name="dpzvc3-ani-fade">
4
+ <div
5
+ v-if="mask && visible"
6
+ class="dpzvc3-popup-mask"
7
+ @click="close"
8
+ @touchmove.prevent
9
+ />
10
+ </transition>
11
+ <transition :name="'dpzvc3-ani-' + position">
12
+ <div
13
+ v-if="visible"
14
+ :class="popupClasses"
15
+ :style="contentStyle"
16
+ >
17
+ <slot />
18
+ </div>
19
+ </transition>
20
+ </div>
21
+ </template>
22
+
23
+ <script>
24
+ import { ref, computed, watch } from 'vue'
25
+
26
+ const prefixCls = 'dpzvc3-popup'
27
+
28
+ export default {
29
+ name: 'Dpzvc3Popup',
30
+ props: {
31
+ modelValue: { // Vue 3 v-model 默认绑定
32
+ type: Boolean,
33
+ default: false
34
+ },
35
+ position: {
36
+ type: String,
37
+ default: 'bottom',
38
+ validator: (val) => ['top', 'bottom', 'center'].includes(val)
39
+ },
40
+ showMask: {
41
+ type: Boolean,
42
+ default: true
43
+ },
44
+ maskClosable: {
45
+ type: Boolean,
46
+ default: true
47
+ },
48
+ width: {
49
+ type: [Number, String],
50
+ default: '100%'
51
+ },
52
+ height: {
53
+ type: [Number, String]
54
+ },
55
+ styles: {
56
+ type: Object,
57
+ default: () => ({})
58
+ }
59
+ },
60
+ setup (props, { emit }) {
61
+ const visible = ref(props.modelValue)
62
+ const mask = ref(props.showMask)
63
+
64
+ // 同步 props -> 状态
65
+ watch(() => props.modelValue, (val) => { visible.value = val })
66
+ watch(visible, (val) => { emit('update:modelValue', val) })
67
+
68
+ watch(() => props.showMask, (val) => { mask.value = val })
69
+
70
+ const classes = computed(() => [prefixCls])
71
+ const popupClasses = computed(() => [`${prefixCls}-${props.position}`, `${prefixCls}-content`])
72
+ const contentStyle = computed(() => {
73
+ const heightValue = props.height != null ? props.height : (props.position === 'top' ? 'auto' : '100%')
74
+ return { ...props.styles, width: props.width, height: heightValue }
75
+ })
76
+
77
+ const close = () => {
78
+ if (props.maskClosable && mask.value) visible.value = false
79
+ }
80
+
81
+ return {
82
+ visible,
83
+ mask,
84
+ classes,
85
+ popupClasses,
86
+ contentStyle,
87
+ close
88
+ }
89
+ }
90
+ }
91
+ </script>
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Created by yishide on 2025/09/26.
3
+ */
4
+ import Progress from './progress'
5
+ export default Progress
@@ -0,0 +1,86 @@
1
+ <template>
2
+ <div
3
+ :class="classes"
4
+ :style="styles"
5
+ >
6
+ <slot name="left" />
7
+
8
+ <div :class="outerClass">
9
+ <div
10
+ :class="runawayClass"
11
+ :style="runawayStyle"
12
+ />
13
+ <div
14
+ :class="progressClass"
15
+ :style="progressStyle"
16
+ />
17
+ </div>
18
+
19
+ <slot name="right" />
20
+ </div>
21
+ </template>
22
+
23
+ <script>
24
+ import { defineComponent, ref, computed, watch } from 'vue'
25
+
26
+ const prefixCls = 'dpzvc3-progress'
27
+
28
+ export default defineComponent({
29
+ name: 'DpzVcProgress',
30
+
31
+ props: {
32
+ styles: {
33
+ type: Object,
34
+ default: () => ({})
35
+ },
36
+ modelValue: {
37
+ type: [Number, String],
38
+ default: 0
39
+ },
40
+ barHeight: {
41
+ type: [String, Number],
42
+ default: 3
43
+ }
44
+ },
45
+
46
+ setup (props) {
47
+ /** 当前进度宽度 */
48
+ const width = ref(Number(props.modelValue) || 0)
49
+
50
+ /** 同步外部 value */
51
+ watch(
52
+ () => props.modelValue,
53
+ val => {
54
+ const num = Number(val) || 0
55
+ width.value = num >= 100 ? 100 : num
56
+ },
57
+ { immediate: true }
58
+ )
59
+
60
+ /** classes */
61
+ const classes = computed(() => [prefixCls])
62
+ const outerClass = computed(() => [`${prefixCls}-outer`])
63
+ const runawayClass = computed(() => [`${prefixCls}-runaway`])
64
+ const progressClass = computed(() => [`${prefixCls}-progress`])
65
+
66
+ /** styles */
67
+ const runawayStyle = computed(() => ({
68
+ height: `${props.barHeight}px`
69
+ }))
70
+
71
+ const progressStyle = computed(() => ({
72
+ height: `${props.barHeight}px`,
73
+ width: `${width.value}%`
74
+ }))
75
+
76
+ return {
77
+ classes,
78
+ outerClass,
79
+ runawayClass,
80
+ progressClass,
81
+ runawayStyle,
82
+ progressStyle
83
+ }
84
+ }
85
+ })
86
+ </script>
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Vue 3 prompt confirm
3
+ * 使用 createVNode + render
4
+ */
5
+
6
+ import { createVNode, render } from 'vue'
7
+ import Prompt from './prompt.vue'
8
+
9
+ // let seed = 0
10
+
11
+ Prompt.newInstance = (properties = {}) => {
12
+ // const id = `dpzvc3-prompt-${seed++}`
13
+ const instance = null
14
+ // 容器
15
+ const container = document.createElement('div')
16
+ // container.id = id
17
+ document.body.appendChild(container)
18
+ // 组件 props(默认值)
19
+ const props = {
20
+ value: false,
21
+ text: '',
22
+ placeholderText: '请输入',
23
+ width: '70%',
24
+ title: '',
25
+ okText: '确定',
26
+ cancleText: '取消',
27
+ loading: false,
28
+ showCancle: true,
29
+ spec: '',
30
+ message: '',
31
+ validator: null,
32
+ onOk: () => {},
33
+ onCancle: () => {},
34
+ ...properties
35
+ }
36
+
37
+ const updateVNode = () => {
38
+ // vnode
39
+ // console.log(props, 'props')
40
+ const vnode = createVNode(Prompt, {
41
+ ...props,
42
+ // 给动态挂载组件绑定 update:value 事件
43
+ 'onUpdate:value': (val) => {
44
+ // 当子组件 emit('update:value', false) 时执行
45
+ if (val === false) {
46
+ vnode.component.props.value = false // 关闭内部显示
47
+ destroy() // 销毁 DOM
48
+ }
49
+ },
50
+ onRemove: destroy
51
+ })
52
+ // 挂载
53
+ render(vnode, container)
54
+ // instance = vnode.component
55
+ }
56
+ // 销毁
57
+ const destroy = () => {
58
+ props.value = false
59
+ setTimeout(() => {
60
+ render(null, container)
61
+ }, 300)
62
+ }
63
+
64
+ return {
65
+ /**
66
+ * 显示
67
+ */
68
+ show (options = {}) {
69
+ // alert(1)
70
+ Object.keys(options).forEach(key => {
71
+ props[key] = options[key]
72
+ })
73
+ // console.log(instance.props, 'props')
74
+ props.value = true
75
+ updateVNode()
76
+ },
77
+
78
+ /**
79
+ * 关闭
80
+ */
81
+ remove () {
82
+ props.value = false
83
+
84
+ destroy()
85
+ },
86
+
87
+ component: instance
88
+ }
89
+ }
90
+
91
+ export default Prompt
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Created by admin on 2025/12/10.
3
+ * Rewritten for Vue 3 (no createApp)
4
+ */
5
+
6
+ import Prompt from './confirm'
7
+
8
+ let promptInstance = null
9
+
10
+ function getPromptInstance () {
11
+ if (!promptInstance) {
12
+ promptInstance = Prompt.newInstance({
13
+ closable: true,
14
+ maskClosable: false,
15
+ footerHide: false
16
+ })
17
+ }
18
+ return promptInstance
19
+ }
20
+
21
+ /**
22
+ * confirm 核心方法
23
+ */
24
+ function confirm (options = {}) {
25
+ const instance = getPromptInstance()
26
+
27
+ // 组件销毁回调
28
+ options.onRemove = () => {
29
+ promptInstance = null
30
+ }
31
+
32
+ instance.show(options)
33
+ }
34
+
35
+ /**
36
+ * info 弹窗
37
+ */
38
+ Prompt.info = function (props = {}) {
39
+ props.showCancle = true
40
+ return confirm(props)
41
+ }
42
+
43
+ /**
44
+ * 手动关闭
45
+ */
46
+ Prompt.remove = function () {
47
+ if (!promptInstance) return
48
+
49
+ const instance = getPromptInstance()
50
+ instance.remove()
51
+ }
52
+
53
+ export default Prompt