@king-one/antdv 1.1.9 → 1.1.11

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 (262) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/es/components/collapse-transtion/hooks/use-collapse-transtion.mjs +108 -41
  3. package/dist/es/components/collapse-transtion/index.mjs +7 -7
  4. package/dist/es/components/collapse-transtion/src/collapse-transtion.vue.mjs +2 -2
  5. package/dist/es/components/collapse-transtion/src/collapse-transtion.vue2.mjs +24 -19
  6. package/dist/es/components/collapse-transtion/src/types.mjs +3 -3
  7. package/dist/es/components/cover-scroll-bar/hooks/use-has-scroll.mjs +25 -12
  8. package/dist/es/components/cover-scroll-bar/index.mjs +7 -7
  9. package/dist/es/components/cover-scroll-bar/src/cover-scroll-bar.mjs +198 -123
  10. package/dist/es/components/cover-scroll-bar/src/types.mjs +2 -2
  11. package/dist/es/components/form/component/form-item.vue.mjs +2 -2
  12. package/dist/es/components/form/component/form-item.vue2.mjs +58 -51
  13. package/dist/es/components/form/component/form.mjs +5 -4
  14. package/dist/es/components/form/component/form.vue.mjs +2 -2
  15. package/dist/es/components/form/component/form.vue2.mjs +21 -18
  16. package/dist/es/components/form/content/form-content.mjs +9 -9
  17. package/dist/es/components/form/index.mjs +11 -10
  18. package/dist/es/components/icon/index.mjs +5 -5
  19. package/dist/es/components/icon/src/icon.vue.mjs +2 -2
  20. package/dist/es/components/icon/src/icon.vue2.mjs +31 -21
  21. package/dist/es/components/icon/src/types.mjs +3 -3
  22. package/dist/es/components/index.mjs +35 -35
  23. package/dist/es/components/plus-upload/apis/plus-upload.api.mjs +8 -8
  24. package/dist/es/components/plus-upload/hook/useExtractPlusUpload.mjs +37 -28
  25. package/dist/es/components/plus-upload/hook/usePlusUpload.mjs +29 -18
  26. package/dist/es/components/plus-upload/images/pdf-icon.png.mjs +2 -2
  27. package/dist/es/components/plus-upload/images/word-icon.png.mjs +2 -2
  28. package/dist/es/components/plus-upload/images/xls-icon.png.mjs +2 -2
  29. package/dist/es/components/plus-upload/index.mjs +5 -5
  30. package/dist/es/components/plus-upload/src/plus-upload.vue.mjs +2 -2
  31. package/dist/es/components/plus-upload/src/plus-upload.vue2.mjs +180 -139
  32. package/dist/es/components/plus-upload/src/types.mjs +22 -10
  33. package/dist/es/components/pro-area/apis/pro-area.api.mjs +3 -3
  34. package/dist/es/components/pro-area/hooks/use-pro-area.mjs +9 -8
  35. package/dist/es/components/pro-area/index.mjs +9 -9
  36. package/dist/es/components/pro-area/src/ProArea.vue.mjs +2 -2
  37. package/dist/es/components/pro-area/src/ProArea.vue2.mjs +116 -82
  38. package/dist/es/components/pro-area/src/types.mjs +4 -3
  39. package/dist/es/components/pro-contract-view/apis/pro-contract-view.api.mjs +7 -7
  40. package/dist/es/components/pro-contract-view/hooks/use-contract-view.mjs +28 -22
  41. package/dist/es/components/pro-contract-view/index.mjs +7 -7
  42. package/dist/es/components/pro-contract-view/src/pro-contract-view.vue.mjs +2 -2
  43. package/dist/es/components/pro-contract-view/src/pro-contract-view.vue2.mjs +127 -103
  44. package/dist/es/components/pro-contract-view/src/types.mjs +6 -6
  45. package/dist/es/components/pro-loading/index.mjs +2 -2
  46. package/dist/es/components/pro-loading/src/pro-loading.mjs +48 -32
  47. package/dist/es/components/pro-modal/hooks/useProModal.mjs +38 -25
  48. package/dist/es/components/pro-modal/index.mjs +8 -8
  49. package/dist/es/components/pro-modal/src/ProModal.vue.mjs +2 -2
  50. package/dist/es/components/pro-modal/src/ProModal.vue2.mjs +111 -79
  51. package/dist/es/components/pro-modal/src/types.mjs +4 -4
  52. package/dist/es/components/pro-overlay/index.mjs +5 -5
  53. package/dist/es/components/pro-overlay/src/pro-overlay.vue.mjs +2 -2
  54. package/dist/es/components/pro-overlay/src/pro-overlay.vue2.mjs +36 -29
  55. package/dist/es/components/pro-picker/apis/pro-picker.api.mjs +6 -6
  56. package/dist/es/components/pro-picker/index.mjs +8 -8
  57. package/dist/es/components/pro-picker/src/ProPicker.vue.mjs +2 -2
  58. package/dist/es/components/pro-picker/src/ProPicker.vue2.mjs +90 -74
  59. package/dist/es/components/pro-picker/src/types.mjs +10 -4
  60. package/dist/es/components/pro-signature/index.mjs +7 -7
  61. package/dist/es/components/pro-signature/src/ProSignature.vue.mjs +2 -2
  62. package/dist/es/components/pro-signature/src/ProSignature.vue2.mjs +216 -103
  63. package/dist/es/components/pro-signature/src/types.mjs +4 -4
  64. package/dist/es/components/pro-table/hooks/use-pro-table.mjs +9 -8
  65. package/dist/es/components/pro-table/index.mjs +7 -7
  66. package/dist/es/components/pro-table/src/constants.mjs +8 -6
  67. package/dist/es/components/pro-table/src/field/field-date-range/field-date-range.vue.mjs +2 -2
  68. package/dist/es/components/pro-table/src/field/field-date-range/field-date-range.vue2.mjs +22 -17
  69. package/dist/es/components/pro-table/src/field/field-input/field-input.vue.mjs +2 -2
  70. package/dist/es/components/pro-table/src/field/field-input/field-input.vue2.mjs +22 -17
  71. package/dist/es/components/pro-table/src/field/field-radio/field-radio.vue.mjs +2 -2
  72. package/dist/es/components/pro-table/src/field/field-radio/field-radio.vue2.mjs +50 -43
  73. package/dist/es/components/pro-table/src/field/field-select/field-select.vue.mjs +2 -2
  74. package/dist/es/components/pro-table/src/field/field-select/field-select.vue2.mjs +50 -43
  75. package/dist/es/components/pro-table/src/field/field.css +3 -1
  76. package/dist/es/components/pro-table/src/field/field.vue.mjs +2 -2
  77. package/dist/es/components/pro-table/src/field/field.vue2.mjs +127 -102
  78. package/dist/es/components/pro-table/src/form-render.css +3 -1
  79. package/dist/es/components/pro-table/src/form-render.vue.mjs +2 -2
  80. package/dist/es/components/pro-table/src/form-render.vue2.mjs +148 -127
  81. package/dist/es/components/pro-table/src/hooks/use-form.mjs +20 -17
  82. package/dist/es/components/pro-table/src/hooks/use-table.mjs +47 -29
  83. package/dist/es/components/pro-table/src/pro-table.vue.mjs +2 -2
  84. package/dist/es/components/pro-table/src/pro-table.vue2.mjs +170 -155
  85. package/dist/es/components/pro-table/utils.mjs +10 -10
  86. package/dist/es/components/pro-tag/index.mjs +7 -7
  87. package/dist/es/components/pro-tag/src/ProTag.vue.mjs +2 -2
  88. package/dist/es/components/pro-tag/src/ProTag.vue2.mjs +28 -19
  89. package/dist/es/components/pro-tag/src/types.mjs +4 -3
  90. package/dist/es/components/pro-title/index.mjs +7 -7
  91. package/dist/es/components/pro-title/src/ProTitle.vue.mjs +2 -2
  92. package/dist/es/components/pro-title/src/ProTitle.vue2.mjs +47 -36
  93. package/dist/es/components/pro-title/src/types.mjs +4 -4
  94. package/dist/es/components/pro-upload/index.mjs +7 -7
  95. package/dist/es/components/pro-upload/src/assets/images/audio-icon.png.mjs +2 -2
  96. package/dist/es/components/pro-upload/src/assets/images/materials-icon.png.mjs +2 -2
  97. package/dist/es/components/pro-upload/src/assets/images/pdf-icon.png.mjs +2 -2
  98. package/dist/es/components/pro-upload/src/assets/images/ppt-icon.png.mjs +2 -2
  99. package/dist/es/components/pro-upload/src/assets/images/video-icon.png.mjs +2 -2
  100. package/dist/es/components/pro-upload/src/assets/images/word-icon.png.mjs +2 -2
  101. package/dist/es/components/pro-upload/src/assets/images/xls-icon.png.mjs +2 -2
  102. package/dist/es/components/pro-upload/src/assets/images/zip-icon.png.mjs +2 -2
  103. package/dist/es/components/pro-upload/src/data.mjs +18 -18
  104. package/dist/es/components/pro-upload/src/file-list.mjs +70 -55
  105. package/dist/es/components/pro-upload/src/gd-upload.mjs +163 -132
  106. package/dist/es/components/pro-upload/src/hooks/index.mjs +4 -4
  107. package/dist/es/components/pro-upload/src/hooks/useHttp.mjs +8 -8
  108. package/dist/es/components/pro-upload/src/hooks/useUpload.mjs +66 -36
  109. package/dist/es/components/pro-upload/src/props.mjs +6 -6
  110. package/dist/es/components/pro-upload/src/utils/index.mjs +38 -25
  111. package/dist/es/components/scale-virtual-list/component/scale-virtual-list.vue.mjs +2 -2
  112. package/dist/es/components/scale-virtual-list/component/scale-virtual-list.vue2.mjs +83 -69
  113. package/dist/es/components/scale-virtual-list/hooks/useVirtualList.mjs +176 -125
  114. package/dist/es/components/scale-virtual-list/index.mjs +5 -5
  115. package/dist/es/components/scroll-bar/index.mjs +7 -7
  116. package/dist/es/components/scroll-bar/src/scroll-bar.mjs +390 -240
  117. package/dist/es/components/scroll-bar/src/types.mjs +2 -2
  118. package/dist/es/components/utils/install.mjs +16 -14
  119. package/dist/es/hooks/index.mjs +3 -3
  120. package/dist/es/hooks/use-namespace/index.mjs +72 -41
  121. package/dist/es/hooks/useProForm.mjs +42 -27
  122. package/dist/es/index.mjs +73 -73
  123. package/dist/es/installer.mjs +8 -8
  124. package/dist/lib/components/base/style/index.js +2 -1
  125. package/dist/lib/components/collapse-transtion/hooks/use-collapse-transtion.js +134 -1
  126. package/dist/lib/components/collapse-transtion/index.js +11 -1
  127. package/dist/lib/components/collapse-transtion/src/collapse-transtion.vue.js +4 -1
  128. package/dist/lib/components/collapse-transtion/src/collapse-transtion.vue2.js +29 -1
  129. package/dist/lib/components/collapse-transtion/src/types.js +9 -1
  130. package/dist/lib/components/collapse-transtion/style/index.js +3 -1
  131. package/dist/lib/components/cover-scroll-bar/hooks/use-has-scroll.js +30 -1
  132. package/dist/lib/components/cover-scroll-bar/index.js +10 -1
  133. package/dist/lib/components/cover-scroll-bar/src/cover-scroll-bar.js +221 -1
  134. package/dist/lib/components/cover-scroll-bar/src/types.js +17 -1
  135. package/dist/lib/components/cover-scroll-bar/style/index.js +3 -1
  136. package/dist/lib/components/form/component/form-item.vue.js +4 -1
  137. package/dist/lib/components/form/component/form-item.vue2.js +63 -1
  138. package/dist/lib/components/form/component/form.js +14 -1
  139. package/dist/lib/components/form/component/form.vue.js +4 -1
  140. package/dist/lib/components/form/component/form.vue2.js +26 -1
  141. package/dist/lib/components/form/content/form-content.js +13 -1
  142. package/dist/lib/components/form/index.js +15 -1
  143. package/dist/lib/components/icon/index.js +9 -1
  144. package/dist/lib/components/icon/src/icon.vue.js +4 -1
  145. package/dist/lib/components/icon/src/icon.vue2.js +36 -1
  146. package/dist/lib/components/icon/src/types.js +17 -1
  147. package/dist/lib/components/icon/style/index.js +3 -1
  148. package/dist/lib/components/index.js +38 -1
  149. package/dist/lib/components/plus-upload/apis/plus-upload.api.js +21 -1
  150. package/dist/lib/components/plus-upload/hook/useExtractPlusUpload.js +64 -1
  151. package/dist/lib/components/plus-upload/hook/usePlusUpload.js +34 -1
  152. package/dist/lib/components/plus-upload/images/pdf-icon.png.js +4 -1
  153. package/dist/lib/components/plus-upload/images/word-icon.png.js +4 -1
  154. package/dist/lib/components/plus-upload/images/xls-icon.png.js +4 -1
  155. package/dist/lib/components/plus-upload/index.js +9 -1
  156. package/dist/lib/components/plus-upload/src/plus-upload.vue.js +4 -1
  157. package/dist/lib/components/plus-upload/src/plus-upload.vue2.js +199 -1
  158. package/dist/lib/components/plus-upload/src/types.js +37 -1
  159. package/dist/lib/components/plus-upload/style/index.js +3 -1
  160. package/dist/lib/components/pro-area/apis/pro-area.api.js +6 -1
  161. package/dist/lib/components/pro-area/hooks/use-pro-area.js +12 -1
  162. package/dist/lib/components/pro-area/index.js +13 -1
  163. package/dist/lib/components/pro-area/src/ProArea.vue.js +4 -1
  164. package/dist/lib/components/pro-area/src/ProArea.vue2.js +135 -1
  165. package/dist/lib/components/pro-area/src/types.js +22 -1
  166. package/dist/lib/components/pro-area/style/index.js +3 -1
  167. package/dist/lib/components/pro-contract-view/apis/pro-contract-view.api.js +10 -1
  168. package/dist/lib/components/pro-contract-view/hooks/use-contract-view.js +45 -1
  169. package/dist/lib/components/pro-contract-view/index.js +11 -1
  170. package/dist/lib/components/pro-contract-view/src/pro-contract-view.vue.js +4 -1
  171. package/dist/lib/components/pro-contract-view/src/pro-contract-view.vue2.js +152 -1
  172. package/dist/lib/components/pro-contract-view/src/types.js +24 -1
  173. package/dist/lib/components/pro-contract-view/style/index.js +3 -1
  174. package/dist/lib/components/pro-loading/index.js +5 -1
  175. package/dist/lib/components/pro-loading/src/pro-loading.js +75 -1
  176. package/dist/lib/components/pro-modal/hooks/useProModal.js +47 -1
  177. package/dist/lib/components/pro-modal/index.js +12 -1
  178. package/dist/lib/components/pro-modal/src/ProModal.vue.js +4 -1
  179. package/dist/lib/components/pro-modal/src/ProModal.vue2.js +122 -1
  180. package/dist/lib/components/pro-modal/src/types.js +16 -1
  181. package/dist/lib/components/pro-modal/style/index.js +3 -1
  182. package/dist/lib/components/pro-overlay/index.js +9 -1
  183. package/dist/lib/components/pro-overlay/src/pro-overlay.vue.js +4 -1
  184. package/dist/lib/components/pro-overlay/src/pro-overlay.vue2.js +41 -1
  185. package/dist/lib/components/pro-overlay/style/index.js +3 -1
  186. package/dist/lib/components/pro-picker/apis/pro-picker.api.js +9 -1
  187. package/dist/lib/components/pro-picker/index.js +11 -1
  188. package/dist/lib/components/pro-picker/src/ProPicker.vue.js +4 -1
  189. package/dist/lib/components/pro-picker/src/ProPicker.vue2.js +106 -1
  190. package/dist/lib/components/pro-picker/src/types.js +28 -1
  191. package/dist/lib/components/pro-signature/index.js +10 -1
  192. package/dist/lib/components/pro-signature/src/ProSignature.vue.js +4 -1
  193. package/dist/lib/components/pro-signature/src/ProSignature.vue2.js +258 -1
  194. package/dist/lib/components/pro-signature/src/types.js +40 -1
  195. package/dist/lib/components/pro-table/hooks/use-pro-table.js +12 -1
  196. package/dist/lib/components/pro-table/index.js +12 -1
  197. package/dist/lib/components/pro-table/src/constants.js +25 -1
  198. package/dist/lib/components/pro-table/src/field/field-date-range/field-date-range.vue.js +4 -1
  199. package/dist/lib/components/pro-table/src/field/field-date-range/field-date-range.vue2.js +31 -1
  200. package/dist/lib/components/pro-table/src/field/field-input/field-input.vue.js +4 -1
  201. package/dist/lib/components/pro-table/src/field/field-input/field-input.vue2.js +31 -1
  202. package/dist/lib/components/pro-table/src/field/field-radio/field-radio.vue.js +4 -1
  203. package/dist/lib/components/pro-table/src/field/field-radio/field-radio.vue2.js +59 -1
  204. package/dist/lib/components/pro-table/src/field/field-select/field-select.vue.js +4 -1
  205. package/dist/lib/components/pro-table/src/field/field-select/field-select.vue2.js +59 -1
  206. package/dist/lib/components/pro-table/src/field/field.css +3 -1
  207. package/dist/lib/components/pro-table/src/field/field.vue.js +5 -1
  208. package/dist/lib/components/pro-table/src/field/field.vue2.js +149 -1
  209. package/dist/lib/components/pro-table/src/form-render.css +3 -1
  210. package/dist/lib/components/pro-table/src/form-render.vue.js +5 -1
  211. package/dist/lib/components/pro-table/src/form-render.vue2.js +166 -1
  212. package/dist/lib/components/pro-table/src/hooks/use-form.js +25 -1
  213. package/dist/lib/components/pro-table/src/hooks/use-table.js +57 -1
  214. package/dist/lib/components/pro-table/src/pro-table.vue.js +4 -1
  215. package/dist/lib/components/pro-table/src/pro-table.vue2.js +203 -1
  216. package/dist/lib/components/pro-table/style/index.js +3 -1
  217. package/dist/lib/components/pro-table/utils.js +15 -1
  218. package/dist/lib/components/pro-tag/index.js +10 -1
  219. package/dist/lib/components/pro-tag/src/ProTag.vue.js +4 -1
  220. package/dist/lib/components/pro-tag/src/ProTag.vue2.js +46 -1
  221. package/dist/lib/components/pro-tag/src/types.js +10 -1
  222. package/dist/lib/components/pro-title/index.js +11 -1
  223. package/dist/lib/components/pro-title/src/ProTitle.vue.js +4 -1
  224. package/dist/lib/components/pro-title/src/ProTitle.vue2.js +52 -1
  225. package/dist/lib/components/pro-title/src/types.js +21 -1
  226. package/dist/lib/components/pro-title/style/index.js +3 -1
  227. package/dist/lib/components/pro-upload/index.js +11 -1
  228. package/dist/lib/components/pro-upload/src/assets/images/audio-icon.png.js +4 -1
  229. package/dist/lib/components/pro-upload/src/assets/images/materials-icon.png.js +4 -1
  230. package/dist/lib/components/pro-upload/src/assets/images/pdf-icon.png.js +4 -1
  231. package/dist/lib/components/pro-upload/src/assets/images/ppt-icon.png.js +4 -1
  232. package/dist/lib/components/pro-upload/src/assets/images/video-icon.png.js +4 -1
  233. package/dist/lib/components/pro-upload/src/assets/images/word-icon.png.js +4 -1
  234. package/dist/lib/components/pro-upload/src/assets/images/xls-icon.png.js +4 -1
  235. package/dist/lib/components/pro-upload/src/assets/images/zip-icon.png.js +4 -1
  236. package/dist/lib/components/pro-upload/src/data.js +49 -1
  237. package/dist/lib/components/pro-upload/src/file-list.js +160 -1
  238. package/dist/lib/components/pro-upload/src/gd-upload.js +211 -1
  239. package/dist/lib/components/pro-upload/src/hooks/index.js +6 -1
  240. package/dist/lib/components/pro-upload/src/hooks/useHttp.js +23 -1
  241. package/dist/lib/components/pro-upload/src/hooks/useUpload.js +85 -1
  242. package/dist/lib/components/pro-upload/src/props.js +50 -1
  243. package/dist/lib/components/pro-upload/src/utils/index.js +46 -1
  244. package/dist/lib/components/pro-upload/style/index.js +3 -1
  245. package/dist/lib/components/scale-virtual-list/component/scale-virtual-list.vue.js +4 -1
  246. package/dist/lib/components/scale-virtual-list/component/scale-virtual-list.vue2.js +93 -1
  247. package/dist/lib/components/scale-virtual-list/hooks/useVirtualList.js +220 -1
  248. package/dist/lib/components/scale-virtual-list/index.js +10 -1
  249. package/dist/lib/components/scale-virtual-list/style/index.js +3 -1
  250. package/dist/lib/components/scroll-bar/index.js +10 -1
  251. package/dist/lib/components/scroll-bar/src/scroll-bar.js +424 -1
  252. package/dist/lib/components/scroll-bar/src/types.js +13 -1
  253. package/dist/lib/components/scroll-bar/style/index.js +3 -1
  254. package/dist/lib/components/utils/install.js +23 -1
  255. package/dist/lib/hooks/index.js +5 -1
  256. package/dist/lib/hooks/use-namespace/index.js +80 -1
  257. package/dist/lib/hooks/useProForm.js +50 -1
  258. package/dist/lib/index.js +77 -1
  259. package/dist/lib/installer.js +13 -1
  260. package/dist/theme-chalk/icon.css +1 -1
  261. package/dist/theme-chalk/index.css +1 -1
  262. package/package.json +9 -9
