ym-giswidget-2d 1.0.58 → 1.0.59

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.
@@ -2,5 +2,153 @@ import { default as OLMap } from 'ym-gis-2d/mapView/Map';
2
2
  type __VLS_Props = {
3
3
  map: OLMap;
4
4
  };
5
- 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>;
5
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
6
+ activeInteraction: (...args: any[]) => void;
7
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
8
+ onActiveInteraction?: ((...args: any[]) => any) | undefined;
9
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
10
+ locationRef: ({
11
+ $: import('vue').ComponentInternalInstance;
12
+ $data: {};
13
+ $props: {
14
+ readonly title?: string | undefined;
15
+ readonly width?: number | undefined;
16
+ readonly height?: number | undefined;
17
+ readonly minWidth?: number | undefined;
18
+ readonly minHeight?: number | undefined;
19
+ readonly resizable?: boolean | undefined;
20
+ readonly showClose?: boolean | undefined;
21
+ readonly showMinimize?: boolean | undefined;
22
+ readonly showMaximize?: boolean | undefined;
23
+ readonly showDock?: boolean | undefined;
24
+ readonly drag?: boolean | undefined;
25
+ readonly showOk?: boolean | undefined;
26
+ readonly showCancel?: boolean | undefined;
27
+ readonly okText?: string | undefined;
28
+ readonly cancelText?: string | undefined;
29
+ readonly onClose?: ((...args: any[]) => any) | undefined;
30
+ readonly onResize?: ((...args: any[]) => any) | undefined;
31
+ readonly onMove?: ((...args: any[]) => any) | undefined;
32
+ readonly onOk?: ((...args: any[]) => any) | undefined;
33
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
34
+ $attrs: {
35
+ [x: string]: unknown;
36
+ };
37
+ $refs: {
38
+ [x: string]: unknown;
39
+ } & {
40
+ panelRef: HTMLDivElement;
41
+ };
42
+ $slots: Readonly<{
43
+ [name: string]: import('vue').Slot<any> | undefined;
44
+ }>;
45
+ $root: import('vue').ComponentPublicInstance | null;
46
+ $parent: import('vue').ComponentPublicInstance | null;
47
+ $host: Element | null;
48
+ $emit: ((event: "close", ...args: any[]) => void) & ((event: "resize", ...args: any[]) => void) & ((event: "move", ...args: any[]) => void) & ((event: "ok", ...args: any[]) => void);
49
+ $el: HTMLDivElement;
50
+ $options: import('vue').ComponentOptionsBase<Readonly<{
51
+ title?: string;
52
+ width?: number;
53
+ height?: number;
54
+ minWidth?: number;
55
+ minHeight?: number;
56
+ resizable?: boolean;
57
+ showClose?: boolean;
58
+ showMinimize?: boolean;
59
+ showMaximize?: boolean;
60
+ showDock?: boolean;
61
+ drag?: boolean;
62
+ showOk?: boolean;
63
+ showCancel?: boolean;
64
+ okText?: string;
65
+ cancelText?: string;
66
+ }> & Readonly<{
67
+ onClose?: ((...args: any[]) => any) | undefined;
68
+ onResize?: ((...args: any[]) => any) | undefined;
69
+ onMove?: ((...args: any[]) => any) | undefined;
70
+ onOk?: ((...args: any[]) => any) | undefined;
71
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
72
+ close: (...args: any[]) => void;
73
+ resize: (...args: any[]) => void;
74
+ move: (...args: any[]) => void;
75
+ ok: (...args: any[]) => void;
76
+ }, string, {
77
+ title: string;
78
+ showClose: boolean;
79
+ drag: boolean;
80
+ minWidth: number;
81
+ minHeight: number;
82
+ resizable: boolean;
83
+ showMinimize: boolean;
84
+ showMaximize: boolean;
85
+ showDock: boolean;
86
+ showOk: boolean;
87
+ showCancel: boolean;
88
+ okText: string;
89
+ cancelText: string;
90
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
91
+ beforeCreate?: (() => void) | (() => void)[];
92
+ created?: (() => void) | (() => void)[];
93
+ beforeMount?: (() => void) | (() => void)[];
94
+ mounted?: (() => void) | (() => void)[];
95
+ beforeUpdate?: (() => void) | (() => void)[];
96
+ updated?: (() => void) | (() => void)[];
97
+ activated?: (() => void) | (() => void)[];
98
+ deactivated?: (() => void) | (() => void)[];
99
+ beforeDestroy?: (() => void) | (() => void)[];
100
+ beforeUnmount?: (() => void) | (() => void)[];
101
+ destroyed?: (() => void) | (() => void)[];
102
+ unmounted?: (() => void) | (() => void)[];
103
+ renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
104
+ renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
105
+ errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
106
+ };
107
+ $forceUpdate: () => void;
108
+ $nextTick: typeof import('vue').nextTick;
109
+ $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;
110
+ } & Readonly<{
111
+ title: string;
112
+ showClose: boolean;
113
+ drag: boolean;
114
+ minWidth: number;
115
+ minHeight: number;
116
+ resizable: boolean;
117
+ showMinimize: boolean;
118
+ showMaximize: boolean;
119
+ showDock: boolean;
120
+ showOk: boolean;
121
+ showCancel: boolean;
122
+ okText: string;
123
+ cancelText: string;
124
+ }> & Omit<Readonly<{
125
+ title?: string;
126
+ width?: number;
127
+ height?: number;
128
+ minWidth?: number;
129
+ minHeight?: number;
130
+ resizable?: boolean;
131
+ showClose?: boolean;
132
+ showMinimize?: boolean;
133
+ showMaximize?: boolean;
134
+ showDock?: boolean;
135
+ drag?: boolean;
136
+ showOk?: boolean;
137
+ showCancel?: boolean;
138
+ okText?: string;
139
+ cancelText?: string;
140
+ }> & Readonly<{
141
+ onClose?: ((...args: any[]) => any) | undefined;
142
+ onResize?: ((...args: any[]) => any) | undefined;
143
+ onMove?: ((...args: any[]) => any) | undefined;
144
+ onOk?: ((...args: any[]) => any) | undefined;
145
+ }>, "title" | "showClose" | "drag" | "minWidth" | "minHeight" | "resizable" | "showMinimize" | "showMaximize" | "showDock" | "showOk" | "showCancel" | "okText" | "cancelText"> & import('vue').ShallowUnwrapRef<{}> & {} & import('vue').ComponentCustomProperties & {} & {
146
+ $slots: {
147
+ header?(_: {}): any;
148
+ default?(_: {}): any;
149
+ footer?(_: {}): any;
150
+ };
151
+ }) | null;
152
+ formRef: unknown;
153
+ }, HTMLDivElement>;
6
154
  export default _default;
