mrxy-yk 1.1.2 → 1.1.4

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 (57) hide show
  1. package/dist/components/adaptive-box/AdaptiveBox.vue.js +168 -5
  2. package/dist/components/adaptive-box/AdaptiveBox.vue3.js +5 -0
  3. package/dist/components/coordinate-pickup/CoordinatePickup.vue.js +300 -6
  4. package/dist/components/coordinate-pickup/CoordinatePickup.vue3.js +5 -0
  5. package/dist/components/drag-drop-box/DragDropBox.vue.js +57 -5
  6. package/dist/components/drag-drop-box/DragDropBox.vue3.js +5 -0
  7. package/dist/components/drag-drop-container/DragDropContainer.vue.js +112 -5
  8. package/dist/components/drag-drop-container/DragDropContainer.vue3.js +5 -0
  9. package/dist/components/echarts-canvas/EChartsCanvas.vue.js +79 -5
  10. package/dist/components/echarts-canvas/EChartsCanvas.vue3.js +5 -0
  11. package/dist/components/index.js +28 -12
  12. package/dist/components/position-anchor/PositionAnchor.vue.js +20 -5
  13. package/dist/components/position-anchor/PositionAnchor.vue3.js +5 -0
  14. package/dist/components/progress-bar/ProgressBar.vue.js +124 -5
  15. package/dist/components/progress-bar/ProgressBar.vue3.js +5 -0
  16. package/dist/components/progress-ring/ProgressRing.vue.js +85 -5
  17. package/dist/components/progress-ring/ProgressRing.vue3.js +5 -0
  18. package/dist/components/scroll-container/ScrollContainer.vue.js +88 -5
  19. package/dist/components/scroll-container/ScrollContainer.vue3.js +5 -0
  20. package/dist/components/show-log/ShowLog.vue.js +60 -5
  21. package/dist/components/show-log/ShowLog.vue3.js +5 -0
  22. package/dist/components/ys-video/YsVideo.vue.js +121 -5
  23. package/dist/components/ys-video/YsVideo.vue3.js +5 -0
  24. package/dist/components/ys-video/components/BtnLineRec.vue.js +55 -5
  25. package/dist/components/ys-video/components/BtnLineRec.vue3.js +5 -0
  26. package/dist/element-plus/components/images/Images.vue.js +91 -5
  27. package/dist/element-plus/components/images/Images.vue3.js +5 -0
  28. package/dist/element-plus/components/pagination/Pagination.vue.js +64 -5
  29. package/dist/element-plus/components/pagination/Pagination.vue3.js +5 -0
  30. package/dist/element-plus/components/upload/select-file/SelectFile.vue.js +64 -5
  31. package/dist/element-plus/components/upload/select-file/SelectFile.vue3.js +5 -0
  32. package/dist/element-plus/components/upload/upload-files/UploadFiles.vue.js +190 -5
  33. package/dist/element-plus/components/upload/upload-files/UploadFiles.vue3.js +5 -0
  34. package/dist/element-plus/components/upload/upload-images/UploadImages.vue.js +198 -5
  35. package/dist/element-plus/components/upload/upload-images/UploadImages.vue3.js +5 -0
  36. package/dist/styles/index.css +1 -1
  37. package/dist/type.d.ts +7 -8
  38. package/package.json +1 -1
  39. package/web-types.json +1 -1
  40. package/dist/_virtual/_plugin-vue_export-helper.js +0 -10
  41. package/dist/components/adaptive-box/AdaptiveBox.vue2.js +0 -170
  42. package/dist/components/coordinate-pickup/CoordinatePickup.vue2.js +0 -302
  43. package/dist/components/drag-drop-box/DragDropBox.vue2.js +0 -59
  44. package/dist/components/drag-drop-container/DragDropContainer.vue2.js +0 -114
  45. package/dist/components/echarts-canvas/EChartsCanvas.vue2.js +0 -81
  46. package/dist/components/position-anchor/PositionAnchor.vue2.js +0 -22
  47. package/dist/components/progress-bar/ProgressBar.vue2.js +0 -126
  48. package/dist/components/progress-ring/ProgressRing.vue2.js +0 -87
  49. package/dist/components/scroll-container/ScrollContainer.vue2.js +0 -90
  50. package/dist/components/show-log/ShowLog.vue2.js +0 -61
  51. package/dist/components/ys-video/YsVideo.vue2.js +0 -122
  52. package/dist/components/ys-video/components/BtnLineRec.vue2.js +0 -57
  53. package/dist/element-plus/components/images/Images.vue2.js +0 -93
  54. package/dist/element-plus/components/pagination/Pagination.vue2.js +0 -66
  55. package/dist/element-plus/components/upload/select-file/SelectFile.vue2.js +0 -66
  56. package/dist/element-plus/components/upload/upload-files/UploadFiles.vue2.js +0 -192
  57. package/dist/element-plus/components/upload/upload-images/UploadImages.vue2.js +0 -200
