ym-giswidget-2d 1.0.5 → 1.0.8

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/_virtual/_commonjs-dynamic-modules.js +6 -0
  2. package/_virtual/_commonjsHelpers.js +8 -0
  3. package/_virtual/jszip.min.js +4 -0
  4. package/components/clear/Clear.vue.d.ts +6 -0
  5. package/components/clear/Clear.vue.js +19 -0
  6. package/components/clear/Clear.vue2.js +4 -0
  7. package/components/clear/index.d.ts +6 -0
  8. package/components/clear/index.js +8 -0
  9. package/components/draw/Draw.vue.d.ts +6 -0
  10. package/components/draw/Draw.vue.js +71 -0
  11. package/components/draw/Draw.vue2.js +4 -0
  12. package/components/draw/index.d.ts +6 -0
  13. package/components/draw/index.js +8 -0
  14. package/components/export/Export.vue.d.ts +154 -0
  15. package/components/export/Export.vue.js +7 -0
  16. package/components/export/Export.vue2.js +298 -0
  17. package/components/export/index.css +3 -0
  18. package/components/export/index.d.ts +154 -0
  19. package/components/export/index.js +8 -0
  20. package/components/horizontally-top-toolbar/{horizontallyTopToolbar.vue.js → HorizontallyTopToolbar.vue.js} +2 -2
  21. package/components/horizontally-top-toolbar/{horizontallyTopToolbar.vue2.js → HorizontallyTopToolbar.vue2.js} +3 -3
  22. package/components/horizontally-top-toolbar/index.css +9 -9
  23. package/components/horizontally-top-toolbar/index.js +1 -1
  24. package/components/identify/Identify.vue.d.ts +13 -0
  25. package/components/identify/Identify.vue.js +96 -0
  26. package/components/identify/Identify.vue2.js +4 -0
  27. package/components/identify/index.d.ts +18 -0
  28. package/components/identify/index.js +8 -0
  29. package/components/import/Import.vue.d.ts +13 -0
  30. package/components/import/Import.vue.js +162 -0
  31. package/components/import/Import.vue2.js +4 -0
  32. package/components/import/index.d.ts +15 -0
  33. package/components/import/index.js +8 -0
  34. package/components/layer-tree/{layerTree.vue.d.ts → LayerTree.vue.d.ts} +212 -186
  35. package/components/layer-tree/{layerTree.vue.js → LayerTree.vue.js} +2 -2
  36. package/components/layer-tree/{layerTree.vue2.js → LayerTree.vue2.js} +2 -2
  37. package/components/layer-tree/index.css +11 -11
  38. package/components/layer-tree/index.d.ts +194 -184
  39. package/components/layer-tree/index.js +1 -1
  40. package/components/multi-screen/MultiScreen.vue.d.ts +425 -0
  41. package/components/multi-screen/MultiScreen.vue2.js +1 -1
  42. package/components/multi-screen/index.d.ts +426 -0
  43. package/components/multi-screen-panel/PanelMultiScreen.vue2.js +1 -1
  44. package/components/popup/Popup.vue.d.ts +158 -0
  45. package/components/popup/Popup.vue.js +8 -0
  46. package/components/popup/Popup.vue2.js +266 -0
  47. package/components/popup/index.css +61 -0
  48. package/components/popup/index.d.ts +157 -0
  49. package/components/popup/index.js +8 -0
  50. package/components/popup/index2.css +5 -0
  51. package/components/select/Select.vue.d.ts +13 -0
  52. package/components/select/Select.vue.js +142 -0
  53. package/components/select/Select.vue2.js +4 -0
  54. package/components/select/index.d.ts +18 -0
  55. package/components/select/index.js +8 -0
  56. package/components/swipe-layer/SwipeLayer.vue.d.ts +6 -0
  57. package/components/swipe-layer/SwipeLayer.vue.js +24 -0
  58. package/components/swipe-layer/SwipeLayer.vue2.js +4 -0
  59. package/components/swipe-layer/index.d.ts +6 -0
  60. package/components/swipe-layer/index.js +8 -0
  61. package/components/toc-card/{tocCard.vue.js → TocCard.vue.js} +2 -2
  62. package/components/toc-card/{tocCard.vue2.js → TocCard.vue2.js} +2 -2
  63. package/components/toc-card/index.css +1 -1
  64. package/components/toc-card/index.js +1 -1
  65. package/config/Config.d.ts +13 -0
  66. package/config/Config.js +8 -0
  67. package/css/index.css +64 -14
  68. package/http/Axios.d.ts +14 -0
  69. package/http/Axios.js +37 -0
  70. package/http/LayerField.js +29 -0
  71. package/http/SpaceFile.d.ts +3 -0
  72. package/http/SpaceFile.js +38 -0
  73. package/http/layerField.d.ts +19 -0
  74. package/index.d.ts +7 -0
  75. package/index.js +14 -0
  76. package/package.json +2 -2
  77. package/panel/DraggablePanel.vue.d.ts +82 -0
  78. package/panel/DraggablePanel.vue2.js +1 -1
  79. /package/components/horizontally-top-toolbar/{horizontallyTopToolbar.vue.d.ts → HorizontallyTopToolbar.vue.d.ts} +0 -0
  80. /package/components/toc-card/{tocCard.vue.d.ts → TocCard.vue.d.ts} +0 -0
