hy-dispatch-ui-v3 0.2.67 → 0.2.69

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 (282) hide show
  1. package/dist/tailwind.css +232 -20
  2. package/es/api/device.mjs +2 -3
  3. package/es/api/exportExcel.mjs +57 -0
  4. package/es/api/index.mjs +27 -16
  5. package/es/api/mapRail.mjs +31 -0
  6. package/es/api/organization.mjs +17 -9
  7. package/es/api/rule.mjs +30 -0
  8. package/es/api/sypct.mjs +2 -3
  9. package/es/api/task.mjs +2 -3
  10. package/es/bussiness/hyAddDepartmentType/addDepartmentType.vue.mjs +18 -19
  11. package/es/bussiness/hyAddDepartmentType/style/addDepartmentType.scss +28 -28
  12. package/es/bussiness/hyElectronicFence/cpns/addElectronicFenceDialog/addElectronicFenceDialog.vue.mjs +511 -0
  13. package/es/bussiness/hyElectronicFence/cpns/batchSetElectronicFenceUserDialog/batchSetElectronicFenceUserDialog.vue.mjs +178 -0
  14. package/es/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersDialog.vue.mjs +316 -0
  15. package/es/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersItem.vue.mjs +119 -0
  16. package/es/bussiness/hyElectronicFence/electronicFence.vue.mjs +358 -0
  17. package/es/bussiness/hyElectronicFence/index.mjs +13 -0
  18. package/es/bussiness/hyElectronicFence/style/electronicFence.scss +0 -0
  19. package/es/bussiness/hyElectronicFence/style/electronicFenceAssociatedUsersDialog.scss +25 -0
  20. package/es/bussiness/hyMapAearchPlace/js/index.mjs +1 -1
  21. package/es/bussiness/hyMapAearchPlace/mapAearchPlace.vue.mjs +4 -6
  22. package/es/bussiness/hyMapAearchPlace/style/mapAearchPlace.scss +4 -3
  23. package/es/bussiness/hyRuleSetting/cpns/gatheringPeople/gatheringPeople.vue.mjs +270 -0
  24. package/es/bussiness/hyRuleSetting/cpns/missionInRule/missionInRule.vue.mjs +251 -0
  25. package/es/bussiness/hyRuleSetting/cpns/missionOutRule/missionOutRule.vue.mjs +251 -0
  26. package/es/bussiness/hyRuleSetting/cpns/ruleAssignDialog/ruleAssignDialog.vue.mjs +395 -0
  27. package/es/bussiness/hyRuleSetting/cpns/ruleFenceDialog/ruleFenceDialog.vue.mjs +651 -0
  28. package/es/bussiness/hyRuleSetting/cpns/ruleSettingDialog/ruleSettingDialog.vue.mjs +357 -0
  29. package/es/bussiness/hyRuleSetting/cpns/sedentary/sedentary.vue.mjs +261 -0
  30. package/es/bussiness/hyRuleSetting/cpns/setRuleAggregationAlarmDialog/setRuleAggregationAlarmDialog.vue.mjs +360 -0
  31. package/es/bussiness/hyRuleSetting/cpns/timedVideo/timedVideo.vue.mjs +240 -0
  32. package/es/bussiness/hyRuleSetting/cpns/timerCamera/timerCamera.vue.mjs +258 -0
  33. package/es/bussiness/hyRuleSetting/cpns/timingReturn/timingReturn.vue.mjs +240 -0
  34. package/es/bussiness/hyRuleSetting/index.mjs +15 -0
  35. package/es/bussiness/hyRuleSetting/js/ruleSetting.mjs +65 -0
  36. package/es/bussiness/hyRuleSetting/ruleSetting.vue.mjs +129 -0
  37. package/es/bussiness/hyRuleSetting/style/ruleSetting.scss +0 -0
  38. package/es/bussiness/index.mjs +2 -0
  39. package/es/components/hyAudioPlayer/audioPlayer.vue.mjs +5 -13
  40. package/es/components/hyAudioPlayer/js/index.mjs +9 -14
  41. package/es/components/hyAudioPlayer/style/audioPlayer.scss +7 -2
  42. package/es/components/hyButton/button.vue.mjs +2 -2
  43. package/es/components/hyButton/style/button.scss +48 -74
  44. package/es/components/hyCheckboxGroup/checkboxGroup.vue.mjs +119 -0
  45. package/es/components/hyCheckboxGroup/index.mjs +7 -0
  46. package/es/components/hyCheckboxGroup/style/checkboxGroup.scss +58 -0
  47. package/es/components/hyConfigProvider/configProvider.vue.mjs +51 -38
  48. package/es/components/hyConfirmDialog/confirmDialog.vue.mjs +57 -62
  49. package/es/components/hyConfirmDialog/confirmMethod.mjs +24 -22
  50. package/es/components/hyCutter/cutter.vue.mjs +9 -23
  51. package/es/components/hyDatePicker/datePicker.vue.mjs +12 -17
  52. package/es/components/hyDialog/dialog.vue.mjs +5 -9
  53. package/es/components/hyDialog/style/dialog.scss +12 -13
  54. package/es/components/hyDrawer/drawer.vue.mjs +100 -0
  55. package/es/components/hyDrawer/index.mjs +7 -0
  56. package/es/components/hyDrawer/style/drawer.scss +0 -0
  57. package/es/components/hyForm/cpns/arrayItem.vue.mjs +10 -28
  58. package/es/components/hyForm/cpns/arrayItem2.vue.mjs +198 -0
  59. package/es/components/hyForm/cpns/extraItem.vue.mjs +2 -3
  60. package/es/components/hyForm/cpns/formItem.vue.mjs +75 -37
  61. package/es/components/hyForm/cpns/locationSelect.vue.mjs +26 -26
  62. package/es/components/hyForm/form.vue.mjs +58 -24
  63. package/es/components/hyForm/js/index.mjs +4 -8
  64. package/es/components/hyForm/js/useAppForm.mjs +5 -9
  65. package/es/components/hyForm/style/form.scss +4 -13
  66. package/es/components/hyIcon/icon.vue.mjs +3 -3
  67. package/es/components/hyIconBox/style/iconBox.scss +2 -6
  68. package/es/components/hyInput/inputSearch.vue.mjs +8 -11
  69. package/es/components/hyInput/style/inputSearch.scss +3 -0
  70. package/es/components/hyLoading/index.mjs +3 -5
  71. package/es/components/hyMap/js/index.mjs +29 -4
  72. package/es/components/hyMap/map.vue.mjs +17 -3
  73. package/es/components/hyMenu/style/menu.scss +5 -15
  74. package/es/components/hyNoPermissions/noPermissions.vue.mjs +3 -4
  75. package/es/components/hyNoPermissionsMap/noPermissionsMap.vue.mjs +3 -6
  76. package/es/components/hyOrgCascader/js/index.mjs +1 -5
  77. package/es/components/hyOrgCascader/orgCascader.vue.mjs +25 -11
  78. package/es/components/hyOrgCascader/style/orgCascader.scss +7 -0
  79. package/es/components/hyRadioGroup/radioGroup.vue.mjs +48 -41
  80. package/es/components/hyRadioGroup/style/radioGroup.scss +9 -0
  81. package/es/components/hySearch/cpns/searchItem.vue.mjs +33 -20
  82. package/es/components/hySearch/js/index.mjs +1 -4
  83. package/es/components/hySearch/js/useAppSearch.mjs +6 -10
  84. package/es/components/hySearch/search.vue.mjs +9 -16
  85. package/es/components/hySearch/style/search.scss +2 -0
  86. package/es/components/hyStatus/index.mjs +7 -0
  87. package/es/components/hyStatus/status.vue.mjs +110 -0
  88. package/es/components/hyStatus/style/status.scss +0 -0
  89. package/es/components/hyTable/cpns/columnSelect.vue.mjs +24 -28
  90. package/es/components/hyTable/cpns/columnSelectItem.vue.mjs +8 -9
  91. package/es/components/hyTable/cpns/headerItem.vue.mjs +2 -2
  92. package/es/components/hyTable/cpns/virtualTable.vue.mjs +18 -28
  93. package/es/components/hyTable/js/index.mjs +56 -59
  94. package/es/components/hyTable/js/useAppTable.mjs +3 -4
  95. package/es/components/hyTable/style/table.scss +8 -0
  96. package/es/components/hyTable/table.vue.mjs +35 -41
  97. package/es/components/hyTableActionButton/tableActionButton.vue.mjs +4 -4
  98. package/es/components/hyTableForm/batchTableForm.vue.mjs +3 -7
  99. package/es/components/hyTableForm/js/index.mjs +3 -11
  100. package/es/components/hyTableForm/js/useAppTableForm.mjs +2 -7
  101. package/es/components/hyTableForm/style/batchTableForm.scss +26 -54
  102. package/es/components/hyTableForm/style/tableForm.scss +3 -2
  103. package/es/components/hyTableForm/tableForm.vue.mjs +90 -46
  104. package/es/components/hyTimePicker/timePicker.vue.mjs +4 -5
  105. package/es/components/hyTree/js/index.mjs +13 -40
  106. package/es/components/hyTree/style/index.css +1 -1
  107. package/es/components/hyTree/tree.vue.mjs +17 -16
  108. package/es/components/hyUserAvatar/userAvatar.vue.mjs +3 -6
  109. package/es/components/hyVideoPlayer/js/index.mjs +14 -23
  110. package/es/components/hyVideoPlayer/style/videoPlayer.scss +5 -7
  111. package/es/components/hyVideoPlayer/videoPlayer.vue.mjs +16 -26
  112. package/es/components/index.mjs +3 -0
  113. package/es/hooks/index.mjs +6 -2
  114. package/es/hooks/useAudioPlayerConfig.mjs +1 -3
  115. package/es/hooks/useBaseMainStore.mjs +29 -0
  116. package/es/hooks/useCurrentBus.mjs +20 -0
  117. package/es/hooks/useDialog.mjs +327 -0
  118. package/es/hooks/useExportFile.mjs +133 -0
  119. package/es/hooks/useGlobalConfig.mjs +10 -6
  120. package/es/hooks/useLocale.mjs +22 -12
  121. package/es/hooks/usePermissionMap.mjs +1 -3
  122. package/es/hooks/useResizeHandler.mjs +1 -4
  123. package/es/hooks/useResizeObserver.mjs +3 -1
  124. package/es/hooks/useSubscribe.mjs +2 -2
  125. package/es/hooks/useUserAvatarMap.mjs +1 -3
  126. package/es/hooks/useVideoPlayerConfig.mjs +1 -3
  127. package/es/index.mjs +11 -2
  128. package/es/locale/{en.mjs → en_US.mjs} +81 -5
  129. package/es/locale/index.mjs +2 -2
  130. package/es/locale/zh_CN.mjs +81 -3
  131. package/es/style/tailwind.scss +7 -3
  132. package/es/utils/adaptive.mjs +1 -3
  133. package/es/utils/form.mjs +19 -12
  134. package/es/utils/handler.mjs +4 -8
  135. package/es/utils/input.mjs +8 -9
  136. package/es/utils/map/hook/bigMap.mjs +14 -53
  137. package/es/utils/map/hook/gaode.mjs +5 -20
  138. package/es/utils/map/hook/leafletjs.mjs +23 -79
  139. package/es/utils/map/index.mjs +2 -8
  140. package/es/utils/map/js/webgis.mjs +12 -12
  141. package/es/version.mjs +1 -1
  142. package/lib/api/device.js +2 -3
  143. package/lib/api/exportExcel.js +62 -0
  144. package/lib/api/index.js +27 -16
  145. package/lib/api/mapRail.js +34 -0
  146. package/lib/api/organization.js +17 -8
  147. package/lib/api/rule.js +33 -0
  148. package/lib/api/sypct.js +2 -3
  149. package/lib/api/task.js +2 -3
  150. package/lib/bussiness/hyAddDepartmentType/addDepartmentType.vue.js +17 -18
  151. package/lib/bussiness/hyAddDepartmentType/style/addDepartmentType.scss +28 -28
  152. package/lib/bussiness/hyElectronicFence/cpns/addElectronicFenceDialog/addElectronicFenceDialog.vue.js +515 -0
  153. package/lib/bussiness/hyElectronicFence/cpns/batchSetElectronicFenceUserDialog/batchSetElectronicFenceUserDialog.vue.js +182 -0
  154. package/lib/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersDialog.vue.js +320 -0
  155. package/lib/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersItem.vue.js +123 -0
  156. package/lib/bussiness/hyElectronicFence/electronicFence.vue.js +362 -0
  157. package/lib/bussiness/hyElectronicFence/index.js +21 -0
  158. package/lib/bussiness/hyElectronicFence/style/electronicFence.scss +0 -0
  159. package/lib/bussiness/hyElectronicFence/style/electronicFenceAssociatedUsersDialog.scss +25 -0
  160. package/lib/bussiness/hyMapAearchPlace/js/index.js +1 -1
  161. package/lib/bussiness/hyMapAearchPlace/mapAearchPlace.vue.js +4 -6
  162. package/lib/bussiness/hyMapAearchPlace/style/mapAearchPlace.scss +4 -3
  163. package/lib/bussiness/hyRuleSetting/cpns/gatheringPeople/gatheringPeople.vue.js +274 -0
  164. package/lib/bussiness/hyRuleSetting/cpns/missionInRule/missionInRule.vue.js +255 -0
  165. package/lib/bussiness/hyRuleSetting/cpns/missionOutRule/missionOutRule.vue.js +255 -0
  166. package/lib/bussiness/hyRuleSetting/cpns/ruleAssignDialog/ruleAssignDialog.vue.js +399 -0
  167. package/lib/bussiness/hyRuleSetting/cpns/ruleFenceDialog/ruleFenceDialog.vue.js +655 -0
  168. package/lib/bussiness/hyRuleSetting/cpns/ruleSettingDialog/ruleSettingDialog.vue.js +361 -0
  169. package/lib/bussiness/hyRuleSetting/cpns/sedentary/sedentary.vue.js +265 -0
  170. package/lib/bussiness/hyRuleSetting/cpns/setRuleAggregationAlarmDialog/setRuleAggregationAlarmDialog.vue.js +364 -0
  171. package/lib/bussiness/hyRuleSetting/cpns/timedVideo/timedVideo.vue.js +244 -0
  172. package/lib/bussiness/hyRuleSetting/cpns/timerCamera/timerCamera.vue.js +262 -0
  173. package/lib/bussiness/hyRuleSetting/cpns/timingReturn/timingReturn.vue.js +244 -0
  174. package/lib/bussiness/hyRuleSetting/index.js +24 -0
  175. package/lib/bussiness/hyRuleSetting/js/ruleSetting.js +68 -0
  176. package/lib/bussiness/hyRuleSetting/ruleSetting.vue.js +133 -0
  177. package/lib/bussiness/hyRuleSetting/style/ruleSetting.scss +0 -0
  178. package/lib/bussiness/index.js +21 -10
  179. package/lib/components/hyAudioPlayer/audioPlayer.vue.js +5 -13
  180. package/lib/components/hyAudioPlayer/js/index.js +9 -14
  181. package/lib/components/hyAudioPlayer/style/audioPlayer.scss +7 -2
  182. package/lib/components/hyButton/button.vue.js +2 -2
  183. package/lib/components/hyButton/style/button.scss +48 -74
  184. package/lib/components/hyCheckboxGroup/checkboxGroup.vue.js +123 -0
  185. package/lib/components/hyCheckboxGroup/index.js +12 -0
  186. package/lib/components/hyCheckboxGroup/style/checkboxGroup.scss +58 -0
  187. package/lib/components/hyConfigProvider/configProvider.vue.js +50 -56
  188. package/lib/components/hyConfirmDialog/confirmDialog.vue.js +56 -61
  189. package/lib/components/hyConfirmDialog/confirmMethod.js +23 -21
  190. package/lib/components/hyCutter/cutter.vue.js +8 -22
  191. package/lib/components/hyDatePicker/datePicker.vue.js +11 -16
  192. package/lib/components/hyDialog/dialog.vue.js +5 -9
  193. package/lib/components/hyDialog/style/dialog.scss +12 -13
  194. package/lib/components/hyDrawer/drawer.vue.js +104 -0
  195. package/lib/components/hyDrawer/index.js +12 -0
  196. package/lib/components/hyDrawer/style/drawer.scss +0 -0
  197. package/lib/components/hyForm/cpns/arrayItem.vue.js +9 -27
  198. package/lib/components/hyForm/cpns/arrayItem2.vue.js +202 -0
  199. package/lib/components/hyForm/cpns/extraItem.vue.js +2 -3
  200. package/lib/components/hyForm/cpns/formItem.vue.js +76 -38
  201. package/lib/components/hyForm/cpns/locationSelect.vue.js +26 -26
  202. package/lib/components/hyForm/form.vue.js +53 -19
  203. package/lib/components/hyForm/js/index.js +3 -7
  204. package/lib/components/hyForm/js/useAppForm.js +5 -9
  205. package/lib/components/hyForm/style/form.scss +4 -13
  206. package/lib/components/hyIcon/icon.vue.js +3 -3
  207. package/lib/components/hyIconBox/style/iconBox.scss +2 -6
  208. package/lib/components/hyInput/inputSearch.vue.js +7 -10
  209. package/lib/components/hyInput/style/inputSearch.scss +3 -0
  210. package/lib/components/hyLoading/index.js +2 -4
  211. package/lib/components/hyMap/js/index.js +29 -4
  212. package/lib/components/hyMap/map.vue.js +17 -3
  213. package/lib/components/hyMenu/style/menu.scss +5 -15
  214. package/lib/components/hyNoPermissions/noPermissions.vue.js +3 -4
  215. package/lib/components/hyNoPermissionsMap/noPermissionsMap.vue.js +3 -6
  216. package/lib/components/hyOrgCascader/js/index.js +1 -5
  217. package/lib/components/hyOrgCascader/orgCascader.vue.js +23 -9
  218. package/lib/components/hyOrgCascader/style/orgCascader.scss +7 -0
  219. package/lib/components/hyRadioGroup/radioGroup.vue.js +47 -40
  220. package/lib/components/hyRadioGroup/style/radioGroup.scss +9 -0
  221. package/lib/components/hySearch/cpns/searchItem.vue.js +33 -20
  222. package/lib/components/hySearch/js/index.js +1 -4
  223. package/lib/components/hySearch/js/useAppSearch.js +6 -10
  224. package/lib/components/hySearch/search.vue.js +9 -16
  225. package/lib/components/hySearch/style/search.scss +2 -0
  226. package/lib/components/hyStatus/index.js +12 -0
  227. package/lib/components/hyStatus/status.vue.js +114 -0
  228. package/lib/components/hyStatus/style/status.scss +0 -0
  229. package/lib/components/hyTable/cpns/columnSelect.vue.js +22 -26
  230. package/lib/components/hyTable/cpns/columnSelectItem.vue.js +7 -8
  231. package/lib/components/hyTable/cpns/headerItem.vue.js +2 -2
  232. package/lib/components/hyTable/cpns/virtualTable.vue.js +17 -27
  233. package/lib/components/hyTable/js/index.js +54 -57
  234. package/lib/components/hyTable/js/useAppTable.js +2 -3
  235. package/lib/components/hyTable/style/table.scss +8 -0
  236. package/lib/components/hyTable/table.vue.js +35 -41
  237. package/lib/components/hyTableActionButton/tableActionButton.vue.js +4 -4
  238. package/lib/components/hyTableForm/batchTableForm.vue.js +3 -7
  239. package/lib/components/hyTableForm/js/index.js +3 -11
  240. package/lib/components/hyTableForm/js/useAppTableForm.js +2 -7
  241. package/lib/components/hyTableForm/style/batchTableForm.scss +26 -54
  242. package/lib/components/hyTableForm/style/tableForm.scss +3 -2
  243. package/lib/components/hyTableForm/tableForm.vue.js +89 -45
  244. package/lib/components/hyTimePicker/timePicker.vue.js +3 -4
  245. package/lib/components/hyTree/js/index.js +13 -40
  246. package/lib/components/hyTree/style/index.css +1 -1
  247. package/lib/components/hyTree/tree.vue.js +17 -16
  248. package/lib/components/hyUserAvatar/userAvatar.vue.js +3 -6
  249. package/lib/components/hyVideoPlayer/js/index.js +14 -23
  250. package/lib/components/hyVideoPlayer/style/videoPlayer.scss +5 -7
  251. package/lib/components/hyVideoPlayer/videoPlayer.vue.js +16 -26
  252. package/lib/components/index.js +46 -40
  253. package/lib/hooks/index.js +17 -0
  254. package/lib/hooks/useAudioPlayerConfig.js +1 -3
  255. package/lib/hooks/useBaseMainStore.js +32 -0
  256. package/lib/hooks/useCurrentBus.js +23 -0
  257. package/lib/hooks/useDialog.js +331 -0
  258. package/lib/hooks/useExportFile.js +135 -0
  259. package/lib/hooks/useGlobalConfig.js +10 -6
  260. package/lib/hooks/useLocale.js +25 -11
  261. package/lib/hooks/usePermissionMap.js +1 -3
  262. package/lib/hooks/useResizeHandler.js +1 -4
  263. package/lib/hooks/useResizeObserver.js +3 -1
  264. package/lib/hooks/useSubscribe.js +2 -1
  265. package/lib/hooks/useUserAvatarMap.js +1 -3
  266. package/lib/hooks/useVideoPlayerConfig.js +1 -3
  267. package/lib/index.js +107 -73
  268. package/lib/locale/{en.js → en_US.js} +81 -5
  269. package/lib/locale/index.js +3 -3
  270. package/lib/locale/zh_CN.js +81 -3
  271. package/lib/style/tailwind.scss +7 -3
  272. package/lib/utils/adaptive.js +1 -3
  273. package/lib/utils/form.js +17 -10
  274. package/lib/utils/handler.js +3 -7
  275. package/lib/utils/input.js +7 -8
  276. package/lib/utils/map/hook/bigMap.js +14 -53
  277. package/lib/utils/map/hook/gaode.js +5 -20
  278. package/lib/utils/map/hook/leafletjs.js +23 -79
  279. package/lib/utils/map/index.js +2 -8
  280. package/lib/utils/map/js/webgis.js +12 -12
  281. package/lib/version.js +1 -1
  282. package/package.json +3 -2