@@ -1,7 +1,170 @@
1
- import _sfc_main from "./AdaptiveBox.vue2.js";
2
- /* empty css */
3
- import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- var AdaptiveBox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e8305a54"]]);
1
+ import { defineComponent, onMounted, onBeforeUnmount, useTemplateRef, ref, createElementBlock, openBlock, createElementVNode, normalizeStyle, unref, renderSlot } from "vue";
2
+ import { ObjectUtil } from "../../utils/prototype/lib/ObjectUtil.js";
3
+ const _hoisted_1 = { class: "adaptive-box" };
4
+ const errorValue = 0.01;
5
+ var _sfc_main = /* @__PURE__ */ defineComponent({
6
+ __name: "AdaptiveBox",
7
+ props: {
8
+ reference: { default: void 0 },
9
+ minWidth: { default: -Infinity },
10
+ maxWidth: { default: Infinity },
11
+ updateWidth: { type: Boolean, default: false },
12
+ observeNodeUpdate: { type: Boolean, default: false },
13
+ mode: { default: "equal-width" }
14
+ },
15
+ setup(__props, { expose: __expose }) {
16
+ const props = __props;
17
+ onMounted(function() {
18
+ initReference();
19
+ resize();
20
+ initResizeMonitor();
21
+ });
22
+ onBeforeUnmount(function() {
23
+ removeResizeMonitor();
24
+ });
25
+ let _reference = null;
26
+ const adaptiveBoxRef = useTemplateRef("adaptiveBoxRef");
27
+ const adaptiveContentRef = useTemplateRef("adaptiveContentRef");
28
+ function initReference() {
29
+ _reference = props.reference ?? window;
30
+ resizeHandel = resizeType[props.mode];
31
+ }
32
+ const resizeType = {
33
+ "equal-width": resizeIsEqualWidth,
34
+ contain: resizeIsContain,
35
+ "full-height": resizeIsFullHeight
36
+ };
37
+ let resizeHandel = null;
38
+ function resize() {
39
+ if (resizeHandel) resizeHandel();
40
+ }
41
+ function resizeIsEqualWidth() {
42
+ const referenceWidth = isWindow(_reference) ? _reference.innerWidth : _reference.offsetWidth;
43
+ const $content = adaptiveContentRef.value;
44
+ let scale = referenceWidth / $content.offsetWidth;
45
+ let width = $content.offsetWidth * scale;
46
+ if (props.minWidth && width < props.minWidth) {
47
+ scale = props.minWidth / $content.scrollWidth;
48
+ width = props.minWidth;
49
+ }
50
+ if (props.maxWidth && width > props.maxWidth) {
51
+ scale = props.maxWidth / $content.scrollWidth;
52
+ width = props.maxWidth;
53
+ }
54
+ if (Math.abs(1 - scale) < errorValue) scale = 1;
55
+ $content.style.transform = `scale(${scale})`;
56
+ const height = $content.offsetHeight * scale;
57
+ adaptiveBoxRef.value.style.height = `${height}px`;
58
+ if (props.updateWidth) {
59
+ adaptiveBoxRef.value.style.width = `${width}px`;
60
+ }
61
+ }
62
+ function resizeIsContain() {
63
+ let referenceWidth;
64
+ let referenceHeight;
65
+ if (isWindow(_reference)) {
66
+ referenceWidth = _reference.innerWidth;
67
+ referenceHeight = _reference.innerHeight;
68
+ } else {
69
+ referenceWidth = _reference.offsetWidth;
70
+ referenceHeight = _reference.offsetHeight;
71
+ }
72
+ const $content = adaptiveContentRef.value;
73
+ let scale = referenceWidth / $content.offsetWidth;
74
+ let height = $content.offsetHeight * scale;
75
+ let width = $content.offsetWidth * scale;
76
+ if (height > referenceHeight) {
77
+ scale = referenceHeight / $content.offsetHeight;
78
+ height = $content.offsetHeight * scale;
79
+ width = $content.offsetWidth * scale;
80
+ }
81
+ if (Math.abs(1 - scale) < errorValue) scale = 1;
82
+ $content.style.transform = `scale(${scale})`;
83
+ adaptiveBoxRef.value.style.height = `${height}px`;
84
+ adaptiveBoxRef.value.style.width = `${width}px`;
85
+ }
86
+ const fullHeight = ref("");
87
+ function resizeIsFullHeight() {
88
+ let referenceWidth;
89
+ let referenceHeight;
90
+ if (isWindow(_reference)) {
91
+ referenceWidth = _reference.innerWidth;
92
+ referenceHeight = _reference.innerHeight;
93
+ } else {
94
+ referenceWidth = _reference.offsetWidth;
95
+ referenceHeight = _reference.offsetHeight;
96
+ }
97
+ const $content = adaptiveContentRef.value;
98
+ let scale = referenceWidth / $content.offsetWidth;
99
+ let width = $content.offsetWidth * scale;
100
+ if (props.minWidth && width < props.minWidth) {
101
+ scale = props.minWidth / $content.scrollWidth;
102
+ width = props.minWidth;
103
+ }
104
+ if (props.maxWidth && width > props.maxWidth) {
105
+ scale = props.maxWidth / $content.scrollWidth;
106
+ width = props.maxWidth;
107
+ }
108
+ if (Math.abs(1 - scale) < errorValue) scale = 1;
109
+ $content.style.transform = `scale(${scale})`;
110
+ const height = referenceHeight / scale;
111
+ adaptiveBoxRef.value.style.height = `${referenceHeight}px`;
112
+ adaptiveContentRef.value.style.height = fullHeight.value = `${height}px`;
113
+ if (props.updateWidth) {
114
+ adaptiveBoxRef.value.style.width = `${width}px`;
115
+ }
116
+ }
117
+ function isWindow(obj) {
118
+ return obj === window;
119
+ }
120
+ function initResizeMonitor() {
121
+ if (isWindow(_reference)) window.addEventListener("resize", resize);
122
+ else loadResizeObserver();
123
+ if (props.observeNodeUpdate) observeNode();
124
+ }
125
+ function removeResizeMonitor() {
126
+ window.removeEventListener("resize", resize);
127
+ if (observer) observer.disconnect();
128
+ if (resizeObserver) resizeObserver.disconnect();
129
+ }
130
+ let resizeObserver = null;
131
+ function loadResizeObserver() {
132
+ if (!isWindow(_reference)) {
133
+ resizeObserver = new ResizeObserver(ObjectUtil.debounce(resize, 50));
134
+ resizeObserver.observe(_reference);
135
+ }
136
+ }
137
+ let observer = null;
138
+ function observeNode() {
139
+ const config = {
140
+ attributes: true,
141
+ childList: true,
142
+ subtree: true
143
+ };
144
+ observer = new MutationObserver(resize);
145
+ observer.observe(adaptiveBoxRef.value, config);
146
+ }
147
+ __expose({ resize });
148
+ return (_ctx, _cache) => {
149
+ return openBlock(), createElementBlock("div", _hoisted_1, [
150
+ createElementVNode("div", {
151
+ ref_key: "adaptiveBoxRef",
152
+ ref: adaptiveBoxRef,
153
+ class: "adaptive-box__body"
154
+ }, [
155
+ createElementVNode("div", {
156
+ ref_key: "adaptiveContentRef",
157
+ ref: adaptiveContentRef,
158
+ class: "adaptive-box__content",
159
+ style: normalizeStyle({ "--adaptive-height": unref(fullHeight) })
160
+ }, [
161
+ renderSlot(_ctx.$slots, "default")
162
+ ], 4)
163
+ ], 512)
164
+ ]);
165
+ };
166
+ }
167
+ });
5
168
  export {
6
- AdaptiveBox as default
169
+ _sfc_main as default
7
170
  };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./AdaptiveBox.vue.js";