@@ -0,0 +1,266 @@
1
+ import { ElTable, ElTableColumn, ElPagination, ElSelect, ElOption } from "element-plus/es";
2
+ import "element-plus/es/components/base/style/css";
3
+ import "element-plus/es/components/pagination/style/css";
4
+ import "element-plus/es/components/table/style/css";
5
+ import "element-plus/es/components/table-column/style/css";
6
+ import "element-plus/es/components/select/style/css";
7
+ import "element-plus/es/components/option/style/css";
8
+ import { defineComponent, reactive, ref, watch, onMounted, onUnmounted, withDirectives, createBlock, openBlock, withCtx, createElementVNode, createVNode, unref, toDisplayString, createElementBlock, Fragment, renderList, vShow } from "vue";
9
+ import DraggablePanel from "../../panel/DraggablePanel.vue.js";
10
+ import Overlay from "../../node_modules/.pnpm/ol@9.2.4/node_modules/ol/Overlay.js";
11
+ import { getLayerFields } from "../../http/LayerField.js";
12
+ import { ElMessage } from "element-plus";
13
+ import FeatureManager from "ym-giscomm-2d/feature/FeatureManager";
14
+ const _hoisted_1 = { class: "identify-popup-content" };
15
+ const _hoisted_2 = { class: "pagination-block" };
16
+ const overlayId = "identify-popup";
17
+ const _sfc_main = /* @__PURE__ */ defineComponent({
18
+ __name: "Popup",
19
+ props: {
20
+ map: {},
21
+ features: {},
22
+ postion: {}
23
+ },
24
+ emits: ["close"],
25
+ setup(__props, { emit: __emit }) {
26
+ const emit = __emit;
27
+ const props = __props;
28
+ let reactiveValue = reactive({
29
+ layerInfos: [],
30
+ currentData: [],
31
+ currentPage: 1,
32
+ pageTotal: 1,
33
+ visible: true
34
+ });
35
+ const popupDom = ref(null);
36
+ watch(() => props.features, (newVal) => {
37
+ init();
38
+ });
39
+ watch(() => reactiveValue.currentPage, (newVal) => {
40
+ flashFeatures();
41
+ });
42
+ onMounted(() => {
43
+ init();
44
+ });
45
+ onUnmounted(() => {
46
+ const overlayTip = props.map.getOverlayById(overlayId);
47
+ if (overlayTip) {
48
+ reactiveValue.visible = false;
49
+ props.map.removeOverlay(overlayTip);
50
+ }
51
+ });
52
+ function handleClose() {
53
+ reactiveValue.visible = false;
54
+ emit("close");
55
+ }
56
+ async function init() {
57
+ try {
58
+ if (!props.features || props.features.length == 0) {
59
+ reactiveValue.visible = false;
60
+ return;
61
+ }
62
+ reactiveValue.layerInfos = await getLayerInfos();
63
+ reactiveValue.currentLayer = reactiveValue.layerInfos[0];
64
+ reactiveValue.pageTotal = reactiveValue.currentLayer.features.length;
65
+ if (reactiveValue.currentPage == 1) {
66
+ flashFeatures();
67
+ } else {
68
+ reactiveValue.currentPage = 1;
69
+ }
70
+ reactiveValue.visible = true;
71
+ if (!popupDom.value) {
72
+ return;
73
+ }
74
+ let overlayTip = props.map.getOverlayById(overlayId);
75
+ if (!overlayTip) {
76
+ overlayTip = new Overlay({
77
+ id: overlayId,
78
+ element: popupDom.value.$el,
79
+ autoPan: {
80
+ animation: {
81
+ duration: 250
82
+ }
83
+ }
84
+ });
85
+ props.map.addOverlay(overlayTip);
86
+ }
87
+ overlayTip.setPosition(props.postion);
88
+ } catch (error) {
89
+ ElMessage.error("获取要素信息失败");
90
+ handleClose();
91
+ }
92
+ }
93
+ function flashFeatures() {
94
+ var _a;
95
+ const feature = (_a = reactiveValue.currentLayer) == null ? void 0 : _a.features[reactiveValue.currentPage - 1].feature;
96
+ if (!feature) {
97
+ return;
98
+ }
99
+ const featureManager = new FeatureManager(props.map);
100
+ featureManager.flashFeatures([feature], 6);
101
+ }
102
+ function onChangeLayer(layer) {
103
+ reactiveValue.currentLayer = layer;
104
+ if (reactiveValue.currentPage == 1) {
105
+ flashFeatures();
106
+ } else {
107
+ reactiveValue.currentPage = 1;
108
+ }
109
+ reactiveValue.pageTotal = reactiveValue.currentLayer.features.length;
110
+ }
111
+ async function getLayerInfos() {
112
+ if (!props.features || props.features.length == 0) {
113
+ return [];
114
+ }
115
+ const layerIds = props.features.map((feature) => feature.layerId ?? "");
116
+ if (!layerIds || layerIds.length == 0) {
117
+ return [];
118
+ }
119
+ const uniqueArr = Array.from(new Set(layerIds));
120
+ const layers = props.map.getLayersByIds(uniqueArr);
121
+ if (!layers || layers.length == 0) {
122
+ return [];
123
+ }
124
+ let layerInfos = [];
125
+ for (let i = 0; i < layers.length; i++) {
126
+ const layer = layers[i];
127
+ if (!layer) {
128
+ continue;
129
+ }
130
+ const layerInfo = { ...layer.layerInfo, features: [] };
131
+ layerInfo.features = await getFeatures(layerInfo);
132
+ layerInfos.push(layerInfo);
133
+ }
134
+ return layerInfos;
135
+ }
136
+ async function getFeatures(layerInfo) {
137
+ if (!layerInfo) {
138
+ return [];
139
+ }
140
+ if (layerInfo.features && layerInfo.features.length > 0) {
141
+ return layerInfo.features;
142
+ }
143
+ const features = props.features.filter((t) => t.layerId == layerInfo.id);
144
+ if (features.length == 0) {
145
+ return [];
146
+ }
147
+ if (!layerInfo.fields) {
148
+ await getLayerFields(layerInfo);
149
+ }
150
+ const fields = layerInfo.fields;
151
+ if (!fields) {
152
+ return [];
153
+ }
154
+ let featuresInfo = [];
155
+ for (let i = 0; i < features.length; i++) {
156
+ const feature = features[i];
157
+ const attributes = feature.getProperties();
158
+ if (!attributes) {
159
+ continue;
160
+ }
161
+ let attributesInfos = [];
162
+ for (const key in attributes) {
163
+ const field = fields.find((t) => t.name.toLowerCase() == key.toLowerCase());
164
+ if (!field || field.fieldType == 6) {
165
+ continue;
166
+ }
167
+ let value = attributes[key];
168
+ if (field.fieldType == 4 && value) {
169
+ value = new Date(attributes[key]).toLocaleDateString();
170
+ }
171
+ attributesInfos.push({ ...field, value });
172
+ }
173
+ featuresInfo.push({ attributes: attributesInfos, geometry: feature.getGeometry(), feature });
174
+ }
175
+ return featuresInfo;
176
+ }
177
+ return (_ctx, _cache) => {
178
+ const _component_el_option = ElOption;
179
+ const _component_el_select = ElSelect;
180
+ const _component_el_table_column = ElTableColumn;
181
+ const _component_el_table = ElTable;
182
+ const _component_el_pagination = ElPagination;
183
+ return withDirectives((openBlock(), createBlock(DraggablePanel, {
184
+ ref_key: "popupDom",
185
+ ref: popupDom,
186
+ class: "identify-popup el-current",
187
+ width: 300,
188
+ height: 400,
189
+ showMaximize: false,
190
+ onClose: handleClose
191
+ }, {
192
+ header: withCtx(() => [
193
+ createVNode(_component_el_select, {
194
+ modelValue: unref(reactiveValue).currentLayer,
195
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(reactiveValue).currentLayer = $event),
196
+ "value-key": "id",
197
+ placeholder: "请选择",
198
+ onChange: onChangeLayer,
199
+ "popper-class": "el-current"
200
+ }, {
201
+ default: withCtx(() => [
202
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(reactiveValue).layerInfos, (item) => {
203
+ return openBlock(), createBlock(_component_el_option, {
204
+ key: item.id,
205
+ label: item.title,
206
+ value: item
207
+ }, null, 8, ["label", "value"]);
208
+ }), 128))
209
+ ]),
210
+ _: 1
211
+ }, 8, ["modelValue"])
212
+ ]),
213
+ default: withCtx(() => {
214
+ var _a;
215
+ return [
216
+ createElementVNode("div", _hoisted_1, [
217
+ createVNode(_component_el_table, {
218
+ data: (_a = unref(reactiveValue).currentLayer) == null ? void 0 : _a.features[unref(reactiveValue).currentPage - 1].attributes,
219
+ "cell-style": { border: "0px", padding: "3px 0" },
220
+ "show-header": false,
221
+ style: { "width": "100%" }
222
+ }, {
223
+ default: withCtx(() => [
224
+ createVNode(_component_el_table_column, {
225
+ prop: "aliasName",
226
+ label: "字段名",
227
+ width: "auto",
228
+ align: "left"
229
+ }, {
230
+ default: withCtx((scope) => [
231
+ createElementVNode("span", null, toDisplayString(scope.row.aliasName + ":"), 1)
232
+ ]),
233
+ _: 1
234
+ }),
235
+ createVNode(_component_el_table_column, {
236
+ prop: "value",
237
+ label: "值",
238
+ width: "auto",
239
+ align: "left"
240
+ })
241
+ ]),
242
+ _: 1
243
+ }, 8, ["data"]),
244
+ createElementVNode("div", _hoisted_2, [
245
+ createVNode(_component_el_pagination, {
246
+ "current-page": unref(reactiveValue).currentPage,
247
+ "onUpdate:currentPage": _cache[1] || (_cache[1] = ($event) => unref(reactiveValue).currentPage = $event),
248
+ layout: "prev, pager, next",
249
+ "page-size": 1,
250
+ "pager-count": 5,
251
+ total: unref(reactiveValue).pageTotal
252
+ }, null, 8, ["current-page", "total"])
253
+ ])
254
+ ])
255
+ ];
256
+ }),
257
+ _: 1
258
+ }, 512)), [
259
+ [vShow, unref(reactiveValue).visible]
260
+ ]);
261
+ };
262
+ }
263
+ });
264
+ export {
265
+ _sfc_main as default
266
+ };
@@ -0,0 +1,61 @@
1
+ .identify-popup[data-v-61fb39d3] {
2
+ top: unset !important;
3
+ overflow: unset !important;
4
+ transform: unset !important;
5
+ position: absolute !important;
6
+ bottom: 12px;
7
+ left: -50px;
8
+ transform: unset !important;
9
+ }
10
+ .identify-popup[data-v-61fb39d3]::after, .identify-popup[data-v-61fb39d3]::before {
11
+ top: 100%;
12
+ border: solid transparent;
13
+ content: " ";
14
+ height: 0;
15
+ width: 0;
16
+ position: absolute;
17
+ pointer-events: none;
18
+ }
19
+ .identify-popup[data-v-61fb39d3]::after {
20
+ border-top-color: white;
21
+ border-width: 10px;
22
+ left: 48px;
23
+ margin-left: -10px;
24
+ }
25
+ .identify-popup[data-v-61fb39d3]::before {
26
+ border-top-color: #cccccc;
27
+ border-width: 11px;
28
+ left: 48px;
29
+ margin-left: -11px;
30
+ }
31
+ .identify-popup .panel-header .el-select[data-v-61fb39d3] {
32
+ --el-fill-color-blank: "";
33
+ --el-input-text-color: var(--system-primary-text-color);
34
+ --el-input-icon-color: var(--system-primary-text-color);
35
+ }
36
+ .identify-popup .identify-popup-content[data-v-61fb39d3] {
37
+ height: 100%;
38
+ display: flex;
39
+ flex-direction: column;
40
+ }
41
+ .identify-popup .identify-popup-content .el-table[data-v-61fb39d3] {
42
+ --el-table-bg-color: "";
43
+ --el-table-tr-bg-color: "";
44
+ --el-table-text-color: var(--system-primary-text-color);
45
+ --el-table-row-hover-bg-color: "";
46
+ height: 100%;
47
+ }
48
+ .identify-popup .identify-popup-content .pagination-block[data-v-61fb39d3] {
49
+ margin-top: 10px;
50
+ }
51
+ .identify-popup .identify-popup-content .pagination-block .el-pagination[data-v-61fb39d3] {
52
+ justify-content: center;
53
+ --el-pagination-bg-color: "";
54
+ --el-pagination-text-color: var(--system-primary-text-color);
55
+ --el-pagination-button-bg-color: "";
56
+ --el-pagination-button-disabled-bg-color: "";
57
+ --el-pagination-button-color: var(--system-primary-text-color);
58
+ }
59
+ .identify-popup .identify-popup-content .pagination-block .el-pagination[data-v-61fb39d3] .el-icon {
60
+ color: var(--system-primary-text-color);
61
+ }
@@ -0,0 +1,157 @@
1
+ export declare const Popup: import('../../utils').WithInstall<import('vue').DefineComponent<{
2
+ map: import('ym-giscomm-2d/mapView/Map').default;
3
+ features: import('ym-giscomm-2d/entity/Feature').default[];
4
+ postion: import('ol/coordinate').Coordinate;
5
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
6
+ close: (...args: any[]) => void;
7
+ }, string, import('vue').PublicProps, Readonly<{
8
+ map: import('ym-giscomm-2d/mapView/Map').default;
9
+ features: import('ym-giscomm-2d/entity/Feature').default[];
10
+ postion: import('ol/coordinate').Coordinate;
11
+ }> & Readonly<{
12
+ onClose?: ((...args: any[]) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
14
+ popupDom: ({
15
+ $: import('vue').ComponentInternalInstance;
16
+ $data: {};
17
+ $props: {
18
+ readonly title?: string | undefined;
19
+ readonly width?: number | undefined;
20
+ readonly height?: number | undefined;
21
+ readonly minWidth?: number | undefined;
22
+ readonly minHeight?: number | undefined;
23
+ readonly resizable?: boolean | undefined;
24
+ readonly showClose?: boolean | undefined;
25
+ readonly showMinimize?: boolean | undefined;
26
+ readonly showMaximize?: boolean | undefined;
27
+ readonly showDock?: boolean | undefined;
28
+ readonly drag?: boolean | undefined;
29
+ readonly showOk?: boolean | undefined;
30
+ readonly showCancel?: boolean | undefined;
31
+ readonly okText?: string | undefined;
32
+ readonly cancelText?: string | undefined;
33
+ readonly onClose?: ((...args: any[]) => any) | undefined;
34
+ readonly onResize?: ((...args: any[]) => any) | undefined;
35
+ readonly onMove?: ((...args: any[]) => any) | undefined;
36
+ readonly onOk?: ((...args: any[]) => any) | undefined;
37
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
38
+ $attrs: {
39
+ [x: string]: unknown;
40
+ };
41
+ $refs: {
42
+ [x: string]: unknown;
43
+ } & {
44
+ panelRef: HTMLDivElement;
45
+ };
46
+ $slots: Readonly<{
47
+ [name: string]: import('vue').Slot<any> | undefined;
48
+ }>;
49
+ $root: import('vue').ComponentPublicInstance | null;
50
+ $parent: import('vue').ComponentPublicInstance | null;
51
+ $host: Element | null;
52
+ $emit: ((event: "close", ...args: any[]) => void) & ((event: "resize", ...args: any[]) => void) & ((event: "move", ...args: any[]) => void) & ((event: "ok", ...args: any[]) => void);
53
+ $el: HTMLDivElement;
54
+ $options: import('vue').ComponentOptionsBase<Readonly<{
55
+ title?: string;
56
+ width?: number;
57
+ height?: number;
58
+ minWidth?: number;
59
+ minHeight?: number;
60
+ resizable?: boolean;
61
+ showClose?: boolean;
62
+ showMinimize?: boolean;
63
+ showMaximize?: boolean;
64
+ showDock?: boolean;
65
+ drag?: boolean;
66
+ showOk?: boolean;
67
+ showCancel?: boolean;
68
+ okText?: string;
69
+ cancelText?: string;
70
+ }> & Readonly<{
71
+ onClose?: ((...args: any[]) => any) | undefined;
72
+ onResize?: ((...args: any[]) => any) | undefined;
73
+ onMove?: ((...args: any[]) => any) | undefined;
74
+ onOk?: ((...args: any[]) => any) | undefined;
75
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
76
+ close: (...args: any[]) => void;
77
+ resize: (...args: any[]) => void;
78
+ move: (...args: any[]) => void;
79
+ ok: (...args: any[]) => void;
80
+ }, string, {
81
+ title: string;
82
+ showClose: boolean;
83
+ drag: boolean;
84
+ minWidth: number;
85
+ minHeight: number;
86
+ resizable: boolean;
87
+ showMinimize: boolean;
88
+ showMaximize: boolean;
89
+ showDock: boolean;
90
+ showOk: boolean;
91
+ showCancel: boolean;
92
+ okText: string;
93
+ cancelText: string;
94
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
95
+ beforeCreate?: (() => void) | (() => void)[];
96
+ created?: (() => void) | (() => void)[];
97
+ beforeMount?: (() => void) | (() => void)[];
98
+ mounted?: (() => void) | (() => void)[];
99
+ beforeUpdate?: (() => void) | (() => void)[];
100
+ updated?: (() => void) | (() => void)[];
101
+ activated?: (() => void) | (() => void)[];
102
+ deactivated?: (() => void) | (() => void)[];
103
+ beforeDestroy?: (() => void) | (() => void)[];
104
+ beforeUnmount?: (() => void) | (() => void)[];
105
+ destroyed?: (() => void) | (() => void)[];
106
+ unmounted?: (() => void) | (() => void)[];
107
+ renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
108
+ renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
109
+ errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
110
+ };
111
+ $forceUpdate: () => void;
112
+ $nextTick: typeof import('vue').nextTick;
113
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
114
+ } & Readonly<{
115
+ title: string;
116
+ showClose: boolean;
117
+ drag: boolean;
118
+ minWidth: number;
119
+ minHeight: number;
120
+ resizable: boolean;
121
+ showMinimize: boolean;
122
+ showMaximize: boolean;
123
+ showDock: boolean;
124
+ showOk: boolean;
125
+ showCancel: boolean;
126
+ okText: string;
127
+ cancelText: string;
128
+ }> & Omit<Readonly<{
129
+ title?: string;
130
+ width?: number;
131
+ height?: number;
132
+ minWidth?: number;
133
+ minHeight?: number;
134
+ resizable?: boolean;
135
+ showClose?: boolean;
136
+ showMinimize?: boolean;
137
+ showMaximize?: boolean;
138
+ showDock?: boolean;
139
+ drag?: boolean;
140
+ showOk?: boolean;
141
+ showCancel?: boolean;
142
+ okText?: string;
143
+ cancelText?: string;
144
+ }> & Readonly<{
145
+ onClose?: ((...args: any[]) => any) | undefined;
146
+ onResize?: ((...args: any[]) => any) | undefined;
147
+ onMove?: ((...args: any[]) => any) | undefined;
148
+ onOk?: ((...args: any[]) => any) | undefined;
149
+ }>, "title" | "showClose" | "drag" | "minWidth" | "minHeight" | "resizable" | "showMinimize" | "showMaximize" | "showDock" | "showOk" | "showCancel" | "okText" | "cancelText"> & import('vue').ShallowUnwrapRef<{}> & {} & import('vue').ComponentCustomProperties & {} & {
150
+ $slots: {
151
+ header?(_: {}): any;
152
+ default?(_: {}): any;
153
+ footer?(_: {}): any;
154
+ };
155
+ }) | null;
156
+ }, any>>;
157
+ export default Popup;
@@ -0,0 +1,8 @@
1
+ import "./index.css";
2
+ import { withInstall } from "../../utils/wthInstall.js";
3
+ import _Popup from "./Popup.vue.js";
4
+ const Popup = withInstall(_Popup);
5
+ export {
6
+ Popup,
7
+ Popup as default
8
+ };
@@ -0,0 +1,5 @@
1
+ .popup-select-items {
2
+ --el-bg-color-overlay: var(--system-primary-color);
3
+ --el-color-primary: var(--system-primary-text-active-color);
4
+ --el-fill-color-light: "";
5
+ }
@@ -0,0 +1,13 @@
1
+ import { default as OLMap } from 'ym-giscomm-2d/mapView/Map';
2
+ import { default as Style } from 'ol/style/Style';
3
+ type __VLS_Props = {
4
+ map: OLMap;
5
+ pointStyle?: Style;
6
+ cancePointStyle?: Style;
7
+ lineStyle?: Style;
8
+ canceLineStyle?: Style;
9
+ polygonStyle?: Style;
10
+ cancePolygonStyle?: Style;
11
+ };
12
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
13
+ export default _default;
@@ -0,0 +1,142 @@
1
+ import { defineComponent, onMounted, onUnmounted } from "vue";
2
+ import Select from "ym-giscomm-2d/interaction/Select";
3
+ import { ElLoading } from "element-plus";
4
+ import FeatureManager from "ym-giscomm-2d/feature/FeatureManager";
5
+ import { intersects } from "ym-giscomm-2d/utils/GeometryUtil";
6
+ import { getSelectPointStyle, getSelectCancePointStyle, getSelectLineStyle, getSelectCancelLineStyle, getSelectPolygonStyle, getSelectCancelPolygonStyle } from "ym-giscomm-2d/style/StyleManager";
7
+ const _sfc_main = /* @__PURE__ */ defineComponent({
8
+ __name: "Select",
9
+ props: {
10
+ map: {},
11
+ pointStyle: {},
12
+ cancePointStyle: {},
13
+ lineStyle: {},
14
+ canceLineStyle: {},
15
+ polygonStyle: {},
16
+ cancePolygonStyle: {}
17
+ },
18
+ setup(__props) {
19
+ const props = __props;
20
+ const pointStyle = props.pointStyle || getSelectPointStyle();
21
+ const cancePointStyle = props.cancePointStyle || getSelectCancePointStyle();
22
+ const lineStyle = props.lineStyle || getSelectLineStyle();
23
+ const canceLineStyle = props.canceLineStyle || getSelectCancelLineStyle();
24
+ const polygonStyle = props.polygonStyle || getSelectPolygonStyle();
25
+ const cancePolygonStyle = props.cancePolygonStyle || getSelectCancelPolygonStyle();
26
+ const tempType = ["copy", "cut", "draw", "import", "union"];
27
+ let holdCtrl = false;
28
+ onMounted(() => {
29
+ const select = new Select("rectangle", {
30
+ pointStyle,
31
+ cancePointStyle,
32
+ lineStyle,
33
+ canceLineStyle,
34
+ polygonStyle,
35
+ cancePolygonStyle,
36
+ addTempLayer: false
37
+ });
38
+ props.map.interactionManager.addInteraction("select", select);
39
+ let loadingInstance;
40
+ select.on("selectstart", (event) => {
41
+ loadingInstance = ElLoading.service({ text: "正在查询...", background: "rgba(0, 0, 0, 0.5)", target: props.map.getTarget() });
42
+ });
43
+ select.on("selected", (event) => {
44
+ loadingInstance.close();
45
+ holdCtrl = event.holdCtrl;
46
+ if (event.selectGeom) {
47
+ clearSelected(event.selectGeom);
48
+ }
49
+ if (event.allFeatures) {
50
+ addFeaturesToTempLayer(event.allFeatures);
51
+ }
52
+ });
53
+ });
54
+ onUnmounted(() => {
55
+ props.map.interactionManager.removeInteraction("select");
56
+ });
57
+ function addFeaturesToTempLayer(features) {
58
+ var _a;
59
+ for (const feature of features) {
60
+ let tempLayer = props.map.getPolygonTempLayer();
61
+ let style = polygonStyle;
62
+ switch ((_a = feature.getGeometry()) == null ? void 0 : _a.getType()) {
63
+ case "Point":
64
+ case "MultiPoint":
65
+ tempLayer = props.map.getPointTempLayer();
66
+ style = pointStyle;
67
+ break;
68
+ case "LineString":
69
+ case "MultiLineString":
70
+ tempLayer = props.map.getLineTempLayer();
71
+ style = lineStyle;
72
+ break;
73
+ case "Polygon":
74
+ case "MultiPolygon":
75
+ tempLayer = props.map.getPolygonTempLayer();
76
+ style = polygonStyle;
77
+ break;
78
+ }
79
+ const source = tempLayer.getSource();
80
+ if (source) {
81
+ feature.isSelected = true;
82
+ feature.tempLayer = tempLayer;
83
+ feature.setStyle(style);
84
+ if (!feature.fromType || !tempType.includes(feature.fromType)) {
85
+ source.addFeature(feature);
86
+ }
87
+ }
88
+ }
89
+ }
90
+ function clearSelected(geo) {
91
+ var _a;
92
+ const featureManager = new FeatureManager(props.map);
93
+ const features = featureManager.getSelectedFeatures(void 0, true);
94
+ if (!features || features.length == 0) {
95
+ return;
96
+ }
97
+ let clearFeatures = [];
98
+ for (const feature of features) {
99
+ const featureGeo = feature.getGeometry();
100
+ if (!featureGeo) {
101
+ continue;
102
+ }
103
+ const isIntersects = intersects(featureGeo, geo);
104
+ if (holdCtrl && isIntersects) {
105
+ clearFeatures.push(feature);
106
+ } else if (!holdCtrl) {
107
+ clearFeatures.push(feature);
108
+ }
109
+ }
110
+ for (const feature of clearFeatures) {
111
+ if (feature.fromType && tempType.includes(feature.fromType)) {
112
+ feature.isSelected = false;
113
+ switch ((_a = feature.getGeometry()) == null ? void 0 : _a.getType()) {
114
+ case "Point":
115
+ case "MultiPoint":
116
+ feature.setStyle(cancePointStyle);
117
+ break;
118
+ case "LineString":
119
+ case "MultiLineString":
120
+ feature.setStyle(canceLineStyle);
121
+ break;
122
+ case "Polygon":
123
+ case "MultiPolygon":
124
+ feature.setStyle(cancePolygonStyle);
125
+ break;
126
+ }
127
+ } else if (feature.tempLayer && feature.tempLayer.getSource()) {
128
+ const source = feature.tempLayer.getSource();
129
+ if (source) {
130
+ source.removeFeature(feature);
131
+ }
132
+ }
133
+ }
134
+ }
135
+ return (_ctx, _cache) => {
136
+ return null;
137
+ };
138
+ }
139
+ });
140
+ export {
141
+ _sfc_main as default
142
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./Select.vue.js";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -0,0 +1,18 @@
1
+ export declare const Select: import('../../utils').WithInstall<import('vue').DefineComponent<{
2
+ map: import('ym-giscomm-2d/mapView/Map').default;
3
+ pointStyle?: import('ol/style').Style;
4
+ cancePointStyle?: import('ol/style').Style;
5
+ lineStyle?: import('ol/style').Style;
6
+ canceLineStyle?: import('ol/style').Style;
7
+ polygonStyle?: import('ol/style').Style;
8
+ cancePolygonStyle?: import('ol/style').Style;
9
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
10
+ map: import('ym-giscomm-2d/mapView/Map').default;
11
+ pointStyle?: import('ol/style').Style;
12
+ cancePointStyle?: import('ol/style').Style;
13
+ lineStyle?: import('ol/style').Style;
14
+ canceLineStyle?: import('ol/style').Style;
15
+ polygonStyle?: import('ol/style').Style;
16
+ cancePolygonStyle?: import('ol/style').Style;
17
+ }> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>>;
18
+ export default Select;