@kyfe/hroa-ui 0.0.2 → 1.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 (309) hide show
  1. package/README.md +77 -77
  2. package/dist/demo.html +10 -0
  3. package/dist/hroa-ui.common.js +31775 -0
  4. package/dist/hroa-ui.css +6 -0
  5. package/dist/hroa-ui.umd.js +31775 -0
  6. package/dist/hroa-ui.umd.min.js +9 -0
  7. package/lib/getJsModule/index.css +6 -0
  8. package/lib/getJsModule/index.js +9 -0
  9. package/lib/hr-at-input/index.css +6 -0
  10. package/lib/hr-at-input/index.js +1 -0
  11. package/lib/hr-bottom-button/index.css +1 -0
  12. package/lib/hr-bottom-button/index.js +1 -0
  13. package/lib/hr-button/index.css +1 -0
  14. package/lib/hr-button/index.js +1 -0
  15. package/lib/hr-clipboard/index.css +1 -0
  16. package/lib/hr-clipboard/index.js +1 -0
  17. package/lib/hr-condition-filtrate/index.css +1 -0
  18. package/lib/hr-condition-filtrate/index.js +1 -0
  19. package/lib/hr-condition-filtrate-popup/index.css +1 -0
  20. package/lib/hr-condition-filtrate-popup/index.js +1 -0
  21. package/lib/hr-elasticity-box/index.css +1 -0
  22. package/lib/hr-elasticity-box/index.js +1 -0
  23. package/lib/hr-elasticity-box-item/index.css +1 -0
  24. package/lib/hr-elasticity-box-item/index.js +1 -0
  25. package/lib/hr-emotional-picture/index.css +1 -0
  26. package/lib/hr-emotional-picture/index.js +1 -0
  27. package/lib/hr-employee-choose/index.css +1 -0
  28. package/lib/hr-employee-choose/index.js +1 -0
  29. package/lib/hr-img-list/index.css +1 -0
  30. package/lib/hr-img-list/index.js +1 -0
  31. package/lib/hr-info-card/index.css +1 -0
  32. package/lib/hr-info-card/index.js +1 -0
  33. package/lib/hr-license-plate-number/index.css +1 -0
  34. package/lib/hr-license-plate-number/index.js +1 -0
  35. package/lib/hr-module-card/index.css +1 -0
  36. package/lib/hr-module-card/index.js +1 -0
  37. package/lib/hr-multiterm-choose/index.css +1 -0
  38. package/lib/hr-multiterm-choose/index.js +1 -0
  39. package/lib/hr-no-data/index.css +1 -0
  40. package/lib/hr-no-data/index.js +1 -0
  41. package/lib/hr-notice-bar/index.js +1 -0
  42. package/lib/hr-open-ks/index.css +1 -0
  43. package/lib/hr-open-ks/index.js +1 -0
  44. package/lib/hr-pager/index.css +1 -0
  45. package/lib/hr-pager/index.js +1 -0
  46. package/lib/hr-popup/index.css +1 -0
  47. package/lib/hr-popup/index.js +1 -0
  48. package/lib/hr-preview-file/index.css +1 -0
  49. package/lib/hr-preview-file/index.js +1 -0
  50. package/lib/hr-rate/index.css +1 -0
  51. package/lib/hr-rate/index.js +1 -0
  52. package/lib/hr-reason-textarea/index.css +1 -0
  53. package/lib/hr-reason-textarea/index.js +1 -0
  54. package/lib/hr-search-input/index.css +1 -0
  55. package/lib/hr-search-input/index.js +1 -0
  56. package/lib/hr-select/index.js +1 -0
  57. package/lib/hr-select-list/index.css +1 -0
  58. package/lib/hr-select-list/index.js +9 -0
  59. package/lib/hr-single-choose/index.css +1 -0
  60. package/lib/hr-single-choose/index.js +1 -0
  61. package/lib/hr-slide-pager/index.css +1 -0
  62. package/lib/hr-slide-pager/index.js +1 -0
  63. package/lib/hr-sort/index.css +1 -0
  64. package/lib/hr-sort/index.js +1 -0
  65. package/lib/hr-stack-image/index.css +1 -0
  66. package/lib/hr-stack-image/index.js +1 -0
  67. package/lib/hr-tab-nav/index.css +1 -0
  68. package/lib/hr-tab-nav/index.js +1 -0
  69. package/lib/hr-view-item/index.css +1 -0
  70. package/lib/hr-view-item/index.js +1 -0
  71. package/lib/index/index.css +6 -0
  72. package/lib/index/index.js +9 -0
  73. package/lib/utils/index.js +1 -0
  74. package/package.json +7 -6
  75. package/packages/getJsModule.js +11 -0
  76. package/packages/hr-at-input/index.js +7 -0
  77. package/packages/hr-at-input/src/blot/atPerson.js +43 -0
  78. package/packages/hr-at-input/src/index.vue +472 -0
  79. package/packages/hr-at-input/src/quill.snow.css +945 -0
  80. package/packages/hr-at-input/src/utils/index.js +60 -0
  81. package/packages/hr-at-input//346/224/257/346/214/201@/351/200/211/344/272/272/350/276/223/345/205/245/346/241/206.md +0 -0
  82. package/packages/hr-bottom-button/index.js +6 -6
  83. package/packages/hr-bottom-button/src/index.vue +108 -84
  84. package/packages/hr-button/index.js +12 -12
  85. package/packages/hr-button/src/hr-button.vue +38 -38
  86. package/packages/hr-clipboard/index.js +8 -3
  87. package/packages/hr-clipboard/src/index.vue +46 -0
  88. package/packages/hr-clipboard/src/util.js +9 -9
  89. package/packages/hr-condition-filtrate/enum/index.js +10 -10
  90. package/packages/hr-condition-filtrate/index.js +6 -6
  91. package/packages/hr-condition-filtrate/src/employee-choose/index.vue +101 -101
  92. package/packages/hr-condition-filtrate/src/index.vue +245 -245
  93. package/packages/hr-condition-filtrate/src/multiterm-choose/index.vue +166 -166
  94. package/packages/hr-condition-filtrate/src/org-tree-choose/index.vue +101 -101
  95. package/packages/hr-condition-filtrate/src/single-choose/index.vue +143 -143
  96. package/packages/hr-condition-filtrate/src/text-input/index.vue +60 -60
  97. package/packages/hr-condition-filtrate/src/time-selector/date-range-select.vue +154 -154
  98. package/packages/hr-condition-filtrate/src/time-selector/index.vue +380 -380
  99. package/packages/hr-condition-filtrate/src/time-selector/utils/constant.js +30 -30
  100. package/packages/hr-condition-filtrate/src/time-selector/utils/tools.js +212 -212
  101. package/packages/hr-condition-filtrate-popup/index.js +7 -0
  102. package/packages/hr-condition-filtrate-popup/src/index.vue +236 -0
  103. package/packages/hr-elasticity-box/index.js +7 -0
  104. package/packages/hr-elasticity-box/src/elasticity-box-item.vue +61 -0
  105. package/packages/hr-elasticity-box/src/index.vue +52 -0
  106. package/packages/hr-elasticity-box-item/index.js +7 -0
  107. package/packages/hr-emotional-picture/index.js +6 -6
  108. package/packages/hr-emotional-picture/src/index.vue +66 -66
  109. package/packages/hr-employee-choose/index.js +7 -0
  110. package/packages/hr-employee-choose/src/image/arrow-right.png +0 -0
  111. package/packages/hr-employee-choose/src/index.vue +119 -0
  112. package/packages/hr-img-list/index.js +3 -3
  113. package/packages/hr-img-list/src/index.vue +143 -123
  114. package/packages/hr-info-card/index.js +7 -0
  115. package/packages/hr-info-card/src/index.vue +67 -0
  116. package/packages/hr-license-plate-number/index.js +8 -0
  117. package/packages/hr-license-plate-number/src/enum.js +44 -0
  118. package/packages/hr-license-plate-number/src/index.vue +164 -0
  119. package/packages/hr-license-plate-number/src/vnp-keyboard.vue +182 -0
  120. package/packages/hr-license-plate-number//350/275/246/347/211/214/345/217/267/345/274/271/347/252/227.md +0 -0
  121. package/packages/hr-module-card/index.js +12 -12
  122. package/packages/hr-module-card/src/index.vue +132 -132
  123. package/packages/hr-module-card//346/250/241/345/235/227/345/215/241/347/211/207/347/273/204/344/273/266.md +29 -29
  124. package/packages/hr-multiterm-choose/index.js +8 -0
  125. package/packages/hr-multiterm-choose/src/active-icon.png +0 -0
  126. package/packages/hr-multiterm-choose/src/index.vue +212 -0
  127. package/packages/hr-multiterm-choose//345/244/232/351/200/211/346/241/206.md +0 -0
  128. package/packages/hr-no-data/index.js +7 -0
  129. package/packages/hr-no-data/src/index.vue +48 -0
  130. package/packages/hr-notice-bar/index.js +6 -6
  131. package/packages/hr-notice-bar/src/bem.js +37 -37
  132. package/packages/hr-notice-bar/src/index.js +51 -51
  133. package/packages/hr-notice-bar//351/200/232/347/237/245/346/240/217/347/273/204/344/273/266.md +2 -2
  134. package/packages/hr-open-ks/index.js +7 -3
  135. package/packages/hr-open-ks/src/{main.vue → index.vue} +97 -85
  136. package/packages/hr-open-ks/src/util.js +31 -31
  137. package/packages/hr-pager/index.js +6 -6
  138. package/packages/hr-pager/src/index.vue +95 -95
  139. package/packages/hr-popup/index.js +3 -3
  140. package/packages/hr-popup/src/index.vue +59 -47
  141. package/packages/hr-preview-file/index.js +7 -0
  142. package/packages/hr-preview-file/src/index.vue +58 -0
  143. package/packages/hr-preview-file/src/util.js +50 -0
  144. package/packages/hr-rate/index.js +7 -0
  145. package/packages/hr-rate/src/index.vue +42 -0
  146. package/packages/hr-rate//350/257/204/345/210/206/347/273/204/344/273/266/357/274/210/345/270/246/346/226/207/346/241/210/357/274/211.md +0 -0
  147. package/packages/hr-reason-textarea/index.js +7 -0
  148. package/packages/hr-reason-textarea/src/index.vue +128 -0
  149. package/packages/hr-search-input/index.js +7 -7
  150. package/packages/hr-search-input/src/index.vue +144 -144
  151. package/packages/hr-select/index.js +7 -3
  152. package/packages/hr-select/src/index.vue +41 -0
  153. package/packages/hr-select-list/index.js +3 -3
  154. package/packages/hr-select-list/src/index.vue +167 -161
  155. package/packages/hr-single-choose/index.js +8 -0
  156. package/packages/hr-single-choose/src/index.vue +178 -0
  157. package/packages/hr-single-choose//345/215/225/351/200/211/346/241/206.md +0 -0
  158. package/packages/hr-slide-pager/guide/image/turn-left.png +0 -0
  159. package/packages/hr-slide-pager/guide/image/turn-right.png +0 -0
  160. package/packages/hr-slide-pager/guide/index.vue +58 -58
  161. package/packages/hr-slide-pager/index.js +6 -6
  162. package/packages/hr-slide-pager/src/index.vue +375 -370
  163. package/packages/hr-sort/index.js +3 -0
  164. package/packages/hr-sort/src/main.vue +133 -0
  165. package/packages/hr-sort//346/216/222/345/272/217.md +0 -0
  166. package/packages/hr-stack-image/index.js +3 -3
  167. package/packages/hr-stack-image/src/main.vue +76 -76
  168. package/packages/hr-tab-nav/index.js +7 -7
  169. package/packages/hr-tab-nav/src/index.vue +114 -96
  170. package/packages/hr-view-item/index.js +12 -12
  171. package/packages/hr-view-item/src/index.vue +89 -89
  172. package/packages/index.js +23 -53
  173. package/packages/utils/directive/common.js +0 -0
  174. package/packages/utils/directive/index.js +2 -0
  175. package/packages/utils/{directive.js → directive/specific.js} +54 -58
  176. package/packages/utils/index.js +7 -73
  177. package/packages/utils/tool/common.js +65 -0
  178. package/packages/utils/tool/index.js +2 -0
  179. package/packages/utils/tool/specific.js +0 -0
  180. package/dist/404.html +0 -20
  181. package/dist/ERP-components/index.html +0 -34
  182. package/dist/H5-components/custom//346/211/223/345/274/200/350/267/250/345/243/260/350/201/212/345/244/251.html +0 -34
  183. package/dist/H5-components/index.html +0 -34
  184. package/dist/H5-components/initial-stage/introduce.html +0 -71
  185. package/dist/H5-components/initial-stage/updateLog.html +0 -42
  186. package/dist/H5-components/views/hr-emotional-picture.html +0 -51
  187. package/dist/H5-components/views/hr-info-card.html +0 -53
  188. package/dist/H5-components/views/hr-no-data.html +0 -47
  189. package/dist/H5-components/views/hr-preview-file.html +0 -76
  190. package/dist/H5-components/views/hr-search-input.html +0 -50
  191. package/dist/H5-components/views/tic-rich-input.html +0 -95
  192. package/dist/H5-components/views//345/211/252/345/210/207/346/235/277/345/244/215/345/210/266.html +0 -59
  193. package/dist/H5-components/views//345/261/202/345/217/240/345/233/276/347/211/207.html +0 -62
  194. package/dist/H5-components/views//346/211/223/345/274/200/350/267/250/345/243/260/347/224/250/346/210/267.html +0 -66
  195. package/dist/H5-components/views//346/213/226/346/213/275dom/345/205/203/347/264/240.html +0 -52
  196. package/dist/H5-components/views//346/214/211/351/222/256/347/277/273/351/241/265/347/273/204/344/273/266.html +0 -48
  197. package/dist/H5-components/views//346/273/221/345/212/250/347/277/273/351/241/265/347/273/204/344/273/266.html +0 -55
  198. package/dist/H5-components/views//351/200/211/346/213/251/345/231/250/350/241/250/345/215/225.html +0 -111
  199. package/dist/assets/css/0.styles.89cafbc9.css +0 -8
  200. package/dist/assets/img/hr-emotional-picture.e7db80e6.png +0 -0
  201. package/dist/assets/img/hr-info-card.c50e7c33.png +0 -0
  202. package/dist/assets/img/hr-pager.34bafc88.png +0 -0
  203. package/dist/assets/img/hr-preview-file-1.3cb7c6ed.png +0 -0
  204. package/dist/assets/img/hr-preview-file-2.0fe45ea1.png +0 -0
  205. package/dist/assets/img/search.83621669.svg +0 -1
  206. package/dist/assets/img/select.acadd024.png +0 -0
  207. package/dist/assets/img/slide-pager.8e2433c6.png +0 -0
  208. package/dist/assets/img/tic-rich-input.8beff81a.png +0 -0
  209. package/dist/assets/img/v-dragable.b824e34a.png +0 -0
  210. package/dist/assets/js/1.1b9c091d.js +0 -1
  211. package/dist/assets/js/12.af649b9d.js +0 -1
  212. package/dist/assets/js/13.16dba19e.js +0 -1
  213. package/dist/assets/js/14.73f3c298.js +0 -1
  214. package/dist/assets/js/15.0a34e390.js +0 -1
  215. package/dist/assets/js/16.0cb2e2cf.js +0 -1
  216. package/dist/assets/js/17.ab78de8b.js +0 -1
  217. package/dist/assets/js/18.267c7007.js +0 -1
  218. package/dist/assets/js/19.879db5c0.js +0 -1
  219. package/dist/assets/js/2.c3a8a3e9.js +0 -16
  220. package/dist/assets/js/20.fe2689df.js +0 -1
  221. package/dist/assets/js/21.15a9e12c.js +0 -1
  222. package/dist/assets/js/22.8d5eaba3.js +0 -1
  223. package/dist/assets/js/23.333c4992.js +0 -1
  224. package/dist/assets/js/24.543262a0.js +0 -1
  225. package/dist/assets/js/25.657016f9.js +0 -1
  226. package/dist/assets/js/26.03bfb23b.js +0 -1
  227. package/dist/assets/js/27.3faf82a6.js +0 -1
  228. package/dist/assets/js/28.2bc37274.js +0 -1
  229. package/dist/assets/js/29.27882fc9.js +0 -1
  230. package/dist/assets/js/3.b50928b1.js +0 -1
  231. package/dist/assets/js/30.e682e7b5.js +0 -1
  232. package/dist/assets/js/31.711223cc.js +0 -1
  233. package/dist/assets/js/32.65c4dfd4.js +0 -1
  234. package/dist/assets/js/33.b3a7c2ea.js +0 -1
  235. package/dist/assets/js/34.159478bb.js +0 -1
  236. package/dist/assets/js/35.5dead2b1.js +0 -1
  237. package/dist/assets/js/36.b58af11f.js +0 -1
  238. package/dist/assets/js/37.86d4ed5a.js +0 -1
  239. package/dist/assets/js/38.af279c3f.js +0 -1
  240. package/dist/assets/js/39.89b34b70.js +0 -1
  241. package/dist/assets/js/4.5d6de21f.js +0 -1
  242. package/dist/assets/js/40.3e1516da.js +0 -1
  243. package/dist/assets/js/41.d021ff9e.js +0 -1
  244. package/dist/assets/js/42.cb50aa1c.js +0 -1
  245. package/dist/assets/js/43.5fded5c8.js +0 -1
  246. package/dist/assets/js/44.50f78d19.js +0 -1
  247. package/dist/assets/js/45.527386eb.js +0 -1
  248. package/dist/assets/js/46.9f784389.js +0 -1
  249. package/dist/assets/js/47.7553aa19.js +0 -1
  250. package/dist/assets/js/48.9fee02f5.js +0 -1
  251. package/dist/assets/js/49.25c724d7.js +0 -1
  252. package/dist/assets/js/5.b3e00557.js +0 -1
  253. package/dist/assets/js/50.aba60d25.js +0 -1
  254. package/dist/assets/js/51.01a0bacf.js +0 -1
  255. package/dist/assets/js/52.86012cbb.js +0 -1
  256. package/dist/assets/js/53.1563eb60.js +0 -1
  257. package/dist/assets/js/54.7e734114.js +0 -1
  258. package/dist/assets/js/55.28b96a29.js +0 -1
  259. package/dist/assets/js/56.81bd12a3.js +0 -1
  260. package/dist/assets/js/57.70cac198.js +0 -1
  261. package/dist/assets/js/58.cc1b357e.js +0 -1
  262. package/dist/assets/js/59.697472ae.js +0 -1
  263. package/dist/assets/js/6.2c85d2f8.js +0 -1
  264. package/dist/assets/js/60.36873359.js +0 -1
  265. package/dist/assets/js/61.0a367a50.js +0 -1
  266. package/dist/assets/js/62.1aaa7b15.js +0 -1
  267. package/dist/assets/js/63.52c8de07.js +0 -1
  268. package/dist/assets/js/64.25b51d76.js +0 -1
  269. package/dist/assets/js/65.462206d5.js +0 -1
  270. package/dist/assets/js/66.c336d9fe.js +0 -1
  271. package/dist/assets/js/67.1b7fa2b9.js +0 -1
  272. package/dist/assets/js/68.e0ebaf13.js +0 -1
  273. package/dist/assets/js/69.3e1b6d2e.js +0 -1
  274. package/dist/assets/js/7.d1b0af72.js +0 -1
  275. package/dist/assets/js/70.40431d36.js +0 -1
  276. package/dist/assets/js/71.64f24577.js +0 -1
  277. package/dist/assets/js/72.2cf8371b.js +0 -1
  278. package/dist/assets/js/73.88f7feb5.js +0 -1
  279. package/dist/assets/js/74.2d5471c0.js +0 -1
  280. package/dist/assets/js/8.9ab5ee55.js +0 -1
  281. package/dist/assets/js/9.aaca0f9d.js +0 -9
  282. package/dist/assets/js/app.7efea3c2.js +0 -16
  283. package/dist/assets/js/vendors~docsearch.6f3b450f.js +0 -3
  284. package/dist/guide/about//346/255/244/346/226/207/346/241/243/351/241/271/347/233/256.html +0 -41
  285. package/dist/guide/index.html +0 -34
  286. package/dist/index.html +0 -40
  287. package/dist/local-js/axios@0.19.0.min.js +0 -9
  288. package/dist/local-js/ks@3.0.7.umd.min.js +0 -1
  289. package/dist/local-js/ksui@3.0.37.umd.min.js +0 -10
  290. package/dist/local-js/quill.js +0 -3
  291. package/dist/local-js/vant@2.5.6.min.js +0 -7
  292. package/dist/local-js/vconsole.min.js +0 -10
  293. package/dist/local-js/vue-router@3.1.3.min.js +0 -6
  294. package/dist/local-js/vue@2.6.10.runtime.min.js +0 -6
  295. package/dist/local-js/vue@2.7.16.min.js +0 -11932
  296. package/dist/local-js/vuex@3.1.1.min.js +0 -6
  297. package/dist/utils/ERP/ERP/345/267/245/345/205/267/346/226/271/346/263/225.html +0 -38
  298. package/dist/utils/H5/H5/345/267/245/345/205/267/346/226/271/346/263/225.html +0 -55
  299. package/dist/utils/H5/copyText /345/244/215/345/210/266.html" +0 -45
  300. package/dist/utils/index.html +0 -34
  301. package/dist//346/226/207/346/241/243/345/272/223/346/226/207/344/273/266/345/244/271.html +0 -46
  302. package/lib/demo.html +0 -10
  303. package/lib/hrui@1.0.1.common.js +0 -7411
  304. package/lib/hrui@1.0.1.css +0 -1
  305. package/lib/hrui@1.0.1.umd.js +0 -7411
  306. package/lib/hrui@1.0.1.umd.min.js +0 -1
  307. package/packages/hr-clipboard/src/icon.png +0 -0
  308. package/packages/hr-clipboard/src/main.vue +0 -64
  309. package/packages/hr-select/src/main.vue +0 -62
