@cmeslib/components 0.1.14 → 0.3.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
  2. package/es/components/demo/index.mjs +2 -4
  3. package/es/components/demo/src/demo-button-setup-tsx.vue.mjs +3 -3
  4. package/es/components/demo/src/demo-button-setup-tsx.vue2.mjs +3 -3
  5. package/es/components/demo/src/demo-button.vue.mjs +4 -4
  6. package/es/components/demo/src/demo-button.vue2.mjs +5 -5
  7. package/es/components/hifleet/index.d.ts +4 -0
  8. package/es/components/hifleet/index.mjs +1 -0
  9. package/es/components/hifleet/src/helper.d.ts +32 -0
  10. package/es/components/hifleet/src/helper.mjs +261 -0
  11. package/es/components/hifleet/src/index.vue.d.ts +37 -0
  12. package/es/components/hifleet/src/index.vue.mjs +6 -0
  13. package/es/components/hifleet/src/index.vue2.mjs +123 -0
  14. package/es/components/hifleet/src/map-data.d.ts +18 -0
  15. package/es/components/hifleet/src/map-data.mjs +238 -0
  16. package/es/components/hifleet/src/types.d.ts +28 -0
  17. package/es/components/hifleet/src/types.mjs +1 -0
  18. package/es/components/index.d.ts +2 -0
  19. package/es/components/index.mjs +4 -3
  20. package/es/components/selectors/index.d.ts +6 -0
  21. package/es/components/selectors/index.mjs +2 -0
  22. package/es/components/selectors/src/DeptTreeSelect.vue.d.ts +13 -0
  23. package/es/components/selectors/src/DeptTreeSelect.vue.mjs +5 -0
  24. package/es/components/selectors/src/DeptTreeSelect.vue2.mjs +63 -0
  25. package/es/components/selectors/src/UserTreeSelect.vue.d.ts +13 -0
  26. package/es/components/selectors/src/UserTreeSelect.vue.mjs +5 -0
  27. package/es/components/selectors/src/UserTreeSelect.vue2.mjs +82 -0
  28. package/es/components/selectors/src/types.d.ts +27 -0
  29. package/es/components/selectors/src/types.mjs +1 -0
  30. package/es/directives/demo/index.d.ts +2 -0
  31. package/es/directives/demo/index.mjs +8 -0
  32. package/es/directives/index.d.ts +1 -1
  33. package/es/directives/index.mjs +1 -5
  34. package/es/hooks/common/index.d.ts +1 -0
  35. package/es/hooks/common/index.mjs +1 -0
  36. package/es/hooks/common/src/globalSingleFlight.d.ts +27 -0
  37. package/es/hooks/common/src/globalSingleFlight.mjs +108 -0
  38. package/es/hooks/demo/index.d.ts +1 -0
  39. package/es/hooks/demo/index.mjs +5 -0
  40. package/es/hooks/index.d.ts +2 -0
  41. package/es/hooks/index.mjs +2 -0
  42. package/es/index.css +63 -0
  43. package/es/index.d.ts +1 -0
  44. package/es/index.mjs +7 -4
  45. package/es/types/env.d.mjs +1 -0
  46. package/lib/_virtual/_plugin-vue_export-helper.js +13 -0
  47. package/lib/components/demo/index.js +4 -6
  48. package/lib/components/demo/src/demo-button-setup-tsx.vue.js +1 -1
  49. package/lib/components/demo/src/demo-button-setup-tsx.vue2.js +2 -2
  50. package/lib/components/demo/src/demo-button.vue.js +3 -3
  51. package/lib/components/demo/src/demo-button.vue2.js +3 -3
  52. package/lib/components/hifleet/index.d.ts +4 -0
  53. package/lib/components/hifleet/index.js +7 -0
  54. package/lib/components/hifleet/src/helper.d.ts +32 -0
  55. package/lib/components/hifleet/src/helper.js +272 -0
  56. package/lib/components/hifleet/src/index.vue.d.ts +37 -0
  57. package/lib/components/hifleet/src/index.vue.js +10 -0
  58. package/lib/components/hifleet/src/index.vue2.js +127 -0
  59. package/lib/components/hifleet/src/map-data.d.ts +18 -0
  60. package/lib/components/hifleet/src/map-data.js +241 -0
  61. package/lib/components/hifleet/src/types.d.ts +28 -0
  62. package/lib/components/hifleet/src/types.js +2 -0
  63. package/lib/components/index.d.ts +3 -0
  64. package/lib/components/index.js +8 -4
  65. package/lib/components/selectors/index.d.ts +6 -0
  66. package/lib/components/selectors/index.js +9 -0
  67. package/lib/components/selectors/src/DeptTreeSelect.vue.d.ts +13 -0
  68. package/lib/components/selectors/src/DeptTreeSelect.vue.js +9 -0
  69. package/lib/components/selectors/src/DeptTreeSelect.vue2.js +67 -0
  70. package/lib/components/selectors/src/UserTreeSelect.vue.d.ts +13 -0
  71. package/lib/components/selectors/src/UserTreeSelect.vue.js +9 -0
  72. package/lib/components/selectors/src/UserTreeSelect.vue2.js +86 -0
  73. package/lib/components/selectors/src/types.d.ts +27 -0
  74. package/lib/components/selectors/src/types.js +2 -0
  75. package/lib/directives/demo/index.d.ts +2 -0
  76. package/lib/directives/demo/index.js +10 -0
  77. package/lib/directives/index.d.ts +1 -1
  78. package/lib/directives/index.js +4 -4
  79. package/lib/hooks/common/index.d.ts +1 -0
  80. package/lib/hooks/common/index.js +8 -0
  81. package/lib/hooks/common/src/globalSingleFlight.d.ts +27 -0
  82. package/lib/hooks/common/src/globalSingleFlight.js +111 -0
  83. package/lib/hooks/demo/index.d.ts +1 -0
  84. package/lib/hooks/demo/index.js +7 -0
  85. package/lib/hooks/index.d.ts +2 -0
  86. package/lib/hooks/index.js +10 -0
  87. package/lib/index.css +63 -0
  88. package/lib/index.d.ts +3 -0
  89. package/lib/index.js +15 -6
  90. package/lib/types/env.d.js +2 -0
  91. package/package.json +5 -3
