hy-dispatch-ui-v3 0.2.60 → 0.2.62

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