2
+ /* empty css */
3
+ export {
4
+ _sfc_main as default
5
+ };
@@ -1,8 +1,302 @@
1
- import _sfc_main from "./CoordinatePickup.vue2.js";
2
- /* empty css */
3
- /* empty css */
4
- import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
5
- var CoordinatePickup = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-50d6439a"]]);
1
+ import { ElDialog, ElForm, ElFormItem, ElAutocomplete, ElInput, ElButton, ElCheckbox } from "element-plus/es";
2
+ import { defineComponent, onMounted, watch, nextTick, computed, ref, onUnmounted, createBlock, openBlock, withCtx, createVNode, createElementVNode, toDisplayString, createElementBlock, createCommentVNode, createTextVNode } from "vue";
3
+ import { ElMessage } from "element-plus";
4
+ import { AMapLoader } from "../../utils/amap/index.js";
5
+ import { AMapConfig } from "../../config/index.js";
6
+ const _hoisted_1 = { class: "autocomplete-subtitle" };
7
+ const _hoisted_2 = { key: 0 };
8
+ const _hoisted_3 = { key: 1 };
9
+ var _sfc_main = /* @__PURE__ */ defineComponent({
10
+ __name: "CoordinatePickup",
11
+ props: {
12
+ modelValue: { type: Boolean },
13
+ lnglat: {},
14
+ address: {},
15
+ regeocodeRequired: { type: Boolean, default: false },
16
+ mapKey: {},
17
+ mapSecret: {},
18
+ modal: { type: Boolean },
19
+ mapStyle: {}
20
+ },
21
+ emits: ["change", "update:modelValue", "update:lnglat", "update:address", "open"],
22
+ setup(__props, { emit: __emit }) {
23
+ const props = __props;
24
+ const emits = __emit;
25
+ onMounted(() => {
26
+ if (props.modelValue) {
27
+ loadAMap();
28
+ }
29
+ });
30
+ const mapKey = props.mapKey || AMapConfig.mapKey;
31
+ const mapSecret = props.mapSecret || AMapConfig.mapSecret;
32
+ watch(() => props.modelValue, (nv) => {
33
+ if (nv && !map) {
34
+ nextTick(() => {
35
+ loadAMap();
36
+ });
37
+ } else {
38
+ placeSearch.clear();
39
+ showMarker(props.lnglat, props.address);
40
+ emits("open", map);
41
+ }
42
+ });
43
+ const changeDialogCustomer = computed({
44
+ get() {
45
+ return props.modelValue;
46
+ },
47
+ set(val) {
48
+ emits("update:modelValue", val);
49
+ }
50
+ });
51
+ const searchParam = ref("");
52
+ const pickupForm = ref({
53
+ lnglat: "",
54
+ address: ""
55
+ });
56
+ const submitHandler = async () => {
57
+ if (regeocode && regeocode.lnglat !== pickupForm.value.lnglat) regeocode = null;
58
+ if (props.regeocodeRequired && !regeocode && pickupForm.value.lnglat) {
59
+ await getAddressBylnglat(pickupForm.value.lnglat);
60
+ }
61
+ emits("change", { value: pickupForm.value, regeocode });
62
+ emits("update:lnglat", pickupForm.value.lnglat);
63
+ emits("update:address", pickupForm.value.address);
64
+ emits("update:modelValue", false);
65
+ };
66
+ let AMap = null;
67
+ let map = null;
68
+ const coordinatePickupRef = ref();
69
+ function loadAMap() {
70
+ AMapLoader({
71
+ key: mapKey,
72
+ secret: mapSecret,
73
+ el: coordinatePickupRef.value,
74
+ plugins: ["AMap.PlaceSearch", "AMap.AutoComplete", "AMap.Geocoder"],
75
+ mapStyle: props.mapStyle
76
+ }).then((res) => {
77
+ AMap = res.AMap;
78
+ map = res.map;
79
+ satelliteLayer = new AMap["TileLayer"].Satellite();
80
+ map.on("click", clickHandler);
81
+ autoComplete = new AMap["Autocomplete"]({ city: "全国" });
82
+ placeSearch = new AMap["PlaceSearch"]({ map, city: "全国", autoFitView: true });
83
+ placeSearch.on("markerClick", placeMarkerClick);
84
+ geocoder = new AMap["Geocoder"]();
85
+ showMarker(props.lnglat, props.address);
86
+ emits("open", { map, AMap });
87
+ });
88
+ }
89
+ const clickHandler = async (e) => {
90
+ const { lng, lat } = e.lnglat;
91
+ const lnglat = `${lng},${lat}`;
92
+ const address = await getAddressBylnglat(lnglat);
93
+ showMarker(lnglat, address);
94
+ };
95
+ onUnmounted(function() {
96
+ if (map) {
97
+ map.off("click", clickHandler);
98
+ map.destroy();
99
+ }
100
+ });
101
+ let autoComplete = null;
102
+ const searchComplete = (queryString, cb) => {
103
+ const empty = [];
104
+ if (queryString.length === 0) {
105
+ cb(empty);
106
+ } else {
107
+ autoComplete.search(queryString, function(status, result) {
108
+ if (result.info === "OK") {
109
+ result.tips.unshift({ name: queryString });
110
+ cb(result.tips);
111
+ } else {
112
+ cb(empty);
113
+ }
114
+ });
115
+ }
116
+ };
117
+ function handleSelect(item) {
118
+ if (!item.address || !item.location) {
119
+ placeSearchHandler(item.name);
120
+ } else {
121
+ placeSearch.clear();
122
+ const { lng, lat } = item.location;
123
+ const lnglat = [lng, lat].join(",");
124
+ let address = item.district;
125
+ if (item.district.includes(item.name)) {
126
+ address += item.name;
127
+ }
128
+ showMarker(lnglat, address);
129
+ }
130
+ }
131
+ let placeSearch = null;
132
+ function placeSearchHandler(queryString) {
133
+ placeSearch.search(queryString, function(status, result) {
134
+ if (result.info === "TIP_CITIES") {
135
+ ElMessage.info("条件内结果过多请精确搜索");
136
+ }
137
+ });
138
+ }
139
+ function placeMarkerClick(e) {
140
+ const { lng, lat } = e.data.location;
141
+ pickupForm.value.lnglat = `${lng},${lat}`;
142
+ const data = e.data;
143
+ let _address = data.pname;
144
+ if (data.pname !== data.cityname) {
145
+ _address += data.cityname;
146
+ }
147
+ _address += data.adname + data.name;
148
+ pickupForm.value.address = _address;
149
+ }
150
+ let geocoder = null;
151
+ let regeocode = null;
152
+ function getAddressBylnglat(lnglat) {
153
+ const position = lnglat.split(",");
154
+ return new Promise(function(resolve) {
155
+ geocoder.getAddress(position, function(status, result) {
156
+ if (status === "complete" && result.regeocode) {
157
+ result.regeocode.lnglat = lnglat;
158
+ regeocode = result.regeocode;
159
+ resolve(result.regeocode.formattedAddress);
160
+ } else {
161
+ regeocode = null;
162
+ resolve("");
163
+ }
164
+ });
165
+ });
166
+ }
167
+ let marker = null;
168
+ function showMarker(lnglat, address) {
169
+ if (lnglat) {
170
+ const position = lnglat.split(",");
171
+ if (marker) {
172
+ marker.setPosition(position);
173
+ marker.setTitle(address || "-");
174
+ } else {
175
+ marker = new AMap.Marker({
176
+ map,
177
+ position,
178
+ title: address
179
+ });
180
+ }
181
+ map.setCenter(position);
182
+ pickupForm.value = { lnglat, address };
183
+ }
184
+ }
185
+ let satelliteLayer = null;
186
+ const isSatelliteLayer = ref(false);
187
+ function setSatelliteLayer() {
188
+ if (isSatelliteLayer.value) {
189
+ map.add(satelliteLayer);
190
+ } else {
191
+ map.remove(satelliteLayer);
192
+ }
193
+ }
194
+ return (_ctx, _cache) => {
195
+ const _component_el_autocomplete = ElAutocomplete;
196
+ const _component_el_form_item = ElFormItem;
197
+ const _component_el_input = ElInput;
198
+ const _component_el_button = ElButton;
199
+ const _component_el_checkbox = ElCheckbox;
200
+ const _component_el_form = ElForm;
201
+ const _component_el_dialog = ElDialog;
202
+ return openBlock(), createBlock(_component_el_dialog, {
203
+ modelValue: changeDialogCustomer.value,
204
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => changeDialogCustomer.value = $event),
205
+ title: "坐标拾取",
206
+ "close-on-click-modal": false,
207
+ draggable: "",
208
+ modal: props.modal
209
+ }, {
210
+ default: withCtx(() => [
211
+ createVNode(_component_el_form, {
212
+ class: "yk-coordinate-pickup-form",
213
+ inline: true
214
+ }, {
215
+ default: withCtx(() => [
216
+ createVNode(_component_el_form_item, null, {
217
+ default: withCtx(() => [
218
+ createVNode(_component_el_autocomplete, {
219
+ modelValue: searchParam.value,
220
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => searchParam.value = $event),
221
+ "fetch-suggestions": searchComplete,
222
+ "value-key": "name",
223
+ placeholder: "请输入搜索内容",
224
+ "popper-class": "yk-coordinate-pickup-autocomplete",
225
+ onSelect: handleSelect
226
+ }, {
227
+ default: withCtx((scope) => [
228
+ createElementVNode("div", null, toDisplayString(scope.item.name), 1),
229
+ createElementVNode("div", _hoisted_1, [
230
+ scope.item.district ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(scope.item.district), 1)) : createCommentVNode("", true),
231
+ scope.item.address && scope.item.address.length > 0 ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(scope.item.address), 1)) : createCommentVNode("", true)
232
+ ])
233
+ ]),
234
+ _: 1
235
+ }, 8, ["modelValue"])
236
+ ]),
237
+ _: 1
238
+ }),
239
+ createVNode(_component_el_form_item, null, {
240
+ default: withCtx(() => [
241
+ createVNode(_component_el_input, {
242
+ modelValue: pickupForm.value.lnglat,
243
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => pickupForm.value.lnglat = $event),
244
+ placeholder: "拾取坐标"
245
+ }, null, 8, ["modelValue"])
246
+ ]),
247
+ _: 1
248
+ }),
249
+ createVNode(_component_el_form_item, null, {
250
+ default: withCtx(() => [
251
+ createVNode(_component_el_input, {
252
+ modelValue: pickupForm.value.address,
253
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => pickupForm.value.address = $event),
254
+ placeholder: "地址",
255
+ style: { "width": "300px" }
256
+ }, null, 8, ["modelValue"])
257
+ ]),
258
+ _: 1
259
+ }),
260
+ createVNode(_component_el_form_item, null, {
261
+ default: withCtx(() => [
262
+ createVNode(_component_el_button, {
263
+ disabled: !pickupForm.value.lnglat,
264
+ type: "primary",
265
+ onClick: submitHandler
266
+ }, {
267
+ default: withCtx(() => [..._cache[5] || (_cache[5] = [
268
+ createTextVNode("确认", -1)
269
+ ])]),
270
+ _: 1
271
+ }, 8, ["disabled"])
272
+ ]),
273
+ _: 1
274
+ }),
275
+ createVNode(_component_el_form_item, null, {
276
+ default: withCtx(() => [
277
+ createVNode(_component_el_checkbox, {
278
+ modelValue: isSatelliteLayer.value,
279
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => isSatelliteLayer.value = $event),
280
+ label: "卫星图",
281
+ onChange: setSatelliteLayer
282
+ }, null, 8, ["modelValue"])
283
+ ]),
284
+ _: 1
285
+ })
286
+ ]),
287
+ _: 1
288
+ }),
289
+ createElementVNode("div", {
290
+ ref_key: "coordinatePickupRef",
291
+ ref: coordinatePickupRef,
292
+ class: "coordinate-pickup"
293
+ }, null, 512)
294
+ ]),
295
+ _: 1
296
+ }, 8, ["modelValue", "modal"]);
297
+ };
298
+ }
299
+ });
6
300
  export {
7
- CoordinatePickup as default
301
+ _sfc_main as default
8
302
  };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./CoordinatePickup.vue.js";