@@ -0,0 +1 @@
1
+ export declare function useDemoHook(): void;
@@ -0,0 +1,5 @@
1
+ function useDemoHook() {
2
+ console.log("This is a demo hook from cmeslib-components.");
3
+ }
4
+
5
+ export { useDemoHook };
@@ -0,0 +1,2 @@
1
+ export * from './demo';
2
+ export * from './common';
@@ -0,0 +1,2 @@
1
+ export { useDemoHook } from './demo/index.mjs';
2
+ export { clearSingleFlightRegistry, useGlobalSingleFlight } from './common/src/globalSingleFlight.mjs';
package/es/index.css CHANGED
@@ -2,4 +2,67 @@
2
2
  border-radius: 6px;
3
3
  background-color: #747bff;
4
4
  color: red;
5
+ }
6
+ .hifleet-map-container[data-v-0b224a81] {
7
+ position: relative;
8
+ }
9
+ .hifleet-map-container .hifleet-map-container-maptype[data-v-0b224a81] {
10
+ position: absolute;
11
+ right: 10px;
12
+ bottom: 0;
13
+ z-index: 999;
14
+ display: flex;
15
+ padding: 0;
16
+ margin: 0;
17
+ list-style: none;
18
+ }
19
+ .hifleet-map-container .hifleet-map-container-maptype .map__type--li[data-v-0b224a81] {
20
+ padding: 10px;
21
+ padding-bottom: 0;
22
+ font-size: 14px;
23
+ font-weight: bold;
24
+ color: #666;
25
+ cursor: pointer;
26
+ }
27
+
28
+ .missing-ais[data-v-0b224a81] {
29
+ position: absolute;
30
+ top: 20px;
31
+ left: 20px;
32
+ z-index: 1000;
33
+ font-size: 18px;
34
+ color: red;
35
+ }
36
+
37
+ .map__position--wrapper[data-v-0b224a81] {
38
+ position: absolute;
39
+ right: 10px;
40
+ bottom: 25px;
41
+ z-index: 1000;
42
+ width: 120px;
43
+ padding: 2px 5px;
44
+ font-size: 12px;
45
+ color: #000;
46
+ background: rgba(233, 239, 235, 0.8);
47
+ border: 1px solid #f5f5f5;
48
+ box-shadow: 0 5px 5px rgba(0, 0, 0, 0.3);
49
+ }
50
+ .map__position--wrapper .map__position--des[data-v-0b224a81] {
51
+ position: absolute;
52
+ top: -10px;
53
+ right: -10px;
54
+ z-index: 1;
55
+ min-width: 16px;
56
+ min-height: 10px;
57
+ padding: 0 2px;
58
+ font-size: 12px;
59
+ font-weight: 500;
60
+ line-height: 14px;
61
+ color: #fff;
62
+ text-align: center;
63
+ cursor: pointer;
64
+ background-color: #02a0ff;
65
+ border: 1px solid #fff;
66
+ border-radius: 4px;
67
+ box-sizing: border-box;
5
68
  }
