hy-dispatch-ui-v3 0.2.61 → 0.2.63

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 (245) hide show
  1. package/dist/tailwind.css +70 -5
  2. package/es/api/device.mjs +19 -0
  3. package/es/api/index.mjs +2 -1
  4. package/es/api/sypct.mjs +19 -0
  5. package/es/api/task.mjs +19 -0
  6. package/es/bussiness/hyAddDepartmentType/addDepartmentType.vue.mjs +6 -3
  7. package/es/bussiness/hyAddDepartmentType/index.mjs +1 -0
  8. package/es/bussiness/hyMapAearchPlace/index.mjs +7 -0
  9. package/es/bussiness/hyMapAearchPlace/js/index.mjs +650 -0
  10. package/es/bussiness/hyMapAearchPlace/mapAearchPlace.vue.mjs +366 -0
  11. package/es/bussiness/hyMapAearchPlace/mapAearchPlaceItem.vue.mjs +101 -0
  12. package/es/bussiness/hyMapAearchPlace/style/mapAearchPlace.scss +71 -0
  13. package/es/bussiness/index.mjs +1 -0
  14. package/es/components/hyAudioPlayer/audioPlayer.vue.mjs +3 -0
  15. package/es/components/hyAudioPlayer/index.mjs +1 -0
  16. package/es/components/hyAudioPlayer/js/index.mjs +5 -1
  17. package/es/components/hyBatchUploadDialog/batchUploadDialog.vue.mjs +23 -3
  18. package/es/components/hyBatchUploadDialog/index.mjs +1 -0
  19. package/es/components/hyButton/button.vue.mjs +3 -2
  20. package/es/components/hyButton/index.mjs +1 -0
  21. package/es/components/hyButton/style/button.scss +10 -3
  22. package/es/components/hyConfigProvider/configProvider.vue.mjs +6 -1
  23. package/es/components/hyConfigProvider/index.mjs +1 -0
  24. package/es/components/hyConfirmDialog/confirmDialog.vue.mjs +6 -2
  25. package/es/components/hyConfirmDialog/confirmMethod.mjs +5 -3
  26. package/es/components/hyConfirmDialog/index.mjs +1 -0
  27. package/es/components/hyCutter/cutter.vue.mjs +5 -2
  28. package/es/components/hyCutter/index.mjs +1 -0
  29. package/es/components/hyDatePicker/datePicker.vue.mjs +2 -0
  30. package/es/components/hyDatePicker/index.mjs +1 -0
  31. package/es/components/hyDialog/dialog.vue.mjs +98 -14
  32. package/es/components/hyDialog/index.mjs +1 -0
  33. package/es/components/hyForm/cpns/arrayItem.vue.mjs +16 -3
  34. package/es/components/hyForm/cpns/extraItem.vue.mjs +2 -0
  35. package/es/components/hyForm/cpns/formItem.vue.mjs +4 -1
  36. package/es/components/hyForm/cpns/locationSelect.vue.mjs +6 -1
  37. package/es/components/hyForm/form.vue.mjs +3 -0
  38. package/es/components/hyForm/index.mjs +1 -0
  39. package/es/components/hyForm/js/index.mjs +3 -1
  40. package/es/components/hyForm/js/useAppForm.mjs +4 -2
  41. package/es/components/hyIcon/icon.vue.mjs +2 -1
  42. package/es/components/hyIcon/index.mjs +1 -0
  43. package/es/components/hyIconBox/iconBox.vue.mjs +1 -0
  44. package/es/components/hyIconBox/index.mjs +1 -0
  45. package/es/components/hyInput/index.mjs +1 -0
  46. package/es/components/hyInput/input.vue.mjs +3 -1
  47. package/es/components/hyInput/inputSearch.vue.mjs +2 -1
  48. package/es/components/hyLoading/index.mjs +41 -0
  49. package/es/components/hyMap/index.mjs +1 -0
  50. package/es/components/hyMap/js/index.mjs +82 -0
  51. package/es/components/hyMap/map.vue.mjs +11 -3
  52. package/es/components/hyMenu/index.mjs +1 -0
  53. package/es/components/hyMenu/menu.vue.mjs +4 -0
  54. package/es/components/hyNoPermissions/index.mjs +1 -0
  55. package/es/components/hyNoPermissions/noPermissions.vue.mjs +4 -0
  56. package/es/components/hyNoPermissionsMap/index.mjs +1 -0
  57. package/es/components/hyNoPermissionsMap/noPermissionsMap.vue.mjs +4 -0
  58. package/es/components/hyOrgCascader/index.mjs +1 -0
  59. package/es/components/hyOrgCascader/js/index.mjs +2 -0
  60. package/es/components/hyOrgCascader/orgCascader.vue.mjs +2 -1
  61. package/es/components/hyRadioGroup/index.mjs +1 -0
  62. package/es/components/hyRadioGroup/radioGroup.vue.mjs +2 -2
  63. package/es/components/hySearch/cpns/searchItem.vue.mjs +20 -2
  64. package/es/components/hySearch/index.mjs +1 -0
  65. package/es/components/hySearch/js/index.mjs +4 -2
  66. package/es/components/hySearch/js/useAppSearch.mjs +4 -2
  67. package/es/components/hySearch/search.vue.mjs +3 -0
  68. package/es/components/hyTable/cpns/columnSelect.vue.mjs +6 -3
  69. package/es/components/hyTable/cpns/columnSelectItem.vue.mjs +3 -0
  70. package/es/components/hyTable/cpns/headerItem.vue.mjs +3 -0
  71. package/es/components/hyTable/cpns/virtualTable.vue.mjs +7 -2
  72. package/es/components/hyTable/index.mjs +1 -0
  73. package/es/components/hyTable/js/index.mjs +10 -10
  74. package/es/components/hyTable/js/search.mjs +2 -0
  75. package/es/components/hyTable/js/useAppTable.mjs +5 -2
  76. package/es/components/hyTable/table.vue.mjs +11 -1
  77. package/es/components/hyTableActionButton/index.mjs +1 -0
  78. package/es/components/hyTableActionButton/tableActionButton.vue.mjs +5 -2
  79. package/es/components/hyTableForm/batchTableForm.vue.mjs +41 -61
  80. package/es/components/hyTableForm/index.mjs +1 -0
  81. package/es/components/hyTableForm/js/index.mjs +13 -27
  82. package/es/components/hyTableForm/js/useAppTableForm.mjs +2 -0
  83. package/es/components/hyTableForm/tableForm.vue.mjs +12 -4
  84. package/es/components/hyTimePicker/index.mjs +1 -0
  85. package/es/components/hyTimePicker/timePicker.vue.mjs +3 -1
  86. package/es/components/hyTooltip/index.mjs +1 -0
  87. package/es/components/hyTooltip/tooltip.vue.mjs +4 -2
  88. package/es/components/hyTree/index.mjs +1 -0
  89. package/es/components/hyTree/js/index.mjs +15 -2
  90. package/es/components/hyTree/tree.vue.mjs +9 -4
  91. package/es/components/hyUserAvatar/index.mjs +1 -0
  92. package/es/components/hyUserAvatar/userAvatar.vue.mjs +5 -1
  93. package/es/components/hyVideoPlayer/cpns/mediaLoading.vue.mjs +1 -0
  94. package/es/components/hyVideoPlayer/index.mjs +1 -0
  95. package/es/components/hyVideoPlayer/js/index.mjs +7 -2
  96. package/es/components/hyVideoPlayer/videoPlayer.vue.mjs +3 -0
  97. package/es/components/index.mjs +1 -0
  98. package/es/hooks/index.mjs +1 -0
  99. package/es/hooks/useGlobalConfig.mjs +6 -1
  100. package/es/hooks/useLocale.mjs +4 -2
  101. package/es/hooks/useMapConfig.mjs +18 -0
  102. package/es/hooks/useResizeHandler.mjs +1 -0
  103. package/es/hooks/useResizeObserver.mjs +1 -1
  104. package/es/index.mjs +8 -0
  105. package/es/locale/en.mjs +1 -2
  106. package/es/locale/zh_CN.mjs +1 -2
  107. package/es/make-installer.mjs +1 -0
  108. package/es/static/hy-svg-icons/hy-icon-ops-list-editorialdownsizing.js +14 -0
  109. package/es/static/hy-svg-icons/hy-icon-ops-list-suoxiao.js +14 -0
  110. package/es/style/element/hy-element.scss +10 -1
  111. package/es/utils/file.mjs +1 -0
  112. package/es/utils/form.mjs +6 -1
  113. package/es/utils/handler.mjs +2 -0
  114. package/es/utils/index.mjs +2 -0
  115. package/es/utils/input.mjs +1 -0
  116. package/es/utils/is.mjs +1 -0
  117. package/es/utils/map/hook/bigMap.mjs +3 -2
  118. package/es/utils/map/hook/gaode.mjs +2 -2
  119. package/es/utils/map/hook/leafletjs.mjs +7 -1
  120. package/es/utils/map/index.mjs +12 -0
  121. package/es/utils/map/js/webgis.mjs +5 -2
  122. package/es/utils/sharedContent.mjs +12 -0
  123. package/es/version.mjs +1 -1
  124. package/lib/api/device.js +21 -0
  125. package/lib/api/index.js +2 -1
  126. package/lib/api/sypct.js +21 -0
  127. package/lib/api/task.js +21 -0
  128. package/lib/bussiness/hyAddDepartmentType/addDepartmentType.vue.js +15 -12
  129. package/lib/bussiness/hyAddDepartmentType/index.js +1 -0
  130. package/lib/bussiness/hyMapAearchPlace/index.js +12 -0
  131. package/lib/bussiness/hyMapAearchPlace/js/index.js +652 -0
  132. package/lib/bussiness/hyMapAearchPlace/mapAearchPlace.vue.js +370 -0
  133. package/lib/bussiness/hyMapAearchPlace/mapAearchPlaceItem.vue.js +105 -0
  134. package/lib/bussiness/hyMapAearchPlace/style/mapAearchPlace.scss +71 -0
  135. package/lib/bussiness/index.js +2 -0
  136. package/lib/components/hyAudioPlayer/audioPlayer.vue.js +3 -0
  137. package/lib/components/hyAudioPlayer/index.js +1 -0
  138. package/lib/components/hyAudioPlayer/js/index.js +5 -1
  139. package/lib/components/hyBatchUploadDialog/batchUploadDialog.vue.js +23 -3
  140. package/lib/components/hyBatchUploadDialog/index.js +1 -0
  141. package/lib/components/hyButton/button.vue.js +2 -1
  142. package/lib/components/hyButton/index.js +1 -0
  143. package/lib/components/hyButton/style/button.scss +10 -3
  144. package/lib/components/hyConfigProvider/configProvider.vue.js +5 -0
  145. package/lib/components/hyConfigProvider/index.js +1 -0
  146. package/lib/components/hyConfirmDialog/confirmDialog.vue.js +6 -2
  147. package/lib/components/hyConfirmDialog/confirmMethod.js +5 -3
  148. package/lib/components/hyConfirmDialog/index.js +1 -0
  149. package/lib/components/hyCutter/cutter.vue.js +3 -0
  150. package/lib/components/hyCutter/index.js +1 -0
  151. package/lib/components/hyDatePicker/datePicker.vue.js +2 -0
  152. package/lib/components/hyDatePicker/index.js +1 -0
  153. package/lib/components/hyDialog/dialog.vue.js +96 -12
  154. package/lib/components/hyDialog/index.js +1 -0
  155. package/lib/components/hyForm/cpns/arrayItem.vue.js +16 -3
  156. package/lib/components/hyForm/cpns/extraItem.vue.js +2 -0
  157. package/lib/components/hyForm/cpns/formItem.vue.js +3 -0
  158. package/lib/components/hyForm/cpns/locationSelect.vue.js +6 -1
  159. package/lib/components/hyForm/form.vue.js +3 -0
  160. package/lib/components/hyForm/index.js +1 -0
  161. package/lib/components/hyForm/js/index.js +3 -1
  162. package/lib/components/hyForm/js/useAppForm.js +3 -1
  163. package/lib/components/hyIcon/icon.vue.js +1 -0
  164. package/lib/components/hyIcon/index.js +1 -0
  165. package/lib/components/hyIconBox/iconBox.vue.js +1 -0
  166. package/lib/components/hyIconBox/index.js +1 -0
  167. package/lib/components/hyInput/index.js +1 -0
  168. package/lib/components/hyInput/input.vue.js +2 -0
  169. package/lib/components/hyInput/inputSearch.vue.js +1 -0
  170. package/lib/components/hyLoading/index.js +47 -0
  171. package/lib/components/hyMap/index.js +1 -0
  172. package/lib/components/hyMap/js/index.js +82 -0
  173. package/lib/components/hyMap/map.vue.js +11 -3
  174. package/lib/components/hyMenu/index.js +1 -0
  175. package/lib/components/hyMenu/menu.vue.js +4 -0
  176. package/lib/components/hyNoPermissions/index.js +1 -0
  177. package/lib/components/hyNoPermissions/noPermissions.vue.js +4 -0
  178. package/lib/components/hyNoPermissionsMap/index.js +1 -0
  179. package/lib/components/hyNoPermissionsMap/noPermissionsMap.vue.js +4 -0
  180. package/lib/components/hyOrgCascader/index.js +1 -0
  181. package/lib/components/hyOrgCascader/js/index.js +2 -0
  182. package/lib/components/hyOrgCascader/orgCascader.vue.js +2 -1
  183. package/lib/components/hyRadioGroup/index.js +1 -0
  184. package/lib/components/hyRadioGroup/radioGroup.vue.js +1 -1
  185. package/lib/components/hySearch/cpns/searchItem.vue.js +18 -0
  186. package/lib/components/hySearch/index.js +1 -0
  187. package/lib/components/hySearch/js/index.js +3 -1
  188. package/lib/components/hySearch/js/useAppSearch.js +4 -2
  189. package/lib/components/hySearch/search.vue.js +3 -0
  190. package/lib/components/hyTable/cpns/columnSelect.vue.js +4 -1
  191. package/lib/components/hyTable/cpns/columnSelectItem.vue.js +3 -0
  192. package/lib/components/hyTable/cpns/headerItem.vue.js +3 -0
  193. package/lib/components/hyTable/cpns/virtualTable.vue.js +6 -1
  194. package/lib/components/hyTable/index.js +1 -0
  195. package/lib/components/hyTable/js/index.js +9 -9
  196. package/lib/components/hyTable/js/search.js +2 -0
  197. package/lib/components/hyTable/js/useAppTable.js +4 -1
  198. package/lib/components/hyTable/table.vue.js +11 -1
  199. package/lib/components/hyTableActionButton/index.js +1 -0
  200. package/lib/components/hyTableActionButton/tableActionButton.vue.js +4 -1
  201. package/lib/components/hyTableForm/batchTableForm.vue.js +42 -62
  202. package/lib/components/hyTableForm/index.js +1 -0
  203. package/lib/components/hyTableForm/js/index.js +12 -27
  204. package/lib/components/hyTableForm/js/useAppTableForm.js +2 -0
  205. package/lib/components/hyTableForm/tableForm.vue.js +19 -11
  206. package/lib/components/hyTimePicker/index.js +1 -0
  207. package/lib/components/hyTimePicker/timePicker.vue.js +2 -0
  208. package/lib/components/hyTooltip/index.js +1 -0
  209. package/lib/components/hyTooltip/tooltip.vue.js +2 -0
  210. package/lib/components/hyTree/index.js +1 -0
  211. package/lib/components/hyTree/js/index.js +14 -1
  212. package/lib/components/hyTree/tree.vue.js +9 -4
  213. package/lib/components/hyUserAvatar/index.js +1 -0
  214. package/lib/components/hyUserAvatar/userAvatar.vue.js +5 -1
  215. package/lib/components/hyVideoPlayer/cpns/mediaLoading.vue.js +1 -0
  216. package/lib/components/hyVideoPlayer/index.js +1 -0
  217. package/lib/components/hyVideoPlayer/js/index.js +7 -2
  218. package/lib/components/hyVideoPlayer/videoPlayer.vue.js +3 -0
  219. package/lib/components/index.js +56 -53
  220. package/lib/hooks/index.js +3 -0
  221. package/lib/hooks/useGlobalConfig.js +5 -0
  222. package/lib/hooks/useLocale.js +3 -1
  223. package/lib/hooks/useMapConfig.js +21 -0
  224. package/lib/hooks/useResizeHandler.js +1 -0
  225. package/lib/index.js +73 -59
  226. package/lib/locale/en.js +1 -2
  227. package/lib/locale/zh_CN.js +1 -2
  228. package/lib/make-installer.js +1 -0
  229. package/lib/static/hy-svg-icons/hy-icon-ops-list-editorialdownsizing.js +14 -0
  230. package/lib/static/hy-svg-icons/hy-icon-ops-list-suoxiao.js +14 -0
  231. package/lib/style/element/hy-element.scss +10 -1
  232. package/lib/utils/file.js +1 -0
  233. package/lib/utils/form.js +5 -0
  234. package/lib/utils/handler.js +2 -0
  235. package/lib/utils/index.js +3 -0
  236. package/lib/utils/input.js +1 -0
  237. package/lib/utils/is.js +1 -0
  238. package/lib/utils/map/hook/bigMap.js +3 -2
  239. package/lib/utils/map/hook/gaode.js +1 -1
  240. package/lib/utils/map/hook/leafletjs.js +7 -1
  241. package/lib/utils/map/index.js +12 -0
  242. package/lib/utils/map/js/webgis.js +5 -1
  243. package/lib/utils/sharedContent.js +14 -0
  244. package/lib/version.js +1 -1
  245. package/package.json +2 -1