2
+ /* empty css */
3
+ export {
4
+ _sfc_main as default
5
+ };
@@ -1,7 +1,59 @@
1
- import _sfc_main from "./DragDropBox.vue2.js";
2
- /* empty css */
3
- import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- var DragDropBox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-382a0b07"]]);
1
+ import { defineComponent, ref, watchEffect, computed, createElementBlock, openBlock, normalizeStyle, unref, renderSlot } from "vue";
2
+ import { ObjectUtil } from "../../utils/prototype/lib/ObjectUtil.js";
3
+ var _sfc_main = /* @__PURE__ */ defineComponent({
4
+ __name: "DragDropBox",
5
+ props: {
6
+ top: { default: "0" },
7
+ left: { default: "0" },
8
+ disabled: { type: Boolean, default: false }
9
+ },
10
+ emits: ["update:top", "update:left"],
11
+ setup(__props, { emit: __emit }) {
12
+ const props = __props;
13
+ const emits = __emit;
14
+ let downPoint = null;
15
+ let downRefPoint = null;
16
+ const translate = ref({ x: 0, y: 0 });
17
+ watchEffect(() => {
18
+ if (props.top) translate.value.y = Number(props.top.replace("px", ""));
19
+ if (props.left) translate.value.x = Number(props.left.replace("px", ""));
20
+ });
21
+ const translateStyle = computed(() => {
22
+ return { left: translate.value.x + "px", top: translate.value.y + "px" };
23
+ });
24
+ const mousedown = (e) => {
25
+ if (props.disabled) return;
26
+ downPoint = { x: e.x, y: e.y };
27
+ downRefPoint = ObjectUtil.toJSON(translate.value);
28
+ document.addEventListener("mousemove", mousemove);
29
+ document.addEventListener("mouseup", mouseup);
30
+ };
31
+ const mousemove = (e) => {
32
+ const offsetPoint = {
33
+ x: e.x - downPoint.x,
34
+ y: e.y - downPoint.y
35
+ };
36
+ translate.value.x = downRefPoint.x + offsetPoint.x;
37
+ translate.value.y = downRefPoint.y + offsetPoint.y;
38
+ };
39
+ const mouseup = () => {
40
+ document.removeEventListener("mousemove", mousemove);
41
+ document.removeEventListener("mouseup", mouseup);
42
+ emits("update:top", translate.value.y + "px");
43
+ emits("update:left", translate.value.x + "px");
44
+ };
45
+ return (_ctx, _cache) => {
46
+ return openBlock(), createElementBlock("div", {
47
+ class: "yk-drag-drop-box",
48
+ ondragstart: "return false",
49
+ style: normalizeStyle(unref(translateStyle)),
50
+ onMousedown: mousedown
51
+ }, [
52
+ renderSlot(_ctx.$slots, "default")
53
+ ], 36);
54
+ };
55
+ }
56
+ });
5
57
  export {
6
- DragDropBox as default
58
+ _sfc_main as default
7
59
  };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./DragDropBox.vue.js";