package/es/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './components';
2
2
  export * from './directives';
3
+ export * from './hooks';
package/es/index.mjs CHANGED
@@ -1,6 +1,9 @@
1
- export { DemoDirective } from './directives/index.mjs';
2
- import './components/demo/src/demo-button.vue.mjs';
3
- export { default as DemoButton } from './components/demo/src/demo-button.vue2.mjs';
4
- import './components/demo/src/demo-button-setup-tsx.vue.mjs';
5
1
  export { default as DemoButtonSetupTsx } from './components/demo/src/demo-button-setup-tsx.vue2.mjs';
2
+ export { default as DeptTreeSelect } from './components/selectors/src/DeptTreeSelect.vue2.mjs';
3
+ export { default as UserTreeSelect } from './components/selectors/src/UserTreeSelect.vue2.mjs';
4
+ export { default as DemoButton } from './components/demo/src/demo-button.vue.mjs';
6
5
  export { default as DemoButtonTsx } from './components/demo/src/demo-button-tsx.mjs';
6
+ export { default as HiFleetMap } from './components/hifleet/src/index.vue.mjs';
7
+ export { clearSingleFlightRegistry, useGlobalSingleFlight } from './hooks/common/src/globalSingleFlight.mjs';
8
+ export { useDemoHook } from './hooks/demo/index.mjs';
9
+ export { vFocus } from './directives/demo/index.mjs';
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var _export_sfc = (sfc, props) => {
6
+ const target = sfc.__vccOpts || sfc;
7
+ for (const [key, val] of props) {
8
+ target[key] = val;
9
+ }
10
+ return target;
11
+ };
12
+
13
+ exports.default = _export_sfc;
@@ -1,13 +1,11 @@
1
1
  'use strict';
2
2
 
3
- require('./src/demo-button.vue.js');
4
- require('./src/demo-button-setup-tsx.vue.js');
5
- var demoButtonTsx = require('./src/demo-button-tsx.js');
6
- var demoButton_vue_vue_type_script_setup_true_lang = require('./src/demo-button.vue2.js');
3
+ var demoButton = require('./src/demo-button.vue.js');
7
4
  var demoButtonSetupTsx_vue_vue_type_script_setup_true_lang = require('./src/demo-button-setup-tsx.vue2.js');
5
+ var demoButtonTsx = require('./src/demo-button-tsx.js');
8
6
 
9
7
 
10
8
 
11
- exports.DemoButtonTsx = demoButtonTsx.default;
12
- exports.DemoButton = demoButton_vue_vue_type_script_setup_true_lang.default;
9
+ exports.DemoButton = demoButton.default;
13
10
  exports.DemoButtonSetupTsx = demoButtonSetupTsx_vue_vue_type_script_setup_true_lang.default;
11
+ exports.DemoButtonTsx = demoButtonTsx.default;
@@ -4,6 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var demoButtonSetupTsx_vue_vue_type_script_setup_true_lang = require('./demo-button-setup-tsx.vue2.js');
6
6
 
7
- demoButtonSetupTsx_vue_vue_type_script_setup_true_lang.default.__file = "packages/cmeslib-components/components/demo/src/demo-button-setup-tsx.vue";
7
+
8
8
 
9
9
  exports.default = demoButtonSetupTsx_vue_vue_type_script_setup_true_lang.default;
@@ -6,7 +6,7 @@ var jsxRuntime = require('vue/jsx-runtime');
6
6
  var vue = require('vue');
7
7
  var elementPlus = require('element-plus');
8
8
 