@@ -1,13 +1,11 @@
1
- import { computed, useTemplateRef, ref, resolveComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, renderSlot, unref, toDisplayString, createBlock, withCtx, createVNode, createCommentVNode, normalizeStyle, Fragment, renderList, createSlots, mergeProps } from 'vue';
1
+ import { computed, resolveComponent, openBlock, createElementBlock, createElementVNode, normalizeClass, renderSlot, unref, toDisplayString, createBlock, withCtx, createVNode, createCommentVNode, normalizeStyle, Fragment, renderList, createSlots, mergeProps } from 'vue';
2
2
  import { ElIcon } from 'element-plus';
3
3
  import { Delete, Top, Bottom, CirclePlus } from '@element-plus/icons-vue';
4
- import '../../../hooks/index.mjs';
5
4
  import '../../index.mjs';
6
5
  import '../../../utils/index.mjs';
7
6
  import { isRequired, columnHelpHandler, renderArrayItemLabel, renderAddLabel } from '../js/index.mjs';
8
7
  import _sfc_main$1 from './formItem.vue.mjs';
9
8
  import { resetAppFormValue } from '../js/useAppForm.mjs';
10
- import { useLocale } from '../../../hooks/useLocale.mjs';
11
9
  import { setValueByProp, getValueByProp } from '../../../utils/form.mjs';