@@ -0,0 +1,652 @@
1
+ 'use strict';
2
+
3
+ var vue = require('vue');
4
+ var elementPlus = require('element-plus');
5
+ var index$1 = require('../../../api/index.js');
6
+ var task = require('../../../api/task.js');
7
+ var device = require('../../../api/device.js');
8
+ var sypct = require('../../../api/sypct.js');
9
+ require('../../../utils/index.js');
10
+ var webgis = require('../../../utils/map/js/webgis.js');
11
+ var index = require('../../../utils/map/index.js');
12
+ var is = require('../../../utils/is.js');
13
+ var input = require('../../../utils/input.js');
14
+
15
+ const CoordinateDict = {
16
+ 0: "WGS84",
17
+ 1: "GCJ02",
18
+ 2: "BD09"
19
+ };
20
+ const CoordinateMap = {
21
+ WGS84: 0,
22
+ GCJ02: 1,
23
+ BD09: 2
24
+ };
25
+ const useMapAearchPlace = (hy) => {
26
+ const { props, emits, t } = hy;
27
+ const poiServer = index.setPoiServer(props.mapConfig);
28
+ const nextPageParams = vue.ref(null);
29
+ const lnglat = vue.ref({
30
+ lng: null,
31
+ lngType: null,
32
+ lat: null,
33
+ latType: null
34
+ });
35
+ const lnglatList = vue.ref([
36
+ {
37
+ titleName: "\u586B\u5199\u7ECF\u7EAC\u5EA6",
38
+ lng: null,
39
+ lat: null
40
+ }
41
+ ]);
42
+ const customCoordinate = vue.ref(null);
43
+ const searchResultList = vue.ref([]);
44
+ const searchAddressType = vue.ref(1);
45
+ const placeholder = vue.ref("\u8F93\u5165\u5730\u5740\u8FDB\u884C\u641C\u7D22");
46
+ const searchAddress = vue.ref(null);
47
+ const valid = vue.ref(true);
48
+ const size = vue.ref(10);
49
+ const page = vue.ref(0);
50
+ const noMore = vue.ref(false);
51
+ const loading = vue.ref(false);
52
+ const colorObject = vue.ref({});
53
+ const timeOut = vue.ref(null);
54
+ const showItem = vue.ref(null);
55
+ const isFocus = vue.ref(false);
56
+ let queryMarkerPoint = null;
57
+ const disabled = vue.computed(() => {
58
+ return hy.loading.value || hy.noMore.value;
59
+ });
60
+ const commonOptions = vue.computed(() => {
61
+ return {
62
+ bmCorrect: 1
63
+ };
64
+ });
65
+ const mapCoordinate = vue.computed(() => {
66
+ return parseInt(hy.commonOptions.value.bmCorrect);
67
+ });
68
+ const mapCoordinateName = vue.computed(() => {
69
+ return CoordinateDict[hy.mapCoordinate.value];
70
+ });
71
+ const searchAddressTypeList = vue.computed(() => {
72
+ const selectIdSet = props.selectIdList.reduce((value, id) => {
73
+ value.add(id);
74
+ return value;
75
+ }, /* @__PURE__ */ new Set());
76
+ return [
77
+ { label: "\u5730\u7406\u5730\u5740", value: 1 },
78
+ // 水源点: 2
79
+ // 防火单位: 3
80
+ {
81
+ label: "\u90E8\u95E8\u540D\u79F0",
82
+ value: 4,
83
+ permission: "operator_departmentManage"
84
+ },
85
+ { label: "\u67E5\u7ECF\u7EAC\u5EA6", value: 5 },
86
+ {
87
+ label: "\u67E5\u5DE1\u67E5\u70B9",
88
+ value: 6,
89
+ permission: "mission_patrolInspectionTask"
90
+ },
91
+ {
92
+ label: "\u4EFB\u52A1\u540D\u79F0",
93
+ value: 7,
94
+ permission: "mission_commonTasks"
95
+ },
96
+ {
97
+ label: "\u67E5\u8BE2\u8F66\u8F86",
98
+ value: 8,
99
+ permission: "commands_dutyStatus"
100
+ }
101
+ ].filter((item) => {
102
+ if (!item.permission && !is.isPermission(item.permission)) {
103
+ return false;
104
+ }
105
+ return selectIdSet.has(item.value);
106
+ });
107
+ });
108
+ async function lnglatCheckFn(content) {
109
+ input.onlyNumber(hy.lnglat.value, content);
110
+ await vue.nextTick();
111
+ if (hy.lnglat.value[`${content}`]) {
112
+ let reg = null;
113
+ if (content === "lng") {
114
+ reg = /^(-|\+)?(((\d|[1-9]\d|1[0-7]\d|0{1,3})\.\d{0,15})|(\d|[1-9]\d|1[0-7]\d|0{1,3})|180\.0{0,15}|180)$/;
115
+ } else {
116
+ reg = /^(-|\+)?([0-8]?\d{1}\.\d{0,15}|90\.0{0,15}|[0-8]?\d{1}|90)$/;
117
+ }
118
+ if (reg.test(hy.lnglat.value[`${content}`])) {
119
+ hy.lnglat.value[`${content}Type`] = true;
120
+ } else {
121
+ hy.lnglat.value[`${content}Type`] = false;
122
+ }
123
+ } else {
124
+ hy.lnglat.value[`${content}Type`] = false;
125
+ }
126
+ const lng = hy.lnglat.value.lng;
127
+ const lat = hy.lnglat.value.lat;
128
+ let lnglatList2 = [];
129
+ if (hy.lnglat.value.latType && hy.lnglat.value.lngType) {
130
+ let wgs84 = {};
131
+ let gcj02 = {};
132
+ let bd09 = {};
133
+ if (hy.mapCoordinate.value === CoordinateMap.WGS84) {
134
+ wgs84 = {
135
+ titleName: "(WGS84-\u56FD\u9645\u901A\u7528\u5750\u6807\u7CFB)",
136
+ lng,
137
+ lat,
138
+ coordinate: CoordinateMap.WGS84
139
+ };
140
+ const gcj20Res = webgis.WGS84ToGCJ02(lat, lng);
141
+ gcj02 = {
142
+ titleName: "\uFF08GCJ02-\u706B\u661F\u5750\u6807\u7CFB\uFF09",
143
+ lng: gcj20Res.lng,
144
+ lat: gcj20Res.lat,
145
+ coordinate: CoordinateMap.GCJ02
146
+ };
147
+ const bd09Res = webgis.WGS84ToBD09(lat, lng);
148
+ bd09 = {
149
+ titleName: "\uFF08BD09-\u706B\u661F\u5750\u6807\u7CFB\uFF09",
150
+ lng: bd09Res.lng,
151
+ lat: bd09Res.lat,
152
+ coordinate: CoordinateMap.BD09
153
+ };
154
+ } else if (hy.mapCoordinate.value === CoordinateMap.GCJ02) {
155
+ gcj02 = {
156
+ titleName: "\uFF08GCJ02-\u706B\u661F\u5750\u6807\u7CFB\uFF09",
157
+ lng,
158
+ lat,
159
+ coordinate: CoordinateMap.GCJ02
160
+ };
161
+ const wgs84Res = webgis.GCJ02ToWGS84(lat, lng);
162
+ wgs84 = {
163
+ titleName: "(WGS84-\u56FD\u9645\u901A\u7528\u5750\u6807\u7CFB)",
164
+ lng: wgs84Res.lng,
165
+ lat: wgs84Res.lat,
166
+ coordinate: CoordinateMap.WGS84
167
+ };
168
+ const bd09Res = webgis.GCJ02ToBD09(lat, lng);
169
+ bd09 = {
170
+ titleName: "\uFF08BD09-\u706B\u661F\u5750\u6807\u7CFB\uFF09",
171
+ lng: bd09Res.lng,
172
+ lat: bd09Res.lat,
173
+ coordinate: CoordinateMap.BD09
174
+ };
175
+ } else if (hy.mapCoordinate.value === CoordinateMap.BD09) {
176
+ bd09 = {
177
+ titleName: "\uFF08BD09-\u706B\u661F\u5750\u6807\u7CFB\uFF09",
178
+ lng,
179
+ lat,
180
+ coordinate: CoordinateMap.BD09
181
+ };
182
+ const gcj20Res = webgis.BD09ToGCJ02(lat, lng);
183
+ gcj02 = {
184
+ titleName: "\uFF08GCJ02-\u706B\u661F\u5750\u6807\u7CFB\uFF09",
185
+ lng: gcj20Res.lng,
186
+ lat: gcj20Res.lat,
187
+ coordinate: CoordinateMap.GCJ02
188
+ };
189
+ const wgs84Res = webgis.BD09ToWGS84(lat, lng);
190
+ wgs84 = {
191
+ titleName: "(WGS84-\u56FD\u9645\u901A\u7528\u5750\u6807\u7CFB)",
192
+ lng: wgs84Res.lng,
193
+ lat: wgs84Res.lat,
194
+ coordinate: CoordinateMap.WGS84
195
+ };
196
+ }
197
+ lnglatList2 = [wgs84, gcj02, bd09];
198
+ } else {
199
+ lnglatList2 = [
200
+ {
201
+ titleName: "\u586B\u5199\u7ECF\u7EAC\u5EA6",
202
+ lng,
203
+ lat
204
+ }
205
+ ];
206
+ }
207
+ await vue.nextTick();
208
+ hy.lnglatList.value = [...lnglatList2];
209
+ }
210
+ function onFocus() {
211
+ hy.isFocus.value = true;
212
+ }
213
+ function onBlur() {
214
+ hy.isFocus.value = false;
215
+ }
216
+ function lnglatClick(item) {
217
+ if (hy.lnglat.value.lngType && hy.lnglat.value.latType) {
218
+ let lng = item.lng;
219
+ let lat = item.lat;
220
+ const data = webgis.getCoordinate(
221
+ { lat, lng },
222
+ {
223
+ importCoordinate: item.coordinate,
224
+ leaveCoordinate: hy.mapCoordinate.value
225
+ }
226
+ );
227
+ lng = data.lng;
228
+ lat = data.lat;
229
+ hy.mapJumpLocationFn({
230
+ lng,
231
+ lat
232
+ });
233
+ }
234
+ }
235
+ function queryMarkerPointDelete() {
236
+ if (hy.timeOut.value) {
237
+ clearTimeout(hy.timeOut.value);
238
+ hy.timeOut.value = null;
239
+ }
240
+ if (hy.queryMarkerPoint) {
241
+ hy.queryMarkerPoint.remove(props.map);
242
+ hy.queryMarkerPoint = null;
243
+ }
244
+ }
245
+ function setQueryMarkerPoint(row) {
246
+ hy.queryMarkerPointDelete();
247
+ if (!props.map) return;
248
+ const { lat, lng } = row;
249
+ hy.queryMarkerPoint = props.hyMap.Marker({
250
+ icon: props.hyMap.DivIcon({
251
+ html: `<div class="hy-map-aearch-place-twinkle-marker w-[40px] h-[60px]" style="position: absolute; transform: translate(-50%, -54px)">
252
+ <svg class= "svg-icon" style="width: inherit;height: inherit;">
253
+ <use xlink:href = "#hy-icon-map-marker-trajectory-personnel"></use>
254
+ </svg>
255
+ </div>`,
256
+ iconSize: [0, 0],
257
+ iconAnchor: [0, 0]
258
+ }),
259
+ position: { lng, lat },
260
+ zIndexOffset: 1
261
+ });
262
+ hy.queryMarkerPoint.addTo(props.map);
263
+ hy.timeOut.value = setTimeout(() => {
264
+ hy.queryMarkerPointDelete();
265
+ }, 4e3);
266
+ }
267
+ function mapJumpLocationFn(row) {
268
+ if (hy.searchAddressType.value === 8) {
269
+ if (row.deviceId) {
270
+ device.detailApi({ deviceId: row.deviceId }).then((res) => {
271
+ if (res.code === 200) {
272
+ const data = res.data;
273
+ if (hy.showItem.value) {
274
+ props.setMarkerToMap();
275
+ }
276
+ vue.nextTick(() => {
277
+ if (data.lat && data.lng) {
278
+ props.map.panTo([row.lng, row.lat]);
279
+ props.map.setZoom(18);
280
+ }
281
+ if (props.onSelectMarker) {
282
+ props.onSelectMarker(data);
283
+ }
284
+ if (props.setMarkerToMap) {
285
+ hy.showItem.value = data;
286
+ props.setMarkerToMap(1, data);
287
+ }
288
+ });
289
+ }
290
+ });
291
+ } else {
292
+ elementPlus.ElMessage.warning("\u5F53\u524D\u7528\u6237\u672A\u7ED1\u5B9A\u8BBE\u5907");
293
+ }
294
+ } else {
295
+ const { lat, lng } = row;
296
+ if (!lat || !lng) {
297
+ let msg = "\u6CA1\u6709\u5B9A\u4F4D\u4FE1\u606F";
298
+ if (hy.searchAddressType.value === 4) {
299
+ msg = "\u8BE5\u90E8\u95E8\u6CA1\u6709\u5B9A\u4F4D\u4FE1\u606F";
300
+ } else if (hy.searchAddressType.value === 6) {
301
+ msg = "\u8BE5\u5DE1\u67E5\u70B9\u6CA1\u6709\u5B9A\u4F4D\u4FE1\u606F";
302
+ } else if (hy.searchAddressType.value === 7) {
303
+ msg = "\u8BE5\u4EFB\u52A1\u6CA1\u6709\u5B9A\u4F4D\u4FE1\u606F";
304
+ }
305
+ elementPlus.ElMessage.warning(msg);
306
+ return;
307
+ }
308
+ props.map.setView(row, 18);
309
+ hy.setQueryMarkerPoint(row);
310
+ hy.resetFn(1);
311
+ }
312
+ }
313
+ function unbindVehicleFn(row) {
314
+ hy.$deleteConfirmationBox(
315
+ {
316
+ deleteTitleImg: "tips",
317
+ deleteTitle: "\u63D0\u793A",
318
+ deleteContent: `
319
+ <div>
320
+ <p>\u786E\u8BA4\u5C06\u8F66\u8F86\u4E0E\u4EBA\u5458\u89E3\u7ED1\uFF1F</p>
321
+ </div>
322
+ `,
323
+ submitText: "\u786E\u8BA4\u89E3\u7ED1",
324
+ closeText: "\u53D6\u6D88",
325
+ closeShow: true
326
+ },
327
+ () => {
328
+ sypct.unbindCphmTaskApi({
329
+ zyId: row.zyId,
330
+ userId: row.userId
331
+ }).then((res) => {
332
+ if (res.code === 200) {
333
+ elementPlus.ElMessage.success("\u89E3\u7ED1\u6210\u529F");
334
+ hy.getVehicleList();
335
+ } else {
336
+ elementPlus.ElMessage.error(res.msg);
337
+ }
338
+ }).catch((err) => {
339
+ console.error(err);
340
+ });
341
+ }
342
+ );
343
+ }
344
+ function throttle(fn, delay) {
345
+ return (params) => {
346
+ if (!hy.valid.value) {
347
+ return false;
348
+ }
349
+ hy.valid.value = false;
350
+ setTimeout(() => {
351
+ fn(params);
352
+ hy.valid.value = true;
353
+ }, delay);
354
+ };
355
+ }
356
+ async function load() {
357
+ hy.loading.value = true;
358
+ hy.page.value++;
359
+ await vue.nextTick();
360
+ hy.getData();
361
+ }
362
+ function searchAddressTypeFn() {
363
+ hy.searchAddress.value = null;
364
+ hy.lnglat.value = {
365
+ lng: null,
366
+ lngType: null,
367
+ lat: null,
368
+ latType: null
369
+ };
370
+ hy.lnglatList.value = [
371
+ {
372
+ titleName: "\u586B\u5199\u7ECF\u7EAC\u5EA6",
373
+ lng: null,
374
+ lat: null
375
+ }
376
+ ];
377
+ hy.placeholderFn();
378
+ hy.resetFn();
379
+ }
380
+ function resetFn(type) {
381
+ hy.searchResultList.value = [];
382
+ hy.page.value = 1;
383
+ hy.noMore.value = false;
384
+ hy.loading.value = false;
385
+ vue.nextTick(() => {
386
+ if (type !== 1) {
387
+ hy.getData();
388
+ }
389
+ });
390
+ }
391
+ function getData() {
392
+ if (hy.searchAddress.value && hy.searchAddress.value.length) {
393
+ if (hy.searchAddressType.value === 1) {
394
+ hy.addressRequestFn();
395
+ } else if (hy.searchAddressType.value === 4) {
396
+ hy.organizationPageFn();
397
+ } else if (hy.searchAddressType.value === 6) {
398
+ hy.patrolPointFn();
399
+ } else if (hy.searchAddressType.value === 7) {
400
+ hy.getTaskList();
401
+ } else if (hy.searchAddressType.value === 8) {
402
+ hy.getVehicleList();
403
+ }
404
+ } else {
405
+ hy.resetFn(1);
406
+ }
407
+ }
408
+ function addressRequestFn() {
409
+ if (hy.page.value === 1) {
410
+ hy.nextPageParams.value = null;
411
+ }
412
+ poiServer.placeSearch({
413
+ pageSize: hy.size.value,
414
+ // 单页显示结果条数
415
+ pageIndex: hy.page.value,
416
+ query: hy.searchAddress.value,
417
+ convertIngAndLat: false,
418
+ // 谷歌地图下一页传入
419
+ nextPageParams: hy.nextPageParams.value
420
+ }).then(({ results, nextPageParams: nextPageParams2 }) => {
421
+ hy.nextPageParams.value = nextPageParams2;
422
+ if (results) {
423
+ const dataList = results;
424
+ const list = [];
425
+ for (let i = 0; i < dataList.length; i++) {
426
+ const item = dataList[i];
427
+ list.push({
428
+ lng: hy.keepDecimal(item.lng),
429
+ lat: hy.keepDecimal(item.lat),
430
+ id: hy.createUniqueId(1),
431
+ address: item.address || item.name,
432
+ title: hy.titleFn(item.name)
433
+ });
434
+ }
435
+ vue.nextTick(() => {
436
+ hy.loading.value = false;
437
+ hy.searchResultList.value.push(...list);
438
+ });
439
+ }
440
+ }).catch(() => {
441
+ hy.loading.value = false;
442
+ hy.noMore.value = true;
443
+ elementPlus.ElMessage.error("\u672A\u641C\u7D22\u5230\u5185\u5BB9");
444
+ });
445
+ }
446
+ function keepDecimal(num, precision = 8) {
447
+ return Math.round(num * Math.pow(10, precision)) / Math.pow(10, precision);
448
+ }
449
+ async function getVehicleList() {
450
+ const res = await index$1.findAllApi("sypct/task/cphmResUse", {
451
+ // page: hy.page.value - 1,
452
+ // size: 10,
453
+ query: hy.searchAddress.value
454
+ });
455
+ if (res.code === 200) {
456
+ const dataList = res.data || [];
457
+ const list = [];
458
+ hy.searchResultList.value = [];
459
+ for (let i = 0; i < dataList.length; i++) {
460
+ const item = dataList[i];
461
+ list.push({
462
+ id: `${i}-${item.zyId}`,
463
+ ...item,
464
+ cphm: hy.titleFn(item.cphm || ""),
465
+ name: hy.titleFn(item.name || "")
466
+ });
467
+ }
468
+ vue.nextTick(() => {
469
+ hy.loading.value = false;
470
+ hy.searchResultList.value.push(...list);
471
+ if (dataList.length === 0 && hy.searchResultList.value.length === 0) {
472
+ elementPlus.ElMessage.error("\u672A\u641C\u7D22\u5230\u5185\u5BB9");
473
+ }
474
+ hy.noMore.value = true;
475
+ });
476
+ }
477
+ }
478
+ async function getTaskList() {
479
+ const res = await task.childTaskFindAllApi({
480
+ taskStatus: "jxz",
481
+ query: hy.searchAddress.value
482
+ });
483
+ if (res && res.code === 200) {
484
+ const dataList = res.data || [];
485
+ const list = [];
486
+ for (let i = 0; i < dataList.length; i++) {
487
+ const item = dataList[i];
488
+ if (item.lat && item.lng) {
489
+ list.push({
490
+ id: `${item.taskId}_${item.orgId}`,
491
+ lat: item.lat,
492
+ lng: item.lng,
493
+ orgName: item.orgName,
494
+ title: hy.titleFn(item.rwmc)
495
+ });
496
+ }
497
+ }
498
+ vue.nextTick(() => {
499
+ hy.loading.value = false;
500
+ hy.searchResultList.value.push(...list);
501
+ if (dataList.length === 0 && hy.searchResultList.value.length === 0) {
502
+ elementPlus.ElMessage.error("\u672A\u641C\u7D22\u5230\u5185\u5BB9");
503
+ }
504
+ hy.noMore.value = true;
505
+ });
506
+ }
507
+ }
508
+ function organizationPageFn() {
509
+ index$1.pageApi("organization", {
510
+ page: hy.page.value - 1,
511
+ size: 10,
512
+ query: hy.searchAddress.value
513
+ }).then((res) => {
514
+ if (res.code === 200) {
515
+ const dataList = res.data.content || [];
516
+ const list = [];
517
+ for (let i = 0; i < dataList.length; i++) {
518
+ const item = dataList[i];
519
+ list.push({
520
+ id: item.id,
521
+ address: item.address || item.companyName,
522
+ ...item,
523
+ title: hy.titleFn(item.companyName)
524
+ });
525
+ }
526
+ vue.nextTick(() => {
527
+ hy.loading.value = false;
528
+ hy.searchResultList.value.push(...list);
529
+ if (dataList.length === 0 && hy.searchResultList.value.length === 0) {
530
+ elementPlus.ElMessage.error("\u672A\u641C\u7D22\u5230\u5185\u5BB9");
531
+ }
532
+ if (hy.page.value === res.data.totalPages) {
533
+ hy.noMore.value = true;
534
+ }
535
+ });
536
+ }
537
+ });
538
+ }
539
+ function patrolPointFn() {
540
+ index$1.pageApi("scrollCheck/scp", {
541
+ page: hy.page.value - 1,
542
+ size: 10,
543
+ query: hy.searchAddress.value
544
+ }).then((res) => {
545
+ if (res.code === 200) {
546
+ const dataList = res.data.content || [];
547
+ const list = [];
548
+ for (let i = 0; i < dataList.length; i++) {
549
+ const item = dataList[i];
550
+ if (item.lng && item.lat) {
551
+ list.push({
552
+ id: item.id,
553
+ ...item,
554
+ address: item.address || item.pointName,
555
+ title: hy.titleFn(item.pointName)
556
+ });
557
+ }
558
+ }
559
+ vue.nextTick(() => {
560
+ hy.loading.value = false;
561
+ hy.searchResultList.value.push(...list);
562
+ if (dataList.length === 0 && hy.searchResultList.value.length === 0) {
563
+ elementPlus.ElMessage.error("\u672A\u641C\u7D22\u5230\u5185\u5BB9");
564
+ }
565
+ if (hy.page.value === res.data.totalPages) {
566
+ hy.noMore.value = true;
567
+ }
568
+ });
569
+ }
570
+ });
571
+ }
572
+ function titleFn(title = "") {
573
+ const arr = [];
574
+ for (let i = 0; i < title.length; i++) {
575
+ const item = title[i];
576
+ const index = hy.searchAddress.value.indexOf(item);
577
+ const json = {
578
+ content: title[i]
579
+ };
580
+ if (index === -1) {
581
+ json.type = 1;
582
+ } else {
583
+ json.type = 2;
584
+ }
585
+ arr.push(json);
586
+ }
587
+ return arr;
588
+ }
589
+ function placeholderFn() {
590
+ if (hy.searchAddressType.value === 1) {
591
+ hy.placeholder.value = "\u8F93\u5165\u5730\u5740\u8FDB\u884C\u641C\u7D22";
592
+ } else if (hy.searchAddressType.value === 4) {
593
+ hy.placeholder.value = "\u8F93\u5165\u90E8\u95E8\u8FDB\u884C\u641C\u7D22";
594
+ } else if (hy.searchAddressType.value === 6) {
595
+ hy.placeholder.value = "\u8F93\u5165\u5DE1\u67E5\u70B9\u8FDB\u884C\u641C\u7D22";
596
+ } else if (hy.searchAddressType.value === 7) {
597
+ hy.placeholder.value = "\u8F93\u5165\u4EFB\u52A1\u540D\u79F0\u8FDB\u884C\u641C\u7D22";
598
+ } else if (hy.searchAddressType.value === 8) {
599
+ hy.placeholder.value = "\u8F93\u5165\u8F66\u724C\u53F7\u7801/\u7528\u6237\u540D\u8FDB\u884C\u641C\u7D22";
600
+ } else {
601
+ hy.placeholder.value = null;
602
+ }
603
+ }
604
+ return {
605
+ searchAddressTypeList,
606
+ nextPageParams,
607
+ lnglat,
608
+ lnglatList,
609
+ customCoordinate,
610
+ searchResultList,
611
+ searchAddressType,
612
+ placeholder,
613
+ searchAddress,
614
+ valid,
615
+ size,
616
+ page,
617
+ noMore,
618
+ loading,
619
+ colorObject,
620
+ timeOut,
621
+ isFocus,
622
+ queryMarkerPoint,
623
+ showItem,
624
+ disabled,
625
+ commonOptions,
626
+ mapCoordinate,
627
+ mapCoordinateName,
628
+ lnglatCheckFn,
629
+ onFocus,
630
+ onBlur,
631
+ lnglatClick,
632
+ queryMarkerPointDelete,
633
+ setQueryMarkerPoint,
634
+ mapJumpLocationFn,
635
+ unbindVehicleFn,
636
+ throttle,
637
+ load,
638
+ searchAddressTypeFn,
639
+ resetFn,
640
+ getData,
641
+ addressRequestFn,
642
+ keepDecimal,
643
+ getVehicleList,
644
+ getTaskList,
645
+ organizationPageFn,
646
+ patrolPointFn,
647
+ titleFn,
648
+ placeholderFn
649
+ };
650
+ };
651
+
652
+ exports.useMapAearchPlace = useMapAearchPlace;