9
- var script = /* @__PURE__ */ vue.defineComponent({
9
+ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
10
10
  __name: "demo-button-setup-tsx",
11
11
  setup(__props) {
12
12
  const count = vue.ref(0);
@@ -25,4 +25,4 @@ var script = /* @__PURE__ */ vue.defineComponent({
25
25
  }
26
26
  });
27
27
 
28
- exports.default = script;
28
+ exports.default = _sfc_main;
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var demoButton_vue_vue_type_script_setup_true_lang = require('./demo-button.vue2.js');
6
+ var _pluginVue_exportHelper = require('../../../_virtual/_plugin-vue_export-helper.js');
6
7
 
7
- demoButton_vue_vue_type_script_setup_true_lang.default.__scopeId = "data-v-45226689";
8
- demoButton_vue_vue_type_script_setup_true_lang.default.__file = "packages/cmeslib-components/components/demo/src/demo-button.vue";
8
+ var demoButton = /* @__PURE__ */ _pluginVue_exportHelper.default(demoButton_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-eab32df7"]]);
9
9
 
10
- exports.default = demoButton_vue_vue_type_script_setup_true_lang.default;
10
+ exports.default = demoButton;
@@ -6,7 +6,7 @@ var vue = require('vue');
6
6
  var elementPlus = require('element-plus');
7
7
  var utils = require('@cmeslib/utils');
8
8
 
9
- var script = /* @__PURE__ */ vue.defineComponent({
9
+ var _sfc_main = /* @__PURE__ */ vue.defineComponent({
10
10
  __name: "demo-button",
11
11
  props: {
12
12
  type: { type: String, required: false }
@@ -16,7 +16,7 @@ var script = /* @__PURE__ */ vue.defineComponent({
16
16
  console.log("Button clicked");
17
17
  };
18
18
  vue.onMounted(() => {
19
- utils.initHiFleet("demo-button", 34);
19
+ utils.loadHiFleetResources();
20
20
  });
21
21
  return (_ctx, _cache) => {
22
22
  return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElButton), {
@@ -38,4 +38,4 @@ var script = /* @__PURE__ */ vue.defineComponent({
38
38
  }
39
39
  });
40
40
 
41
- exports.default = script;
41
+ exports.default = _sfc_main;
@@ -0,0 +1,4 @@
1
+ import HiFleetMap from './src/index.vue';
2
+ import type { HiFleetMapInitResponse } from './src/types';
3
+ export { HiFleetMap };
4
+ export type { HiFleetMapInitResponse };
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ var index = require('./src/index.vue.js');
4
+
5
+
6
+
7
+ exports.HiFleetMap = index.default;
@@ -0,0 +1,32 @@
1
+ import type { LayerGroup, LatLngExpression } from 'leaflet';
2
+ import { LineOptions, MapObj } from './types';
3
+ export declare function init(mapId: string, defaultMapType?: string): MapObj;
4
+ export declare const mapType: import("vue").Ref<string, string>;
5
+ export declare function changMapType(type: string, map: any, app: any): string;
6
+ export declare function mathLngFn(lnglng: number, multiple: number): any;
7
+ /**
8
+ * @param points [[维度,经度]]
9
+ * @param options // 更多配置详阅 https://leafletjs.com/reference.html#polyline
10
+ * @param layer 图层
11
+ */
12
+ export declare function displayPredictLine(points: LatLngExpression[], layer: LayerGroup, options?: LineOptions): void;
13
+ /**
14
+ * @param points [[维度,经度]]
15
+ * @param options // 更多配置详阅 https://leafletjs.com/reference.html#polyline
16
+ * @param layer 图层
17
+ */
18
+ export declare function displayRealLine(points: LatLngExpression[], layer: LayerGroup, options?: LineOptions): void;
19
+ /**
20
+ * @param points [[经度,维度]]
21
+ * @param type [经,纬]字段 key值
22
+ */
23
+ export declare function objectDayLineTransform(points: any, type: any): any[];
24
+ /**
25
+ * @param points [[经度,维度]]
26
+ */
27
+ export declare function dayLineTransform(points: any): any[];
28
+ export declare function convertLines(arg: any): any[];
29
+ /**
30
+ * 设置图标
31
+ */
32
+ export declare function setPointIcon(type: string): import("leaflet").Icon<import("leaflet").IconOptions>;
@@ -0,0 +1,272 @@
1
+ 'use strict';
2
+
3
+ var vue = require('vue');
4
+
5
+ function init(mapId, defaultMapType = "normal") {
6
+ const app = window.hifleet.create({ el: mapId });
7
+ const map = app.getMap();
8
+ const featureLayer = window.L.layerGroup();
9
+ const solidLineLayer = window.L.layerGroup();
10
+ const dottedLineLayer = window.L.layerGroup();
11
+ const lineLayer = window.L.layerGroup();
12
+ const tooltipLayer = window.L.layerGroup();
13
+ const markerLayer = window.L.layerGroup();
14
+ const mapEle = document.getElementsByClassName("leaflet-control-attribution");
15
+ for (let i = 0; i < mapEle.length; i++) {
16
+ const item = mapEle[i];
17
+ item.style.display = "none";
18
+ }
19
+ if (defaultMapType === "satellite") {
20
+ changMapType("satellite", map, app);
21
+ } else {
22
+ changMapType("normal", map, app);
23
+ app.setSeaMapMode();
24
+ }
25
+ featureLayer.addTo(map);
26
+ solidLineLayer.addTo(map);
27
+ dottedLineLayer.addTo(map);
28
+ lineLayer.addTo(map);
29
+ tooltipLayer.addTo(map);
30
+ markerLayer.addTo(map);
31
+ const EVENT = app.EVENT;
32
+ const latlngInfoObj = vue.ref();
33
+ latlngInfoObj.value = {
34
+ lng: "",
35
+ lat: "",
36
+ lngDegree: "",
37
+ latDegree: ""
38
+ };
39
+ map.on("mousemove", (result) => {
40
+ const lnglng = +result.latlng.lng;
41
+ const latlng = +result.latlng.lat;
42
+ const multiple = Math.abs(+(lnglng / 360 + "").split(".")[0]);
43
+ const lng = mathLngFn(lnglng, multiple);
44
+ const lngDegreeArr = (lng + "").split(".");
45
+ const lngX = Math.abs(+lngDegreeArr[0]);
46
+ const lngY = ((Math.abs(lng) - lngX) * 60).toFixed(3);
47
+ const lngDegree = lngX + "\xB0" + lngY + " " + (lng >= 0 ? "E" : "W");
48
+ const latDegreeArr = (latlng + "").split(".");
49
+ const latX = Math.abs(+latDegreeArr[0]);
50
+ const latY = ((Math.abs(latlng) - latX) * 60).toFixed(3);
51
+ const latDegree = latX + "\xB0" + latY + " " + (latlng >= 0 ? "N" : "S");
52
+ latlngInfoObj.value = {
53
+ lng: lng.toFixed(5),
54
+ lat: latlng.toFixed(5),
55
+ lngDegree,
56
+ latDegree
57
+ };
58
+ });
59
+ const mapObj = {
60
+ mapInfo: {
61
+ // 地图对象
62
+ app,
63
+ map,
64
+ EVENT
65
+ },
66
+ latlngInfoObj,
67
+ // 经纬度信息
68
+ layerGroup: {
69
+ // 默认建图层
70
+ featureLayer,
71
+ solidLineLayer,
72
+ dottedLineLayer,
73
+ lineLayer,
74
+ tooltipLayer,
75
+ markerLayer
76
+ }
77
+ };
78
+ return mapObj;
79
+ }
80
+ let globalLayer;
81
+ const mapType = vue.ref("normal");
82
+ function changMapType(type = mapType.value, map, app) {
83
+ switch (type) {
84
+ case "normal":
85
+ if (globalLayer) {
86
+ map.removeLayer(globalLayer);
87
+ globalLayer = null;
88
+ }
89
+ app.openMap();
90
+ app.changeMap({ lang: "cn", key: "global" });
91
+ break;
92
+ case "satellite":
93
+ if (globalLayer) {
94
+ map.removeLayer(globalLayer);
95
+ globalLayer = null;
96
+ }
97
+ app.openMap();
98
+ app.changeMap({ lang: "cn", key: "satellite" });
99
+ break;
100
+ case "global":
101
+ app.closeMap();
102
+ globalLayer = window.L.tileLayer(
103
+ "https://api.hifleet.com/nauticalmap/en/token?usertoken=uhzt76EZeisfeaj9mfjRe7wUhvQbokxgEYkBlfnXlR53HDfWXhpBuiIp7ZwY00S8&x={x}&y={y}&z={z}"
104
+ ).addTo(map);
105
+ break;
106
+ }
107
+ vue.nextTick(() => {
108
+ if (map) {
109
+ map.invalidateSize(true);
110
+ }
111
+ });
112
+ mapType.value = type;
113
+ return type;
114
+ }
115
+ function mathLngFn(lnglng, multiple) {
116
+ let lng;
117
+ if (lnglng >= 0) {
118
+ lng = Math.abs(lnglng - 360 * multiple) < 180 ? lnglng - 360 * multiple : lnglng - 360 * multiple - 360;
119
+ } else {
120
+ lng = Math.abs(lnglng + 360 * multiple) < 180 ? lnglng + 360 * multiple : lnglng + 360 * multiple + 360;
121
+ }
122
+ return lng;
123
+ }
124
+ function displayPredictLine(points, layer, options = { weight: 2, color: "#F95E5A" }) {
125
+ const predictFeature = window.L.polyline(points, {
126
+ // snakingPause: 200,
127
+ color: options.color,
128
+ // 线的颜色
129
+ weight: options.weight,
130
+ // 线的宽度
131
+ dashArray: [10, 10]
132
+ // 虚线间隔的设置
133
+ // zIndex: 9
134
+ }).addTo(layer);
135
+ window.L.polylineDecorator(predictFeature, {
136
+ patterns: [
137
+ // defines a pattern of 10px-wide dashes, repeated every 20px on the line
138
+ {
139
+ offset: 30,
140
+ repeat: 100,
141
+ symbol: window.L.Symbol.arrowHead({
142
+ pixelSize: 8,
143
+ polygon: false,
144
+ pathOptions: { color: "#F95E5A", weight: 2, stroke: true }
145
+ })
146
+ }
147
+ ]
148
+ }).addTo(layer);
149
+ }
150
+ function displayRealLine(points, layer, options = { weight: 2, color: "#F95E5A" }) {
151
+ const realFeature = window.L.polyline(points, {
152
+ // snakingPause: 200,
153
+ color: options.color,
154
+ // 线的颜色
155
+ weight: options.weight
156
+ // 线的宽度
157
+ // zIndex: 9
158
+ }).addTo(layer);
159
+ window.L.polylineDecorator(realFeature, {
160
+ patterns: [
161
+ // defines a pattern of 10px-wide dashes, repeated every 20px on the line
162
+ {
163
+ offset: 30,
164
+ repeat: 100,
165
+ symbol: window.L.Symbol.arrowHead({
166
+ pixelSize: 8,
167
+ polygon: false,
168
+ pathOptions: { color: "#F95E5A", weight: 2, stroke: true }
169
+ })
170
+ }
171
+ ]
172
+ }).addTo(layer);
173
+ }
174
+ function objectDayLineTransform(points, type) {
175
+ if (!type || !type.length) {
176
+ return [];
177
+ }
178
+ const result = [];
179
+ let iscrossdaylineleft = false;
180
+ let iscrossdaylineright = false;
181
+ for (let i = 0; i < points.length; i++) {
182
+ const firstcoor = [points[i][type[1]], points[i][type[0]]];
183
+ let subFCoords = {};
184
+ if (iscrossdaylineleft) {
185
+ subFCoords = { ...points[i], [type[0]]: firstcoor[1] + 360, [type[1]]: firstcoor[0] };
186
+ } else if (iscrossdaylineright) {
187
+ subFCoords = { ...points[i], [type[0]]: firstcoor[1] - 360, [type[1]]: firstcoor[0] };
188
+ } else {
189
+ subFCoords = { ...points[i] };
190
+ }
191
+ result.push(subFCoords);
192
+ if (i < points.length - 1) {
193
+ const secondcoor = [points[i + 1][type[1]], points[i + 1][type[0]]];
194
+ const diff = Math.abs(firstcoor[1] - secondcoor[1]);
195
+ if (diff > 240) {
196
+ if (firstcoor[1] > 0) {
197
+ if (iscrossdaylineright) {
198
+ iscrossdaylineright = false;
199
+ } else iscrossdaylineleft = true;
200
+ } else {
201
+ if (iscrossdaylineleft) {
202
+ iscrossdaylineleft = false;
203
+ } else {
204
+ iscrossdaylineright = true;
205
+ }
206
+ }
207
+ }
208
+ }
209
+ }
210
+ return result;
211
+ }
212
+ function dayLineTransform(points) {
213
+ const result = [];
214
+ let iscrossdaylineleft = false;
215
+ let iscrossdaylineright = false;
216
+ for (let i = 0; i < points.length; i++) {
217
+ const firstcoor = [points[i][1], points[i][0]];
218
+ let subFCoords = [];
219
+ if (iscrossdaylineleft) {
220
+ subFCoords = [firstcoor[1] + 360, firstcoor[0]];
221
+ } else if (iscrossdaylineright) {
222
+ subFCoords = [firstcoor[1] - 360, firstcoor[0]];
223
+ } else {
224
+ subFCoords = [firstcoor[1], firstcoor[0]];
225
+ }
226
+ result.push(subFCoords);
227
+ if (i < points.length - 1) {
228
+ const secondcoor = [points[i + 1][1], points[i + 1][0]];
229
+ const diff = Math.abs(firstcoor[1] - secondcoor[1]);
230
+ if (diff > 240) {
231
+ if (firstcoor[1] > 0) {
232
+ if (iscrossdaylineright) {
233
+ iscrossdaylineright = false;
234
+ } else iscrossdaylineleft = true;
235
+ } else {
236
+ if (iscrossdaylineleft) {
237
+ iscrossdaylineleft = false;
238
+ } else {
239
+ iscrossdaylineright = true;
240
+ }
241
+ }
242
+ }
243
+ }
244
+ }
245
+ return result;
246
+ }
247
+ function convertLines(arg) {
248
+ const arr = [];
249
+ arg.map((item) => {
250
+ const _arr = [item[1], item[0]];
251
+ arr.push(_arr);
252
+ });
253
+ return arr;
254
+ }
255
+ function setPointIcon(type) {
256
+ return window.L.icon({
257
+ iconUrl: type === "ship" || type === "repair" ? "./img/" + type + ".png" : "./img/" + type + ".svg",
258
+ iconSize: [30, 30],
259
+ iconAnchor: [15, 15]
260
+ });
261
+ }
262
+
263
+ exports.changMapType = changMapType;
264
+ exports.convertLines = convertLines;
265
+ exports.dayLineTransform = dayLineTransform;
266
+ exports.displayPredictLine = displayPredictLine;
267
+ exports.displayRealLine = displayRealLine;
268
+ exports.init = init;
269
+ exports.mapType = mapType;
270
+ exports.mathLngFn = mathLngFn;
271
+ exports.objectDayLineTransform = objectDayLineTransform;
272
+ exports.setPointIcon = setPointIcon;
@@ -0,0 +1,37 @@
1
+ import type { HiFleetMapInitResponse } from './types';
2
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
+ mapId: {
4
+ type: StringConstructor;
5
+ required: true;
6
+ };
7
+ height: {
8
+ type: StringConstructor;
9
+ default: string;
10
+ };
11
+ width: {
12
+ type: StringConstructor;
13
+ default: string;
14
+ };
15
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
16
+ init: (obj: HiFleetMapInitResponse) => any;
17
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
18
+ mapId: {
19
+ type: StringConstructor;
20
+ required: true;
21
+ };
22
+ height: {
23
+ type: StringConstructor;
24
+ default: string;
25
+ };
26
+ width: {
27
+ type: StringConstructor;
28
+ default: string;
29
+ };
30
+ }>> & Readonly<{
31
+ onInit?: (obj: HiFleetMapInitResponse) => any;
32
+ }>, {
33
+ height: string;
34
+ width: string;
35
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
36
+ declare const _default: typeof __VLS_export;
37
+ export default _default;
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var index_vue_vue_type_script_setup_true_lang = require('./index.vue2.js');
6
+ var _pluginVue_exportHelper = require('../../../_virtual/_plugin-vue_export-helper.js');
7
+
8
+ var index = /* @__PURE__ */ _pluginVue_exportHelper.default(index_vue_vue_type_script_setup_true_lang.default, [["__scopeId", "data-v-0b224a81"]]);
9
+
10
+ exports.default = index;