@@ -1,21 +1,109 @@
1
- import { defineComponent, onMounted, onUnmounted } from "vue";
1
+ import { ElForm, ElFormItem, ElSelect, ElOption } from "element-plus/es";
2
+ import "element-plus/es/components/base/style/css";
3
+ import "element-plus/es/components/form/style/css";
4
+ import "element-plus/es/components/form-item/style/css";
5
+ import "element-plus/es/components/select/style/css";
6
+ import "element-plus/es/components/option/style/css";
7
+ import { defineComponent, reactive, onMounted, onUnmounted, withDirectives, createBlock, openBlock, withCtx, createVNode, unref, createElementBlock, Fragment, renderList, vShow } from "vue";
8
+ import { ElMessage } from "element-plus";
9
+ import DraggablePanel from "../../panel/DraggablePanel.vue.js";
2
10
  import SwipeLayerControl from "ym-gis-2d/controls/SwipeLayerControl";
3
11
  const _sfc_main = /* @__PURE__ */ defineComponent({
4
12
  __name: "SwipeLayer",
5
13
  props: {
6
14
  map: {}
7
15
  },
8
- setup(__props) {
16
+ emits: ["activeInteraction"],
17
+ setup(__props, { emit: __emit }) {
18
+ const emit = __emit;
9
19
  const props = __props;
20
+ let reactiveValue = reactive({
21
+ visible: true,
22
+ layers: []
23
+ });
10
24
  onMounted(() => {
11
- const control = new SwipeLayerControl({ swipeLayer: props.map.getAllLayers()[0], dockedVisible: "Right", target: props.map.getTarget() });
12
- props.map.controlManager.addControl("swipe", control);
25
+ reactiveValue.layers = props.map.getAllLayers().filter((t) => t.getVisible() && t.layerInfo).map((layer) => layer.layerInfo);
26
+ props.map.on("changelayer", (e) => {
27
+ reactiveValue.layers = props.map.getAllLayers().filter((t) => t.getVisible() && t.layerInfo).map((layer) => layer.layerInfo);
28
+ });
13
29
  });
14
30
  onUnmounted(() => {
15
31
  props.map.controlManager.removeControl("swipe");
16
32
  });
33
+ function handleClose() {
34
+ emit("activeInteraction", { success: false, message: "" });
35
+ }
36
+ function handleChange() {
37
+ const layer = props.map.getLayerById(reactiveValue.selectItem.id);
38
+ if (!layer) {
39
+ ElMessage.error("图层不存在");
40
+ return;
41
+ }
42
+ if (!reactiveValue.swipeLayerControl) {
43
+ reactiveValue.swipeLayerControl = new SwipeLayerControl({ swipeLayer: layer, dockedVisible: "Right", target: props.map.getTarget() });
44
+ props.map.controlManager.addControl("swipe", reactiveValue.swipeLayerControl);
45
+ } else {
46
+ reactiveValue.swipeLayerControl.setSwipeLayer(layer);
47
+ }
48
+ }
17
49
  return (_ctx, _cache) => {
18
- return null;
50
+ const _component_el_option = ElOption;
51
+ const _component_el_select = ElSelect;
52
+ const _component_el_form_item = ElFormItem;
53
+ const _component_el_form = ElForm;
54
+ return withDirectives((openBlock(), createBlock(DraggablePanel, {
55
+ ref: "locationRef",
56
+ class: "el-current",
57
+ title: "卷帘对比",
58
+ drag: true,
59
+ width: 320,
60
+ height: 128,
61
+ showMaximize: false,
62
+ showOk: false,
63
+ "show-cancel": false,
64
+ "ok-text": "确定",
65
+ onClose: handleClose
66
+ }, {
67
+ default: withCtx(() => [
68
+ createVNode(_component_el_form, {
69
+ ref: "formRef",
70
+ model: unref(reactiveValue),
71
+ "label-width": "83"
72
+ }, {
73
+ default: withCtx(() => [
74
+ createVNode(_component_el_form_item, { label: "卷帘图层:" }, {
75
+ default: withCtx(() => [
76
+ createVNode(_component_el_select, {
77
+ modelValue: unref(reactiveValue).selectItem,
78
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(reactiveValue).selectItem = $event),
79
+ "value-key": "id",
80
+ filterable: "",
81
+ placeholder: "请选择卷帘图层",
82
+ style: { "width": "240px" },
83
+ onChange: handleChange
84
+ }, {
85
+ default: withCtx(() => [
86
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(reactiveValue).layers, (item) => {
87
+ return openBlock(), createBlock(_component_el_option, {
88
+ key: item.id,
89
+ label: item.title,
90
+ value: item
91
+ }, null, 8, ["label", "value"]);
92
+ }), 128))
93
+ ]),
94
+ _: 1
95
+ }, 8, ["modelValue"])
96
+ ]),
97
+ _: 1
98
+ })
99
+ ]),
100
+ _: 1
101
+ }, 8, ["model"])
102
+ ]),
103
+ _: 1
104
+ }, 512)), [
105
+ [vShow, unref(reactiveValue).visible]
106
+ ]);
19
107
  };