12
10
  import { isNumber, isArray } from '../../../utils/is.mjs';
13
11
  import { HyTooltip } from '../../hyTooltip/index.mjs';
@@ -50,7 +48,6 @@ const _sfc_main = {
50
48
  },
51
49
  setup(__props) {
52
50
  const props = __props;
53
- const { t } = useLocale();
54
51
  const bindValue = computed({
55
52
  get() {
56
53
  const prop = props.column.field;
@@ -61,20 +58,6 @@ const _sfc_main = {
61
58
  setValueByProp(props.model, prop, val);
62
59
  }
63
60
  });
64
- const containerRef = useTemplateRef("containerRef");
65
- const containerHeight = ref(0);
66
- const isExpand = ref(false);
67
- const isExpandHover = ref(null);
68
- function onExpandHandler(column) {
69
- containerHeight.value = containerRef.value.clientHeight;
70
- isExpand.value = !isExpand.value;
71
- }
72
- function onExpandMouseenter(column) {
73
- isExpandHover.value = true;
74
- }
75
- function onExpandMouseleave(column) {
76
- isExpandHover.value = false;
77
- }
78
61
  const containerStyle = computed(() => {
79
62
  const columnNum = isNumber(props.column.columnNum) && props.column.columnNum > 0 ? props.column.columnNum : isNumber(props.columnNum) && props.columnNum > 0 ? props.columnNum || 1 : 1;
80
63
  return {
@@ -157,8 +140,10 @@ const _sfc_main = {
157
140
  createElementVNode(
158
141
  "div",
159
142
  {
160
- class: "overflow-y-auto scroll-body",
161
- style: normalizeStyle({ maxHeight: `${__props.column.height || 500}px` })
143
+ class: normalizeClass({ "overflow-y-auto scroll-body": __props.column.height > 0 }),
144
+ style: normalizeStyle({
145
+ maxHeight: __props.column.height > 0 ? `${__props.column.height}px` : void 0
146
+ })
162
147
  },
163
148
  [
164
149
  (openBlock(true), createElementBlock(
@@ -169,7 +154,7 @@ const _sfc_main = {
169
154
  "div",
170
155
  {
171
156
  key: index,
172
- class: normalizeClass(["bg-background-2 rounded-[6px] border border-border my-1.5", [__props.size === "small" ? "px-4 pt-2" : " pt-3 px-5"]])
157
+ class: normalizeClass(["bg-background-2 rounded-[6px] border border-border my-1.5 box-border", [__props.size === "small" ? "px-4 pt-2" : " pt-3 px-5"]])
173
158
  },
174
159
  [
175
160
  createElementVNode("div", { class: "flex items-center min-h-[36px]" }, [
@@ -187,7 +172,7 @@ const _sfc_main = {
187
172
  }, () => [
188
173
  createElementVNode(
189
174
  "span",
190
- { class: "text-auxiliary" },
175
+ { class: "text-auxiliary whitespace-nowrap" },
191
176
  toDisplayString(unref(renderArrayItemLabel)(props, __props.column, index)),
192
177
  1
193
178
  /* TEXT */
@@ -197,7 +182,7 @@ const _sfc_main = {
197
182
  createElementVNode("div", { class: "flex items-center gap-3 ml-auto" }, [
198
183
  bindValue.value.length > 1 || props.column.emptyChildren ? (openBlock(), createElementBlock("div", {
199
184
  key: 0,
200
- class: "clickBox bg-background py-0.5 px-1.5 rounded",
185
+ class: "clickBox bg-background py-0.5 px-1.5 rounded box-border",
201
186
  onClick: ($event) => onDeleteItemHandler(index)
202
187
  }, [
203
188
  createVNode(unref(ElIcon), {
@@ -245,9 +230,6 @@ const _sfc_main = {
245
230
  createElementVNode(
246
231
  "div",
247
232
  {
248
- ref_for: true,
249
- ref_key: "containerRef",
250
- ref: containerRef,
251
233
  class: "grid gap-x-6",
252
234
  style: normalizeStyle(containerStyle.value)
253
235
  },
@@ -298,8 +280,8 @@ const _sfc_main = {
298
280
  /* KEYED_FRAGMENT */
299
281
  ))
300
282
  ],
301
- 4
302
- /* STYLE */
283
+ 6
284
+ /* CLASS, STYLE */
303
285
  ),
304
286
  createElementVNode("div", { class: "flex justify-center mt-2.5" }, [
305
287
  createElementVNode("span", {
@@ -0,0 +1,198 @@
1
+ import { useTemplateRef, ref, computed, onBeforeUnmount, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, createBlock, createSlots, withCtx, renderSlot, mergeProps, createVNode, unref, toDisplayString } from 'vue';
2
+ import '../../index.mjs';
3
+ import '../../../utils/index.mjs';
4
+ import '../../../hooks/index.mjs';
5
+ import { renderAddLabel } from '../js/index.mjs';
6
+ import _sfc_main$1 from './formItem.vue.mjs';
7
+ import { resetAppFormValue } from '../js/useAppForm.mjs';
8
+ import { useResizeObserver } from '../../../hooks/useResizeObserver.mjs';
9
+ import { setValueByProp, getValueByProp } from '../../../utils/form.mjs';
10
+ import { isNumber, isArray } from '../../../utils/is.mjs';
11
+ import { HyIcon } from '../../hyIcon/index.mjs';
12
+
13
+ const _sfc_main = {
14
+ __name: "arrayItem2",
15
+ props: {
16
+ model: {
17
+ type: Object,
18
+ default: () => ({})
19
+ },
20
+ column: {
21
+ type: Object,
22
+ default: () => ({})
23
+ },
24
+ rules: {
25
+ type: Object,
26
+ default: () => ({})
27
+ },
28
+ columnNum: {
29
+ type: Number,
30
+ default: 1
31
+ },
32
+ loading: {
33
+ type: Boolean,
34
+ default: false
35
+ },
36
+ disabled: {
37
+ type: Boolean,
38
+ default: false
39
+ },
40
+ readonly: {
41
+ type: Boolean,
42
+ default: false
43
+ },
44
+ size: {
45
+ type: String,
46
+ default: "default"
47
+ }
48
+ },
49
+ setup(__props) {
50
+ const props = __props;
51
+ const arrayItemRef = useTemplateRef("arrayItemRef");
52
+ const { removeResize } = useResizeObserver(arrayItemRef, () => {
53
+ if (arrayItemRef.value) {
54
+ clientHeight.value = arrayItemRef.value.clientHeight;
55
+ }
56
+ });
57
+ const clientHeight = ref(0);
58
+ const bindValue = computed({
59
+ get() {
60
+ const prop = props.column.field;
61
+ return getValueByProp(props.model, prop);
62
+ },
63
+ set(val) {
64
+ const prop = props.column.field;
65
+ setValueByProp(props.model, prop, val);
66
+ }
67
+ });
68
+ const containerStyle = computed(() => {
69
+ const columnNum = isNumber(props.column.columnNum) && props.column.columnNum > 0 ? props.column.columnNum : isNumber(props.columnNum) && props.columnNum > 0 ? props.columnNum || 1 : 1;
70
+ return {
71
+ gridTemplateColumns: `repeat(${columnNum}, minmax(0, 1fr))`
72
+ };
73
+ });
74
+ function onAddItemHandler() {
75
+ if (!isArray(bindValue.value)) {
76
+ bindValue.value = [];
77
+ }
78
+ bindValue.value.push(resetAppFormValue(props.column.children));
79
+ }
80
+ function onDeleteItemHandler(index) {
81
+ bindValue.value.splice(index, 1);
82
+ }
83
+ onBeforeUnmount(() => {
84
+ removeResize && removeResize();
85
+ });
86
+ return (_ctx, _cache) => {
87
+ return openBlock(), createElementBlock(
88
+ "div",
89
+ {
90
+ ref_key: "arrayItemRef",
91
+ ref: arrayItemRef
92
+ },
93
+ [
94
+ createElementVNode(
95
+ "div",
96
+ {
97
+ class: "absolute w-full bg-background-2 left-0",
98
+ style: normalizeStyle({ height: clientHeight.value ? `${clientHeight.value}px` : void 0 })
99
+ },
100
+ null,
101
+ 4
102
+ /* STYLE */
103
+ ),
104
+ createElementVNode("div", { class: "py-3" }, [
105
+ (openBlock(true), createElementBlock(
106
+ Fragment,
107
+ null,
108
+ renderList(bindValue.value, (item, index) => {
109
+ return openBlock(), createElementBlock("div", {
110
+ key: index,
111
+ class: "relative"
112
+ }, [
113
+ createElementVNode(
114
+ "div",
115
+ {
116
+ class: "grid gap-x-6",
117
+ style: normalizeStyle(containerStyle.value)
118
+ },
119
+ [
120
+ (openBlock(true), createElementBlock(
121
+ Fragment,
122
+ null,
123
+ renderList(__props.column.children, (citem, cindex) => {
124
+ return openBlock(), createBlock(_sfc_main$1, {
125
+ key: cindex,
126
+ model: item,
127
+ column: citem,
128
+ rules: __props.rules,
129
+ "parent-prop": __props.column.field,
130
+ index,
131
+ loading: __props.loading,
132
+ size: __props.size,
133
+ disabled: __props.disabled,
134
+ readonly: __props.readonly,
135
+ level: 3
136
+ }, createSlots({
137
+ _: 2
138
+ /* DYNAMIC */
139
+ }, [
140
+ renderList(_ctx.$slots, (_, slotName) => {
141
+ return {
142
+ name: slotName,
143
+ fn: withCtx((scope) => [
144
+ renderSlot(_ctx.$slots, slotName, mergeProps({ ref_for: true }, scope))
145
+ ])
146
+ };
147
+ })
148
+ ]), 1032, ["model", "column", "rules", "parent-prop", "index", "loading", "size", "disabled", "readonly"]);
149
+ }),
150
+ 128
151
+ /* KEYED_FRAGMENT */
152
+ ))
153
+ ],
154
+ 4
155
+ /* STYLE */
156
+ ),
157
+ createElementVNode("div", {
158
+ class: "w-[32px] h-[32px] flex items-center justify-center bg-[rgba(var(--hy-danger-2),0.2)] clickBox rounded absolute top-[32px] -right-2 transform translate-x-full",
159
+ onClick: ($event) => onDeleteItemHandler(index)
160
+ }, [
161
+ createVNode(unref(HyIcon), {
162
+ "svg-name": "ops-linear-delete",
163
+ class: "!w-5 !h-5 text-danger-2"
164
+ })
165
+ ], 8, ["onClick"])
166
+ ]);
167
+ }),
168
+ 128
169
+ /* KEYED_FRAGMENT */
170
+ )),
171
+ createElementVNode("div", { class: "flex items-center" }, [
172
+ createElementVNode("span", {
173
+ onClick: ($event) => onAddItemHandler(),
174
+ class: "flex items-center justify-center clickBox text-success text-xs"
175
+ }, [
176
+ createVNode(unref(HyIcon), {
177
+ "svg-name": "ops-button-add",
178
+ class: "!w-3 !h-3"
179
+ }),
180
+ createElementVNode(
181
+ "span",
182
+ { style: { "margin-left": "6px" } },
183
+ toDisplayString(unref(renderAddLabel)(props, __props.column)),
184
+ 1
185
+ /* TEXT */
186
+ )
187
+ ], 8, ["onClick"])
188
+ ])
189
+ ])
190
+ ],
191
+ 512
192
+ /* NEED_PATCH */
193
+ );
194
+ };
195
+ }
196
+ };
197
+
198
+ export { _sfc_main as default };
@@ -4,8 +4,8 @@ import { DArrowRight } from '@element-plus/icons-vue';
4
4
  import '../../../hooks/index.mjs';
5
5
  import '../../../utils/index.mjs';
6
6
  import _sfc_main$1 from './formItem.vue.mjs';
7
- import { useLocale } from '../../../hooks/useLocale.mjs';
8
7
  import { isNumber } from '../../../utils/is.mjs';
8
+ import { $t } from '../../../hooks/useLocale.mjs';
9
9
 
10
10
  const _sfc_main = {
11
11
  __name: "extraItem",
@@ -45,7 +45,6 @@ const _sfc_main = {
45
45
  },
46
46
  setup(__props) {
47
47
  const props = __props;
48
- const { t } = useLocale();
49
48
  const containerRef = useTemplateRef("containerRef");
50
49
  const containerHeight = ref(0);
51
50
  const isExpand = ref(false);
@@ -88,7 +87,7 @@ const _sfc_main = {
88
87
  createElementVNode(
89
88
  "span",
90
89
  { class: "ml-1.5" },
91
- toDisplayString(isExpandHover.value ? unref(t)("form.additionalInformationHoverTip") : unref(t)("form.additionalInformationTip")),
90
+ toDisplayString(isExpandHover.value ? unref($t)("form.additionalInformationHoverTip") : unref($t)("form.additionalInformationTip")),
92
91
  1
93
92
  /* TEXT */
94
93
  )
@@ -1,19 +1,20 @@
1
- import { inject, useTemplateRef, computed, reactive, toRefs, onMounted, watch, onBeforeUnmount, unref, openBlock, createElementBlock, normalizeClass, normalizeStyle, createBlock, createSlots, withCtx, createElementVNode, renderSlot, toDisplayString, createCommentVNode, createVNode, Fragment, mergeProps } from 'vue';
1
+ import { inject, useTemplateRef, computed, unref, reactive, toRefs, onMounted, watch, onBeforeUnmount, openBlock, createElementBlock, normalizeClass, normalizeStyle, createBlock, createSlots, withCtx, createElementVNode, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createVNode, Fragment, mergeProps } from 'vue';
2
2
  import { ElFormItem, ElSelect, ElIcon, ElSelectV2, ElRadioGroup, ElCheckboxGroup, ElSwitch, ElInputNumber, ElCascader } from 'element-plus';
3
3
  import { Loading } from '@element-plus/icons-vue';
4
4
  import '../../../utils/index.mjs';
5
5
  import '../../index.mjs';
6
6
  import { formContextKey, optionsHandler, isRequired, columnVisibleHandler, columnItemStyle, columnShowHandler, columnHelpHandler, isReadonly, renderText, isDisabled } from '../js/index.mjs';
7
7
  import '../../../hooks/index.mjs';
8
- import { useLocale } from '../../../hooks/useLocale.mjs';
9
8
  import { isBoolean, isArray } from '../../../utils/is.mjs';
10
9
  import { setValueByProp, getValueByProp, columnPlaceholderHandler, columnLabelHandler, columnRuleHandler } from '../../../utils/form.mjs';
11
10
  import { HyTooltip } from '../../hyTooltip/index.mjs';
12
11
  import { HyIcon } from '../../hyIcon/index.mjs';
12
+ import { $t } from '../../../hooks/useLocale.mjs';
13
13
  import { HyInput } from '../../hyInput/index.mjs';
14
14
  import { HyDatePicker } from '../../hyDatePicker/index.mjs';
15
15
  import { HyTimePicker } from '../../hyTimePicker/index.mjs';
16
16
  import { HyRadioGroup } from '../../hyRadioGroup/index.mjs';
17
+ import { HyCheckboxGroup } from '../../hyCheckboxGroup/index.mjs';
17
18
  import { HyOrgCascader } from '../../hyOrgCascader/index.mjs';
18
19
 
19
20
  const _sfc_main = {
@@ -59,7 +60,6 @@ const _sfc_main = {
59
60
  }
60
61
  },
61
62
  setup(__props) {
62
- const { t } = useLocale();
63
63
  const props = __props;
64
64
  const formContext = inject(formContextKey);
65
65
  const formItemRef = useTemplateRef("formItemRef");
@@ -111,8 +111,16 @@ const _sfc_main = {
111
111
  };
112
112
  });
113
113
  const columnAttrs = computed(() => {
114
+ const attrs = props.column.attrs || {};
115
+ const config = {};
116
+ if (props.column.type === "input") {
117
+ if (attrs.type === "text" && unref(formContext.business) !== "tableForm") {
118
+ config.maxlength = 255;
119
+ }
120
+ }
114
121
  return {
115
- ...props.column.attrs,
122
+ ...config,
123
+ ...attrs,
116
124
  label: columnLabelHandler(props.column, props.model),
117
125
  placeholder: columnPlaceholderHandler(props.column, props.model)
118
126
  };
@@ -121,19 +129,14 @@ const _sfc_main = {
121
129
  return new Promise(async (resolve, reject) => {
122
130
  if (props.column.optionsFn) {
123
131
  if (!props.column.optionsFn) return;
124
- props.column.optionsLoading = true;
125
- props.column.optionsError = "";
126
- props.column.attrs.options = [];
132
+ onRequesting();
127
133
  if (!(isMountedLoad && props.column.isDefaultGetData === false)) {
128
134
  try {
129
- props.column.attrs.options = await props.column.optionsFn(
130
- props.column,
131
- props.model
132
- );
133
- props.column.optionsError = "";
135
+ const options = await props.column.optionsFn(props.column, props.model);
136
+ onFulfilled(options);
134
137
  resolve();
135
138
  } catch (err) {
136
- props.column.optionsError = "error";
139
+ onRejected();
137
140
  console.error(err);
138
141
  reject();
139
142
  }
@@ -142,13 +145,14 @@ const _sfc_main = {
142
145
  }
143
146
  } else if (props.column.type === "org-cascader") {
144
147
  if (orgCascaderRef.value) {
145
- props.column.optionsLoading = true;
146
- props.column.optionsError = "";
147
148
  try {
149
+ onRequesting();
148
150
  await orgCascaderRef.value.getData();
151
+ onFulfilled();
149
152
  resolve();
150
153
  } catch {
151
154
  props.column.optionsError = "error";
155
+ onRejected();
152
156
  reject();
153
157
  }
154
158
  } else {
@@ -160,6 +164,21 @@ const _sfc_main = {
160
164
  props.column.optionsLoading = false;
161
165
  });
162
166
  }
167
+ function onRequesting() {
168
+ props.column.optionsLoading = true;
169
+ props.column.optionsError = "";
170
+ props.column.attrs.options = [];
171
+ }
172
+ function onFulfilled(options = []) {
173
+ props.column.optionsLoading = false;
174
+ props.column.optionsError = "";
175
+ props.column.attrs.options = options;
176
+ }
177
+ function onRejected() {
178
+ props.column.optionsLoading = false;
179
+ props.column.optionsError = "error";
180
+ props.column.attrs.options = [];
181
+ }
163
182
  function getOptionsHandler(props2, column) {
164
183
  if (props2.column.optionsLoading) {
165
184
  return [];
@@ -170,7 +189,7 @@ const _sfc_main = {
170
189
  if (!isRequired(props, column) && formItemRef.value) {
171
190
  formItemRef.value.clearValidate();
172
191
  }
173
- return columnRuleHandler(column, model);
192
+ return columnRuleHandler(column, model, { business: unref(formContext.business) });
174
193
  }
175
194
  function onChangeHandler() {
176
195
  const { onChange } = props.column;
@@ -243,18 +262,18 @@ const _sfc_main = {
243
262
  default: withCtx(() => [
244
263
  createElementVNode("div", { class: "w-full flex justify-between text-main" }, [
245
264
  createElementVNode("div", { class: "flex items-center" }, [
246
- renderSlot(_ctx.$slots, __props.column.labelSlot, {
247
- column: columnConfig.value,
248
- model: __props.model,
249
- required: unref(isRequired)(props, __props.column)
250
- }, () => [
251
- createElementVNode(
252
- "span",
253
- { class: "text-main" },
254
- toDisplayString(unref(columnLabelHandler)(__props.column, props.model) || "\xA0"),
255
- 1
256
- /* TEXT */
257
- )
265
+ createElementVNode("span", { class: "text-main whitespace-nowrap" }, [
266
+ renderSlot(_ctx.$slots, __props.column.labelSlot, {
267
+ column: columnConfig.value,
268
+ model: __props.model,
269
+ required: unref(isRequired)(props, __props.column)
270
+ }, () => [
271
+ createTextVNode(
272
+ toDisplayString(unref(columnLabelHandler)(__props.column, props.model) || "\xA0"),
273
+ 1
274
+ /* TEXT */
275
+ )
276
+ ])
258
277
  ]),
259
278
  unref(isRequired)(props, __props.column) ? (openBlock(), createElementBlock("span", {
260
279
  key: 0,
@@ -288,7 +307,7 @@ const _sfc_main = {
288
307
  createElementVNode(
289
308
  "span",
290
309
  null,
291
- toDisplayString(unref(t)("hy.help")),
310
+ toDisplayString(unref($t)("hy.help")),
292
311
  1
293
312
  /* TEXT */
294
313
  )
@@ -313,7 +332,7 @@ const _sfc_main = {
313
332
  "div",
314
333
  {
315
334
  key: 0,
316
- class: normalizeClass(["w-full flex items-center text-main px-2", {
335
+ class: normalizeClass(["w-full flex items-center text-main px-2 box-border", {
317
336
  "min-h-[40px]": __props.size === "large",
318
337
  "min-h-[32px]": __props.size === "default",
319
338
  "min-h-[24px]": __props.size === "small",
@@ -448,9 +467,7 @@ const _sfc_main = {
448
467
  { key: 4 },
449
468
  [
450
469
  createCommentVNode(" \u65E5\u671F\u9009\u62E9\u6846 "),
451
- ["datetimerange", "daterange", "monthrange", "yearrange"].includes(
452
- columnAttrs.value?.type
453
- ) && unref(isArray)(__props.column.field) ? (openBlock(), createBlock(unref(HyDatePicker), mergeProps({
470
+ ["datetimerange", "daterange", "monthrange", "yearrange"].includes(columnAttrs.value?.type) && unref(isArray)(__props.column.field) ? (openBlock(), createBlock(unref(HyDatePicker), mergeProps({
454
471
  key: 0,
455
472
  start: bindValue.value,
456
473
  "onUpdate:start": ($event) => bindValue.value = $event,
@@ -556,9 +573,26 @@ const _sfc_main = {
556
573
  ],
557
574
  2112
558
575
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
559
- )) : __props.column.type === "switch" ? (openBlock(), createElementBlock(
576
+ )) : __props.column.type === "checkbox-group" ? (openBlock(), createElementBlock(
560
577
  Fragment,
561
578
  { key: 9 },
579
+ [
580
+ createCommentVNode(" \u591A\u9009\u6309\u94AE "),
581
+ createVNode(unref(HyCheckboxGroup), mergeProps({
582
+ modelValue: bindValue.value,
583
+ "onUpdate:modelValue": ($event) => bindValue.value = $event
584
+ }, columnAttrs.value, {
585
+ disabled: unref(isDisabled)(props, __props.column),
586
+ options: getOptionsHandler(props, __props.column),
587
+ size: __props.size,
588
+ onChange: onChangeHandler
589
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "options", "size"])
590
+ ],
591
+ 2112
592
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
593
+ )) : __props.column.type === "switch" ? (openBlock(), createElementBlock(
594
+ Fragment,
595
+ { key: 10 },
562
596
  [
563
597
  createCommentVNode(" \u5F00\u5173 "),
564
598
  createVNode(unref(ElSwitch), mergeProps({
@@ -576,7 +610,7 @@ const _sfc_main = {
576
610
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
577
611
  )) : __props.column.type === "input-number" ? (openBlock(), createElementBlock(
578
612
  Fragment,
579
- { key: 10 },
613
+ { key: 11 },
580
614
  [
581
615
  createCommentVNode(" \u6570\u5B57\u8F93\u5165\u6846 "),
582
616
  createVNode(unref(ElInputNumber), mergeProps({
@@ -591,7 +625,7 @@ const _sfc_main = {
591
625
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
592
626
  )) : __props.column.type === "org-cascader" ? (openBlock(), createElementBlock(
593
627
  Fragment,
594
- { key: 11 },
628
+ { key: 12 },
595
629
  [
596
630
  createCommentVNode(" \u90E8\u95E8\u7EA7\u8054\u9009\u62E9\u6846 "),
597
631
  createVNode(unref(HyOrgCascader), mergeProps({
@@ -602,6 +636,10 @@ const _sfc_main = {
602
636
  class: "w-full"
603
637
  }, columnAttrs.value, {
604
638
  disabled: unref(isDisabled)(props, __props.column),
639
+ defaultGetData: false,
640
+ onRequesting,
641
+ onFulfilled,
642
+ onRejected,
605
643
  onChange: onChangeHandler
606
644
  }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])
607
645
  ],
@@ -609,7 +647,7 @@ const _sfc_main = {
609
647
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
610
648
  )) : __props.column.type === "cascader" ? (openBlock(), createElementBlock(
611
649
  Fragment,
612
- { key: 12 },
650
+ { key: 13 },
613
651
  [
614
652
  createCommentVNode(" \u7EA7\u8054\u9009\u62E9\u6846 "),
615
653
  createVNode(unref(ElCascader), mergeProps({
@@ -1,10 +1,8 @@
1
1
  import { useTemplateRef, computed, onBeforeUnmount, openBlock, createElementBlock, createElementVNode, normalizeStyle, Fragment, renderList, createBlock, createSlots, withCtx, createVNode, unref, mergeProps, withKeys, renderSlot, normalizeClass, withModifiers, toDisplayString } from 'vue';
2
2
  import { ElMessage } from 'element-plus';
3
- import '../../../hooks/index.mjs';
4
3
  import '../../../utils/index.mjs';
5
4
  import '../../index.mjs';
6
5
  import _sfc_main$1 from './formItem.vue.mjs';
7
- import { useLocale } from '../../../hooks/useLocale.mjs';
8
6
  import { isArray, isNumber } from '../../../utils/is.mjs';
9
7
  import { setValueByProp, getValueByProp } from '../../../utils/form.mjs';
10
8
  import { setPoiServer } from '../../../utils/map/index.mjs';
@@ -56,7 +54,6 @@ const _sfc_main = {
56
54
  setup(__props, { expose: __expose, emit: __emit }) {
57
55
  const props = __props;
58
56
  const emits = __emit;
59
- const { t } = useLocale();
60
57
  const containerRef = useTemplateRef("containerRef");
61
58
  const addressValue = computed({
62
59
  get() {
@@ -155,10 +152,7 @@ const _sfc_main = {
155
152
  console.log(results);
156
153
  if (results && results.length) {
157
154
  const geographicalPosition = results[0];
158
- throughCoordinatePosition(
159
- geographicalPosition.lng,
160
- geographicalPosition.lat
161
- );
155
+ throughCoordinatePosition(geographicalPosition.lng, geographicalPosition.lat);
162
156
  } else {
163
157
  ElMessage.error("\u6CA1\u6709\u627E\u5230\u641C\u7D22\u5730\u7406\u4F4D\u7F6E");
164
158
  }
@@ -168,22 +162,26 @@ const _sfc_main = {
168
162
  });
169
163
  }
170
164
  function throughCoordinatePosition(lng, lat) {
171
- poiServer.geocoderFormat({
172
- lat,
173
- lng
174
- }).then(({ results }) => {
175
- geographicalPositionFn({
176
- lng,
177
- lat,
178
- address: results.address,
179
- name: results.address
180
- });
181
- }).catch(() => {
182
- geographicalPositionFn({
183
- lng,
165
+ return new Promise((resolve) => {
166
+ poiServer.geocoderFormat({
184
167
  lat,
185
- address: `${Number(lat).toFixed(6)}\u3001${Number(lng).toFixed(6)}`,
186
- name: `${Number(lat).toFixed(6)}\u3001${Number(lng).toFixed(6)}`
168
+ lng
169
+ }).then(({ results }) => {
170
+ geographicalPositionFn({
171
+ lng,
172
+ lat,
173
+ address: results.address,
174
+ name: results.address
175
+ });
176
+ resolve(200);
177
+ }).catch(() => {
178
+ geographicalPositionFn({
179
+ lng,
180
+ lat,
181
+ address: `${Number(lat).toFixed(6)}\u3001${Number(lng).toFixed(6)}`,
182
+ name: `${Number(lat).toFixed(6)}\u3001${Number(lng).toFixed(6)}`
183
+ });
184
+ resolve(200);
187
185
  });
188
186
  });
189
187
  }
@@ -210,7 +208,7 @@ const _sfc_main = {
210
208
  });
211
209
  emits("complete");
212
210
  }
213
- function setMarker({ lat, lng }) {
211
+ async function setMarker({ lat, lng }, getAddress = false) {
214
212
  if (marker) {
215
213
  marker.setLatLng({ lat, lng });
216
214
  map.setView({ lat, lng }, mapConfig.maxZoom || 18);
@@ -231,6 +229,10 @@ const _sfc_main = {
231
229
  marker.addTo(map);
232
230
  map.setView({ lat, lng }, mapConfig.maxZoom || 18);
233
231
  }
232
+ if (getAddress) {
233
+ await throughCoordinatePosition(lng, lat);
234
+ }
235
+ return 200;
234
236
  }
235
237
  function clearMarker() {
236
238
  if (marker) {
@@ -338,9 +340,7 @@ const _sfc_main = {
338
340
  createElementVNode(
339
341
  "div",
340
342
  {
341
- class: normalizeClass(["z-20 cursor-pointer absolute rounded top-2 right-2 w-[110px] h-8 border bg-background/70 text-xs flex items-center justify-center gap-1", [
342
- __props.allMapSelect ? "border-theme text-theme" : "border-border/50 text-main"
343
- ]]),
343
+ class: normalizeClass(["z-20 cursor-pointer absolute rounded top-2 right-2 w-[110px] h-8 border bg-background/70 text-xs flex items-center justify-center gap-1", [__props.allMapSelect ? "border-theme text-theme" : "border-border/50 text-main"]]),
344
344
  onClick: withModifiers(setMapSize, ["stop"])
345
345
  },
346
346
  [