@@ -1,124 +1,144 @@
1
- <template>
2
- <HrPopup :show="isShowPopup"
3
- closeable
4
- position="bottom"
5
- safe-area-inset-bottom
6
- v-bind="$attrs"
7
- :title="title"
8
- @close="close">
9
- <div class="hr-img-list">
10
- <div v-for="(item, index) in imgList"
11
- :key="index"
12
- class="img-item"
13
- :class="{'item-single': imgList.length === 1}"
14
- @click="() => preview(index)">
15
- <img :src="item.url"
16
- alt="" />
17
- <slot :item="item"
18
- :index="index"></slot>
19
- </div>
20
- </div>
21
- </HrPopup>
22
- </template>
23
-
24
- <script>
25
- import HrPopup from '../../hr-popup'
26
-
27
- export default {
28
- components: {
29
- HrPopup
30
- },
31
- props: {
32
- show: {
33
- type: Boolean,
34
- default: false
35
- },
36
- // 标题
37
- title: String,
38
- // 图片列表
39
- imgList: {
40
- type: Array,
41
- default: () => ([])
42
- }
43
- },
44
- data () {
45
- return {
46
- isShowPopup: false,
47
- }
48
- },
49
- watch: {
50
- show: {
51
- handler (val) {
52
- this.isShowPopup = val
53
- },
54
- immediate: true
55
- }
56
- },
57
- // render () {
58
- // return (
59
- // <HrPopup show={this.isShowPopup}
60
- // closeable
61
- // position="bottom"
62
- // safe-area-inset-bottom
63
- // title={this.title}
64
- // onClose={this.close}>
65
- // <div class="hr-img-list">
66
- // {
67
- // this.imgList.map((item, index) => {
68
- // return <div class={['img-item', this.imgList.length === 1 ? 'item-single' : '']}
69
- // onClick={() => this.preview(index)}>
70
- // <img src={item.url} alt="" />
71
- // {this.$scopedSlots.default({
72
- // info: item,
73
- // index: index
74
- // })}
75
- // <slot item={item}
76
- // index={index}></slot>
77
- // </div>
78
- // })
79
- // }
80
- // </div>
81
- // </HrPopup>
82
- // )
83
- // },
84
- methods: {
85
- preview (index) {
86
- const images = this.imgList.map(item => item.url)
87
- vant.ImagePreview({
88
- images,
89
- startPosition: index
90
- })
91
- },
92
- close () {
93
- this.isShowPopup = false
94
- this.$emit('close')
95
- },
96
- }
97
- }
98
- </script>
99
-
100
- <style lang="less" scoped>
101
- .hr-img-list {
102
- display: flex;
103
- flex-wrap: wrap;
104
- padding: 10px;
105
- .img-item {
106
- position: relative;
107
- width: calc(50% - 12px);
108
- height: calc(50vw - 24px - 20px);
109
- position: relative;
110
- margin: 6px;
111
- overflow: hidden;
112
- border-radius: 8px;
113
- &.item-single {
114
- width: calc(100% - 12px);
115
- height: auto;
116
- }
117
- img {
118
- width: 100%;
119
- min-height: 100%;
120
- border-radius: 8px;
121
- }
122
- }
123
- }
1
+ <template>
2
+ <HrPopup :show="isShowPopup"
3
+ closeable
4
+ position="bottom"
5
+ safe-area-inset-bottom
6
+ v-bind="$attrs"
7
+ :title="title"
8
+ @close="close">
9
+ <div ref="hrImgListRef"
10
+ class="hr-img-list">
11
+ <HrElasticityBox v-if="showImgList.length > 1"
12
+ :lineNumber="2"
13
+ :margin="6">
14
+ <HrElasticityBoxItem v-for="(item, index) in showImgList"
15
+ :key="index"
16
+ :index="index">
17
+ <div class="img-item"
18
+ :class="{'item-single': showImgList.length === 1, 'active': checksIndex.includes(index)}"
19
+ @click="() => preview(index)">
20
+ <img :src="item.url"
21
+ alt="" />
22
+ <slot :item="item"
23
+ :index="index"></slot>
24
+ </div>
25
+ </HrElasticityBoxItem>
26
+ </HrElasticityBox>
27
+ <template v-else>
28
+ <div v-for="(item, index) in showImgList"
29
+ :key="index"
30
+ class="img-item"
31
+ :class="{'item-single': showImgList.length === 1, 'active': checksIndex.includes(index)}"
32
+ @click="() => preview(index)">
33
+ <img :src="item.url"
34
+ alt="" />
35
+ <slot :item="item"
36
+ :index="index"></slot>
37
+ </div>
38
+ </template>
39
+ <slot v-if="!showImgList.length"
40
+ name="no-data"></slot>
41
+ </div>
42
+ <slot name="list-footer"></slot>
43
+ </HrPopup>
44
+ </template>
45
+
46
+ <script>
47
+ import HrPopup from '../../hr-popup'
48
+ import HrElasticityBox from '../../hr-elasticity-box'
49
+ import HrElasticityBoxItem from '../../hr-elasticity-box/src/elasticity-box-item.vue'
50
+
51
+ export default {
52
+ name: 'HrImgList',
53
+ components: {
54
+ HrPopup,
55
+ HrElasticityBox,
56
+ HrElasticityBoxItem
57
+ },
58
+ props: {
59
+ show: {
60
+ type: Boolean,
61
+ default: false
62
+ },
63
+ // 标题
64
+ title: String,
65
+ // 图片列表
66
+ imgList: {
67
+ type: Array,
68
+ default: () => ([])
69
+ },
70
+ // 需要添加选中效果的索引集合
71
+ checksIndex: {
72
+ type: Array,
73
+ default: () => ([])
74
+ }
75
+ },
76
+ data () {
77
+ return {
78
+ isShowPopup: false,
79
+ showImgList: [],
80
+ }
81
+ },
82
+ watch: {
83
+ show: {
84
+ handler (val) {
85
+ this.isShowPopup = val
86
+ },
87
+ immediate: true
88
+ },
89
+ imgList: {
90
+ handler (val) {
91
+ this.showImgList = val || []
92
+ },
93
+ deep: true,
94
+ immediate: true
95
+ },
96
+ },
97
+ methods: {
98
+ preview (index) {
99
+ const images = this.showImgList.map(item => item.url)
100
+ vant.ImagePreview({
101
+ images,
102
+ startPosition: index
103
+ })
104
+ },
105
+ close () {
106
+ this.isShowPopup = false
107
+ this.$emit('close')
108
+ },
109
+ }
110
+ }
111
+ </script>
112
+
113
+ <style lang="less" scoped>
114
+ .hr-img-list {
115
+ max-height: 70vh;
116
+ overflow: auto;
117
+ display: flex;
118
+ flex-wrap: wrap;
119
+ padding: 10px;
120
+ .img-item {
121
+ position: relative;
122
+ width: 100%;
123
+ height: 100%;
124
+ // width: calc(50% - 16px);
125
+ // height: 200px;
126
+ // height: calc(50vw - 16px - 20px);
127
+ margin: 6px;
128
+ overflow: hidden;
129
+ border-radius: 8px;
130
+ border: 2px solid transparent;
131
+ &.item-single {
132
+ width: 100%;
133
+ height: auto;
134
+ }
135
+ &.active {
136
+ border: 2px solid #7972fe;
137
+ }
138
+ img {
139
+ width: 100%;
140
+ min-height: 100%;
141
+ }
142
+ }
143
+ }
124
144
  </style>
