@vunk/form 1.1.76 → 1.1.79
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.
- package/components/_plugin-vue_export-helper.mjs +9 -0
- package/components/button/{index.js → index.mjs} +33 -29
- package/components/button/src/ctx.d.ts +30 -30
- package/components/button/src/index.vue.d.ts +69 -69
- package/components/cascader/index.css +0 -2
- package/components/cascader/{index.js → index.mjs} +22 -22
- package/components/cascader/src/ctx.d.ts +37 -45
- package/components/cascader/src/index.vue.d.ts +92 -92
- package/components/cascader/src/use.d.ts +1 -1
- package/components/checkbox/index.css +0 -9
- package/components/checkbox/{index.js → index.mjs} +45 -42
- package/components/checkbox/src/ctx.d.ts +29 -32
- package/components/checkbox/src/index.vue.d.ts +65 -65
- package/components/color-picker/{index.js → index.mjs} +24 -23
- package/components/color-picker/src/ctx.d.ts +29 -29
- package/components/color-picker/src/index.vue.d.ts +77 -64
- package/components/date-picker/{index.js → index.mjs} +28 -25
- package/components/date-picker/src/ctx.d.ts +49 -49
- package/components/date-picker/src/index.vue.d.ts +104 -104
- package/components/download-plus/index.css +0 -6
- package/components/download-plus/{index.js → index.mjs} +119 -147
- package/components/download-plus/src/api.d.ts +1 -1
- package/components/download-plus/src/ctx.d.ts +27 -26
- package/components/download-plus/src/index.vue.d.ts +59 -59
- package/components/esri-input-geojson/index.css +0 -10
- package/components/esri-input-geojson/index.mjs +1109 -0
- package/components/esri-input-geojson/src/append.vue.d.ts +1 -1
- package/components/esri-input-geojson/src/ctx.d.ts +49 -72
- package/components/esri-input-geojson/src/index.vue.d.ts +138 -158
- package/components/esri-input-geojson/src/types.d.ts +0 -1
- package/components/esri-input-geojson/src/viewer.vue.d.ts +18 -19
- package/components/form/{index.js → index.mjs} +31 -27
- package/components/form/src/ctx.d.ts +13 -297
- package/components/form/src/index.vue.d.ts +97 -659
- package/components/form-item/index.css +0 -8
- package/components/form-item/{index.js → index.mjs} +22 -19
- package/components/form-item/src/ctx.d.ts +13 -11
- package/components/form-item/src/index.vue.d.ts +20 -20
- package/components/form-item-renderer/{index.js → index.mjs} +9 -7
- package/components/form-item-renderer/src/index.vue.d.ts +1 -1
- package/components/form-item-renderer-template/{index.js → index.mjs} +7 -7
- package/components/geoinput/{index.js → index.mjs} +10 -17
- package/components/geoinput/src/ctx.d.ts +48 -60
- package/components/geoinput/src/index.vue.d.ts +114 -132
- package/components/geoinput-read/index.css +0 -2
- package/components/geoinput-read/{index.js → index.mjs} +101 -109
- package/components/geoinput-read/src/core.vue.d.ts +123 -142
- package/components/geoinput-read/src/ctx.d.ts +50 -74
- package/components/geoinput-read/src/index.vue.d.ts +102 -120
- package/components/geoinput-update/index.css +0 -6
- package/components/geoinput-update/index.mjs +399 -0
- package/components/geoinput-update/src/ctx.d.ts +49 -69
- package/components/geoinput-update/src/index.vue.d.ts +126 -141
- package/components/index.mjs +11 -0
- package/components/index2.mjs +306 -0
- package/components/index3.mjs +484 -0
- package/components/input/{index.js → index.mjs} +31 -27
- package/components/input/src/ctx.d.ts +47 -66
- package/components/input/src/index.vue.d.ts +101 -113
- package/components/input-link/index.css +0 -2
- package/components/input-link/index.mjs +151 -0
- package/components/input-link/src/ctx.d.ts +40 -56
- package/components/input-link/src/index.vue.d.ts +89 -101
- package/components/input-number/index.css +0 -2
- package/components/input-number/{index.js → index.mjs} +25 -25
- package/components/input-number/src/ctx.d.ts +31 -37
- package/components/input-number/src/index.vue.d.ts +71 -71
- package/components/radio/index.css +0 -6
- package/components/radio/{index.js → index.mjs} +50 -47
- package/components/radio/src/ctx.d.ts +29 -29
- package/components/radio/src/index.vue.d.ts +64 -64
- package/components/select/index.css +0 -2
- package/components/select/{index.js → index.mjs} +49 -48
- package/components/select/src/ctx.d.ts +31 -85
- package/components/select/src/index.vue.d.ts +121 -230
- package/components/slider/{index.js → index.mjs} +28 -24
- package/components/slider/src/ctx.d.ts +35 -35
- package/components/slider/src/index.vue.d.ts +93 -93
- package/components/switch/index.css +0 -2
- package/components/switch/{index.js → index.mjs} +29 -24
- package/components/switch/src/ctx.d.ts +40 -40
- package/components/switch/src/index.vue.d.ts +91 -91
- package/components/templates-default/index.mjs +302 -0
- package/components/templates-default/src/ctx.d.ts +2 -4
- package/components/templates-default/src/index.vue.d.ts +2 -8
- package/components/templates-element-plus/index.mjs +106 -0
- package/components/templates-esri/index.mjs +59 -0
- package/components/templates-layout/index.css +0 -3
- package/components/templates-layout/index.mjs +131 -0
- package/components/templates-mapbox/index.mjs +59 -0
- package/components/upload/index.css +0 -7
- package/components/upload/index.mjs +501 -0
- package/components/upload/src/ctx.d.ts +36 -38
- package/components/upload/src/file.vue.d.ts +22 -21
- package/components/upload/src/index.vue.d.ts +78 -78
- package/components/upload-plus/index.css +4 -8
- package/components/upload-plus/{index.js → index.mjs} +9497 -926
- package/components/upload-plus/src/api.d.ts +1 -1
- package/components/upload-plus/src/ctx.d.ts +25 -28
- package/components/upload-plus/src/index.vue.d.ts +58 -58
- package/components/van-cascader/index.css +0 -2
- package/components/van-cascader/{index.js → index.mjs} +41 -44
- package/components/van-cascader/src/ctx.d.ts +35 -35
- package/components/van-cascader/src/index.vue.d.ts +82 -82
- package/components/var-datetime-picker/index.css +0 -2
- package/components/var-datetime-picker/index.mjs +324 -0
- package/components/var-datetime-picker/src/ctx.d.ts +27 -26
- package/components/var-datetime-picker/src/index.vue.d.ts +57 -57
- package/components/vditor/{index.js → index.mjs} +9 -14
- package/components/vditor/src/ctx.d.ts +2 -1
- package/components/vditor/src/index.vue.d.ts +2 -3
- package/composables/index.mjs +85 -0
- package/composables/useSourceManager.d.ts +2 -2
- package/defaults.d.ts +1 -1
- package/index.css +4 -169
- package/index.d.ts +1 -1
- package/index.esm.js +44 -1
- package/package.json +246 -2
- package/shared/const/index.d.ts +1 -1
- package/shared/const/index.mjs +56 -0
- package/shared/element-plus/ctx.d.ts +26 -94
- package/shared/element-plus/index.mjs +285 -0
- package/shared/element-plus/instances.d.ts +29 -28
- package/shared/form/index.mjs +30 -0
- package/shared/helper/index.mjs +9 -0
- package/shared/index.mjs +1 -0
- package/shared/infer-prop/index.mjs +34 -0
- package/shared/progress-it/index.mjs +38 -0
- package/shared/rules/index.mjs +53 -0
- package/shared/upload/index.mjs +771 -0
- package/components/button/src/ctx.js +0 -1
- package/components/cascader/src/ctx.js +0 -1
- package/components/cascader/src/types.js +0 -1
- package/components/cascader/src/use.js +0 -1
- package/components/checkbox/src/ctx.js +0 -1
- package/components/checkbox/src/index.css +0 -1
- package/components/checkbox/src/types.js +0 -1
- package/components/color-picker/index.css +0 -1
- package/components/color-picker/src/ctx.js +0 -1
- package/components/color-picker/src/index.css +0 -1
- package/components/color-picker/src/types.js +0 -1
- package/components/date-picker/index.css +0 -1
- package/components/date-picker/src/ctx.js +0 -1
- package/components/date-picker/src/index.css +0 -1
- package/components/date-picker/src/types.js +0 -1
- package/components/download-plus/src/api.js +0 -1
- package/components/download-plus/src/const.js +0 -1
- package/components/download-plus/src/ctx.js +0 -1
- package/components/download-plus/src/index.css +0 -1
- package/components/download-plus/src/types.js +0 -1
- package/components/esri-input-geojson/index.js +0 -1563
- package/components/esri-input-geojson/src/const.js +0 -1
- package/components/esri-input-geojson/src/ctx.js +0 -1
- package/components/esri-input-geojson/src/index.css +0 -1
- package/components/esri-input-geojson/src/types.js +0 -1
- package/components/form/index.css +0 -1
- package/components/form/src/ctx.js +0 -1
- package/components/form/src/index.css +0 -1
- package/components/form/src/types.js +0 -1
- package/components/form/src/utils.js +0 -1
- package/components/form-item/src/ctx.js +0 -1
- package/components/form-item/src/index.css +0 -1
- package/components/form-item/src/types.js +0 -1
- package/components/form-item-renderer/index.css +0 -1
- package/components/form-item-renderer/src/ctx.js +0 -1
- package/components/form-item-renderer/src/index.css +0 -1
- package/components/form-item-renderer/src/symbols.js +0 -1
- package/components/form-item-renderer/src/types.js +0 -1
- package/components/form-item-renderer-template/index.css +0 -1
- package/components/form-item-renderer-template/src/ctx.js +0 -1
- package/components/form-item-renderer-template/src/index.css +0 -1
- package/components/form-item-renderer-template/src/types.js +0 -1
- package/components/geoinput/index.css +0 -1
- package/components/geoinput/src/ctx.js +0 -1
- package/components/geoinput/src/index.css +0 -1
- package/components/geoinput/src/types.js +0 -1
- package/components/geoinput-read/src/ctx.js +0 -1
- package/components/geoinput-read/src/index.css +0 -1
- package/components/geoinput-read/src/types.js +0 -1
- package/components/geoinput-update/index.js +0 -930
- package/components/geoinput-update/src/ctx.js +0 -1
- package/components/geoinput-update/src/index.css +0 -1
- package/components/geoinput-update/src/types.js +0 -1
- package/components/input/index.css +0 -1
- package/components/input/src/ctx.js +0 -1
- package/components/input/src/index.css +0 -1
- package/components/input/src/types.js +0 -1
- package/components/input-link/index.js +0 -163
- package/components/input-link/src/ctx.js +0 -1
- package/components/input-link/src/index.css +0 -1
- package/components/input-link/src/types.js +0 -1
- package/components/input-number/src/ctx.js +0 -1
- package/components/input-number/src/index.css +0 -1
- package/components/input-number/src/types.js +0 -1
- package/components/radio/src/ctx.js +0 -1
- package/components/radio/src/index.css +0 -1
- package/components/radio/src/types.js +0 -1
- package/components/select/src/ctx.js +0 -1
- package/components/select/src/index.css +0 -1
- package/components/select/src/types.js +0 -1
- package/components/slider/index.css +0 -1
- package/components/slider/src/ctx.js +0 -1
- package/components/slider/src/index.css +0 -1
- package/components/slider/src/types.js +0 -1
- package/components/switch/src/ctx.js +0 -1
- package/components/switch/src/index.css +0 -1
- package/components/switch/src/types.js +0 -1
- package/components/templates-default/index.css +0 -1
- package/components/templates-default/index.js +0 -347
- package/components/templates-default/src/ctx.js +0 -1
- package/components/templates-default/src/index.css +0 -1
- package/components/templates-default/src/types.js +0 -1
- package/components/templates-element-plus/index.css +0 -1
- package/components/templates-element-plus/index.js +0 -110
- package/components/templates-element-plus/src/ctx.js +0 -1
- package/components/templates-element-plus/src/index.css +0 -1
- package/components/templates-element-plus/src/types.js +0 -1
- package/components/templates-esri/index.css +0 -1
- package/components/templates-esri/index.js +0 -65
- package/components/templates-esri/src/ctx.js +0 -1
- package/components/templates-esri/src/index.css +0 -1
- package/components/templates-esri/src/types.js +0 -1
- package/components/templates-layout/index.js +0 -141
- package/components/templates-layout/src/ctx.js +0 -1
- package/components/templates-layout/src/index.css +0 -1
- package/components/templates-layout/src/types.js +0 -1
- package/components/templates-mapbox/index.css +0 -1
- package/components/templates-mapbox/index.js +0 -65
- package/components/templates-mapbox/src/ctx.js +0 -1
- package/components/templates-mapbox/src/index.css +0 -1
- package/components/templates-mapbox/src/types.js +0 -1
- package/components/upload/index.js +0 -565
- package/components/upload/src/ctx.js +0 -1
- package/components/upload/src/index.css +0 -1
- package/components/upload/src/types.js +0 -1
- package/components/upload-plus/src/api.js +0 -28
- package/components/upload-plus/src/const.js +0 -1
- package/components/upload-plus/src/ctx.js +0 -1
- package/components/upload-plus/src/index.css +0 -1
- package/components/upload-plus/src/types.js +0 -1
- package/components/van-cascader/src/ctx.js +0 -1
- package/components/van-cascader/src/index.css +0 -1
- package/components/van-cascader/src/types.js +0 -1
- package/components/var-datetime-picker/index.js +0 -299
- package/components/var-datetime-picker/src/const.js +0 -1
- package/components/var-datetime-picker/src/ctx.js +0 -1
- package/components/var-datetime-picker/src/index.css +0 -1
- package/components/var-datetime-picker/src/types.js +0 -1
- package/components/vditor/index.css +0 -1
- package/components/vditor/src/ctx.js +0 -1
- package/components/vditor/src/index.css +0 -1
- package/components/vditor/src/types.js +0 -1
- package/composables/index.css +0 -1
- package/composables/index.js +0 -1
- package/shared/const/index.css +0 -1
- package/shared/const/index.js +0 -1
- package/shared/element-plus/index.css +0 -1
- package/shared/element-plus/index.js +0 -1
- package/shared/form/index.css +0 -1
- package/shared/form/index.js +0 -1
- package/shared/helper/index.css +0 -1
- package/shared/helper/index.js +0 -1
- package/shared/index.css +0 -1
- package/shared/index.js +0 -1
- package/shared/infer-prop/index.css +0 -1
- package/shared/infer-prop/index.js +0 -1
- package/shared/progress-it/index.css +0 -1
- package/shared/progress-it/index.js +0 -1
- package/shared/rules/index.css +0 -1
- package/shared/rules/index.js +0 -1
- package/shared/types/form/index.css +0 -1
- package/shared/types/form/index.js +0 -1
- package/shared/types/index.css +0 -1
- package/shared/types/index.js +0 -1
- package/shared/types/source/index.css +0 -1
- package/shared/types/source/index.js +0 -1
- package/shared/types/source-manager/index.css +0 -1
- package/shared/types/source-manager/index.js +0 -1
- package/shared/upload/index.css +0 -1
- package/shared/upload/index.js +0 -1
- /package/{components/button/index.css → shared/types/form/index.mjs} +0 -0
- /package/{components/button/src/index.css → shared/types/index.mjs} +0 -0
- /package/{components/cascader/src/index.css → shared/types/source/index.mjs} +0 -0
- /package/{components/button/src/types.js → shared/types/source-manager/index.mjs} +0 -0
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, createVNode, normalizeClass, createCommentVNode, computed, shallowRef, ref, onMounted, nextTick, createElementBlock, mergeProps, toHandlers, withModifiers, renderSlot, resolveDynamicComponent, createElementVNode, withDirectives, vShow } from 'vue';
|
|
2
|
+
import { _VkfInputCtx, VkfInput } from '@vunk/form/components/input';
|
|
3
|
+
import { EMPTY_FEATURE_COLLECTION } from '@vumap/core/shared/static';
|
|
4
|
+
import { bindPropsFactory, onEmitsFactory } from '@vunk/core/shared/utils-vue';
|
|
5
|
+
import { ElButton, ElIcon, ElButtonGroup, ElUpload, ElDialog, ElMessage } from 'element-plus';
|
|
6
|
+
import { u as upload_default, e as edit_default, b as checked_default } from '../index2.mjs';
|
|
7
|
+
import { _ as _export_sfc } from '../_plugin-vue_export-helper.mjs';
|
|
8
|
+
import { VmMap } from '@vumap/core';
|
|
9
|
+
import { VmTdtLayers } from '@vumap/core/components/tdt-layers';
|
|
10
|
+
import { VmControlDraw } from '@vumap/core/components/control-draw';
|
|
11
|
+
import { Deferred } from '@vunk/core/shared/utils-promise';
|
|
12
|
+
import { t as toGeojson } from '../index3.mjs';
|
|
13
|
+
import { VkAsyncTeleport } from '@vunk/core';
|
|
14
|
+
import { VmControlDrawUi } from '@vumap/core/components/control-draw-ui';
|
|
15
|
+
|
|
16
|
+
const props = {
|
|
17
|
+
..._VkfInputCtx.props,
|
|
18
|
+
showMap: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false
|
|
21
|
+
},
|
|
22
|
+
dialogEdit: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: true
|
|
25
|
+
},
|
|
26
|
+
dialogEditFullscreen: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: true
|
|
29
|
+
},
|
|
30
|
+
dialogEditTitle: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: "\u7ED8\u5236\u56FE\u6591"
|
|
33
|
+
},
|
|
34
|
+
modelValue: {
|
|
35
|
+
type: Object,
|
|
36
|
+
default: () => EMPTY_FEATURE_COLLECTION
|
|
37
|
+
},
|
|
38
|
+
editControls: {
|
|
39
|
+
type: Array,
|
|
40
|
+
default: () => ["trash"]
|
|
41
|
+
},
|
|
42
|
+
editTypes: {
|
|
43
|
+
type: [Array, String],
|
|
44
|
+
default: () => "polygon"
|
|
45
|
+
},
|
|
46
|
+
multiple: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: true
|
|
49
|
+
},
|
|
50
|
+
mapTo: {
|
|
51
|
+
type: [Object, String],
|
|
52
|
+
default: void 0
|
|
53
|
+
},
|
|
54
|
+
mapCenter: {
|
|
55
|
+
type: [Object, Array],
|
|
56
|
+
default: [120, 30]
|
|
57
|
+
},
|
|
58
|
+
editStyles: {
|
|
59
|
+
type: Array,
|
|
60
|
+
default: () => []
|
|
61
|
+
},
|
|
62
|
+
slots: {
|
|
63
|
+
type: Object,
|
|
64
|
+
default: () => ({})
|
|
65
|
+
},
|
|
66
|
+
spikSave: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const createBindProps = bindPropsFactory(props);
|
|
72
|
+
const emits = {
|
|
73
|
+
..._VkfInputCtx.emits,
|
|
74
|
+
"update:modelValue": (e) => e,
|
|
75
|
+
"editUpdate": (e) => e
|
|
76
|
+
};
|
|
77
|
+
const createOnEmits = onEmitsFactory(emits);
|
|
78
|
+
|
|
79
|
+
var ctx = /*#__PURE__*/Object.freeze({
|
|
80
|
+
__proto__: null,
|
|
81
|
+
createBindProps: createBindProps,
|
|
82
|
+
createOnEmits: createOnEmits,
|
|
83
|
+
emits: emits,
|
|
84
|
+
props: props
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
var _sfc_main$1 = defineComponent({
|
|
88
|
+
components: {
|
|
89
|
+
ElButton,
|
|
90
|
+
ElIcon,
|
|
91
|
+
ElButtonGroup,
|
|
92
|
+
Upload: upload_default,
|
|
93
|
+
Edit: edit_default,
|
|
94
|
+
ElUpload
|
|
95
|
+
},
|
|
96
|
+
props: {
|
|
97
|
+
disabled: Boolean,
|
|
98
|
+
dialog: Boolean
|
|
99
|
+
},
|
|
100
|
+
emits: {
|
|
101
|
+
upload: (e) => e,
|
|
102
|
+
edit: null
|
|
103
|
+
},
|
|
104
|
+
methods: {
|
|
105
|
+
getFile(file) {
|
|
106
|
+
this.$emit("upload", file);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
112
|
+
const _component_Upload = resolveComponent("Upload");
|
|
113
|
+
const _component_ElIcon = resolveComponent("ElIcon");
|
|
114
|
+
const _component_ElUpload = resolveComponent("ElUpload");
|
|
115
|
+
const _component_ElButton = resolveComponent("ElButton");
|
|
116
|
+
const _component_Edit = resolveComponent("Edit");
|
|
117
|
+
const _component_ElButtonGroup = resolveComponent("ElButtonGroup");
|
|
118
|
+
return openBlock(), createBlock(_component_ElButtonGroup, null, {
|
|
119
|
+
default: withCtx(() => [
|
|
120
|
+
createVNode(_component_ElButton, { class: "vk-geoinput-upload-x" }, {
|
|
121
|
+
default: withCtx(() => [
|
|
122
|
+
createVNode(_component_ElUpload, {
|
|
123
|
+
class: normalizeClass("vk-geoinput-upload"),
|
|
124
|
+
action: "",
|
|
125
|
+
accept: "file",
|
|
126
|
+
multiple: false,
|
|
127
|
+
"show-file-list": false,
|
|
128
|
+
"auto-upload": false,
|
|
129
|
+
"on-change": _ctx.getFile,
|
|
130
|
+
disabled: _ctx.disabled
|
|
131
|
+
}, {
|
|
132
|
+
default: withCtx(() => [
|
|
133
|
+
createVNode(_component_ElIcon, { color: "var(--el-color-primary)" }, {
|
|
134
|
+
default: withCtx(() => [
|
|
135
|
+
createVNode(_component_Upload)
|
|
136
|
+
]),
|
|
137
|
+
_: 1
|
|
138
|
+
/* STABLE */
|
|
139
|
+
})
|
|
140
|
+
]),
|
|
141
|
+
_: 1
|
|
142
|
+
/* STABLE */
|
|
143
|
+
}, 8, ["on-change", "disabled"])
|
|
144
|
+
]),
|
|
145
|
+
_: 1
|
|
146
|
+
/* STABLE */
|
|
147
|
+
}),
|
|
148
|
+
_ctx.dialog ? (openBlock(), createBlock(_component_ElButton, {
|
|
149
|
+
key: 0,
|
|
150
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("edit")),
|
|
151
|
+
disabled: _ctx.disabled
|
|
152
|
+
}, {
|
|
153
|
+
default: withCtx(() => [
|
|
154
|
+
createVNode(_component_ElIcon, { color: "var(--el-color-primary)" }, {
|
|
155
|
+
default: withCtx(() => [
|
|
156
|
+
createVNode(_component_Edit)
|
|
157
|
+
]),
|
|
158
|
+
_: 1
|
|
159
|
+
/* STABLE */
|
|
160
|
+
})
|
|
161
|
+
]),
|
|
162
|
+
_: 1
|
|
163
|
+
/* STABLE */
|
|
164
|
+
}, 8, ["disabled"])) : createCommentVNode("v-if", true)
|
|
165
|
+
]),
|
|
166
|
+
_: 1
|
|
167
|
+
/* STABLE */
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
var AppendVue = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__file", "D:\\labCode\\vunk-form2\\packages\\components\\geoinput-update\\src\\append.vue"]]);
|
|
171
|
+
|
|
172
|
+
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
173
|
+
name: "VkfGeoinputUpdate",
|
|
174
|
+
components: {
|
|
175
|
+
VkfInput,
|
|
176
|
+
ElDialog,
|
|
177
|
+
VmMap,
|
|
178
|
+
VmTdtLayers,
|
|
179
|
+
VmControlDraw,
|
|
180
|
+
VkAsyncTeleport,
|
|
181
|
+
VmControlDrawUi,
|
|
182
|
+
ElIcon,
|
|
183
|
+
Checked: checked_default
|
|
184
|
+
},
|
|
185
|
+
emits,
|
|
186
|
+
props,
|
|
187
|
+
setup(props2, {
|
|
188
|
+
emit
|
|
189
|
+
}) {
|
|
190
|
+
const inputBindProps = _VkfInputCtx.createBindProps(props2, ["inputSlots", "readonly", "modelValue"]);
|
|
191
|
+
const inputOnEmits = _VkfInputCtx.createOnEmits(emit, ["update:modelValue"]);
|
|
192
|
+
const mapOptions = computed(() => {
|
|
193
|
+
return {
|
|
194
|
+
center: props2.mapCenter
|
|
195
|
+
};
|
|
196
|
+
});
|
|
197
|
+
const geoInputMapDialogNode = shallowRef();
|
|
198
|
+
const geoInputMapXNode = shallowRef();
|
|
199
|
+
const editPlayground = ref(geoInputMapXNode.value);
|
|
200
|
+
onMounted(() => {
|
|
201
|
+
editPlayground.value = geoInputMapXNode.value;
|
|
202
|
+
});
|
|
203
|
+
const mapTo = computed(() => {
|
|
204
|
+
return editPlayground.value === geoInputMapDialogNode.value ? geoInputMapDialogNode.value : props2.mapTo ?? editPlayground.value;
|
|
205
|
+
});
|
|
206
|
+
const mapControls = computed(() => {
|
|
207
|
+
return props2.readonly ? [] : typeof props2.editTypes === "string" ? [props2.editTypes, ...props2.editControls] : [...props2.editTypes, ...props2.editControls];
|
|
208
|
+
});
|
|
209
|
+
const currentDrawCacheValue = ref(props2.modelValue);
|
|
210
|
+
const currentDrawValue = computed(() => {
|
|
211
|
+
return props2.spikSave ? props2.modelValue : currentDrawCacheValue.value;
|
|
212
|
+
});
|
|
213
|
+
const setCurrentDrawValue = value => {
|
|
214
|
+
if (props2.spikSave) {
|
|
215
|
+
emit("update:modelValue", value);
|
|
216
|
+
} else {
|
|
217
|
+
currentDrawCacheValue.value = value;
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
const doSave = () => {
|
|
221
|
+
emit("update:modelValue", currentDrawCacheValue.value);
|
|
222
|
+
ElMessage({
|
|
223
|
+
message: "\u4FDD\u5B58\u6210\u529F",
|
|
224
|
+
type: "success"
|
|
225
|
+
});
|
|
226
|
+
dialogShow.value = false;
|
|
227
|
+
};
|
|
228
|
+
const dialogShow = ref(false);
|
|
229
|
+
const mapDef = new Deferred();
|
|
230
|
+
const dialogOnOpen = async () => {
|
|
231
|
+
await nextTick();
|
|
232
|
+
editPlayground.value = geoInputMapDialogNode.value;
|
|
233
|
+
await nextTick();
|
|
234
|
+
const map = await mapDef.promise;
|
|
235
|
+
currentDrawCacheValue.value = props2.modelValue;
|
|
236
|
+
map.resize();
|
|
237
|
+
};
|
|
238
|
+
const dialogOnClose = async () => {
|
|
239
|
+
editPlayground.value = geoInputMapXNode.value;
|
|
240
|
+
const map = await mapDef.promise;
|
|
241
|
+
map.resize();
|
|
242
|
+
};
|
|
243
|
+
const append = () => createVNode(AppendVue, {
|
|
244
|
+
"dialog": props2.dialogEdit,
|
|
245
|
+
"disabled": props2.disabled,
|
|
246
|
+
"onUpload": onUpload,
|
|
247
|
+
"onEdit": onEdit
|
|
248
|
+
}, null);
|
|
249
|
+
async function onUpload(e) {
|
|
250
|
+
if (!e.raw) return;
|
|
251
|
+
toGeojson(e.raw).then(res => {
|
|
252
|
+
emit("update:modelValue", res);
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
function onEdit() {
|
|
256
|
+
dialogShow.value = true;
|
|
257
|
+
}
|
|
258
|
+
return {
|
|
259
|
+
inputBindProps,
|
|
260
|
+
inputOnEmits,
|
|
261
|
+
append,
|
|
262
|
+
dialogShow,
|
|
263
|
+
mapDef,
|
|
264
|
+
dialogOnOpen,
|
|
265
|
+
dialogOnClose,
|
|
266
|
+
mapOptions,
|
|
267
|
+
geoInputMapDialogNode,
|
|
268
|
+
geoInputMapXNode,
|
|
269
|
+
mapTo,
|
|
270
|
+
mapControls,
|
|
271
|
+
doSave,
|
|
272
|
+
currentDrawValue,
|
|
273
|
+
setCurrentDrawValue
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
const _hoisted_1 = { class: "vkf-form-item" };
|
|
279
|
+
const _hoisted_2 = {
|
|
280
|
+
class: "geoinput-map-dialog",
|
|
281
|
+
ref: "geoInputMapDialogNode"
|
|
282
|
+
};
|
|
283
|
+
const _hoisted_3 = {
|
|
284
|
+
class: "geoinput-map-x",
|
|
285
|
+
ref: "geoInputMapXNode"
|
|
286
|
+
};
|
|
287
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
288
|
+
const _component_VkfInput = resolveComponent("VkfInput");
|
|
289
|
+
const _component_VmTdtLayers = resolveComponent("VmTdtLayers");
|
|
290
|
+
const _component_Checked = resolveComponent("Checked");
|
|
291
|
+
const _component_ElIcon = resolveComponent("ElIcon");
|
|
292
|
+
const _component_VmControlDrawUi = resolveComponent("VmControlDrawUi");
|
|
293
|
+
const _component_VmControlDraw = resolveComponent("VmControlDraw");
|
|
294
|
+
const _component_VmMap = resolveComponent("VmMap");
|
|
295
|
+
const _component_VkAsyncTeleport = resolveComponent("VkAsyncTeleport");
|
|
296
|
+
const _component_ElDialog = resolveComponent("ElDialog");
|
|
297
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
298
|
+
createVNode(_component_VkfInput, mergeProps({
|
|
299
|
+
readonly: true,
|
|
300
|
+
modelValue: JSON.stringify(_ctx.modelValue)
|
|
301
|
+
}, _ctx.inputBindProps, toHandlers(_ctx.inputOnEmits), {
|
|
302
|
+
inputSlots: _ctx.readonly ? {} : {
|
|
303
|
+
append: _ctx.append
|
|
304
|
+
}
|
|
305
|
+
}), null, 16, ["modelValue", "inputSlots"]),
|
|
306
|
+
createVNode(_component_VkAsyncTeleport, { to: _ctx.mapTo }, {
|
|
307
|
+
default: withCtx(() => [
|
|
308
|
+
createVNode(_component_VmMap, {
|
|
309
|
+
defaultOptions: _ctx.mapOptions,
|
|
310
|
+
class: "vk-geoinput-edit-map",
|
|
311
|
+
onLoad: _cache[1] || (_cache[1] = ($event) => _ctx.mapDef.resolve($event.map))
|
|
312
|
+
}, {
|
|
313
|
+
default: withCtx(() => [
|
|
314
|
+
createVNode(_component_VmTdtLayers),
|
|
315
|
+
createVNode(_component_VmControlDraw, {
|
|
316
|
+
styles: _ctx.editStyles,
|
|
317
|
+
modelValue: _ctx.currentDrawValue,
|
|
318
|
+
"onUpdate:modelValue": _ctx.setCurrentDrawValue,
|
|
319
|
+
onUpdate: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("editUpdate", $event)),
|
|
320
|
+
controls: _ctx.mapControls,
|
|
321
|
+
multiple: _ctx.multiple
|
|
322
|
+
}, {
|
|
323
|
+
default: withCtx(() => [
|
|
324
|
+
!_ctx.spikSave ? (openBlock(), createBlock(_component_VmControlDrawUi, {
|
|
325
|
+
key: 0,
|
|
326
|
+
onClick: withModifiers(_ctx.doSave, ["prevent"])
|
|
327
|
+
}, {
|
|
328
|
+
default: withCtx(() => [
|
|
329
|
+
createVNode(_component_ElIcon, null, {
|
|
330
|
+
default: withCtx(() => [
|
|
331
|
+
createVNode(_component_Checked)
|
|
332
|
+
]),
|
|
333
|
+
_: 1
|
|
334
|
+
/* STABLE */
|
|
335
|
+
})
|
|
336
|
+
]),
|
|
337
|
+
_: 1
|
|
338
|
+
/* STABLE */
|
|
339
|
+
}, 8, ["onClick"])) : createCommentVNode("v-if", true)
|
|
340
|
+
]),
|
|
341
|
+
_: 1
|
|
342
|
+
/* STABLE */
|
|
343
|
+
}, 8, ["styles", "modelValue", "onUpdate:modelValue", "controls", "multiple"]),
|
|
344
|
+
renderSlot(_ctx.$slots, "map"),
|
|
345
|
+
_ctx.slots.map ? (openBlock(), createBlock(resolveDynamicComponent(typeof _ctx.slots.map === "function" ? _ctx.slots.map() : _ctx.slots.map), { key: 0 })) : createCommentVNode("v-if", true)
|
|
346
|
+
]),
|
|
347
|
+
_: 3
|
|
348
|
+
/* FORWARDED */
|
|
349
|
+
}, 8, ["defaultOptions"])
|
|
350
|
+
]),
|
|
351
|
+
_: 3
|
|
352
|
+
/* FORWARDED */
|
|
353
|
+
}, 8, ["to"]),
|
|
354
|
+
createVNode(_component_ElDialog, {
|
|
355
|
+
modelValue: _ctx.dialogShow,
|
|
356
|
+
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => _ctx.dialogShow = $event),
|
|
357
|
+
title: _ctx.dialogEditTitle,
|
|
358
|
+
fullscreen: _ctx.dialogEditFullscreen,
|
|
359
|
+
modalClass: "vk-geoinput-edit-dialog-x",
|
|
360
|
+
appendToBody: true,
|
|
361
|
+
onOpen: _ctx.dialogOnOpen,
|
|
362
|
+
onClose: _ctx.dialogOnClose,
|
|
363
|
+
closeOnClickModal: false,
|
|
364
|
+
draggable: true
|
|
365
|
+
}, {
|
|
366
|
+
default: withCtx(() => [
|
|
367
|
+
createElementVNode(
|
|
368
|
+
"div",
|
|
369
|
+
_hoisted_2,
|
|
370
|
+
null,
|
|
371
|
+
512
|
|
372
|
+
/* NEED_PATCH */
|
|
373
|
+
)
|
|
374
|
+
]),
|
|
375
|
+
_: 1
|
|
376
|
+
/* STABLE */
|
|
377
|
+
}, 8, ["modelValue", "title", "fullscreen", "onOpen", "onClose"]),
|
|
378
|
+
withDirectives(createElementVNode(
|
|
379
|
+
"div",
|
|
380
|
+
_hoisted_3,
|
|
381
|
+
null,
|
|
382
|
+
512
|
|
383
|
+
/* NEED_PATCH */
|
|
384
|
+
), [
|
|
385
|
+
[vShow, _ctx.showMap]
|
|
386
|
+
])
|
|
387
|
+
]);
|
|
388
|
+
}
|
|
389
|
+
var VkfGeoinputUpdate = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "D:\\labCode\\vunk-form2\\packages\\components\\geoinput-update\\src\\index.vue"]]);
|
|
390
|
+
|
|
391
|
+
var types = /*#__PURE__*/Object.freeze({
|
|
392
|
+
__proto__: null
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
VkfGeoinputUpdate.install = (app) => {
|
|
396
|
+
app.component(VkfGeoinputUpdate.name, VkfGeoinputUpdate);
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
export { VkfGeoinputUpdate, ctx as _VkfGeoinputUpdateCtx, types as __VkfGeoinputUpdate, VkfGeoinputUpdate as default };
|