20
108
  }
21
109
  });
@@ -1,6 +1,154 @@
1
1
  export declare const SwipeLayer: import('../../utils').WithInstall<import('vue').DefineComponent<{
2
2
  map: import('ym-gis-2d/mapView/Map').default;
3
- }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
3
+ }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
4
+ activeInteraction: (...args: any[]) => void;
5
+ }, string, import('vue').PublicProps, Readonly<{
4
6
  map: import('ym-gis-2d/mapView/Map').default;
5
- }> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>>;
7
+ }> & Readonly<{
8
+ onActiveInteraction?: ((...args: any[]) => any) | undefined;
9
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
10
+ locationRef: ({
11
+ $: import('vue').ComponentInternalInstance;
12
+ $data: {};
13
+ $props: {
14
+ readonly title?: string | undefined;
15
+ readonly width?: number | undefined;
16
+ readonly height?: number | undefined;
17
+ readonly minWidth?: number | undefined;
18
+ readonly minHeight?: number | undefined;
19
+ readonly resizable?: boolean | undefined;
20
+ readonly showClose?: boolean | undefined;
21
+ readonly showMinimize?: boolean | undefined;
22
+ readonly showMaximize?: boolean | undefined;
23
+ readonly showDock?: boolean | undefined;
24
+ readonly drag?: boolean | undefined;
25
+ readonly showOk?: boolean | undefined;
26
+ readonly showCancel?: boolean | undefined;
27
+ readonly okText?: string | undefined;
28
+ readonly cancelText?: string | undefined;
29
+ readonly onClose?: ((...args: any[]) => any) | undefined;
30
+ readonly onResize?: ((...args: any[]) => any) | undefined;
31
+ readonly onMove?: ((...args: any[]) => any) | undefined;
32
+ readonly onOk?: ((...args: any[]) => any) | undefined;
33
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
34
+ $attrs: {
35
+ [x: string]: unknown;
36
+ };
37
+ $refs: {
38
+ [x: string]: unknown;
39
+ } & {
40
+ panelRef: HTMLDivElement;
41
+ };
42
+ $slots: Readonly<{
43
+ [name: string]: import('vue').Slot<any> | undefined;
44
+ }>;
45
+ $root: import('vue').ComponentPublicInstance | null;
46
+ $parent: import('vue').ComponentPublicInstance | null;
47
+ $host: Element | null;
48
+ $emit: ((event: "close", ...args: any[]) => void) & ((event: "resize", ...args: any[]) => void) & ((event: "move", ...args: any[]) => void) & ((event: "ok", ...args: any[]) => void);
49
+ $el: HTMLDivElement;
50
+ $options: import('vue').ComponentOptionsBase<Readonly<{
51
+ title?: string;
52
+ width?: number;
53
+ height?: number;
54
+ minWidth?: number;
55
+ minHeight?: number;
56
+ resizable?: boolean;
57
+ showClose?: boolean;
58
+ showMinimize?: boolean;
59
+ showMaximize?: boolean;
60
+ showDock?: boolean;
61
+ drag?: boolean;
62
+ showOk?: boolean;
63
+ showCancel?: boolean;
64
+ okText?: string;
65
+ cancelText?: string;
66
+ }> & Readonly<{
67
+ onClose?: ((...args: any[]) => any) | undefined;
68
+ onResize?: ((...args: any[]) => any) | undefined;
69
+ onMove?: ((...args: any[]) => any) | undefined;
70
+ onOk?: ((...args: any[]) => any) | undefined;
71
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
72
+ close: (...args: any[]) => void;
73
+ resize: (...args: any[]) => void;
74
+ move: (...args: any[]) => void;
75
+ ok: (...args: any[]) => void;
76
+ }, string, {
77
+ title: string;
78
+ showClose: boolean;
79
+ drag: boolean;
80
+ minWidth: number;
81
+ minHeight: number;
82
+ resizable: boolean;
83
+ showMinimize: boolean;
84
+ showMaximize: boolean;
85
+ showDock: boolean;
86
+ showOk: boolean;
87
+ showCancel: boolean;
88
+ okText: string;
89
+ cancelText: string;
90
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
91
+ beforeCreate?: (() => void) | (() => void)[];
92
+ created?: (() => void) | (() => void)[];
93
+ beforeMount?: (() => void) | (() => void)[];
94
+ mounted?: (() => void) | (() => void)[];
95
+ beforeUpdate?: (() => void) | (() => void)[];
96
+ updated?: (() => void) | (() => void)[];
97
+ activated?: (() => void) | (() => void)[];
98
+ deactivated?: (() => void) | (() => void)[];
99
+ beforeDestroy?: (() => void) | (() => void)[];
100
+ beforeUnmount?: (() => void) | (() => void)[];
101
+ destroyed?: (() => void) | (() => void)[];
102
+ unmounted?: (() => void) | (() => void)[];
103
+ renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
104
+ renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
105
+ errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
106
+ };
107
+ $forceUpdate: () => void;
108
+ $nextTick: typeof import('vue').nextTick;
109
+ $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;
110
+ } & Readonly<{
111
+ title: string;
112
+ showClose: boolean;
113
+ drag: boolean;
114
+ minWidth: number;
115
+ minHeight: number;
116
+ resizable: boolean;
117
+ showMinimize: boolean;
118
+ showMaximize: boolean;
119
+ showDock: boolean;
120
+ showOk: boolean;
121
+ showCancel: boolean;
122
+ okText: string;
123
+ cancelText: string;
124
+ }> & Omit<Readonly<{
125
+ title?: string;
126
+ width?: number;
127
+ height?: number;
128
+ minWidth?: number;
129
+ minHeight?: number;
130
+ resizable?: boolean;
131
+ showClose?: boolean;
132
+ showMinimize?: boolean;
133
+ showMaximize?: boolean;
134
+ showDock?: boolean;
135
+ drag?: boolean;
136
+ showOk?: boolean;
137
+ showCancel?: boolean;
138
+ okText?: string;
139
+ cancelText?: string;
140
+ }> & Readonly<{
141
+ onClose?: ((...args: any[]) => any) | undefined;
142
+ onResize?: ((...args: any[]) => any) | undefined;
143
+ onMove?: ((...args: any[]) => any) | undefined;
144
+ onOk?: ((...args: any[]) => any) | undefined;
145
+ }>, "title" | "showClose" | "drag" | "minWidth" | "minHeight" | "resizable" | "showMinimize" | "showMaximize" | "showDock" | "showOk" | "showCancel" | "okText" | "cancelText"> & import('vue').ShallowUnwrapRef<{}> & {} & import('vue').ComponentCustomProperties & {} & {
146
+ $slots: {
147
+ header?(_: {}): any;
148
+ default?(_: {}): any;
149
+ footer?(_: {}): any;
150
+ };
151
+ }) | null;
152
+ formRef: unknown;
153
+ }, HTMLDivElement>>;
6
154
  export default SwipeLayer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ym-giswidget-2d",
3
- "version": "1.0.58",
3
+ "version": "1.0.59",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -10,6 +10,6 @@
10
10
  "element-plus": "^2.9.0",
11
11
  "jszip": "^3.10.1",
12
12
  "ol": "^9.2.4",
13
- "ym-gis-2d": "1.0.37"
13
+ "ym-gis-2d": "1.0.38"
14
14
  }
15
15
  }