@@ -0,0 +1,7 @@
1
+ import HrInfoCard from './src/index.vue'
2
+
3
+ HrInfoCard.install = function (Vue) {
4
+ Vue.component(HrInfoCard.name, HrInfoCard)
5
+ }
6
+
7
+ export default HrInfoCard
@@ -0,0 +1,67 @@
1
+ <script>
2
+ export default {
3
+ name: 'HrInfoCard',
4
+ props: {
5
+ title: {
6
+ type: String,
7
+ default: '标题'
8
+ },
9
+ size: {
10
+ type: [String, Number],
11
+ default: '15'
12
+ },
13
+ titleColor: {
14
+ type: String,
15
+ default: 'inherit'
16
+ },
17
+ weight: {
18
+ type: String,
19
+ default: 'bold'
20
+ },
21
+ background: {
22
+ type: String,
23
+ default: '#fff'
24
+ },
25
+ borderColor: {
26
+ type: String,
27
+ default: '#ebedf5'
28
+ },
29
+ titleBackground: {
30
+ type: String,
31
+ default: 'inherit'
32
+ }
33
+ },
34
+ render () {
35
+ const wrapStyle = {
36
+ background: `${this.background}`,
37
+ }
38
+ const titleStyle = {
39
+ fontSize: `${this.size}px`,
40
+ color: this.titleColor,
41
+ fontWeight: this.weight,
42
+ borderBottom: `0.5px solid ${this.borderColor}`,
43
+ background: `${this.titleBackground}`,
44
+ }
45
+ return (<div style={wrapStyle} class="hr-info-card">
46
+ <div style={titleStyle} class="card-title">
47
+ {this.$slots.title ? this.$slots.title : this.title}
48
+ {this.$slots.right ? this.$slots.right : null}
49
+ </div>
50
+ {this.$slots.default ? this.$slots.default : null}
51
+ </div>)
52
+ }
53
+ }
54
+ </script>
55
+ <style lang="less" scoped>
56
+ .hr-info-card {
57
+ border-radius: 6px;
58
+ .card-title {
59
+ padding: 16px;
60
+ border-top-left-radius: 6px;
61
+ border-top-right-radius: 6px;
62
+ display: flex;
63
+ justify-content: space-between;
64
+ align-items: center;
65
+ }
66
+ }
67
+ </style>
@@ -0,0 +1,8 @@
1
+
2
+ import HrLicensePlateNumber from './src/index.vue'
3
+
4
+ HrLicensePlateNumber.install = function (Vue) {
5
+ Vue.component(HrLicensePlateNumber.name, HrLicensePlateNumber)
6
+ }
7
+
8
+ export default HrLicensePlateNumber
@@ -0,0 +1,44 @@
1
+ // 语言
2
+ export const LANGUAGE_TYPE = {
3
+ CHINESE: 10,
4
+ ENGLISH: 20
5
+ }
6
+
7
+ // 语言按钮
8
+ export const LANGUAGE_BUTTON_TEXT = {
9
+ [LANGUAGE_TYPE.CHINESE]: [
10
+ ["京", "津", "沪", "渝", "冀", "豫", "云", "辽", "黑", "湘"],
11
+ ["皖", "鲁", "新", "苏", "浙", "赣", "鄂", "桂", "甘", "晋"],
12
+ ["蒙", "陕", "吉", "闽", "贵", "粤", "青", "藏", "川", "宁"],
13
+ ["琼", "", "", "", "", "", "", "del"]
14
+ ],
15
+ [LANGUAGE_TYPE.ENGLISH]: [
16
+ ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"],
17
+ ["Q", "W", "E", "R", "T", "Y", "U", "I", "O", "P"],
18
+ ["A", "S", "D", "F", "G", "H", "J", "K", "L"],
19
+ ["港", "澳", "Z", "X", "C", "V", "B", "N", "M", "del"]
20
+ ],
21
+ }
22
+
23
+ // 按钮索引
24
+ export const LANGUAGE_BUTTON_TYPE = {
25
+ ZERO: 0,
26
+ ONE: 1,
27
+ TWO: 2,
28
+ THREE: 3,
29
+ FOUR: 4,
30
+ FIVE: 5,
31
+ SIX: 6,
32
+ SEVEN: 7,
33
+ }
34
+
35
+ // 禁用按钮
36
+ export const DISABLED_LANGUAGE_BUTTON_TEXT = {
37
+ [LANGUAGE_BUTTON_TYPE.ONE]: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "I", "港", "澳"],
38
+ [LANGUAGE_BUTTON_TYPE.TWO]: ["港", "澳", "O", "I"],
39
+ [LANGUAGE_BUTTON_TYPE.THREE]: ["港", "澳", "O", "I"],
40
+ [LANGUAGE_BUTTON_TYPE.FOUR]: ["港", "澳", "O", "I"],
41
+ [LANGUAGE_BUTTON_TYPE.FIVE]: ["港", "澳", "O", "I"],
42
+ [LANGUAGE_BUTTON_TYPE.SIX]: ["O", "I"],
43
+ [LANGUAGE_BUTTON_TYPE.SEVEN]: ["港", "澳", "O", "I"],
44
+ }
@@ -0,0 +1,164 @@
1
+ <script>
2
+ import Keyboard from './vnp-keyboard.vue'
3
+ import { LANGUAGE_TYPE } from './enum.js'
4
+ export default {
5
+ name: 'HrLicensePlateNumber',
6
+ components: {
7
+ Keyboard,
8
+ },
9
+ props: {
10
+ defaultValue: {
11
+ type: String,
12
+ default: '',
13
+ }
14
+ },
15
+ data () {
16
+ return {
17
+ showKeyboard: false,
18
+ currentIndex: '',
19
+ updateKey: 1,
20
+ numberList: [] // 车牌选项
21
+ }
22
+ },
23
+ computed: {
24
+ // 键盘中英切换
25
+ keyboardType () {
26
+ return this.currentIndex === 0 ? LANGUAGE_TYPE.CHINESE : LANGUAGE_TYPE.ENGLISH
27
+ }
28
+ },
29
+ watch: {
30
+ showKeyboard (newValue) {
31
+ this.$emit('bindShow', newValue)
32
+ }
33
+ },
34
+ mounted () {
35
+ this.init()
36
+ },
37
+ methods: {
38
+ init () {
39
+ this.initNumberList()
40
+ },
41
+ // 组建车牌选项
42
+ initNumberList () {
43
+ this.numberList = this.defaultValue && this.defaultValue.split('') || []
44
+ },
45
+ // 点击车牌item
46
+ handelClick (index) {
47
+ this.currentIndex = index
48
+ this.showKeyboard = true
49
+ },
50
+ // 点击键盘
51
+ keyboardChange (val) {
52
+ this.numberList.splice(this.currentIndex, 1, val)
53
+ if (this.currentIndex < 7) {
54
+ this.currentIndex++
55
+ }
56
+ this.updateKey++
57
+ this.emitValue()
58
+ },
59
+ // 键盘删除按钮
60
+ keyboardDelete () {
61
+ this.numberList[this.currentIndex] = ''
62
+ if (this.currentIndex > 0) {
63
+ this.currentIndex--
64
+ }
65
+ this.updateKey++
66
+ this.emitValue()
67
+ },
68
+ // 校验车牌号 满7位通过
69
+ check () {
70
+ let list = this.numberList.slice(0, 7)
71
+ return list.every((item) => item)
72
+ },
73
+ emitValue () {
74
+ let strValue = this.numberList.join('')
75
+ this.$emit('change', strValue)
76
+ },
77
+ keyboardFinish () {
78
+ if (!this.check()) {
79
+ this.$toast('请输入正确的车牌号码')
80
+ }
81
+ }
82
+ },
83
+ render () {
84
+ // 渲染单个车牌文本
85
+ const renderNumberItem = (value, index) => {
86
+ const isStartOrEnd = index === 0 || index === this.numberList.length - 1
87
+ const text = index === 0 ? '省' : '新能源'
88
+ return isStartOrEnd ? <div class="placeholder-val">{value || text}</div>
89
+ : <div class="item-value"> {value}</div>
90
+ }
91
+
92
+ // 渲染车牌号
93
+ const renderNumberList = () => {
94
+ return <ks-row gutter="8">
95
+ {
96
+ this.numberList.map((item, index) => {
97
+ return <ks-col
98
+ onClick={this.handelClick.bind(this, index)}
99
+ key={this.updateKey + index}
100
+ span="3">
101
+ <div class={[
102
+ 'item-box',
103
+ index === 7 && 'last-box',
104
+ currentIndex === index && 'active'
105
+ ]}> {renderNumberItem(item, index)} </div>
106
+ </ks-col>
107
+ })
108
+ }
109
+ </ks-row>
110
+ }
111
+
112
+ // 渲染键盘
113
+ const renderKeyboard = () => {
114
+ return <Keyboard show={this.showKeyboard}
115
+ onUpdate:show={(value) => { this.showKeyboard = value }}
116
+ onchange={this.keyboardChange}
117
+ onDelete={this.keyboardDelete}
118
+ onFinish={this.keyboardFinish}
119
+ currentIndex={this.currentIndex} />
120
+ }
121
+
122
+ return <div class="hr-license-plate-number">
123
+ {renderNumberList()}
124
+ {renderKeyboard()}
125
+ </div>
126
+ }
127
+ }
128
+ </script>
129
+
130
+ <style lang="less" scoped>
131
+ .hr-license-plate-number {
132
+ font-size: 14px;
133
+ .van-col {
134
+ & > div {
135
+ background: #f7f8fa;
136
+ border-radius: 4px;
137
+ height: 42px;
138
+ display: flex;
139
+ align-items: center;
140
+ justify-content: center;
141
+ color: #03050d;
142
+ box-sizing: border-box;
143
+ }
144
+ .item-box {
145
+ &.active {
146
+ border: 1px solid #7972fe;
147
+ }
148
+ }
149
+ }
150
+
151
+ .placeholder-val {
152
+ color: #b0b3bf;
153
+ }
154
+ .last-box {
155
+ border: 1px dashed #9adeb9;
156
+ box-sizing: border-box;
157
+ white-space: nowrap;
158
+ .placeholder-val {
159
+ font-size: 10px;
160
+ transform: scale(0.8);
161
+ }
162
+ }
163
+ }
164
+ </style>