2
+ /* empty css */
3
+ export {
4
+ _sfc_main as default
5
+ };
@@ -1,7 +1,114 @@
1
- import _sfc_main from "./DragDropContainer.vue2.js";
2
- /* empty css */
3
- import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- var DragDropContainer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3f6ac8f9"]]);
1
+ import { defineComponent, ref, createElementBlock, openBlock, createElementVNode, normalizeStyle, renderSlot } from "vue";
2
+ import { ObjectUtil } from "../../utils/prototype/lib/ObjectUtil.js";
3
+ var _sfc_main = /* @__PURE__ */ defineComponent({
4
+ __name: "DragDropContainer",
5
+ props: {
6
+ step: { default: 0.1 },
7
+ scale: { type: Boolean, default: true }
8
+ },
9
+ setup(__props, { expose: __expose }) {
10
+ const props = __props;
11
+ let downPoint = null;
12
+ let downRefPoint = null;
13
+ const translate = ref({ x: 0, y: 0 });
14
+ const _scale = ref(1);
15
+ const mousedown = (e) => {
16
+ downPoint = {
17
+ x: e.x,
18
+ y: e.y
19
+ };
20
+ downRefPoint = ObjectUtil.toJSON(translate.value);
21
+ document.addEventListener("mousemove", mousemove);
22
+ document.addEventListener("mouseup", mouseup);
23
+ };
24
+ const mousemove = (e) => {
25
+ const offsetPoint = {
26
+ x: e.x - downPoint.x,
27
+ y: e.y - downPoint.y
28
+ };
29
+ translate.value.x = downRefPoint.x + offsetPoint.x;
30
+ translate.value.y = downRefPoint.y + offsetPoint.y;
31
+ };
32
+ const mouseup = () => {
33
+ document.removeEventListener("mousemove", mousemove);
34
+ document.removeEventListener("mouseup", mouseup);
35
+ };
36
+ const mouseover = () => {
37
+ if (props.scale) {
38
+ document.addEventListener("mousewheel", mousewheel, { passive: false });
39
+ }
40
+ };
41
+ const mouseout = () => {
42
+ document.removeEventListener("mousewheel", mousewheel);
43
+ };
44
+ const mousewheel = (e) => {
45
+ e.preventDefault();
46
+ if (e.deltaY > 0) {
47
+ if (_scale.value - props.step >= 0) {
48
+ _scale.value = _scale.value - props.step;
49
+ }
50
+ } else {
51
+ _scale.value = _scale.value + props.step;
52
+ }
53
+ };
54
+ const reset = () => {
55
+ translate.value.x = 0;
56
+ translate.value.y = 0;
57
+ _scale.value = 1;
58
+ };
59
+ const dragDropRef = ref();
60
+ const dragDropContentRef = ref();
61
+ const autoSize = () => {
62
+ if (dragDropRef.value && dragDropContentRef.value) {
63
+ const width = dragDropRef.value?.offsetWidth;
64
+ const height = dragDropRef.value?.offsetHeight;
65
+ const cWidth = dragDropContentRef.value?.offsetWidth;
66
+ const cHeight = dragDropContentRef.value?.offsetHeight;
67
+ const hScale = height / cHeight;
68
+ const wScale = width / cWidth;
69
+ _scale.value = hScale * cWidth <= width ? hScale : wScale;
70
+ translate.value.y = -(cHeight - cHeight * hScale) / 2;
71
+ translate.value.x = -(cWidth - cWidth * wScale) / 2;
72
+ }
73
+ };
74
+ function getOption() {
75
+ return {
76
+ translate: translate.value,
77
+ scale: _scale.value
78
+ };
79
+ }
80
+ function setOption(option) {
81
+ translate.value = option.translate;
82
+ _scale.value = option.scale;
83
+ }
84
+ __expose({
85
+ reset,
86
+ autoSize,
87
+ getOption,
88
+ setOption
89
+ });
90
+ return (_ctx, _cache) => {
91
+ return openBlock(), createElementBlock("div", {
92
+ ref_key: "dragDropRef",
93
+ ref: dragDropRef,
94
+ class: "yk-drag-drop-container",
95
+ ondragstart: "return false",
96
+ onMousedown: mousedown,
97
+ onMouseout: mouseout,
98
+ onMouseover: mouseover
99
+ }, [
100
+ createElementVNode("div", {
101
+ ref_key: "dragDropContentRef",
102
+ ref: dragDropContentRef,
103
+ class: "drag-drop-content",
104
+ style: normalizeStyle({ transform: `translate(${translate.value.x}px,${translate.value.y}px) scale(${_scale.value})` })
105
+ }, [
106
+ renderSlot(_ctx.$slots, "default")
107
+ ], 4)
108
+ ], 544);
109
+ };
110
+ }
111
+ });
5
112
  export {
6
- DragDropContainer as default
113
+ _sfc_main as default
7
114
  };