@@ -1,101 +1,135 @@
1
- import { defineComponent as B, useModel as F, computed as u, createBlock as m, openBlock as i, unref as d, withCtx as f, createElementBlock as P, Fragment as w, renderList as y, createVNode as A, normalizeClass as E, mergeModels as I } from "vue";
2
- import { Form as M, Row as N, Col as k, Select as U } from "ant-design-vue";
3
- import { useNamespace as j } from "../../../hooks/use-namespace/index.mjs";
4
- import { ProAreaProps as q } from "./types.mjs";
5
- const R = /* @__PURE__ */ B({
6
- name: "ProArea",
1
+ import { defineComponent, useModel, computed, createBlock, openBlock, unref, withCtx, createElementBlock, Fragment, renderList, createVNode, normalizeClass, mergeModels } from "vue";
2
+ import { Form, Row, Col, Select } from "ant-design-vue";
3
+ import { useNamespace } from "../../../hooks/use-namespace/index.mjs";
4
+ import { ProAreaProps } from "./types.mjs";
5
+ const _sfc_main = /* @__PURE__ */ defineComponent({
6
+ ...{
7
+ name: "ProArea"
8
+ },
7
9
  __name: "ProArea",
8
- props: /* @__PURE__ */ I(q, {
9
- modelValue: {
10
- required: !0
10
+ props: /* @__PURE__ */ mergeModels(ProAreaProps, {
11
+ "modelValue": {
12
+ required: true
11
13
  },
12
- modelModifiers: {}
14
+ "modelModifiers": {}
13
15
  }),
14
16
  emits: ["update:modelValue"],
15
- setup(p) {
16
- const n = p;
17
- M.useInjectFormItemContext();
18
- const a = F(p, "modelValue"), { b: v } = j("pro-area-select"), h = u(() => (e) => `请选择${e === 1 ? "请选择省份" : e === 2 ? "请选择城市" : "请选择区县"}`), g = u(() => (e) => n.options.length > 0 ? C(e) : []);
19
- function C(e) {
20
- var t;
21
- if (e === 1)
22
- return n.options.map((l) => ({
23
- value: r(l, "id"),
24
- label: r(l, "name")
17
+ setup(__props) {
18
+ const props = __props;
19
+ Form.useInjectFormItemContext();
20
+ const model = useModel(__props, "modelValue");
21
+ const { b } = useNamespace("pro-area-select");
22
+ const placeholder = computed(() => {
23
+ return (index) => {
24
+ const title = index === 1 ? "请选择省份" : index === 2 ? "请选择城市" : "请选择区县";
25
+ return `请选择${title}`;
26
+ };
27
+ });
28
+ const ops = computed(() => {
29
+ return (index) => {
30
+ if (props.options.length > 0) {
31
+ return getOps(index);
32
+ }
33
+ return [];
34
+ };
35
+ });
36
+ function getOps(level) {
37
+ var _a;
38
+ if (level === 1) {
39
+ return props.options.map((item) => ({
40
+ value: getFieldValue(item, "id"),
41
+ label: getFieldValue(item, "name")
25
42
  }));
26
- if (e === 2) {
27
- const l = a.value.province;
28
- return l ? s(n.options, l).map((o) => ({
29
- value: r(o, "id"),
30
- label: r(o, "name")
43
+ } else if (level === 2) {
44
+ const value = model.value.province;
45
+ return value ? findChildrenByvalue(props.options, value).map((item) => ({
46
+ value: getFieldValue(item, "id"),
47
+ label: getFieldValue(item, "name")
31
48
  })) : [];
32
49
  } else {
33
- const l = (t = a.value) == null ? void 0 : t.city;
34
- return l ? s(n.options, l).map((o) => ({
35
- value: r(o, "id"),
36
- label: r(o, "name")
50
+ const value = (_a = model.value) == null ? void 0 : _a.city;
51
+ return value ? findChildrenByvalue(props.options, value).map((item) => ({
52
+ value: getFieldValue(item, "id"),
53
+ label: getFieldValue(item, "name")
37
54
  })) : [];
38
55
  }
39
56
  }
40
- function s(e, t) {
41
- for (const l of e) {
42
- if (r(l, "id") === t)
43
- return r(l, "children") || [];
44
- if (r(l, "children")) {
45
- const o = s(r(l, "children"), t);
46
- if (o)
47
- return o;
57
+ function findChildrenByvalue(regions, value) {
58
+ for (const item of regions) {
59
+ if (getFieldValue(item, "id") === value) {
60
+ return getFieldValue(item, "children") || [];
61
+ }
62
+ if (getFieldValue(item, "children")) {
63
+ const result = findChildrenByvalue(getFieldValue(item, "children"), value);
64
+ if (result) {
65
+ return result;
66
+ }
48
67
  }
49
68
  }
69
+ return void 0;
50
70
  }
51
- function r(e, t) {
52
- return e && t ? e[(n == null ? void 0 : n.fieldNames[t]) || t] : void 0;
71
+ function getFieldValue(opt, key) {
72
+ return opt && key ? opt[(props == null ? void 0 : props.fieldNames[key]) || key] : void 0;
53
73
  }
54
- const c = u(() => {
55
- let e = n.level;
56
- const t = [];
57
- for (; e--; )
58
- t.push(e === 2 ? "province" : e === 1 ? "city" : "county");
59
- return t;
60
- }), V = u(() => [v()]);
61
- function _(e) {
62
- e === 1 ? c.value.slice(e).forEach((l) => {
63
- a.value[l] = void 0;
64
- }) : e === 2 && c.value.slice(e).forEach((l) => {
65
- a.value[l] = void 0;
66
- });
74
+ const levels = computed(() => {
75
+ let IDX = props.level;
76
+ const arr = [];
77
+ while (IDX--) {
78
+ arr.push(IDX === 2 ? "province" : IDX === 1 ? "city" : "county");
79
+ }
80
+ return arr;
81
+ });
82
+ const c = computed(() => {
83
+ return [b()];
84
+ });
85
+ function handleChange(index) {
86
+ if (index === 1) {
87
+ const list = levels.value.slice(index);
88
+ list.forEach((item) => {
89
+ model.value[item] = void 0;
90
+ });
91
+ } else if (index === 2) {
92
+ const list = levels.value.slice(index);
93
+ list.forEach((item) => {
94
+ model.value[item] = void 0;
95
+ });
96
+ }
67
97
  }
68
- return (e, t) => (i(), m(d(N), { gutter: 10 }, {
69
- default: f(() => [
70
- (i(!0), P(
71
- w,
72
- null,
73
- y(c.value, (l, o) => (i(), m(d(k), {
74
- key: l,
75
- span: 24 / e.level
76
- }, {
77
- default: f(() => [
78
- A(d(U), {
79
- value: a.value[l],
80
- "onUpdate:value": (b) => a.value[l] = b,
81
- placeholder: h.value(o + 1),
82
- class: E(V.value),
83
- options: g.value(o + 1),
84
- onChange: () => _(o + 1)
85
- }, null, 8, ["value", "onUpdate:value", "placeholder", "class", "options", "onChange"])
86
- ]),
87
- _: 2
88
- /* DYNAMIC */
89
- }, 1032, ["span"]))),
90
- 128
91
- /* KEYED_FRAGMENT */
92
- ))
93
- ]),
94
- _: 1
95
- /* STABLE */
96
- }));
98
+ return (_ctx, _cache) => {
99
+ return openBlock(), createBlock(unref(Row), { gutter: 10 }, {
100
+ default: withCtx(() => [
101
+ (openBlock(true), createElementBlock(
102
+ Fragment,
103
+ null,
104
+ renderList(levels.value, (item, index) => {
105
+ return openBlock(), createBlock(unref(Col), {
106
+ key: item,
107
+ span: 24 / _ctx.level
108
+ }, {
109
+ default: withCtx(() => [
110
+ createVNode(unref(Select), {
111
+ value: model.value[item],
112
+ "onUpdate:value": ($event) => model.value[item] = $event,
113
+ placeholder: placeholder.value(index + 1),
114
+ class: normalizeClass(c.value),
115
+ options: ops.value(index + 1),
116
+ onChange: () => handleChange(index + 1)
117
+ }, null, 8, ["value", "onUpdate:value", "placeholder", "class", "options", "onChange"])
118
+ ]),
119
+ _: 2
120
+ /* DYNAMIC */
121
+ }, 1032, ["span"]);
122
+ }),
123
+ 128
124
+ /* KEYED_FRAGMENT */
125
+ ))
126
+ ]),
127
+ _: 1
128
+ /* STABLE */
129
+ });
130
+ };
97
131
  }
98
132
  });
99
133
  export {
100
- R as default
134
+ _sfc_main as default
101
135
  };
@@ -1,11 +1,12 @@
1
- const e = {
1
+ const level = [1, 2, 3];
2
+ const ProAreaProps = {
2
3
  level: {
3
4
  type: Number,
4
5
  default: 3
5
6
  },
6
7
  options: {
7
8
  type: Array,
8
- required: !0
9
+ required: true
9
10
  },
10
11
  fieldNames: {
11
12
  type: Object,
@@ -17,5 +18,5 @@ const e = {
17
18
  }
18
19
  };
19
20
  export {
20
- e as ProAreaProps
21
+ ProAreaProps
21
22
  };
@@ -1,10 +1,10 @@
1
- const i = {
2
- getContractPrefix: (t) => globalThis.$http.get("/contract/uri/prefix", t),
3
- getSignPrefix: (t) => globalThis.$http.get("/sign/uri/prefix", t),
4
- getPreviewUrl: (t, e) => globalThis.$http.get(`${t}/redirect/contract-preview-url`, e),
5
- getFileList: (t, e) => globalThis.$http.get(`${t}/contract/file/detail/list`, e),
6
- getFilePreview: (t, e) => globalThis.$http.get(`${t}//file/preview`, e)
1
+ const proContractViewApi = {
2
+ getContractPrefix: (config) => globalThis.$http.get(`/contract/uri/prefix`, config),
3
+ getSignPrefix: (config) => globalThis.$http.get(`/sign/uri/prefix`, config),
4
+ getPreviewUrl: (preFix, config) => globalThis.$http.get(`${preFix}/redirect/contract-preview-url`, config),
5
+ getFileList: (preFix, config) => globalThis.$http.get(`${preFix}/contract/file/detail/list`, config),
6
+ getFilePreview: (signPreFix, config) => globalThis.$http.get(`${signPreFix}//file/preview`, config)
7
7
  };
8
8
  export {
9
- i as proContractViewApi
9
+ proContractViewApi
10
10
  };
@@ -1,39 +1,45 @@
1
- import { ref as o, reactive as p, onMounted as P } from "vue";
2
- import { proContractViewApi as e } from "../apis/pro-contract-view.api.mjs";
3
- function u({
4
- contractId: r
1
+ import { ref, reactive, onMounted } from "vue";
2
+ import { proContractViewApi } from "../apis/pro-contract-view.api.mjs";
3
+ function useProContractView({
4
+ contractId
5
5
  }) {
6
- const c = o([]), i = o([]), t = p({
6
+ const pageList = ref([]);
7
+ const fileList = ref([]);
8
+ const viewStatus = reactive({
7
9
  contractPrefix: "",
8
10
  signPrefix: "",
9
11
  appToken: "",
10
12
  userIdentity: ""
11
13
  });
12
- return P(async () => {
13
- const { data: a } = await e.getContractPrefix(), { data: n } = await e.getSignPrefix();
14
- if (a.contractUriPrefix && n.signUriPrefix) {
15
- t.contractPrefix = a.contractUriPrefix, t.signPrefix = n.signUriPrefix;
16
- const { data: s } = await e.getPreviewUrl(t.contractPrefix, {
14
+ onMounted(async () => {
15
+ const { data: cres } = await proContractViewApi.getContractPrefix();
16
+ const { data: sres } = await proContractViewApi.getSignPrefix();
17
+ if (cres.contractUriPrefix && sres.signUriPrefix) {
18
+ viewStatus.contractPrefix = cres.contractUriPrefix;
19
+ viewStatus.signPrefix = sres.signUriPrefix;
20
+ const { data: previewRes } = await proContractViewApi.getPreviewUrl(viewStatus.contractPrefix, {
17
21
  params: {
18
- contractId: r
22
+ contractId
19
23
  }
20
24
  });
21
- t.userIdentity = s.userIdentity, t.appToken = s.appToken;
22
- const { data: f } = await e.getFileList(t.signPrefix, {
25
+ viewStatus.userIdentity = previewRes.userIdentity;
26
+ viewStatus.appToken = previewRes.appToken;
27
+ const { data: res } = await proContractViewApi.getFileList(viewStatus.signPrefix, {
23
28
  headers: {
24
- "SEAL-APP-TOKEN ": t.appToken,
25
- userIdentity: t.userIdentity
29
+ "SEAL-APP-TOKEN ": viewStatus.appToken,
30
+ "userIdentity": viewStatus.userIdentity
26
31
  },
27
- params: { contractId: r }
32
+ params: { contractId }
28
33
  });
29
- i.value = f;
34
+ fileList.value = res;
30
35
  }
31
- }), {
32
- pageList: c,
33
- viewStatus: t,
34
- fileList: i
36
+ });
37
+ return {
38
+ pageList,
39
+ viewStatus,
40
+ fileList
35
41
  };
36
42
  }
37
43
  export {
38
- u as useProContractView
44
+ useProContractView
39
45
  };
@@ -1,11 +1,11 @@
1
- import { withInstall as o } from "../utils/install.mjs";
1
+ import { withInstall } from "../utils/install.mjs";
2
2
  import "./src/pro-contract-view.vue.mjs";
3
3
  import "./style/index.mjs";
4
- import { useProContractView as n } from "./hooks/use-contract-view.mjs";
5
- import t from "./src/pro-contract-view.vue2.mjs";
6
- const e = o(t);
4
+ import { useProContractView } from "./hooks/use-contract-view.mjs";
5
+ import _sfc_main from "./src/pro-contract-view.vue2.mjs";
6
+ const KProContractView = withInstall(_sfc_main);
7
7
  export {
8
- e as KProContractView,
9
- e as default,
10
- n as useProContractView
8
+ KProContractView,
9
+ KProContractView as default,
10
+ useProContractView
11
11
  };
@@ -1,4 +1,4 @@
1
- import f from "./pro-contract-view.vue2.mjs";
1
+ import _sfc_main from "./pro-contract-view.vue2.mjs";
2
2
  export {
3
- f as default
3
+ _sfc_main as default
4
4
  };
@@ -1,128 +1,152 @@
1
- import { defineComponent as b, ref as u, computed as C, onMounted as V, watchEffect as z, unref as l, createElementBlock as g, openBlock as h, normalizeClass as d, createVNode as v, createCommentVNode as E, withCtx as H, createElementVNode as w, normalizeStyle as R } from "vue";
2
- import { Spin as A } from "ant-design-vue";
3
- import { useNamespace as B } from "../../../hooks/use-namespace/index.mjs";
1
+ import { defineComponent, ref, computed, onMounted, watchEffect, unref, createElementBlock, openBlock, normalizeClass, createVNode, createCommentVNode, withCtx, createElementVNode, normalizeStyle } from "vue";
2
+ import { Spin } from "ant-design-vue";
3
+ import { useNamespace } from "../../../hooks/use-namespace/index.mjs";
4
4
  import "../../index.mjs";
5
- import { proContractViewApi as T } from "../apis/pro-contract-view.api.mjs";
6
- import { ProContractViewProps as U } from "./types.mjs";
7
- import { KScaleVirtualList as $ } from "../../scale-virtual-list/index.mjs";
8
- const K = ["data-page-index"], M = ["src"], Q = /* @__PURE__ */ b({
5
+ import { proContractViewApi } from "../apis/pro-contract-view.api.mjs";
6
+ import { ProContractViewProps } from "./types.mjs";
7
+ import { KScaleVirtualList } from "../../scale-virtual-list/index.mjs";
8
+ const _hoisted_1 = ["data-page-index"];
9
+ const _hoisted_2 = ["src"];
10
+ const _sfc_main = /* @__PURE__ */ defineComponent({
9
11
  __name: "pro-contract-view",
10
- props: U,
11
- setup(x) {
12
- const o = x, _ = u(null), c = u([]), y = {
13
- itemHeight: (e) => c.value[e].size,
12
+ props: ProContractViewProps,
13
+ setup(__props) {
14
+ const props = __props;
15
+ const virtualListRef = ref(null);
16
+ const pages = ref([]);
17
+ const options = {
18
+ itemHeight: (index) => pages.value[index].size,
14
19
  overscan: 3
15
- }, p = u(!0), r = u(null), { b: N, e: m } = B("pro-contract-view"), k = C(() => [
16
- N()
20
+ };
21
+ const spinning = ref(true);
22
+ const containerRef = ref(null);
23
+ const { b, e } = useNamespace("pro-contract-view");
24
+ const c = computed(() => [
25
+ b()
17
26
  ]);
18
- V(() => {
19
- if (r.value) {
20
- const e = r.value.parentElement;
21
- !r.value.clientHeight && (e != null && e.clientHeight) && (r.value.style.height = `${e == null ? void 0 : e.clientHeight}px`);
27
+ onMounted(() => {
28
+ if (containerRef.value) {
29
+ const parentElement = containerRef.value.parentElement;
30
+ if (!containerRef.value.clientHeight && (parentElement == null ? void 0 : parentElement.clientHeight)) {
31
+ containerRef.value.style.height = `${parentElement == null ? void 0 : parentElement.clientHeight}px`;
32
+ }
33
+ }
34
+ });
35
+ watchEffect(() => {
36
+ const { signPrefix, userIdentity, appToken } = props.viewStatus;
37
+ if (signPrefix && userIdentity && appToken && props.pageList.length > 0 && props.fileId) {
38
+ render(props.pageList);
22
39
  }
23
- }), z(() => {
24
- const { signPrefix: e, userIdentity: a, appToken: t } = o.viewStatus;
25
- e && a && t && o.pageList.length > 0 && o.fileId && F(o.pageList);
26
40
  });
27
- function F(e, a) {
28
- const t = l(e), i = Math.max(...t.map((s) => s.width));
29
- let n = 1;
30
- a && (n = Number.parseFloat((a / i).toFixed(2))), c.value = t.map((s) => {
31
- const S = Number.parseFloat((+s.width * n).toFixed(2)), f = Number.parseFloat((+s.height * n).toFixed(2));
41
+ function render(pageList, width) {
42
+ const list = unref(pageList);
43
+ const maxWidth = Math.max(...list.map((item) => item.width));
44
+ let scale = 1;
45
+ if (width) {
46
+ scale = Number.parseFloat((width / maxWidth).toFixed(2));
47
+ }
48
+ pages.value = list.map((item) => {
49
+ const w = Number.parseFloat((+item.width * scale).toFixed(2));
50
+ const h = Number.parseFloat((+item.height * scale).toFixed(2));
32
51
  return {
33
52
  url: "",
34
- loaded: !1,
35
- width: S,
36
- height: f,
37
- size: f + 10,
38
- pageNum: s.pageNum
53
+ loaded: false,
54
+ width: w,
55
+ height: h,
56
+ size: h + 10,
57
+ pageNum: item.pageNum
39
58
  };
40
- }), p.value = !1;
59
+ });
60
+ spinning.value = false;
41
61
  }
42
- function I(e) {
43
- L(e.start, e.end);
62
+ function handleUpdate(state) {
63
+ loadImg(state.start, state.end);
44
64
  }
45
- async function L(e, a) {
46
- let t = e;
47
- for (; t <= a; ) {
48
- const i = c.value[t];
49
- if (!i)
65
+ async function loadImg(start, end) {
66
+ let current = start;
67
+ while (current <= end) {
68
+ const item = pages.value[current];
69
+ if (!item)
50
70
  return;
51
- if (!i.loaded) {
52
- i.loaded = !0;
53
- const n = await P(t + 1);
54
- i.url = n;
71
+ if (!item.loaded) {
72
+ item.loaded = true;
73
+ const img = await getImgUrl(current + 1);
74
+ item.url = img;
55
75
  }
56
- t++;
76
+ current++;
57
77
  }
58
78
  }
59
- async function P(e) {
60
- const { viewStatus: a, fileId: t } = o;
61
- return (await T.getFilePreview(a.signPrefix, {
79
+ async function getImgUrl(index) {
80
+ const { viewStatus, fileId } = props;
81
+ const res = await proContractViewApi.getFilePreview(viewStatus.signPrefix, {
62
82
  headers: {
63
- "SEAL-APP-TOKEN ": a.appToken,
64
- userIdentity: a.userIdentity
83
+ "SEAL-APP-TOKEN ": viewStatus.appToken,
84
+ "userIdentity": viewStatus.userIdentity
65
85
  },
66
86
  params: {
67
- fileId: t,
68
- pageNum: e,
87
+ fileId,
88
+ pageNum: index,
69
89
  pageSize: 1,
70
- absoluteEnable: !0
90
+ absoluteEnable: true
71
91
  }
72
- })).data.pages[e - 1].url;
92
+ });
93
+ const img = res.data.pages[index - 1].url;
94
+ return img;
73
95
  }
74
- return (e, a) => (h(), g(
75
- "div",
76
- {
77
- ref_key: "containerRef",
78
- ref: r,
79
- class: d(k.value)
80
- },
81
- [
82
- v(l(A), {
83
- tip: "Loading...",
84
- spinning: p.value
85
- }, null, 8, ["spinning"]),
86
- p.value ? E("v-if", !0) : (h(), g(
87
- "div",
88
- {
89
- key: 0,
90
- class: d(l(m)("content"))
91
- },
92
- [
93
- v(l($), {
94
- ref_key: "virtualListRef",
95
- ref: _,
96
- list: c.value,
97
- option: y,
98
- "onUpdate:state": I
99
- }, {
100
- default: H(({ index: t, item: i }) => [
101
- w("div", {
102
- "data-page-index": t + 1,
103
- class: d(l(m)("content-item")),
104
- style: R({ height: `${i.data.height}px`, width: `${i.data.width}px`, marginBottom: "10px" })
105
- }, [
106
- w("img", {
107
- src: i.data.url,
108
- width: "100%",
109
- alt: ""
110
- }, null, 8, M)
111
- ], 14, K)
112
- ]),
113
- _: 1
114
- /* STABLE */
115
- }, 8, ["list"])
116
- ],
117
- 2
118
- /* CLASS */
119
- ))
120
- ],
121
- 2
122
- /* CLASS */
123
- ));
96
+ return (_ctx, _cache) => {
97
+ return openBlock(), createElementBlock(
98
+ "div",
99
+ {
100
+ ref_key: "containerRef",
101
+ ref: containerRef,
102
+ class: normalizeClass(c.value)
103
+ },
104
+ [
105
+ createVNode(unref(Spin), {
106
+ tip: "Loading...",
107
+ spinning: spinning.value
108
+ }, null, 8, ["spinning"]),
109
+ !spinning.value ? (openBlock(), createElementBlock(
110
+ "div",
111
+ {
112
+ key: 0,
113
+ class: normalizeClass(unref(e)("content"))
114
+ },
115
+ [
116
+ createVNode(unref(KScaleVirtualList), {
117
+ ref_key: "virtualListRef",
118
+ ref: virtualListRef,
119
+ list: pages.value,
120
+ option: options,
121
+ "onUpdate:state": handleUpdate
122
+ }, {
123
+ default: withCtx(({ index, item }) => [
124
+ createElementVNode("div", {
125
+ "data-page-index": index + 1,
126
+ class: normalizeClass(unref(e)("content-item")),
127
+ style: normalizeStyle({ height: `${item.data.height}px`, width: `${item.data.width}px`, marginBottom: `10px` })
128
+ }, [
129
+ createElementVNode("img", {
130
+ src: item.data.url,
131
+ width: "100%",
132
+ alt: ""
133
+ }, null, 8, _hoisted_2)
134
+ ], 14, _hoisted_1)
135
+ ]),
136
+ _: 1
137
+ /* STABLE */
138
+ }, 8, ["list"])
139
+ ],
140
+ 2
141
+ /* CLASS */
142
+ )) : createCommentVNode("v-if", true)
143
+ ],
144
+ 2
145
+ /* CLASS */
146
+ );
147
+ };
124
148
  }
125
149
  });
126
150
  export {
127
- Q as default
151
+ _sfc_main as default
128
152
  };
@@ -1,14 +1,14 @@
1
- import { definePropType as e } from "../../utils/install.mjs";
2
- const r = {
1
+ import { definePropType } from "../../utils/install.mjs";
2
+ const ProContractViewProps = {
3
3
  viewStatus: {
4
- type: e(Object),
5
- required: !0
4
+ type: definePropType(Object),
5
+ required: true
6
6
  },
7
7
  fileId: {
8
8
  type: String
9
9
  },
10
10
  pageList: {
11
- type: e(Array),
11
+ type: definePropType(Array),
12
12
  default: () => []
13
13
  }
14
14
  // fileId: {
@@ -20,5 +20,5 @@ const r = {
20
20
  // }
21
21
  };
22
22
  export {
23
- r as ProContractViewProps
23
+ ProContractViewProps
24
24
  };